From: Alexandre Oliva Date: Fri, 22 Jan 1999 18:33:45 +0000 (+0000) Subject: merged from HEAD to idl-branch X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90f1e8e7b1e3eac682fd61e8dab41cf616ad29fb;p=thirdparty%2Flibtool.git merged from HEAD to idl-branch --- diff --git a/ChangeLog b/ChangeLog index 97bff6c2f..ce2b7c292 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,20 @@ -1999-01-22 Gary V. Vaughan +1999-01-22 Alexandre Oliva + + * Makefile.am (ltconfig, ltmain.sh): add ChangeLog Revision to + TIMESTAMP + * configure.in: get values of PACKAGE and VERSION set by + AM_INIT_AUTOMAKE, and extract only TIMESTAMP from the ChangeLog + + * libltdl/ltdl.c (lt_dlopen): if we're reusing a previously opened + handle, don't reset its name nor add it to the list, and free the + name we have allocated + Reported by Edouard G. Parmelan + + * Makefile.am (ltconfig, ltmain.sh, TIMESTAMP): let's not assume + anything about the format of the date, just that it does not + contain `$' + +1999-01-22 Gary V. Vaughan * ltmain.in: Merged Thomas' ild-patch. Untested. * configure.in: ditto. @@ -11,8 +27,6 @@ * doc/PLATFORMS: ReInsert i686-pc-cygwin32, for the same reason. * doc/libtool.texi: ReInsert win32 refs, for the same reason. -1999-01-22 Gary V. Vaughan - * configure.in (date): echo the version number during configuration, and show $date for cvs versions. @@ -3598,4 +3612,4 @@ Thu May 28 18:59:08 1998 Ian Lance Taylor * For historical reasons: this is when I started writing libtool. - $Date$ + $Revision$ $Date$ diff --git a/Makefile.am b/Makefile.am index 40d25c5b2..ba6f0fdb8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -61,7 +61,7 @@ update-timestamps: # Line numbering transliterated from a section in autoconf (Autoconf 2.12). $(srcdir)/ltconfig: $(srcdir)/ltconfig.in $(top_srcdir)/configure.in $(TSDEPS) rm -f ltconfig.T - date=`sed 's%.*\$$''Date: \([0-9 /]*[0-9:]*\) \$$.*% (\1)%;t;d' \ + date=`sed 's%.*\$$''Revision: \([^$$]*\) \$$ \$$''Date: \([^$$]*\) \$$.*% (\1 \2)%;t end;d;: end' \ < $(srcdir)/ChangeLog` && \ $(AWK) '/@LINENO@/ { printf "%d:", NR } { print }' $(srcdir)/ltconfig.in | \ sed -e 's/@''PACKAGE@/@PACKAGE@/' -e 's/@''VERSION@/@VERSION@/' \ @@ -74,7 +74,7 @@ $(srcdir)/ltconfig: $(srcdir)/ltconfig.in $(top_srcdir)/configure.in $(TSDEPS) $(srcdir)/ltmain.sh: $(srcdir)/ltmain.in $(top_srcdir)/configure.in $(TSDEPS) rm -f ltmain.shT - date=`sed 's%.*\$$''Date: \([0-9 /]*[0-9:]*\) \$$.*% (\1)%;t;d' \ + date=`sed 's%.*\$$''Revision: \([^$$]*\) \$$ \$$''Date: \([^$$]*\) \$$.*% (\1 \2)%;t end;d;: end' \ < $(srcdir)/ChangeLog` && \ sed -e 's/@''PACKAGE@/@PACKAGE@/' -e 's/@''VERSION@/@VERSION@/' \ -e "s%@""TIMESTAMP@%$$date%" $(srcdir)/ltmain.in > ltmain.shT diff --git a/configure.in b/configure.in index 5e5238275..e5280c80b 100644 --- a/configure.in +++ b/configure.in @@ -2,32 +2,28 @@ dnl Process this file with autoconf to create configure. AC_INIT(ltmain.in) +AM_INIT_AUTOMAKE(libtool, 1.2e) + # This is a sanity check so we can see which version is used in bug reports. # It is assumed that we only want to see the date extension for cvs libtool # versions (i.e. "odd" letters) and not actual alpha releases. -version=`egrep '^[AM_INIT_AUTOMAKE]' $srcdir/configure.in | \ - sed 's/^.*,//;s/).*$//'` -date= +case "$VERSION" in changequote(,) -case $version in *[acegikmoqsuwy]) - date=`sed 's%.*\$''Date: \([0-9 /]*[0-9:]*\) \$.*% (\1)%;t;d' < \ - $srcdir/ChangeLog` + TIMESTAMP=`sed 's%.*\$''Revision: \([^$]*\) \$ \$''Date: \([^$]*\) \$.*% (\1 \2)%;t end;d;: end' < ${srcdir}/ChangeLog` +changequote([,]) + banner="Configuring $PACKAGE $VERSION$TIMESTAMP" + dashes=`echo "$banner" | sed 's/./-/g'` + + # Display an obvious version banner + echo + echo $dashes + echo "$banner" + echo $dashes + echo ;; esac -changequote([,]) -banner="Configuring libtool-$version$date" -dashes=`echo "$banner" | sed 's/./-/g'` - -# Display an obvious version banner -echo $dashes -echo "$banner" -echo $dashes -echo - -AM_INIT_AUTOMAKE(libtool, 1.2e) -AC_SUBST(pkgdatadir) aclocaldir='${datadir}/aclocal' AC_SUBST(aclocaldir) diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 43b47bbb3..a655cd484 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -981,7 +981,7 @@ lt_dlopen (filename) const char *filename; { lt_dlhandle handle = 0; - char *dir = 0; + char *dir = 0, *name = 0; const char *basename, *ext; const char *saved_error = last_error; @@ -1004,7 +1004,6 @@ lt_dlopen (filename) char *dlname = 0, *old_name = 0; char *libdir = 0, *deplibs = 0; char tmp[LTDL_FILENAME_MAX]; - char *name; FILE *file; int i; /* if we can't find the installed flag, it is probably an @@ -1044,8 +1043,6 @@ lt_dlopen (filename) #endif } if (!file) { - clean_up_name: - free(name); goto clean_up_dir; } while (!feof(file)) { @@ -1086,6 +1083,7 @@ lt_dlopen (filename) last_error = memory_error; goto clean_up_vars; } + handle->usage = 0; if (deplibs && load_deplibs(handle, deplibs)) { clean_up_handle: free(handle); @@ -1110,7 +1108,6 @@ lt_dlopen (filename) dlname, old_name)) goto clean_up_deplibs; } - handle->name = name; clean_up_vars: if (dlname) free(dlname); @@ -1121,7 +1118,7 @@ lt_dlopen (filename) if (deplibs) free(deplibs); if (!handle) - goto clean_up_name; + goto clean_up_dir; } else { /* try to append libtool library extension */ char *newfilename = malloc(strlen(filename)+4); @@ -1142,6 +1139,7 @@ lt_dlopen (filename) last_error = memory_error; goto clean_up_dir; } + handle->usage = 0; if (tryall_dlopen(&handle, filename) && (dir || (find_library(&handle, basename, usr_search_path) @@ -1181,16 +1179,21 @@ lt_dlopen (filename) } #endif } - handle->name = 0; } - handle->usage = 1; - handle->next = handles; - handles = handle; + if (!handle->usage) { + handle->usage = 1; + handle->next = handles; + handles = handle; + handle->name = name; + name = 0; + } restore_error: last_error = saved_error; clean_up_dir: if (dir) free(dir); + if (name) + free(name); return handle; }