]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* configure.in: fix spacing for --disable-ltdl-install,
authorThomas Tanner <tanner@gmx.de>
Wed, 10 Mar 1999 16:16:03 +0000 (16:16 +0000)
committerThomas Tanner <tanner@gmx.de>
Wed, 10 Mar 1999 16:16:03 +0000 (16:16 +0000)
  always configure libltdl, add libltdl/acinclude.m4 to
  ACINCLUDE_M4_LIST, disable installation of libltdl if necessary
* libltdl/Makefile.am: set version info for libltdl.la
* libltdl/configure.in: don't check whether
  enable_ltdl_convenience/install was set so that libltdl
  can be used as independent package (libltdl.tar.gz) without
  the need to use --enable-ltdl*
* libltdl/ltdl.c: minor cleanups, allocate the line cache
  dynamically (lt_dlopen)

ChangeLog
configure.in
libltdl/Makefile.am
libltdl/configure.in
libltdl/ltdl.c

index 9c51f170292792568fd14c7346ae5bd4fa08d422..bf1c6e9ab7c75389e387941c885a65c3dc77cdcb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+1999-03-10  Thomas Tanner  <tanner@gmx.de>
+
+       * configure.in: fix spacing for --disable-ltdl-install,
+         always configure libltdl, add libltdl/acinclude.m4 to 
+         ACINCLUDE_M4_LIST, disable installation of libltdl if necessary
+       * libltdl/Makefile.am: set version info for libltdl.la
+       * libltdl/configure.in: don't check whether 
+         enable_ltdl_convenience/install was set so that libltdl
+         can be used as independent package (libltdl.tar.gz) without
+         the need to use --enable-ltdl*
+       * libltdl/ltdl.c: minor cleanups, allocate the line cache
+         dynamically (lt_dlopen)
+       
 1999-03-10  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * libltdl/ltdl.c (lt_dlopen): some preprocessors choke if the `#'
index 295598a9b6d3587ae19045f9017a9c0b3a9ef05c..50756f3235441b61214148f8ee6bb62ecee132c8 100644 (file)
@@ -40,20 +40,18 @@ dnl For the `lineno' script (which puts line numbers into `ltconfig').
 AC_PROG_AWK
 
 AC_ARG_ENABLE(ltdl-install,
-  [--disable-ltdl-install     do not install libltdl])
-if test x"$enable_ltdl_install" != xno; then
-  enable_ltdl_install=yes
-  ac_configure_args="$ac_configure_args --enable-ltdl-install"
+[  --disable-ltdl-install  do not install libltdl])
+if test x"$enable_ltdl_install" = xno; then
+  ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
 fi
