|
|
| version 1.267, 2003/06/23 23:51:59 | version 1.464, 2006/04/29 20:47:29 |
|---|---|
| Line 1 | Line 1 |
| dnl Process this file with autoconf to produce a configure script. | dnl Process this file with autoconf to produce a configure script. |
| dnl $Header$ | dnl $PostgreSQL: pgsql/configure.in,v 1.463 2006/04/29 16:34:41 momjian Exp $ |
| dnl | dnl |
| dnl Developers, please strive to achieve this order: | dnl Developers, please strive to achieve this order: |
| dnl | dnl |
| Line 16 dnl | Line 16 dnl |
| dnl Read the Autoconf manual for details. | dnl Read the Autoconf manual for details. |
| dnl | dnl |
| m4_pattern_forbid(^PGAC_)dnl to catch undefined macros | m4_pattern_forbid(^PGAC_)dnl to catch undefined macros |
| dnl | |
| dnl The GNU folks apparently haven't heard that some people don't use | |
| dnl Texinfo. Use this sorcery to use "docdir" instead of "infodir". | |
| m4_define([info], [doc]) | |
| m4_define([infodir], [docdir]) | |
| AC_INIT([PostgreSQL], [7.4devel], [[email protected]]) | |
| m4_undefine([infodir]) | |
| m4_undefine([info]) | |
| AC_SUBST(docdir) | |
| AC_PREREQ(2.53) | AC_INIT([PostgreSQL], [8.2devel], [[email protected]]) |
| AC_COPYRIGHT([Copyright 2002 PostgreSQL Global Development Group]) | |
| AC_PREREQ(2.59) | |
| AC_COPYRIGHT([Copyright (c) 1996-2006, PostgreSQL Global Development Group]) | |
| AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) | AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) |
| AC_CONFIG_AUX_DIR(config) | AC_CONFIG_AUX_DIR(config) |
| AC_PREFIX_DEFAULT(/usr/local/pgsql) | AC_PREFIX_DEFAULT(/usr/local/pgsql) |
| AC_SUBST(configure_args, [$ac_configure_args]) | AC_SUBST(configure_args, [$ac_configure_args]) |
| AC_DEFINE_UNQUOTED(PG_VERSION, "$PACKAGE_VERSION", [PostgreSQL version]) | AC_DEFINE_UNQUOTED(PG_VERSION, "$PACKAGE_VERSION", [PostgreSQL version as a string]) |
| AC_CANONICAL_HOST | AC_CANONICAL_HOST |
| Line 52 PGAC_ARG_REQ(with, template, [], | Line 45 PGAC_ARG_REQ(with, template, [], |
| esac | esac |
| ], | ], |
| [ | [ |
| # --with-template not given | # --with-template not given |
| case $host_os in | case $host_os in |
| aix*) template=aix ;; | aix*) template=aix ;; |
| beos*) template=beos ;; | |
| bsdi*) template=bsdi ;; | bsdi*) template=bsdi ;; |
| cygwin*) template=cygwin ;; | cygwin*) template=cygwin ;; |
| darwin*) template=darwin ;; | darwin*) template=darwin ;; |
| dgux*) template=dgux ;; | dgux*) template=dgux ;; |
| freebsd*) template=freebsd ;; | freebsd*) template=freebsd ;; |
| hpux*) template=hpux ;; | hpux*) template=hpux ;; |
| irix*) template=irix5 ;; | irix*) template=irix ;; |
| linux*) template=linux ;; | linux*|gnu*|k*bsd*-gnu) |
| template=linux ;; | |
| mingw*) template=win32 ;; | mingw*) template=win32 ;; |
| netbsd*) template=netbsd ;; | netbsd*) template=netbsd ;; |
| nextstep*) template=nextstep ;; | nextstep*) template=nextstep ;; |
| openbsd*) template=openbsd ;; | openbsd*) template=openbsd ;; |
| osf*) template=osf ;; | osf*) template=osf ;; |
| qnx*) template=qnx4 ;; | |
| sco*) template=sco ;; | sco*) template=sco ;; |
| solaris*) template=solaris ;; | solaris*) template=solaris ;; |
| sunos*) template=sunos4 ;; | sunos*) template=sunos4 ;; |
| Line 104 AC_MSG_RESULT([$template]) | Line 96 AC_MSG_RESULT([$template]) |
| PORTNAME=$template | PORTNAME=$template |
| AC_SUBST(PORTNAME) | AC_SUBST(PORTNAME) |
| # Pick right test-and-set (TAS) code. Most platforms have inline | # Initialize default assumption that we do not need separate assembly code |
| # assembler code in src/include/storage/s_lock.h, so we just use | # for TAS (test-and-set). This can be overridden by the template file |
| # a dummy file here. | # when it's executed. |
| case $host in | need_tas=no |
| *-*-hpux*) need_tas=yes; tas_file=hpux.s ;; | tas_file=dummy.s |
| sparc-*-solaris*) need_tas=yes; tas_file=solaris_sparc.s ;; | |
| i?86-*-solaris*) need_tas=yes; tas_file=solaris_i386.s ;; | |
| *) need_tas=no; tas_file=dummy.s ;; | |
| esac | |
| AC_CONFIG_LINKS([src/backend/port/tas.s:src/backend/port/tas/${tas_file}]) | |
| if test "$need_tas" = yes ; then | |
| TAS=tas.o | |
| fi | |
| AC_SUBST(TAS) | |
| Line 126 AC_SUBST(TAS) | Line 108 AC_SUBST(TAS) |
| ## Command line options | ## Command line options |
| ## | ## |
| # | |
| # Installation directory for documentation | |
| # | |
| PGAC_ARG(with, docdir, [ --with-docdir=DIR install the documentation in DIR [[PREFIX/doc]] | |
| --without-docdir do not install the documentation], | |
| [AC_MSG_ERROR([option --with-docdir requires an argument])], | |
| [docdir=], | |
| [docdir=$withval], | |
| [docdir='${prefix}/doc']) | |
| AC_SUBST(docdir) | |
| # | # |
| # Add non-standard directories to the include path | # Add non-standard directories to the include path |
| Line 153 PGAC_ARG_BOOL(enable, integer-datetimes, | Line 146 PGAC_ARG_BOOL(enable, integer-datetimes, |
| AC_MSG_RESULT([$enable_integer_datetimes]) | AC_MSG_RESULT([$enable_integer_datetimes]) |
| # Character set recode (--enable-recode) | |
| # | |
| AC_MSG_CHECKING([whether to build with recode support]) | |
| PGAC_ARG_BOOL(enable, recode, no, [ --enable-recode enable single-byte recode support], | |
| [AC_DEFINE([CYR_RECODE], 1, | |
| [Define to 1 if you want single-byte recode support. (--enable-recode)])]) | |
| AC_MSG_RESULT([$enable_recode]) | |
| # | # |
| # NLS | # NLS |
| # | # |
| Line 180 AC_SUBST(WANTED_LANGUAGES) | Line 164 AC_SUBST(WANTED_LANGUAGES) |
| # Default port number (--with-pgport), default 5432 | # Default port number (--with-pgport), default 5432 |
| # | # |
| AC_MSG_CHECKING([for default port number]) | AC_MSG_CHECKING([for default port number]) |
| PGAC_ARG_REQ(with, pgport, [ --with-pgport=PORTNUM change default port number [5432]], | PGAC_ARG_REQ(with, pgport, [ --with-pgport=PORTNUM change default port number [[5432]]], |
| [default_port=$withval], | [default_port=$withval], |
| [default_port=5432]) | [default_port=5432]) |
| AC_MSG_RESULT([$default_port]) | AC_MSG_RESULT([$default_port]) |
| # Need both of these because some places want an integer and some a string | # Need both of these because some places want an integer and some a string |
| AC_DEFINE_UNQUOTED(DEF_PGPORT, ${default_port}, | AC_DEFINE_UNQUOTED(DEF_PGPORT, ${default_port}, |
| [Define to the default TCP port number on which the server listens and | [Define to the default TCP port number on which the server listens and |
| to which clients will try to connect to. This can be overridden at | to which clients will try to connect. This can be overridden at run-time, |
| run-time, but it's convenient if your clients have the right default | but it's convenient if your clients have the right default compiled in. |
| compiled in. (--with-pgport=PORTNUM)]) | (--with-pgport=PORTNUM)]) |
| AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}", | AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}", |
| [Define to the default TCP port number as string constant.]) | [Define to the default TCP port number as a string constant.]) |
| AC_SUBST(default_port) | AC_SUBST(default_port) |
| # | # |
| Line 208 PGAC_ARG_BOOL(enable, rpath, yes, | Line 192 PGAC_ARG_BOOL(enable, rpath, yes, |
| [ --disable-rpath do not embed shared library search path in executables]) | [ --disable-rpath do not embed shared library search path in executables]) |
| AC_SUBST(enable_rpath) | AC_SUBST(enable_rpath) |
| # | |
| # Spinlocks | |
| # | |
| PGAC_ARG_BOOL(enable, spinlocks, yes, | |
| [ --disable-spinlocks do not use spinlocks]) | |
| # | # |
| # --enable-debug adds -g to compiler flags | # --enable-debug adds -g to compiler flags |
| Line 232 case $template in | Line 221 case $template in |
| esac | esac |
| AC_PROG_CC([$pgac_cc_list]) | AC_PROG_CC([$pgac_cc_list]) |
| unset CFLAGS | |
| # | |
| # Read the template | # Read the template |
| # | |
| . "$srcdir/src/template/$template" || exit | . "$srcdir/src/template/$template" || exit |
| # CFLAGS are selected so: | |
| # If the user specifies something in the environment, that is used. | |
| # else: If the template file set something, that is used. | |
| # else: If the compiler is GCC, then we use -O2. | |
| # else: If the compiler is something else, then we use -0. | |
| if test "$ac_env_CFLAGS_set" = set; then | if test "$ac_env_CFLAGS_set" = set; then |
| CFLAGS=$ac_env_CFLAGS_value | CFLAGS=$ac_env_CFLAGS_value |
| elif test "${CFLAGS+set}" = set; then | |
| : # (keep what template set) | |
| elif test "$GCC" = yes; then | |
| CFLAGS="-O2" | |
| else | |
| # if the user selected debug mode, don't use -O | |
| if test "$enable_debug" != yes; then | |
| CFLAGS="-O" | |
| fi | |
| fi | fi |
| # Some versions of GCC support some additional useful warning flags. | |
| # Check whether they are supported, and add them to CFLAGS if so. | |
| if test "$GCC" = yes; then | |
| # ICC pretends to be GCC but it's lying; it doesn't support these options. | |
| # So we have to check if "GCC" is really ICC. | |
| AC_TRY_COMPILE([], [@%:@ifndef __INTEL_COMPILER | |
| choke me | |
| @%:@endif], [ICC=[yes]], [ICC=[no]]) | |
| if test "$ICC" = no; then | |
| CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline" | |
| PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) | |
| PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels]) | |
| else | |
| # Intel compiler has a bug/misoptimization in checking for | |
| # division by NAN (NaN == 0), -mp1 fixes it, so add it to the | |
| # CFLAGS. | |
| PGAC_PROG_CC_CFLAGS_OPT([-mp1]) | |
| fi | |
| # Disable strict-aliasing rules; needed for gcc 3.3+ | |
| PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing]) | |
| elif test ${CC} = "xlc"; then | |
| # AIX xlc has to have strict aliasing turned off too | |
| PGAC_PROG_CC_CFLAGS_OPT([-qnoansialias]) | |
| fi | |
| # supply -g if --enable-debug | |
| if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then | if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then |
| CFLAGS="$CFLAGS -g" | CFLAGS="$CFLAGS -g" |
| fi | fi |
| AC_MSG_NOTICE([using CFLAGS=$CFLAGS]) | AC_MSG_NOTICE([using CFLAGS=$CFLAGS]) |
| # We already have this in Makefile.win32, but configure needs it too | |
| if test "$PORTNAME" = "win32"; then | |
| CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND" | |
| fi | |
| # Check if the compiler still works with the template settings | # Check if the compiler still works with the template settings |
| AC_MSG_CHECKING([whether the C compiler still works]) | AC_MSG_CHECKING([whether the C compiler still works]) |
| AC_TRY_LINK([], [return 0;], | AC_TRY_LINK([], [return 0;], |
| Line 250 AC_TRY_LINK([], [return 0;], | Line 297 AC_TRY_LINK([], [return 0;], |
| [AC_MSG_RESULT(no) | [AC_MSG_RESULT(no) |
| AC_MSG_ERROR([cannot proceed])]) | AC_MSG_ERROR([cannot proceed])]) |
| # Defend against gcc -ffastmath | # Defend against gcc -ffast-math |
| if test "$GCC" = yes; then | if test "$GCC" = yes; then |
| AC_TRY_COMPILE([], [@%:@ifdef __FAST_MATH__ | AC_TRY_COMPILE([], [@%:@ifdef __FAST_MATH__ |
| choke me | choke me |
| Line 272 AC_DEFINE_UNQUOTED(PG_VERSION_STR, | Line 319 AC_DEFINE_UNQUOTED(PG_VERSION_STR, |
| # | # |
| # Set up TAS assembly code if needed; the template file has now had its | |
| # chance to request this. | |
| # | |
| AC_CONFIG_LINKS([src/backend/port/tas.s:src/backend/port/tas/${tas_file}]) | |
| if test "$need_tas" = yes ; then | |
| TAS=tas.o | |
| else | |
| TAS="" | |
| fi | |
| AC_SUBST(TAS) | |
| # | |
| # Automatic dependency tracking | # Automatic dependency tracking |
| # | # |
| PGAC_ARG_BOOL(enable, depend, no, [ --enable-depend turn on automatic dependency tracking], | PGAC_ARG_BOOL(enable, depend, no, [ --enable-depend turn on automatic dependency tracking], |
| Line 291 PGAC_ARG_BOOL(enable, cassert, no, [ -- | Line 352 PGAC_ARG_BOOL(enable, cassert, no, [ -- |
| # Include directories | # Include directories |
| # | # |
| ac_save_IFS=$IFS | ac_save_IFS=$IFS |
| IFS="${IFS}:" | IFS="${IFS}${PATH_SEPARATOR}" |
| # SRCH_INC comes from the template file | # SRCH_INC comes from the template file |
| for dir in $with_includes $SRCH_INC; do | for dir in $with_includes $SRCH_INC; do |
| if test -d "$dir"; then | if test -d "$dir"; then |
| Line 308 AC_SUBST(INCLUDES) | Line 369 AC_SUBST(INCLUDES) |
| # Library directories | # Library directories |
| # | # |
| ac_save_IFS=$IFS | ac_save_IFS=$IFS |
| IFS="${IFS}:" | IFS="${IFS}${PATH_SEPARATOR}" |
| # LIBRARY_DIRS comes from command line, SRCH_LIB from template file. | # LIBRARY_DIRS comes from command line, SRCH_LIB from template file. |
| for dir in $LIBRARY_DIRS $SRCH_LIB; do | for dir in $LIBRARY_DIRS $SRCH_LIB; do |
| if test -d "$dir"; then | if test -d "$dir"; then |
| Line 320 done | Line 381 done |
| IFS=$ac_save_IFS | IFS=$ac_save_IFS |
| # | # |
| # Enable libpq to be thread-safe | # Enable thread-safe client libraries |
| # | # |
| AC_MSG_CHECKING([allow threaded libpq]) | AC_MSG_CHECKING([allow thread-safe client libraries]) |
| PGAC_ARG_BOOL(with, threads, no, [ --with-threads allow libpq and ecpg to be thread-safe], | PGAC_ARG_BOOL(enable, thread-safety, no, [ --enable-thread-safety make client libraries thread-safe]) |
| [AC_DEFINE([USE_THREADS], 1, [Define to 1 to build libpq and ecpg to be thread-safe. (--with-threads)])]) | PGAC_ARG_BOOL(enable, thread-safety-force, no, [ --enable-thread-safety-force force thread-safety in spite of thread test failure]) |
| if test "$enable_thread_safety" = yes -o \ | |
| AC_MSG_RESULT([$with_threads]) | "$enable_thread_safety_force" = yes; then |
| AC_SUBST(with_threads) | enable_thread_safety="yes" # for 'force' |
| AC_DEFINE([ENABLE_THREAD_SAFETY], 1, | |
| [Define to 1 to build client libraries as thread-safe code. (--enable-thread-safety)]) | |
| fi | |
| AC_MSG_RESULT([$enable_thread_safety]) | |
| AC_SUBST(enable_thread_safety) | |
| # | # |
| # Tcl/Tk | # Optionally build Tcl modules (PL/Tcl) |
| # | # |
| AC_MSG_CHECKING([whether to build with Tcl]) | AC_MSG_CHECKING([whether to build with Tcl]) |
| PGAC_ARG_BOOL(with, tcl, no, [ --with-tcl build Tcl and Tk interfaces]) | PGAC_ARG_BOOL(with, tcl, no, [ --with-tcl build Tcl modules (PL/Tcl)]) |
| AC_MSG_RESULT([$with_tcl]) | AC_MSG_RESULT([$with_tcl]) |
| AC_SUBST([with_tcl]) | AC_SUBST([with_tcl]) |
| # If Tcl is enabled (above) then Tk is also, unless the user disables it using --without-tk | |
| AC_MSG_CHECKING([whether to build with Tk]) | |
| if test "$with_tcl" = yes; then | |
| PGAC_ARG_BOOL(with, tk, yes, [ --without-tk do not build Tk interfaces if Tcl is enabled]) | |
| else | |
| with_tk=no | |
| fi | |
| AC_MSG_RESULT([$with_tk]) | |
| AC_SUBST([with_tk]) | |
| # We see if the path to the Tcl/Tk configuration scripts is specified. | # We see if the path to the Tcl/Tk configuration scripts is specified. |
| # This will override the use of tclsh to find the paths to search. | # This will override the use of tclsh to find the paths to search. |
| PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConfig.sh are in DIR]) | PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh is in DIR]) |
| # We see if the path to the Tk configuration scripts is specified. | |
| # This will override the use of tclsh to find the paths to search. | |
| PGAC_ARG_REQ(with, tkconfig, [ --with-tkconfig=DIR tkConfig.sh is in DIR]) | |
| # | # |
| # Optionally build Perl modules (PL/Perl) | # Optionally build Perl modules (PL/Perl) |
| Line 367 AC_MSG_RESULT([$with_perl]) | Line 417 AC_MSG_RESULT([$with_perl]) |
| AC_SUBST(with_perl) | AC_SUBST(with_perl) |
| # | # |
| # Optionally build Python interface module | # Optionally build Python modules (PL/Python) |
| # | # |
| AC_MSG_CHECKING([whether to build Python modules]) | AC_MSG_CHECKING([whether to build Python modules]) |
| PGAC_ARG_BOOL(with, python, no, [ --with-python build Python interface module]) | PGAC_ARG_BOOL(with, python, no, [ --with-python build Python modules (PL/Python)]) |
| AC_MSG_RESULT([$with_python]) | AC_MSG_RESULT([$with_python]) |
| AC_SUBST(with_python) | AC_SUBST(with_python) |
| # | # |
| # Optionally build the Java/JDBC tools | |
| # | |
| AC_MSG_CHECKING([whether to build Java/JDBC tools]) | |
| PGAC_ARG_BOOL(with, java, no, [ --with-java build JDBC interface and Java tools], | |
| [AC_MSG_RESULT(yes) | |
| PGAC_PATH_ANT | |
| if test -z "$ANT"; then | |
| AC_MSG_ERROR([Ant is required to build Java components | |
| If you have Ant already installed, see config.log for details on the failure.]) | |
| fi | |
| if "$ANT" -version | sed q | egrep -v ' 1\.[[5-9]]| [[2-9]]\.' >/dev/null ; then | |
| AC_MSG_ERROR([Ant version >= 1.5 is required to build Java components]) | |
| fi], | |
| [AC_MSG_RESULT(no)]) | |
| AC_SUBST(with_java) | |
| dnl A note on the Kerberos and OpenSSL options: | |
| dnl | |
| dnl The user can give an argument to the option in order the specify | |
| dnl the base path of the respective installation (what he specified | |
| dnl perhaps as --prefix). If no argument is given ($withval is "yes") | |
| dnl then we take the path where the package installs by default. This | |
| dnl way the user doesn't have to use redundant --with-includes and | |
| dnl --with-libraries options, but he can still use them if the layout | |
| dnl is non-standard. | |
| # | |
| # Kerberos 4 | |
| # | |
| AC_MSG_CHECKING([whether to build with Kerberos 4 support]) | |
| PGAC_ARG_OPTARG(with, krb4, [[ --with-krb4[=DIR] build with Kerberos 4 support [/usr/athena]]], | |
| [krb4_prefix=/usr/athena], | |
| [krb4_prefix=$withval], | |
| [ | |
| AC_MSG_RESULT(yes) | |
| AC_DEFINE(KRB4, 1, [Define to build with Kerberos 4 support. (--with-krb4)]) | |
| if test -d "$krb4_prefix/include"; then | |
| INCLUDES="$INCLUDES -I$krb4_prefix/include" | |
| fi | |
| if test -d "$krb4_prefix/lib"; then | |
| LIBDIRS="$LIBDIRS -L$krb4_prefix/lib" | |
| fi | |
| krb_srvtab="/etc/srvtab" | |
| ], | |
| [AC_MSG_RESULT(no)]) | |
| AC_SUBST(with_krb4) | |
| # | |
| # Kerberos 5 | # Kerberos 5 |
| # | # |
| AC_MSG_CHECKING([whether to build with Kerberos 5 support]) | AC_MSG_CHECKING([whether to build with Kerberos 5 support]) |
| PGAC_ARG_OPTARG(with, krb5, [[ --with-krb5[=DIR] build with Kerberos 5 support [/usr/athena]]], | PGAC_ARG_BOOL(with, krb5, no, [ --with-krb5 build with Kerberos 5 support], |
| [krb5_prefix=/usr/athena], | |
| [krb5_prefix=$withval], | |
| [ | [ |
| AC_MSG_RESULT([yes]) | |
| AC_DEFINE(KRB5, 1, [Define to build with Kerberos 5 support. (--with-krb5)]) | AC_DEFINE(KRB5, 1, [Define to build with Kerberos 5 support. (--with-krb5)]) |
| if test -d "$krb5_prefix/include"; then | |
| INCLUDES="$INCLUDES -I$krb5_prefix/include" | |
| fi | |
| if test -d "$krb5_prefix/lib"; then | |
| LIBDIRS="$LIBDIRS -L$krb5_prefix/lib" | |
| fi | |
| krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab" | krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab" |
| ], | ]) |
| [AC_MSG_RESULT(no)]) | AC_MSG_RESULT([$with_krb5]) |
| AC_SUBST(with_krb5) | AC_SUBST(with_krb5) |
| # Using both Kerberos 4 and Kerberos 5 at the same time isn't going to work. | |
| if test "$with_krb4" = yes && test "$with_krb5" = yes ; then | |
| AC_MSG_ERROR([Kerberos 4 and Kerberos 5 support cannot be combined]) |