| 1 | AC_INIT(README.postgis) |
|---|
| 2 | AC_CONFIG_HEADER(config.h) |
|---|
| 3 | |
|---|
| 4 | dnl AC_ARG_ENABLE(autoconf, [ --enable-autoconf really use autoconf], |
|---|
| 5 | dnl AC_MSG_RESULT(Using autoconf), |
|---|
| 6 | dnl AC_MSG_ERROR([ |
|---|
| 7 | dnl |
|---|
| 8 | dnl Autoconf-based configuration is not widely tested. |
|---|
| 9 | dnl If you want to use it anyway specify --enable-autoconf. |
|---|
| 10 | dnl ]) |
|---|
| 11 | dnl ) |
|---|
| 12 | |
|---|
| 13 | dnl |
|---|
| 14 | dnl Compilers |
|---|
| 15 | dnl |
|---|
| 16 | AC_PROG_CC |
|---|
| 17 | AC_PROG_CXX |
|---|
| 18 | AC_PROG_LN_S |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | dnl |
|---|
| 22 | dnl iconv support (might fail in case of non-default iconv installation) |
|---|
| 23 | dnl |
|---|
| 24 | AC_SUBST(USE_ICONV) |
|---|
| 25 | AC_SUBST(ICONV_LDFLAGS) |
|---|
| 26 | ICONV_LDFLAGS= |
|---|
| 27 | USE_ICONV=1 |
|---|
| 28 | AC_ARG_WITH(iconv, |
|---|
| 29 | [ --without-iconv disable unicode support], |
|---|
| 30 | if test "$with_iconv" = "no"; then |
|---|
| 31 | USE_ICONV=0 |
|---|
| 32 | fi |
|---|
| 33 | ) |
|---|
| 34 | |
|---|
| 35 | if test "$USE_ICONV" = 1; then |
|---|
| 36 | AC_CHECK_LIB(iconv, iconv_open, |
|---|
| 37 | USE_ICONV=1 |
|---|
| 38 | ICONV_LDFLAGS=-liconv |
|---|
| 39 | , |
|---|
| 40 | AC_CHECK_LIB(iconv, libiconv_open, |
|---|
| 41 | USE_ICONV=1 |
|---|
| 42 | ICONV_LDFLAGS=-liconv |
|---|
| 43 | , |
|---|
| 44 | AC_CHECK_LIB(c, iconv_open, |
|---|
| 45 | USE_ICONV=1 |
|---|
| 46 | , |
|---|
| 47 | USE_ICONV=0 |
|---|
| 48 | ) |
|---|
| 49 | ) |
|---|
| 50 | ) |
|---|
| 51 | fi |
|---|
| 52 | |
|---|
| 53 | AC_CHECK_HEADERS(iconv.h) |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | dnl |
|---|
| 58 | dnl host operating system |
|---|
| 59 | dnl |
|---|
| 60 | AC_CANONICAL_HOST |
|---|
| 61 | |
|---|
| 62 | dnl |
|---|
| 63 | dnl Search for pg_config and setup pgsql stuff |
|---|
| 64 | dnl |
|---|
| 65 | AC_SUBST(PGCONFIG) |
|---|
| 66 | PGCONFIG= |
|---|
| 67 | AC_ARG_WITH(pgsql, |
|---|
| 68 | [ --with-pgsql[[=ARG]] build for a specific pgsql version |
|---|
| 69 | [[ARG=path to pg_config]]], |
|---|
| 70 | if test "$with_pgsql" != "no" -a "$with_pgsql" != "yes"; then |
|---|
| 71 | if test ! -f "$with_pgsql"; then |
|---|
| 72 | AC_MSG_ERROR([Invalid argument to --with-pgsql]); |
|---|
| 73 | fi |
|---|
| 74 | PGCONFIG="$with_pgsql" |
|---|
| 75 | fi |
|---|
| 76 | ) |
|---|
| 77 | if test -z "$PGCONFIG"; then |
|---|
| 78 | AC_PATH_PROG([PGCONFIG], [pg_config]) |
|---|
| 79 | fi |
|---|
| 80 | if test -z "$PGCONFIG"; then |
|---|
| 81 | AC_MSG_ERROR([PostgreSQL is required by PostGIS]); |
|---|
| 82 | fi |
|---|
| 83 | AC_SUBST(PGFEINCLUDES) |
|---|
| 84 | AC_SUBST(PGBEINCLUDES) |
|---|
| 85 | AC_SUBST(PGFELIBS) |
|---|
| 86 | AC_SUBST(PGBELIBS) |
|---|
| 87 | AC_SUBST(PGBIN) |
|---|
| 88 | AC_SUBST(PGTEMPLATE) |
|---|
| 89 | AC_SUBST(LPATH) |
|---|
| 90 | PGFEINCLUDES="-I"`${PGCONFIG} --includedir` |
|---|
| 91 | PGFELIBS="-L"`${PGCONFIG} --libdir`" -lpq " #(1)# `${PGCONFIG} --libs 2> /dev/null` |
|---|
| 92 | #(1)# |
|---|
| 93 | # We don't really want to link to more libs then required, see: |
|---|
| 94 | # http://postgis.refractions.net/pipermail/postgis-devel/2006-May/002124.html |
|---|
| 95 | PGBELIBS="-L"`${PGCONFIG} --libdir`" -lpostgres" |
|---|
| 96 | PGBEINCLUDES="-I"`${PGCONFIG} --includedir-server` |
|---|
| 97 | PGBIN=`${PGCONFIG} --bindir` |
|---|
| 98 | |
|---|
| 99 | dnl |
|---|
| 100 | dnl MingW requires use of pwd -W to give proper Windows (not MingW) paths |
|---|
| 101 | dnl for in-place regression tests |
|---|
| 102 | dnl |
|---|
| 103 | case $host_os in |
|---|
| 104 | *mingw*) |
|---|
| 105 | PWDREGRESS="pwd -W" |
|---|
| 106 | ;; |
|---|
| 107 | *) |
|---|
| 108 | PWDREGRESS="pwd" |
|---|
| 109 | ;; |
|---|
| 110 | esac |
|---|
| 111 | AC_SUBST(PWDREGRESS) |
|---|
| 112 | |
|---|
| 113 | dnl |
|---|
| 114 | dnl Test for GEOS |
|---|
| 115 | dnl |
|---|
| 116 | |
|---|
| 117 | AC_SUBST(USE_GEOS) |
|---|
| 118 | AC_SUBST(GEOS_DIR) |
|---|
| 119 | AC_SUBST(GEOS_LDFLAGS) |
|---|
| 120 | AC_SUBST(GEOS_VERNUM) |
|---|
| 121 | USE_GEOS=0 |
|---|
| 122 | GEOS_DIR= |
|---|
| 123 | GEOS_LDFLAGS= |
|---|
| 124 | GEOS_VERNUM=10 |
|---|
| 125 | |
|---|
| 126 | AC_PATH_PROG([GEOSCONFIG], [geos-config]) |
|---|
| 127 | if test -n "$GEOSCONFIG"; then |
|---|
| 128 | USE_GEOS=1 |
|---|
| 129 | fi |
|---|
| 130 | |
|---|
| 131 | AC_ARG_WITH(geos, |
|---|
| 132 | [ --with-geos[[=ARG]] enable spatial predicates and operators using GEOS |
|---|
| 133 | [[ARG=path to geos-config]]], |
|---|
| 134 | if test "$with_geos" = "no"; then |
|---|
| 135 | USE_GEOS=0 |
|---|
| 136 | else |
|---|
| 137 | if test "$with_geos" != "yes"; then |
|---|
| 138 | if test ! -f "$with_geos"; then |
|---|
| 139 | AC_MSG_ERROR([Invalid argument to --with-geos]); |
|---|
| 140 | else |
|---|
| 141 | GEOSCONFIG="$with_geos" |
|---|
| 142 | USE_GEOS=1 |
|---|
| 143 | AC_MSG_RESULT([Using specified geos-config file: $GEOSCONFIG]) |
|---|
| 144 | fi |
|---|
| 145 | fi |
|---|
| 146 | fi |
|---|
| 147 | ) |
|---|
| 148 | |
|---|
| 149 | if test $USE_GEOS -gt 0; then |
|---|
| 150 | |
|---|
| 151 | GEOS_DIR=`$GEOSCONFIG --prefix` |
|---|
| 152 | GEOS_LDFLAGS=`$GEOSCONFIG --ldflags 2> /dev/null` |
|---|
| 153 | |
|---|
| 154 | if test x"$GEOS_LDFLAGS" = "x"; then |
|---|
| 155 | # older geos-config versions did not |
|---|
| 156 | # support the --ldflags switch, we'll |
|---|
| 157 | # default to GEOS_DIR/lib in this case. |
|---|
| 158 | # |
|---|
| 159 | GEOS_LDFLAGS="-L${GEOS_DIR}/lib" |
|---|
| 160 | fi |
|---|
| 161 | |
|---|
| 162 | GEOS_MAJOR=`$GEOSCONFIG --version | cut -d. -f1` |
|---|
| 163 | GEOS_MINOR=`$GEOSCONFIG --version | cut -d. -f2` |
|---|
| 164 | GEOS_VERNUM=`expr $GEOS_MAJOR "*" 10` |
|---|
| 165 | GEOS_VERNUM=`expr $GEOS_VERNUM "+" $GEOS_MINOR` |
|---|
| 166 | |
|---|
| 167 | # GEOS >= 3.0.0 always has CAPI, however only GEOS >= 2.2.0 has CAPI support |
|---|
| 168 | # so abort if CAPI support is not available. |
|---|
| 169 | if test $GEOS_VERNUM -lt 22; then |
|---|
| 170 | AC_MSG_ERROR([PostGIS version >= 1.2.0 requires GEOS version >= 2.2.0]) |
|---|
| 171 | fi |
|---|
| 172 | |
|---|
| 173 | fi |
|---|
| 174 | |
|---|
| 175 | AC_SUBST(USE_PROJ) |
|---|
| 176 | AC_SUBST(PROJ_DIR) |
|---|
| 177 | AC_SUBST(PROJ_LIBDIR) |
|---|
| 178 | USE_PROJ=0 |
|---|
| 179 | PROJ_DIR= |
|---|
| 180 | PROJ_LIBDIR= |
|---|
| 181 | AC_PATH_PROG([PROJ], [proj]) |
|---|
| 182 | if test -n "$PROJ"; then |
|---|
| 183 | USE_PROJ=1 |
|---|
| 184 | PROJ_DIR=`dirname ${PROJ}`/.. |
|---|
| 185 | owd=`pwd`; cd ${PROJ_DIR}; PROJ_DIR=`pwd`; cd $owd; |
|---|
| 186 | fi |
|---|
| 187 | AC_ARG_WITH(proj, |
|---|
| 188 | [ --with-proj[[=DIR]] enable reprojection support], |
|---|
| 189 | if test "$with_proj" = "no"; then |
|---|
| 190 | USE_PROJ=0 |
|---|
| 191 | else |
|---|
| 192 | USE_PROJ=1 |
|---|
| 193 | if test "$with_proj" != "yes"; then |
|---|
| 194 | PROJ_DIR=$with_proj |
|---|
| 195 | fi |
|---|
| 196 | fi |
|---|
| 197 | ) |
|---|
| 198 | if test $USE_PROJ -gt 0; then |
|---|
| 199 | if test ! -f $PROJ_DIR/include/projects.h; then |
|---|
| 200 | AC_MSG_ERROR([Can't find proj dir.]); |
|---|
| 201 | fi |
|---|
| 202 | PROJ_LIBDIR=${PROJ_DIR}/lib |
|---|
| 203 | fi |
|---|
| 204 | |
|---|
| 205 | AC_ARG_WITH(proj-libdir, |
|---|
| 206 | [ --with-proj-libdir=PATH path to PROJ4 libdir], |
|---|
| 207 | [ |
|---|
| 208 | case "$with_proj_libdir" in |
|---|
| 209 | no|yes) |
|---|
| 210 | AC_MSG_ERROR([Invalid argument to --with-proj-libdir]) |
|---|
| 211 | ;; |
|---|
| 212 | *) |
|---|
| 213 | PROJ_LIBDIR=${with_proj_libdir} |
|---|
| 214 | ;; |
|---|
| 215 | esac |
|---|
| 216 | ], with_proj_libdir=no) |
|---|
| 217 | |
|---|
| 218 | AC_SUBST(USE_JTS) |
|---|
| 219 | AC_SUBST(JTS_INCLUDES) |
|---|
| 220 | AC_SUBST(JTS_LIBDIR) |
|---|
| 221 | USE_JTS=0 |
|---|
| 222 | JTS_INCLUDES= |
|---|
| 223 | JTS_INCLUDES= |
|---|
| 224 | AC_ARG_WITH(jts, |
|---|
| 225 | [ --with-jts[[=ARG]] use JTS for spatial predicates and operators |
|---|
| 226 | [[ARG=path to jts-config]]], |
|---|
| 227 | if test "$with_jts" != "no"; then |
|---|
| 228 | USE_JTS=1 |
|---|
| 229 | if test "$with_jts" != "yes"; then |
|---|
| 230 | if test ! -f "$with_jts"; then |
|---|
| 231 | AC_MSG_ERROR([Invalid argument to --with-jts]); |
|---|
| 232 | else |
|---|
| 233 | JTSCONFIG=$with_jts |
|---|
| 234 | fi |
|---|
| 235 | fi |
|---|
| 236 | fi |
|---|
| 237 | ) |
|---|
| 238 | if test $USE_JTS -gt 0; then |
|---|
| 239 | if test -z "$JTSCONFIG"; then |
|---|
| 240 | AC_PATH_PROG([JTSCONFIG], [jts-config]) |
|---|
| 241 | if test -z "$JTSCONFIG"; then |
|---|
| 242 | AC_MSG_ERROR([Can't find jts-config]); |
|---|
| 243 | fi |
|---|
| 244 | fi |
|---|
| 245 | JTS_INCLUDES=`$JTSCONFIG --includedir` |
|---|
| 246 | JTS_LIBDIR=`$JTSCONFIG --libdir` |
|---|
| 247 | fi |
|---|
| 248 | |
|---|
| 249 | dnl |
|---|
| 250 | dnl Search flex and yacc |
|---|
| 251 | dnl |
|---|
| 252 | AC_SUBST(FLEX) |
|---|
| 253 | AC_PATH_PROG([FLEX], [flex]) |
|---|
| 254 | if test -z "$FLEX"; then |
|---|
| 255 | AC_MSG_ERROR(Can't find 'flex'); |
|---|
| 256 | fi |
|---|
| 257 | |
|---|
| 258 | AC_SUBST(DLLWRAP) |
|---|
| 259 | AC_PATH_PROG([DLLWRAP], [dllwrap]) |
|---|
| 260 | AC_SUBST(DLLTOOL) |
|---|
| 261 | AC_PATH_PROG([DLLTOOL], [dlltool]) |
|---|
| 262 | |
|---|
| 263 | dnl AC_SUBST(YACC) |
|---|
| 264 | dnl AC_PATH_PROG([YACC], [yacc]) |
|---|
| 265 | AC_PROG_YACC |
|---|
| 266 | if test -z "$YACC"; then |
|---|
| 267 | AC_MSG_ERROR(Can't find 'yacc'); |
|---|
| 268 | fi |
|---|
| 269 | |
|---|
| 270 | dnl |
|---|
| 271 | dnl Find 'install' |
|---|
| 272 | dnl |
|---|
| 273 | dnl AC_PATH_PROG([INSTALL], [install]) |
|---|
| 274 | dnl if test -z "$INSTALL"; then |
|---|
| 275 | dnl AC_MSG_ERROR(Can't find 'install'); |
|---|
| 276 | dnl fi |
|---|
| 277 | AC_SUBST(INSTALL) |
|---|
| 278 | INSTALL=`pwd`"/install-sh" |
|---|
| 279 | |
|---|
| 280 | dnl |
|---|
| 281 | dnl Search perl |
|---|
| 282 | dnl |
|---|
| 283 | AC_SUBST(PERL) |
|---|
| 284 | AC_PATH_PROG([PERL], [perl]) |
|---|
| 285 | if test -z "$PERL"; then |
|---|
| 286 | AC_MSG_ERROR(Can't find 'perl'); |
|---|
| 287 | fi |
|---|
| 288 | |
|---|
| 289 | AC_SUBST(docdir) |
|---|
| 290 | docdir='${prefix}/share/doc' |
|---|
| 291 | AC_ARG_WITH(docdir, |
|---|
| 292 | [ --with-docdir=DIR install the documentation in DIR [[PREFIX/share/doc]]], |
|---|
| 293 | if test "$with_docdir" = "yes"; then |
|---|
| 294 | AC_MSG_ERROR([option --with-docdir requires an argument]) |
|---|
| 295 | fi |
|---|
| 296 | if test "$with_docdir" != "no"; then |
|---|
| 297 | docdir="$with_docdir" |
|---|
| 298 | fi |
|---|
| 299 | ) |
|---|
| 300 | |
|---|
| 301 | dnl |
|---|
| 302 | dnl Find 'html/docbook.xsl' |
|---|
| 303 | dnl |
|---|
| 304 | AC_SUBST(XSLBASE) |
|---|
| 305 | XSLBASE= |
|---|
| 306 | AC_ARG_WITH(xsl, |
|---|
| 307 | [ --with-xsl=DIR Specify the DIR containing html/docbook.xsl stylesheet], |
|---|
| 308 | if test "$with_xsl" = yes; then |
|---|
| 309 | AC_MSG_ERROR([option --with-xsl requires an argument]) |
|---|
| 310 | fi |
|---|
| 311 | if test "$with_xsl" != "no"; then |
|---|
| 312 | xsl="$with_xsl" |
|---|
| 313 | fi |
|---|
| 314 | , |
|---|
| 315 | SEARCHPATH=" |
|---|
| 316 | /usr/share/sgml/docbook/xsl-stylesheets |
|---|
| 317 | /usr/share/xml/docbook/stylesheet/nwalsh |
|---|
| 318 | /usr/share/sgml/docbook/stylesheet/xsl/nwalsh |
|---|
| 319 | /opt/local/share/xsl/docbook-xsl |
|---|
| 320 | /usr/local/share/xsl/docbook-xsl |
|---|
| 321 | /usr/share/xsl/docbook-xsl |
|---|
| 322 | " |
|---|
| 323 | for p in ${SEARCHPATH}; do |
|---|
| 324 | if test -r "${p}"/html/docbook.xsl; then |
|---|
| 325 | xsl="${p}" |
|---|
| 326 | break |
|---|
| 327 | fi |
|---|
| 328 | done |
|---|
| 329 | ) |
|---|
| 330 | XSLBASE="${xsl}" |
|---|
| 331 | |
|---|
| 332 | dnl |
|---|
| 333 | dnl Search for other binaries needed to build docs |
|---|
| 334 | dnl |
|---|
| 335 | AC_PATH_PROG([XSLTPROC], [xsltproc]) |
|---|
| 336 | AC_PATH_PROG([PDFXMLTEX], [pdfxmltex]) |
|---|
| 337 | AC_PATH_PROG([DB2PDF], [db2pdf]) |
|---|
| 338 | AC_PATH_PROG([JW], [jw]) |
|---|
| 339 | AC_SUBST(XSLTPROC) |
|---|
| 340 | AC_SUBST(PDFXMLTEX) |
|---|
| 341 | AC_SUBST(JW) |
|---|
| 342 | |
|---|
| 343 | DOC_RULE=requirements_not_met |
|---|
| 344 | if test -n "${XSLBASE}"; then |
|---|
| 345 | if test -n "${XSLTPROC}"; then |
|---|
| 346 | DOC_RULE=html/postgis.html |
|---|
| 347 | else |
|---|
| 348 | if test -n "${JW}"; then |
|---|
| 349 | DOC_RULE=jw |
|---|
| 350 | fi |
|---|
| 351 | fi |
|---|
| 352 | fi |
|---|
| 353 | AC_SUBST(DOC_RULE) |
|---|
| 354 | |
|---|
| 355 | |
|---|
| 356 | if test $USE_JTS -gt 0; then |
|---|
| 357 | dnl AC_MSG_RESULT([ GEOS disabled, using JTS.]) |
|---|
| 358 | USE_GEOS=0 |
|---|
| 359 | AC_DEFINE(USE_JTS) |
|---|
| 360 | fi |
|---|
| 361 | |
|---|
| 362 | if test $USE_GEOS -gt 0; then |
|---|
| 363 | AC_DEFINE(USE_GEOS) |
|---|
| 364 | fi |
|---|
| 365 | |
|---|
| 366 | # |
|---|
| 367 | # Extract PostgreSQL paths from pg_config |
|---|
| 368 | ## |
|---|
| 369 | |
|---|
| 370 | # |
|---|
| 371 | # Prefix (pg_prefix) |
|---|
| 372 | # |
|---|
| 373 | pg_prefix=/usr/local/pgsql |
|---|
| 374 | pg_eprefix= |
|---|
| 375 | pg_docdir= |
|---|
| 376 | pg_datadir= |
|---|
| 377 | pg_mandir= |
|---|
| 378 | pg_bindir="`${PGCONFIG} --bindir`" |
|---|
| 379 | pg_pkglibdir="`${PGCONFIG} --pkglibdir`" |
|---|
| 380 | for v in `${PGCONFIG} --configure`; do |
|---|
| 381 | strip=`echo $v | sed "s/'//g"` |
|---|
| 382 | var=`echo "$strip" | cut -d= -f1` |
|---|
| 383 | if test "$var" = "--prefix"; then |
|---|
| 384 | pg_prefix=`echo "$strip" | cut -d= -f2` |
|---|
| 385 | elif test "$var" = "--exec-prefix"; then |
|---|
| 386 | pg_eprefix=`echo "$strip" | cut -d= -f2` |
|---|
| 387 | elif test "$var" = "--docdir"; then |
|---|
| 388 | pg_docdir=`echo "$strip" | cut -d= -f2` |
|---|
| 389 | elif test "$var" = "--with-docdir"; then |
|---|
| 390 | pg_docdir=`echo "$strip" | cut -d= -f2` |
|---|
| 391 | elif test "$var" = "--datadir"; then |
|---|
| 392 | pg_datadir=`echo "$strip" | cut -d= -f2` |
|---|
| 393 | elif test "$var" = "--mandir"; then |
|---|
| 394 | pg_mandir=`echo "$strip" | cut -d= -f2` |
|---|
| 395 | elif test "$var" = "--with-template"; then |
|---|
| 396 | PGTEMPLATE=`echo "$strip" | cut -d= -f2` |
|---|
| 397 | fi |
|---|
| 398 | done |
|---|
| 399 | # |
|---|
| 400 | # We set these defaults after scan of |
|---|
| 401 | # pg_config --configure to safely expand pg_prefix |
|---|
| 402 | # We need expansion for the 'postgresq' path component |
|---|
| 403 | # addition below (default paths take from pg_config) |
|---|
| 404 | # |
|---|
| 405 | if test -z "$pg_eprefix"; then pg_eprefix=${pg_prefix}; fi |
|---|
| 406 | if test -z "$pg_docdir"; then pg_docdir=${pg_prefix}'/doc'; fi |
|---|
| 407 | if test -z "$pg_datadir"; then pg_datadir=${pg_prefix}'/share'; fi |
|---|
| 408 | if test -z "$pg_mandir"; then pg_mandir=${pg_prefix}'/man'; fi |
|---|
| 409 | |
|---|
| 410 | # Use old layout by default |
|---|
| 411 | use_new_layout=0 |
|---|
| 412 | |
|---|
| 413 | if test "$prefix" != 'NONE'; then |
|---|
| 414 | use_new_layout=1 |
|---|
| 415 | fi |
|---|
| 416 | |
|---|
| 417 | if test "${use_new_layout}" = "1"; then |
|---|
| 418 | LPATH=$libdir |
|---|
| 419 | else |
|---|
| 420 | |
|---|
| 421 | # |
|---|
| 422 | # Use old layout: everything under PGSQL paths |
|---|
| 423 | # Note: still allow override by user, this is |
|---|
| 424 | # done checking each variable against its |
|---|
| 425 | # default value, if it has a different |
|---|
| 426 | # value do not use PGSQL versions |
|---|
| 427 | # |
|---|
| 428 | |
|---|
| 429 | if test "$prefix" = 'NONE'; then |
|---|
| 430 | prefix=${pg_prefix} |
|---|
| 431 | fi |
|---|
| 432 | |
|---|
| 433 | if test "$docdir" = '${prefix}/share/doc'; then |
|---|
| 434 | docdir=${pg_docdir} |
|---|
| 435 | # |
|---|
| 436 | # If docdir contains no 'pgsql' or 'postgres' |
|---|
| 437 | # add the suffix. This is derived from |
|---|
| 438 | # PGSQL_SRC/src/Makefile.global |
|---|
| 439 | # |
|---|
| 440 | if expr "${docdir}" : ".*/pgsql" > /dev/null ; then :; else |
|---|
| 441 | if expr "${docdir}" : ".*/postgres" > /dev/null ; then :; else |
|---|
| 442 | docdir=${docdir}"/postgresql" |
|---|
| 443 | fi |
|---|
| 444 | fi |
|---|
| 445 | # Add the "contrib" part |
|---|
| 446 | docdir=${docdir}"/contrib" |
|---|
| 447 | fi |
|---|
| 448 | |
|---|
| 449 | if test "$datadir" = '${prefix}/share'; then |
|---|
| 450 | datadir=${pg_datadir} |
|---|
| 451 | # |
|---|
| 452 | # If datadir contains no 'pgsql' or 'postgres' |
|---|
| 453 | # add the suffix. This is derived from |
|---|
| 454 | # PGSQL_SRC/src/Makefile.global |
|---|
| 455 | # |
|---|
| 456 | if expr "${datadir}" : ".*/pgsql" > /dev/null ; then :; else |
|---|
| 457 | if expr "${datadir}" : ".*/postgres" > /dev/null ; then :; else |
|---|
| 458 | datadir=${datadir}"/postgresql" |
|---|
| 459 | fi |
|---|
| 460 | fi |
|---|
| 461 | # Add the "contrib" part |
|---|
| 462 | datadir=${datadir}"/contrib" |
|---|
| 463 | fi |
|---|
| 464 | |
|---|
| 465 | if test "$mandir" = '${prefix}/man'; then |
|---|
| 466 | mandir=${pg_mandir} |
|---|
| 467 | fi |
|---|
| 468 | |
|---|
| 469 | if test "$bindir" = '${exec_prefix}/bin'; then |
|---|
| 470 | bindir=${pg_bindir} |
|---|
| 471 | fi |
|---|
| 472 | |
|---|
| 473 | if test "$libdir" = '${exec_prefix}/lib'; then |
|---|
| 474 | libdir=${pg_pkglibdir} |
|---|
| 475 | LPATH='\$$libdir' |
|---|
| 476 | else |
|---|
| 477 | LPATH=$libdir |
|---|
| 478 | fi |
|---|
| 479 | fi |
|---|
| 480 | |
|---|
| 481 | # --with-template parsing is done in the single |
|---|
| 482 | # pg_config --configure scan above |
|---|
| 483 | AC_MSG_CHECKING([which template to use]) |
|---|
| 484 | template=$PGTEMPLATE |
|---|
| 485 | |
|---|
| 486 | case $host_os in |
|---|
| 487 | aix*) template=aix ;; |
|---|
| 488 | beos*) template=beos ;; |
|---|
| 489 | bsdi*) template=bsdi ;; |
|---|
| 490 | cygwin*) template=cygwin ;; |
|---|
| 491 | darwin*) template=darwin ;; |
|---|
| 492 | dgux*) template=dgux ;; |
|---|
| 493 | freebsd*) template=freebsd ;; |
|---|
| 494 | hpux*) template=hpux ;; |
|---|
| 495 | irix*) template=irix ;; |
|---|
| 496 | linux*|gnu*|k*bsd*-gnu) |
|---|
| 497 | template=linux ;; |
|---|
| 498 | mingw*) template=win32 ;; |
|---|
| 499 | netbsd*) template=netbsd ;; |
|---|
| 500 | nextstep*) template=nextstep ;; |
|---|
| 501 | openbsd*) template=openbsd ;; |
|---|
| 502 | osf*) template=osf ;; |
|---|
| 503 | qnx*) template=qnx4 ;; |
|---|
| 504 | sco*) template=sco ;; |
|---|
| 505 | solaris*) template=solaris ;; |
|---|
| 506 | sunos*) template=sunos4 ;; |
|---|
| 507 | sysv4.2*) |
|---|
| 508 | case $host_vendor in |
|---|
| 509 | univel) template=univel ;; |
|---|
| 510 | esac ;; |
|---|
| 511 | sysv4*) template=svr4 ;; |
|---|
| 512 | sysv5*) template=unixware ;; |
|---|
| 513 | ultrix*) template=ultrix4 ;; |
|---|
| 514 | esac |
|---|
| 515 | |
|---|
| 516 | if test x"$template" = x"" ; then |
|---|
| 517 | AC_MSG_ERROR([[ |
|---|
| 518 | ******************************************************************* |
|---|
| 519 | PostgreSQL has apparently not been ported to your platform yet. |
|---|
| 520 | To try a manual configuration, look into the src/template directory |
|---|
| 521 | for a similar platform and use the '--with-template=' option. |
|---|
| 522 | |
|---|
| 523 | Please also contact <pgsql-ports@postgresql.org> to see about |
|---|
| 524 | rectifying this. Include the above 'checking host system type...' |
|---|
| 525 | line. |
|---|
| 526 | ******************************************************************* |
|---|
| 527 | ]]) |
|---|
| 528 | fi |
|---|
| 529 | |
|---|
| 530 | AC_MSG_RESULT([$template]) |
|---|
| 531 | |
|---|
| 532 | PORTNAME=$template |
|---|
| 533 | AC_SUBST(PORTNAME) |
|---|
| 534 | |
|---|
| 535 | |
|---|
| 536 | # |
|---|
| 537 | # OS-specific settings |
|---|
| 538 | # |
|---|
| 539 | AC_SUBST(DLSUFFIX) |
|---|
| 540 | AC_SUBST(DLFLAGS) |
|---|
| 541 | AC_SUBST(EXE) |
|---|
| 542 | AC_SUBST(HOST_OS) |
|---|
| 543 | |
|---|
| 544 | # host_os is defined by AC_CANONICAL_HOST |
|---|
| 545 | HOST_OS=$host_os |
|---|
| 546 | DLSUFFIX=.so |
|---|
| 547 | DLFLAGS=-shared |
|---|
| 548 | EXE= |
|---|
| 549 | case $host_os in |
|---|
| 550 | *mingw*) |
|---|
| 551 | PGBEINCLUDES="$PGBEINCLUDES $PGBEINCLUDES/port/win32" |
|---|
| 552 | DLSUFFIX=.dll |
|---|
| 553 | DLFLAGS='${PGBELIBS}' |
|---|
| 554 | EXE=.exe |
|---|
| 555 | ;; |
|---|
| 556 | *darwin*) |
|---|
| 557 | DLFLAGS="-no-cpp-precomp -flat_namespace -undefined suppress -multiply_defined suppress" |
|---|
| 558 | ;; |
|---|
| 559 | esac |
|---|
| 560 | |
|---|
| 561 | # Assume system is ELF if it predefines __ELF__ as 1, |
|---|
| 562 | # otherwise believe host_os based default. |
|---|
| 563 | case $host_os in |
|---|
| 564 | freebsd1*|freebsd2*) elf=no;; |
|---|
| 565 | freebsd3*|freebsd4*) elf=yes;; |
|---|
| 566 | esac |
|---|
| 567 | |
|---|
| 568 | AC_EGREP_CPP(yes, |
|---|
| 569 | [#if __ELF__ |
|---|
| 570 | yes |
|---|
| 571 | #endif |
|---|
| 572 | ], |
|---|
| 573 | [ELF_SYS=true], |
|---|
| 574 | [if test "X$elf" = "Xyes" ; then |
|---|
| 575 | ELF_SYS=true |
|---|
| 576 | else |
|---|
| 577 | ELF_SYS= |
|---|
| 578 | fi]) |
|---|
| 579 | AC_SUBST(ELF_SYS) |
|---|
| 580 | |
|---|
| 581 | |
|---|
| 582 | |
|---|
| 583 | AC_OUTPUT(Makefile.config) |
|---|
| 584 | |
|---|
| 585 | AC_MSG_RESULT([ ]) |
|---|
| 586 | AC_MSG_RESULT([ SUMMARY]) |
|---|
| 587 | AC_MSG_RESULT([ -------------------------------------------------------]) |
|---|
| 588 | AC_MSG_RESULT([ ]) |
|---|
| 589 | AC_MSG_RESULT([ HOST_OS: $host_os]) |
|---|
| 590 | AC_MSG_RESULT([ ]) |
|---|
| 591 | AC_MSG_RESULT([ PGSQL: $PGCONFIG]) |
|---|
| 592 | |
|---|
| 593 | if test $USE_JTS -gt 0; then |
|---|
| 594 | AC_MSG_RESULT([ JTS: includedir=$JTS_INCLUDES libdir=$JTS_LIBDIR]) |
|---|
| 595 | fi |
|---|
| 596 | |
|---|
| 597 | # GEOS CAPI information |
|---|
| 598 | if test $USE_GEOS -gt 0; then |
|---|
| 599 | AC_MSG_RESULT([ GEOS: $GEOSCONFIG (with C-API)]) |
|---|
| 600 | AC_MSG_RESULT([ (ldflags: $GEOS_LDFLAGS)]) |
|---|
| 601 | fi |
|---|
| 602 | |
|---|
| 603 | # PROJ.4 information |
|---|
| 604 | if test $USE_PROJ -gt 0; then |
|---|
| 605 | AC_MSG_RESULT([ PROJ: prefix=$PROJ_DIR libdir=$PROJ_LIBDIR]) |
|---|
| 606 | fi |
|---|
| 607 | |
|---|
| 608 | AC_MSG_RESULT([ ICONV: $USE_ICONV $ICONV_LDFLAGS]) |
|---|
| 609 | dnl AC_MSG_RESULT([ FLEX: path=$FLEX]) |
|---|
| 610 | dnl AC_MSG_RESULT([ YACC: path=$YACC]) |
|---|
| 611 | |
|---|
| 612 | AC_MSG_RESULT([ ]) |
|---|
| 613 | AC_MSG_RESULT([ PORTNAME: $PORTNAME]) |
|---|
| 614 | AC_MSG_RESULT([ PREFIX: $prefix]) |
|---|
| 615 | AC_MSG_RESULT([ EPREFIX: $exec_prefix]) |
|---|
| 616 | AC_MSG_RESULT([ DOC: $docdir]) |
|---|
| 617 | AC_MSG_RESULT([ DATA: $datadir]) |
|---|
| 618 | AC_MSG_RESULT([ MAN: $mandir]) |
|---|
| 619 | AC_MSG_RESULT([ BIN: $bindir]) |
|---|
| 620 | if test "$MODULE_INSTALLDIR" = "$LPATH"; then |
|---|
| 621 | AC_MSG_RESULT([ EXT: $libdir]) |
|---|
| 622 | else |
|---|
| 623 | AC_MSG_RESULT([ EXT: $libdir ($LPATH)]) |
|---|
| 624 | fi |
|---|
| 625 | |
|---|
| 626 | AC_MSG_RESULT([ -------------------------------------------------------]) |
|---|
| 627 | AC_MSG_RESULT([ ]) |
|---|