-dnl Since this is handled by m4, it cannot be made conditional :-(
 AC_CONFIG_SUBDIRS(libltdl)
 
 dnl all subdirectories that are configured on demand, but that must be
 dnl included in the distribution
-CONF_SUBDIRS="demo mdemo cdemo" # depdemo
+CONF_SUBDIRS="cdemo demo mdemo"
 AC_SUBST(CONF_SUBDIRS)
 
-ACINCLUDE_M4_LIST="${srcdir}/acinclude.m4 "
+ACINCLUDE_M4_LIST="${srcdir}/acinclude.m4 ${srcdir}/libltdl/acinclude.m4 "
 DIST_MAKEFILE_LIST=
 for dir in $CONF_SUBDIRS; do
   ACINCLUDE_M4_LIST="$ACINCLUDE_M4_LIST${srcdir}/$dir/acinclude.m4 "
index a676d633c2c7bd0ac98503e0c98e65bc4ccedc3c..4c2ebd572ddba628081dfc751583bf19838404fc 100644 (file)
@@ -2,8 +2,6 @@
 #
 AUTOMAKE_OPTIONS = no-dependencies foreign
 
-LTDL_VERSION = -version-info 1:1:1
-
 if INSTALL_LTDL
 include_HEADERS = ltdl.h
 lib_LTLIBRARIES = libltdl.la
@@ -16,6 +14,7 @@ noinst_LTLIBRARIES = libltdlc.la
 endif
 
 libltdl_la_SOURCES = ltdl.c
+libltdl_la_LDFLAGS = -version-info 1:1:1
 libltdl_la_LIBADD = $(LIBADD_DL)
 
 libltdlc_la_SOURCES = ltdl.c
index ed83c4e9e5df2f4bbdc8a6bd199d135545f7b0b0..5b66c1b9a871eed27a51b80effde82a11416574a 100644 (file)
@@ -3,26 +3,20 @@ dnl Initialize the libltdl package.
 AC_INIT(ltdl.c)
 AM_INIT_AUTOMAKE(libltdl,1.0,-)
 AM_CONFIG_HEADER(config.h)
-
 AM_MAINTAINER_MODE
 
-if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
-  AC_MSG_WARN([*** Neither [A""C_LIBLTDL_INSTALLABLE] nor [A""C_LIBLTDL_CONVENIENCE] were used])
-  AC_MSG_ERROR([*** in the top-level configure.in; aborting])
-fi
-
-AC_ARG_ENABLE(ltdl-install,
-  [--enable-ltdl-install     install libltdl])
-
-AM_CONDITIONAL(INSTALL_LTDL, test x"$enable_ltdl_install" != xno)
-AM_CONDITIONAL(CONVENIENCE_LTDL, test x"$enable_ltdl_convenience" != xno)
-
 AC_PROG_CC
 AC_C_CONST
 AC_C_INLINE
 AM_PROG_LIBTOOL
 AC_SUBST(LIBTOOL_DEPS)
 
+AC_ARG_ENABLE(ltdl-install,
+[  --enable-ltdl-install   install libltdl])
+
+AM_CONDITIONAL(INSTALL_LTDL, test x"$enable_ltdl_install" != xno)
+AM_CONDITIONAL(CONVENIENCE_LTDL, test x"$enable_ltdl_convenience" != xno)
+
 AC_CACHE_CHECK([which extension is used for shared libraries],
   libltdl_cv_shlibext, [dnl
 (
index 8bf16a7cd281f8676df58c579f7734d38bd38d40..7053afb3461de4faa7c5ed5716e9ad5524556e20 100644 (file)
@@ -833,6 +833,8 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
        const char *old_name;
        int installed;
 {
+       int     error;
+       char    *filename;
        /* try to open the old library first; if it was dlpreopened, 
           we want the preopened version of it, even if a dlopenable
           module is available */
@@ -842,10 +844,8 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
        if (dlname) {
                /* try to open the installed module */
                if (installed && libdir) {
-                       int ret;
-                       char *filename = (char*)
+                       filename = (char*)
                                lt_dlmalloc(strlen(libdir)+1+strlen(dlname)+1);
-
                        if (!filename) {
                                last_error = memory_error;
                                return 1;
@@ -853,18 +853,16 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
                        strcpy(filename, libdir);
                        strcat(filename, "/");
                        strcat(filename, dlname);
-                       ret = tryall_dlopen(handle, filename) == 0;
+                       error = tryall_dlopen(handle, filename) == 0;
                        lt_dlfree(filename);
-                       if (ret)
+                       if (error)
                                return 0;
                }
                /* try to open the not-installed module */
                if (!installed) {
-                       int ret;
-                       char *filename = (char*)
+                       filename = (char*)
                                lt_dlmalloc((dir ? strlen(dir) : 0)
                                       + strlen(objdir) + strlen(dlname) + 1);
-                       
                        if (!filename) {
                                last_error = memory_error;
                                return 1;
@@ -876,16 +874,14 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
                        strcat(filename, objdir);
                        strcat(filename, dlname);
 
-                       ret = tryall_dlopen(handle, filename) == 0;
+                       error = tryall_dlopen(handle, filename) == 0;
                        lt_dlfree(filename);
-                       if (ret)
+                       if (error)
                                return 0;
                }
-               /* hmm, maybe it was moved to another directory.
-                   Should we really support this? */
+               /* hmm, maybe it was moved to another directory */
                {
-                       int ret;
-                       char *filename = (char*)
+                       filename = (char*)
                                lt_dlmalloc((dir ? strlen(dir) : 0)
                                       + strlen(dlname) + 1);
                        if (dir)
@@ -893,9 +889,9 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
                        else
                                *filename = 0;
                        strcat(filename, dlname);
-                       ret = tryall_dlopen(handle, filename) == 0;
+                       error = tryall_dlopen(handle, filename) == 0;
                        lt_dlfree(filename);
-                       if (ret)
+                       if (error)
                                return 0;
                }
        }
@@ -999,23 +995,25 @@ unload_deplibs(handle)
 }
 
 static inline int
-trim (dest, s)
+trim (dest, str)
        char **dest;
-       const char *s;
+       const char *str;
 {
+       /* remove the leading and trailing "'" from str 
+          and store the result in dest */
        char *tmp;
-       char *i = strrchr(s, '\'');
-       int len = strlen(s);
+       char *end = strrchr(str, '\'');
+       int len = strlen(str);
 
        if (*dest)
                lt_dlfree(*dest);
-       if (len > 3 && s[0] == '\'') {
-               tmp = (char*) lt_dlmalloc(i - s);
+       if (len > 3 && str[0] == '\'') {
+               tmp = (char*) lt_dlmalloc(end - str);
                if (!tmp) {
                        last_error = memory_error;
                        return 1;
                }
-               strncpy(tmp, &s[1], (i - s) - 1);
+               strncpy(tmp, &str[1], (end - str) - 1);
                tmp[len-3] = '\0';
                *dest = tmp;
        } else
@@ -1092,6 +1090,7 @@ lt_dlopen (filename)
                int     i;
                char    *dlname = 0, *old_name = 0;
                char    *libdir = 0, *deplibs = 0;
+               char    *line;
                int     error = 0;
                /* if we can't find the installed flag, it is probably an
                   installed libtool archive, produced with an old version
@@ -1140,11 +1139,15 @@ lt_dlopen (filename)
                                lt_dlfree(dir);
                        return 0;
                }
+               line = (char*) lt_dlmalloc(LTDL_FILENAME_MAX);
+               if (!line) {
+                       fclose(file);
+                       last_error = memory_error;
+                       return 0;
+               }
                /* read the .la file */
                while (!feof(file)) {
-                       char    line[LTDL_FILENAME_MAX];
-                       
-                       if (!fgets(line, sizeof(line), file))
+                       if (!fgets(line, LTDL_FILENAME_MAX, file))
                                break;
                        if (line[0] == '\n' || line[0] == '#')
                                continue;
@@ -1185,6 +1188,7 @@ lt_dlopen (filename)
                                break;
                }
                fclose(file);
+               lt_dlfree(line);
                /* allocate the handle */
                handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
                if (!handle || error) {