Skip to content
Snippets Groups Projects
Commit b08cbb32 authored by Jorrit Fahlke's avatar Jorrit Fahlke
Browse files

Rewrite the DUNE_CHECK_LIB_EXT macro:

 * Essentially copy and adapt the definition of AC_CHECK_LIB.  This should
   make sure the two macros behave the same even in corner cases (except for
   the added functionality, of course).

 * Properly document what exactly is allowed in the arguments.

Parse arguments to DUNE_CHECK_LIBS_EXT properly in parmetis.  This avoids
expansions like 'LDFLAGS="$LDFLAGS -L"$PARMETISLIBPATH""'.

[[Imported from SVN: r5830]]
parent 1e93ee44
No related branches found
No related tags found
No related merge requests found
...@@ -194,10 +194,10 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -194,10 +194,10 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
_DUNE_MODULE[]_CPPFLAGS="`$PKG_CONFIG --cflags _dune_name`" 2>/dev/null _DUNE_MODULE[]_CPPFLAGS="`$PKG_CONFIG --cflags _dune_name`" 2>/dev/null
_DUNE_MODULE[]_ROOT="`$PKG_CONFIG --variable=prefix _dune_name`" 2>/dev/null _DUNE_MODULE[]_ROOT="`$PKG_CONFIG --variable=prefix _dune_name`" 2>/dev/null
_DUNE_MODULE[]_VERSION="`$PKG_CONFIG --modversion _dune_name`" 2>/dev/null _DUNE_MODULE[]_VERSION="`$PKG_CONFIG --modversion _dune_name`" 2>/dev/null
ifelse(_dune_symbol,,,[ _DUNE_MODULE[]_LDFLAGS=""
_DUNE_MODULE[]_LDFLAGS="-L`$PKG_CONFIG --variable=libdir _dune_name`" 2>/dev/null ifelse(_dune_symbol,,
_DUNE_MODULE[]_LIBS="-l[]_dune_lib" [_DUNE_MODULE[]_LIBS=""],
]) [_DUNE_MODULE[]_LIBS="-L`$PKG_CONFIG --variable=libdir _dune_name 2>/dev/null` -l[]_dune_lib"])
HAVE_[]_DUNE_MODULE=1 HAVE_[]_DUNE_MODULE=1
AC_MSG_RESULT([global installation in $_DUNE_MODULE[]_ROOT]) AC_MSG_RESULT([global installation in $_DUNE_MODULE[]_ROOT])
],[ ],[
...@@ -227,10 +227,10 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -227,10 +227,10 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
_DUNE_MODULE[]_CPPFLAGS="-I$_DUNE_MODULE[]_SRCDIR" _DUNE_MODULE[]_CPPFLAGS="-I$_DUNE_MODULE[]_SRCDIR"
_DUNE_MODULE[]_VERSION="`grep Version $_DUNE_MODULE[]_SRCDIR/dune.module | sed -e 's/^Version: *//'`" 2>/dev/null _DUNE_MODULE[]_VERSION="`grep Version $_DUNE_MODULE[]_SRCDIR/dune.module | sed -e 's/^Version: *//'`" 2>/dev/null
]) ])
ifelse(_dune_symbol,,,[ _DUNE_MODULE[]_LDFLAGS=""
_DUNE_MODULE[]_LDFLAGS="-L$_DUNE_MODULE[]_ROOT/lib" ifelse(_dune_symbol,,
_DUNE_MODULE[]_LIBS="-l[]_dune_lib" [_DUNE_MODULE[]_LIBS=""],
]) [_DUNE_MODULE[]_LIBS="-L$_DUNE_MODULE[]_ROOT/lib -l[]_dune_lib"])
# set expanded module path # set expanded module path
with_[]_dune_module="$_DUNE_MODULE[]_ROOT" with_[]_dune_module="$_DUNE_MODULE[]_ROOT"
HAVE_[]_DUNE_MODULE=1 HAVE_[]_DUNE_MODULE=1
......
...@@ -85,7 +85,7 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[ ...@@ -85,7 +85,7 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[
LIBS="$DUNEMPILIBS -lm $LIBS" LIBS="$DUNEMPILIBS -lm $LIBS"
if test x$HAVE_PARMETIS = x1 ; then if test x$HAVE_PARMETIS = x1 ; then
DUNE_CHECK_LIB_EXT(["$PARMETIS_LIB_PATH"], [metis], [metis_partgraphkway], DUNE_CHECK_LIB_EXT([$PARMETIS_LIB_PATH], [metis], [metis_partgraphkway],
[ [
PARMETIS_LIBS="-L$PARMETIS_LIB_PATH -lmetis $DUNEMPILIBS -lm" PARMETIS_LIBS="-L$PARMETIS_LIB_PATH -lmetis $DUNEMPILIBS -lm"
LIBS="$PARMETIS_LIBS $ac_save_LIBS" LIBS="$PARMETIS_LIBS $ac_save_LIBS"
...@@ -96,7 +96,7 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[ ...@@ -96,7 +96,7 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[
fi fi
if test x$HAVE_PARMETIS = x1 ; then if test x$HAVE_PARMETIS = x1 ; then
DUNE_CHECK_LIB_EXT(["$PARMETIS_LIB_PATH"], [parmetis], [parmetis_v3_partkway], DUNE_CHECK_LIB_EXT([$PARMETIS_LIB_PATH], [parmetis], [parmetis_v3_partkway],
[ [
PARMETIS_LIBS="-L$PARMETIS_LIB_PATH -lparmetis -lmetis $DUNEMPILIBS -lm" PARMETIS_LIBS="-L$PARMETIS_LIB_PATH -lparmetis -lmetis $DUNEMPILIBS -lm"
],[ ],[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment