changeset 4110:b9238356dd07

[project @ 2002-10-17 16:14:44 by jwe]
author jwe
date Thu, 17 Oct 2002 16:14:45 +0000
parents 6e20cac828cd
children 73ca6e054d91
files ChangeLog Makeconf.in configure.in liboctave/ChangeLog liboctave/oct-shlib.cc src/ChangeLog src/Makefile.in src/mkbuiltins src/oct-conf.h.in src/toplev.cc
diffstat 10 files changed, 268 insertions(+), 150 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Oct 17 03:11:30 2002 +0000
+++ b/ChangeLog	Thu Oct 17 16:14:45 2002 +0000
@@ -1,3 +1,21 @@
+2002-10-17  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* Makeconf.in (do-subst-config-vals): Don't substitute
+	OCTAVE_CONF_OCTAVE_LITE.
+	(OCTAVE_LITE): Delete.
+
+	* Makeconf.in: Use HAVE_DLOPEN_API, HAVE_LOADLIBRARY_API, and
+	HAVE_SHL_LOAD_API instead of WITH_DL and WITH_SHL.
+
+	* configure.in: Rewrite the way we handle dynamic linking.
+	If dynamic linking is used always do what was previously only
+	enabled by --enable-lite-kernel.
+
+2002-10-17  Paul Kienzle <pkienzle@users.sf.net>
+
+	* configure.in: Define WITH_DYNAMIC_LINKING based on --enable-shared.
+	Add -lwsock32 to LIBS for MinGW.
+
 2002-10-16  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* aclocal.m4 (OCTAVE_LANG_PROG_NO_CONFDEFS): New macro.
--- a/Makeconf.in	Thu Oct 17 03:11:30 2002 +0000
+++ b/Makeconf.in	Thu Oct 17 16:14:45 2002 +0000
@@ -50,13 +50,12 @@
 
 DEFAULT_PAGER = @DEFAULT_PAGER@
 
-WITH_DL = @WITH_DL@
-WITH_SHL = @WITH_SHL@
+HAVE_DLOPEN_API = @HAVE_DLOPEN_API@
+HAVE_SHL_LOAD_API = @HAVE_SHL_LOAD_API@
+HAVE_LOADLIBRARY_API = @HAVE_LOADLIBRARY_API@
 
 WITH_DYNAMIC_LINKING = @WITH_DYNAMIC_LINKING@
 
-OCTAVE_LITE = @OCTAVE_LITE@
-
 STATIC_LIBS = @STATIC_LIBS@
 
 SHARED_LIBS = @SHARED_LIBS@
@@ -390,6 +389,9 @@
   -e "s;%OCTAVE_CONF_FLIBS%;\"${FLIBS}\";" \
   -e "s;%OCTAVE_CONF_FPICFLAG%;\"${FPICFLAG}\";" \
   -e "s;%OCTAVE_CONF_GLOB_INCFLAGS%;\"${GLOB_INCFLAGS}\";" \
+  -e "s;%OCTAVE_CONF_HAVE_DLOPEN_API%;\"${HAVE_DLOPEN_API}\";" \
+  -e "s;%OCTAVE_CONF_HAVE_LOADLIBRARY_API%;\"${HAVE_LOADLIBRARY_API}\";" \
+  -e "s;%OCTAVE_CONF_HAVE_SHL_LOAD_API%;\"${HAVE_SHL_LOAD_API}\";" \
   -e "s;%OCTAVE_CONF_INCFLAGS%;\"${INCFLAGS}\";" \
   -e "s;%OCTAVE_CONF_INCLUDE_LINK_DEPS%;\"${INCLUDE_LINK_DEPS}\";"\
   -e "s;%OCTAVE_CONF_LD_CXX%;\"${LD_CXX}\";" \
@@ -412,7 +414,6 @@
   -e "s;%OCTAVE_CONF_LN_S%;\"${LN_S}\";" \
   -e "s;%OCTAVE_CONF_MKOCTFILE_INCFLAGS%;\"${MKOCTFILE_INCFLAGS}\";" \
   -e "s;%OCTAVE_CONF_MKOCTFILE_LFLAGS%;\"${MKOCTFILE_LFLAGS}\";" \
-  -e "s;%OCTAVE_CONF_OCTAVE_LITE%;\"${OCTAVE_LITE}\";" \
   -e "s;%OCTAVE_CONF_RANLIB%;\"${RANLIB}\";" \
   -e "s;%OCTAVE_CONF_RDYNAMIC_FLAG%;\"${RDYNAMIC_FLAG}\";" \
   -e "s;%OCTAVE_CONF_RLD_FLAG%;\"${RLD_FLAG}\";" \
@@ -428,9 +429,7 @@
   -e "s;%OCTAVE_CONF_STATIC_LIBS%;\"${STATIC_LIBS}\";" \
   -e "s;%OCTAVE_CONF_UGLY_DEFS%;\"${UGLY_DEFS}\";" \
   -e "s;%OCTAVE_CONF_VERSION%;\"${version}\";" \
-  -e "s;%OCTAVE_CONF_WITH_DL%;\"${WITH_DL}\";" \
   -e "s;%OCTAVE_CONF_WITH_DYNAMIC_LINKING%;\"${WITH_DYNAMIC_LINKING}\";" \
-  -e "s;%OCTAVE_CONF_WITH_SHL%;\"${WITH_SHL}\";" \
   -e "s;%OCTAVE_CONF_XTRA_CFLAGS%;\"${XTRA_CFLAGS}\";" \
   -e "s;%OCTAVE_CONF_XTRA_CXXFLAGS%;\"${XTRA_CXXFLAGS}\";" \
   -e "s;%OCTAVE_CONF_YACC%;\"${YACC}\";" \
--- a/configure.in	Thu Oct 17 03:11:30 2002 +0000
+++ b/configure.in	Thu Oct 17 16:14:45 2002 +0000
@@ -22,7 +22,7 @@
 ### 02111-1307, USA. 
 
 AC_INIT
-AC_REVISION($Revision: 1.379 $)
+AC_REVISION($Revision: 1.380 $)
 AC_PREREQ(2.52)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -575,26 +575,7 @@
 AC_SUBST(BLAS_DIR)
 AC_SUBST(LAPACK_DIR)
 
-### Handle dynamic linking and shared library options.
-
-### Allow the user to experiment with dynamic linking using dlopen/dlsym.
-
-AC_ARG_ENABLE(dl,
-  [  --enable-dl             use dlopen/dlsym for dynamic linking (not all systems)],
-  [if test "$enableval" = no; then WITH_DL=no;
-   elif test "$enableval" = yes; then WITH_DL=yes;
-   else WITH_DL=maybe; fi],
-  WITH_DL=maybe)
-
-### Allow the user to experiment with dynamic linking using
-### shl_load/shl_findsym (HP/UX only?).
-
-AC_ARG_ENABLE(shl,
-  [  --enable-shl            use shl_load/shl_findsym for dynamic linking (HP only)],
-  [if test "$enableval" = no; then WITH_SHL=no;
-   elif test "$enableval" = yes; then WITH_SHL=yes;
-   else WITH_SHL=maybe; fi],
-  WITH_SHL=maybe)
+### Handle shared library options.
 
 ### Enable creation of static libraries.
 
@@ -776,32 +757,6 @@
 AC_SUBST(INCLUDE_LINK_DEPS)
 AC_SUBST(library_path_var)
 
