--- rpl/Attic/configure.in 2011/07/22 07:38:00 1.70 +++ rpl/Attic/configure.in 2011/07/25 07:44:51 1.73 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([rpl],[4.1.1]) +AC_INIT([rpl],[4.1.2]) AC_CANONICAL_TARGET AC_CANONICAL_TARGET AM_INIT_AUTOMAKE @@ -15,7 +15,7 @@ GPP=gpp-2.24 GNUPLOT=gnuplot-4.4.3 FILE=file-5.03 ICONV=libiconv-1.13.1 -SQLITE=sqlite-3.7.6.3 +SQLITE=sqlite-3.7.7.1 OPENSSL=openssl-1.0.0d GMP=gmp-5.0.1 @@ -60,10 +60,30 @@ fi dnl Checks for C++ compiler AC_PROG_CXX(g++) -if test "$GXX" != yes; then +if test "$CXX" != "g++"; then AC_MSG_ERROR([Cannot find g++! You have to install it.]) fi +if test x"$CXX" != x""; then + GCC_VERSION_MAJEURE=`$CXX -v 2>&1 | awk '/^gcc/ { print $3; }' | \ + awk -F. '{ printf("%s", $1);}'` + GCC_VERSION_MINEURE=`$CXX -v 2>&1 | awk '/^gcc/ { print $3; }' | \ + awk -F. '{ printf("%s", $2);}'` + if test $GCC_VERSION_MAJEURE -ge 5; then + OPTIMISATION_GXX=-O3 + else + if test $GCC_VERSION_MAJEURE -ge 4 -a $GCC_VERSION_MINEURE -ge 4; then + OPTIMISATION_GXX=-O3 + else + if test $GCC_VERSION_MAJEURE -ge 3; then + OPTIMISATION_GXX=-O2 + else + AC_MSG_ERROR([Cannot find decent or recent g++ (g++-4.3 or better)!]) + fi + fi + fi +fi + dnl Checks for Fortran 77 compiler AC_PROG_F77(gfortran) @@ -115,27 +135,31 @@ if test "$ac_x_libraries" != "no"; then fi dnl 32 bits ABI -AC_ARG_WITH(32bits, +AC_ARG_WITH(32bits-abi, [ --with-32bits-abi force 32bits ABI (multilib)],[ if test "$with-32bits-abi" = "no"; then ABI= else ABI=-m32 fi],[ - ABI=-m32 + ABI= ] ) -AC_ARG_WITH(64bits, +if test x$ABI = x; then +AC_ARG_WITH(64bits-abi, [ --with-64bits-abi force 64bits ABI (multilib)],[ if test "$with-64bits-abi" = "no"; then ABI= else ABI=-m64 fi],[ - ABI=-m64 + ABI= ] ) +fi + +LDFLAGS="$LDFLAGS $ABI" dnl RPL/CAS support AC_ARG_WITH(rplcas, @@ -160,18 +184,20 @@ dnl Options AC_ARG_ENABLE(optimization, [ --enable-optimization set compiler flags [[default=environment variables -O3]]], [ if test "$enableval" = "no"; then - CFLAGS= - FFLAGS= - CXXFLAGS= - FCFLAGS= -else - CFLAGS="$CFLAGS $enable_optimization" - FFLAGS="$FFLAGS $enable_optimization" - FCFLAGS="$FCFLAGS $enable_optimization" + CFLAGS=$ABI + FFLAGS=$ABI + CXXFLAGS=$ABI + FCFLAGS=$ABI +else + CFLAGS="$CFLAGS $ABI $enable_optimization" + FFLAGS="$FFLAGS $ABI $enable_optimization" + CXXFLAGS="$CXXFLAGS $ABI $enable_optimization" + FCFLAGS="$FCFLAGS $ABI $enable_optimization" fi],[ - CFLAGS="$CFLAGS $OPTIMISATION_C" - FFLAGS="$FFLAGS $OPTIMISATION_F" - FCFLAGS="$FCFLAGS $OPTIMISATION_F" + CFLAGS="$CFLAGS $ABI $OPTIMISATION_C" + FFLAGS="$FFLAGS $ABI $OPTIMISATION_F" + CXXFLAGS="$CXXFLAGS $ABI $OPTIMISATION_CXX" + FCFLAGS="$FCFLAGS $ABI $OPTIMISATION_F" ] ) @@ -951,15 +977,6 @@ else fi fi -AC_CONFIG_SUBDIRS(tools/$NCURSES) -AC_CONFIG_SUBDIRS(tools/$READLINE) -AC_CONFIG_SUBDIRS(tools/$GSL) -AC_CONFIG_SUBDIRS(tools/$GPP) -AC_CONFIG_SUBDIRS(tools/$FILE) -AC_CONFIG_SUBDIRS(tools/$ICONV) -AC_CONFIG_SUBDIRS(tools/$SQLITE) -AC_CONFIG_SUBDIRS(tools/$UNITS) - if test "$MYGNUPLOT" = "yes"; then if test ! -d "$srcdir"/tools/$GNUPLOT; then gunzip -c "$srcdir"/tools/$GNUPLOT.tar.gz | \ @@ -973,6 +990,9 @@ fi AC_SUBST(GNUPLOT_COMPILATION) +HOST=$host +AC_SUBST(HOST) + case $host_cpu in i?86) @@ -1036,7 +1056,10 @@ case $OS in IPCS_SYSV=-UIPCS_SYSV CXXFLAGS="$CXXFLAGS -D_GLIBCXX_FULLY_DYNAMIC_STRING" ac_configure_args="$ac_configure_args --with-readline=builtin \ - --disable-shared --enable-static --enable-threads" + --disable-shared --enable-static --enable-threads \ + CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" \ + FFLAGS=\"$FFLAGS\" FCFLAGS=\"$FCFLAGS\" \ + LDFLAGS=\"$LDFLAGS\"" C_STANDARD=-std=gnu99 break ;; @@ -1046,7 +1069,10 @@ case $OS in SEMAPHORES_NOMMES=-USEMAPHORES_NOMMES IPCS_SYSV=-UIPCS_SYSV ac_configure_args="$ac_configure_args --with-readline=builtin \ - --disable-shared --enable-static --enable-threads" + --disable-shared --enable-static --enable-threads \ + CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" \ + FFLAGS=\"$FFLAGS\" FCFLAGS=\"$FCFLAGS\" \ + LDFLAGS=\"$LDFLAGS\"" C_STANDARD=-std=gnu99 break ;; @@ -1056,7 +1082,10 @@ case $OS in SEMAPHORES_NOMMES=-USEMAPHORES_NOMMES IPCS_SYSV=-UIPCS_SYSV ac_configure_args="$ac_configure_args --with-readline=builtin \ - --disable-shared --enable-static --enable-threads" + --disable-shared --enable-static --enable-threads \ + CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" \ + FFLAGS=\"$FFLAGS\" FCFLAGS=\"$FCFLAGS\" \ + LDFLAGS=\"$LDFLAGS\"" C_STANDARD=-std=gnu99 break;; @@ -1066,7 +1095,10 @@ case $OS in SEMAPHORES_NOMMES=-DSEMAPHORES_NOMMES IPCS_SYSV=-UIPCS_SYSV ac_configure_args="$ac_configure_args --with-readline=builtin \ - --disable-shared --enable-static --enable-threads" + --disable-shared --enable-static --enable-threads \ + CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" \ + FFLAGS=\"$FFLAGS\" FCFLAGS=\"$FCFLAGS\" \ + LDFLAGS=\"$LDFLAGS\"" C_STANDARD=-std=gnu99 break ;; @@ -1081,7 +1113,10 @@ case $OS in IPCS_SYSV=-DIPCS_SYSV ac_configure_args="$ac_configure_args --without-readline \ --without-cairo --disable-shared --enable-static \ - --enable-threads" + --enable-threads \ + CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" \ + FFLAGS=\"$FFLAGS\" FCFLAGS=\"$FCFLAGS\" \ + LDFLAGS=\"$LDFLAGS\"" C_STANDARD= break;; @@ -1094,7 +1129,10 @@ case $OS in SEMAPHORES_NOMMES=-USEMAPHORES_NOMMES IPCS_SYSV=-DIPCS_SYSV ac_configure_args="$ac_configure_args --with-readline=builtin \ - --disable-shared --enable-static --enable-threads" + --disable-shared --enable-static --enable-threads \ + CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" \ + FFLAGS=\"$FFLAGS\" FCFLAGS=\"$FCFLAGS\" \ + LDFLAGS=\"$LDFLAGS\"" C_STANDARD=-std=gnu99 break;; @@ -1110,7 +1148,10 @@ case $OS in fi ac_configure_args="$ac_configure_args --with-readline=builtin \ - --disable-shared --enable-static --enable-threads" + --disable-shared --enable-static --enable-threads \ + CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" \ + FFLAGS=\"$FFLAGS\" FCFLAGS=\"$FCFLAGS\" \ + LDFLAGS=\"$LDFLAGS\"" C_STANDARD=-std=gnu99 MALLOC=-lumem break ;; @@ -1127,7 +1168,10 @@ case $OS in fi ac_configure_args="$ac_configure_args --with-readline=builtin \ - --disable-shared --enable-static --enable-threads" + --disable-shared --enable-static --enable-threads \ + CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" \ + FFLAGS=\"$FFLAGS\" FCFLAGS=\"$FCFLAGS\" \ + LDFLAGS=\"$LDFLAGS\"" C_STANDARD=-std=gnu99 break ;; @@ -1169,6 +1213,16 @@ AC_SUBST(CFLAGS) AC_SUBST(CXXFLAGS) AC_SUBST(FFLAGS) AC_SUBST(FCFLAGS) +AC_SUBST(LDFLAGS) + +AC_CONFIG_SUBDIRS(tools/$NCURSES) +AC_CONFIG_SUBDIRS(tools/$READLINE) +AC_CONFIG_SUBDIRS(tools/$GSL) +AC_CONFIG_SUBDIRS(tools/$GPP) +AC_CONFIG_SUBDIRS(tools/$FILE) +AC_CONFIG_SUBDIRS(tools/$ICONV) +AC_CONFIG_SUBDIRS(tools/$SQLITE) +AC_CONFIG_SUBDIRS(tools/$UNITS) AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(COPYING)