]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: Provide absolute paths for dlopen and dlpreopen
authorGreg Eisenhauer <eisen@cc.gatech.edu>
Thu, 31 Jul 2003 20:46:41 +0000 (20:46 +0000)
committerRobert Boehne <rboehne@gnu.org>
Thu, 31 Jul 2003 20:46:41 +0000 (20:46 +0000)
files in generating uninstalled libtool libraries.
* mdemo2/main.c, mdemo2/Makefile.am, mdemo2/README,
mdemo2/configure.ac, mdemo2/.cvsignore, mdemo/mlib.c,
tests/mdemo2-conf.test, tests/mdemo2-exec.test,
tests/mdemo2-make.test: New files for testing above feature.
* configure.ac, bootstrap, tests/Makefile.am: Accomodate new
test directory.
* mdemo/Makefile.am: Build libmlib.la for mdemo2 tests.

ChangeLog
bootstrap
configure.ac
ltmain.in
mdemo/Makefile.am
mdemo2/.cvsignore [new file with mode: 0644]
mdemo2/Makefile.am [new file with mode: 0644]
mdemo2/README [new file with mode: 0644]
mdemo2/configure.ac [new file with mode: 0644]
mdemo2/main.c [new file with mode: 0644]
tests/Makefile.am

index b05fe05c7e456ce7121d6b9e35dcc11caa7d9951..4c1d33ed33f427c85588e6a2a94d26b649b8f779 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2003-07-31  Greg Eisenhauer  <eisen@cc.gatech.edu>
+
+       * ltmain.in: Provide absolute paths for dlopen and dlpreopen
+       files in generating uninstalled libtool libraries.
+       * mdemo2/main.c, mdemo2/Makefile.am, mdemo2/README,
+       mdemo2/configure.ac, mdemo2/.cvsignore, mdemo/mlib.c,
+       tests/mdemo2-conf.test, tests/mdemo2-exec.test,
+       tests/mdemo2-make.test: New files for testing above feature.
+       * configure.ac, bootstrap, tests/Makefile.am: Accomodate new
+       test directory.
+       * mdemo/Makefile.am: Build libmlib.la for mdemo2 tests.
+
 2003-07-30  Tony Wyatt <wyattaw@optushome.com.au>
 
        * libtool.m4: Remove parentheses around finish_eval part which
index c9d9a80dc271a4dc30f75f28ec9f47ba9b2dcc52..304284fc022035c9769cc72e7d7f25d00e10cf5f 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -15,7 +15,7 @@ touch ltmain.sh
 touch libtoolize
 (cd libltdl && touch ltmain.sh)
 
-for sub in . libltdl cdemo demo depdemo mdemo pdemo tagdemo f77demo; do
+for sub in . libltdl cdemo demo depdemo mdemo mdemo2 pdemo tagdemo f77demo; do
   case $sub in
   .) 
     top_srcdir=.
index 1ccfb621afc4818ad99bdca80dda91b0a342e7e7..9385803514ddda476b28e142db8a68baa4a21077 100644 (file)
@@ -74,7 +74,7 @@ AC_CONFIG_SUBDIRS([libltdl])
 
 # all subdirectories that are configured on demand, but that must be
 # included in the distribution
-CONF_SUBDIRS="cdemo pdemo demo depdemo mdemo tagdemo f77demo"
+CONF_SUBDIRS="cdemo pdemo demo depdemo mdemo mdemo2 tagdemo f77demo"
 AC_SUBST([CONF_SUBDIRS])
 
 ACINCLUDE_M4_LIST="${srcdir}/acinclude.m4"
index 7ff31df19ad2d1fa67ad9fc4f3223e3541231b26..5065415c3325430bb61083a81d09597182d97841 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -5111,6 +5111,25 @@ fi\
              newdlprefiles="$newdlprefiles $libdir/$name"
            done
            dlprefiles="$newdlprefiles"
+         else
+           newdlfiles=
+           for lib in $dlfiles; do
+             case $lib in 
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             newdlfiles="$newdlfiles $abs"
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in 
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             newdlprefiles="$newdlprefiles $abs"
+           done
+           dlprefiles="$newdlprefiles"
          fi
          $rm $output
          # place dlname in correct position for cygwin
index 2141e0d2f2bd677fbc1eafecb3f70a96d656e5cd..8136c4351ea30edf2829c32632e1e5f20329fa00 100644 (file)
@@ -6,7 +6,7 @@ INCLUDES = $(INCLTDL)
 
 EXTRA_DIST = acinclude.m4
 
-lib_LTLIBRARIES = libsub.la foo1.la libfoo2.la
+lib_LTLIBRARIES = libsub.la foo1.la libfoo2.la libmlib.la
 
 foo1_la_SOURCES = foo1.c
 foo1_la_LIBADD = $(LIBM) libsub.la
@@ -19,6 +19,11 @@ libfoo2_la_LDFLAGS = -no-undefined -module -export-symbols-regex "libfoo2.*"
 libsub_la_SOURCES = sub.c
 libsub_la_LDFLAGS = -no-undefined
 
