## -*- autoconf -*- AC_DEFUN(ANALYSIS_LIB_TESTS, [ AC_LANG_C # dnl Checks for XML library # AC_CHECK_LIB(xml2,xmlParseFile, ,AC_MSG_ERROR([No XML library found])) # dnl Checks for lbet library # #AC_CHECK_LIB(lber,ber_init, ,AC_MSG_ERROR([No lber library found])) # dnl Checks for LDAP library # #AC_CHECK_LIB(ldap,ldap_open, ,AC_MSG_ERROR([No LDAP library found])) # dnl Checks for Ncurses library # AC_CHECK_LIB(ncurses,tgetstr, ,AC_MSG_ERROR([No ncurses library found])) # dnl Checks for readline library # AC_CHECK_LIB(readline, readline, , # AC_MSG_ERROR([GNU readline library not found])) AC_LANG_CPLUSPLUS # dnl Checks for MYSQL++ library # AC_CHECK_LIB(sqlplus,main, ,AC_MSG_ERROR([No MYSQL++ library found])) # dnl Checks for LDAP C++ library # AC_CHECK_LIB(ldapcpp,main, ,AC_MSG_ERROR([No LDAP C++ library found])) AC_LANG_C ]) AC_DEFUN(CHECK_COMPILER_FLAG, [ AC_REQUIRE([AC_CHECK_COMPILERS]) AC_MSG_CHECKING(whether $CXX supports -$1) cache=`echo $1 | sed 'y%.=/+-%___p_%'` AC_CACHE_VAL(cv_prog_cxx_$cache, [ echo 'void f(){}' >conftest.cc if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then eval "cv_prog_cxx_$cache=yes" else eval "cv_prog_cxx_$cache=no" fi rm -f conftest* ]) if eval "test \"`echo '$cv_prog_cxx_'$cache`\" = yes"; then AC_MSG_RESULT(yes) : $2 else AC_MSG_RESULT(no) : $3 fi ]) AC_DEFUN(AC_CHECK_COMPILERS, [ dnl this is somehow a fat lie, but prevents other macros from double checking AC_PROVIDE([AC_PROG_CC]) AC_PROVIDE([AC_PROG_CPP]) AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]], [ if test $enableval = "no"; dnl then use_debug_code="no" else use_debug_code="yes" fi ], [use_debug_code="no"]) AC_ARG_ENABLE(debugflag,[ --enable-debug-flag includes extra debugging output code [default=no]], [ if test $enableval = "no"; then use_debug_define="no" else use_debug_define="yes" fi ], [use_debug_define="no"]) AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)], [ if test $enableval = "yes"; then use_strict_options="yes" else use_strict_options="no" fi ], [use_strict_options="no"]) dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it AC_MSG_CHECKING(for a C-Compiler) dnl if there is one, print out. if not, don't matter AC_MSG_RESULT($CC) if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) AC_PROG_CC_WORKS AC_PROG_CC_GNU if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi if test -z "$CFLAGS"; then if test "$use_debug_code" = "yes"; then AC_PROG_CC_G if test $ac_cv_prog_cc_g = yes; then CFLAGS="-g" fi else if test "$GCC" = "yes"; then CFLAGS="-O2" else CFLAGS="" fi fi if test "$use_debug_define" = "yes"; then CFLAGS="$CFLAGS -DDEBUG" fi if test "$GCC" = "yes"; then CFLAGS="$CFLAGS" if test "$use_strict_options" = "yes"; then CFLAGS="$CFLAGS -W -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings" fi fi fi case "$host" in *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";; esac if test -z "$LDFLAGS" && test "$use_debug_code" = "no" && test "$GCC" = "yes"; then LDFLAGS="-s" fi dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?) AC_MSG_CHECKING(how to run the C preprocessor) # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then AC_CACHE_VAL(ac_cv_prog_CPP, [ # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. dnl Use a header file that comes with gcc, so configuring glibc dnl with a fresh cross-compiler works. AC_TRY_CPP([#include Syntax Error], , CPP="${CC-cc} -E -traditional-cpp" AC_TRY_CPP([#include Syntax Error], , CPP=/lib/cpp)) ac_cv_prog_CPP="$CPP"])dnl CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi AC_MSG_RESULT($CPP) AC_SUBST(CPP)dnl AC_MSG_CHECKING(for a C++-Compiler) dnl if there is one, print out. if not, don't matter AC_MSG_RESULT($CXX) if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH]) AC_PROG_CXX_WORKS AC_PROG_CXX_GNU if test $ac_cv_prog_gxx = yes; then GXX=yes fi if test -z "$CXXFLAGS"; then if test "$use_debug_code" = "yes"; then AC_PROG_CXX_G if test $ac_cv_prog_cxx_g = yes; then CXXFLAGS="-g" fi else if test "$GXX" = "yes"; then CXXFLAGS="-O2" fi fi if test "$use_debug_define" = "yes"; then CXXFLAGS="$CXXFLAGS -DDEBUG" fi # CHECK_COMPILER_FLAG(fno-exceptions, # [ # CXXFLAGS="$CXXFLAGS -fno-exceptions" # ]) # # CHECK_COMPILER_FLAG(fno-rtti, # [ # CXXFLAGS="$CXXFLAGS -fno-rtti" # ]) CHECK_COMPILER_FLAG(fno-check-new, [ CXXFLAGS="$CXXFLAGS -fno-check-new" ]) if test "$GXX" = "yes"; then CXXFLAGS="$CXXFLAGS" if test "$use_strict_options" = "yes"; then CXXFLAGS="$CXXFLAGS -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings" CHECK_COMPILER_FLAG(Wno-long-long, [ CXXFLAGS="$CXXFLAGS -Wno-long-long" ]) CHECK_COMPILER_FLAG(fno-builtin, [ CXXFLAGS="$CXXFLAGS -fno-builtin" ]) fi if test "$use_strict_options" = "yes"; then CXXFLAGS="$CXXFLAGS -Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align -Woverloaded-virtual" fi if test "$user_very_strict" = "yes"; then CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wredundant-decls -Wconversion" fi fi fi CHECK_COMPILER_FLAG(fexceptions, [ USE_EXCEPTIONS="-fexceptions" ], USE_EXCEPTIONS= ) AC_SUBST(USE_EXCEPTIONS) CHECK_COMPILER_FLAG(frtti, [ USE_RTTI="-frtti" ], USE_RTTI= ) AC_SUBST(USE_RTTI) case "$host" in *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";; esac AC_PROVIDE(AC_PROG_CXXCPP) AC_MSG_CHECKING(how to run the C++ preprocessor) if test -z "$CXXCPP"; then AC_CACHE_VAL(ac_cv_prog_CXXCPP, [ AC_LANG_SAVE[]dnl AC_LANG_CPLUSPLUS[]dnl CXXCPP="${CXX-g++} -E" AC_TRY_CPP([#include ], , CXXCPP=/lib/cpp) ac_cv_prog_CXXCPP="$CXXCPP" AC_LANG_RESTORE[]dnl ])dnl CXXCPP="$ac_cv_prog_CXXCPP" fi AC_MSG_RESULT($CXXCPP) AC_SUBST(CXXCPP)dnl # the following is to allow programs, that are known to # have problems when compiled with -O2 if test -n "$CXXFLAGS"; then safe_IFS=$IFS IFS=" " NOOPT_CXXFLAGS="" for i in $CXXFLAGS; do if test ! "$i" = "-O2"; then NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i" fi done IFS=$safe_IFS fi AC_SUBST(NOOPT_CXXFLAGS) ])