Re: Multiple dependant library

2006-05-30 Thread Dario Meloni

Thanks, now it works

2006/5/30, Ralf Wildenhues <[EMAIL PROTECTED]>:

Hi Dario,

* Dario Meloni wrote on Tue, May 30, 2006 at 12:40:22AM CEST:
> Hi,
> I am trying to setup an automake script to build 3 library which each
> one, except the first, depends on the others preceding libraries (they
> are IL,ILU and ILUT).
>
> the folder are disposed like this, with the main makefile in the root
> directory
> src-IL/
> src-ILU/
> src-ILUT/
>
> actually to accomplish this the ld flags had these line for ILU:
>  -L$(top_srcdir)/src-IL/src
>
> and these for ILUT:
>  -L$(top_srcdir)/src-IL/src
>  -L$(top_srcdir)/src-ILU/src

Since they are in the same build tree, you should write instead
  ../src/IL/src/libIL.la
  ../src/ILU/src/libILU.la

Then everything will work as intended.

Cheers,
Ralf






Re: Manual Example

2006-05-30 Thread Thomas 'Tom' R. Treadway III

Is there a way to have commas in the text of AS_HELP_STRING?
For example:
AS_HELP_STRING([--with-HDF5=INC,LIB],[Location of HDF5 include files  
and libraries])


   trt

On May 26, 2006, at 4:45 AM, Ralf Wildenhues wrote:


silly me...

* Ralf Wildenhues wrote on Fri, May 26, 2006 at 01:39:04PM CEST:


AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [Turn on debugging]),


instead:

  [AS_HELP_STRING([--enable-debug], [Turn on debugging])],

and with argument:

  [AS_HELP_STRING([--enable-debug@<:@=value@:>@], [Turn on  
debugging])],


(Autoconf-2.60 will get the spacing right.)


[case $enableval in
  yes) debug=true ;;
  no)  debug=false ;;
  *) AC_MSG_ERROR([bad value $enableval for --enable-debug]) ;;
esac], [debug=false])
AM_CONDITIONAL([DEBUG], [test "x$debug" = xtrue])








--
Thomas R. Treadway
Computer Scientist
Lawrence Livermore Nat'l Lab
7000 East Avenue, L-550
Livermore, CA 94550-0611




Re: Manual Example

2006-05-30 Thread Ralf Wildenhues
Hello Thomas,

* Thomas 'Tom' R. Treadway III wrote on Tue, May 30, 2006 at 07:03:15PM CEST:
> Is there a way to have commas in the text of AS_HELP_STRING?
> For example:
> AS_HELP_STRING([--with-HDF5=INC,LIB],[Location of HDF5 include files  
> and libraries])

It seems not, and it seems we need another macro name to produce a fixed
version of AS_HELP_STRING (both a quoting and a counting error: you can
actually get in a comma by adding three sets of [ ], but then using the
comma will mess up the counting), to which users will then be able to
upgrade to.

I suggest using a | instead of a comma, if those are to be alternative
values, or using something like --with-HDF5=PREFIX if the argument is to
mean that the libraries are in PREFIX/lib, and the headers are in
PREFIX/inc.

Cheers,
Ralf




Re: Non-recursive makefiles

2006-05-30 Thread Bob Friesenhahn

On Mon, 29 May 2006, Stefan Puiu wrote:

However, people haven't mentioned yet the main point in Peter Miller's
paper - dependency handling, which I think is very important (I would
say significantly more important than the ability to type "make clean"
in one directory). Most people I work with are more familiar with


There should be no need to type "make clean" in a subdirectory.  Doing 
so is a rank admission that the build system is broken.  Why else 
would someone want to do a "make clean" in a subdirectory?  Perhaps 
the desire to do "make clean" in a subdirectory is aquired bad 
behavior?


That said, if one inspects the Automake generated Makefile, it does 
not take long to learn how to create specific clean targets which will 
work for a specific target.


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




passing parameters to libtool

2006-05-30 Thread tchize
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

am using autoconf / automake in a project. We have a problem with some
static library compilation leading to us needing to pass parameters to
libtool call at link time. We need to pass it the --preserve-dup-deps
parameters. However, i found nowhere in automake docs how to do this.
All automake docs states is that libtool is fully integrated since
1.2, but no info on how to pass additionnal parameters.

Need infos on it, this is quite important, our project is currently
blocked until we resolve this compilation issue. Some of our
developper are waiting for this soluce :)

Thanks

David Delbecq
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEfJAnHHGOa1Q2wXwRAuYoAJ4nPTHu+gc44gzDQkJakPgUwb402wCgxS3Y
B0odSoh7Gzg0/fTufttysCA=
=e3Gl
-END PGP SIGNATURE-





Re: passing parameters to libtool

2006-05-30 Thread Ralf Wildenhues
Hi David,

* tchize wrote on Tue, May 30, 2006 at 08:34:16PM CEST:
> 
> am using autoconf / automake in a project. We have a problem with some
> static library compilation leading to us needing to pass parameters to
> libtool call at link time. We need to pass it the --preserve-dup-deps
> parameters. However, i found nowhere in automake docs how to do this.
> All automake docs states is that libtool is fully integrated since
> 1.2, but no info on how to pass additionnal parameters.

