From 554b4b209d6d900417581f31dc1ccb57841d426d Mon Sep 17 00:00:00 2001 From: Claus-Justus Heine <Claus-Justus.Heine@IANS.Uni-Stuttgart.DE> Date: Fri, 22 Jul 2016 09:56:45 +0000 Subject: [PATCH] Check for presence of ltdl --- Makefile.am.template | 6 +++--- configure.ac | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile.am.template b/Makefile.am.template index e187be2..00130d1 100644 --- a/Makefile.am.template +++ b/Makefile.am.template @@ -32,7 +32,7 @@ pkgconfig_DATA += alberta-fem%LIBCODE%.pc noinst_LTLIBRARIES += $(assemble%LIBCODE%_libs) libalberta_fem%LIBCODE%_la_SOURCES = $(common_fem_sources) -libalberta_fem%LIBCODE%_la_LIBADD = $(assemble%LIBCODE%_libs) @GPSKCA_ALL_LIBS@ +libalberta_fem%LIBCODE%_la_LIBADD = $(assemble%LIBCODE%_libs) @GPSKCA_ALL_LIBS@ @DYLOADER_LIBS@ libalberta_fem%LIBCODE%_la_CPPFLAGS = \ $(CPPFLAGS) -DDIM_OF_WORLD=%DIM_OF_WORLD% \ -DALBERTA_DEBUG=%ALBERTA_DEBUG% \ @@ -128,8 +128,8 @@ alberta-fem%LIBCODE%.pc: $(top_builddir)/alberta-fem.pctmpl Makefile alberta-gfx%LIBCODE%.pc: $(top_builddir)/alberta-gfx.pctmpl Makefile $(SED) -e 's/!DIMENSION!/%DIM_OF_WORLD%/g' -e 's/!LIBCODE!/$(LIBCODE)/g' -e 's/!SUFFIX!/$(SUFFIX)/g' $< > $@ -distclean-local: - -rm -f $(BUILT_SOURCES) +%NO_MULTI_DIM%distclean-local: +%NO_MULTI_DIM% -rm -f $(BUILT_SOURCES) %NO_MULTI_DIM%if MAINTAINER_MODE %NO_MULTI_DIM%$(srcdir)/Makefile.am: \ diff --git a/configure.ac b/configure.ac index 9fa43c3..07a5ee9 100644 --- a/configure.ac +++ b/configure.ac @@ -660,6 +660,7 @@ ALBERTA_ENABLE_FLAG([fem-toolbox], ALBERTA_FEM_TOOLBOX, [SUBST cond define]) +DYLOADER_LIBS="" if test "${ALBERTA_FEM_TOOLBOX}" = 1; then ALBERTA_ENABLE_FLAG([graphics], [disable support for visualization, including all add-ons which need graphics.], @@ -667,7 +668,10 @@ ALBERTA_ENABLE_FLAG([graphics], ALBERTA_USE_GRAPHICS, [SUBST cond define]) # Check for libltdl - AC_CHECK_LIB([ltdl],[lt_dlinit]) + AC_CHECK_LIB([ltdl],[lt_dlinit], + [AC_DEFINE(HAVE_LIBLTDL, 1, [Define to 1 if libtldl is available]) +DYLOADER_LIBS="-lltdl" + ]) AC_CHECK_HEADERS([ltdl.h]) else AM_CONDITIONAL(ALBERTA_USE_GRAPHICS, false) @@ -676,6 +680,7 @@ else AC_DEFINE(HAVE_LIBLTDL, 0, []) AC_DEFINE(HAVE_LTDL_H, 0, []) fi +AC_SUBST(DYLOADER_LIBS) if test "${ALBERTA_USE_GRAPHICS}" = 1; then # -- GitLab