2 dnl ========= Large File Support ==============
3 dnl By default, many hosts won't let programs access large files;
4 dnl one must use special compiler options to get large-file access to work.
5 dnl For more details about this brain damage please see:
6 dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
8 dnl Written by Paul Eggert <eggert@twinsun.com>.
10 dnl Internal subroutine of AC_SYS_LARGEFILE.
11 dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
12 AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
13 [AC_CACHE_CHECK([for $1 value to request large file support],
14 ac_cv_sys_largefile_$1,
15 [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || {
16 ac_cv_sys_largefile_$1=no
19 # IRIX 6.2 and later require cc -n32.
21 irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
23 if test "$GCC" != yes; then
24 ac_cv_sys_largefile_CFLAGS=-n32
27 CC="$CC $ac_cv_sys_largefile_CFLAGS"
28 AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
33 dnl Internal subroutine of AC_SYS_LARGEFILE.
34 dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
35 AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
45 dnl Internal subroutine of AC_SYS_LARGEFILE.
46 dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
47 AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
48 [AC_CACHE_CHECK([for $1], $2,
52 for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
57 $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
62 if test "[$]$2" != no; then
63 AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
66 AC_DEFUN(AC_SYS_LARGEFILE,
67 [AC_REQUIRE([AC_CANONICAL_HOST])
68 AC_ARG_ENABLE(largefile,
69 [ --disable-largefile omit support for large files])
70 if test "$enable_largefile" != no; then
71 AC_CHECK_TOOL(GETCONF, getconf)
72 AC_SYS_LARGEFILE_FLAGS(CFLAGS)
73 AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
74 AC_SYS_LARGEFILE_FLAGS(LIBS)
76 for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
79 -D_FILE_OFFSET_BITS=*) ;;
80 -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
81 -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
83 AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
85 AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
88 AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
89 AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
90 AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
91 ac_cv_sys_file_offset_bits,
92 [Number of bits in a file offset, on hosts where this is settable.],
94 # HP-UX 10.20 and later
95 hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
96 ac_cv_sys_file_offset_bits=64 ;;
98 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
99 ac_cv_sys_largefile_source,
100 [Define to make fseeko etc. visible, on some hosts.],
102 # HP-UX 10.20 and later
103 hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
104 ac_cv_sys_largefile_source=1 ;;
106 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
107 ac_cv_sys_large_files,
108 [Define for large files, on AIX-style hosts.],
111 aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
112 ac_cv_sys_large_files=1 ;;
116 dnl ==========================================================
118 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
119 AC_DEFUN(SIGNAL_CHECK,
120 [AC_REQUIRE([AC_TYPE_SIGNAL])
121 AC_MSG_CHECKING(for type of signal functions)
122 AC_CACHE_VAL(bash_cv_signal_vintage,
124 AC_TRY_LINK([#include <signal.h>],[
127 sigemptyset(&ss); sigsuspend(&ss);
128 sigaction(SIGINT, &sa, (struct sigaction *) 0);
129 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
130 ], bash_cv_signal_vintage=posix,
132 AC_TRY_LINK([#include <signal.h>], [
133 int mask = sigmask(SIGINT);
134 sigsetmask(mask); sigblock(mask); sigpause(mask);
135 ], bash_cv_signal_vintage=4.2bsd,
139 RETSIGTYPE foo() { }], [
140 int mask = sigmask(SIGINT);
141 sigset(SIGINT, foo); sigrelse(SIGINT);
142 sighold(SIGINT); sigpause(SIGINT);
143 ], bash_cv_signal_vintage=svr3, bash_cv_signal_vintage=v7
148 AC_MSG_RESULT($bash_cv_signal_vintage)
149 if test "$bash_cv_signal_vintage" = posix; then
150 AC_DEFINE(HAVE_POSIX_SIGNALS)
151 elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
152 AC_DEFINE(HAVE_BSD_SIGNALS)
153 elif test "$bash_cv_signal_vintage" = svr3; then
154 AC_DEFINE(HAVE_USG_SIGHOLD)
158 AC_DEFUN(BA_CONDITIONAL,
170 AC_DEFUN(BA_CHECK_OPSYS,
171 [AC_MSG_CHECKING(for Operating System)
173 if test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
175 BA_CONDITIONAL(HAVE_SUN_OS, $TRUEPRG)
176 AC_DEFINE(HAVE_SUN_OS)
178 BA_CONDITIONAL(HAVE_SUN_OS, $FALSEPRG)
181 if test $HAVE_UNAME=yes -a x`uname -s` = xOSF1
183 BA_CONDITIONAL(HAVE_OSF1_OS, $TRUEPRG)
184 AC_DEFINE(HAVE_OSF1_OS)
186 BA_CONDITIONAL(HAVE_OSF1_OS, $FALSEPRG)
189 if test $HAVE_UNAME=yes -a x`uname -s` = xAIX
191 BA_CONDITIONAL(HAVE_AIX_OS, $TRUEPRG)
192 AC_DEFINE(HAVE_AIX_OS)
194 BA_CONDITIONAL(HAVE_AIX_OS, $FALSEPRG)
197 if test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
199 BA_CONDITIONAL(HAVE_HPUX_OS, $TRUEPRG)
200 AC_DEFINE(HAVE_HPUX_OS)
202 BA_CONDITIONAL(HAVE_HPUX_OS, $FALSEPRG)
205 if test $HAVE_UNAME=yes -a x`uname -s` = xLinux
207 BA_CONDITIONAL(HAVE_LINUX_OS, $TRUEPRG)
208 AC_DEFINE(HAVE_LINUX_OS)
210 BA_CONDITIONAL(HAVE_LINUX_OS, $FALSEPRG)
213 if test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
215 BA_CONDITIONAL(HAVE_FREEBSD_OS, $TRUEPRG)
216 AC_DEFINE(HAVE_FREEBSD_OS)
218 BA_CONDITIONAL(HAVE_FREEBSD_OS, $FALSEPRG)
221 if test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
223 BA_CONDITIONAL(HAVE_NETBSD_OS, $TRUEPRG)
224 AC_DEFINE(HAVE_NETBSD_OS)
226 BA_CONDITIONAL(HAVE_NETBSD_OS, $FALSEPRG)
229 if test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
231 BA_CONDITIONAL(HAVE_OPENBSD_OS, $TRUEPRG)
232 AC_DEFINE(HAVE_OPENBSD_OS)
234 BA_CONDITIONAL(HAVE_OPENBSD_OS, $FALSEPRG)
237 if test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
239 BA_CONDITIONAL(HAVE_BSDI_OS, $TRUEPRG)
240 AC_DEFINE(HAVE_BSDI_OS)
242 BA_CONDITIONAL(HAVE_BSDI_OS, $FALSEPRG)
245 if test $HAVE_UNAME=yes -a x`uname -s` = xSGI
247 BA_CONDITIONAL(HAVE_SGI_OS, $TRUEPRG)
248 AC_DEFINE(HAVE_SGI_OS)
250 BA_CONDITIONAL(HAVE_SGI_OS, $FALSEPRG)
253 if test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
255 BA_CONDITIONAL(HAVE_IRIX_OS, $TRUEPRG)
256 AC_DEFINE(HAVE_IRIX_OS)
258 BA_CONDITIONAL(HAVE_IRIX_OS, $FALSEPRG)
264 AC_DEFUN(BA_CHECK_OPSYS_DISTNAME,
265 [AC_MSG_CHECKING(for Operating System Distribution)
266 if test "x$DISTNAME" != "x"
268 echo "distname set to $DISTNAME"
269 elif test $HAVE_UNAME=yes -a x`uname -s` = xOSF1
272 elif test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
275 elif test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
278 elif test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
281 elif test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
284 elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
287 elif test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
290 elif test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
293 elif test -f /etc/SuSE-release
296 elif test -d /etc/SuSEconfig
299 elif test -d /usr/src/OpenLinux
302 elif test -f /etc/redhat-release
305 elif test -f /etc/gentoo-release
308 elif test -f /etc/debian_version
311 elif test -f /etc/slackware-version
314 elif test "$ac_cv_cygwin" = yes
317 AC_DEFINE(HAVE_CYGWIN)
324 AC_DEFUN(BA_CHECK_MYSQL_DB,
327 AC_MSG_CHECKING(for MySQL support)
330 Which DBMS do you want to use (please select only one):
331 --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base
332 install directory, default is to search through
333 a number of common places for the MySQL files.],
335 if test "$withval" != "no"; then
336 if test "$withval" = "yes"; then
337 if test -f /usr/local/mysql/include/mysql/mysql.h; then
338 MYSQL_INCDIR=/usr/local/mysql/include/mysql
339 MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
340 MYSQL_BINDIR=/usr/local/mysql/bin
341 elif test -f /usr/include/mysql/mysql.h; then
342 MYSQL_INCDIR=/usr/include/mysql
343 MYSQL_LIBDIR=/usr/lib/mysql
344 MYSQL_BINDIR=/usr/bin
345 elif test -f /usr/include/mysql.h; then
346 MYSQL_INCDIR=/usr/include
347 MYSQL_LIBDIR=/usr/lib
348 MYSQL_BINDIR=/usr/bin
349 elif test -f /usr/local/include/mysql/mysql.h; then
350 MYSQL_INCDIR=/usr/local/include/mysql
351 MYSQL_LIBDIR=/usr/local/lib/mysql
352 MYSQL_BINDIR=/usr/local/bin
353 elif test -f /usr/local/include/mysql.h; then
354 MYSQL_INCDIR=/usr/local/include
355 MYSQL_LIBDIR=/usr/local/lib
356 MYSQL_BINDIR=/usr/local/bin
359 AC_MSG_ERROR(Unable to find mysql.h in standard locations)
362 if test -f $withval/include/mysql/mysql.h; then
363 MYSQL_INCDIR=$withval/include/mysql
364 MYSQL_LIBDIR=$withval/lib/mysql
365 MYSQL_BINDIR=$withval/bin
366 elif test -f $withval/include/mysql.h; then
367 MYSQL_INCDIR=$withval/include
368 MYSQL_LIBDIR=$withval/lib
369 MYSQL_BINDIR=$withval/bin
372 AC_MSG_ERROR(Invalid MySQL directory $withval - unable to find mysql.h under $withval)
375 SQL_INCLUDE=-I$MYSQL_INCDIR
376 SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient -lz"
377 SQL_BINDIR=$MYSQL_BINDIR
379 AC_DEFINE(HAVE_MYSQL)
393 AC_ARG_WITH(embedded-mysql,
395 Which DBMS do you want to use (please select only one):
396 --with-embedded-mysql[=DIR] Include MySQL support. DIR is the MySQL base
397 install directory, default is to search through
398 a number of common places for the MySQL files.],
400 if test "$withval" != "no"; then
401 if test "$withval" = "yes"; then
402 if test -f /usr/local/mysql/include/mysql/mysql.h; then
403 MYSQL_INCDIR=/usr/local/mysql/include/mysql
404 MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
405 MYSQL_BINDIR=/usr/local/mysql/bin
406 elif test -f /usr/include/mysql/mysql.h; then
407 MYSQL_INCDIR=/usr/include/mysql
408 MYSQL_LIBDIR=/usr/lib/mysql
409 MYSQL_BINDIR=/usr/bin
410 elif test -f /usr/include/mysql.h; then
411 MYSQL_INCDIR=/usr/include
412 MYSQL_LIBDIR=/usr/lib
413 MYSQL_BINDIR=/usr/bin
414 elif test -f /usr/local/include/mysql/mysql.h; then
415 MYSQL_INCDIR=/usr/local/include/mysql
416 MYSQL_LIBDIR=/usr/local/lib/mysql
417 MYSQL_BINDIR=/usr/local/bin
418 elif test -f /usr/local/include/mysql.h; then
419 MYSQL_INCDIR=/usr/local/include
420 MYSQL_LIBDIR=/usr/local/lib
421 MYSQL_BINDIR=/usr/local/bin
424 AC_MSG_ERROR(Unable to find mysql.h in standard locations)
427 if test -f $withval/include/mysql/mysql.h; then
428 MYSQL_INCDIR=$withval/include/mysql
429 MYSQL_LIBDIR=$withval/lib/mysql
430 MYSQL_BINDIR=$withval/bin
431 elif test -f $withval/include/mysql.h; then
432 MYSQL_INCDIR=$withval/include
433 MYSQL_LIBDIR=$withval/lib
434 MYSQL_BINDIR=$withval/bin
437 AC_MSG_ERROR(Invalid MySQL directory $withval - unable to find mysql.h under $withval)
440 SQL_INCLUDE=-I$MYSQL_INCDIR
441 SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqld -lz -lm -lcrypt"
442 SQL_BINDIR=$MYSQL_BINDIR
444 AC_DEFINE(HAVE_MYSQL)
445 AC_DEFINE(HAVE_EMBEDDED_MYSQL)
461 AC_SUBST(SQL_INCLUDE)
467 AC_DEFUN(BA_CHECK_SQLITE_DB,
470 AC_MSG_CHECKING(for SQLite support)
473 Which DBMS do you want to use (please select only one):
474 --with-sqlite[=DIR] Include SQLite support. DIR is the SQLite base
475 install directory, default is to search through
476 a number of common places for the SQLite files.],
478 if test "$withval" != "no"; then
479 if test "$withval" = "yes"; then
480 if test -f /usr/local/include/sqlite.h; then
481 SQLITE_INCDIR=/usr/local/include
482 SQLITE_LIBDIR=/usr/local/lib
483 SQLITE_BINDIR=/usr/local/bin
484 elif test -f /usr/include/sqlite.h; then
485 SQLITE_INCDIR=/usr/include
486 SQLITE_LIBDIR=/usr/lib
487 SQLITE_BINDIR=/usr/bin
490 AC_MSG_ERROR(Unable to find sqlite.h in standard locations)
493 if test -f $withval/sqlite.h; then
494 SQLITE_INCDIR=$withval
495 SQLITE_LIBDIR=$withval
496 SQLITE_BINDIR=$withval
499 AC_MSG_ERROR(Invalid SQLite directory $withval - unable to find sqlite.h under $withval)
502 SQL_INCLUDE=-I$SQLITE_INCDIR
503 SQL_LFLAGS="-L$SQLITE_LIBDIR -lsqlite"
504 SQL_BINDIR=$SQLITE_BINDIR
506 AC_DEFINE(HAVE_SQLITE)
520 AC_SUBST(SQL_INCLUDE)
527 AC_DEFUN(BA_CHECK_SQL_DB,
528 [AC_MSG_CHECKING(Checking for various databases)
529 dnl# --------------------------------------------------------------------------
530 dnl# CHECKING FOR VARIOUS DATABASES (thanks to UdmSearch team)
531 dnl# --------------------------------------------------------------------------
532 dnl Check for some DBMS backend
533 dnl NOTE: we can use only one backend at a time
541 if test x$support_mysql = xyes; then
546 AC_MSG_CHECKING(for Berkeley DB support)
547 AC_ARG_WITH(berkeleydb,
549 Which DBMS do you want to use (please select only one):
550 --with-berkeleydb[=DIR] Include Berkeley DB support. DIR is the Berkeley DB base
551 install directory, default is to search through
552 a number of common places for the DB files.],
554 if test "$withval" != "no"; then
555 if test "$withval" = "yes"; then
556 if test -f /usr/include/db.h; then
557 BERKELEYDB_INCDIR=/usr/include
558 BERKELEYDB_LIBDIR=/usr/lib
561 AC_MSG_ERROR(Invalid Berkeley DB directory - unable to find db.h)
564 if test -f $withval/include/db.h; then
565 BERKELEYDB_INCDIR=$withval/include
566 BERKELEYDBL_LIBDIR=$withval/lib
569 AC_MSG_ERROR(Invalid Berkeley DB directory - unable to find db.h under $withval)
572 SQL_INCLUDE=-I$BERKELEYDB_INCDIR
573 SQL_LFLAGS="-L$BERKELEYDB_LIBDIR -ldb"
575 AC_DEFINE(HAVE_BERKELEY_DB)
588 AC_SUBST(SQL_INCLUDE)
590 if test x$support_berkleydb = xyes; then
595 AC_MSG_CHECKING(for PostgreSQL support)
597 [ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL
598 base install directory, defaults to /usr/local/pgsql.],
600 if test "$withval" != "no"; then
601 if test "$have_db" = "yes"; then
603 AC_MSG_ERROR("You can configure for only one database.");
605 if test "$withval" = "yes"; then
606 if test -f /usr/include/pgsql/libpq-fe.h; then
607 PGSQL_INCDIR=/usr/include/pgsql
609 PGSQL_INCDIR=/usr/local/pgsql/include
611 if test -f /usr/lib/libpq.a; then
612 PGSQL_LIBDIR=/usr/lib
614 PGSQL_LIBDIR=/usr/local/pgsql/lib
617 PGSQL_INCDIR=$withval/include
618 test -d $withval/include/pgsql && PGSQL_INCDIR=$withval/include/pgsql
619 PGSQL_LIBDIR=$withval/lib
620 test -d $withval/lib/pgsql && PGSQL_LIBDIR=$withval/lib/pgsql
622 PGSQL_INCLUDE=-I$PGSQL_INCDIR
623 PGSQL_LFLAGS="-L$PGSQL_LIBDIR -lpq"
624 AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt, [LIBS="-lcrypt $LIBS"]))
626 AC_DEFINE(HAVE_PGSQL)
635 AC_SUBST(PGSQL_LFLAGS)
636 AC_SUBST(PGSQL_INCLUDE)
639 AC_MSG_CHECKING(for mSQL support)
641 [ --with-msql[=DIR] Include mSQL support. DIR is the mSQL base
642 install directory, defaults to /usr/local/Hughes.],
644 if test "$withval" != "no"; then
645 if test "$have_db" = "yes"; then
647 AC_MSG_ERROR("You can configure for only one database.");
650 if test "$withval" = "yes"; then
651 MSQL_INCDIR=/usr/local/Hughes/include
652 MSQL_LIBDIR=/usr/local/Hughes/lib
654 MSQL_INCDIR=$withval/include
655 MSQL_LIBDIR=$withval/lib
657 MSQL_INCLUDE=-I$MSQL_INCDIR
658 MSQL_LFLAGS="-L$MSQL_LIBDIR -lmsql"
669 AC_SUBST(MSQL_LFLAGS)
670 AC_SUBST(MSQL_INCLUDE)
673 AC_MSG_CHECKING(for iODBC support)
675 [ --with-iodbc[=DIR] Include iODBC support. DIR is the iODBC base
676 install directory, defaults to /usr/local.],
678 if test "$withval" != "no"; then
679 if test "$have_db" = "yes"; then
681 AC_MSG_ERROR("You can configure for only one database.");
685 if test "$withval" = "yes"; then
689 if test "$withval" != "no"; then
690 if test -f $withval/include/isql.h; then
691 IODBC_INCDIR=$withval/include
692 IODBC_LIBDIR=$withval/lib
695 AC_MSG_ERROR(Invalid iODBC directory - unable to find isql.h)
697 IODBC_LFLAGS="-L$IODBC_LIBDIR -liodbc"
698 IODBC_INCLUDE=-I$IODBC_INCDIR
699 AC_DEFINE(HAVE_IODBC)
706 AC_SUBST(IODBC_LFLAGS)
707 AC_SUBST(IODBC_INCLUDE)
710 AC_MSG_CHECKING(for unixODBC support)
711 AC_ARG_WITH(unixODBC,
712 [ --with-unixODBC[=DIR] Include unixODBC support. DIR is the unixODBC base
713 install directory, defaults to /usr/local.],
715 if test "$withval" != "no"; then
716 if test "$have_db" = "yes"; then
718 AC_MSG_ERROR("You can configure for only one database.");
722 if test "$withval" = "yes"; then
726 if test "$withval" != "no"; then
727 if test -f $withval/include/sql.h; then
728 UNIXODBC_INCDIR=$withval/include
729 UNIXODBC_LIBDIR=$withval/lib
732 AC_MSG_ERROR(Invalid unixODBC directory - unable to find sql.h)
734 UNIXODBC_LFLAGS="-L$UNIXODBC_LIBDIR -lodbc"
735 UNIXODBC_INCLUDE=-I$UNIXODBC_INCDIR
736 AC_DEFINE(HAVE_UNIXODBC)
743 AC_SUBST(UNIXODBC_LFLAGS)
744 AC_SUBST(UNIXODBC_INCLUDE)
747 AC_MSG_CHECKING(for Solid support)
749 [ --with-solid[=DIR] Include Solid support. DIR is the Solid base
750 install directory, defaults to /usr/local.],
752 if test "$withval" != "no"; then
753 if test "$have_db" = "yes"; then
755 AC_MSG_ERROR("You can configure for only one database.");
759 if test "$withval" = "yes"; then
763 if test "$withval" != "no"; then
764 if test -f $withval/include/cli0cli.h; then
765 SOLID_INCDIR=$withval/include
766 SOLID_LIBDIR=$withval/lib
769 AC_MSG_ERROR(Invalid Solid directory - unable to find cli0cli.h)
771 SOLID_LFLAGS="-L$SOLID_LIBDIR -lsolcli"
772 SOLID_INCLUDE="-I$SOLID_INCDIR"
773 AC_DEFINE(HAVE_SOLID)
780 AC_SUBST(SOLID_LFLAGS)
781 AC_SUBST(SOLID_INCLUDE)
783 AC_MSG_CHECKING(for OpenLink ODBC support)
784 AC_ARG_WITH(openlink,
785 [ --with-openlink[=DIR] Include OpenLink ODBC support.
786 DIR is the base OpenLink ODBC install directory],
788 if test "$withval" != "no"; then
789 if test "$withval" = "yes"; then
791 if test "$have_db" = "yes"; then
793 AC_MSG_ERROR("You can configure for only one database.");
796 if test -f /usr/local/virtuoso-ent/odbcsdk/include/isql.h; then
797 VIRT_INCDIR=/usr/local/virtuoso-ent/odbcsdk/include/
798 VIRT_LIBDIR=/usr/local/virtuoso-ent/odbcsdk/lib/
799 elif test -f /usr/local/virtuoso-lite/odbcsdk/include/isql.h; then
800 VIRT_INCDIR=/usr/local/virtuoso-lite/odbcsdk/include/
801 VIRT_LIBDIR=/usr/local/virtuoso-lite/odbcsdk/lib/
802 elif test -f /usr/local/virtuoso/odbcsdk/include/isql.h; then
803 VIRT_INCDIR=/usr/local/virtuoso/odbcsdk/include/
804 VIRT_LIBDIR=/usr/local/virtuoso/odbcsdk/lib/
807 AC_MSG_ERROR(Invalid OpenLink ODBC directory - unable to find isql.h)
810 if test -f $withval/odbcsdk/include/isql.h; then
811 VIRT_INCDIR=$withval/odbcsdk/include/
812 VIRT_LIBDIR=$withval/odbcsdk/lib/
813 elif test -f $withval/include/isql.h; then
814 VIRT_INCDIR=$withval/include/
815 VIRT_LIBDIR=$withval/lib/
818 AC_MSG_ERROR(Invalid OpenLink ODBC directory - unable to find isql.h under $withval)
821 VIRT_INCLUDE=-I$VIRT_INCDIR
822 VIRT_LFLAGS="-L$VIRT_LIBDIR -liodbc"
834 AC_SUBST(VIRT_LFLAGS)
835 AC_SUBST(VIRT_INCLUDE)
838 AC_MSG_CHECKING(for EasySoft ODBC support)
839 AC_ARG_WITH(easysoft,
840 [ --with-easysoft[=DIR] Include EasySoft ODBC support.
841 DIR is the base EasySoft ODBC install directory],
843 if test "$withval" != "no"; then
844 if test "$withval" = "yes"; then
846 if test "$have_db" = "yes"; then
848 AC_MSG_ERROR("You can configure for only one database.");
851 if test -f /usr/local/easysoft/oob/client/include/sql.h; then
852 EASYSOFT_INCDIR=/usr/local/easysoft/oob/client/include/
853 EASYSOFT_LFLAGS="-L/usr/local/easysoft/oob/client/lib/ -L/usr/local/easysoft/lib"
856 AC_MSG_ERROR(Invalid EasySoft ODBC directory - unable to find sql.h)
859 if test -f $withval/easysoft/oob/client/include/sql.h; then
860 EASYSOFT_INCDIR=$withval/easysoft/oob/client/include/
861 EASYSOFT_LFLAGS="-L$withval/easysoft/oob/client/lib/ -L$withval/easysoft/lib"
864 AC_MSG_ERROR(Invalid EasySoft ODBC directory - unable to find sql.h under $withval)
867 EASYSOFT_INCLUDE=-I$EASYSOFT_INCDIR
868 EASYSOFT_LFLAGS="$EASYSOFT_LFLAGS -lesoobclient -lesrpc -lsupport -lextra"
870 AC_DEFINE(HAVE_EASYSOFT)
880 AC_SUBST(EASYSOFT_LFLAGS)
881 AC_SUBST(EASYSOFT_INCLUDE)
885 AC_MSG_CHECKING(for InterBase support)
887 [ --with-ibase[=DIR] Include InterBase support. DIR is the InterBase
888 install directory, defaults to /usr/interbase.],
890 if test "$withval" != "no"; then
891 if test "$have_db" = "yes"; then
893 AC_MSG_ERROR("You can configure for only one database.");
897 if test "$withval" = "yes"; then
898 withval=/usr/interbase
901 if test "$withval" != "no"; then
902 if test -f $withval/include/ibase.h; then
903 IBASE_INCDIR=$withval/include
904 IBASE_LIBDIR=$withval/lib
907 AC_MSG_ERROR(Invalid InterBase directory - unable to find ibase.h)
909 IBASE_LFLAGS="-L$IBASE_LIBDIR -lgds"
910 IBASE_INCLUDE=-I$IBASE_INCDIR
911 AC_DEFINE(HAVE_IBASE)
918 AC_SUBST(IBASE_LFLAGS)
919 AC_SUBST(IBASE_INCLUDE)
921 AC_MSG_CHECKING(for Oracle8 support)
923 [ --with-oracle8[=DIR] Include Oracle8 support. DIR is the Oracle
924 home directory, defaults to $ORACLE_HOME or
925 /oracle8/app/oracle/product/8.0.5.],
927 if test "$withval" != "no"; then
928 if test "$have_db" = "yes"; then
930 AC_MSG_ERROR("You can configure for only one database.");
934 if test "$withval" = "yes"; then
935 withval="$ORACLE_HOME"
936 if test "$withval" = ""; then
937 withval=/oracle8/app/oracle/product/8.0.5
941 if test "$withval" != "no"; then
942 if test -f $withval/rdbms/demo/oci.h; then
943 ORACLE8_INCDIR1=$withval/rdbms/demo/
944 ORACLE8_INCDIR2=$withval/rdbms/public/:
945 ORACLE8_INCDIR3=$withval/network/public/
946 ORACLE8_INCDIR4=$withval/plsql/public/
947 ORACLE8_LIBDIR1=$withval/lib
948 ORACLE8_LIBDIR2=$withval/rdbms/lib
951 AC_MSG_ERROR(Invalid ORACLE directory - unable to find oci.h)
953 ORACLE8_LFLAGS="-L$ORACLE8_LIBDIR1 -L$ORACLE8_LIBDIR2 $withval/lib/libclntsh.so -lmm -lepc -lclient -lvsn -lcommon -lgeneric -lcore4 -lnlsrtl3 -lnsl -lm -ldl -lnetv2 -lnttcp -lnetwork -lncr -lsql"
954 ORACLE8_INCLUDE="-I$ORACLE8_INCDIR1 -I$ORACLE8_INCDIR2 -I$ORACLE8_INCDIR3 -I$ORACLE8_INCDIR4"
955 AC_DEFINE(HAVE_ORACLE8)
962 AC_SUBST(ORACLE8_LFLAGS)
963 AC_SUBST(ORACLE8_INCLUDE)
966 AC_MSG_CHECKING(for Oracle7 support)
968 [ --with-oracle7[=DIR] Include Oracle 7.3 support. DIR is the Oracle
969 home directory, defaults to
970 ORACLE_HOME [$ORACLE_HOME]],
972 if test "$withval" != "no"; then
973 if test "$have_db" = "yes"; then
975 AC_MSG_ERROR("You can configure for only one database.");
979 if test "$withval" = "yes"; then
980 withval="$ORACLE_HOME"
983 if test "$withval" != "no"; then
984 if test -f $withval/rdbms/demo/ocidfn.h; then
985 ORACLE7_INCDIR=$withval/rdbms/demo/
986 ORACLE7_LIBDIR1=$withval/lib
987 ORACLE7_LIBDIR2=$withval/rdbms/lib
990 AC_MSG_ERROR(Invalid ORACLE directory - unable to find ocidfn.h)
993 ORACLEINST_TOP=$withval
994 if test -f "$ORACLEINST_TOP/rdbms/lib/sysliblist"
996 ORA_SYSLIB="`cat $ORACLEINST_TOP/rdbms/lib/sysliblist`"
997 elif test -f "$ORACLEINST_TOP/lib/sysliblist"
999 ORA_SYSLIB="`cat $ORACLEINST_TOP/lib/sysliblist`"
1004 ORACLE7_LFLAGS="-L$ORACLE7_LIBDIR1 -L$ORACLE7_LIBDIR2 \
1005 -lclient -lsqlnet -lncr -lsqlnet -lclient -lcommon \
1006 -lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric \
1007 -lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 -lcore3 -lnlsrtl3 \
1008 $ORA_SYSLIB -lcore3 $ORA_SYSLIB"
1009 ORACLE7_INCLUDE="-I$ORACLE7_INCDIR "
1010 AC_DEFINE(HAVE_ORACLE7)
1017 AC_SUBST(ORACLE7_LFLAGS)
1018 AC_SUBST(ORACLE7_INCLUDE)
1021 dnl AM_ACLOCAL_INCLUDE(macrodir)
1022 AC_DEFUN([AM_ACLOCAL_INCLUDE],
1024 AM_CONDITIONAL(INSIDE_GNOME_COMMON, false)
1026 test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
1028 for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
1032 dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
1034 dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
1038 AC_DEFUN([GNOME_INIT_HOOK],[
1039 AC_SUBST(GNOME_LIBS)
1040 AC_SUBST(GNOMEUI_LIBS)
1041 AC_SUBST(GNOMEGNORBA_LIBS)
1042 AC_SUBST(GTKXMHTML_LIBS)
1044 AC_SUBST(GNOME_LIBDIR)
1045 AC_SUBST(GNOME_INCLUDEDIR)
1047 AC_ARG_WITH(gnome-includes,
1048 [ --with-gnome-includes Specify location of GNOME headers],[
1049 CFLAGS="$CFLAGS -I$withval"
1052 AC_ARG_WITH(gnome-libs,
1053 [ --with-gnome-libs Specify location of GNOME libs],[
1054 LDFLAGS="$LDFLAGS -L$withval"
1055 gnome_prefix=$withval
1059 [ --with-gnome Specify prefix for GNOME files],
1060 if test x$withval = xyes; then
1062 dnl Note that an empty true branch is not
1063 dnl valid sh syntax.
1064 ifelse([$1], [], :, [$1])
1066 if test "x$withval" = xno; then
1070 LDFLAGS="$LDFLAGS -L$withval/lib"
1071 CFLAGS="$CFLAGS -I$withval/include"
1072 gnome_prefix=$withval/lib
1077 if test "x$want_gnome" = xyes; then
1079 AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
1080 if test "$GNOME_CONFIG" = "no"; then
1081 no_gnome_config="yes"
1083 AC_MSG_CHECKING(if $GNOME_CONFIG works)
1084 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
1086 GNOME_GNORBA_HOOK([],$2)
1087 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
1088 GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
1089 GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
1090 GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
1091 ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
1092 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
1093 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
1097 no_gnome_config="yes"
1101 if test x$exec_prefix = xNONE; then
1102 if test x$prefix = xNONE; then
1103 gnome_prefix=$ac_default_prefix/lib
1105 gnome_prefix=$prefix/lib
1108 gnome_prefix=`eval echo \`echo $libdir\``
1111 if test "$no_gnome_config" = "yes"; then
1112 AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
1113 if test -f $gnome_prefix/gnomeConf.sh; then
1114 AC_MSG_RESULT(found)
1115 echo "loading gnome configuration from" \
1116 "$gnome_prefix/gnomeConf.sh"
1117 . $gnome_prefix/gnomeConf.sh
1120 AC_MSG_RESULT(not found)
1121 if test x$2 = xfail; then
1122 AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
1128 if test -n "$3"; then
1131 AC_MSG_CHECKING(extra library \"$i\")
1134 AC_SUBST(GNOME_APPLETS_LIBS)
1135 GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
1136 AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
1138 AC_SUBST(GNOME_DOCKLETS_LIBS)
1139 GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets`
1140 AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);;
1142 AC_SUBST(GNOME_CAPPLET_LIBS)
1143 GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
1144 AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
1146 AC_MSG_RESULT(unknown library)
1148 EXTRA_INCLUDEDIR=`$GNOME_CONFIG --cflags $i`
1149 GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR $EXTRA_INCLUDEDIR"
1155 dnl GNOME_INIT ([additional-inits])
1158 AC_DEFUN([GNOME_INIT],[
1159 GNOME_INIT_HOOK([],fail,$1)
1164 dnl Basic X11 related checks for X11. At the end, the following will be
1165 dnl defined/changed:
1166 dnl GTK_{CFLAGS,LIBS} From AM_PATH_GTK
1167 dnl CPPFLAGS Will include $X_CFLAGS
1168 dnl GNOME_HAVE_SM `true' or `false' depending on whether session
1169 dnl management is available. It is available if
1170 dnl both -lSM and X11/SM/SMlib.h exist. (Some
1171 dnl Solaris boxes have the library but not the header)
1172 dnl XPM_LIBS -lXpm if Xpm library is present, otherwise ""
1174 dnl The following configure cache variables are defined (but not used):
1175 dnl gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS}
1177 AC_DEFUN([GNOME_X_CHECKS],
1179 AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path))
1180 dnl Hope that GTK_CFLAGS have only -I and -D. Otherwise, we could
1181 dnl test -z "$x_includes" || CPPFLAGS="$CPPFLAGS -I$x_includes"
1183 dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses
1184 dnl CPPFLAGS, not CFLAGS
1185 CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
1187 saved_ldflags="$LDFLAGS"
1188 LDFLAGS="$LDFLAGS $GTK_LIBS"
1190 gnome_cv_passdown_x_libs="$GTK_LIBS"
1191 gnome_cv_passdown_X_LIBS="$GTK_LIBS"
1192 gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS"
1193 gnome_cv_passdown_GTK_LIBS="$GTK_LIBS"
1195 LDFLAGS="$saved_ldflags $GTK_LIBS"
1197 dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow.
1200 dnl AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x])
1201 dnl AC_EGREP_CPP(answer_affirmatively,
1202 dnl [#include <gtk/gtkfeatures.h>
1203 dnl #ifdef GTK_HAVE_FEATURES_1_1_0
1204 dnl answer_affirmatively
1206 dnl ], dev_gtk=yes, dev_gtk=no)
1207 dnl if test "$dev_gtk" = "yes"; then
1210 dnl AC_MSG_RESULT("$dev_gtk")
1215 dnl Already found it.
1218 dnl Assume that if we have -lSM then we also have -lICE.
1219 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
1220 [GTK_LIBS="-lSM -lICE $GTK_LIBS"],GNOME_HAVE_SM=false,
1225 if test "$GNOME_HAVE_SM" = true; then
1226 AC_CHECK_HEADERS(X11/SM/SMlib.h,,GNOME_HAVE_SM=false)
1229 if test "$GNOME_HAVE_SM" = true; then
1230 AC_DEFINE(HAVE_LIBSM)
1234 AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs)
1237 AC_REQUIRE([GNOME_PTHREAD_CHECK])
1238 LDFLAGS="$saved_ldflags"
1240 AC_PROVIDE([GNOME_X_CHECKS])
1243 AC_DEFUN([GNOME_PTHREAD_CHECK],[
1245 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1246 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1247 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1248 [AC_CHECK_LIB(pthread, __pthread_attr_init_system, PTHREAD_LIB="-lpthread",
1249 [AC_CHECK_FUNC(pthread_create)]
1254 AC_SUBST(PTHREAD_LIB)
1255 AC_PROVIDE([GNOME_PTHREAD_CHECK])
1258 AC_DEFUN(AM_CONDITIONAL,
1270 dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
1272 dnl if failflag is "failure" it aborts if gnorba is not found.
1275 AC_DEFUN([GNOME_GNORBA_HOOK],[
1276 GNOME_ORBIT_HOOK([],$2)
1277 AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
1278 gnome_cv_gnorba_found=no
1279 if test x$gnome_cv_orbit_found = xyes; then
1280 GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
1281 GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
1282 if test -n "$GNORBA_LIBS"; then
1283 gnome_cv_gnorba_found=yes
1287 AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
1288 if test x$gnome_cv_orbit_found = xyes; then
1290 GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
1291 GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
1292 AC_SUBST(GNORBA_CFLAGS)
1293 AC_SUBST(GNORBA_LIBS)
1295 if test x$2 = xfailure; then
1296 AC_MSG_ERROR(gnorba library not installed or installation problem)
1301 AC_DEFUN([GNOME_GNORBA_CHECK], [
1302 GNOME_GNORBA_HOOK([],failure)
1306 dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
1308 dnl if failflag is "failure" it aborts if orbit is not found.
1311 AC_DEFUN([GNOME_ORBIT_HOOK],[
1312 AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
1313 AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
1314 AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
1315 if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
1316 gnome_cv_orbit_found=no
1318 gnome_cv_orbit_found=yes
1321 AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
1322 if test x$gnome_cv_orbit_found = xyes; then
1324 ORBIT_CFLAGS=`orbit-config --cflags client server`
1325 ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
1326 AC_SUBST(ORBIT_CFLAGS)
1327 AC_SUBST(ORBIT_LIBS)
1329 if test x$2 = xfailure; then
1330 AC_MSG_ERROR(ORBit not installed or installation problem)
1335 AC_DEFUN([GNOME_ORBIT_CHECK], [
1336 GNOME_ORBIT_HOOK([],failure)