AC_INIT(src/parser/XPath2Parser.y) AC_CONFIG_AUX_DIR(autotools) AC_CONFIG_HEADER(src/config/pathan_config_unix.h:src/config/config.pre:src/config/config.h.in:src/config/config.post) AC_MSG_CHECKING(if --enable-debug option specified) AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], [Build a debugging version.])], [pathan_cv_debug="$enable_debug"], [pathan_cv_debug="no"]) AC_MSG_RESULT($pathan_cv_debug) AC_MSG_CHECKING(if --enable-profile option specified) AC_ARG_ENABLE(profile, [AC_HELP_STRING([--enable-profile], [Build a profiling version.])], [pathan_cv_profile="$enable_profile"], [pathan_cv_profile="no"]) AC_MSG_RESULT($pathan_cv_profile) AC_MSG_CHECKING(if --enable-dependencies option specified) AC_ARG_ENABLE(dependencies, [AC_HELP_STRING([--enable-dependencies], [Build include dependencies.])], [pathan_cv_depend="$enable_dependencies"], [pathan_cv_depend="no"]) AC_MSG_RESULT($pathan_cv_depend) dnl --- Check Xerces library name --- AC_MSG_CHECKING([if --with-xerces=DIR option specified]) AC_ARG_WITH(xerces, [AC_HELP_STRING([--with-xerces=DIR], [Path of Xerces. [DIR="../xerces-c-src"]])], [with_xerces="$withval"], [with_xerces="no"]) AC_MSG_RESULT($with_xerces) if test "$with_xerces" = "no"; then with_xerces="/usr/local" fi if test `ls $with_xerces/lib/libxerces-c.*2[[6-7]].* 2>/dev/null | wc -l` -gt 0 ; then AC_MSG_CHECKING([for Xerces C++ version from source tree]) xerces_version=`ls "$with_xerces"/lib/libxerces-c.*[[0-9]][[0-9]].* | tail -1 | sed 's/.*xerces-c.*\([[0-9]]\)\([[0-9]]\).*/\1.\2/'` AC_MSG_RESULT([$xerces_version]) xerces_lib="$with_xerces/lib" xerces_include="$with_xerces/src" xerces_library="xerces-c" elif test `ls $with_xerces/lib/libxerces-c*2[[6-7]].* 2>/dev/null | wc -l` -gt 0 ; then AC_MSG_CHECKING([for Xerces C++ version from source tree]) xerces_version=`ls "$with_xerces"/lib/libxerces-c*[[0-9]][[0-9]].* | tail -1 | sed 's/.*xerces-c*\([[0-9]]\)\([[0-9]]\).*/\1.\2/'` AC_MSG_RESULT([$xerces_version]) xerces_lib="$with_xerces/lib" xerces_include="$with_xerces/src" xerces_library="xerces-c" else AC_MSG_ERROR([Xerces-C++ is required to build XQuery. $with_xerces not a valid, supported Xerces tree. You must specify the path where Xerces is installed with --with-xerces.]) fi AC_SUBST(xerces_library) AC_SUBST(xerces_include) AC_SUBST(xerces_src) AC_SUBST(xerces_lib) AC_SUBST(MAKEFILE_CXX_MM) AC_SUBST(build_cpp_dep) MAKEFILE_CXX_MM="nocxx" dnl --- Establish absolute srcdir path for Makefiles --- topsrcdir=`cd ${srcdir}; pwd;` AC_SUBST(topsrcdir) dnl --- Check system type --- AC_CANONICAL_SYSTEM dnl Currently we need no specific defines so the UNIX default is fine system_type="UNIX" dnl case "$target" in dnl i*86-*-linux-*) system_type="LINUX" ;; dnl sparc-sun-solaris*) system_type="UNIX" ;; dnl esac case "$host_os" in aix*) system_type="AIX";; bsdi3*) system_type="BSD";; bsdi*) system_type="BSD";; freebsd*) system_type="BSD";; hpux*) system_type="HPUX";; irix*);; linux*) system_type="LINUX";; mpeix*);; osf*);; solaris*) system_type="SOLARIS";; darwin*) system_type="MAC";; esac AC_SUBST(system_type) # Don't override anything if it's already set from the environment. optimize_def="-O" case $host_os in aix4.3.*|aix5*) optimize_def="-O2" CC=${CC-"xlc_r"} CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" LDFLAGS="$LDFLAGS -Wl,-brtl";; bsdi3*) CC=${CC-"shlicc2"} LIBS="$LIBS -lipc";; cygwin*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";; freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" LDFLAGS="$LDFLAGS -pthread";; gnu*|k*bsd*-gnu|linux*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";; hpux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT";; irix*) optimize_def="-O2" CPPFLAGS="$CPPFLAGS -D_SGI_MP_SOURCE";; mpeix*) CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -D_SOCKET_SOURCE" LIBS="$LIBS -lsocket -lsvipc";; osf*) CPPFLAGS="$CPPFLAGS -pthread";; *qnx*) AC_DEFINE(HAVE_QNX) AH_TEMPLATE(HAVE_QNX, [Define to 1 if building on QNX.]);; solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT";; esac # Set CFLAGS/CXXFLAGS. We MUST set the flags before we call autoconf # compiler configuration macros, because if we don't, they set CFLAGS # to no optimization and -g, which isn't what we want. if test "$pathan_cv_profile" = "yes"; then CFLAGS="$CFLAGS -pg -g" CXXFLAGS="$CXXFLAGS -pg -g" LIBS="$LIBS -pg -g" else if test "$pathan_cv_debug" = "yes"; then AC_DEFINE(DEBUG) AH_TEMPLATE(DEBUG, [Define to 1 if you want a debugging version.]) CFLAGS="$CFLAGS -g" CXXFLAGS="$CXXFLAGS -g" else CFLAGS=${CFLAGS-$optimize_def} CXXFLAGS=${CXXFLAGS-"$CFLAGS"} fi fi # build include dependencies or not build_cpp_dep='$(nocppdeps)' if test "$pathan_cv_depend" = yes; then build_cpp_dep='$(cppdeps)' fi dnl --- Check compilers --- AC_PROG_CXX AC_PROG_CC MAKEFILE_CXX_MM="${CXX} -MM" dnl --- Set up compiler flags --- # turn off Xerces-based warning for aCC # get correct flags for aCC for STL and PIC code if test "$GXX" != "yes" then case $host_os in hpux11.0*|hpux11*) CXXFLAGS="$CXXFLAGS -mt" case $CXX in aCC) CXXFLAGS="$CXXFLAGS -AA +W930 +Z" MAKEFILE_CXX_MM="${CXX} +Maked -E" LDFLAGS="$LDFLAGS -AA" ;; esac ;; aix*) case $CXX in xlC*) CXXFLAGS="$CXXFLAGS -qstaticinline" LDFLAGS="$LDFLAGS -bh:5" MAKEFILE_CXX_MM="${CXX} -E" ;; esac ;; esac else CXXFLAGS="$CXXFLAGS -Wall -ftemplate-depth-50 ${targetoptions}" CFLAGS="$CFLAGS -Wall ${targetoptions}" fi dnl --- ieeefp.h --- AC_CHECK_HEADERS(ieeefp.h) dnl --- Check utility programmes --- AC_PROG_INSTALL AC_PROG_YACC AC_PROG_LEX AC_CHECK_PROG(sed, sed, sed, false) if test "$sed" != "sed" then AC_MSG_WARN([sed not found. Manually edit Makefile.defs to add -lxercesxxx to LIBS]) fi AC_SUBST(sed) AC_CHECK_PROG(perl, perl, perl, error) if test "$perl" != "perl" then AC_MSG_ERROR([perl not found. Required to build Pathan.]) fi AC_SUBST(perl) dnl --- Check for unicode support in flex --- AC_MSG_CHECKING([unicode support in flex]) flex --help | grep "\-U" > /dev/null if test "$?" -eq "0" then AC_MSG_RESULT([found]) else AC_MSG_WARN([not found. Pathan requires a version of flex supporting the -U (16-bit unicode) flag if you need to rebuild the lexer or parser.]) fi dnl --- GNU libtool --- AC_PROG_LIBTOOL top_builddir=topsrcdir dnl --- Check for libpthread --- AC_CHECK_LIB(pthread,pthread_create) dnl --- Check for libsocket --- AC_CHECK_LIB(socket,connect) dnl --- Check for libnsl --- AC_CHECK_LIB(nsl,gethostbyname) dnl --- Checks for typedefs, structures, and compiler characteristics --- AC_C_CONST AC_C_BIGENDIAN dnl --- Set up libtool flags --- LIBTOOL="\$(srcdir)/libtool ${libtoolflags}" dnl --- Set up linking flags --- dnl --- might want to move this into DSLconfig script: depends if configure.in can give us useful info --- AC_OUTPUT(Makefile.defs)