Re: Emulating GNU Make conditionals, or: Is there a nice way to automatically set CFLAGS when make is run?

2003-12-11 Thread Tom Tromey
> "Dalibor" == Dalibor Topic <[EMAIL PROTECTED]> writes:

Dalibor> They use make -DCHECK=1 to enable adding of special debuggin flags,
Dalibor> for example, and make -DPROF=1 to add another set of flags to enable a
Dalibor> build fro profiling.

You can always add your own targets:

debugging:
$(MAKE) CFLAGS='-g ...'

Then "make mostlyclean debugging" should work ok.  This isn't
completely robust in all situations -- if something in CFLAGS changes
a decision that configure makes, then you must reconfigure.  However,
the above would work fine most of the time.

Maybe I'm misunderstanding what you want?

If you've got several common ways to build something, I suggest either
building outside the source tree (so you can easily have multiple
builds with different options -- this is what I do) or using ccache.

Tom




Re: making convenience libraries without libtool

2003-12-11 Thread Daniel Reed
On 2003-12-11T11:00-0500, Marty Leisner wrote:
) I'm using libtool to make convenience libraries merging
) sublibraries...
)
) I really don't need to use libtool since I don't build shared libraries.

Ensure your configure.{ac,in} contains at least:
AC_PROG_CC
AC_PROG_RANLIB

Add to your Makefile.am:
noinst_LIBRARIES = libtarget.a

You can use libtarget_a_SOURCES to have it build libtarget.a from source
code, or perhaps make interesting use of libtarget_a_LIBADD to include other
libraries.


The key to convenience libraries is the noinst_ prefix, and the key to not
using libtool just to make an archive is to use the _LIBRARIES suffix
instead of _LTLIBRARIES.

-- 
Daniel Reed <[EMAIL PROTECTED]> http://naim-users.org/nmlorg/   http://naim.n.ml.org/
Punishment often increases the feelings of estrangement and strengthens
the power of resistance. -- Friedrich Nietzsche, German Philosopher




Re: making convenience libraries without libtool

2003-12-11 Thread Bob Friesenhahn
I believe that Automake relies on libtool to support convenience
libraries.

Bob

On Thu, 11 Dec 2003, Marty Leisner wrote:

> I'm using libtool to make convenience libraries merging
> sublibraries...
>
> I really don't need to use libtool since I don't build shared libraries.
>
> How can I use automake to build convenience libraries -- or do I
> need to make a command in the makefile.am  I can invoke like
> this:
>
> build_lib  -o libtarget.a foo/libfoo.a bar/libbar.a common/libcommon.a
>
> where build lib busts up the archive foo, bar and common into a temporary
> directory and then build libtarget.a.
>
> marty [EMAIL PROTECTED]
> Don't  confuse education with schooling.
>   Milton Friedman to Yogi Berra
>
>

==
Bob Friesenhahn
[EMAIL PROTECTED]
http://www.simplesystems.org/users/bfriesen





making convenience libraries without libtool

2003-12-11 Thread Marty Leisner
I'm using libtool to make convenience libraries merging
sublibraries...

I really don't need to use libtool since I don't build shared libraries.

How can I use automake to build convenience libraries -- or do I 
need to make a command in the makefile.am  I can invoke like 
this:

build_lib  -o libtarget.a foo/libfoo.a bar/libbar.a common/libcommon.a

where build lib busts up the archive foo, bar and common into a temporary
directory and then build libtarget.a.

marty   [EMAIL PROTECTED]   
Don't  confuse education with schooling.
Milton Friedman to Yogi Berra




Building Fortran 77 libtool modules

2003-12-11 Thread Schleicher Ralph (LLI)
ltmain.sh (GNU libtool) 1.5 (1.1220 2003/04/05 19:32:58)
automake (GNU automake) 1.8

Hi,

I want to create a libtool module written in Fortran 77 and ended up
with the following code:


$ cat configure.ac
AC_INIT([foo], [1.0], [EMAIL PROTECTED])
AM_INIT_AUTOMAKE([1.7 foreign no-define])
AC_CONFIG_SRCDIR([foo.f])
AC_CONFIG_FILES([Makefile])
AC_PROG_LIBTOOL
AC_OUTPUT

$ cat Makefile.am
lib_LTLIBRARIES = foo.la
foo_la_SOURCES = foo.f
foo_la_LDFLAGS = -avoid-version -module -shrext .bar

$ cat foo.f
  subroutine foo
  return
  end

$ libtoolize && aclocal && automake -a && autoconf && ./configure && make
/bin/sh ./libtool --mode=compile g77  -g -O2 -c -o foo.lo foo.f
mkdir .libs
 g77 -g -O2 -c foo.f  -fPIC -o .libs/foo.o
 g77 -g -O2 -c foo.f -o foo.o >/dev/null 2>&1
/bin/sh ./libtool --mode=link g77  -g -O2   -o foo.la -rpath /usr/local/lib 
-avoid-version -module -shrext .bar foo.lo
g77 -shared -fPIC -Wl,+h -Wl,foo.sl -Wl,+b -Wl,/usr/local/lib -o .libs/foo.sl  
.libs/foo.o
ar cru .libs/foo.a  foo.o
ranlib .libs/foo.a
creating foo.la
(cd .libs && rm -f foo.la && ln -s ../foo.la foo.la)


Hmm, looks good on first sight but the module name is foo.sl (this is a
HP-UX box) instead of foo.bar!  When I run libtool manually with the
--tag=F77 option, the module name is foo.bar instead:


$ /bin/sh ./libtool --mode=link --tag=F77 g77  -g -O2   -o foo.la -rpath 
/usr/local/lib -avoid-version -module -shrext .bar foo.lo
rm -fr  .libs/foo.a .libs/foo.la .libs/foo.lai .libs/foo.sl
g77 -shared -fPIC -Wl,+h -Wl,foo.bar -Wl,+b -Wl,/usr/local/lib -o .libs/foo.bar  
.libs/foo.o
ar cru .libs/foo.a  foo.o
ranlib .libs/foo.a
creating foo.la
(cd .libs && rm -f foo.la && ln -s ../foo.la foo.la)


Can anybody enlighten me what's going on.  Libtool's --tag option
is not documented therefore it's quite hard for the average user to
figure it out.  Anyway, adding --tag=F77 to foo_la_LDFLAGS does not
help either because the --tag option must be specified before the
compilation command.  I would consider this a bug if there is no
proper solution.

-- 
Ralph