-if $SHARED_LIBS; then
-  LIBOCTINTERP=-loctinterp$SHLLINKEXT
-  LIBOCTAVE=-loctave$SHLLINKEXT
-  LIBCRUFT=-lcruft$SHLLINKEXT
-else
-  LIBOCTINTERP='$(TOPDIR)/src/liboctinterp.$(LIBEXT)'
-  LIBOCTAVE='$(TOPDIR)/liboctave/liboctave.$(LIBEXT)'
-  LIBCRUFT='$(TOPDIR)/libcruft/libcruft.$(LIBEXT)'
-fi
-AC_SUBST(LIBOCTINTERP)
-AC_SUBST(LIBOCTAVE)
-AC_SUBST(LIBCRUFT)
-
-### Allow compilation of smaller kernel.  This only works if some form
-### of dynamic linking is also supported and used.
-
-AC_ARG_ENABLE(lite-kernel,
-  [  --enable-lite-kernel    compile smaller kernel (requires dynamic linking)],
-  [if test "$enableval" = no; then OCTAVE_LITE=false;
-   else OCTAVE_LITE=true; fi],
-  OCTAVE_LITE=false)
-if $OCTAVE_LITE; then
-  AC_DEFINE(OCTAVE_LITE, 1, [Define to compile smaller kernel.])
-fi
-AC_SUBST(OCTAVE_LITE)
-
 ### special checks for odd OS specific things.
 ###
 ### I am told that on some SCO systems, the only place to find some
@@ -922,76 +877,84 @@
 
 OCTAVE_SMART_PUTENV
 
+### Dynamic linking is now enabled only if we are building shared
+### libs and some API for dynamic linking is detected.
+
 LD_CXX='$(CXX)'
 LIBDLFCN=
 DLFCN_INCFLAGS=
 RDYNAMIC_FLAG=
-if test "$WITH_DL" = yes || test "$WITH_DL" = maybe; then
-  case "$canonical_host_type" in
-    rs6000-ibm-aix* | powerpc-ibm-aix*)
-      LIBDLFCN="-ldlfcn -ll -lld"
-      DLFCN_INCFLAGS='-I$(top_srcdir)/dlfcn -I$(TOPDIR)/dlfcn'
-      WITH_DL=true
-    ;;
-    i[[3456]]86-*-sco3.2v5*)
-      LD_CXX='LD_RUN_PATH=$LD_RUN_PATH:$(octlibdir) $(CXX)'
-      WITH_DL=true
-    ;;
-    *)
-      AC_CHECK_LIB(dl, dlopen)
-      AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose, [], [have_dl=false])
-      if test "x$have_dl" != xfalse; then
-        WITH_DL=true
+WITH_DYNAMIC_LINKING=false
+DL_API_MSG=""
+dlopen_api=false
+shl_load_api=false
+loadlibrary_api=false
+if $SHARED_LIBS; then
+
+  LIBOCTINTERP=-loctinterp$SHLLINKEXT
+  LIBOCTAVE=-loctave$SHLLINKEXT
+  LIBCRUFT=-lcruft$SHLLINKEXT
+
+  AC_CHECK_LIB(dl, dlopen)
+  AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose)
+  if test $ac_cv_func_dlclose = yes && test $ac_cv_func_dlerror = yes \
+    && test $ac_cv_func_dlopen = yes && test $ac_cv_func_dlsym = yes; then
+    dlopen_api=true
+  else
+    AC_CHECK_LIB(dld, shl_load)
+    AC_CHECK_FUNCS(shl_load shl_findsym)
+    if test $ac_cv_func_shl_load = yes \
+      && test $ac_cv_func_shl_findsym = yes; then
+      shl_load_api=true
+    else
+      AC_CHECK_LIB(wsock32, LoadLibrary)
+      AC_CHECK_FUNCS(LoadLibrary)
+      if test $ac_cv_func_loadlibrary = yes; then
+	loadlibrary_api=true
       else
