dnl
-dnl If available, use support for large files unless the user specified
-dnl one of the CPPFLAGS, LDFLAGS, or LIBS variables (<eggert@twinsun.com>
-dnl via GNU patch 2.5)
-dnl
-AC_DEFUN(LARGE_FILE_SUPPORT,
-[AC_MSG_CHECKING(whether large file support needs explicit enabling)
-ac_getconfs=''
-ac_result=yes
-ac_set=''
-ac_shellvars='CPPFLAGS LDFLAGS LIBS'
-for ac_shellvar in $ac_shellvars; do
- case $ac_shellvar in
- CPPFLAGS) ac_lfsvar=LFS_CFLAGS ac_lfs64var=LFS64_CFLAGS ;;
- *) ac_lfsvar=LFS_$ac_shellvar ac_lfs64var=LFS64_$ac_shellvar ;;
- esac
- eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
- (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
- ac_getconf=`getconf $ac_lfsvar`
- ac_getconf64=`getconf $ac_lfs64var`
- ac_getconfs=$ac_getconfs$ac_getconf\ $ac_getconf64
- eval ac_test_$ac_shellvar="\$ac_getconf\ \$ac_getconf64"
-done
-case "$ac_result$ac_getconfs" in
-yes) ac_result=no ;;
-esac
-case "$ac_result$ac_set" in
-yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
-esac
-AC_MSG_RESULT($ac_result)
-case $ac_result in
-yes)
- for ac_shellvar in $ac_shellvars; do
- eval $ac_shellvar=\$ac_test_$ac_shellvar
- done ;;
-esac
-])
+dnl ========= Large File Support ==============
+dnl By default, many hosts won't let programs access large files;
+dnl one must use special compiler options to get large-file access to work.
+dnl For more details about this brain damage please see:
+dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
+
+dnl Written by Paul Eggert <eggert@twinsun.com>.
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
+AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
+ [AC_CACHE_CHECK([for $1 value to request large file support],
+ ac_cv_sys_largefile_$1,
+ [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || {
+ ac_cv_sys_largefile_$1=no
+ ifelse($1, CFLAGS,
+ [case "$host_os" in
+ # IRIX 6.2 and later require cc -n32.
+changequote(, )dnl
+ irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
+changequote([, ])dnl
+ if test "$GCC" != yes; then
+ ac_cv_sys_largefile_CFLAGS=-n32
+ fi
+ ac_save_CC="$CC"
+ CC="$CC $ac_cv_sys_largefile_CFLAGS"
+ AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
+ CC="$ac_save_CC"
+ esac])
+ }])])
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
+AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
+ [case $2 in
+ no) ;;
+ ?*)
+ case "[$]$1" in
+ '') $1=$2 ;;
+ *) $1=[$]$1' '$2 ;;
+ esac ;;
+ esac])
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
+AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
+ [AC_CACHE_CHECK([for $1], $2,
+ [$2=no
+changequote(, )dnl
+ $4
+ for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+ case "$ac_flag" in
+ -D$1)
+ $2=1 ;;
+ -D$1=*)
+ $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
+ esac
+ done
+changequote([, ])dnl
+ ])
+ if test "[$]$2" != no; then
+ AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
+ fi])
+
+AC_DEFUN(AC_BAC_LARGEFILE,
+ [AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_ARG_ENABLE(largefile,
+ [ --disable-largefile omit support for large files])
+ if test "$enable_largefile" != no; then
+ AC_CHECK_TOOL(GETCONF, getconf)
+ AC_SYS_LARGEFILE_FLAGS(CFLAGS)
+ AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
+ AC_SYS_LARGEFILE_FLAGS(LIBS)
+
+ for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+ case "$ac_flag" in
+ no) ;;
+ -D_FILE_OFFSET_BITS=*) ;;
+ -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
+ -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
+ -D?* | -I?*)
+ AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
+ *)
+ AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
+ esac
+ done
+ AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
+ AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
+ AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
+ ac_cv_sys_file_offset_bits,
+ [Number of bits in a file offset, on hosts where this is settable.],
+ [case "$host_os" in
+ # HP-UX 10.20 and later
+ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
+ ac_cv_sys_file_offset_bits=64 ;;
+ esac])
+ AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
+ ac_cv_sys_largefile_source,
+ [Define to make fseeko etc. visible, on some hosts.],
+ [case "$host_os" in
+ # HP-UX 10.20 and later
+ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
+ ac_cv_sys_largefile_source=1 ;;
+ esac])
+ AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
+ ac_cv_sys_large_files,
+ [Define for large files, on AIX-style hosts.],
+ [case "$host_os" in
+ # AIX 4.2 and later
+ aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
+ ac_cv_sys_large_files=1 ;;
+ esac])
+ fi
+ ])
+dnl ==========================================================
dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
AC_DEFUN(SIGNAL_CHECK,
else
BA_CONDITIONAL(HAVE_SGI_OS, $FALSEPRG)
fi
+
+if test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
+then
+ BA_CONDITIONAL(HAVE_IRIX_OS, $TRUEPRG)
+ AC_DEFINE(HAVE_IRIX_OS)
+else
+ BA_CONDITIONAL(HAVE_IRIX_OS, $FALSEPRG)
+fi
+
+if test $HAVE_UNAME=yes -a x`uname -s` = xDarwin
+then
+ AM_CONDITIONAL(HAVE_DARWIN_OS, $TRUEPRG)
+ AC_DEFINE(HAVE_DARWIN_OS)
+else
+ AM_CONDITIONAL(HAVE_DARWIN_OS, $FALSEPRG)
+fi
+
AC_MSG_RESULT(" ")
])
elif test $HAVE_UNAME=yes -a x`uname -s` = xOSF1
then
DISTNAME=alpha
+elif test $HAVE_UNAME=yes -a x`uname -s` = xAIX
+then
+ DISTNAME=aix
elif test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
then
DISTNAME=hpux
elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
then
DISTNAME=openbsd
+elif test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
+then
+ DISTNAME=irix
elif test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
then
DISTNAME=bsdi
elif test -d /etc/SuSEconfig
then
DISTNAME=suse5
-elif test -d /usr/src/OpenLinux
+elif test -f /etc/mandrake-release
then
- DISTNAME=caldera
+ DISTNAME=mandrake
elif test -f /etc/redhat-release
then
DISTNAME=redhat
+elif test -f /etc/gentoo-release
+then
+ DISTNAME=gentoo
elif test -f /etc/debian_version
then
DISTNAME=debian
elif test -f /etc/slackware-version
then
DISTNAME=slackware
-elif test "$ac_cv_cygwin" = yes
+elif test $HAVE_UNAME=yes -a x`uname -s` = xDarwin
+then
+ DISTNAME=darwin
+elif test -f /etc/engarde-version
+then
+ DISTNAME=engarde
+elif test "$CYGWIN" = yes
then
DISTNAME=cygwin
AC_DEFINE(HAVE_CYGWIN)
AC_DEFUN(BA_CHECK_MYSQL_DB,
[
-have_db=no
+db_found=no
AC_MSG_CHECKING(for MySQL support)
AC_ARG_WITH(mysql,
[
-Which one DBMS do you want to use (please select only one):
+Which DBMS do you want to use (please select only one):
--with-mysql[=DIR] Include MySQL support. DIR is the MySQL base
install directory, default is to search through
a number of common places for the MySQL files.],
fi
fi
SQL_INCLUDE=-I$MYSQL_INCDIR
- SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient"
+ if test -f $MYSQL_LIBDIR/libmysqlclient_r.a; then
+ SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
+ AC_DEFINE(HAVE_THREAD_SAFE_MYSQL)
+ else
+ SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient -lz"
+ fi
SQL_BINDIR=$MYSQL_BINDIR
AC_DEFINE(HAVE_MYSQL)
AC_MSG_RESULT(yes)
- have_db=yes
+ db_found=yes
support_mysql=yes
db_name=MySQL
DB_NAME=mysql
AC_MSG_RESULT(no)
fi
],[
- AC_MSG_RESULT(no)
+ AC_MSG_RESULT(no)
])
AC_ARG_WITH(embedded-mysql,
[
-Which one DBMS do you want to use (please select only one):
- --with-embedde-mysql[=DIR] Include MySQL support. DIR is the MySQL base
+Which DBMS do you want to use (please select only one):
+ --with-embedded-mysql[=DIR] Include MySQL support. DIR is the MySQL base
install directory, default is to search through
a number of common places for the MySQL files.],
[
AC_DEFINE(HAVE_MYSQL)
AC_DEFINE(HAVE_EMBEDDED_MYSQL)
AC_MSG_RESULT(yes)
- have_db=yes
+ db_found=yes
support_mysql=yes
db_name=MySQL
DB_NAME=mysql
AC_DEFUN(BA_CHECK_SQLITE_DB,
[
-have_db=no
+db_found=no
AC_MSG_CHECKING(for SQLite support)
AC_ARG_WITH(sqlite,
[
-Which one DBMS do you want to use (please select only one):
+Which DBMS do you want to use (please select only one):
--with-sqlite[=DIR] Include SQLite support. DIR is the SQLite base
install directory, default is to search through
a number of common places for the SQLite files.],
AC_DEFINE(HAVE_SQLITE)
AC_MSG_RESULT(yes)
- have_db=yes
+ db_found=yes
support_sqlite=yes
db_name=SQLite
DB_NAME=sqlite
dnl NOTE: we can use only one backend at a time
AC_MSG_RESULT(" ")
-have_db=no
+db_found=no
db_name=none
AC_MSG_CHECKING(for Berkeley DB support)
AC_ARG_WITH(berkeleydb,
[
-Which one DBMS do you want to use (please select only one):
+Which DBMS do you want to use (please select only one):
--with-berkeleydb[=DIR] Include Berkeley DB support. DIR is the Berkeley DB base
install directory, default is to search through
a number of common places for the DB files.],
AC_SUBST(ORACLE7_INCLUDE)
])
+
+AC_DEFUN(AM_CONDITIONAL,
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
+
+
+
+dnl
+dnl ========================================================================
+dnl
+dnl Old Gnome 1.4 detection code -- deprecated, but still used
+dnl
+dnl ========================================================================
+
dnl AM_ACLOCAL_INCLUDE(macrodir)
AC_DEFUN([AM_ACLOCAL_INCLUDE],
[
AC_PROVIDE([GNOME_PTHREAD_CHECK])
])
-AC_DEFUN(AM_CONDITIONAL,
-[AC_SUBST($1_TRUE)
-AC_SUBST($1_FALSE)
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi])
-
dnl
dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
dnl
AC_DEFUN([GNOME_ORBIT_CHECK], [
GNOME_ORBIT_HOOK([],failure)
])
+dnl
+dnl =========================================================================
+dnl
+
+
+dnl
+dnl =========================================================================
+dnl
+dnl New package checking stuff
+dnl
+dnl =========================================================================
+dnl
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN(PKG_CHECK_MODULES, [
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ AC_MSG_CHECKING(for $2)
+
+ if $PKG_CONFIG --exists "$2" ; then
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+
+ AC_MSG_CHECKING($1_CFLAGS)
+ $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+ AC_MSG_RESULT($$1_CFLAGS)
+
+ AC_MSG_CHECKING($1_LIBS)
+ $1_LIBS=`$PKG_CONFIG --libs "$2"`
+ AC_MSG_RESULT($$1_LIBS)
+ else
+ $1_CFLAGS=""
+ $1_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+ ifelse([$4], ,echo $$1_PKG_ERRORS,)
+ fi
+
+ AC_SUBST($1_CFLAGS)
+ AC_SUBST($1_LIBS)
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+
+ if test $succeeded = yes; then
+ ifelse([$3], , :, [$3])
+ else
+ ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+ fi
+])