From 023a01615485614826ee7a82c5d923e26bdc6f6b Mon Sep 17 00:00:00 2001 From: Jorrit Fahlke <joe@dune-project.org> Date: Mon, 21 Sep 2009 18:37:42 +0000 Subject: [PATCH] LDFLAGS -> LIBS transition for the m4 files [[Imported from SVN: r5583]] --- m4/dune.m4 | 6 ++---- m4/dune_mpi.m4 | 6 +++--- m4/f5.m4 | 4 ++-- m4/grape.m4 | 6 +++--- m4/hdf5.m4 | 4 ++-- m4/immdx_lib_metis.m4 | 8 +++++--- m4/mpi-config.m4 | 28 ++++++++++++++-------------- m4/pardiso.m4 | 1 + m4/parmetis.m4 | 8 ++++++-- m4/superlu-dist.m4 | 9 +++++---- 10 files changed, 43 insertions(+), 37 deletions(-) diff --git a/m4/dune.m4 b/m4/dune.m4 index a54f4cb33..56fbc611c 100644 --- a/m4/dune.m4 +++ b/m4/dune.m4 @@ -110,8 +110,7 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ _DUNE_MODULE[]_ROOT="`$PKG_CONFIG --variable=prefix _dune_name`" 2>/dev/null _DUNE_MODULE[]_VERSION="`$PKG_CONFIG --modversion _dune_name`" 2>/dev/null ifelse(_dune_symbol,,,[ - _DUNE_MODULE[]_LDFLAGS="-L`$PKG_CONFIG --variable=libdir _dune_name`" 2>/dev/null - _DUNE_MODULE[]_LIBS="-l[]_dune_lib" + _DUNE_MODULE[]_LIBS="-L`$PKG_CONFIG --libs _dune_name`" 2>/dev/null ]) HAVE_[]_DUNE_MODULE=1 AC_MSG_RESULT([ @@ -138,8 +137,7 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ _DUNE_MODULE[]_VERSION="`grep Version $_DUNE_MODULE[]_ROOT/dune.module | sed -e 's/^Version: *//'`" 2>/dev/null fi ifelse(_dune_symbol,,,[ - _DUNE_MODULE[]_LDFLAGS="-L$_DUNE_MODULE[]_ROOT/lib" - _DUNE_MODULE[]_LIBS="-l[]_dune_lib" + _DUNE_MODULE[]_LIBS="-L$_DUNE_MODULE[]_ROOT/lib -l[]_dune_lib" ]) # set expanded module path with_[]_dune_module="$_DUNE_MODULE[]_ROOT" diff --git a/m4/dune_mpi.m4 b/m4/dune_mpi.m4 index bdd0fd7f4..e99f0e16a 100644 --- a/m4/dune_mpi.m4 +++ b/m4/dune_mpi.m4 @@ -109,9 +109,7 @@ AC_DEFUN([DUNE_MPI],[ ac_save_LIBS="$LIBS" ac_save_CPPFLAGS="$CPPFLAGS" - # looks weird but as the -l... are contained in the MPI_LDFLAGS these - # parameters have to be last on the commandline: with LIBS this is true - LIBS="$MPI_LDFLAGS" + LIBS="$MPI_LIBS" CPPFLAGS="$CPPFLAGS $MPI_CPPFLAGS" # try to create MPI program @@ -169,6 +167,7 @@ AC_DEFUN([DUNE_MPI],[ if test x"$with_mpi" != xno ; then AC_SUBST(MPI_CPPFLAGS, $MPI_CPPFLAGS) AC_SUBST(MPI_LDFLAGS, $MPI_LDFLAGS) + AC_SUBST(MPI_LIBS, $MPI_LIBS) AC_SUBST(MPI_VERSION, $MPI_VERSION) AC_DEFINE(HAVE_MPI,ENABLE_MPI,[Define if you have the MPI library. This is only true if MPI was found by configure @@ -176,6 +175,7 @@ AC_DEFUN([DUNE_MPI],[ else AC_SUBST(MPI_CPPFLAGS, "") AC_SUBST(MPI_LDFLAGS, "") + AC_SUBST(MPI_LIBS, "") fi AM_CONDITIONAL(MPI, test x"$with_mpi" != xno) diff --git a/m4/f5.m4 b/m4/f5.m4 index 80ca92d5d..f63f1e7a7 100644 --- a/m4/f5.m4 +++ b/m4/f5.m4 @@ -32,8 +32,8 @@ AC_DEFUN([DUNE_PATH_F5],[ AC_MSG_CHECKING([for make/arch]) if test -x $F5ARCH ; then AC_MSG_RESULT([yes]) - LDFLAGS="$HDF5_LDFLAGS -L$with_f5/lib/`$F5ARCH`" - F5_LDFLAGS="$LDFLAGS" + LIBS="$HDF5_LIBS -L$with_f5/lib/`$F5ARCH`" + F5_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS -I$with_f5" else AC_MSG_RESULT([no]) diff --git a/m4/grape.m4 b/m4/grape.m4 index 3ab38651e..aa431070a 100644 --- a/m4/grape.m4 +++ b/m4/grape.m4 @@ -36,7 +36,7 @@ if test "x$X_LIBS" != x && test x$with_grape != xno ; then fi CPPFLAGS="$CPPFLAGS -I$GRAPEROOT" - LDFLAGS="$LDFLAGS -L$GRAPEROOT" + LIBS="$LIBS -L$GRAPEROOT" # check for header # we have to use CC for checking the header!! @@ -61,9 +61,9 @@ if test "x$X_LIBS" != x && test x$with_grape != xno ; then fi AC_CHECK_LIB(gr, grape, - [GRAPE_LDFLAGS="-L$GRAPEROOT $GL_LDFLAGS $GRAPE_LINKER_FLAGS" + [GRAPE_LDFLAGS="$GL_LDFLAGS $GRAPE_LINKER_FLAGS" GRAPE_CPPFLAGS="$CPPFLAGS" - GRAPE_LIBS="-lgr $GL_LIBS -lXext"], + GRAPE_LIBS="-L$GRAPEROOT -lgr $GL_LIBS -lXext"], [HAVE_GRAPE="0"]) fi diff --git a/m4/hdf5.m4 b/m4/hdf5.m4 index caacb860a..a61a8436a 100644 --- a/m4/hdf5.m4 +++ b/m4/hdf5.m4 @@ -32,8 +32,8 @@ AC_DEFUN([DUNE_PATH_HDF5],[ else AC_MSG_ERROR([HDF5-directory $with_hdf5 does not exist]) fi - LDFLAGS="$LDFLAGS -L$with_hdf5/lib" - HDF5_LDFLAGS="$LDFLAGS" + LIBS="$LIBS -L$with_hdf5/lib" + HDF5_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS -I$with_hdf5/include" fi diff --git a/m4/immdx_lib_metis.m4 b/m4/immdx_lib_metis.m4 index c55a685b5..cacf6ec9f 100644 --- a/m4/immdx_lib_metis.m4 +++ b/m4/immdx_lib_metis.m4 @@ -66,6 +66,7 @@ AC_DEFUN([IMMDX_LIB_METIS], [ if test -n "$with_metis" ; then old_CFLAGS=$CFLAGS old_LDFLAGS=$LDFLAGS + old_LIBS=$LIBS if test -f "$with_metis/include/metis.h"; then lib_path="/lib" @@ -78,7 +79,7 @@ AC_DEFUN([IMMDX_LIB_METIS], [ include_path="/Lib" fi CFLAGS="-I$with_metis/$include_path" - LDFLAGS="-L$with_metis/$lib_path" + LIBS="-L$with_metis/$lib_path" AC_LANG_SAVE AC_LANG_C @@ -95,12 +96,13 @@ AC_DEFUN([IMMDX_LIB_METIS], [ CFLAGS=$old_CFLAGS LDFLAGS=$old_LDFLAGS + LIBS=$old_LIBS AC_MSG_CHECKING(METIS in $with_metis) if test "$metis_lib" = "yes" -a "$metis_h" = "yes" ; then AC_SUBST(METIS_INCLUDE, [-I$with_metis$include_path]) - AC_SUBST(METIS_LDFLAGS, [-L$with_metis$lib_path]) - AC_SUBST(METIS_LIB, [-lmetis]) + AC_SUBST(METIS_LDFLAGS, []) + AC_SUBST(METIS_LIB, [-L$with_metis$lib_path -lmetis]) AC_MSG_RESULT(ok) else AC_MSG_RESULT(failed) diff --git a/m4/mpi-config.m4 b/m4/mpi-config.m4 index 2eb171237..9c1cb247c 100644 --- a/m4/mpi-config.m4 +++ b/m4/mpi-config.m4 @@ -54,14 +54,14 @@ _EOF MPI_VERSION="LAM >= 7.1" MPI_CPPFLAGS="$retval" mpi_getflags "-showme:link" - MPI_LDFLAGS="$retval" + MPI_LIBS="$retval" else MPI_VERSION="LAM < 7.1" # use -showme and dummy parameters to extract flags mpi_getflags "-showme" "-c $MPISOURCE" MPI_CPPFLAGS="$retval" mpi_getflags "-showme" "dummy.o -o dummy" - MPI_LDFLAGS="$retval" + MPI_LIBS="$retval" fi # hack in option to disable LAM-C++-bindings... # we fake to have mpicxx.h read already @@ -86,13 +86,13 @@ mpi_getmpichflags() { # get linker options mpi_getflags "-link_info" - MPI_LDFLAGS="$retval" + MPI_LIBS="$retval" # strip -o option - mpi_remove "$MPI_LDFLAGS" "-o" - MPI_LDFLAGS="$retval" + mpi_remove "$MPI_LIBS" "-o" + MPI_LIBS="$retval" #strip MPI_CPPFLAGS (which are included for mpich2 on jugene) enc=`echo "$MPI_CPPFLAGS" | sed -e 's/\\//\\\\\\//g'` - MPI_LDFLAGS=`echo "$retval" | sed -e "s/$enc / /"` + MPI_LIBS=`echo "$MPI_LIBS" | sed -e "s/$enc / /"` # hack in option to disable MPICH-C++-bindings... @@ -109,13 +109,13 @@ mpi_getmpich2flags() { # get linker options mpi_getflags "-show" "-o" - MPI_LDFLAGS="$retval" + MPI_LIBS="$retval" # strip -o option - mpi_remove "$MPI_LDFLAGS" "-o" - MPI_LDFLAGS="$retval" + mpi_remove "$MPI_LIBS" "-o" + MPI_LIBS="$retval" #strip MPI_CPPFLAGS (which are included for mpich2 on jugene) enc=`echo "$MPI_CPPFLAGS" | sed -e 's/\\//\\\\\\//g'` - MPI_LDFLAGS=`echo "$retval" | sed -e "s/$enc / /"` + MPI_LIBS=`echo "$retval" | sed -e "s/$enc / /"` # hack in option to disable MPICH-C++-bindings... @@ -181,7 +181,7 @@ _EOF mpi_getflags "-showme:compile" MPI_CPPFLAGS="$retval" mpi_getflags "-showme:link" - MPI_LDFLAGS="$retval" + MPI_LIBS="$retval" MPI_NOCXXFLAGS="-DMPIPP_H" AC_MSG_RESULT([yes]) @@ -204,7 +204,7 @@ test_mvapich() { mpi_getflags "-compile_info $ADDFLAGS" "dummy.o -o dummy" MPI_CPPFLAGS="$retval" mpi_getflags "-link_info $ADDFLAGS" "dummy.o -o dummy" - MPI_LDFLAGS="$retval" + MPI_LIBS="$retval" AC_MSG_RESULT([yes]) rm -f conftest* return 0 @@ -244,7 +244,7 @@ test_ibmmpi() { # retval=`echo $retval | sed -e 's/\(-b[[^ ]]*\)/-Xlinker \1/g'` # fi - MPI_LDFLAGS="$retval" + MPI_LIBS="$retval" AC_MSG_RESULT([yes]) rm -f conftest* @@ -264,7 +264,7 @@ test_intelmpi() { MPI_VERSION="Intel MPI" mpi_getflags "-show" MPI_CPPFLAGS="$retval" - MPI_LDFLAGS="$retval" + MPI_LIBS="$retval" AC_MSG_RESULT([yes]) rm -f conftest* return 0 diff --git a/m4/pardiso.m4 b/m4/pardiso.m4 index a0f6a0147..c784c14fe 100644 --- a/m4/pardiso.m4 +++ b/m4/pardiso.m4 @@ -1,5 +1,6 @@ AC_DEFUN([DUNE_PARDISO], [ AC_PREREQ(2.50) +dnl this will set the variable FLIBS (*not* ..._LDFLAGS) AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) AC_REQUIRE([ACX_LAPACK]) acx_pardiso_ok=no diff --git a/m4/parmetis.m4 b/m4/parmetis.m4 index 088e2456b..063e2e49b 100644 --- a/m4/parmetis.m4 +++ b/m4/parmetis.m4 @@ -55,13 +55,14 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[ ac_save_LIBS="$LIBS" ## do nothing if --without-parmetis is used - if test x"$MPI_LDFLAGS" != x"" && test x"$with_parmetis" != x"no" ; then + if test x"$MPI_LIBS" != x"" && test x"$with_parmetis" != x"no" ; then # defaultpath PARMETIS_LIB_PATH="$with_parmetis$lib_path" PARMETIS_INCLUDE_PATH="$with_parmetis$lib_path" - PARMETIS_LIBS="-L$PARMETIS_LIB_PATH $MPI_LDFLAGS $MPI_LIBS" + PARMETIS_LIBS="-L$PARMETIS_LIB_PATH $MPI_LIBS" + PARMETIS_LDFLAGS="$MPI_LDFLAGS" # set variables so that tests can use them CPPFLAGS="$CPPFLAGS -I$PARMETIS_INCLUDE_PATH $MPI_CPPFLAGS" @@ -81,6 +82,7 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[ # if header is found check for the libs LIBS="$LIBS $PARMETIS_LIBS -lm" + LDFLAGS="$LDFLAGS $PARMETIS_LDFLAGS" if test x$HAVE_PARMETIS = x1 ; then AC_CHECK_LIB(metis, [metis_partgraphkway],[ @@ -106,6 +108,7 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[ # did it work? AC_MSG_CHECKING(ParMETIS in $with_parmetis) if test x$HAVE_PARMETIS = x1 ; then + AC_SUBST(PARMETIS_LDFLAGS, $PARMETIS_LDFLAGS) AC_SUBST(PARMETIS_LIBS, $PARMETIS_LIBS) AC_SUBST(PARMETIS_CPPFLAGS, $PARMETIS_CPPFLAGS) AC_DEFINE(HAVE_PARMETIS,ENABLE_PARMETIS,[Define if you have the Parmetis library. @@ -114,6 +117,7 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[ AC_MSG_RESULT(ok) # add to global list + DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $PARMETIS_LDFLAGS" DUNE_PKG_LIBS="$DUNE_PKG_LIBS $PARMETIS_LIBS" DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $PARMETIS_CPPFLAGS" diff --git a/m4/superlu-dist.m4 b/m4/superlu-dist.m4 index 1facc650e..fba4d0c79 100644 --- a/m4/superlu-dist.m4 +++ b/m4/superlu-dist.m4 @@ -95,7 +95,8 @@ AC_DEFUN([DUNE_PATH_SUPERLU_DIST],[ SUPERLU_DIST_LIB_PATH="$with_superlu_dist/$my_lib_path" SUPERLU_DIST_INCLUDE_PATH="$with_superlu_dist/$my_include_path" - SUPERLU_DIST_LDFLAGS="-L$SUPERLU_DIST_LIB_PATH $MPI_LDFLAGS" + SUPERLU_DIST_LDFLAGS="$MPI_LDFLAGS" + SUPERLU_DIST_LIBS="-L$SUPERLU_DIST_LIB_PATH $MPI_LIBS" # set variables so that tests can use them CPPFLAGS="$CPPFLAGS -I$SUPERLU_DIST_INCLUDE_PATH $MPI_CPPFLAGS" @@ -116,12 +117,12 @@ AC_DEFUN([DUNE_PATH_SUPERLU_DIST],[ # set variables so that tests can use them OLDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$SUPERLU_DIST_LIB_PATH $MPI_LDFLAGS" - LIBS="$BLAS_LIBS $LIBS $FLIBS $MPILIBS $MPI_LDFLAGS" + LDFLAGS="$LDFLAGS $MPI_LDFLAGS" + LIBS="$BLAS_LIBS $LIBS $FLIBS $MPILIBS -L$SUPERLU_DIST_LIB_PATH" AC_CHECK_LIB(superlu-mpi, [pdgssvx], [dnl - SUPERLU_DIST_LIBS="-lsuperlu-mpi $LIBS" + SUPERLU_DIST_LIBS="$LIBS -lsuperlu-mpi" SUPERLU_DIST_LDFLAGS="$LDFLAGS" HAVE_SUPERLU_DIST="1" AC_MSG_RESULT(yes) -- GitLab