diff configure.ac @ 13010:edc5ec6e949b

maint: allow --enable-static --disable-dl to work again * oct-conf.h.in (OCTAVE_CONF_OCTAVE_LINK_DEPS, OCTAVE_CONF_OCTAVE_LINK_OPTS, OCTAVE_CONF_OCT_LINK_DEPS, OCTAVE_CONF_OCT_LINK_OPTS): New macros. * common.mk (do_subst_config_vals): Substitute them. * toplev.cc (octave_config_info): Add them to the info map * libcruft/link-deps.mk, liboctave/link-deps.mk, src/link-deps.mk: New files. * libcruft/Makefile.am, liboctave/Makefile.am, src/Makefile.am: Include link-deps.mk files to get link options and dependencies. Set link options in _LDFLAGS variable, not _LIBADD variable. * configure.ac (--enable-dl): Update help message. * configure.ac (AMCOND_LINK_ALL_DEPS): New conditional. * liboctave/link-deps.mk, src/link-deps.mk: Use it. * src/DLD-FUNCTIONS/module-files: Store file-specific CPPFLAGS, * LDFLAGS, and LIBRARY info here. src/Makefile.am: Not here. * src/DLD-FUNCTIONS/config-module.awk: Use file-specific CPPFLAGS, LDFLAGS, and LIBRARY info from module-files to generate variable definitions and rules. * src/Makefile.am (DLD_DYNAMIC_SRC, DLD_STATIC_SRC, OCTAVE_LIBS, OCTINTERP_LINK_DEPS): Delete. (octave_LDADD): Set to liboctinerp.la and $(OCTAVE_LINK_DEPS), not $(OCTAVE_LIBS). (octave_LDFLAGS): New variable. (DLD_STATIC_DEF_FILES, DLD_DYNAMIC_DEF_FILES): Delete. (DLD_FUNCTIONS_DEF_FILES): New variable. (DEF_FILES): Set conditionally. (DLD_FUNCTIONS_PKG_ADD_FILE): New conditionally defined variable. Change all uses of hard-coded file name. (DLD-FUNCTIONS/PKG_ADD:): Conditionally define rule. * mkoctfile.in, mkoctfile.cc.in: Update for new linking rules.
author John W. Eaton <jwe@octave.org>
date Fri, 26 Aug 2011 15:36:14 -0400
parents c55df65b543a
children 6b0798860fa4
line wrap: on
line diff
--- a/configure.ac	Fri Aug 26 09:33:52 2011 -0400
+++ b/configure.ac	Fri Aug 26 15:36:14 2011 -0400
@@ -1157,7 +1157,7 @@
 
 AC_ARG_ENABLE([dl],
   [AS_HELP_STRING([--enable-dl],
-    [create shared libraries (not all systems)])], [
+    [allow loading of dynamically linked modules (not all systems)])], [
   case "${enableval}" in
     yes) ENABLE_DYNAMIC_LINKING=true ;;
     no) ENABLE_DYNAMIC_LINKING=false ;;
@@ -1509,6 +1509,7 @@
   ;;
 esac
 AC_SUBST(NO_UNDEFINED_LDFLAG)
+AM_CONDITIONAL([AMCOND_LINK_ALL_DEPS], [test -n "$NO_UNDEFINED_LDFLAG"])
 
 ### Type stuff.
 
@@ -1685,7 +1686,7 @@
       OCTAVE_CXX_FLAG(-rdynamic, [RDYNAMIC_FLAG=-rdynamic])
     ;;
     shl_load)
-      shl_load_api=true
+      shl_load_api=truenn
       DL_API_MSG="(shl_load)"
       AC_DEFINE(HAVE_SHL_LOAD_API, 1, [Define if your system has shl_load and shl_findsym for dynamic linking])
     ;;
@@ -1704,12 +1705,18 @@
   DL_LIBS="$lt_cv_dlopen_libs"
   AC_SUBST(DL_LIBS)
 
+  ## Disable dynamic linking if capability is not present.
   if $dlopen_api || $shl_load_api || $loadlibrary_api || $dyld_api; then
-    ENABLE_DYNAMIC_LINKING=true
-    AC_DEFINE(ENABLE_DYNAMIC_LINKING, 1, [Define if using dynamic linking])
+    true
+  else
+    ENABLE_DYNAMIC_LINKING=false
   fi
 fi
 
+if $ENABLE_DYNAMIC_LINKING; then
+  AC_DEFINE(ENABLE_DYNAMIC_LINKING, 1, [Define if using dynamic linking])
+fi
+
 AM_CONDITIONAL([AMCOND_ENABLE_DYNAMIC_LINKING],
   [test x$ENABLE_DYNAMIC_LINKING = xtrue])