From: Ossama Othman Date: Mon, 28 Feb 2000 17:51:35 +0000 (+0000) Subject: * ltmain.in (libobjs, reload_conv_objs): When searching for object X-Git-Tag: multi-language-merge-point~236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e91693e3aedfa18e5e20a55f2e9229f29af469a;p=thirdparty%2Flibtool.git * ltmain.in (libobjs, reload_conv_objs): When searching for object files, search for "*.$objext," not "*.o." (compile_command, finalize_command, progfiles): No need to transform `.lo' objects into standard `.o' objects. `.lo' files are converted to the appropriate `.o' file earlier in the link mode code. * doc/libtool.texi (AC_LIBTOOL_CXX): Documented this macro, and the `tagdemo' test that utilizes it. Updated C++ and tagged configuration documentation. --- diff --git a/ChangeLog b/ChangeLog index 67541c079..81e641400 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2000-02-28 Ossama Othman + + * ltmain.in (libobjs, reload_conv_objs): When searching for object + files, search for "*.$objext," not "*.o." + (compile_command, finalize_command, progfiles): No need to + transform `.lo' objects into standard `.o' objects. `.lo' files + are converted to the appropriate `.o' file earlier in the link + mode code. + * doc/libtool.texi (AC_LIBTOOL_CXX): Documented this + macro, and the `tagdemo' test that utilizes it. Updated C++ and + tagged configuration documentation. + 2000-02-25 Ossama Othman * libtool.m4, ltconfig.in: Merged in changes from most recent HEAD diff --git a/doc/libtool.texi b/doc/libtool.texi index 549883afe..23b3657c8 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1861,6 +1861,14 @@ on @file{libtool}. @end defmac +@defmac AC_LIBTOOL_CXX +Enable C++ shared library support. This macro should be used if libtool +will be used to generate C++ shared libraries. It causes a C++-specific +configuration to be appended to the @file{libtool} script. The C++ +support can coexist with other configurations, including the default C +shared library configuration. +@end defmac + @defmac AC_LIBTOOL_DLOPEN Enable checking for dlopen support. This macro should be used if the package makes use of the @samp{-dlopen} and @samp{-dlpreopen} flags, @@ -3526,7 +3534,7 @@ A potential problem may occur if you use variables when setting the following: @example -$ @kbd{CC=$CXX LTCC=$CC ./ltconfig -o libtool --add-tag=CXX ltcf-cxx.sh} +$ @kbd{LTCC=$CC CC=$CXX ./ltconfig -o libtool --add-tag=CXX ltcf-cxx.sh} @end example In this example, @var{CC} is set to the C++ compiler and LTCC is set to @@ -3535,6 +3543,17 @@ set to the C++ compiler @var{$CXX}, which causes LTCC to be set to the C++ compiler @var{$CXX}, too. This is a problem because LTCC must be a valid C compiler, not a C++ compiler for example. +If @samp{ltconfig} is unable to determine the host type then you must +explicitly provide a host when invoking @samp{ltconfig}. This is +typically necessary for new very platforms and many cross-compiled +platforms. For example, assuming that your host is @samp{i386-nto} then +@samp{ltconfig} could be invoked as follows: + +@example +$ @kbd{LTCC=$CC CC=$CXX ./ltconfig -o libtool \} +> @kbd{--add-tag=CXX ltcf-cxx.sh i386-nto} +@end example + After a configuration tag has been added using the @samp{--add-tag} option, whenever you want to compile or link a library using @samp{c++}, you should run: @@ -3561,6 +3580,10 @@ Only the two pre-defined tags, @samp{disable-shared} and @samp{disable-static}, override a single variable, and can be used cumulatively, after other tags. +@emph{NOTE}: C++ support may be automatically added to your package by +adding the @code{AC_LIBTOOL_CXX} macro to your package +@file{configure.in} file. + @node C++ libraries @section Writing libraries for C++ @c FIXME: in the TOC, the ++ is too large (seems to be math mode) @@ -3568,6 +3591,11 @@ cumulatively, after other tags. @cindex pitfalls using C++ @cindex C++, pitfalls +@emph{NOTE}: The problems described in this section may no longer +relevant due to the @samp{libtool} multi-language support. To enable +C++ support in libtool, use the @code{AC_LIBTOOL_CXX} macro in your +@file{configure.in} file. + Creating libraries of C++ code should be a fairly straightforward process, because its object files differ from C ones in only three ways: @@ -3807,6 +3835,33 @@ static and shared libraries, @file{mdemo-static.test} builds only static libraries (@samp{--disable-shared}), and @file{mdemo-shared.test} builds only shared libraries (@samp{--disable-static}). +@item tagdemo-conf.test +@itemx tagdemo-exec.test +@itemx tagdemo-make.test +@itemx tagdemo-static.test +@itemx tagdemo-shared.test +@pindex tagdemo-conf.test +@pindex tagdemo-exec.test +@pindex tagdemo-make.test +@pindex tagdemo-static.test +@pindex tagdemo-shared.test +These programs check to see that the @file{tagdemo} subdirectory of the +libtool distribution can be configured and built correctly. + +The @file{tagdemo} subdirectory contains a demonstration of a package +that uses libtool and its tagged configuration support +(@pxref{Configuration tags}) build a C++ library. C++ shared library +support is enabled by using the @code{AC_LIBTOOL_CXX} macro in +@file{tagdemo/configure.in}. + +The tests @file{tagdemo-make.test}, and @file{tagdemo-exec.test}, are +executed three times, under three different libtool configurations: +@file{tagdemo-conf.test} configures @file{tagdemo/libtool} to build both +static and shared libraries, @file{tagdemo-static.test} builds only +static libraries (@samp{--disable-shared}), and +@file{tagdemo-shared.test} builds only shared libraries +(@samp{--disable-static}). + @item dryrun.test @pindex dryrun.test This test checks whether libtool's @code{--dry-run} mode works properly. diff --git a/ltmain.in b/ltmain.in index 2cc3a4665..fb64a2037 100644 --- a/ltmain.in +++ b/ltmain.in @@ -2852,7 +2852,7 @@ EOF $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi @@ -2991,7 +2991,7 @@ EOF $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi @@ -3179,12 +3179,6 @@ EOF fi finalize_rpath="$rpath" - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then @@ -3227,7 +3221,7 @@ extern \"C\" { test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + progfiles="$objs$old_deplibs" for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"