+libmlib_la_SOURCES = mlib.c
+libmlib_la_LIBADD = @LIBLTDL@ "-dlopen" foo1.la "-dlopen" libfoo2.la
+libmlib_la_LDFLAGS = -no-undefined
+libmlib_la_DEPENDENCIES = @LIBLTDL@ libsub.la foo1.la libfoo2.la
+
 noinst_HEADERS = foo.h
 
 bin_PROGRAMS = mdemo mdemo_static
diff --git a/mdemo2/.cvsignore b/mdemo2/.cvsignore
new file mode 100644 (file)
index 0000000..b987e2c
--- /dev/null
@@ -0,0 +1,15 @@
+.deps
+.libs
+Makefile
+Makefile.in
+acinclude.m4
+aclocal.m4
+configure
+config.*
+conftest*
+libtool
+*.lo
+*.la
+mdemo2
+mdemo2_static
+mdemo2.static
diff --git a/mdemo2/Makefile.am b/mdemo2/Makefile.am
new file mode 100644 (file)
index 0000000..3329495
--- /dev/null
@@ -0,0 +1,24 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = no-dependencies foreign
+
+INCLUDES = $(INCLTDL)
+
+EXTRA_DIST = acinclude.m4
+
+bin_PROGRAMS = mdemo2 mdemo2_static
+
+# Create a version of mdemo2 that links a library that does dlopen.
+mdemo2_SOURCES = main.c
+mdemo2_LDFLAGS = -export-dynamic
+mdemo2_LDADD = ../mdemo/libmlib.la
+
+# Create a statically linked version of mdemo.
+mdemo2_static_SOURCES = $(mdemo2_SOURCES)
+mdemo2_static_LDFLAGS = $(STATIC) $(mdemo2_LDFLAGS)
+mdemo2_static_LDADD = $(mdemo2_LDADD)
+mdemo2_static_DEPENDENCIES = $(mdemo2_DEPENDENCIES)
+
+$(OBJECTS): libtool
+libtool: $(LIBTOOL_DEPS)
+       $(SHELL) ./config.status --recheck
diff --git a/mdemo2/README b/mdemo2/README
new file mode 100644 (file)
index 0000000..8a1e18b
--- /dev/null
@@ -0,0 +1,5 @@
+This is mdemo2, an example package that attempts to use GNU libtool to
+link with a library that itself does dlopening of libtool modules.
+
+This demo depends upon the libraries generated in ../mdemo.
+
diff --git a/mdemo2/configure.ac b/mdemo2/configure.ac
new file mode 100644 (file)
index 0000000..9f7b3fd
--- /dev/null
@@ -0,0 +1,70 @@
+## Process this file with autoconf to create configure. -*- autoconf -*-
+# Copyright 2001  Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307  USA
+
+AC_PREREQ(2.50)
+
+
+## ------------------------ ##
+## Autoconf initialisation. ##
+## ------------------------ ##
+AC_INIT([mdemo2], [0.1], [bug-libtool@gnu.org])
+AC_CONFIG_SRCDIR([main.c])
+
+
+## ------------------------ ##
+## Automake Initialisation. ##
+## ------------------------ ##
+AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
+
+
+## ------------------ ##
+## C compiler checks. ##
+## ------------------ ##
+AC_PROG_CC
+AC_C_CONST
+
+
+## ----------------------- ##
+## Libtool initialisation. ##
+## ----------------------- ##
+AM_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+
+if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
+  STATIC=-static
+else
+  STATIC=
+fi
+AC_SUBST([STATIC])
+
+
+## ---------------------------- ##
+## C headers required by mdemo2. ##
+## ---------------------------- ##
+
+
+## ---------------------------- ##
+## Libraries required by cdemo. ##
+## ---------------------------- ##
+
+
+## -------- ##
+## Outputs. ##
+## -------- ##
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/mdemo2/main.c b/mdemo2/main.c
new file mode 100644 (file)
index 0000000..b6bd75a
--- /dev/null
@@ -0,0 +1,39 @@
+/* main.c -- mdemo2 test program
+   Copyright (C) 2003 Free Software Foundation, Inc.
+   Originally by Greg Eisenhauer < eisen at cc.gatech.edu >
+   This file is part of GNU Libtool.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+USA. */
+
+#include <stdio.h>
+
+int
+main (argc, argv)
+  int argc;
+  char **argv;
+{
+  int ret = 0;
+
+  printf ("Welcome to GNU libtool mdemo2!\n");
+
+  if (argc < 2) {
+    fprintf (stderr, "usage: %s module [module...]\n", argv[0]);
+  }
+
+  ret = mlib_func(argc, argv);
+
+  return ret;
+}
index 51a3a8c772a3979a79d1d01fbe5a3fbf5378499a..ab3c34bfdc272f6755f24c77c9ec2fc4594b6273 100644 (file)
@@ -43,7 +43,10 @@ COMMON_TESTS = \
        mdemo-inst.test mdemo-unst.test \
        assign.test link.test link-2.test nomode.test \
        quote.test sh.test suffix.test pdemo-conf.test \
-       pdemo-make.test pdemo-exec.test pdemo-inst.test
+       pdemo-make.test pdemo-exec.test pdemo-inst.test \
+       mdemo-conf.test mdemo-make.test mdemo2-conf.test \
+       mdemo2-make.test mdemo2-exec.test
+
 
 if HAVE_CXX
 if HAVE_F77