![]() |
Blitz Support : |
From: Frank Schimmel (schimmel_at_[hidden])
Date: 2003-09-10 11:20:47
Hey Julian! Hello world!
Sorry the answer took so long, but I was out of town for a few days
and didn't read any mail...
>>>>> Julian C Cummings writes:
> Frank, do you have enough automake/autoconf expertise to take a
> swing at excising the libtool support from the present Blitz make
> system? I know that I don't. I would be happy if someone from the
> community could work out the necessary changes for the entire Blitz
> package and submit them.
I had a look at it. It seems to me that there has been quite a bit of
hackery necessary(?) to get blitz going on various platforms. Also for
just building a static lib.
In particular, for some arguments to the --with-cxx option the AR (for
building an archive) and RANLIB (for generating an archive index)
variables are set manually in configure.in:
* For the patterns `KCC*' (but not `KCCdev') and `SGI*' (but not
`SGI32*' and `SGI64*') AR is set to "\$(CXX)".
* For `SGI*', `SGI32*', `SGI64*', `DECcxx6.2' and `DECcxx6.3' RANLIB
is set to "ar ts"
Additionally, the (non-standard) variable AR_FLAGS (should be
ARFLAGS?) is used to set flags for $(AR). This is not only set for
various compilers (KCC*, SGI*, DECcxx6.2, DECcxx6.3) but also for
different target plattforms (*aix* and *irix* and then, again,
depending on the compiler).
There were also calls to the ac macros `AC_CHECK_TOOL(AR, ar)' and
`AC_PROG_RANLIB' around. Both commented out.
What a mess.
Relying on all of the above magic being correct, the key to
de-libtoolising is to roll back the changes show here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/blitz/blitz/configure.in.diff?r1=1.25&r2=1.26
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/blitz/blitz/lib/Makefile.am.diff?r1=1.8&r2=1.9
I'd also suggest to rename AR_FLAGS to ARFLAGS, which is what make
uses normally (only that automake seems to force the flags cru to ar
so that libblitz_a_AR has to be set by hand in the Makefile.am.)
The patch is included below.
Some more things to consider:
Disabling building the shared libs by default does not fix the
original problem. You still require libtool and if it's installed in
some funny way aclocal will not find `libtool.m4'.
OTOH the libtool info docs say in node `AC_PROG_LIBTOOL':
Nevertheless, it is advisable to include a copy of `libtool.m4' in
`acinclude.m4', so that, even if `aclocal.m4' and `configure' are
rebuilt for any reason, the appropriate libtool macros will be used.
Now *that* would fix the aclocal problem for good. (Except that you
have to remember to update aclocal.m4 by hand to match the version of
ltmain.sh in case of a libtool update...)
But in node `C++ libraries' (below `Other Languages') it discusses the
issues Julian also mentioned and comes to the conclusion
that libtool is not ready for general use for C++ libraries.
I don't know about everyone else around here, but I personally don't
feel like *always* living on the bleeding edge...
Now that was a lengthy post...
-Frank
--- configure.in.~1.29.~ 2003-06-26 04:27:25.000000000 +0200
+++ configure.in 2003-09-10 17:43:58.938523000 +0200
@@ -39,12 +39,12 @@
AC_SUBST(FORTLIBS)
AC_SUBST(BLASLIB)
AC_SUBST(AR)
-AC_SUBST(AR_FLAGS)
+AC_SUBST(ARFLAGS)
AC_SUBST(RANLIB)
AC_SUBST(CXXF90FLAG)
# Set default values
-AR_FLAGS="-cru"
+ARFLAGS="-cru"
# Process command-line arguments for configure
@@ -79,7 +79,7 @@
CXX_OPTIMIZE_FLAGS="+K3 -O3"
CXX_DEBUG_FLAGS="-g +K0 -DBZ_DEBUG"
AR="\$(CXX)"
- AR_FLAGS="-o"
+ ARFLAGS="-o"
;;
SGI64*) # SGI C++ http://www.sgi.com
echo "Configuring for SGI C++ (64 bit abi)"
@@ -108,8 +108,8 @@
CXX_OPTIMIZE_FLAGS="-Ofast"
CXX_DEBUG_FLAGS="-g -DBZ_DEBUG"
AR="\$(CXX)"
- AR_FLAGS="-ar -o"
- LDFLAGS="-lCio"
+ ARFLAGS="-ar -o"
+ LDFLAGS="-lCio"
RANLIB="ar ts"
;;
FCC*)
@@ -125,7 +125,7 @@
AC_BZ_SET_COMPILER($withval,"cxx","-DBZ_ENABLE_XOPEN_SOURCE -std strict_ansi")
CXX_OPTIMIZE_FLAGS="-O4 -tune host"
CXX_DEBUG_FLAGS="-g -msg_display_tag -DBZ_DEBUG"
- AR_FLAGS="-rv"
+ ARFLAGS="-rv"
RANLIB="ar ts"
;;
DECcxx6.3) # DEC C++ http://www.digital.com/
@@ -134,7 +134,7 @@
AC_BZ_SET_COMPILER($withval,"cxx","-DBZ_ENABLE_XOPEN_SOURCE -std strict_ansi -nopure_cname")
CXX_OPTIMIZE_FLAGS="-O4 -tune host"
CXX_DEBUG_FLAGS="-g -msg_display_tag -DBZ_DEBUG"
- AR_FLAGS="-rv"
+ ARFLAGS="-rv"
RANLIB="ar ts"
;;
cray*) # Cray C++
@@ -242,11 +242,11 @@
case "$CXX" in
xlC)
CXXFLAGS="-q64 $CXXFLAGS"
- AR_FLAGS="-cruX64"
+ ARFLAGS="-cruX64"
;;
KCC)
CXXFLAGS="-q64 $CXXFLAGS"
- AR_FLAGS="-q64 -o"
+ ARFLAGS="-q64 -o"
;;
gcc)
CXXFLAGS="-maix64 $CXXFLAGS"
@@ -275,11 +275,11 @@
CC)
CXXFLAGS="-64 $CXXFLAGS"
LDFLAGS="-64 $LDFLAGS"
- AR_FLAGS="-64 -ar -o"
+ ARFLAGS="-64 -ar -o"
;;
KCC)
CXXFLAGS="-64 $CXXFLAGS"
- AR_FLAGS="-64 -o"
+ ARFLAGS="-64 -o"
;;
gcc)
CXXFLAGS="-mabi=64 $CXXFLAGS"
@@ -389,14 +389,13 @@
echo ""
# Check tools
-#AC_CHECK_TOOL(AR, ar)
-#AC_PROG_RANLIB
+AC_CHECK_TOOL(AR, ar)
+AC_PROG_RANLIB
# Disable shared library building
#AM_DISABLE_SHARED
# Libtool stuff check
-
-AC_PROG_LIBTOOL
+#AC_PROG_LIBTOOL
AC_LANG([C++])
AC_PROG_CXX
--- lib/Makefile.am.~1.9.~ 2003-03-31 13:53:10.000000000 +0200
+++ lib/Makefile.am 2003-09-10 17:34:50.233545000 +0200
@@ -6,12 +6,14 @@
INCLUDES = -I$(top_srcdir) -I$(top_builddir)
-#lib_LIBRARIES = libblitz.a
-#libblitz_a_SOURCES = $(top_srcdir)/src/globals.cpp
-#libblitz_a_AR = $(AR) $(AR_FLAGS)
+lib_LIBRARIES = libblitz.a
+libblitz_a_SOURCES = $(top_srcdir)/src/globals.cpp
+# setting `libblitz_a_AR' like this by hand is necessary for the
+# ARFLAGS set by configure to take effect (automake always uses cru).
+libblitz_a_AR = $(AR) $(ARFLAGS)
-lib_LTLIBRARIES = libblitz.la
-libblitz_la_SOURCES = $(top_srcdir)/src/globals.cpp
+#lib_LTLIBRARIES = libblitz.la
+#libblitz_la_SOURCES = $(top_srcdir)/src/globals.cpp
clean-local: