1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>
Autoconf Macro: ac_cxx_template_objs
</title>
<link rel="stylesheet" type="text/css" href="ac-archive.css">
</head>
<body>
<table summary="web navigation" style="width:100%;">
<tbody>
<tr>
<td style="width:50%;" align="center">
<a href=
"http://autoconf-archive.cryp.to/ac_cxx_template_objs.m4">Download M4
Source</a>
</td>
<td style="width:50%;" align="center">
<a href="macros-by-category.html">Macro Index Page</a>
</td>
</tr>
</tbody>
</table>
<hr>
<h1>
ac_cxx_template_objs
</h1>
<h2>
Obsolete Macro
</h2>
<p class="indent">
Unnecessary with recent versions of libtool.
</p>
<h2>
Synopsis
</h2>
<p class="indent" style="white-space:nowrap;">
<code>AC_CXX_TEMPLATE_OBJS</code>
</p>
<h2>
Description
</h2>
<div class="indent">
<p>
NOTE: AC_CXX_TEMPLATE_OBJS macro is not needed anymore, recent versions of
libtool handle correctly these extra object files by recognizing the SUN
compiler "CC" and using it with the "-xar" switch to pack libraries instead
of using the more classical "ar" command. Using recent libtool with the SUN
compiler AND this macro does not work at all.
</p>
<p>
This macro tries to find the place where the objects files resulting from
templates instantiations are stored and the associated compiler flags. This
is particularly useful to include these files in libraries. Currently only
g++/egcs and SUN CC are supported (there is nothing to be done for the
formers while the latter uses directory ./Templates.DB if you use the -ptr.
flag). This macro sets the CXXFLAGS if needed, it also sets the output
variable TEMPLATES_OBJ. Note that if you use libtool, this macro does work
correctly with the SUN compilers ONLY while building static libraries.
Since there are sometimes problems with exception handling with multiple
levels of shared libraries even with g++ on this platform, you may wish to
enforce the usage of static libraires there. You can do this by putting the
following statements in your configure.in file:
</p>
<pre>
AC_CANONICAL_HOST
case x$host_os in
xsolaris*) AC_DISABLE_SHARED ;;
esac
AM_PROG_LIBTOOL
</pre>
</div>
<h2>
Author
</h2>
<p class="indent">
Luc Maisonobe <luc@spaceroots.org>
</p>
<h2>
Last Modified
</h2>
<p class="indent">
2005-01-25
</p>
<h2>
M4 Source Code
</h2>
<div class="indent">
<pre class="m4source">
AC_DEFUN([AC_CXX_TEMPLATE_OBJS],
dnl
dnl This macro is OBSOLETE; do not use.
dnl
[AC_CACHE_CHECK(where template objects are stored, ac_cv_cxx_templobjs,
[ ac_cv_cxx_templobjs='unknown'
if test "$GXX" = yes; then
ac_cv_cxx_templobjs='nowhere'
else
case $CXX in
CC|*/CC)
cat > conftest.cc <<EOF
template<class T> class A { public : A () {} };
template<class T> void f (const A<T>&) {}
main()
{ A<double> d;
A<int> i;
f (d);
f (i);
return 0;
}
EOF
if test "$ac_cv_cxx_templobjs" = 'unknown' ; then
if test -d Templates.DB ; then
rm -fr Templates.DB
fi
if $CXX $CXXFLAGS -ptr. -c conftest.cc 1> /dev/null 2>&1; then
if test -d Templates.DB ; then
# this should be Sun CC <= 4.2
CXXFLAGS="$CXXFLAGS -ptr."
if test x"$LIBTOOL" = x ; then
ac_cv_cxx_templobjs='Templates.DB/*.o'
else
ac_cv_cxx_templobjs='Templates.DB/*.lo'
fi
rm -fr Templates.DB
fi
fi
fi
if test "$ac_cv_cxx_templobjs" = 'unknown' ; then
if test -d SunWS_cache ; then
rm -fr SunWS_cache
fi
if $CXX $CXXFLAGS -c conftest.cc 1> /dev/null 2>&1; then
if test -d SunWS_cache ; then
# this should be Sun WorkShop C++ compiler 5.x
# or Sun Forte C++ compiler >= 6.x
if test x"$LIBTOOL" = x ; then
ac_cv_cxx_templobjs='SunWS_cache/*/*.o'
else
ac_cv_cxx_templobjs='SunWS_cache/*/*.lo'
fi
rm -fr SunWS_cache
fi
fi
fi
rm -f conftest* ;;
esac
fi
case "x$ac_cv_cxx_templobjs" in
xunknown|xnowhere)
TEMPLATE_OBJS="" ;;
*)
TEMPLATE_OBJS="$ac_cv_cxx_templobjs" ;;
esac
AC_SUBST(TEMPLATE_OBJS)])])
</pre>
</div>
</body>
</html>
|