Dear all
I have now been able to build c++ library on a alphaev6-dec-osf5.0
with templates using cxx
I had to specify in aclocal.m4 instead of
>old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
<case "$host_os" in
<osf*)
< if test "X${CXX}" = Xcxx ; then
< old_archive_cmds='$AR $AR_FLAGS $oldlib ${libname}/*.o$oldobjs$old_deplibs'
< else
< old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
< fi
< ;;
<*)
< old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
<esac
where ${libname} is the directory containing the templates instantiations
for the library. In order to put the templates instantiations in this
directory I have done the following in Makefile.am
lib_LTLIBRARIES = libmudfas3d.la libmudfas2d.la libutilities.la
if COMPILER_IS_COMPAQ_CXX
TEMPLATES2D_CXX = -ptr libmudfas2d
TEMPLATES3D_CXX = -ptr libmudfas3d
TEMPLATESUTIL_CXX = -ptr libutilities
endif
## 3-dimensions library
libmudfas3d_la_SOURCES = $(MUDSRC)
libmudfas3d_la_CXXFLAGS = -DDIM=3 $(TEMPLATES3D_CXX)
libmudfas3d_la_LDFLAGS = -version-info 0:0:0
## 2-dimensions library
libmudfas2d_la_SOURCES = $(MUDSRC)
libmudfas2d_la_CXXFLAGS = -DDIM=2 $(TEMPLATES2D_CXX)
libmudfas2d_la_LDFLAGS = -version-info 0:0:0
## utility library
libutilities_la_SOURCES = $(UTILSRC)
libutilities_la_CXXFLAGS = $(TEMPLATESUTIL_CXX)
libutilities_la_LDFLAGS = -version-info 0:0:0
## Clean up template repositories
clean-local:
-rm -rf libmudfas3d libmudfas2d libutilities ti_files
That's not all!In libtool I had to manually comment or change the
following
line 728
********
# Delete any leftover library objects.
if test "$build_old_libs" = yes; then
removelist="$obj $libobj"
else
removelist="$libobj"
fi
replaced by
# Delete any leftover library objects.
if test "$build_old_libs" = yes; then
removelist="$libobj" # HERE IS THE CHANGE
else
removelist="$libobj"
fi
line 833
# $run $rm "$output_obj" COMMENTED
line 926
# Suppress compiler output if we already did a PIC compilation.
command="$command$suppress_output"
# $run $rm "$output_obj" COMMENTED
The reason is that the object .o was deleted but never created again since
cxx -M just output the dependencies but does *not* create any object .o
even though one gives the option -c -o <object>
Note that by giving the option -MD one create a file with dependencies
(same style) called <sourcename>.o.d and the code is compiled!
Do you think it could be possible to insert this in the libtool?
Maybe automake/depcomp has to be modified to be able to use the option -MD
with the cxx compaq compiler for osf machines?
Sincerely
Patrick Guio
======================================================================
Patrick Guio
Institute of Physics, University of Oslo
P.O. box 1048, Blindern, N-0316 Oslo
Tel : (+47) 22 84 40 60 - Fax : (+47) 22 85 56 71
E-mail : [EMAIL PROTECTED]
URL : http://www.fys.uio.no