Per-Makefile:
  AM_LIBTOOLFLAGS = --preserve-dup-deps

or per-target with *_LIBTOOLFLAGS.

(And yes, it is very inconsistent that this flag must be passed before
the --mode, and not after the compiler, where *LDFLAGS go.  TODO item.)

> Need infos on it, this is quite important, our project is currently
> blocked until we resolve this compilation issue. Some of our
> developper are waiting for this soluce :)

Well, was that fast enough?  ;-)

(You may still have troubles getting what you want; but to help more, we
need to see more, like the corresponding Makefile.am parts.)

Cheers,
Ralf




Re: Manual Example

2006-05-30 Thread Thomas 'Tom' R. Treadway III


On May 30, 2006, at 10:18 AM, Ralf Wildenhues wrote:


Hello Thomas,

* Thomas 'Tom' R. Treadway III wrote on Tue, May 30, 2006 at  
07:03:15PM CEST:

Is there a way to have commas in the text of AS_HELP_STRING?
For example:
AS_HELP_STRING([--with-HDF5=INC,LIB],[Location of HDF5 include files
and libraries])

AS_HELP_STRING
vs
AC_HELP_STRING?


It seems not, and it seems we need another macro name to produce a  
fixed
version of AS_HELP_STRING (both a quoting and a counting error: you  
can
actually get in a comma by adding three sets of [ ], but then using  
the

comma will mess up the counting), to which users will then be able to
upgrade to.

Thanks,
I fell back to:
[  --with-hdf5=INC,LIB Location of HDF5 header and library]


I suggest using a | instead of a comma, if those are to be alternative
values, or using something like --with-HDF5=PREFIX if the argument  
is to

mean that the libraries are in PREFIX/lib, and the headers are in
PREFIX/inc.

I was trying to maintain some backward compatibility.


Cheers,
Ralf

   trt





Re: passing parameters to libtool

2006-05-30 Thread tchize
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yes, great, very fast thank you, i hope we can continue getting this
fast :)

But does not work :/

Relevant Makefile.am section:


#note all .a are here twice for compilation problems
AM_LIBTOOLFLAGS= --preserve-dup-deps
LDADD = ../../../server/libserver.a \
../../../common/libcross.a \
../../../random_maps/librandom_map.a \
../../../socket/libsocket.a \
../../../server/libserver.a \
../../../common/libcross.a \
../../../random_maps/librandom_map.a \
../../../socket/libsocket.a \
$(LIBDL) @CHECK_LIBS@




I checked twice, i reran

libtoolize -f -c
mv -f ltmain.sh utils
aclocal
autoheader
automake -a -c
autoconf
./configure
make

and Makefile does now indeed contain a reference to AM_LIBTOOLFLAGS


runtime called made by make

/bin/sh ../../../libtool --tag=CC --mode=link gcc  -g -O2   -o
check_shop  check_shop.o ../../../server/libserver.a
../../../common/libcross.a ../../../random_maps/librandom_map.a
../../../socket/libsocket.a ../../../server/libserver.a
../../../common/libcross.a ../../../random_maps/librandom_map.a
../../../socket/libsocket.a -ldl -lcheck -lcrypt -lm -lnsl


You see , flag is not there! :)


Another solution?

Thanks
David Delbecq



Ralf Wildenhues a écrit :

> Hi David,
>
> * tchize wrote on Tue, May 30, 2006 at 08:34:16PM CEST:
>
>> am using autoconf / automake in a project. We have a problem with
>> some static library compilation leading to us needing to pass
>> parameters to libtool call at link time. We need to pass it the
>> --preserve-dup-deps parameters. However, i found nowhere in
>> automake docs how to do this. All automake docs states is that
>> libtool is fully integrated since 1.2, but no info on how to pass
>> additionnal parameters.
>
>
> Per-Makefile: AM_LIBTOOLFLAGS = --preserve-dup-deps
>
> or per-target with *_LIBTOOLFLAGS.
>
> (And yes, it is very inconsistent that this flag must be passed
> before the --mode, and not after the compiler, where *LDFLAGS go.
> TODO item.)
>
>> Need infos on it, this is quite important, our project is
>> currently blocked until we resolve this compilation issue. Some
>> of our developper are waiting for this soluce :)
>
>
> Well, was that fast enough? ;-)
>
> (You may still have troubles getting what you want; but to help
> more, we need to see more, like the corresponding Makefile.am
> parts.)
>
> Cheers, Ralf
>
>

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEfJnfHHGOa1Q2wXwRAs0kAKC9wL16+e7bknZqpD6QOobfhpSqqACgpGn7
tmqpKP1E9cdQE8Eg43/ara4=
=6XXB
-END PGP SIGNATURE-





Re: passing parameters to libtool

2006-05-30 Thread Ralf Wildenhues
* tchize wrote on Tue, May 30, 2006 at 09:15:43PM CEST:
> 
> Yes, great, very fast thank you, i hope we can continue getting this
> fast :)
> 
> But does not work :/

