dnl Process this file with autoconf to produce a configure script. AC_INIT(acconfig.h) AM_INIT_AUTOMAKE(mnogosearch, 3.1.17) AM_CONFIG_HEADER(include/udm_config.h) AC_PROG_MAKE_SET # Set all version vars based on $VERSION. How do we do this more elegant ? # Remember that regexps needs to quote [ and ] since this is run through m4 UDM_TRIM_VERSION=`echo $VERSION | sed -e "s|\.*pre[[0-9]]*$||"` UDM_BASE_VERSION=`echo $UDM_TRIM_VERSION | sed -e "s|\.[[^.]]*$||" | sed -e "s|^\(.\)\.\(.\)$|\\1\.0\\2|" | sed -e "s|\.||g"` UDM_TAIL_VERSION=`echo $UDM_TRIM_VERSION | sed -e "s|^[[0-9]]\.[[0-9]]*\.||" | sed -e "s|^\(.\)$|0\\1|"` UDM_VERSION_ID=${UDM_BASE_VERSION}${UDM_TAIL_VERSION} AC_DEFINE_UNQUOTED(UDM_VERSION_ID,$UDM_VERSION_ID) AC_SUBST(UDM_VERSION_ID) dnl Installation prefix by default AC_PREFIX_DEFAULT(/usr/local/mnogosearch) dnl Check if build env is sane AM_SANITY_CHECK dnl Check for programs. AC_PROG_CC AC_PROG_INSTALL dnl This is to disable shared libs by default AM_DISABLE_SHARED AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) dnl Checks for header files. AC_STDC_HEADERS AC_CHECK_HEADERS(fcntl.h unistd.h libutil.h \ sys/ioctl.h sys/time.h sys/times.h sys/param.h sys/wait.h sys/mman.h \ getopt.h syslog.h select.h sys/select.h sys/socket.h arpa/inet.h netdb.h\ netinet/in.h netinet/in_systm.h netinet/ip.h netinet/tcp.h netinet/in.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T # Check if we have socklen_t AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, AC_TRY_COMPILE( [#include #include ], [socklen_t s;], ac_cv_have_socklen_t=yes, ac_cv_have_socklen_t=no)) if test "$ac_cv_have_socklen_t" = "no" then AC_DEFINE(socklen_t, int) fi dnl Check if we are little or big endian AC_C_BIGENDIAN dnl Check for tm_gmtoff in struct tm AC_MSG_CHECKING(for tm_gmtoff in struct tm) AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff=0; ], AC_DEFINE(HAVE_TM_GMTOFF) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) dnl Check for library functions AC_CHECK_FUNCS(strdup strstr strnlen strcasecmp strncasecmp bzero) AC_CHECK_FUNCS(regcomp socket vsnprintf snprintf) AC_CHECK_FUNCS(setenv putenv, break) AC_CHECK_FUNCS(unsetenv) AC_CHECK_FUNC(inet_addr, , AC_CHECK_LIB(xnet, inet_addr, LIBS="-lxnet $LIBS")) AC_CHECK_FUNC(setproctitle, , AC_CHECK_LIB(util, setproctitle, LIBS="-lutil $LIBS")) dnl Check for libraries dnl Next line was commented out by Kir dnl Does inet_addr and inet_aton belongs to one lib? dnl If so we don't need to check for inet_aton dnl AC_CHECK_FUNCS(inet_addr inet_aton) sinclude(net.m4) AC_LIBRARY_NET dnl Determine signal handling standard AC_TYPE_SIGNAL AC_MSG_CHECKING(for POSIX signals) AC_TRY_LINK([#include ], [ sigset_t ss; struct sigaction sa; sigemptyset(&ss); sigsuspend(&ss); sigaction(SIGINT, &sa, (struct sigaction *) 0); sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); ], AC_DEFINE(HAVE_POSIX_SIGNALS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) syslog=yes AC_MSG_CHECKING(for syslog support) AC_ARG_ENABLE(syslog, [How to log indexer messages: --enable-syslog Use syslog (default) --enable-syslog=LOG_FACILITY Use syslog facility LOG_FACILITY, which should be valid name defined in /usr/include/sys/syslog.h --disable-syslog Use stdout/stderr] , syslog=$enableval) if test "$syslog" != no; then AC_DEFINE(USE_SYSLOG) if test "$syslog" != yes; then AC_DEFINE_UNQUOTED(LOG_FACILITY, $syslog, syslog facility) AC_TRY_RUN([ #include int main(void){ openlog("Test", LOG_NDELAY, LOG_FACILITY); closelog(); return 0; } ], AC_MSG_RESULT([enabled (will use $syslog facility)]), [ AC_MSG_RESULT(error) echo "You probably gave wrong facility argument ($syslog)" echo "to --enable-syslog. This argument should be one defined in" echo "/usr/include/sys/syslog.h, for example LOG_DAEMON or LOG_LOCAL7." AC_MSG_ERROR([** Unknown syslog facility given **]) ], [echo $ac_n "cross compiling; assumed OK... $ac_c"] ) else AC_MSG_RESULT(enabled) fi else AC_MSG_RESULT([disabled (will use stdout/stderr)]) fi dnl Hack to build statically linked binary distributions STATIC_LFLAGS="" static_lflags=no AC_MSG_CHECKING(for -all-static linker flags) AC_ARG_ENABLE(all-static, [ --enable-all-static build statically linked binaries],static_lflags=$enableval) if test "$static_lflags" != no; then AC_MSG_RESULT(enabled) STATIC_LFLAGS="-all-static" else AC_MSG_RESULT([disabled]) fi AC_SUBST(STATIC_LFLAGS) PTHREAD_CFLAGS="" PTHREAD_LFLAGS="" freebsd_pthreads=no AC_MSG_CHECKING(for freebsd pthreads) AC_ARG_ENABLE(freebsd-pthreads, [ --enable-freebsd-pthreads enable FreeBSD pthreads],freebsd_pthreads=$enableval) if test "$freebsd_pthreads" != no; then AC_DEFINE(HAVE_PTHREAD) AC_MSG_RESULT(enabled) PTHREAD_CFLAGS="-pthread" PTHREAD_LFLAGS="-pthread" else AC_MSG_RESULT([disabled]) fi linux_pthreads=no AC_MSG_CHECKING(for linux pthreads) AC_ARG_ENABLE(linux-pthreads, [ --enable-linux-pthreads enable Linux pthreads], linux_pthreads=$enableval) if test "$linux_pthreads" != no; then AC_DEFINE(HAVE_PTHREAD) AC_MSG_RESULT(enabled) PTHREAD_CFLAGS="" PTHREAD_LFLAGS="-lpthread" else AC_MSG_RESULT([disabled]) fi AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LFLAGS) charset_guesser=no AC_MSG_CHECKING(for charset guesser) AC_ARG_ENABLE(charset-guesser, [ --enable-charset-guesser enable automatic Russian charset guesser], charset_guesser=$enableval) if test "$charset_guesser" != no; then AC_DEFINE(USE_CHARSET_GUESSER) AC_MSG_RESULT(enabled) else AC_MSG_RESULT([disabled]) fi parser=yes AC_MSG_CHECKING(for external parsers support) AC_ARG_ENABLE(parser, [ --disable-parser disable external parsers support], parser=$enableval) if test "$parser" != no; then AC_DEFINE(USE_PARSER) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi mp3=yes AC_MSG_CHECKING(for MP3 ID3 tags support) AC_ARG_ENABLE(mp3, [ --disable-mp3 disable MP3 tags support ], mp3=$enableval) if test "$mp3" != no; then AC_DEFINE(USE_MP3) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi aliasprog=yes AC_MSG_CHECKING(for AliasProg support) AC_ARG_ENABLE(aliasprog, [ --disable-aliasprog disable AliasProg support], aliasprog=$enableval) if test "$aliasprog" != no; then AC_DEFINE(UDM_WITH_ALIASPROG) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi execcgi=yes AC_MSG_CHECKING(for exec: and cgi: virtual URL scheme) AC_ARG_ENABLE(aliasprog, [ --disable-exec-cgi disable exec: and cgi: virtual scheme support], execcgi=$enableval) if test "$execcgi" != no; then AC_DEFINE(UDM_WITH_EXEC_CGI) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi file=yes AC_MSG_CHECKING(for file: URL schema support) AC_ARG_ENABLE(file, [ --disable-file disable file:/ URL scheme support], file=$enableval) if test "$file" != no; then AC_DEFINE(USE_FILE) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi http=yes AC_MSG_CHECKING([for http: (and ftp: - via proxy) URL schema support]) AC_ARG_ENABLE(http, [ --disable-http disable http:// URL scheme support], http=$enableval) if test "$http" != no; then AC_DEFINE(USE_HTTP) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi AC_MSG_CHECKING(for Openssl support) AC_ARG_WITH(openssl, [ --with-openssl[=DIR] Include Openssl support. DIR is the Openssl base install directory, defaults to /usr/local/ssl.], [ if test "$withval" != "no"; then if test "$withval" = "yes"; then if test -f /usr/include/openssl/ssl.h; then SSL_INCDIR=/usr/include else SSL_INCDIR=/usr/local/ssl/include fi if test -f /usr/lib/libssl.a; then SSL_LIBDIR=/usr/lib else SSL_LIBDIR=/usr/local/ssl/lib fi else SSL_INCDIR=$withval/include test -d $withval/include/openssl && SSL_INCDIR=$withval/include SSL_LIBDIR=$withval/lib fi SSL_INCLUDE=-I$SSL_INCDIR SSL_LFLAGS="-L$SSL_LIBDIR -lcrypto -lssl" AC_MSG_RESULT(yes) AC_DEFINE(USE_HTTPS) else AC_MSG_RESULT(no) fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(SSL_INCLUDE) AC_SUBST(SSL_LFLAGS) ftp=yes AC_MSG_CHECKING(for ftp: URL schema support) AC_ARG_ENABLE(ftp, [ --disable-ftp disable ftp:// URL scheme support], ftp=$enableval) if test "$ftp" != no; then AC_DEFINE(USE_FTP) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi htdb=yes AC_MSG_CHECKING(for htdb: virtual URL schema support) AC_ARG_ENABLE(htdb, [ --disable-htdb disable htdb:/ virtual URL scheme support], htdb=$enableval) if test "$htdb" != no; then AC_DEFINE(USE_HTDB) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi news=yes AC_MSG_CHECKING(for news: URL schema support) AC_ARG_ENABLE(news, [ --disable-news disable news:// URL schema support], news=$enableval) if test "$news" != no; then AC_DEFINE(USE_NEWS) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi ext=no AC_MSG_CHECKING(for extended NEWS features) AC_ARG_ENABLE(news-extension, [ --enable-news-extension enable extended NEWS features], ext=$enableval) if test "$ext" != no; then AC_DEFINE(NEWS_EXT) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi fasttag=no AC_MSG_CHECKING(for fast tag search support) AC_ARG_ENABLE(fast-tag, [ --enable-fast-tag enable fast tag search in cache mode], fasttag=$enableval) if test "$fasttag" != no; then AC_DEFINE(UDM_STORE_CACHE_TAG) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi fastcat=no AC_MSG_CHECKING(for fast category search support) AC_ARG_ENABLE(fast-cat, [ --enable-fast-cat enable fast category search in cache mode], fastcat=$enableval) if test "$fastcat" != no; then AC_DEFINE(UDM_STORE_CACHE_CATEGORY) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi fastsite=no AC_MSG_CHECKING(for fast site search support) AC_ARG_ENABLE(fast-site, [ --enable-fast-site enable fast site search in cache mode], fastsite=$enableval) if test "$fastsite" != no; then AC_DEFINE(UDM_STORE_CACHE_SITEID) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi phrase=no AC_MSG_CHECKING(for phrase support in cache mode) AC_ARG_ENABLE(phrase, [ --enable-phrase enable phrase support in cache mode],phrase=$enableval) if test "$phrase" != no; then AC_DEFINE(UDM_STORE_CACHE_WRDPOS) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi dmalloc=no AC_MSG_CHECKING(for DMALLOC memory debugger support) AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc enable DMALLOC memory debugger support],dmalloc=$enableval) if test "$dmalloc" != no; then AC_DEFINE(DMALLOC) LIBS="$LIBS -L/usr/local/lib -ldmalloc " CFLAGS="$CFLAGS -I/usr/local/include" AC_MSG_RESULT(yes) else AC_MSG_RESULT([no]) fi dnl Check for some DBMS backend dnl NOTE: we can use only one backend at the same time have_db=no AC_MSG_CHECKING(for MySQL support) AC_ARG_WITH(mysql, [ What 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.], [ if test "$withval" != "no"; then if test "$withval" = "yes"; then if test -f /usr/local/mysql/include/mysql/mysql.h; then MYSQL_INCDIR=/usr/local/mysql/include/mysql MYSQL_LIBDIR=/usr/local/mysql/lib/mysql elif test -f /usr/include/mysql/mysql.h; then MYSQL_INCDIR=/usr/include/mysql MYSQL_LIBDIR=/usr/lib/mysql elif test -f /usr/include/mysql.h; then MYSQL_INCDIR=/usr/include MYSQL_LIBDIR=/usr/lib elif test -f /usr/local/include/mysql/mysql.h; then MYSQL_INCDIR=/usr/local/include/mysql MYSQL_LIBDIR=/usr/local/lib/mysql elif test -f /usr/local/include/mysql.h; then MYSQL_INCDIR=/usr/local/include MYSQL_LIBDIR=/usr/local/lib elif test -f /Library/MySQL/include/mysql/mysql.h; then MYSQL_INCDIR=/Library/MySQL/include/mysql MYSQL_LIBDIR=/Library/MySQL/lib/mysql else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h) fi else if test -f $withval/include/mysql/mysql.h; then MYSQL_INCDIR=$withval/include/mysql MYSQL_LIBDIR=$withval/lib/mysql elif test -f $withval/include/mysql.h; then MYSQL_INCDIR=$withval/include MYSQL_LIBDIR=$withval/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h under $withval) fi fi MYSQL_INCLUDE=-I$MYSQL_INCDIR MYSQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient" AC_DEFINE(HAVE_MYSQL) AC_MSG_RESULT(yes) have_db=yes dnl MySQL requires -lm sometime AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor, MYSQL_LFLAGS="$MYSQL_LFLAGS -lm")) dnl MySQL 3.23 requires -lz sometime AC_CHECK_FUNC(compress, , AC_CHECK_LIB(z, compress, MYSQL_LFLAGS="$MYSQL_LFLAGS -lz")) else AC_MSG_RESULT(no) fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(MYSQL_LFLAGS) AC_SUBST(MYSQL_INCLUDE) AC_MSG_CHECKING(for PostgreSQL support) AC_ARG_WITH(pgsql, [ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql.], [ if test "$withval" != "no"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi if test "$withval" = "yes"; then if test -f /usr/include/pgsql/libpq-fe.h; then PGSQL_INCDIR=/usr/include/pgsql else PGSQL_INCDIR=/usr/local/pgsql/include fi if test -f /usr/lib/libpq.a; then PGSQL_LIBDIR=/usr/lib else PGSQL_LIBDIR=/usr/local/pgsql/lib fi else PGSQL_INCDIR=$withval/include test -d $withval/include/pgsql && PGSQL_INCDIR=$withval/include/pgsql PGSQL_LIBDIR=$withval/lib test -d $withval/lib/pgsql && PGSQL_LIBDIR=$withval/lib/pgsql fi PGSQL_INCLUDE=-I$PGSQL_INCDIR PGSQL_LFLAGS="-L$PGSQL_LIBDIR -lpq" AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt, LIBS="-lcrypt $LIBS")) AC_DEFINE(HAVE_PGSQL) AC_MSG_RESULT(yes) have_db=yes else AC_MSG_RESULT(no) fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(PGSQL_LFLAGS) AC_SUBST(PGSQL_INCLUDE) AC_MSG_CHECKING(for mSQL support) AC_ARG_WITH(msql, [ --with-msql[=DIR] Include mSQL support. DIR is the mSQL base install directory, defaults to /usr/local/Hughes.], [ if test "$withval" != "no"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi if test "$withval" = "yes"; then MSQL_INCDIR=/usr/local/Hughes/include MSQL_LIBDIR=/usr/local/Hughes/lib else MSQL_INCDIR=$withval/include MSQL_LIBDIR=$withval/lib fi MSQL_INCLUDE=-I$MSQL_INCDIR MSQL_LFLAGS="-L$MSQL_LIBDIR -lmsql" AC_DEFINE(HAVE_MSQL) AC_MSG_RESULT(yes) have_db=yes else AC_MSG_RESULT(no) fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(MSQL_LFLAGS) AC_SUBST(MSQL_INCLUDE) AC_MSG_CHECKING(for iODBC support) AC_ARG_WITH(iodbc, [ --with-iodbc[=DIR] Include iODBC support. DIR is the iODBC base install directory, defaults to /usr/local.], [ if test "$withval" != "no"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi fi if test "$withval" = "yes"; then withval=/usr/local fi if test "$withval" != "no"; then if test -f $withval/include/isql.h; then IODBC_INCDIR=$withval/include IODBC_LIBDIR=$withval/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid iODBC directory - unable to find isql.h) fi IODBC_LFLAGS="-L$IODBC_LIBDIR -liodbc" IODBC_INCLUDE=-I$IODBC_INCDIR AC_DEFINE(HAVE_IODBC) AC_MSG_RESULT(yes) have_db=yes fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(IODBC_LFLAGS) AC_SUBST(IODBC_INCLUDE) AC_MSG_CHECKING(for unixODBC support) AC_ARG_WITH(unixODBC, [ --with-unixODBC[=DIR] Include unixODBC support. DIR is the unixODBC base install directory, defaults to /usr/local.], [ if test "$withval" != "no"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi fi if test "$withval" = "yes"; then withval=/usr/local fi if test "$withval" != "no"; then if test -f $withval/include/sql.h; then UNIXODBC_INCDIR=$withval/include UNIXODBC_LIBDIR=$withval/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid unixODBC directory - unable to find sql.h) fi UNIXODBC_LFLAGS="-L$UNIXODBC_LIBDIR -lodbc" UNIXODBC_INCLUDE=-I$UNIXODBC_INCDIR AC_DEFINE(HAVE_UNIXODBC) AC_MSG_RESULT(yes) have_db=yes fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(UNIXODBC_LFLAGS) AC_SUBST(UNIXODBC_INCLUDE) AC_MSG_CHECKING(for Solid support) AC_ARG_WITH(solid, [ --with-solid[=DIR] Include Solid support. DIR is the Solid base install directory, defaults to /usr/local.], [ if test "$withval" != "no"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi fi if test "$withval" = "yes"; then withval=/usr/local fi if test "$withval" != "no"; then if test -f $withval/include/cli0cli.h; then SOLID_INCDIR=$withval/include SOLID_LIBDIR=$withval/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid Solid directory - unable to find cli0cli.h) fi SOLID_LFLAGS="-L$SOLID_LIBDIR -lsolcli -lm" SOLID_INCLUDE="-I$SOLID_INCDIR" AC_DEFINE(HAVE_SOLID) AC_MSG_RESULT(yes) have_db=yes fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(SOLID_LFLAGS) AC_SUBST(SOLID_INCLUDE) AC_MSG_CHECKING(for OpenLink ODBC support) AC_ARG_WITH(openlink, [ --with-openlink[=DIR] Include OpenLink ODBC support. DIR is the base OpenLink ODBC install directory], [ if test "$withval" != "no"; then if test "$withval" = "yes"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi if test -f /usr/local/virtuoso-ent/odbcsdk/include/isql.h; then VIRT_INCDIR=/usr/local/virtuoso-ent/odbcsdk/include/ VIRT_LIBDIR=/usr/local/virtuoso-ent/odbcsdk/lib/ elif test -f /usr/local/virtuoso-lite/odbcsdk/include/isql.h; then VIRT_INCDIR=/usr/local/virtuoso-lite/odbcsdk/include/ VIRT_LIBDIR=/usr/local/virtuoso-lite/odbcsdk/lib/ elif test -f /usr/local/virtuoso/odbcsdk/include/isql.h; then VIRT_INCDIR=/usr/local/virtuoso/odbcsdk/include/ VIRT_LIBDIR=/usr/local/virtuoso/odbcsdk/lib/ else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid OpenLink ODBC directory - unable to find isql.h) fi else if test -f $withval/odbcsdk/include/isql.h; then VIRT_INCDIR=$withval/odbcsdk/include/ VIRT_LIBDIR=$withval/odbcsdk/lib/ elif test -f $withval/include/isql.h; then VIRT_INCDIR=$withval/include/ VIRT_LIBDIR=$withval/lib/ else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid OpenLink ODBC directory - unable to find isql.h under $withval) fi fi VIRT_INCLUDE=-I$VIRT_INCDIR VIRT_LFLAGS="-L$VIRT_LIBDIR -liodbc" AC_DEFINE(HAVE_VIRT) AC_MSG_RESULT(yes) have_db=yes else AC_MSG_RESULT(no) fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(VIRT_LFLAGS) AC_SUBST(VIRT_INCLUDE) AC_MSG_CHECKING(for EasySoft ODBC support) AC_ARG_WITH(easysoft, [ --with-easysoft[=DIR] Include EasySoft ODBC support. DIR is the base EasySoft ODBC install directory], [ if test "$withval" != "no"; then if test "$withval" = "yes"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi if test -f /usr/local/easysoft/oob/client/include/sql.h; then EASYSOFT_INCDIR=/usr/local/easysoft/oob/client/include/ EASYSOFT_LFLAGS="-L/usr/local/easysoft/oob/client/lib/ -L/usr/local/easysoft/lib" else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid EasySoft ODBC directory - unable to find sql.h) fi else if test -f $withval/easysoft/oob/client/include/sql.h; then EASYSOFT_INCDIR=$withval/easysoft/oob/client/include/ EASYSOFT_LFLAGS="-L$withval/easysoft/oob/client/lib/ -L$withval/easysoft/lib" else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid EasySoft ODBC directory - unable to find sql.h under $withval) fi fi EASYSOFT_INCLUDE=-I$EASYSOFT_INCDIR EASYSOFT_LFLAGS="$EASYSOFT_LFLAGS -lesoobclient -lesrpc -lsupport -lextra" AC_DEFINE(HAVE_EASYSOFT) AC_MSG_RESULT(yes) have_db=yes else AC_MSG_RESULT(no) fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(EASYSOFT_LFLAGS) AC_SUBST(EASYSOFT_INCLUDE) AC_MSG_CHECKING(for SAPDB ODBC support) AC_ARG_WITH(sapdb, [ --with-sapdb[=DIR] Include SAPDB support. DIR is the SAPDB base install directory, defaults to /usr/sapdb.], [ if test "$withval" != "no"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi fi if test "$withval" = "yes"; then withval=/usr/sapdb fi if test "$withval" != "no"; then if test -f $withval/incl/sql.h; then SAPDB_INCDIR=$withval/incl SAPDB_LIBDIR=$withval/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid SAPDB directory - unable to find sql.h) fi SAPDB_LFLAGS="-L$SAPDB_LIBDIR -lpthread -lsqlod -lsqlrte -lm" SAPDB_INCLUDE=-I$SAPDB_INCDIR AC_DEFINE(HAVE_SAPDB) AC_MSG_RESULT(yes) have_db=yes fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(SAPDB_LFLAGS) AC_SUBST(SAPDB_INCLUDE) AC_MSG_CHECKING(for InterBase support) AC_ARG_WITH(ibase, [ --with-ibase[=DIR] Include InterBase support. DIR is the InterBase install directory, defaults to /usr/interbase.], [ if test "$withval" != "no"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi fi if test "$withval" = "yes"; then withval=/usr/interbase fi if test "$withval" != "no"; then if test -f $withval/include/ibase.h; then IBASE_INCDIR=$withval/include IBASE_LIBDIR=$withval/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid InterBase directory - unable to find ibase.h) fi IBASE_LFLAGS="-L$IBASE_LIBDIR -lgds" IBASE_INCLUDE=-I$IBASE_INCDIR AC_DEFINE(HAVE_IBASE) AC_MSG_RESULT(yes) have_db=yes dnl IB requires -lcrypt sometime AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt, IBASE_LFLAGS="$IBASE_LFLAGS -lcrypt")) dnl IB requires -ldl sometime AC_CHECK_FUNC(dlopen, , AC_CHECK_LIB(dl, dlopen, IBASE_LFLAGS="$IBASE_LFLAGS -ldl")) dnl InterBase lib on FreeBSD is in old aout format dnl so we need to pass -aout flag to ranlib if echo $build_os | grep -q freebsdelf; then RANLIB="$RANLIB -aout" CFLAGS="$CFLAGS -aout" AM_PROG_LIBTOOL fi fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(IBASE_LFLAGS) AC_SUBST(IBASE_INCLUDE) AC_MSG_CHECKING(for Oracle7 support) AC_ARG_WITH(oracle7, [ --with-oracle7[=DIR] Include Oracle 7.3 support. DIR is the Oracle home directory, defaults to ORACLE_HOME [$ORACLE_HOME]], [ if test "$withval" != "no"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi fi if test "$withval" = "yes"; then withval="$ORACLE_HOME" fi if test "$withval" != "no"; then if test -f $withval/rdbms/demo/ocidfn.h; then ORACLE7_INCDIR=$withval/rdbms/demo/ ORACLE7_LIBDIR1=$withval/lib ORACLE7_LIBDIR2=$withval/rdbms/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid ORACLE directory - unable to find ocidfn.h) fi ORACLEINST_TOP=$withval if test -f "$ORACLEINST_TOP/rdbms/lib/sysliblist" then ORA_SYSLIB="`cat $ORACLEINST_TOP/rdbms/lib/sysliblist`" elif test -f "$ORACLEINST_TOP/lib/sysliblist" then ORA_SYSLIB="`cat $ORACLEINST_TOP/lib/sysliblist`" else ORA_SYSLIB="-lm" fi ORACLE7_LFLAGS="-L$ORACLE7_LIBDIR1 -L$ORACLE7_LIBDIR2 \ -lclient -lsqlnet -lncr -lsqlnet -lclient -lcommon \ -lgeneric \ -lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 \ $ORA_SYSLIB -lcore3 $ORA_SYSLIB" ORACLE7_INCLUDE="-I$ORACLE7_INCDIR " AC_DEFINE(HAVE_ORACLE7) AC_MSG_RESULT(yes) have_db=yes fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(ORACLE7_LFLAGS) AC_SUBST(ORACLE7_INCLUDE) AC_MSG_CHECKING(for Oracle8 support) AC_ARG_WITH(oracle8, [ --with-oracle8[=DIR] Include Oracle8 support. DIR is the Oracle home directory, defaults to $ORACLE_HOME or /oracle8/app/oracle/product/8.0.5.], [ if test "$withval" != "no"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi fi if test "$withval" = "yes"; then withval="$ORACLE_HOME" if test "$withval" = ""; then withval=/oracle8/app/oracle/product/8.0.5 fi fi if test "$withval" != "no"; then if test -f $withval/rdbms/demo/oci.h; then ORACLE8_INCDIR1=$withval/rdbms/demo/ ORACLE8_INCDIR2=$withval/rdbms/public/ ORACLE8_INCDIR3=$withval/network/public/ ORACLE8_INCDIR4=$withval/plsql/public/ ORACLE8_LIBDIR1=$withval/lib ORACLE8_LIBDIR2=$withval/rdbms/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid ORACLE directory - unable to find oci.h) fi if test -f $withval/lib/libwtc8.so; then ORACLE8_LIBS="-lwtc8" fi ORACLE8_LFLAGS="-L$ORACLE8_LIBDIR1 -L$ORACLE8_LIBDIR2$ORACLE8_LIBS -lclntsh -lmm -lepc -lclient -lvsn -lcommon -lgeneric -lcore4 -lnlsrtl3 -lm -lnetv2 -lnttcp -lnetwork -lncr -lsql" ORACLE8_INCLUDE="-I$ORACLE8_INCDIR1 -I$ORACLE8_INCDIR2 -I$ORACLE8_INCDIR3 -I$ORACLE8_INCDIR4" AC_DEFINE(HAVE_ORACLE8) AC_MSG_RESULT(yes) have_db=yes fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(ORACLE8_LFLAGS) AC_SUBST(ORACLE8_INCLUDE) AC_MSG_CHECKING(for Oracle8i support) AC_ARG_WITH(oracle8i, [ --with-oracle8i[=DIR] Include Oracle8i support. DIR is the Oracle home directory, defaults to $ORACLE_HOME], [ if test "$withval" != "no"; then if test "$have_db" = "yes"; then AC_MSG_RESULT(error) AC_MSG_ERROR("You can configure for only one database."); fi fi if test "$withval" = "yes"; then withval="$ORACLE_HOME" fi if test "$withval" != "no"; then if test -f $withval/rdbms/demo/oci.h; then ORACLE8_INCDIR1=$withval/rdbms/demo/ ORACLE8_INCDIR2=$withval/rdbms/public/ ORACLE8_INCDIR3=$withval/network/public/ ORACLE8_INCDIR4=$withval/plsql/public/ ORACLE8_LIBDIR1=$withval/lib ORACLE8_LIBDIR2=$withval/rdbms/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid ORACLE directory - unable to find oci.h) fi ORACLE8_LFLAGS="-L$ORACLE8_LIBDIR1 -L$ORACLE8_LIBDIR2 -lclntsh -lmm -lm" ORACLE8_INCLUDE="-I$ORACLE8_INCDIR1 -I$ORACLE8_INCDIR2 -I$ORACLE8_INCDIR3 -I$ORACLE8_INCDIR4" AC_DEFINE(HAVE_ORACLE8) AC_MSG_RESULT(yes) have_db=yes fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(ORACLE8_LFLAGS) AC_SUBST(ORACLE8_INCLUDE) AC_MSG_CHECKING(for built-in database support) AC_ARG_WITH(built-in, [ --with-built-in Include built-in database support. Use for small sites.], [ AC_DEFINE(HAVE_FILES) AC_MSG_RESULT(yes) have_db=yes ],[ AC_MSG_RESULT(no) ]) dnl Check if one of databases was selected if test "$have_db" != "yes"; then AC_MSG_ERROR(No database selected! Use --with-XXX where XXX is your preferred database type) echo fi AC_OUTPUT(Makefile src/Makefile doc/Makefile etc/Makefile udm-config run-splitter) chmod a+x udm-config chmod a+x run-splitter echo echo "***********************************************************" echo "* *" echo "* Now run make && make install *" echo "* If it fails, try to use GNU make, *" echo "* often installed as gmake. *" echo "* *" echo "* *" echo "* Thank you for using mnoGoSearch! *" echo "***********************************************************" echo