-	if test "$WITH_DL" = yes; then
-	  AC_MSG_ERROR([--enable-dl specified, but functions are missing!])
-	fi
-	WITH_DL=false
+	case "$canonical_host_type" in
+	  rs6000-ibm-aix* | powerpc-ibm-aix*)
+	    LIBDLFCN="-ldlfcn -ll -lld"
+	    DLFCN_INCFLAGS='-I$(top_srcdir)/dlfcn -I$(TOPDIR)/dlfcn'
+	    dlopen_api=true
+	  ;;
+	  i[[3456]]86-*-sco3.2v5*)
+	    LD_CXX='LD_RUN_PATH=$LD_RUN_PATH:$(octlibdir) $(CXX)'
+	    dlopen_api=true
+	  ;;
+	esac
       fi
-    ;;
-  esac
-  if $WITH_DL; then
+    fi
+  fi
+
+  if $dlopen_api; then
+    DL_API_MSG="(dlopen)"
+    AC_DEFINE(HAVE_DLOPEN_API, 1, [Define if your system has dlopen, dlsym, dlerror, and dlclose for dynamic linking])
     OCTAVE_CXX_FLAG(-rdynamic, [RDYNAMIC_FLAG=-rdynamic])
-    AC_DEFINE(WITH_DL, 1, [Define if using dlopen/dlsym.])
+  elif $shl_load_api; then
+    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])
+  elif $loadlibrary_api; then
+    DL_API_MSG="(LoadLibrary)"
+    AC_DEFINE(HAVE_LOADLIBRARY_API, 1, [Define if your system has LoadLibrary for dynamic linking])
+  fi
+
+  if $dlopen_api || $shl_load_api || $loadlibrary_api; then
+    WITH_DYNAMIC_LINKING=true
   fi
 else
-  WITH_DL=false
+  LIBOCTINTERP='$(TOPDIR)/src/liboctinterp.$(LIBEXT)'
+  LIBOCTAVE='$(TOPDIR)/liboctave/liboctave.$(LIBEXT)'
+  LIBCRUFT='$(TOPDIR)/libcruft/libcruft.$(LIBEXT)'
 fi
-AC_SUBST(WITH_DL)
+AC_SUBST(LD_CXX)
 AC_SUBST(LIBDLFCN)
 AC_SUBST(DLFCN_INCFLAGS)
 AC_SUBST(RDYNAMIC_FLAG)
-AC_SUBST(LD_CXX)
-
-if test "$WITH_SHL" = yes || test "$WITH_SHL" = maybe; then
-  AC_CHECK_LIB(dld, shl_load)
-  AC_CHECK_FUNCS(shl_load shl_findsym, [], [have_shl=false])
-  if test "x$have_shl" != xfalse; then
-    WITH_SHL=true
-  else
-    if test "$WITH_SHL" = yes; then
-      AC_MSG_ERROR([--enable-shl specified, but functions are missing!])
-    fi
-    WITH_SHL=false
-  fi
-  if $WITH_SHL; then
-    AC_DEFINE(WITH_SHL, 1, [Define if using dld for dynamic linking.])
-  fi
-else
-  WITH_SHL=false
-fi
-AC_SUBST(WITH_SHL)
-
-### Set WITH_DYNAMIC_LINKING after all the other shared library stuff
-### has been determined.
-
-if $WITH_DL || $WITH_SHL; then
-  AC_DEFINE(WITH_DYNAMIC_LINKING, 1, [Define if using dynamic linking.])
-  WITH_DYNAMIC_LINKING=true
-else
-  WITH_DYNAMIC_LINKING=false
-fi
 AC_SUBST(WITH_DYNAMIC_LINKING)
+AC_SUBST(LIBOCTINTERP)
+AC_SUBST(LIBOCTAVE)
+AC_SUBST(LIBCRUFT)
 
 ### There is more than one possible prototype for gettimeofday.  See
 ### which one (if any) appears in sys/time.h.  These tests are from
@@ -1132,13 +1095,6 @@
 
 ### A system dependent kluge or two.
 
