Skip to content
Snippets Groups Projects
Commit bb2fe387 authored by Thimo Neubauer's avatar Thimo Neubauer
Browse files

- added --enable-localdune option

- added two types of library-check:
  a) normal search for lib in default-path (for a global installation
     some time in the future)
  b) a check for a signs of a compiled lib in a local
     Dune-installation if "localdune" is enabled. This is by no chance
     a strict check but what we want for local development

[[Imported from SVN: r251]]
parent a8cd1f2a
No related branches found
No related tags found
No related merge requests found
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
# TODO # TODO
# #
# use pkg-config later? Maybe not really worth it, because only one -I is # - use pkg-config if --enable-localdune is not provided
# needed right now...
# #export PKG_CONFIG_LIBDIR=$with_dune/dune # #export PKG_CONFIG_LIBDIR=$with_dune/dune
# #PKG_CHECK_MODULES(DUNE, dune) # #PKG_CHECK_MODULES(DUNE, dune)
...@@ -20,9 +19,14 @@ AC_DEFUN([DUNE_PATH_DUNE],[ ...@@ -20,9 +19,14 @@ AC_DEFUN([DUNE_PATH_DUNE],[
AC_ARG_WITH(dune, AC_ARG_WITH(dune,
AC_HELP_STRING([--with-dune=PATH],[directory with Dune inside])) AC_HELP_STRING([--with-dune=PATH],[directory with Dune inside]))
AC_ARG_ENABLE(localdune,
AC_HELP_STRING([--enable-localdune],[use Dune-headers/lib]))
# backup of flags # backup of flags
ac_save_CPPFLAGS="$CPPFLAGS" ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="" CPPFLAGS=""
LIBS=""
# is a directory set? # is a directory set?
if test "x$with_dune" != x ; then if test "x$with_dune" != x ; then
...@@ -46,18 +50,67 @@ AC_DEFUN([DUNE_PATH_DUNE],[ ...@@ -46,18 +50,67 @@ AC_DEFUN([DUNE_PATH_DUNE],[
[HAVE_DUNE=0] [HAVE_DUNE=0]
) )
# did we find the headers?
if test x$HAVE_DUNE = x1 ; then
# check for library
#
# for the devel-mode, we're searching for a .la-file in the
# with-dune-directory, otherwise we'll really test for a lib
# (installed in a proper directory!)
if test x"$enable_localdune" != xyes ; then
## normal test
# !!! should be pkg-config later (which would save the special
# header-check above)
# !!! insert symbol defined in the libdune
AC_CHECK_LIB(dune, ,[HAVE_DUNE=1],[HAVE_DUNE=0])
else
## special test for a local installation
ac_save_LDFLAGS="$LDFLAGS"
if test x$DUNEROOT != x ; then
# have a look into the dune-dir
LDFLAGS="$LDFLAGS -L$DUNEROOT/dune/lib"
# only check for a .la-file
if test -s $DUNEROOT/dune/lib/libdune.la ; then
DUNE_LDFLAGS="-L$DUNEROOT/dune/lib"
echo found libdune.la, setting LDFLAGS to $DUNE_LDFLAGS
# provide arguments like normal lib-check
LIBS="-ldune"
HAVE_DUNE=1
else
AC_MSG_ERROR([localdune is enabled but libdune.la was not found. Please compile the library or set a correct --with-dune])
fi
else
AC_MSG_ERROR([--enable-localdune needs a --with-dune-parameter!])
fi
# reset variable
LDFLAGS="$ac_save_LDFLAGS"
fi
fi
# did we succeed? # did we succeed?
if test x$HAVE_DUNE = x1 ; then if test x$HAVE_DUNE = x1 ; then
AC_SUBST(DUNE_CPPFLAGS, $DUNE_CPPFLAGS) AC_SUBST(DUNE_CPPFLAGS, $DUNE_CPPFLAGS)
AC_DEFINE(HAVE_DUNE, 1, [Define to 1 if dune-headers were found]) AC_SUBST(DUNE_LDFLAGS, $DUNE_LDFLAGS)
AC_SUBST(DUNE_LIBS, $LIBS)
AC_DEFINE(HAVE_DUNE, 1, [Define to 1 if dune was found])
# add to global list # add to global list
DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $DUNE_CPPFLAGS" DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $DUNE_CPPFLAGS"
DUNE_PKG_LIBS="$DUNE_PKG_LIBS $LIBS"
DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $DUNE_LDFLAGS"
fi fi
# reset previous flags # reset previous flags
CPPFLAGS="$ac_save_CPPFLAGS" CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
# restore previous language settings (leave C++) # restore previous language settings (leave C++)
AC_LANG_POP([C++]) AC_LANG_POP([C++])
]) ])
\ No newline at end of file
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