Yep, I wasn't paying attention: support for LIBTOOLFLAGS has been added
only in the CVS version of Automake, after 1.9.6.  :-/
Sorry about that.

> runtime called made by make
> 
> /bin/sh ../../../libtool --tag=CC --mode=link gcc  -g -O2   -o
> check_shop  check_shop.o ../../../server/libserver.a
> ../../../common/libcross.a ../../../random_maps/librandom_map.a
> ../../../socket/libsocket.a ../../../server/libserver.a
> ../../../common/libcross.a ../../../random_maps/librandom_map.a
> ../../../socket/libsocket.a -ldl -lcheck -lcrypt -lm -lnsl
> 
> You see , flag is not there! :)

Yeah, I guess then you'll either have to use CVS Automake, or hack you
way around this.  Different possibilities come to mind:

- write
LIBTOOL = @LIBTOOL@ --preserve-dup-deps

- write
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
   $(LDFLAGS) -o $@

in Makefile.am (both untested; feedback appreciated).

Cheers,
Ralf




Re: passing parameters to libtool

2006-05-30 Thread tchize
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ralf Wildenhues a écrit :

> * tchize wrote on Tue, May 30, 2006 at 09:15:43PM CEST:
>
>> Yes, great, very fast thank you, i hope we can continue getting
>> this fast :)
>>
>> But does not work :/
>
>
> Yep, I wasn't paying attention: support for LIBTOOLFLAGS has been
> added only in the CVS version of Automake, after 1.9.6. :-/ Sorry
> about that.

Quite surprised, nobody requested to pass parameter to libtool since
1.2? :D

>
>
> Yeah, I guess then you'll either have to use CVS Automake,

Can't ask team to switch to CVS version of automake :)

> or hack you way around this. Different possibilities come to mind:
>
>
> - write LIBTOOL = @LIBTOOL@ --preserve-dup-deps

Works, though i have no idea what it means :D

>
> - write LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS)
> $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS)
> $(AM_LDFLAGS) \ $(LDFLAGS) -o $@

Works too (and that, i undestand it :p)

>
> in Makefile.am (both untested; feedback appreciated).

Problem solved, thank you (will go for first solution as the smallest
one, would like to know what it means anyway. I guess it states
libtool is libtool, but i don't really understand the notation :)

>
> Cheers, Ralf
>
>
Greetings,
David Delbecq
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEfJ8GHHGOa1Q2wXwRAmgkAKCM/QLXtVvZPJJI+jFxvnDATC+3wwCg7KCs
gZ6f2ScmIIaDhR8nh9Tg/vo=
=hIbR
-END PGP SIGNATURE-





Re: passing parameters to libtool

2006-05-30 Thread Ralf Wildenhues
* tchize wrote on Tue, May 30, 2006 at 09:37:43PM CEST:
> Ralf Wildenhues a écrit :
> >
> > - write LIBTOOL = @LIBTOOL@ --preserve-dup-deps
> 
> Works, though i have no idea what it means :D

Well, for each AC_SUBSTed variable in configure.ac, Automake generates a
line of the form

  VARIABLE = @VARIABLE@

in Makefile.in, so that you can later use $(VARIABLE) instead of
@VARIABLE@ everywhere; and, so that you have a chance to override 
the value of $(VARIABLE) -- your settings come after the one by
Automake, so they will take precedence.  (There are cases where
it may not work as easily, but I can't think of one off-hand now.)

Maybe you should add a note to that line that, once your project
can assume Automake-1.10, it should be replaced with a proper
AM_LIBTOOLFLAGS setting.

Cheers,
Ralf




Re: passing parameters to libtool

2006-05-30 Thread tchize
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ralf Wildenhues a écrit :

> * tchize wrote on Tue, May 30, 2006 at 09:37:43PM CEST:
>
>> Ralf Wildenhues a écrit :
>>
>>> - write LIBTOOL = @LIBTOOL@ --preserve-dup-deps
>>
>> Works, though i have no idea what it means :D
>
>
> Well, for each AC_SUBSTed variable in configure.ac, Automake
> generates a line of the form
>
> VARIABLE = @VARIABLE@
>
> in Makefile.in, so that you can later use $(VARIABLE) instead of
> @VARIABLE@ everywhere; and, so that you have a chance to override
> the value of $(VARIABLE) -- your settings come after the one by
> Automake, so they will take precedence. (There are cases where it
> may not work as easily, but I can't think of one off-hand now.)
>
> Maybe you should add a note to that line that, once your project
> can assume Automake-1.10, it should be replaced with a proper
> AM_LIBTOOLFLAGS setting.
>
> Cheers, Ralf
>
>
thanks for enlightments, don't worry about comment, is already there,
but i bet it will still be there in 2 years considering how many time
Makefiles get modified :p

Thanks for all help
David Delbecq
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEfKWdHHGOa1Q2wXwRAjbrAJ9dlKyjIIPAvtSdpd30IWfLz75FawCgogPM
aLO72cq8vUuHNDnYzcivws8=
=K8qV
-END PGP SIGNATURE-