-### Extra libs needed when using the win32api
-case "$cannonical_host_type" in
-  *-*-mingw*)
-    LIBS="-lwsock32 $LIBS"
-    ;;
-esac
-
 AC_CHECK_FUNCS(getrusage times)
 case "$canonical_host_type" in
   *-*-cygwin*)
@@ -1378,13 +1334,11 @@
   Default pager:        $DEFAULT_PAGER
   gnuplot:              $GNUPLOT_BINARY
 
-  Do internal array bounds checking:       $BOUNDS_CHECKING
-  Build static libraries:                  $STATIC_LIBS
-  Build shared libraries:                  $SHARED_LIBS
-  Minimal kernel option:                   $OCTAVE_LITE
-  Dynamic Linking (dlopen/dlsym):          $WITH_DL
-  Dynamic Linking (shl_load/shl_findsym):  $WITH_SHL
-  Include support for GNU readline:        $USE_READLINE
+  Do internal array bounds checking:  $BOUNDS_CHECKING
+  Build static libraries:             $STATIC_LIBS
+  Build shared libraries:             $SHARED_LIBS
+  Dynamic Linking:                    $WITH_DYNAMIC_LINKING $DL_API_MSG
+  Include support for GNU readline:   $USE_READLINE
 ])
 
 warn_msg_printed=false
--- a/liboctave/ChangeLog	Thu Oct 17 03:11:30 2002 +0000
+++ b/liboctave/ChangeLog	Thu Oct 17 16:14:45 2002 +0000
@@ -1,3 +1,7 @@
+2002-10-17  Paul Kienzle <pkienzle@users.sf.net>
+
+	* oct-shlib.cc (octave_w32_shlib): New class to support Windows.
+
 2002-10-16  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* Makefile.in (install-lib): Don't bother with versions for
--- a/liboctave/oct-shlib.cc	Thu Oct 17 03:11:30 2002 +0000
+++ b/liboctave/oct-shlib.cc	Thu Oct 17 16:14:45 2002 +0000
@@ -24,14 +24,14 @@
 #include <config.h>
 #endif
 
-#if defined (WITH_SHL)
+#if defined (HAVE_SHL_LOAD_API)
 #include <cerrno>
 #include <cstring>
 #endif
 
 extern "C"
 {
-#if defined (WITH_DL)
+#if defined (HAVE_DLOPEN_API)
 #if defined (HAVE_DLFCN_H)
 #include <dlfcn.h>
 #else
@@ -43,7 +43,7 @@
 #ifndef RTLD_LAZY
 #define RTLD_LAZY 1
 #endif
-#elif defined (WITH_SHL)
+#elif defined (HAVE_SHL_LOAD_API)
 #include <dl.h>
 #endif
 }
@@ -193,7 +193,7 @@
   tm_loaded = static_cast<time_t> (0);
 }
 
-#if defined (WITH_DL)
+#if defined (HAVE_DLOPEN_API)
 
 class
 octave_dlopen_shlib : public octave_base_shlib
@@ -297,7 +297,7 @@
     }
 }
 
-#elif defined (WITH_SHL)
+#elif defined (HAVE_SHL_LOAD_API)
 
 class
 octave_shl_load_shlib : public octave_base_shlib
@@ -400,15 +400,141 @@
     }
 }
 
