In order to compile flac-1.0 with Compaq C on FreeBSD/alpha, I needed to move -lm to the end of the libraries, otherwise ccc would complain about unresolved symbols. Patches below. The result is nothing less than stunning. On my 21164A/500 box, "ccc -fast" code is almost twice as fast as "gcc -O -mcpu=ev56", 1:11 vs. 2:03 for encoding a test track with default parameters. This may also be due to the Compaq math library. --- src/flac/Makefile.am.orig Tue Aug 28 15:58:11 2001 +++ src/flac/Makefile.am Tue Aug 28 15:58:19 2001 @@ -29,5 +29,4 @@ encode.h \ file.h -flac_LDFLAGS = -lm -flac_LDADD = $(top_builddir)/src/libFLAC/libFLAC.la +flac_LDADD = $(top_builddir)/src/libFLAC/libFLAC.la -lm --- src/test_streams/Makefile.am.orig Tue Aug 28 16:00:17 2001 +++ src/test_streams/Makefile.am Tue Aug 28 16:00:28 2001 @@ -20,6 +20,6 @@ noinst_PROGRAMS = test_streams test_streams_SOURCES = \ main.c -test_streams_LDFLAGS = -lm +test_streams_LDADD = -lm CLEANFILES = $(wildcard *.raw) --- src/test_unit/Makefile.am.orig Tue Aug 28 16:21:54 2001 +++ src/test_unit/Makefile.am Tue Aug 28 16:22:05 2001 @@ -19,8 +19,7 @@ INCLUDES = -I$(top_srcdir)/src/libFLAC/include noinst_PROGRAMS = test_unit -test_unit_LDFLAGS = -lm -test_unit_LDADD = $(top_builddir)/src/libFLAC/libFLAC.la +test_unit_LDADD = $(top_builddir)/src/libFLAC/libFLAC.la -lm test_unit_SOURCES = \ bitbuffer.c \ main.c \ -- Christian "naddy" Weisgerber naddy@mips.inka.de
--- Christian Weisgerber <naddy@mips.inka.de> wrote:> In order to compile flac-1.0 with Compaq C on FreeBSD/alpha, I > needed to move -lm to the end of the libraries, otherwise ccc would > complain about unresolved symbols. Patches below. > >... > > --- src/flac/Makefile.am.orig Tue Aug 28 15:58:11 2001 > +++ src/flac/Makefile.am Tue Aug 28 15:58:19 2001 > @@ -29,5 +29,4 @@ > encode.h \ > file.h > > -flac_LDFLAGS = -lm > -flac_LDADD = $(top_builddir)/src/libFLAC/libFLAC.la > +flac_LDADD = $(top_builddir)/src/libFLAC/libFLAC.la -lm[etc] let me lateral to Matt, not being a proficient libtool guy... is it OK to put the -lm in using _LDADD? I have this vague memory of having to do this some other way for some reason. Josh __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com
On Wed, Oct 31, 2001 at 08:40:42PM -0800, Josh Coalson wrote:> let me lateral to Matt, not being a proficient libtool guy... is it OK > to put the -lm in using _LDADD? I have this vague memory of having to > do this some other way for some reason.It looks like LDADD is the right place for it, though the double negative is a prone to misinterpretation: `maude_LDADD' Extra objects can be added to a shared library or a program by listing them in the `_LDADD' variable. This should be used for objects determined by `configure'. `_LDADD' is inappropriate for passing program-specific linker flags (except for `-l', `-L', `-dlopen' and `-dlpreopen'). Use the `_LDFLAGS' variable for this purpose. For instance, if your `configure.in' uses `AC_PATH_XTRA', you could link your program against the X libraries like so: maude_LDADD = $(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIBS) `maude_LDFLAGS' This variable is used to pass extra flags to the link step of a program or a shared library. -- - mdz