@@ -497,99 +497,41 @@ AC_DEFINE_UNQUOTED(PG_KRB_SRVTAB, ["$krb_srvtab"], [The location of the Kerberos
497
497
498
498
499
499
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)
514
518
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
532
519
533
520
dnl 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.])
552
526
fi
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}'
556
531
fi
557
- AC_SUBST(ODBCINSTDIR)
558
-
559
- #check for unixODBC libs
532
+ AC_SUBST(odbcinst_ini_dir)
560
533
561
- if test "x$use_unixODBC" = "xyes"
562
- then
563
534
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
593
535
594
536
dnl Unless we specify the command line options
595
537
dnl--enable cassertto explicitly enable it
@@ -658,8 +600,6 @@ AC_SUBST(DL_LIB)
658
600
AC_SUBST(USE_TCL)
659
601
AC_SUBST(USE_TK)
660
602
AC_SUBST(WISH)
661
- AC_SUBST(USE_ODBC)
662
- AC_SUBST(SHLIB_ODBC)
663
603
AC_SUBST(MULTIBYTE)
664
604
665
605
@@ -699,13 +639,16 @@ case "$host_os" in
699
639
hpux*)
700
640
INSTL_SHLIB_OPTS="-m 555" ;;
701
641
esac
702
-
703
- AC_SUBST(INSTALL)
704
642
AC_SUBST(INSTLOPTS)
705
643
AC_SUBST(INSTL_LIB_OPTS)
706
644
AC_SUBST(INSTL_SHLIB_OPTS)
707
645
AC_SUBST(INSTL_EXE_OPTS)
708
646
647
+
648
+ INSTALL_SHLIB="\${INSTALL} $INST_SHLIB_OPTS"
649
+ AC_SUBST(INSTALL_SHLIB)
650
+
651
+
709
652
AC_PROG_AWK
710
653
711
654
AC_PROG_LEX
@@ -788,9 +731,8 @@ AC_CHECK_HEADERS(unistd.h)
788
731
AC_CHECK_HEADERS(values.h)
789
732
AC_CHECK_HEADERS(sys/exec.h sys/pstat.h machine/vmparam.h)
790
733
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
791
- dnl ODBC headers...
792
734
AC_CHECK_HEADERS(sys/param.h pwd.h)
793
- dnl
735
+
794
736
795
737
dnl Checks for typedefs, structures, and compiler characteristics.
796
738
AC_C_CONST
@@ -1241,26 +1183,6 @@ See the file 'config.log' for further diagnostics.])
1241
1183
LDFLAGS="$ice_save_LDFLAGS"
1242
1184
fi
1243
1185
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
1264
1186
1265
1187
dnl Output files that are neither makefiles nor shell scripts probably
1266
1188
dnl need fully-expanded substitutions, rather than partial expansions
@@ -1304,7 +1226,6 @@ AC_OUTPUT(
1304
1226
src/interfaces/libpgeasy/Makefile
1305
1227
src/interfaces/libpgtcl/Makefile
1306
1228
src/interfaces/odbc/GNUmakefile
1307
- src/interfaces/odbc/Makefile.global
1308
1229
src/interfaces/python/GNUmakefile
1309
1230
src/pl/Makefile
1310
1231
src/pl/plpgsql/src/Makefile