+#elif defined (HAVE_LOADLIBRARY_API)
+
+class
+octave_w32_shlib: public octave_base_shlib
+{
+public:
+
+  octave_w32_shlib (void);
+
+  ~octave_w32_shlib (void);
+
+  void open (const std::string& f, bool warn_future = false);
+
+  void *search (const std::string& name, name_mangler mangler = 0);
+
+  void close (octave_shlib::close_hook cl_hook = 0);
+
+  bool is_open (void) const { return (handle != 0); }
+
+private:
+
+  // No copying!
+
+  octave_w32_shlib (const octave_w32_shlib&);
+
+  octave_w32_shlib& operator = (const octave_w32_shlib&);
+
+  HINSTANCE handle; 
+};
+
+octave_w32_shlib::octave_w32_shlib (void)
+  : octave_base_shlib (), handle (0)
+{
+}
+
+octave_w32_shlib::~octave_w32_shlib (void)
+{
+  close ();
+}
+
+void
+octave_w32_shlib::open (const std::string& f, bool warn_future)
+{
+  if (! is_open ())
+    {
+      file = f;
+
+      handle = LoadLibrary (file.c_str ());
+
+      if (handle != NULL)
+	stamp_time (warn_future);
+      else
+	{
+	  DWORD lastError = GetLastError ();
+	  char *msg;
+
+	  switch (lastError)
+	    {
+	    case ERROR_MOD_NOT_FOUND:
+	    case ERROR_DLL_NOT_FOUND:
+	      msg = "could not find library or dependents";
+	      break;
+
+	    case ERROR_INVALID_DLL:
+	      msg = "library or its dependents are damaged";
+	      break;
+
+	    case ERROR_DLL_INIT_FAILED:
+	      msg = "library initialization routine failed";
+	      break;
+
+	    default:
+	      msg = "library open failed";
+	    }
+
+	  (*current_liboctave_error_handler) ("%s: %s", msg, file.c_str ());
+	}
+    }
+  else
+    (*current_liboctave_error_handler)
+      ("shared library %s is already open", file.c_str ());
+}
+
+void *
+octave_w32_shlib::search (const std::string& name,
+			  octave_shlib::name_mangler mangler)
+{
+  void *function = 0;
+
+  if (is_open ())
+    {
+      std::string sym_name = name;
+
+      if (mangler)
+	sym_name = mangler (name);
+
+      function
+	= static_cast<void *> (GetProcAddress (handle, sym_name.c_str ()));
+
+      if (function)
+	add_to_fcn_names (name);
+    }
+  else
+    (*current_liboctave_error_handler)
+      ("shared library %s is not open", file.c_str ());
+
+  return function;
+}
+
+void
+octave_w32_shlib::close (octave_shlib::close_hook cl_hook)
+{
+  if (is_open ())
+    {
+      do_close_hook (cl_hook);
+
+      FreeLibrary (handle);
+
+      handle = 0;
+
+      tabula_rasa ();
+    }
+}
+
 #endif
 
 octave_shlib *
 octave_shlib::make_shlib (void)
 {
-#if defined (WITH_DL)
+#if defined (HAVE_DLOPEN_API)
   return new octave_dlopen_shlib ();
-#elif defined (WITH_SHL)
+#elif defined (HAVE_SHL_LOAD_API)
   return new octave_shl_load_shlib ();
+#elif defined (HAVE_LOADLIBRARY_API)
+  return new octave_w32_shlib ();
 #else
   return new octave_base_shlib ();
 #endif
--- a/src/ChangeLog	Thu Oct 17 03:11:30 2002 +0000
+++ b/src/ChangeLog	Thu Oct 17 16:14:45 2002 +0000
@@ -1,3 +1,20 @@
+2002-10-17  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* oct-conf.h.in: No need to substitute OCTAVE_CONF_OCTAVE_LITE.
+	* toplev.cc (octave_config_info): Likewise, don't include it in
+	struct.
+
+	* mkbuiltins: Remove check for OCTAVE_LITE, since it is now
+	implied by WITH_DYNAMIC_LINKING.
+	* Makefile.in: Likewise, replace tests for OCTAVE_LITE with tests
+	for WITH_DYNAMIC_LINKING instead.
+
+	* oct-conf.h.in: Use OCTAVE_CONF_HAVE_DLOPEN_API,
+	OCTAVE_CONF_HAVE_LOADLIBRARY_API, and
+	OCTAVE_CONF_HAVE_SHL_LOAD_API instead of OCTAVE_CONF_WITH_DL and
+	OCTAVE_CONF_WITH_SHL.
+	* toplev.cc (octave_config_info): Likewise.
+
 2002-10-16  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* help.cc (display_help_text): Quote output file name for Cygwin.
--- a/src/Makefile.in	Thu Oct 17 03:11:30 2002 +0000
+++ b/src/Makefile.in	Thu Oct 17 16:14:45 2002 +0000
@@ -29,7 +29,7 @@
 
 # How to make a .oct file from a .o file:
 
-ifeq ($(OCTAVE_LITE), true)
+ifeq ($(WITH_DYNAMIC_LINKING), true)
   ifdef CXXPICFLAG
     %.oct : pic/%.o
 	  $(SH_LD) $(SH_LDFLAGS) -o $@ $< $(OCT_LINK_DEPS)
@@ -55,7 +55,7 @@
 
 DLD_OBJ := $(patsubst %.cc, %.o, $(DLD_XSRC))
 
-ifeq ($(OCTAVE_LITE), true)
+ifeq ($(WITH_DYNAMIC_LINKING), true)
   OCT_FILES := $(patsubst %.o, %.oct, $(DLD_OBJ))
   ifdef CXXPICFLAG
     DLD_PICOBJ := $(addprefix pic/, $(DLD_OBJ))
--- a/src/mkbuiltins	Thu Oct 17 03:11:30 2002 +0000
+++ b/src/mkbuiltins	Thu Oct 17 16:14:45 2002 +0000
@@ -33,7 +33,7 @@
 #undef quad
 #endif
 
-#if defined (OCTAVE_LITE) && defined (WITH_DYNAMIC_LINKING)
+#if defined (WITH_DYNAMIC_LINKING)
 #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc)
 #else
 #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \
--- a/src/oct-conf.h.in	Thu Oct 17 03:11:30 2002 +0000
+++ b/src/oct-conf.h.in	Thu Oct 17 16:14:45 2002 +0000
@@ -144,6 +144,18 @@
 #define OCTAVE_CONF_GLOB_INCFLAGS %OCTAVE_CONF_GLOB_INCFLAGS%
 #endif
 
+#ifndef OCTAVE_CONF_HAVE_DLOPEN_API
+#define OCTAVE_CONF_HAVE_DLOPEN_API %OCTAVE_CONF_HAVE_DLOPEN_API%
+#endif
+
+#ifndef OCTAVE_CONF_HAVE_LOAD_LIBRARY_API
+#define OCTAVE_CONF_HAVE_LOAD_LIBRARY_API %OCTAVE_CONF_HAVE_LOAD_LIBRARY_API%
+#endif
+
+#ifndef OCTAVE_CONF_HAVE_SHL_LOAD_API
+#define OCTAVE_CONF_HAVE_SHL_LOAD_API %OCTAVE_CONF_HAVE_SHL_LOAD_API%
+#endif
+
 #ifndef OCTAVE_CONF_INCFLAGS
 #define OCTAVE_CONF_INCFLAGS %OCTAVE_CONF_INCFLAGS%
 #endif
@@ -228,10 +240,6 @@
 #define OCTAVE_CONF_MKOCTFILE_LFLAGS %OCTAVE_CONF_MKOCTFILE_LFLAGS%
 #endif
 
-#ifndef OCTAVE_CONF_OCTAVE_LITE
-#define OCTAVE_CONF_OCTAVE_LITE %OCTAVE_CONF_OCTAVE_LITE%
-#endif
-
 #ifndef OCTAVE_CONF_RANLIB
 #define OCTAVE_CONF_RANLIB %OCTAVE_CONF_RANLIB%
 #endif
@@ -284,18 +292,10 @@
 #define OCTAVE_CONF_UGLY_DEFS %OCTAVE_CONF_UGLY_DEFS%
 #endif
 
-#ifndef OCTAVE_CONF_WITH_DL
-#define OCTAVE_CONF_WITH_DL %OCTAVE_CONF_WITH_DL%
-#endif
-
 #ifndef OCTAVE_CONF_WITH_DYNAMIC_LINKING
 #define OCTAVE_CONF_WITH_DYNAMIC_LINKING %OCTAVE_CONF_WITH_DYNAMIC_LINKING%
 #endif
 
-#ifndef OCTAVE_CONF_WITH_SHL
-#define OCTAVE_CONF_WITH_SHL %OCTAVE_CONF_WITH_SHL%
-#endif
-
 #ifndef OCTAVE_CONF_XTRA_CFLAGS
 #define OCTAVE_CONF_XTRA_CFLAGS %OCTAVE_CONF_XTRA_CFLAGS%
 #endif
--- a/src/toplev.cc	Thu Oct 17 03:11:30 2002 +0000
+++ b/src/toplev.cc	Thu Oct 17 16:14:45 2002 +0000
@@ -642,7 +642,7 @@
 {
   octave_value retval;
 
-#if defined (WITH_DYNAMIC_LINKING) && (defined (WITH_DL) || defined (WITH_SHL))
+#if defined (WITH_DYNAMIC_LINKING)
   bool octave_supports_dynamic_linking = true;
 #else
   bool octave_supports_dynamic_linking = false;
@@ -679,6 +679,9 @@
   m ["FLIBS"] = OCTAVE_CONF_FLIBS;
   m ["FPICFLAG"] = OCTAVE_CONF_FPICFLAG;
   m ["GLOB_INCFLAGS"] = OCTAVE_CONF_GLOB_INCFLAGS;
+  m ["HAVE_DLOPEN_API"] = OCTAVE_CONF_HAVE_DLOPEN_API;
+  m ["HAVE_LOAD_LIBRARY_API"] = OCTAVE_CONF_HAVE_LOAD_LIBRARY_API;
+  m ["HAVE_SHL_LOAD_API"] = OCTAVE_CONF_HAVE_SHL_LOAD_API;
   m ["INCFLAGS"] = OCTAVE_CONF_INCFLAGS;
   m ["LDFLAGS"] = OCTAVE_CONF_LDFLAGS;
   m ["LD_CXX"] = OCTAVE_CONF_LD_CXX;
@@ -700,7 +703,6 @@
   m ["LN_S"] = OCTAVE_CONF_LN_S;
   m ["MKOCTFILE_INCFLAGS"] = OCTAVE_CONF_MKOCTFILE_INCFLAGS;
   m ["MKOCTFILE_LFLAGS"] = OCTAVE_CONF_MKOCTFILE_LFLAGS;
-  m ["OCTAVE_LITE"] = OCTAVE_CONF_OCTAVE_LITE;
   m ["RANLIB"] = OCTAVE_CONF_RANLIB;
   m ["RDYNAMIC_FLAG"] = OCTAVE_CONF_RDYNAMIC_FLAG;
   m ["RLD_FLAG"] = OCTAVE_CONF_RLD_FLAG;
@@ -715,9 +717,7 @@
   m ["STATIC_LIBS"] = OCTAVE_CONF_STATIC_LIBS;
   m ["UGLY_DEFS"] = OCTAVE_CONF_DEFS;
   m ["UGLY_DEFS"] = OCTAVE_CONF_UGLY_DEFS;
-  m ["WITH_DL"] = OCTAVE_CONF_WITH_DL;
   m ["WITH_DYNAMIC_LINKING"] = OCTAVE_CONF_WITH_DYNAMIC_LINKING;
-  m ["WITH_SHL"] = OCTAVE_CONF_WITH_SHL;
   m ["XTRA_CFLAGS"] = OCTAVE_CONF_XTRA_CFLAGS;
   m ["XTRA_CXXFLAGS"] = OCTAVE_CONF_XTRA_CXXFLAGS;
   m ["YACC"] = OCTAVE_CONF_YACC;