--- configure.in.orig 2005-08-12 18:29:18 +0400 +++ configure.in 2005-08-12 19:09:30 +0400 @@ -7,6 +7,13 @@ # definition in "src/win32/WIN32-Includes/config.h" AM_INIT_AUTOMAKE(snort,2.4.0) +# Evseev/EBCEEB: this is very quick&dirty(tm) workaround trick&hack(tm). +# I don't understand why this is needed at all +# because libprelude.m4 is already included at bottom of aclocal.m4, +# but 'autoreconf -fisv' fails without this. +# Well, I'm not Autoconf guru, sorry... +m4_include([m4/libprelude.m4]) + # Since we get -O2 from configure defaults, which doesn't work in 64bit # mode, let's make some changes here before calling _CC macros. AC_ARG_ENABLE(64bit-gcc, @@ -129,6 +136,31 @@ extra_incl=-I/sw/include esac +case $host in +*-*-linux*) + # Test if the compiler is 64bit + echo 'int i;' > conftest.$ac_ext + snort_cv_cc_64bit_output=no + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *"ELF 64"*) + snort_cv_cc_64bit_output=yes + ;; + esac + fi + rm -rf conftest* + ;; +esac + +case $host_cpu:$snort_cv_cc_64bit_output in +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) + snort_libname="lib64" + ;; +*:*) + snort_libname="lib" + ;; +esac + # any sparc platform has to have this one defined. AC_MSG_CHECKING(for sparc alignment) if eval "echo $host_cpu|grep -i sparc >/dev/null"; then @@ -409,7 +441,7 @@ fi else - for i in lib lib/mysql; do + for i in $snort_libname $snort_libname/mysql; do str="$MYSQL_DIR/$i/libmysqlclient.*" for j in `echo $str`; do if test -r $j; then @@ -422,7 +454,7 @@ if test -z "$MYSQL_LIB_DIR"; then if test "$mysql_fail" != "no"; then FAIL_MESSAGE("mysqlclient library", - "$MYSQL_DIR/lib $MYSQL_DIR/lib/mysql") + "$MYSQL_DIR/$snort_libname $MYSQL_DIR/$snort_libname/mysql") else AC_MSG_RESULT(no) fi @@ -476,19 +508,19 @@ fi else - str="$ODBC_DIR/lib/libodbc.*" + str="$ODBC_DIR/$snort_libname/libodbc.*" for j in `echo $str`; do if test -r $j; then - ODBC_LIB_DIR="$ODBC_DIR/lib" + ODBC_LIB_DIR="$ODBC_DIR/$snort_libname" ODBC_LIB="odbc" fi done dnl if test -z "$ODBC_LIB_DIR"; then -dnl str="$ODBC_DIR/lib/libiodbc.*" +dnl str="$ODBC_DIR/$snort_libname/libiodbc.*" dnl for j in `echo $str`; do dnl if test -r $j; then -dnl ODBC_LIB_DIR="$ODBC_DIR/lib" +dnl ODBC_LIB_DIR="$ODBC_DIR/$snort_libname" dnl ODBC_LIB="iodbc" dnl fi dnl done @@ -496,7 +528,7 @@ if test -z "$ODBC_LIB_DIR"; then if test "$odbc_fail" != "no"; then - FAIL_MESSAGE("odbc library (libodbc)", "$ODBC_DIR/lib") + FAIL_MESSAGE("odbc library (libodbc)", "$ODBC_DIR/$snort_libname") else AC_MSG_RESULT(no) fi @@ -579,7 +611,7 @@ if test -z "$POSTGRESQL_DIR"; then for dir in $postgresql_directory; do - for i in lib lib/pgsql; do + for i in $snort_libname $snort_libname/pgsql; do str="$dir/$i/libpq.*" for j in `echo $str`; do if test -r $j; then @@ -596,7 +628,7 @@ if test -z "$POSTGRESQL_LIB_DIR"; then if test "$postgresql_fail" != "no"; then FAIL_MESSAGE("postgresql library libpq", - "$POSTGRESQL_DIR/lib $POSTGRESQL_DIR/lib/pgsql") + "$POSTGRESQL_DIR/$snort_libname $POSTGRESQL_DIR/$snort_libname/pgsql") else AC_MSG_RESULT(no); fi @@ -648,7 +680,7 @@ for i in rdbms/demo rdbms/public network/public; do ORACLE_CPP_FLAGS="$ORACLE_CPP_FLAGS -I$ORACLE_DIR/$i" done - ORACLE_LIB_DIR="$ORACLE_DIR/lib" + ORACLE_LIB_DIR="$ORACLE_DIR/$snort_libname" AC_MSG_RESULT(yes) LDFLAGS="${LDFLAGS} -L${ORACLE_LIB_DIR}" @@ -1039,7 +1071,7 @@ if test "$enable_flexresp" != "no" -a "$enable_flexresp" = "yes"; then if test `libnet-config --cflags | wc -c` = "1"; then - CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/sw/include" + CPPFLAGS="${CPPFLAGS}" LIBNET_CONFIG_BROKEN_CFLAGS=yes fi @@ -1047,7 +1079,7 @@ AC_MSG_WARN(libnet-config --libs is broken on your system. If you) AC_MSG_WARN(are using a precompiled package please notify the) AC_MSG_WARN(maintainer.) - LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/sw/lib" + LDFLAGS="${LDFLAGS}" LIBS="${LIBS} -lnet" fi