Annotation of pgsql/configure.in, revision 1.103
1.1 petere 1: dnl Process this file with autoconf to produce a configure script.
1.28 petere 2:
3: dnl Developers, please strive to achieve this order:
4: dnl
5: dnl 0. Initialization and options processing
6: dnl 1. Programs
7: dnl 2. Libraries
8: dnl 3. Header files
9: dnl 4. Types
10: dnl 5. Structures
11: dnl 6. Compiler characteristics
12: dnl 7. Functions, global variables
13: dnl 8. System services
14: dnl
15: dnl Read the Autoconf manual for details.
16:
1.32 petere 17: dnl The GNU folks apparently haven't heard that some people don't use
18: dnl Texinfo. Use this sorcery to use "docdir" instead of "infodir".
19: define([info], [doc])
20: define([infodir], [docdir])
1.1 petere 21: AC_INIT(src/backend/access/common/heaptuple.c)
1.32 petere 22: undefine([infodir])
23: undefine([info])
24:
1.1 petere 25: AC_PREFIX_DEFAULT(/usr/local/pgsql)
26: AC_CONFIG_HEADER(src/include/config.h)
27:
28: AC_PREREQ(2.13)
1.28 petere 29: AC_CONFIG_AUX_DIR(config)
1.5 petere 30:
1.101 scrappy 31: VERSION='7.1beta5'
1.24 petere 32: AC_SUBST(VERSION)
33: AC_DEFINE_UNQUOTED(PG_VERSION, "$VERSION")
34:
1.80 petere 35: unset CDPATH
1.61 petere 36: abs_top_srcdir=`cd $srcdir && pwd`
37: AC_SUBST(abs_top_srcdir)
38: abs_top_builddir=`pwd`
39: AC_SUBST(abs_top_builddir)
40:
1.1 petere 41: AC_CANONICAL_HOST
1.45 petere 42: AC_SUBST(host)
43: AC_SUBST(host_cpu)
44: AC_SUBST(host_os)
1.1 petere 45:
1.30 petere 46: template=
47: AC_MSG_CHECKING([which template to use])
48:
1.42 petere 49: PGAC_ARG_REQ(with, template, [],
50: [
51: case $withval in
1.30 petere 52: list) echo; ls "$srcdir/src/template"; exit;;
53: *) if test -f "$srcdir/src/template/$with_template" ; then
1.42 petere 54: template=$withval
1.30 petere 55: else
1.80 petere 56: AC_MSG_ERROR(['$withval' is not a valid template name. Use 'list' for a list.])
1.30 petere 57: fi;;
58: esac
1.42 petere 59: ],
60: [
61: # --with-template not given
1.30 petere 62:
63: case $host_os in
64: aix*) template=aix ;;
1.54 momjian 65: beos*) template=beos ;;
1.30 petere 66: bsdi*) template=bsdi ;;
67: cygwin*) template=win ;;
1.72 petere 68: darwin*) template=darwin ;;
1.30 petere 69: dgux*) template=dgux ;;
70: freebsd*) template=freebsd ;;
71: hpux*) template=hpux ;;
72: irix*) template=irix5 ;;
73: linux*) template=linux ;;
74: netbsd*) template=netbsd ;;
75: nextstep*) template=nextstep ;;
76: openbsd*) template=openbsd ;;
77: osf*) template=osf ;;
78: qnx*) template=qnx4 ;;
79: sco*) template=sco ;;
1.58 petere 80: solaris*) template=solaris ;;
1.30 petere 81: sunos*) template=sunos4 ;;
1.1 petere 82: sysv4.2*)
1.30 petere 83: case $host_vendor in
84: univel) template=univel ;;
85: esac ;;
86: sysv4*) template=svr4 ;;
87: sysv5uw*) template=unixware ;;
88: ultrix*) template=ultrix4 ;;
1.1 petere 89: esac
90:
1.30 petere 91: if test x"$template" = x"" ; then
1.80 petere 92: AC_MSG_ERROR([[
1.30 petere 93: *******************************************************************
94: PostgreSQL has apparently not been ported to your platform yet.
1.32 petere 95: To try a manual configuration, look into the src/template directory
1.80 petere 96: for a similar platform and use the '--with-template=' option.
1.30 petere 97:
98: Please also contact <[email protected]> to see about
1.80 petere 99: rectifying this. Include the above 'checking host system type...'
1.30 petere 100: line.
101: *******************************************************************
1.80 petere 102: ]])
1.30 petere 103: fi
104:
1.42 petere 105: ])
1.1 petere 106:
1.30 petere 107: AC_MSG_RESULT([$template])
1.1 petere 108:
1.30 petere 109: PORTNAME=$template
110: AC_SUBST(PORTNAME)
1.1 petere 111:
1.30 petere 112: AC_LINK_FILES([src/backend/port/dynloader/${template}.c], [src/backend/port/dynloader.c])
113: AC_LINK_FILES([src/backend/port/dynloader/${template}.h], [src/include/dynloader.h])
114: AC_LINK_FILES([src/include/port/${template}.h], [src/include/os.h])
115: AC_LINK_FILES([src/makefiles/Makefile.${template}], [src/Makefile.port])
116:
1.58 petere 117: # Pick right test-and-set (TAS) code. Most platforms have inline
118: # assembler code in src/include/storage/s_lock.h, so we just use
119: # a dummy file here.
120: case $host in
121: *-*-hpux*) need_tas=yes; tas_file=hpux.s ;;
122: sparc-*-solaris*) need_tas=yes; tas_file=solaris_sparc.s ;;
123: i?86-*-solaris) need_tas=yes; tas_file=solaris_i386.s ;;
1.63 petere 124: *) need_tas=no; tas_file=dummy.s ;;
1.30 petere 125: esac
1.63 petere 126: AC_LINK_FILES([src/backend/port/tas/${tas_file}], [src/backend/port/tas.s])
1.1 petere 127:
1.30 petere 128: if test "$need_tas" = yes ; then
129: TAS=tas.o
1.1 petere 130: fi
1.30 petere 131: AC_SUBST(TAS)
1.1 petere 132:
133:
134:
1.30 petere 135: ##
136: ## Command line options
137: ##
1.13 petere 138:
1.1 petere 139:
1.30 petere 140: #
141: # Add non-standard directories to the include path
142: #
1.42 petere 143: PGAC_ARG_REQ(with, includes, [ --with-includes=DIRS look for additional header files in DIRS])
1.1 petere 144:
145:
1.30 petere 146: #
147: # Add non-standard directories to the library search path
148: #
1.42 petere 149: PGAC_ARG_REQ(with, libraries, [ --with-libraries=DIRS look for additional libraries in DIRS],
150: [LIBRARY_DIRS=$withval])
1.1 petere 151:
1.42 petere 152: PGAC_ARG_REQ(with, libs, [ --with-libs=DIRS alternative spelling of --with-libraries],
153: [LIBRARY_DIRS=$withval])
1.29 petere 154:
155:
156: #
157: # Locale (--enable-locale)
158: #
159: AC_MSG_CHECKING([whether to build with locale support])
1.42 petere 160: PGAC_ARG_BOOL(enable, locale, no, [ --enable-locale enable locale support],
161: [AC_DEFINE([USE_LOCALE], 1,
162: [Set to 1 if you want LOCALE support (--enable-locale)])])
1.29 petere 163: AC_MSG_RESULT([$enable_locale])
1.2 petere 164:
1.1 petere 165:
1.29 petere 166: #
1.42 petere 167: # Character set recode (--enable-recode)
1.29 petere 168: #
1.42 petere 169: AC_MSG_CHECKING([whether to build with recode support])
170: PGAC_ARG_BOOL(enable, recode, no, [ --enable-recode enable character set recode support],
171: [AC_DEFINE([CYR_RECODE], 1,
172: [Set to 1 if you want cyrillic recode support (--enable-recode)])])
1.29 petere 173: AC_MSG_RESULT([$enable_recode])
1.1 petere 174:
175:
1.29 petere 176: #
177: # Multibyte support
178: #
179: MULTIBYTE=
180: AC_MSG_CHECKING([whether to build with multibyte character support])
1.42 petere 181:
182: PGAC_ARG_OPTARG(enable, multibyte, [ --enable-multibyte enable multibyte character support],
183: [MULTIBYTE=SQL_ASCII],
1.29 petere 184: [
185: case $enableval in
186: SQL_ASCII|EUC_JP|EUC_CN|EUC_KR|EUC_TW|UNICODE|MULE_INTERNAL|LATIN1|LATIN2|LATIN3|LATIN4|LATIN5|KOI8|WIN|ALT)
1.42 petere 187: MULTIBYTE=$enableval;;
188: *)
189: AC_MSG_ERROR(
1.29 petere 190: [argument to --enable-multibyte must be one of:
1.1 petere 191: SQL_ASCII, EUC_JP, EUC_CN, EUC_KR, EUC_TW,
192: UNICODE, MULE_INTERNAL,
193: LATIN1, LATIN2, LATIN3, LATIN4, LATIN5,
194: KOI8, WIN, ALT
1.42 petere 195: Or do not specify an argument to the option to use the default.]);;
1.29 petere 196: esac
197: ],
1.42 petere 198: [
199: AC_DEFINE(MULTIBYTE, 1, [Set to 1 if you want to use multibyte characters (--enable-multibyte)])
200: AC_MSG_RESULT([yes, default $MULTIBYTE])
201: ],
202: [AC_MSG_RESULT(no)])
1.29 petere 203:
204: AC_SUBST(MULTIBYTE)
1.1 petere 205:
1.70 ishii 206: #
1.77 petere 207: # Unicode conversion (--enable-unicode-conversion)
1.70 ishii 208: #
209: AC_MSG_CHECKING([whether to build with Unicode conversion support])
1.77 petere 210: PGAC_ARG_BOOL(enable, unicode-conversion, no,
211: [ --enable-unicode-conversion enable unicode conversion support],
212: [if test -z "$MULTIBYTE"; then
213: AC_MSG_ERROR([--enable-unicode-conversion only works with --enable-multibyte])
214: fi
215: AC_DEFINE([UNICODE_CONVERSION], 1,
216: [Set to 1 if you want Unicode conversion support (--enable-unicode-conversion)])])
217: AC_MSG_RESULT([$enable_unicode_conversion])
1.1 petere 218:
1.29 petere 219: #
220: # Default port number (--with-pgport), default 5432
221: #
222: AC_MSG_CHECKING([for default port number])
1.42 petere 223: PGAC_ARG_REQ(with, pgport, [ --with-pgport=PORTNUM change default port number [5432]],
224: [default_port=$withval],
225: [default_port=5432])
1.97 tgl 226: AC_MSG_RESULT([$default_port])
227: # Need both of these because some places want an integer and some a string
1.1 petere 228: AC_DEFINE_UNQUOTED(DEF_PGPORT, ${default_port})
229: AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}")
1.97 tgl 230: AC_SUBST(default_port)
1.1 petere 231:
1.29 petere 232: #
233: # Maximum number of allowed connections (--with-maxbackends), default 32
234: #
235: AC_MSG_CHECKING([for default soft limit on number of connections])
1.42 petere 236: PGAC_ARG_REQ(with, maxbackends, [ --with-maxbackends=N set default maximum number of connections [32]],
237: [],
238: [with_maxbackends=32])
1.29 petere 239: AC_MSG_RESULT([$with_maxbackends])
1.42 petere 240: AC_DEFINE_UNQUOTED([DEF_MAXBACKENDS], [$with_maxbackends],
241: [The default soft limit on the number of concurrent connections, i.e., the default for the postmaster -N switch (--with-maxbackends)])
1.29 petere 242:
1.1 petere 243:
1.29 petere 244: #
1.65 petere 245: # Option to disable shared libraries
246: #
247: PGAC_ARG_BOOL(enable, shared, yes,
1.68 petere 248: [ --disable-shared do not build shared libraries])
1.65 petere 249: AC_SUBST(enable_shared)
250:
1.69 petere 251: #
252: # '-rpath'-like feature can be disabled
253: #
254: PGAC_ARG_BOOL(enable, rpath, yes,
255: [ --disable-rpath do not embed shared library search path in executables])
256: AC_SUBST(enable_rpath)
257:
1.65 petere 258:
259: #
1.74 petere 260: # --enable-debug adds -g to compiler flags
261: #
262: PGAC_ARG_BOOL(enable, debug, no,
263: [ --enable-debug build with debugging symbols (-g)])
264:
265:
266: #
1.30 petere 267: # C compiler
268: #
269:
1.29 petere 270: # For historical reasons you can also use --with-CC to specify the C compiler
271: # to use, although the standard way to do this is to set the CC environment
272: # variable.
1.42 petere 273: PGAC_ARG_REQ(with, CC, [], [CC=$with_CC])
1.4 tgl 274:
1.30 petere 275: # On AIX, default compiler to xlc.
276: if test "$template" = aix && test -z "$CC" ; then CC=xlc; fi
1.4 tgl 277:
1.74 petere 278: # Save CFLAGS from the environment
279: has_environ_CFLAGS="${CFLAGS+yes}"
280: save_CFLAGS=$CFLAGS
281:
1.4 tgl 282: AC_PROG_CC
1.30 petere 283: # Read the template
284: . "$srcdir/src/template/$template" || exit
1.74 petere 285:
286: if test "$has_environ_CFLAGS" = yes; then
287: CFLAGS=$save_CFLAGS
288: fi
289: if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
290: CFLAGS="$CFLAGS -g"
291: fi
1.30 petere 292: echo "using CFLAGS=$CFLAGS"
293: # Check if the compiler still works with the template settings
294: AC_PROG_CC_WORKS
1.44 petere 295: AC_EXEEXT
1.4 tgl 296: AC_PROG_CPP
297: AC_PROG_GCC_TRADITIONAL
1.6 petere 298: AC_SUBST(GCC)
1.4 tgl 299:
1.29 petere 300: # Create compiler version string
1.24 petere 301: if test x"$GCC" = x"yes" ; then
302: cc_string="GCC `${CC} --version`"
1.4 tgl 303: else
1.24 petere 304: cc_string=$CC
1.4 tgl 305: fi
1.24 petere 306: AC_DEFINE_UNQUOTED(PG_VERSION_STR, ["PostgreSQL $VERSION on $host, compiled by $cc_string"], [A canonical string containing the version number, platform, and C compiler])
307:
1.4 tgl 308:
1.31 petere 309: #
310: # Automatic dependency tracking
311: #
1.42 petere 312: PGAC_ARG_BOOL(enable, depend, no, [ --enable-depend turn on automatic dependency tracking],
313: [autodepend=yes])
1.31 petere 314: AC_SUBST(autodepend)
315:
316:
1.42 petere 317: #
318: # Enable assert checks
319: #
320: PGAC_ARG_BOOL(enable, cassert, no, [ --enable-cassert enable assertion checks (for debugging)],
321: [AC_DEFINE([USE_ASSERT_CHECKING], 1,
322: [Define to 1 to build with assertion checks])])
1.30 petere 323:
324:
325: #
326: # Include directories
327: #
328: ac_save_IFS=$IFS
1.80 petere 329: IFS="${IFS}:"
1.30 petere 330: # SRCH_INC comes from the template file
331: for dir in $with_includes $SRCH_INC; do
332: if test -d "$dir"; then
333: INCLUDES="$INCLUDES -I$dir"
334: else
335: AC_MSG_WARN([*** Include directory $dir does not exist.])
336: fi
337: done
338: IFS=$ac_save_IFS
339: AC_SUBST(INCLUDES)
340:
341:
342: #
343: # Library directories
344: #
345: ac_save_IFS=$IFS
1.80 petere 346: IFS="${IFS}:"
1.30 petere 347: # LIBRARY_DIRS comes from command line, SRCH_LIB from template file.
348: for dir in $LIBRARY_DIRS $SRCH_LIB; do
349: if test -d "$dir"; then
1.68 petere 350: LIBDIRS="$LIBDIRS -L$dir"
1.30 petere 351: else
352: AC_MSG_WARN([*** Library directory $dir does not exist.])
353: fi
354: done
355: IFS=$ac_save_IFS
356:
357:
1.43 petere 358: #
359: # Tcl/Tk
360: #
361: AC_MSG_CHECKING([whether to build with Tcl])
362: PGAC_ARG_BOOL(with, tcl, no, [ --with-tcl build Tcl and Tk interfaces])
363: AC_MSG_RESULT([$with_tcl])
364: AC_SUBST([with_tcl])
365:
366: # If Tcl is enabled (above) then Tk is also, unless the user disables it using --without-tk
367: AC_MSG_CHECKING([whether to build with Tk])
368: if test "$with_tcl" = yes; then
369: PGAC_ARG_BOOL(with, tk, yes, [ --without-tk do not build Tk interfaces if Tcl is enabled])
370: else
371: with_tk=no
372: fi
373: AC_MSG_RESULT([$with_tk])
374: AC_SUBST([with_tk])
1.1 petere 375:
376:
1.42 petere 377: # We see if the path to the TCL/TK configuration scripts is specified.
378: # This will override the use of tclsh to find the paths to search.
379:
1.43 petere 380: PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConfig.sh are in DIR])
1.1 petere 381:
1.42 petere 382: # We see if the path to the TK configuration scripts is specified.
383: # This will override the use of tclsh to find the paths to search.
1.1 petere 384:
1.43 petere 385: PGAC_ARG_REQ(with, tkconfig, [ --with-tkconfig=DIR tkConfig.sh is in DIR])
1.1 petere 386:
1.5 petere 387:
1.42 petere 388: #
389: # Optionally build Perl modules (Pg.pm and PL/Perl)
390: #
391: AC_MSG_CHECKING([whether to build Perl modules])
392: PGAC_ARG_BOOL(with, perl, no, [ --with-perl build Perl interface and PL/Perl])
393: AC_MSG_RESULT([$with_perl])
1.5 petere 394: AC_SUBST(with_perl)
395:
396:
1.42 petere 397: #
398: # Optionally build Python interface module
399: #
400: AC_MSG_CHECKING([whether to build Python modules])
401: PGAC_ARG_BOOL(with, python, no, [ --with-python build Python interface module],
402: [AC_MSG_RESULT(yes)
403: PGAC_PROG_PYTHON
404: PGAC_PATH_PYTHONDIR],
1.5 petere 405: [AC_MSG_RESULT(no)])
406: AC_SUBST(with_python)
1.1 petere 407:
1.13 petere 408:
1.28 petere 409: dnl A note on the Kerberos and OpenSSL options:
1.13 petere 410: dnl
1.28 petere 411: dnl The user can give an argument to the option in order the specify
412: dnl the base path of the respective installation (what he specified
413: dnl perhaps as --prefix). If no argument is given ($withval is "yes")
414: dnl then we take the path where the package installs by default. This
415: dnl way the user doesn't have to use redundant --with-includes and
416: dnl --with-libraries options, but he can still use them if the layout
417: dnl is non-standard.
418:
419: #
420: # Kerberos 4
421: #
1.42 petere 422: PGAC_ARG_OPTARG(with, krb4, [ --with-krb4[=DIR] build with Kerberos 4 support [/usr/athena]],
423: [krb4_prefix=/usr/athena],
424: [krb4_prefix=$withval],
425: [
1.28 petere 426: AC_MSG_RESULT([building with Kerberos 4 support])
1.42 petere 427: AC_DEFINE(KRB4, 1, [Define if you are building with Kerberos 4 support.])
1.28 petere 428:
1.68 petere 429: if test -d "$krb4_prefix/include"; then
430: INCLUDES="$INCLUDES -I$krb4_prefix/include"
431: fi
432: if test -d "$krb4_prefix/lib"; then
433: LIBDIRS="$LIBDIRS -L$krb4_prefix/lib"
1.13 petere 434: fi
1.37 petere 435:
1.42 petere 436: krb_srvtab="/etc/srvtab"
437: ])
438:
439: AC_SUBST(with_krb4)
1.13 petere 440:
441:
1.28 petere 442: #
443: # Kerberos 5
444: #
1.42 petere 445: PGAC_ARG_OPTARG(with, krb5, [ --with-krb5[=DIR] build with Kerberos 5 support [/usr/athena]],
446: [krb5_prefix=/usr/athena],
447: [krb5_prefix=$withval],
448: [
1.28 petere 449: AC_MSG_RESULT([building with Kerberos 5 support])
1.42 petere 450: AC_DEFINE(KRB5, 1, [Define if you are building with Kerberos 5 support.])
1.28 petere 451:
1.68 petere 452: if test -d "$krb5_prefix/include"; then
453: INCLUDES="$INCLUDES -I$krb5_prefix/include"
454: fi
455: if test -d "$krb5_prefix/lib"; then
456: LIBDIRS="$LIBDIRS -L$krb5_prefix/lib"
1.13 petere 457: fi
1.28 petere 458:
1.42 petere 459: krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
460: ])
461:
462: AC_SUBST(with_krb5)
1.28 petere 463:
464:
465: # Using both Kerberos 4 and Kerberos 5 at the same time isn't going to work.
466: if test "$with_krb4" = yes && test "$with_krb5" = yes ; then
467: AC_MSG_ERROR([Kerberos 4 and Kerberos 5 support cannot be combined])
468: fi
1.13 petere 469:
1.37 petere 470: AC_SUBST(krb_srvtab)
1.13 petere 471:
472:
1.28 petere 473: #
474: # Kerberos configuration parameters
475: #
1.42 petere 476: PGAC_ARG_REQ(with, krb-srvnam,
1.68 petere 477: [ --with-krb-srvnam=NAME name of the service principal in Kerberos [postgres]],
1.42 petere 478: [],
479: [with_krb_srvnam="postgres"])
480: AC_DEFINE_UNQUOTED([PG_KRB_SRVNAM], ["$with_krb_srvnam"],
481: [The name of the PostgreSQL service principal in Kerberos])
1.13 petere 482:
1.28 petere 483:
484:
485: #
486: # OpenSSL
487: #
1.42 petere 488: PGAC_ARG_OPTARG(with, openssl,
489: [ --with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl]],
490: [openssl_prefix=/usr/local/ssl],
491: [openssl_prefix=$withval],
492: [
1.28 petere 493: AC_MSG_RESULT([building with OpenSSL support])
1.42 petere 494: AC_DEFINE([USE_SSL], 1, [Define to build with (Open)SSL support])
1.28 petere 495:
496: if test -d "${openssl_prefix}/include" ; then
497: INCLUDES="$INCLUDES -I${openssl_prefix}/include"
498: fi
499: if test -d "${openssl_prefix}/lib" ; then
1.68 petere 500: LIBDIRS="$LIBDIRS -L${openssl_prefix}/lib"
1.28 petere 501: fi
1.42 petere 502: ])
503:
504: AC_SUBST(with_openssl)
1.28 petere 505:
1.13 petere 506:
507:
1.42 petere 508: #
509: # Optionally enable the building of the ODBC driver
510: #
1.15 petere 511:
1.42 petere 512: # Old option name
513: if test "${with_odbc+set}" = set && test "${enable_odbc+set}" != set; then
1.15 petere 514: enable_odbc=$with_odbc
515: fi
516:
1.42 petere 517: AC_MSG_CHECKING([whether to build the ODBC driver])
518: PGAC_ARG_BOOL(enable, odbc, no, [ --enable-odbc build the ODBC driver package])
519: AC_MSG_RESULT([$enable_odbc])
520: AC_SUBST([enable_odbc])
1.8 momjian 521:
1.1 petere 522:
1.42 petere 523: # Allow for overriding the default location of the odbcinst.ini
524: # file which is normally ${sysconfdir} (i.e., ${prefix}/etc).
525: PGAC_ARG_REQ(with, odbcinst,
526: [ --with-odbcinst=DIR default directory for odbcinst.ini [sysconfdir]],
527: [odbcinst_ini_dir=$withval],
528: [odbcinst_ini_dir="\${sysconfdir}"])
529: AC_SUBST([odbcinst_ini_dir])
1.3 momjian 530:
531:
532:
1.30 petere 533: # Assume system is ELF if it predefines __ELF__ as 1,
534: # otherwise believe host_os based default.
535: case $host_os in
536: freebsd1*|freebsd2*) elf=yes;;
537: esac
1.1 petere 538:
539: AC_EGREP_CPP(yes,
540: [#if __ELF__
541: yes
542: #endif
543: ],
1.30 petere 544: [ELF_SYS=true],
545: [if test "X$elf" = "Xyes" ; then
546: ELF_SYS=true
1.1 petere 547: else
1.30 petere 548: ELF_SYS=
549: fi])
550: AC_SUBST(ELF_SYS)
1.1 petere 551:
552:
553:
1.42 petere 554: #
555: # Optionally build C++ code (i.e., libpq++)
556: #
1.36 petere 557: AC_MSG_CHECKING([whether to build C++ modules])
1.42 petere 558: PGAC_ARG_OPTARG(with, CXX, [ --with-CXX build C++ modules (libpq++)],
559: [],
560: [CXX=$withval],
561: [
562: AC_MSG_RESULT(yes)
1.71 petere 563:
564: # If the user has specified CXXFLAGS in the environment, leave it
565: # alone, else use a default.
566:
1.74 petere 567: has_environ_CXXFLAGS="${CXXFLAGS+yes}"
1.6 petere 568: AC_PROG_CXX
1.74 petere 569: if test "$has_environ_CXXFLAGS" != yes; then
1.71 petere 570: if test "$GXX" = yes; then
571: CXXFLAGS=-O2
572: else
573: case $template in
574: osf) CXXFLAGS='-O4 -Olimit 2000' ;;
575: unixware) CXXFLAGS='-O' ;;
576: *) CXXFLAGS= ;;
577: esac
578: fi
579: fi
580: if test "$enable_debug" = yes && test "$ac_cv_prog_cxx_g" = yes; then
581: CXXFLAGS="$CXXFLAGS -g"
582: fi
583: echo "using CXXFLAGS=$CXXFLAGS"
584:
1.6 petere 585: AC_PROG_CXXCPP
1.61 petere 586: AC_SUBST(GXX)
1.6 petere 587: PGAC_CLASS_STRING
588: PGAC_CXX_NAMESPACE_STD
1.42 petere 589: ],
590: [AC_MSG_RESULT(no)])
591: AC_SUBST(with_CXX)
1.1 petere 592:
1.30 petere 593: CPPFLAGS="$CPPFLAGS $INCLUDES"
1.68 petere 594: LDFLAGS="$LDFLAGS $LIBDIRS"
1.30 petere 595:
596: echo "using CPPFLAGS=$CPPFLAGS"
597: echo "using LDFLAGS=$LDFLAGS"
598:
599:
1.28 petere 600: # Figure out how to invoke "install" and what install options to use.
1.1 petere 601:
602: AC_PROG_INSTALL
1.28 petere 603: # When Autoconf chooses install-sh as install program it tries to generate
604: # a relative path to it in each makefile where it subsitutes it. This clashes
605: # with our Makefile.global concept. This workaround helps.
606: case $INSTALL in
607: *install-sh*) INSTALL='\${SHELL} \${top_srcdir}/config/install-sh -c';;
608: esac
1.1 petere 609:
1.28 petere 610: # Fix Autoconf's brain-dead defaults for script installs.
611: INSTALL_SCRIPT="\${INSTALL} -m 755"
1.1 petere 612:
1.28 petere 613: # HPUX wants shared libs to be mode 555. Add your platform's special
614: # needs here if necessary.
615: case $host_os in
616: hpux*) INSTL_SHLIB_OPTS="-m 555" ;;
1.77 petere 617: *) INSTL_SHLIB_OPTS="-m 755" ;;
1.1 petere 618: esac
1.19 tgl 619:
1.28 petere 620: INSTALL_SHLIB="\${INSTALL} $INSTL_SHLIB_OPTS"
621: AC_SUBST(INSTALL_SHLIB)
1.1 petere 622:
1.19 tgl 623:
1.2 petere 624: AC_PROG_AWK
1.39 petere 625: PGAC_PATH_FLEX
1.1 petere 626: AC_PROG_LN_S
1.62 petere 627: AC_PROG_LD
1.67 petere 628: AC_SUBST(LD)
629: AC_SUBST(with_gnu_ld)
1.77 petere 630: case $host_os in sysv5uw*)
631: AC_CACHE_CHECK([whether ld -R works], [pgac_cv_prog_ld_R],
632: [
633: pgac_save_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -Wl,-R/usr/lib"
634: AC_TRY_LINK([], [], [pgac_cv_prog_ld_R=yes], [pgac_cv_prog_ld_R=no])
635: LDFLAGS=$pgac_save_LDFLAGS
636: ])
637: ld_R_works=$pgac_cv_prog_ld_R
638: AC_SUBST(ld_R_works)
639: esac
1.1 petere 640: AC_PROG_RANLIB
1.58 petere 641: AC_CHECK_PROGS(LORDER, lorder)
1.56 petere 642: AC_PATH_PROG(TAR, tar)
1.58 petere 643: AC_CHECK_PROGS(PERL, perl)
1.98 petere 644:
645: AC_CHECK_PROGS(YACC, ['bison -y'])
646: if test -z "$YACC"; then
647: AC_MSG_WARN([
648: *** Without Bison you will not be able to build PostgreSQL from CVS or
649: *** change any of the parser definition files. You can obtain Bison from
650: *** a GNU mirror site. (If you are using the official distribution of
651: *** PostgreSQL then you do not need to worry about this because the Bison
652: *** output is pre-generated.) To use a different yacc program (possible,
653: *** but not recommended), set the environment variable YACC before running
654: *** 'configure'.])
655: fi
1.6 petere 656: AC_SUBST(YFLAGS)
1.98 petere 657:
1.43 petere 658: if test "$with_tk" = yes; then
659: AC_PATH_PROG(WISH, wish)
1.80 petere 660: test -z "$WISH" && AC_MSG_ERROR(['wish' is required for Tk support])
1.43 petere 661: fi
1.1 petere 662:
663:
1.29 petere 664: ##
665: ## Libraries
666: ##
667:
1.1 petere 668: AC_CHECK_LIB(sfio, main)
1.96 petere 669: PGAC_CHECK_READLINE
1.52 petere 670: AC_SEARCH_LIBS(using_history, history, [AC_DEFINE(HAVE_HISTORY_FUNCTIONS)])
1.1 petere 671:
672: if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha"
673: then
674: AC_CHECK_LIB(bsd, main)
675: fi
1.21 petere 676: AC_CHECK_LIB(util, setproctitle)
1.1 petere 677: AC_CHECK_LIB(m, main)
678: AC_CHECK_LIB(dl, main)
679: AC_CHECK_LIB(socket, main)
680: AC_CHECK_LIB(nsl, main)
681: AC_CHECK_LIB(ipc, main)
682: AC_CHECK_LIB(IPC, main)
683: AC_CHECK_LIB(lc, main)
684: AC_CHECK_LIB(dld, main)
685: AC_CHECK_LIB(ld, main)
686: AC_CHECK_LIB(compat, main)
687: AC_CHECK_LIB(BSD, main)
688: AC_CHECK_LIB(gen, main)
689: AC_CHECK_LIB(PW, main)
1.95 petere 690: AC_CHECK_LIB(resolv, main)
1.21 petere 691: AC_SEARCH_LIBS(crypt, crypt)
1.86 tgl 692: AC_CHECK_LIB(bind, __inet_ntoa)
693: dnl only consider libz to be present if we find <zlib.h> as well
694: AC_CHECK_HEADER(zlib.h, [
1.28 petere 695: AC_CHECK_LIB(z, inflate)
1.86 tgl 696: ])
1.60 momjian 697:
1.28 petere 698:
699: if test "$with_krb4" = yes ; then
1.80 petere 700: AC_CHECK_LIB(des, [des_encrypt], [], [AC_MSG_ERROR([library 'des' is required for Kerberos 4])])
701: AC_CHECK_LIB(krb, [krb_sendauth], [], [AC_MSG_ERROR([library 'krb' is required for Kerberos 4])])
1.28 petere 702: fi
703:
704: if test "$with_krb5" = yes ; then
1.80 petere 705: AC_CHECK_LIB(com_err, [com_err], [], [AC_MSG_ERROR([library 'com_err' is required for Kerberos 5])])
1.68 petere 706: AC_CHECK_LIB(crypto, [krb5_encrypt], [],
1.80 petere 707: [AC_CHECK_LIB(k5crypto, [krb5_encrypt], [], [AC_MSG_ERROR([library 'crypto' or 'k5crypto' is required for Kerberos 5])])])
708: AC_CHECK_LIB(krb5, [krb5_sendauth], [], [AC_MSG_ERROR([library 'krb5' is required for Kerberos 5])])
1.28 petere 709: fi
710:
711: if test "$with_openssl" = yes ; then
712: dnl Order matters!
1.80 petere 713: AC_CHECK_LIB(crypto, [CRYPTO_new_ex_data], [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
714: AC_CHECK_LIB(ssl, [SSL_library_init], [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
1.28 petere 715: fi
1.1 petere 716:
1.28 petere 717:
1.29 petere 718: ##
719: ## Header files
720: ##
721: dnl sys/socket.h and sys/types.h are required by AC_FUNC_ACCEPT_ARGTYPES
1.66 tgl 722: AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h pwd.h sys/ipc.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/types.h sys/un.h termios.h kernel/OS.h kernel/image.h SupportDefs.h])
723:
724: dnl At least on IRIX, cpp test for netinet/tcp.h will fail unless netinet/in.h
725: dnl is included first. So can't just use AC_CHECK_HEADERS; do it this way:
726: AC_CHECK_HEADERS([netinet/in.h])
727: AC_MSG_CHECKING([for netinet/tcp.h])
728: AC_TRY_CPP([
729: #ifdef HAVE_NETINET_IN_H
730: #include <netinet/in.h>
731: #endif
732: #include <netinet/tcp.h>
733: ], [AC_DEFINE(HAVE_NETINET_TCP_H) AC_MSG_RESULT(yes)],
734: [AC_MSG_RESULT(no)])
1.29 petere 735:
1.73 petere 736: PGAC_HEADER_STRING
737:
1.28 petere 738: AC_CHECK_HEADERS([readline/readline.h readline.h], [break])
739: AC_CHECK_HEADERS([readline/history.h history.h], [break])
1.15 petere 740:
1.28 petere 741: if test "$with_krb4" = yes ; then
742: AC_CHECK_HEADER(krb.h, [], [AC_MSG_ERROR([header file <krb.h> is required for Kerberos 4])])
743: fi
744:
745: if test "$with_krb5" = yes ; then
746: AC_CHECK_HEADER(krb5.h, [], [AC_MSG_ERROR([header file <krb5.h> is required for Kerberos 5])])
747: AC_CHECK_HEADER(com_err.h, [], [AC_MSG_ERROR([header file <com_err.h> is required for Kerberos 5])])
748: fi
749:
750: if test "$with_openssl" = yes ; then
751: AC_CHECK_HEADER([openssl/ssl.h], [], [AC_MSG_ERROR([header file <openssl/ssl.h> is required for OpenSSL])])
752: AC_CHECK_HEADER([openssl/err.h], [], [AC_MSG_ERROR([header file <openssl/err.h> is required for OpenSSL])])
753: fi
754:
1.1 petere 755:
1.29 petere 756: ##
757: ## Types, structures, compiler characteristics
758: ##
1.1 petere 759: AC_C_CONST
760: AC_C_INLINE
761: AC_C_STRINGIZE
1.40 petere 762: PGAC_C_SIGNED
763: PGAC_C_VOLATILE
1.29 petere 764: AC_STRUCT_TIMEZONE
765: PGAC_UNION_SEMUN
1.44 petere 766: PGAC_STRUCT_SOCKADDR_UN
1.1 petere 767:
1.29 petere 768: ##
769: ## Functions, global variables
770: ##
1.6 petere 771: PGAC_VAR_INT_TIMEZONE
1.29 petere 772: AC_FUNC_ACCEPT_ARGTYPES
1.6 petere 773: PGAC_FUNC_GETTIMEOFDAY_1ARG
1.1 petere 774:
1.99 tgl 775: AC_CHECK_FUNCS([fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync])
776:
777: dnl Check whether <unistd.h> declares fdatasync().
778: AC_EGREP_HEADER(fdatasync, unistd.h, AC_DEFINE(HAVE_FDATASYNC_DECL))
1.1 petere 779:
1.28 petere 780: AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
781: [AC_TRY_LINK(
782: [#include <machine/vmparam.h>
783: #include <sys/exec.h>
784: ],
1.1 petere 785: [PS_STRINGS->ps_nargvstr = 1;
786: PS_STRINGS->ps_argvstr = "foo";],
1.28 petere 787: [pgac_cv_var_PS_STRINGS=yes],
788: [pgac_cv_var_PS_STRINGS=no])])
789: if test "$pgac_cv_var_PS_STRINGS" = yes ; then
790: AC_DEFINE([HAVE_PS_STRINGS], [], [Define if the PS_STRINGS thing exists.])
791: fi
1.1 petere 792:
793: dnl We use our snprintf.c emulation if either snprintf() or vsnprintf()
794: dnl is missing. Yes, there are machines that have only one.
795: dnl We may also decide to use snprintf.c if snprintf() is present but does
796: dnl not have working "long long int" support -- see below.
797: SNPRINTF=''
798: AC_CHECK_FUNC(snprintf,
799: AC_DEFINE(HAVE_SNPRINTF),
800: SNPRINTF='snprintf.o')
801: AC_CHECK_FUNC(vsnprintf,
802: AC_DEFINE(HAVE_VSNPRINTF),
803: SNPRINTF='snprintf.o')
804: AC_SUBST(SNPRINTF)
805: dnl Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
806: dnl include/c.h will provide declarations. Note this is a separate test
807: dnl from whether the functions exist in the C library --- there are systems
808: dnl that have the functions but don't bother to declare them :-(
809: dnl Note: simple-minded pattern here will do wrong thing if stdio.h
810: dnl declares vsnprintf() but not snprintf(). Hopefully there are no
811: dnl systems that are *that* brain-damaged...
812: AC_EGREP_HEADER(snprintf, stdio.h, AC_DEFINE(HAVE_SNPRINTF_DECL))
813: AC_EGREP_HEADER(vsnprintf, stdio.h, AC_DEFINE(HAVE_VSNPRINTF_DECL))
1.29 petere 814:
815: # do this one the hard way in case isinf() is a macro
816: AC_CACHE_CHECK([for isinf], ac_cv_func_isinf,
1.1 petere 817: [AC_TRY_LINK(
1.29 petere 818: [#include <math.h>
819: ],
1.1 petere 820: [double x = 0.0; int res = isinf(x);],
1.29 petere 821: [ac_cv_func_isinf=yes],
822: [ac_cv_func_isinf=no])])
823:
824: if test $ac_cv_func_isinf = yes ; then
1.1 petere 825: AC_DEFINE(HAVE_ISINF)
1.29 petere 826: ISINF=
1.1 petere 827: else
828: ISINF='isinf.o'
1.29 petere 829: # Look for a way to implement a substitute for isinf()
830: AC_CHECK_FUNCS([fpclass fp_class fp_class_d class], [break])
1.1 petere 831: fi
832: AC_SUBST(ISINF)
1.29 petere 833:
1.1 petere 834: AC_CHECK_FUNC(getrusage,
835: AC_DEFINE(HAVE_GETRUSAGE),
836: GETRUSAGE='getrusage.o')
837: AC_SUBST(GETRUSAGE)
838: AC_CHECK_FUNC(srandom,
839: AC_DEFINE(HAVE_SRANDOM),
840: SRANDOM='srandom.o')
841: AC_SUBST(SRANDOM)
842: AC_CHECK_FUNC(gethostname,
843: AC_DEFINE(HAVE_GETHOSTNAME),
844: GETHOSTNAME='gethostname.o')
845: AC_SUBST(GETHOSTNAME)
846: AC_CHECK_FUNC(random,
847: AC_DEFINE(HAVE_RANDOM),
848: MISSING_RANDOM='random.o')
849: AC_SUBST(MISSING_RANDOM)
850: AC_CHECK_FUNC(inet_aton,
851: AC_DEFINE(HAVE_INET_ATON),
852: INET_ATON='inet_aton.o')
853: AC_SUBST(INET_ATON)
854: AC_CHECK_FUNC(strerror,
855: AC_DEFINE(HAVE_STRERROR),
1.92 tgl 856: STRERROR='strerror.o')
1.1 petere 857: AC_SUBST(STRERROR)
858: AC_CHECK_FUNC(strdup,
859: AC_DEFINE(HAVE_STRDUP),
860: STRDUP='../../utils/strdup.o')
861: AC_SUBST(STRDUP)
862: AC_CHECK_FUNC(strtol,
863: AC_DEFINE(HAVE_STRTOL),
864: STRTOL='strtol.o')
865: AC_SUBST(STRTOL)
866: AC_CHECK_FUNC(strtoul,
867: AC_DEFINE(HAVE_STRTOUL),
1.100 ishii 868: STRTOUL='strtoul.o')
1.1 petere 869: AC_SUBST(STRTOUL)
870: AC_CHECK_FUNC(strcasecmp,
871: AC_DEFINE(HAVE_STRCASECMP),
872: STRCASECMP='strcasecmp.o')
873: AC_SUBST(STRCASECMP)
874: AC_CHECK_FUNC(cbrt,
875: AC_DEFINE(HAVE_CBRT),
876: AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT)))
877:
878: # On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a;
879: # this hackery with HPUXMATHLIB allows us to cope.
880: HPUXMATHLIB=""
1.30 petere 881: case $host_cpu in
1.1 petere 882: hppa1.1)
883: if [[ -r /lib/pa1.1/libm.a ]] ; then
884: HPUXMATHLIB="-L /lib/pa1.1 -lm"
885: fi ;;
886: esac
887: AC_SUBST(HPUXMATHLIB)
888:
889: AC_CHECK_FUNC(rint,
890: AC_DEFINE(HAVE_RINT),
891: AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB))
892:
1.52 petere 893:
894: # Readline versions < 2.1 don't have rl_completion_append_character
895: AC_MSG_CHECKING([for rl_completion_append_character])
896: AC_TRY_LINK([#include <stdio.h>
897: #ifdef HAVE_READLINE_H
898: # include <readline.h>
899: #endif
900: #ifdef HAVE_READLINE_READLINE_H
901: # include <readline/readline.h>
902: #endif],
903: [rl_completion_append_character = 'x';],
904: [AC_MSG_RESULT(yes)
905: AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER)],
906: [AC_MSG_RESULT(no)])
907:
908:
909: # Check whether readline's filename_completion_function is declared.
910: # Some prehistoric versions of readline, in particular those shipped
911: # with earlier Cygwins don't have this declared, although it's in the
912: # library.
913: AC_MSG_CHECKING([whether filename_completion_function is declared])
914: if test "$ac_cv_header_readline_h" = yes; then
915: _readline_header='readline.h'
916: elif test "$ac_cv_header_readline_readline_h" = yes; then
917: _readline_header='readline/readline.h'
918: else
919: _readline_header='xxx'
920: fi
921: AC_EGREP_HEADER([filename_completion_function], [$_readline_header],
922: [AC_DEFINE(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
923: AC_MSG_RESULT(yes)],
924: [AC_MSG_RESULT(no)])
925:
1.1 petere 926:
927:
928: dnl Cannot use AC_CHECK_FUNC because finite may be a macro
929: AC_MSG_CHECKING(for finite)
930: AC_TRY_LINK([#include <math.h>],
931: [int dummy=finite(1.0);],
932: [AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes)],
933: AC_MSG_RESULT(no))
934:
935: dnl Cannot use AC_CHECK_FUNC because sigsetjmp may be a macro
936: dnl (especially on GNU libc)
937: dnl See also comments in config.h.
938: AC_MSG_CHECKING(for sigsetjmp)
939: AC_TRY_LINK([#include <setjmp.h>],
940: [sigjmp_buf x; sigsetjmp(x, 1);],
941: [AC_DEFINE(HAVE_SIGSETJMP) AC_MSG_RESULT(yes)],
942: AC_MSG_RESULT(no))
943:
1.42 petere 944:
945: PGAC_ARG_BOOL(enable, syslog, no, [ --enable-syslog enable logging to syslog],
946: [AC_CHECK_FUNC(syslog,
947: [AC_DEFINE([ENABLE_SYSLOG], 1,
948: [Define to 1 if to enable the syslogging code])],
949: [AC_MSG_ERROR([no syslog interface found])])])
950:
1.1 petere 951:
1.76 petere 952: AC_CACHE_CHECK([for optreset], pgac_cv_var_int_optreset,
953: [AC_TRY_LINK([#include <unistd.h>],
954: [extern int optreset; optreset = 1;],
955: [pgac_cv_var_int_optreset=yes],
956: [pgac_cv_var_int_optreset=no])])
957: if test x"$pgac_cv_var_int_optreset" = x"yes"; then
958: AC_DEFINE(HAVE_INT_OPTRESET, 1)
959: fi
960:
1.1 petere 961: dnl Check to see if we have a working 64-bit integer type.
962: dnl This breaks down into two steps:
963: dnl (1) figure out if the compiler has a 64-bit int type with working
964: dnl arithmetic, and if so
965: dnl (2) see whether snprintf() can format the type correctly. (Currently,
966: dnl snprintf is the only library routine we really need for int8 support.)
967: dnl It's entirely possible to have a compiler that handles a 64-bit type
968: dnl when the C library doesn't; this is fairly likely when using gcc on
969: dnl an older platform, for example.
970: dnl If there is no native snprintf() or it does not handle the 64-bit type,
971: dnl we force our own version of snprintf() to be used instead.
972: dnl Note this test must be run after our initial check for snprintf/vsnprintf.
973:
1.6 petere 974: PGAC_TYPE_64BIT_INT([long int])
1.1 petere 975:
1.6 petere 976: if test x"$HAVE_LONG_INT_64" = x"no" ; then
977: PGAC_TYPE_64BIT_INT([long long int])
978: fi
1.1 petere 979:
980:
981: dnl If we found "long int" is 64 bits, assume snprintf handles it.
982: dnl If we found we need to use "long long int", better check.
983: dnl We cope with snprintfs that use either %lld or %qd as the format.
984: dnl If neither works, fall back to our own snprintf emulation (which we
985: dnl know uses %lld).
986:
1.7 petere 987: if [[ x"$HAVE_LONG_LONG_INT_64" = xyes ]] ; then
1.1 petere 988: if [[ x$SNPRINTF = x ]] ; then
989: AC_MSG_CHECKING(whether snprintf handles 'long long int' as %lld)
990: AC_TRY_RUN([#include <stdio.h>
991: typedef long long int int64;
992: #define INT64_FORMAT "%lld"
993:
994: int64 a = 20000001;
995: int64 b = 40000005;
996:
997: int does_int64_snprintf_work()
998: {
999: int64 c;
1000: char buf[100];
1001:
1002: if (sizeof(int64) != 8)
1003: return 0; /* doesn't look like the right size */
1004:
1005: c = a * b;
1006: snprintf(buf, 100, INT64_FORMAT, c);
1007: if (strcmp(buf, "800000140000005") != 0)
1008: return 0; /* either multiply or snprintf is busted */
1009: return 1;
1010: }
1011: main() {
1012: exit(! does_int64_snprintf_work());
1013: }],
1014: [ AC_MSG_RESULT(yes)
1015: INT64_FORMAT='"%lld"'
1016: ],
1017: [ AC_MSG_RESULT(no)
1018: AC_MSG_CHECKING(whether snprintf handles 'long long int' as %qd)
1019: AC_TRY_RUN([#include <stdio.h>
1020: typedef long long int int64;
1021: #define INT64_FORMAT "%qd"
1022:
1023: int64 a = 20000001;
1024: int64 b = 40000005;
1025:
1026: int does_int64_snprintf_work()
1027: {
1028: int64 c;
1029: char buf[100];
1030:
1031: if (sizeof(int64) != 8)
1032: return 0; /* doesn't look like the right size */
1033:
1034: c = a * b;
1035: snprintf(buf, 100, INT64_FORMAT, c);
1036: if (strcmp(buf, "800000140000005") != 0)
1037: return 0; /* either multiply or snprintf is busted */
1038: return 1;
1039: }
1040: main() {
1041: exit(! does_int64_snprintf_work());
1042: }],
1043: [ AC_MSG_RESULT(yes)
1044: INT64_FORMAT='"%qd"'
1045: ],
1046: [ AC_MSG_RESULT(no)
1047: # Force usage of our own snprintf, since system snprintf is broken
1048: SNPRINTF='snprintf.o'
1049: INT64_FORMAT='"%lld"'
1050: ],
1051: [ AC_MSG_RESULT(assuming not on target machine)
1052: # Force usage of our own snprintf, since we cannot test foreign snprintf
1053: SNPRINTF='snprintf.o'
1054: INT64_FORMAT='"%lld"'
1055: ]) ],
1056: [ AC_MSG_RESULT(assuming not on target machine)
1057: # Force usage of our own snprintf, since we cannot test foreign snprintf
1058: SNPRINTF='snprintf.o'
1059: INT64_FORMAT='"%lld"'
1060: ])
1061: else
1062: # here if we previously decided we needed to use our own snprintf
1063: INT64_FORMAT='"%lld"'
1064: fi
1065: else
1066: # Here if we are not using 'long long int' at all
1067: INT64_FORMAT='"%ld"'
1068: fi
1069:
1070: AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT)
1071:
1072:
1.78 petere 1073: AC_CHECK_FUNCS([strtoll strtoq], [break])
1074: AC_CHECK_FUNCS([strtoull strtouq], [break])
1075:
1.102 ishii 1076: dnl psql needs atexit() or on_exit()
1077: AC_CHECK_FUNC(atexit,
1078: [AC_DEFINE(HAVE_ATEXIT)],
1079: [AC_CHECK_FUNCS(on_exit,
1080: [AC_DEFINE(HAVE_ON_EXIT)],
1081: [AC_MSG_ERROR([atexi() nor on_exit() found])])])
1.78 petere 1082:
1.84 tgl 1083: dnl Need a #define for the size of Datum (unsigned long)
1084:
1085: AC_CHECK_SIZEOF(unsigned long, 4)
1086: AC_DEFINE_UNQUOTED(SIZEOF_DATUM, $ac_cv_sizeof_unsigned_long)
1087:
1.1 petere 1088: dnl Determine memory alignment requirements for the basic C datatypes.
1089:
1.6 petere 1090: PGAC_CHECK_ALIGNOF(short)
1091: PGAC_CHECK_ALIGNOF(int)
1092: PGAC_CHECK_ALIGNOF(long)
1.7 petere 1093: if [[ x"$HAVE_LONG_LONG_INT_64" = xyes ]] ; then
1.6 petere 1094: PGAC_CHECK_ALIGNOF(long long int)
1.1 petere 1095: fi
1.6 petere 1096: PGAC_CHECK_ALIGNOF(double)
1.1 petere 1097:
1098: dnl Compute maximum alignment of any basic type.
1099: dnl We assume long's alignment is at least as strong as char, short, or int;
1100: dnl but we must check long long (if it exists) and double.
1101:
1.6 petere 1102: if test $pgac_cv_alignof_double != 'sizeof(double)' ; then
1103: MAX_ALIGNOF=$pgac_cv_alignof_long
1104: if test $MAX_ALIGNOF -lt $pgac_cv_alignof_double ; then
1105: MAX_ALIGNOF=$pgac_cv_alignof_double
1.1 petere 1106: fi
1.7 petere 1107: if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $pgac_cv_alignof_long_long_int ; then
1.6 petere 1108: MAX_ALIGNOF="$pgac_cv_alignof_long_long_int"
1.1 petere 1109: fi
1110: else
1111: dnl cross-compiling: assume that double's alignment is worst case
1.6 petere 1112: MAX_ALIGNOF="$pgac_cv_alignof_double"
1.1 petere 1113: fi
1.6 petere 1114: AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignment requirement of any type])
1.1 petere 1115:
1.6 petere 1116: PGAC_FUNC_POSIX_SIGNALS
1.1 petere 1117:
1118:
1.43 petere 1119: # Check for Tcl configuration script tclConfig.sh
1120: if test "$with_tcl" = yes; then
1121: PGAC_PATH_TCLCONFIGSH([$with_tclconfig])
1122: fi
1.1 petere 1123:
1.43 petere 1124: # Check for Tk configuration script tkConfig.sh
1125: if test "$with_tk" = yes; then
1126: PGAC_PATH_TKCONFIGSH([$with_tkconfig $with_tclconfig])
1.1 petere 1127: fi
1128:
1129:
1.75 petere 1130: #
1131: # Check for DocBook and tools
1132: #
1133: PGAC_PROG_NSGMLS
1134: # If you don't have nsgmls you won't get very far, so save the cycles.
1135: if test -n "$NSGMLS"; then
1136: PGAC_PROG_JADE
1137: PGAC_CHECK_DOCBOOK([3.1])
1138: PGAC_PATH_DOCBOOK_STYLESHEETS
1139: AC_CHECK_PROGS(SGMLSPL, sgmlspl)
1140: fi
1141:
1142:
1.43 petere 1143: # Finally ready to produce output files ...
1.61 petere 1144:
1145: if test x"$abs_top_srcdir" != x"$abs_top_builddir"; then
1146: echo $ac_n "preparing build tree... $ac_c" 1>&6
1147: /bin/sh "$srcdir/config/prep_buildtree" "$abs_top_srcdir" "$abs_top_builddir" \
1148: || AC_MSG_ERROR(failed)
1149: AC_MSG_RESULT(done)
1150: fi
1.1 petere 1151:
1152: AC_OUTPUT(
1.33 petere 1153: [
1154: GNUmakefile
1155: src/GNUmakefile
1156: src/Makefile.global
1157: src/backend/port/Makefile
1.85 tgl 1158: ],
1159: [
1160: # Update timestamp for config.h (see Makefile.global)
1.87 petere 1161: test x"$CONFIG_HEADERS" != x"" && echo >src/include/stamp-h
1.83 petere 1162: ])
PostgreSQL CVSweb <[email protected]>