2004-03-24 Albert Chin-A-Young <china@thewrittenword.com>
+ * libtool.m4: When linking convenience libraries on Solaris
+ with the Sun C++ compiler, pass convenience libraries through
+ to the linker with -Qoption between allextract/defaultextract.
+ The Sun C++ compiler bundles -Qoption arguments so
+ convenience libraries are linked with defaultextract
+ otherwise.
+ * tagdemo/Makefile.am, tagdemo/main.cpp, tagdemo/conv.h,
+ tagdemo/conv.cpp: Augment tagdemo test to link a convenience
+ library with a libtool library.
+
* ltmain.in: Piecewise linking doesn't work when the output
file is an absolute path, use the basename only instead.
*)
# The C++ compiler is used as linker so we must use $wl
# flag to pass the commands to the underlying system
- # linker.
+ # linker. We must also pass each convience library through
+ # to the system linker between allextract/defaultextract.
+ # The C++ compiler will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
;;
esac
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
AUTOMAKE_OPTIONS = no-dependencies foreign
ACLOCAL_AMFLAGS = -I ../../m4
-noinst_LTLIBRARIES = libfoo.la
-lib_LTLIBRARIES = libbaz.la
+noinst_LTLIBRARIES = libconv.la
+lib_LTLIBRARIES = libfoo.la libbaz.la
libfoo_la_SOURCES = foo.cpp
libfoo_la_LDFLAGS = -no-undefined
-libfoo_la_LIBADD = $(LIBM)
+libfoo_la_LIBADD = libconv.la $(LIBM)
# Test some of the ILD support when using tagged configurations.
libbaz_la_SOURCES = baz.cpp
libbaz_la_LDFLAGS = -no-undefined
libbaz_la_LIBADD = libfoo.la
-noinst_HEADERS = foo.h baz.h
+# Test convenience libraries.
+libconv_la_SOURCES = conv.cpp
+libconv_la_LDFLAGS = -no-undefined
+
+noinst_HEADERS = foo.h baz.h conv.h
bin_PROGRAMS = tagdemo
--- /dev/null
+// -*- C++ -*-
+// conv.cpp -- trivial convenience test library
+// Copyright (C) 1998-2000 Free Software Foundation, Inc.
+// Originally by Thomas Tanner <tanner@ffii.org>
+// 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 "conv.h"
+
+// Our C functions.
+int
+convenience(void)
+{
+ return 1;
+}
--- /dev/null
+// -*- C++ -*-
+// conv.h -- part of the interface to the libfoo* libraries
+// Copyright (C) 1998-1999 Free Software Foundation, Inc.
+// Originally by Thomas Tanner <tanner@ffii.org>
+// 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.
+
+// Only include this header file once.
+#ifndef _CONV_H_
+#define _CONV_H_ 1
+
+// Our C test functions.
+extern "C"
+{
+ int convenience(void);
+}
+
+#endif /* !_CONV_H_ */
#include "foo.h"
#include "baz.h"
+#include "conv.h"
#include <iostream.h>
if (bb->baz() == FOO_RET)
cout << "barbaz::baz is ok!" << endl;
+ // --------------
+
+ if (convenience())
+ cout << "convenience is ok!" << endl;
+
return 0;
}