[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: library used but `LIBTOOL' not defined in `configure.in
From: |
Brian May |
Subject: |
Re: library used but `LIBTOOL' not defined in `configure.in |
Date: |
20 Aug 2001 10:34:23 +1000 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (GTK) |
>>>>> "Allen" == Allen Wayne Best <address@hidden> writes:
Allen> -------------- start configure.in --------------------
Allen> dnl Process this file with autoconf to produce a configure script.
Allen> AC_INIT(acconfig.h)
Allen> AC_CONFIG_AUX_DIR(config)
Hello,
Some of this code, too me looks real strange, but perhaps that is just
differences in coding style?
So, don't take my opinion as an authoritative source, but I will
highlight things which I consider a bit odd.
Somebody else can reply, and tell both of use if I am right/wrong
<grin>, and fill in any missing details.
Allen> dnl Initialize automake stuff
Allen> SYS_MAJOR_VERSION=0
Allen> SYS_MINOR_VERSION=0
Allen> SYS_MICRO_VERSION=0
Allen> SYS_INTERFACE_AGE=0
Allen> SYS_BINARY_AGE=0
Allen> SYS_VERSION=$SYS_MAJOR_VERSION.$SYS_MINOR_VERSION.$SYS_MICRO_VERSION
Allen> dnl libtool versioning
Allen> LT_RELEASE=$SYS_MAJOR_VERSION.$SYS_MINOR_VERSION
Allen> LT_CURRENT=`expr $SYS_MICRO_VERSION - $SYS_INTERFACE_AGE`
Allen> LT_REVISION=$SYS_INTERFACE_AGE
Allen> LT_AGE=`expr $SYS_BINARY_AGE - $SYS_INTERFACE_AGE`
Normally, I would put the library versions (minus the complex
arithmetic) in Makefile.am, not configure.in. I guess though, that
there might be good reasons for either way.
Later: Only here, it seems to be that you are trying to create a link
between package version and release version. That doesn't look good to
me, read the libtool documentation on version numbers.
Allen> PACKAGE=system
Allen> VERSION=$SYS_VERSION
Allen> AM_CONFIG_HEADER(config.h)
Allen> AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
Looks fine (apart from potential problem with VERSION, which I have
already mentioned).
I am not sure what the no-define does, I guess it must be something
good though whatever it is <grin>.
Allen> for top_builddir in . .. ../.. $ac_auxdir $ac_auxdir/..; do
Allen> test -f $top_builddir/configure && break
Allen> done
This seems weird. What does it do? Why is it even required? To me, it
would seem much more straight forward just to use the
AC_CONFIG_SUBDIRS(...) macro (assuming the two are even related).
Allen> dnl Checks for programs.
Allen> AC_PROG_CXX
Allen> AC_PROG_AWK
Allen> AC_PROG_CC
Allen> AC_PROG_INSTALL
Allen> AC_PROG_LN_S
Allen> AC_PROG_MAKE_SET
Allen> AC_PROG_LIBTOOL
Looks fine.
Allen> AC_SUBST(LIBTOOL_DEPS)
Allen> if ./libtool --features | grep '^enable static libraries$' >
/dev/null 2>&1 ;
Allen> then
Allen> STATIC=-static
Allen> else
Allen> STATIC=
Allen> fi
Allen> AC_SUBST(STATIC)
Allen> AC_CHECK_LIBM
Allen> AC_SUBST(LIBM)
Looks weird. I don't see what this does, or why it is
required. Libtool should automatically disable shared libraries if
shared libraries are not supported.
Allen> LIBSOURCES="foo.c bar.c"
Allen> LTLDFLAGS="-shared -release $SYSVERSION"
Allen> AC_MSG_RESULT([$LIBSOURCES])
Allen> AC_SUBST(LTLDFLAGS)
Allen> AC_SUBST(LIBSOURCES)
Allen> LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/.lo/g'`
Allen> AC_SUBST(LTLIBOBJS)
Allen> LTALLOCA=`echo "$ALLOCA" | sed 's/\.o/.lo/g'`
Allen> AC_SUBST(LTALLOCA)
I might be wrong, but all of this looks a bit funny to me.
Allen> SUBDIRS = "lib src po intl lib"
Allen> AC_SUBST(SUBDIRS)
Looks fine.
Allen> AC_OUTPUT(po/Makefile doc/Makefile intl/Makefile doc/C/Makefile
Makefile
Allen> doc/es/Makefile lib/Makefile src/Makefile pixmaps/Makefile)
Looks fine.
Allen> ------------------ end of configure.in---------------
Allen> the lib/Makefile.am is as follows:
Allen> -------------- start makefile.am ------------
Allen> ## lib/Makefile.am - process this file with automake
Allen> EXTRA_DIST = acinclude.m4
Allen> INCLUDES = -I$(top_builddir) -I$(top_srcdir)
Allen> lib_LTLIBRARIES = libsyspci.la
Allen> libsyspci_la_SOURCES = @LIBSOURCES@
Allen> libsyspci_la_LIBADD = $(LIBM)
Allen> libsyspci_la_LDFLAGS = @LTLDFLAGS@
If this was my code, I would put something like this here (instead of
code in configure.in):
libsyspci_la_LDFLAGS = -version-info 0:0:0
(but replace the version with your own)
I have a vague feeling that _SOURCES cannot be substituted like you
are trying to do here, too. They have to be hard-coded. Any optional
sources should be moved (to _LIBADD???). However, it is possible this
requirement has changed since I last did it (years ago).
Allen> ------------ end makefile.am -------------
of course, none of this exactly helps with your original problem, but
myself, I would fix these issues up first, then worry about that next.
--
Brian May <address@hidden>