@@ -497,99 +497,41 @@ AC_DEFINE_UNQUOTED(PG_KRB_SRVTAB, ["$krb_srvtab"], [The location of the Kerberos
497497
498498
499499
500- dnl We include odbc support unless we disable it with --with-odbc=false
501- AC_MSG_CHECKING(setting USE_ODBC)
502- AC_ARG_WITH(
503- odbc,
504- [ --with-odbc build ODBC driver package ],
505- [
506- case "$withval" in
507- y | ye | yes)USE_ODBC=true; AC_MSG_RESULT(enabled) ;;
508- *)USE_ODBC=false; AC_MSG_RESULT(disabled) ;;
509- esac
510- ],
511- [ USE_ODBC=false; AC_MSG_RESULT(disabled) ]
512- )
513- export USE_ODBC
500+ dnl
501+ dnl Optionally enable the building of the ODBC driver
502+ dnl
503+
504+ dnl Old option name
505+ if test "x${with_odbc+set}" = xset && test "x${enable_odbc+set}" != xset; then
506+ enable_odbc=$with_odbc
507+ fi
508+
509+ AC_MSG_CHECKING(whether to build the ODBC driver)
510+ AC_ARG_ENABLE(odbc, [ --enable-odbc build the ODBC driver package],
511+ [if test x"$enableval" = x"yes" ; then
512+ AC_MSG_RESULT(yes)
513+ else
514+ AC_MSG_RESULT(no)
515+ fi],
516+ [AC_MSG_RESULT(no)])
517+ AC_SUBST(enable_odbc)
514518
515- dnl check if we want to use unixODBC to provide access to the odbc.ini
516- dnl files
517-
518- use_unixODBC=no
519- AC_MSG_CHECKING(setting USE_UNIXODBC)
520- AC_ARG_WITH(
521- unixODBC,
522- [ --with-unixODBC[=DIR] Use unixODBC located in DIR],
523- [
524- use_unixODBC=yes;
525- unixODBC="$withval";
526- USE_ODBC=true;
527- AC_MSG_RESULT(enabled);
528- ],
529- [ USE_ODBC=false; use_unixODBC=no; AC_MSG_RESULT(disabled) ]
530- )
531- export USE_ODBC
532519
533520dnl Allow for overriding the default location of the odbcinst.ini
534- dnl file which is normally ${prefix}/share or ${prefix} if this is
535- dnl being compiled inside the postgres distribution.
536- dnl Link in the port and template directories
537- dnl to help build a "standalone ODBC" tar file
538- if test "X$USE_ODBC" = "Xtrue"
539- then
540- AC_LINK_FILES(src/include/port, src/interfaces/odbc/port)
541- AC_LINK_FILES(src/makefiles, src/interfaces/odbc/makefiles)
542- AC_LINK_FILES(src/template, src/interfaces/odbc/template)
543- AC_LINK_FILES(src/include/config.h, src/interfaces/odbc/config.h)
544-
545- AC_MSG_CHECKING(setting ODBCINST)
546- AC_ARG_WITH(
547- odbcinst,
548- [ --with-odbcinst=DIR change default directory for odbcinst.ini],
549- AC_DEFINE_UNQUOTED(ODBCINST, ${with_odbcinst}) AC_MSG_RESULT($with_odbcinst),
550- AC_DEFINE_UNQUOTED(ODBCINST, ${ODBCINSTDIR}) AC_MSG_RESULT(${ODBCINSTDIR})
551- )
521+ dnl file which is normally ${datadir} (i.e., ${prefix}/share).
522+ if test x"$enable_odbc" = x"yes" ; then
523+ AC_ARG_WITH(odbcinst, [ --with-odbcinst=DIR default directory for odbcinst.ini [datadir]],
524+ [if test x"$with_odbcinst" = x"yes" || test x"$with_odbcinst" = x"no" ; then
525+ AC_MSG_ERROR([You must supply an argument to the --with-odbcinst option.])
552526fi
553- if test "X$with_odbcinst" != "X"
554- then
555- ODBCINSTDIR=$with_odbcinst
527+ odbcinst_ini_dir=$withval],
528+ [odbcinst_ini_dir='${datadir}'])
529+ else
530+ odbcinst_ini_dir='${datadir}'
556531fi
557- AC_SUBST(ODBCINSTDIR)
558-
559- #check for unixODBC libs
532+ AC_SUBST(odbcinst_ini_dir)
560533
561- if test "x$use_unixODBC" = "xyes"
562- then
563534
564- # default to /usr/local if not specified
565- if test "x$unixODBC" = "x"
566- then
567- unixODBC="/usr/local";
568- fi
569-
570- unixODBC_libs="$unixODBC/lib"
571- unixODBC_includes="$unixODBC/include"
572-
573- INCLUDES="$INCLUDES -I$unixODBC_includes"
574- AC_CHECK_HEADERS(sql.h sqlext.h odbcinst.h,
575- unixODBC_ok=yes;
576- odbc_headers="$odbc_headers $ac_hdr",
577- unixODBC_ok=no )
578-
579- if test "x$unixODBC_ok" != "xyes"
580- then
581- AC_MSG_ERROR([Unable to find the unixODBC headers in $1])
582- fi
583-
584- save_LIBS="$LIBS"
585- LIBS="-L$unixODBC_libs $LIBS"
586-
587- AC_CHECK_LIB(odbcinst,SQLGetPrivateProfileString,
588- [AC_DEFINE(HAVE_SQL_GET_PRIV_PROFILE)
589- SHLIB_ODBC="$LDFLAGS_ODBC -L$unixODBC_libs -lodbcinst" ],
590- [LIBS="$save_LIBS"] )
591- fi
592- export SHLIB_ODBC
593535
594536dnl Unless we specify the command line options
595537dnl--enable cassertto explicitly enable it
@@ -658,8 +600,6 @@ AC_SUBST(DL_LIB)
658600AC_SUBST(USE_TCL)
659601AC_SUBST(USE_TK)
660602AC_SUBST(WISH)
661- AC_SUBST(USE_ODBC)
662- AC_SUBST(SHLIB_ODBC)
663603AC_SUBST(MULTIBYTE)
664604
665605
@@ -699,13 +639,16 @@ case "$host_os" in
699639 hpux*)
700640INSTL_SHLIB_OPTS="-m 555" ;;
701641esac
702-
703- AC_SUBST(INSTALL)
704642AC_SUBST(INSTLOPTS)
705643AC_SUBST(INSTL_LIB_OPTS)
706644AC_SUBST(INSTL_SHLIB_OPTS)
707645AC_SUBST(INSTL_EXE_OPTS)
708646
647+
648+ INSTALL_SHLIB="\${INSTALL} $INST_SHLIB_OPTS"
649+ AC_SUBST(INSTALL_SHLIB)
650+
651+
709652AC_PROG_AWK
710653
711654AC_PROG_LEX
@@ -788,9 +731,8 @@ AC_CHECK_HEADERS(unistd.h)
788731AC_CHECK_HEADERS(values.h)
789732AC_CHECK_HEADERS(sys/exec.h sys/pstat.h machine/vmparam.h)
790733AC_CHECK_HEADERS(sys/types.h sys/socket.h)
791- dnl ODBC headers...
792734AC_CHECK_HEADERS(sys/param.h pwd.h)
793- dnl
735+
794736
795737dnl Checks for typedefs, structures, and compiler characteristics.
796738AC_C_CONST
@@ -1241,26 +1183,6 @@ See the file 'config.log' for further diagnostics.])
12411183LDFLAGS="$ice_save_LDFLAGS"
12421184fi
12431185
1244- dnl cause configure to recurse into subdirectories with their own configure
1245- dnl Darn, setting AC_CONFIG_SUBDIRS sets a list $subdirs$ in the configure output
1246- dnl file, but then configure doesn't bother using that list. Probably a bug in
1247- dnl this version of autoconf.
1248- dnl So at the moment interfaces/odbc gets configured unconditionally.
1249- dnl - thomas 1998-10-05
1250- #if test "X$USE_ODBC" = "Xtrue"
1251- #then
1252- #AC_CONFIG_SUBDIRS(interfaces/odbc)
1253- #fi
1254- if test "$USE_ODBC" = "true"
1255- then
1256- PWD_INCDIR=no
1257- AC_CHECK_HEADER(pwd.h, PWD_INCDIR=yes)
1258- if test "$PWD_INCDIR" = "no"; then
1259- AC_MSG_WARN(odbc support disabled; pwd.h missing)
1260- USE_ODBC=
1261- fi
1262- AC_SUBST(USE_ODBC)
1263- fi
12641186
12651187dnl Output files that are neither makefiles nor shell scripts probably
12661188dnl need fully-expanded substitutions, rather than partial expansions
@@ -1304,7 +1226,6 @@ AC_OUTPUT(
13041226src/interfaces/libpgeasy/Makefile
13051227src/interfaces/libpgtcl/Makefile
13061228src/interfaces/odbc/GNUmakefile
1307- src/interfaces/odbc/Makefile.global
13081229src/interfaces/python/GNUmakefile
13091230src/pl/Makefile
13101231src/pl/plpgsql/src/Makefile