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/debian_version
308 elif test -f /etc/slackware-version
311 elif test "$ac_cv_cygwin" = yes
314 AC_DEFINE(HAVE_CYGWIN)
321 AC_DEFUN(BA_CHECK_MYSQL_DB,
324 AC_MSG_CHECKING(for MySQL support)
327 Which one DBMS do you want to use (please select only one):
328 --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base
329 install directory, default is to search through
330 a number of common places for the MySQL files.],
332 if test "$withval" != "no"; then
333 if test "$withval" = "yes"; then
334 if test -f /usr/local/mysql/include/mysql/mysql.h; then
335 MYSQL_INCDIR=/usr/local/mysql/include/mysql
336 MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
337 MYSQL_BINDIR=/usr/local/mysql/bin
338 elif test -f /usr/include/mysql/mysql.h; then
339 MYSQL_INCDIR=/usr/include/mysql
340 MYSQL_LIBDIR=/usr/lib/mysql
341 MYSQL_BINDIR=/usr/bin
342 elif test -f /usr/include/mysql.h; then
343 MYSQL_INCDIR=/usr/include
344 MYSQL_LIBDIR=/usr/lib
345 MYSQL_BINDIR=/usr/bin
346 elif test -f /usr/local/include/mysql/mysql.h; then
347 MYSQL_INCDIR=/usr/local/include/mysql
348 MYSQL_LIBDIR=/usr/local/lib/mysql
349 MYSQL_BINDIR=/usr/local/bin
350 elif test -f /usr/local/include/mysql.h; then
351 MYSQL_INCDIR=/usr/local/include
352 MYSQL_LIBDIR=/usr/local/lib
353 MYSQL_BINDIR=/usr/local/bin
356 AC_MSG_ERROR(Unable to find mysql.h in standard locations)
359 if test -f $withval/include/mysql/mysql.h; then
360 MYSQL_INCDIR=$withval/include/mysql
361 MYSQL_LIBDIR=$withval/lib/mysql
362 MYSQL_BINDIR=$withval/bin
363 elif test -f $withval/include/mysql.h; then
364 MYSQL_INCDIR=$withval/include
365 MYSQL_LIBDIR=$withval/lib
366 MYSQL_BINDIR=$withval/bin
369 AC_MSG_ERROR(Invalid MySQL directory $withval - unable to find mysql.h under $withval)
372 SQL_INCLUDE=-I$MYSQL_INCDIR
373 SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient -lz"
374 SQL_BINDIR=$MYSQL_BINDIR
376 AC_DEFINE(HAVE_MYSQL)
390 AC_ARG_WITH(embedded-mysql,
392 Which one DBMS do you want to use (please select only one):
393 --with-embedde-mysql[=DIR] Include MySQL support. DIR is the MySQL base
394 install directory, default is to search through
395 a number of common places for the MySQL files.],
397 if test "$withval" != "no"; then
398 if test "$withval" = "yes"; then
399 if test -f /usr/local/mysql/include/mysql/mysql.h; then
400 MYSQL_INCDIR=/usr/local/mysql/include/mysql
401 MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
402 MYSQL_BINDIR=/usr/local/mysql/bin
403 elif test -f /usr/include/mysql/mysql.h; then
404 MYSQL_INCDIR=/usr/include/mysql
405 MYSQL_LIBDIR=/usr/lib/mysql
406 MYSQL_BINDIR=/usr/bin
407 elif test -f /usr/include/mysql.h; then
408 MYSQL_INCDIR=/usr/include
409 MYSQL_LIBDIR=/usr/lib
410 MYSQL_BINDIR=/usr/bin
411 elif test -f /usr/local/include/mysql/mysql.h; then
412 MYSQL_INCDIR=/usr/local/include/mysql
413 MYSQL_LIBDIR=/usr/local/lib/mysql
414 MYSQL_BINDIR=/usr/local/bin
415 elif test -f /usr/local/include/mysql.h; then
416 MYSQL_INCDIR=/usr/local/include
417 MYSQL_LIBDIR=/usr/local/lib
418 MYSQL_BINDIR=/usr/local/bin
421 AC_MSG_ERROR(Unable to find mysql.h in standard locations)
424 if test -f $withval/include/mysql/mysql.h; then
425 MYSQL_INCDIR=$withval/include/mysql
426 MYSQL_LIBDIR=$withval/lib/mysql
427 MYSQL_BINDIR=$withval/bin
428 elif test -f $withval/include/mysql.h; then
429 MYSQL_INCDIR=$withval/include
430 MYSQL_LIBDIR=$withval/lib
431 MYSQL_BINDIR=$withval/bin
434 AC_MSG_ERROR(Invalid MySQL directory $withval - unable to find mysql.h under $withval)
437 SQL_INCLUDE=-I$MYSQL_INCDIR
438 SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqld -lz -lm -lcrypt"
439 SQL_BINDIR=$MYSQL_BINDIR
441 AC_DEFINE(HAVE_MYSQL)
442 AC_DEFINE(HAVE_EMBEDDED_MYSQL)
458 AC_SUBST(SQL_INCLUDE)
464 AC_DEFUN(BA_CHECK_SQLITE_DB,
467 AC_MSG_CHECKING(for SQLite support)
470 Which one DBMS do you want to use (please select only one):
471 --with-sqlite[=DIR] Include SQLite support. DIR is the SQLite base
472 install directory, default is to search through
473 a number of common places for the SQLite files.],
475 if test "$withval" != "no"; then
476 if test "$withval" = "yes"; then
477 if test -f /usr/local/include/sqlite.h; then
478 SQLITE_INCDIR=/usr/local/include
479 SQLITE_LIBDIR=/usr/local/lib
480 SQLITE_BINDIR=/usr/local/bin
481 elif test -f /usr/include/sqlite.h; then
482 SQLITE_INCDIR=/usr/include
483 SQLITE_LIBDIR=/usr/lib
484 SQLITE_BINDIR=/usr/bin
487 AC_MSG_ERROR(Unable to find sqlite.h in standard locations)
490 if test -f $withval/sqlite.h; then
491 SQLITE_INCDIR=$withval
492 SQLITE_LIBDIR=$withval
493 SQLITE_BINDIR=$withval
496 AC_MSG_ERROR(Invalid SQLite directory $withval - unable to find sqlite.h under $withval)
499 SQL_INCLUDE=-I$SQLITE_INCDIR
500 SQL_LFLAGS="-L$SQLITE_LIBDIR -lsqlite"
501 SQL_BINDIR=$SQLITE_BINDIR
503 AC_DEFINE(HAVE_SQLITE)
517 AC_SUBST(SQL_INCLUDE)
524 AC_DEFUN(BA_CHECK_SQL_DB,
525 [AC_MSG_CHECKING(Checking for various databases)
526 dnl# --------------------------------------------------------------------------
527 dnl# CHECKING FOR VARIOUS DATABASES (thanks to UdmSearch team)
528 dnl# --------------------------------------------------------------------------
529 dnl Check for some DBMS backend
530 dnl NOTE: we can use only one backend at a time
538 if test x$support_mysql = xyes; then
543 AC_MSG_CHECKING(for Berkeley DB support)
544 AC_ARG_WITH(berkeleydb,
546 Which one DBMS do you want to use (please select only one):
547 --with-berkeleydb[=DIR] Include Berkeley DB support. DIR is the Berkeley DB base
548 install directory, default is to search through
549 a number of common places for the DB files.],
551 if test "$withval" != "no"; then
552 if test "$withval" = "yes"; then
553 if test -f /usr/include/db.h; then
554 BERKELEYDB_INCDIR=/usr/include
555 BERKELEYDB_LIBDIR=/usr/lib
558 AC_MSG_ERROR(Invalid Berkeley DB directory - unable to find db.h)
561 if test -f $withval/include/db.h; then
562 BERKELEYDB_INCDIR=$withval/include
563 BERKELEYDBL_LIBDIR=$withval/lib
566 AC_MSG_ERROR(Invalid Berkeley DB directory - unable to find db.h under $withval)
569 SQL_INCLUDE=-I$BERKELEYDB_INCDIR
570 SQL_LFLAGS="-L$BERKELEYDB_LIBDIR -ldb"
572 AC_DEFINE(HAVE_BERKELEY_DB)
585 AC_SUBST(SQL_INCLUDE)
587 if test x$support_berkleydb = xyes; then
592 AC_MSG_CHECKING(for PostgreSQL support)
594 [ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL
595 base install directory, defaults to /usr/local/pgsql.],
597 if test "$withval" != "no"; then
598 if test "$have_db" = "yes"; then
600 AC_MSG_ERROR("You can configure for only one database.");
602 if test "$withval" = "yes"; then
603 if test -f /usr/include/pgsql/libpq-fe.h; then
604 PGSQL_INCDIR=/usr/include/pgsql
606 PGSQL_INCDIR=/usr/local/pgsql/include
608 if test -f /usr/lib/libpq.a; then
609 PGSQL_LIBDIR=/usr/lib
611 PGSQL_LIBDIR=/usr/local/pgsql/lib
614 PGSQL_INCDIR=$withval/include
615 test -d $withval/include/pgsql && PGSQL_INCDIR=$withval/include/pgsql
616 PGSQL_LIBDIR=$withval/lib
617 test -d $withval/lib/pgsql && PGSQL_LIBDIR=$withval/lib/pgsql
619 PGSQL_INCLUDE=-I$PGSQL_INCDIR
620 PGSQL_LFLAGS="-L$PGSQL_LIBDIR -lpq"
621 AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt, [LIBS="-lcrypt $LIBS"]))
623 AC_DEFINE(HAVE_PGSQL)
632 AC_SUBST(PGSQL_LFLAGS)
633 AC_SUBST(PGSQL_INCLUDE)
636 AC_MSG_CHECKING(for mSQL support)
638 [ --with-msql[=DIR] Include mSQL support. DIR is the mSQL base
639 install directory, defaults to /usr/local/Hughes.],
641 if test "$withval" != "no"; then
642 if test "$have_db" = "yes"; then
644 AC_MSG_ERROR("You can configure for only one database.");
647 if test "$withval" = "yes"; then
648 MSQL_INCDIR=/usr/local/Hughes/include
649 MSQL_LIBDIR=/usr/local/Hughes/lib
651 MSQL_INCDIR=$withval/include
652 MSQL_LIBDIR=$withval/lib
654 MSQL_INCLUDE=-I$MSQL_INCDIR
655 MSQL_LFLAGS="-L$MSQL_LIBDIR -lmsql"
666 AC_SUBST(MSQL_LFLAGS)
667 AC_SUBST(MSQL_INCLUDE)
670 AC_MSG_CHECKING(for iODBC support)
672 [ --with-iodbc[=DIR] Include iODBC support. DIR is the iODBC base
673 install directory, defaults to /usr/local.],
675 if test "$withval" != "no"; then
676 if test "$have_db" = "yes"; then
678 AC_MSG_ERROR("You can configure for only one database.");
682 if test "$withval" = "yes"; then
686 if test "$withval" != "no"; then
687 if test -f $withval/include/isql.h; then
688 IODBC_INCDIR=$withval/include
689 IODBC_LIBDIR=$withval/lib
692 AC_MSG_ERROR(Invalid iODBC directory - unable to find isql.h)
694 IODBC_LFLAGS="-L$IODBC_LIBDIR -liodbc"
695 IODBC_INCLUDE=-I$IODBC_INCDIR
696 AC_DEFINE(HAVE_IODBC)
703 AC_SUBST(IODBC_LFLAGS)
704 AC_SUBST(IODBC_INCLUDE)
707 AC_MSG_CHECKING(for unixODBC support)
708 AC_ARG_WITH(unixODBC,
709 [ --with-unixODBC[=DIR] Include unixODBC support. DIR is the unixODBC base
710 install directory, defaults to /usr/local.],
712 if test "$withval" != "no"; then
713 if test "$have_db" = "yes"; then
715 AC_MSG_ERROR("You can configure for only one database.");
719 if test "$withval" = "yes"; then
723 if test "$withval" != "no"; then
724 if test -f $withval/include/sql.h; then
725 UNIXODBC_INCDIR=$withval/include
726 UNIXODBC_LIBDIR=$withval/lib
729 AC_MSG_ERROR(Invalid unixODBC directory - unable to find sql.h)
731 UNIXODBC_LFLAGS="-L$UNIXODBC_LIBDIR -lodbc"
732 UNIXODBC_INCLUDE=-I$UNIXODBC_INCDIR
733 AC_DEFINE(HAVE_UNIXODBC)
740 AC_SUBST(UNIXODBC_LFLAGS)
741 AC_SUBST(UNIXODBC_INCLUDE)
744 AC_MSG_CHECKING(for Solid support)
746 [ --with-solid[=DIR] Include Solid support. DIR is the Solid base
747 install directory, defaults to /usr/local.],
749 if test "$withval" != "no"; then
750 if test "$have_db" = "yes"; then
752 AC_MSG_ERROR("You can configure for only one database.");
756 if test "$withval" = "yes"; then
760 if test "$withval" != "no"; then
761 if test -f $withval/include/cli0cli.h; then
762 SOLID_INCDIR=$withval/include
763 SOLID_LIBDIR=$withval/lib
766 AC_MSG_ERROR(Invalid Solid directory - unable to find cli0cli.h)
768 SOLID_LFLAGS="-L$SOLID_LIBDIR -lsolcli"
769 SOLID_INCLUDE="-I$SOLID_INCDIR"
770 AC_DEFINE(HAVE_SOLID)
777 AC_SUBST(SOLID_LFLAGS)
778 AC_SUBST(SOLID_INCLUDE)
780 AC_MSG_CHECKING(for OpenLink ODBC support)
781 AC_ARG_WITH(openlink,
782 [ --with-openlink[=DIR] Include OpenLink ODBC support.
783 DIR is the base OpenLink ODBC install directory],
785 if test "$withval" != "no"; then
786 if test "$withval" = "yes"; then
788 if test "$have_db" = "yes"; then
790 AC_MSG_ERROR("You can configure for only one database.");
793 if test -f /usr/local/virtuoso-ent/odbcsdk/include/isql.h; then
794 VIRT_INCDIR=/usr/local/virtuoso-ent/odbcsdk/include/
795 VIRT_LIBDIR=/usr/local/virtuoso-ent/odbcsdk/lib/
796 elif test -f /usr/local/virtuoso-lite/odbcsdk/include/isql.h; then
797 VIRT_INCDIR=/usr/local/virtuoso-lite/odbcsdk/include/
798 VIRT_LIBDIR=/usr/local/virtuoso-lite/odbcsdk/lib/
799 elif test -f /usr/local/virtuoso/odbcsdk/include/isql.h; then
800 VIRT_INCDIR=/usr/local/virtuoso/odbcsdk/include/
801 VIRT_LIBDIR=/usr/local/virtuoso/odbcsdk/lib/
804 AC_MSG_ERROR(Invalid OpenLink ODBC directory - unable to find isql.h)
807 if test -f $withval/odbcsdk/include/isql.h; then
808 VIRT_INCDIR=$withval/odbcsdk/include/
809 VIRT_LIBDIR=$withval/odbcsdk/lib/
810 elif test -f $withval/include/isql.h; then
811 VIRT_INCDIR=$withval/include/
812 VIRT_LIBDIR=$withval/lib/
815 AC_MSG_ERROR(Invalid OpenLink ODBC directory - unable to find isql.h under $withval)
818 VIRT_INCLUDE=-I$VIRT_INCDIR
819 VIRT_LFLAGS="-L$VIRT_LIBDIR -liodbc"
831 AC_SUBST(VIRT_LFLAGS)
832 AC_SUBST(VIRT_INCLUDE)
835 AC_MSG_CHECKING(for EasySoft ODBC support)
836 AC_ARG_WITH(easysoft,
837 [ --with-easysoft[=DIR] Include EasySoft ODBC support.
838 DIR is the base EasySoft ODBC install directory],
840 if test "$withval" != "no"; then
841 if test "$withval" = "yes"; then
843 if test "$have_db" = "yes"; then
845 AC_MSG_ERROR("You can configure for only one database.");
848 if test -f /usr/local/easysoft/oob/client/include/sql.h; then
849 EASYSOFT_INCDIR=/usr/local/easysoft/oob/client/include/
850 EASYSOFT_LFLAGS="-L/usr/local/easysoft/oob/client/lib/ -L/usr/local/easysoft/lib"
853 AC_MSG_ERROR(Invalid EasySoft ODBC directory - unable to find sql.h)
856 if test -f $withval/easysoft/oob/client/include/sql.h; then
857 EASYSOFT_INCDIR=$withval/easysoft/oob/client/include/
858 EASYSOFT_LFLAGS="-L$withval/easysoft/oob/client/lib/ -L$withval/easysoft/lib"
861 AC_MSG_ERROR(Invalid EasySoft ODBC directory - unable to find sql.h under $withval)
864 EASYSOFT_INCLUDE=-I$EASYSOFT_INCDIR
865 EASYSOFT_LFLAGS="$EASYSOFT_LFLAGS -lesoobclient -lesrpc -lsupport -lextra"
867 AC_DEFINE(HAVE_EASYSOFT)
877 AC_SUBST(EASYSOFT_LFLAGS)
878 AC_SUBST(EASYSOFT_INCLUDE)
882 AC_MSG_CHECKING(for InterBase support)
884 [ --with-ibase[=DIR] Include InterBase support. DIR is the InterBase
885 install directory, defaults to /usr/interbase.],
887 if test "$withval" != "no"; then
888 if test "$have_db" = "yes"; then
890 AC_MSG_ERROR("You can configure for only one database.");
894 if test "$withval" = "yes"; then
895 withval=/usr/interbase
898 if test "$withval" != "no"; then
899 if test -f $withval/include/ibase.h; then
900 IBASE_INCDIR=$withval/include
901 IBASE_LIBDIR=$withval/lib
904 AC_MSG_ERROR(Invalid InterBase directory - unable to find ibase.h)
906 IBASE_LFLAGS="-L$IBASE_LIBDIR -lgds"
907 IBASE_INCLUDE=-I$IBASE_INCDIR
908 AC_DEFINE(HAVE_IBASE)
915 AC_SUBST(IBASE_LFLAGS)
916 AC_SUBST(IBASE_INCLUDE)
918 AC_MSG_CHECKING(for Oracle8 support)
920 [ --with-oracle8[=DIR] Include Oracle8 support. DIR is the Oracle
921 home directory, defaults to $ORACLE_HOME or
922 /oracle8/app/oracle/product/8.0.5.],
924 if test "$withval" != "no"; then
925 if test "$have_db" = "yes"; then
927 AC_MSG_ERROR("You can configure for only one database.");
931 if test "$withval" = "yes"; then
932 withval="$ORACLE_HOME"
933 if test "$withval" = ""; then
934 withval=/oracle8/app/oracle/product/8.0.5
938 if test "$withval" != "no"; then
939 if test -f $withval/rdbms/demo/oci.h; then
940 ORACLE8_INCDIR1=$withval/rdbms/demo/
941 ORACLE8_INCDIR2=$withval/rdbms/public/:
942 ORACLE8_INCDIR3=$withval/network/public/
943 ORACLE8_INCDIR4=$withval/plsql/public/
944 ORACLE8_LIBDIR1=$withval/lib
945 ORACLE8_LIBDIR2=$withval/rdbms/lib
948 AC_MSG_ERROR(Invalid ORACLE directory - unable to find oci.h)
950 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"
951 ORACLE8_INCLUDE="-I$ORACLE8_INCDIR1 -I$ORACLE8_INCDIR2 -I$ORACLE8_INCDIR3 -I$ORACLE8_INCDIR4"
952 AC_DEFINE(HAVE_ORACLE8)
959 AC_SUBST(ORACLE8_LFLAGS)
960 AC_SUBST(ORACLE8_INCLUDE)
963 AC_MSG_CHECKING(for Oracle7 support)
965 [ --with-oracle7[=DIR] Include Oracle 7.3 support. DIR is the Oracle
966 home directory, defaults to
967 ORACLE_HOME [$ORACLE_HOME]],
969 if test "$withval" != "no"; then
970 if test "$have_db" = "yes"; then
972 AC_MSG_ERROR("You can configure for only one database.");
976 if test "$withval" = "yes"; then
977 withval="$ORACLE_HOME"
980 if test "$withval" != "no"; then
981 if test -f $withval/rdbms/demo/ocidfn.h; then
982 ORACLE7_INCDIR=$withval/rdbms/demo/
983 ORACLE7_LIBDIR1=$withval/lib
984 ORACLE7_LIBDIR2=$withval/rdbms/lib
987 AC_MSG_ERROR(Invalid ORACLE directory - unable to find ocidfn.h)
990 ORACLEINST_TOP=$withval
991 if test -f "$ORACLEINST_TOP/rdbms/lib/sysliblist"
993 ORA_SYSLIB="`cat $ORACLEINST_TOP/rdbms/lib/sysliblist`"
994 elif test -f "$ORACLEINST_TOP/lib/sysliblist"
996 ORA_SYSLIB="`cat $ORACLEINST_TOP/lib/sysliblist`"
1001 ORACLE7_LFLAGS="-L$ORACLE7_LIBDIR1 -L$ORACLE7_LIBDIR2 \
1002 -lclient -lsqlnet -lncr -lsqlnet -lclient -lcommon \
1003 -lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric \
1004 -lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 -lcore3 -lnlsrtl3 \
1005 $ORA_SYSLIB -lcore3 $ORA_SYSLIB"
1006 ORACLE7_INCLUDE="-I$ORACLE7_INCDIR "
1007 AC_DEFINE(HAVE_ORACLE7)
1014 AC_SUBST(ORACLE7_LFLAGS)
1015 AC_SUBST(ORACLE7_INCLUDE)
1018 dnl AM_ACLOCAL_INCLUDE(macrodir)
1019 AC_DEFUN([AM_ACLOCAL_INCLUDE],
1021 AM_CONDITIONAL(INSIDE_GNOME_COMMON, false)
1023 test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
1025 for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
1029 dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
1031 dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
1035 AC_DEFUN([GNOME_INIT_HOOK],[
1036 AC_SUBST(GNOME_LIBS)
1037 AC_SUBST(GNOMEUI_LIBS)
1038 AC_SUBST(GNOMEGNORBA_LIBS)
1039 AC_SUBST(GTKXMHTML_LIBS)
1041 AC_SUBST(GNOME_LIBDIR)
1042 AC_SUBST(GNOME_INCLUDEDIR)
1044 AC_ARG_WITH(gnome-includes,
1045 [ --with-gnome-includes Specify location of GNOME headers],[
1046 CFLAGS="$CFLAGS -I$withval"
1049 AC_ARG_WITH(gnome-libs,
1050 [ --with-gnome-libs Specify location of GNOME libs],[
1051 LDFLAGS="$LDFLAGS -L$withval"
1052 gnome_prefix=$withval
1056 [ --with-gnome Specify prefix for GNOME files],
1057 if test x$withval = xyes; then
1059 dnl Note that an empty true branch is not
1060 dnl valid sh syntax.
1061 ifelse([$1], [], :, [$1])
1063 if test "x$withval" = xno; then
1067 LDFLAGS="$LDFLAGS -L$withval/lib"
1068 CFLAGS="$CFLAGS -I$withval/include"
1069 gnome_prefix=$withval/lib
1074 if test "x$want_gnome" = xyes; then
1076 AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
1077 if test "$GNOME_CONFIG" = "no"; then
1078 no_gnome_config="yes"
1080 AC_MSG_CHECKING(if $GNOME_CONFIG works)
1081 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
1083 GNOME_GNORBA_HOOK([],$2)
1084 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
1085 GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
1086 GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
1087 GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
1088 ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
1089 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
1090 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
1094 no_gnome_config="yes"
1098 if test x$exec_prefix = xNONE; then
1099 if test x$prefix = xNONE; then
1100 gnome_prefix=$ac_default_prefix/lib
1102 gnome_prefix=$prefix/lib
1105 gnome_prefix=`eval echo \`echo $libdir\``
1108 if test "$no_gnome_config" = "yes"; then
1109 AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
1110 if test -f $gnome_prefix/gnomeConf.sh; then
1111 AC_MSG_RESULT(found)
1112 echo "loading gnome configuration from" \
1113 "$gnome_prefix/gnomeConf.sh"
1114 . $gnome_prefix/gnomeConf.sh
1117 AC_MSG_RESULT(not found)
1118 if test x$2 = xfail; then
1119 AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
1125 if test -n "$3"; then
1128 AC_MSG_CHECKING(extra library \"$i\")
1131 AC_SUBST(GNOME_APPLETS_LIBS)
1132 GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
1133 AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
1135 AC_SUBST(GNOME_DOCKLETS_LIBS)
1136 GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets`
1137 AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);;
1139 AC_SUBST(GNOME_CAPPLET_LIBS)
1140 GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
1141 AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
1143 AC_MSG_RESULT(unknown library)
1145 EXTRA_INCLUDEDIR=`$GNOME_CONFIG --cflags $i`
1146 GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR $EXTRA_INCLUDEDIR"
1152 dnl GNOME_INIT ([additional-inits])
1155 AC_DEFUN([GNOME_INIT],[
1156 GNOME_INIT_HOOK([],fail,$1)
1161 dnl Basic X11 related checks for X11. At the end, the following will be
1162 dnl defined/changed:
1163 dnl GTK_{CFLAGS,LIBS} From AM_PATH_GTK
1164 dnl CPPFLAGS Will include $X_CFLAGS
1165 dnl GNOME_HAVE_SM `true' or `false' depending on whether session
1166 dnl management is available. It is available if
1167 dnl both -lSM and X11/SM/SMlib.h exist. (Some
1168 dnl Solaris boxes have the library but not the header)
1169 dnl XPM_LIBS -lXpm if Xpm library is present, otherwise ""
1171 dnl The following configure cache variables are defined (but not used):
1172 dnl gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS}
1174 AC_DEFUN([GNOME_X_CHECKS],
1176 AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path))
1177 dnl Hope that GTK_CFLAGS have only -I and -D. Otherwise, we could
1178 dnl test -z "$x_includes" || CPPFLAGS="$CPPFLAGS -I$x_includes"
1180 dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses
1181 dnl CPPFLAGS, not CFLAGS
1182 CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
1184 saved_ldflags="$LDFLAGS"
1185 LDFLAGS="$LDFLAGS $GTK_LIBS"
1187 gnome_cv_passdown_x_libs="$GTK_LIBS"
1188 gnome_cv_passdown_X_LIBS="$GTK_LIBS"
1189 gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS"
1190 gnome_cv_passdown_GTK_LIBS="$GTK_LIBS"
1192 LDFLAGS="$saved_ldflags $GTK_LIBS"
1194 dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow.
1197 dnl AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x])
1198 dnl AC_EGREP_CPP(answer_affirmatively,
1199 dnl [#include <gtk/gtkfeatures.h>
1200 dnl #ifdef GTK_HAVE_FEATURES_1_1_0
1201 dnl answer_affirmatively
1203 dnl ], dev_gtk=yes, dev_gtk=no)
1204 dnl if test "$dev_gtk" = "yes"; then
1207 dnl AC_MSG_RESULT("$dev_gtk")
1212 dnl Already found it.
1215 dnl Assume that if we have -lSM then we also have -lICE.
1216 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
1217 [GTK_LIBS="-lSM -lICE $GTK_LIBS"],GNOME_HAVE_SM=false,
1222 if test "$GNOME_HAVE_SM" = true; then
1223 AC_CHECK_HEADERS(X11/SM/SMlib.h,,GNOME_HAVE_SM=false)
1226 if test "$GNOME_HAVE_SM" = true; then
1227 AC_DEFINE(HAVE_LIBSM)
1231 AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs)
1234 AC_REQUIRE([GNOME_PTHREAD_CHECK])
1235 LDFLAGS="$saved_ldflags"
1237 AC_PROVIDE([GNOME_X_CHECKS])
1240 AC_DEFUN([GNOME_PTHREAD_CHECK],[
1242 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1243 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1244 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1245 [AC_CHECK_LIB(pthread, __pthread_attr_init_system, PTHREAD_LIB="-lpthread",
1246 [AC_CHECK_FUNC(pthread_create)]
1251 AC_SUBST(PTHREAD_LIB)
1252 AC_PROVIDE([GNOME_PTHREAD_CHECK])
1255 AC_DEFUN(AM_CONDITIONAL,
1267 dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
1269 dnl if failflag is "failure" it aborts if gnorba is not found.
1272 AC_DEFUN([GNOME_GNORBA_HOOK],[
1273 GNOME_ORBIT_HOOK([],$2)
1274 AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
1275 gnome_cv_gnorba_found=no
1276 if test x$gnome_cv_orbit_found = xyes; then
1277 GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
1278 GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
1279 if test -n "$GNORBA_LIBS"; then
1280 gnome_cv_gnorba_found=yes
1284 AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
1285 if test x$gnome_cv_orbit_found = xyes; then
1287 GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
1288 GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
1289 AC_SUBST(GNORBA_CFLAGS)
1290 AC_SUBST(GNORBA_LIBS)
1292 if test x$2 = xfailure; then
1293 AC_MSG_ERROR(gnorba library not installed or installation problem)
1298 AC_DEFUN([GNOME_GNORBA_CHECK], [
1299 GNOME_GNORBA_HOOK([],failure)
1303 dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
1305 dnl if failflag is "failure" it aborts if orbit is not found.
1308 AC_DEFUN([GNOME_ORBIT_HOOK],[
1309 AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
1310 AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
1311 AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
1312 if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
1313 gnome_cv_orbit_found=no
1315 gnome_cv_orbit_found=yes
1318 AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
1319 if test x$gnome_cv_orbit_found = xyes; then
1321 ORBIT_CFLAGS=`orbit-config --cflags client server`
1322 ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
1323 AC_SUBST(ORBIT_CFLAGS)
1324 AC_SUBST(ORBIT_LIBS)
1326 if test x$2 = xfailure; then
1327 AC_MSG_ERROR(ORBit not installed or installation problem)
1332 AC_DEFUN([GNOME_ORBIT_CHECK], [
1333 GNOME_ORBIT_HOOK([],failure)