dnl Process this file with autoconf to produce a configure script for dict. dnl dnl Created: Wed Apr 24 14:11:05 1996 by faith@dict.org dnl Revised: Sat Mar 30 11:01:57 2002 by faith@dict.org dnl Copyright 1996-1999, 2001-2002 Rickard E. Faith (faith@dict.org) dnl dnl This program is free software; you can redistribute it and/or modify it dnl under the terms of the GNU General Public License as published by the dnl Free Software Foundation; either version 1, or (at your option) any dnl later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License along dnl with this program; if not, write to the Free Software Foundation, Inc., dnl 675 Mass Ave, Cambridge, MA 02139, USA. dnl dnl $Id: configure.in,v 1.105 2007/05/29 20:31:45 cheusov Exp $ dnl dnl Flag conventions: dnl CFLAGS and LDFLAGS should be settable on the make commandline dnl for optimization and stripping. dnl LIBOBJS is an automatically-generated list of extra objects we need define(VERSION, 1.10.9) AC_PREREQ(2.53) AC_REVISION($Revision: 1.105 $) AC_INIT([dict],[VERSION],["dict-beta@dict.org"]) AC_CONFIG_SRCDIR([dictd.c]) AC_CONFIG_HEADER(config.h) echo Configuring for dict echo . DICT_VERSION=VERSION AC_ARG_WITH(cc, [ --with-cc with cc (instead of gcc)], [ if test "x${withval}" = xyes; then CC=cc fi ]) AC_CANONICAL_HOST AC_PROG_CC dnl AC_PROG_CXX AC_ISC_POSIX REALCC="$CC" if test "$CC" = gcc; then CFLAGS='-g -O' WCFLAGS='-Wall' case "$host" in dnl did include: -Winline *linux*) WCFLAGS="$WCFLAGS -pipe -Wwrite-strings -Wcast-align \ -Wmissing-prototypes -Wshadow -Wnested-externs -Waggregate-return";; sparc-sun-sunos*) WCFLAGS="$WCFLAGS -pipe";; esac # Silence flex/bison output SCFLAGS="-Wno-implicit -Wno-unused" else CFLAGS='-g' fi local_libmaa=0 AC_ARG_WITH(cflags, [ --with-cflags=FLAGS use FLAGS for CFLAGS], CFLAGS="$withval") AC_ARG_WITH(prof, [ --with-prof with prof profiling], [ if test "x${withval}" = xyes; then CFLAGS="$CFLAGS -p" LDFLAGS="$LDFLAGS -p" fi ]) AC_ARG_WITH(nec-socks5, [ --with-nec-socks5 with NEC socks5 library], [ if test "x${withval}" = xyes; then CFLAGS="$CFLAGS -Dconnect=Rconnect \ -Dgetsockname=Rgetsockname -Dgetpeername=Rgetpeername \ -Dbind=Rbind -Daccept=Raccept \ -Dselect=Rselect -DRconnect=SOCKSconnect \ -DRgetsockname=SOCKSgetsockname -DRgetpeername=SOCKSgetpeername \ -DRbind=SOCKSbind -DRaccept=SOCKSaccept -DRlisten=SOCKSlisten \ -DRselect=SOCKSselect -Drecvfrom=SOCKSrecvfrom -Dsendto=SOCKSsendto \ -Drecv=SOCKSrecv -Dsend=SOCKSsend -Dread=SOCKSread -Dwrite=SOCKSwrite \ -Drresvport=SOCKSrresvport -Dshutdown=SOCKSshutdown -Dlisten=SOCKSlisten \ -Dclose=SOCKSclose -Ddup=SOCKSdup -Ddup2=SOCKSdup2 \ -Dgethostbyname=SOCKSgethostbyname" REALLIBS="$REALLIBS -lsocks5" fi ]) AC_ARG_WITH(gprof, [ --with-gprof with gprof profiling], [ if test "x${withval}" = xyes; then CFLAGS="$CFLAGS -pg" LDFLAGS="$LDFLAGS -pg" fi ]) AC_ARG_WITH(local-libmaa, [ --without-local-libmaa without libmaa built in local source tree], [ if test "x${withval}" = xyes; then local_libmaa=0 fi ]) REGEX_INCLUDE='regex.h' AC_ARG_WITH(regex-include, [ --with-regex-include=FILE set an alternative to regex.h], [ REGEX_INCLUDE=${withval} ]) AC_ARG_WITH(checker, [ --with-checker with Checker support (Linux only)], [ if test "x${withval}" = xyes; then REALCC=checkergcc fi ]) AC_ARG_WITH(efence, [ --with-efence with Electric Fence (by Bruce Perens)], [ if test "x${withval}" = xyes; then REALLIBS="$REALLIBS -lefence" fi ]) AC_ARG_WITH(insure, [ --with-insure with Insure support (from ParaSoft Corp.)], [ if test "x${withval}" = xyes; then REALCC=insight fi ]) AC_ARG_WITH(purify, [ --with-purify with Purify support (from Pure, Inc.)], [ if test "x${withval}" = xyes; then REALCC="purify gcc" fi ]) AC_ARG_WITH(purify, [ --with-system-utf8-funcs use system wcXXX and mbXXX functions], [ if test "x${withval}" = xyes; then SYSTEM_UTF8=1 fi ]) AC_ARG_ENABLE([plugin],[ --disable-plugin without plugin support]) if test "x${enableval}" != xno; then AC_CHECK_LIB(c, dlopen, [USE_PLUGIN=2], AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"; USE_PLUGIN=2], AC_CHECK_LIB(ltdl,lt_dlopen, [LIBS="$LIBS -lltdl"; USE_PLUGIN=1]))) # [AC_MSG_ERROR( # [Install ltdl library and appropriate header files # or run ./configure --disable-plugin])]))) fi AC_ARG_ENABLE([dictorg],[ --enable-dictorg use predefined dict servers]) if test "x${enableval}" = xyes; then CFLAGS="$CFLAGS -DUSE_DICT_ORG" USE_DICT_ORG=1 fi dnl Checks for programs. echo Checking for programs AC_PROG_AWK AC_PROG_INSTALL AC_PROG_RANLIB AC_PROG_MAKE_SET AC_PROG_YACC AC_PROG_LEX #AC_PROG_LIBTOOL dnl AC_LIBTOOL_DLOPEN AC_CHECK_PROG(AR,ar,ar) dnl AC_PROG_LIBTOOL dnl AC_LIBTOOL_DLOPEN AC_CHECK_PROGS(NROFF,gnroff nroff) AC_CHECK_PROGS(TROFF,groff troff) AC_CHECK_PROGS(COL,col cat) AC_CHECK_PROGS(EXPAND,expand cat) echo . echo Checking for libraries if test "$local_libmaa" = 0; then AC_CHECK_LIB(maa,maa_shutdown,XLDFLAGS="$XLDFLAGS -lmaa",local_libmaa=1) fi if test "$local_libmaa" = 1; then AC_MSG_CHECKING(for libmaa in local source tree) if test -d libmaa; then XLDFLAGS="$XLDFLAGS -Llibmaa -lmaa" XCPPFLAGS="$XCPPFLAGS -Ilibmaa" subdirs="$subdirs libmaa" AC_CONFIG_SUBDIRS(libmaa) allsubdirs="$allsubdirs libmaa" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_ERROR([Libmaa not found, cannot continue]) fi fi AC_CHECK_LIB(Judy, JudySLNext, [JUDYLIB=-lJudy]) AC_CHECK_LIB(dbi, dbi_shutdown, [DBILIB=-ldbi]) AC_CHECK_LIB(socket,main) AC_CHECK_LIB(c,inet_ntoa, [true], [AC_CHECK_LIB(nsl,inet_ntoa)]) echo . echo Checking for header files AC_HEADER_STDC AC_HEADER_TIME if test "x${USE_PLUGIN}" = "x2"; then # We use native dlopen AC_CHECK_HEADERS(dlfcn.h, [CFLAGS="$CFLAGS -DUSE_PLUGIN"], [USE_PLUGIN=]) # [AC_DEFINE(HAVE_DLFCN_H, 1, # [Define if you have the header file.])], # [AC_MSG_ERROR([Install dl library and appropriate header files # or run ./configure --disable-plugin])]) fi if test "x${USE_PLUGIN}" = "x1"; then # We use libltdl AC_CHECK_HEADERS(ltdl.h, [CFLAGS="$CFLAGS -DUSE_PLUGIN"], [USE_PLUGIN=]) # [AC_DEFINE(HAVE_LTDL_H, 1, # [Define if you have the header file.])], # [AC_MSG_ERROR([Install ltdl library and appropriate header files # or run ./configure --disable-plugin])]) fi AC_CHECK_HEADERS(unistd.h strings.h limits.h) AC_CHECK_HEADERS(sys/resource.h sys/time.h sys/param.h sys/wait.h) AC_CHECK_HEADERS(wctype.h wchar.h) AC_CHECK_HEADER([Judy.h], ,[JUDYLIB=]) AC_CHECK_HEADER([dbi/dbi.h], ,[DBILIB=]) AC_CHECK_TYPES(wint_t,,, [#include ]) AC_CHECK_TYPES(mbstate_t, , , [#include ]) AC_CHECK_TYPES(wchar_t, , , [#include ]) AC_CHECK_TYPES(size_t) echo . echo Checking for system constants AC_C_CONST AC_C_INLINE echo . echo Checking for library functions AC_FUNC_ALLOCA AC_FUNC_FORK AC_FUNC_MALLOC #AC_FUNC_STAT AC_FUNC_STRCOLL AC_FUNC_STRFTIME AC_FUNC_VPRINTF AC_FUNC_WAIT3 AC_CHECK_FUNCS(waitpid) #AC_FUNC_MMAP AC_CHECK_FUNCS(mmap munmap) AC_CHECK_FUNCS(strdup strtol strtoul semget strerror inet_aton) AC_CHECK_FUNCS(strdup strtol strtoul) AC_CHECK_FUNCS(alarm gethostbyaddr gethostbyname gethostname gettimeofday) AC_CHECK_FUNCS(inet_ntoa memmove memset regcomp setlocale) AC_CHECK_FUNCS(socket strcasecmp strchr strrchr strstr uname) AC_CHECK_FUNCS(dlopen) AC_CHECK_FUNCS(getopt) AC_CHECK_FUNCS(initgroups) AC_CHECK_FUNC(daemon,, [AC_LIBOBJ([daemon3])]) AC_REPLACE_FUNCS(setenv) AC_CHECK_FUNCS(putenv) if test "$SYSTEM_UTF8"; then CFLAGS="$CFLAGS -DSYSTEM_UTF8_FUNCS" AC_REPLACE_FUNCS(wcrtomb wctomb mbrlen mbrtowc mbstowcs mbtowc) AC_REPLACE_FUNCS(iswspace iswalnum towlower) AC_CHECK_FUNCS(wcwidth) else #not SYSTEM_UTF8 AC_LIBOBJ([wcrtomb]) AC_LIBOBJ([wctomb]) AC_LIBOBJ([mbrlen]) AC_LIBOBJ([mbrtowc]) AC_LIBOBJ([mbstowcs]) AC_LIBOBJ([mbtowc]) AC_LIBOBJ([iswspace]) AC_LIBOBJ([iswalnum]) AC_LIBOBJ([towlower]) # AC_LIBOBJ([wcwidth]) fi #end of SYSTEM_UTF8 AC_REPLACE_FUNCS(strlcpy strlcat) AC_REPLACE_FUNCS(getopt_long) # [AC_LIBOBJ([getopt_long]) # AC_LIBOBJ([getopt])]) AC_REPLACE_FUNCS(snprintf vsnprintf) AC_CHECK_DECLS(CODESET,, [AC_LIBOBJ(nl_langinfo)], [#include ]) echo . echo Making output files CC="$REALCC" LIBS="$REALLIBS $LIBS" test "_$exec_prefix" = _NONE && exec_prefix='${prefix}' eval3 () { eval echo $(eval echo $(eval echo $@)); } SYSCONFDIR=`eval3 $sysconfdir` BINDIR=`eval3 $bindir` SBINDIR=`eval3 $sbindir` LIBEXECDIR=`eval3 $libexecdir` DATADIR=`eval3 $datadir` CPPFLAGS="$CPPFLAGS $XCPPFLAGS" CFLAGS="$CFLAGS $XCFLAGS" LDFLAGS="$LDFLAGS $XLDFLAGS" AC_SUBST(DICT_VERSION) AC_SUBST(CPPFLAGS) AC_SUBST(CFLAGS) AC_SUBST(USE_PLUGIN) AC_SUBST(EXEEXT) AC_SUBST(allsubdirs) AC_SUBST(USE_DICT_ORG) AC_SUBST(REGEX_INCLUDE) AC_SUBST(local_libmaa) AC_SUBST(JUDYLIB) AC_SUBST(DBILIB) AC_SUBST(SYSCONFDIR) AC_SUBST(BINDIR) AC_SUBST(SBINDIR) AC_SUBST(LIBEXECDIR) AC_SUBST(DATADIR) AC_CONFIG_FILES([Makefile doc/Makefile include_regex.h]) AC_CONFIG_FILES([dictdplugin-config], [chmod +x dictdplugin-config]) AC_CONFIG_FILES([dictl], [chmod +x dictl]) AC_CONFIG_FILES([colorit], [chmod +x colorit]) AC_CONFIG_FILES([dictunformat], [chmod +x dictunformat]) #AC_CONFIG_FILES([dictfmt_index2suffix], [chmod +x dictfmt_index2suffix]) #AC_CONFIG_FILES([dictfmt_index2word], [chmod +x dictfmt_index2word]) AC_CONFIG_FILES(colorit.1) AC_CONFIG_FILES(dict.1) AC_CONFIG_FILES(dictfmt.1) AC_CONFIG_FILES(dictfmt_index2suffix.1) AC_CONFIG_FILES(dictfmt_index2word.1) AC_CONFIG_FILES(dictl.1) AC_CONFIG_FILES(dictunformat.1) AC_CONFIG_FILES(dictzip.1) AC_CONFIG_FILES(dictd.8) AC_CONFIG_FILES(test/dictd_test) AC_OUTPUT printf '\n\n' # MAA printf "maa: " if test "_$local_libmaa" = "_0"; then echo system else echo local fi # PLUGIN SUPPORT printf "plugin support: " if test "_$USE_PLUGIN" = "_"; then echo disabled else case "$USE_PLUGIN" in 1) echo libltdl;; 2) echo native esac printf " judy plugin: " if test "_$JUDYLIB" = "_"; then echo "disabled" else echo "enabled" fi printf " dbi plugin: " if test "_$DBILIB" = "_"; then echo "disabled" else echo "enabled" fi fi printf '\n\n' date > stamp-h.in date > stamp-h #echo . #echo Done