autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conditional compiling?


From: Ed Hartnett
Subject: Re: Conditional compiling?
Date: Wed, 21 Dec 2005 14:31:16 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Keith MARSHALL <address@hidden> writes:

> Ralf Corsepius wrote:
>> Congratulations! You are about to reinvented AM_CONDITIONAL. ;)
>>
>> That's more or less how AM_CONDITIONAL internally works.
>
> I'm sure it is!  I was merely illustrating how the desired effect
> can be achieved, while avoiding all the unnecessary cruft and
> verbiage that automake also throws into your Makefile.in, (and
> into your project in general)!
>
> I *really* do not like automake at all.  IMNSHO, it is just one
> autotool too far.  For me, it delivers zero added value for the
> expenditure of time to learn it.  Several have tried, but no one
> has yet offered a convincing argument to persuade me to change
> this opinion.
>
> Of course, I fully respect your right to a contradictory POV.
> I'd appreciate your respect for mine; without the sarcasm.
>
> Regards,
> Keith.
>

Really?

You amaze me.

I distribute netCDF, a C/C++/F77/F90 library that installs just about
everywhere.

Switching from our old hand-crafted makefiles to Automake not only
removed thousands of lines of makefiles (which had to be maintained),
but also gave me all kinds of extra targets, like distcheck, which
have been really helpful.

And in terms of conditional compilation, they have simplified things
tremendously with the conditional statements. Here's part of my main
automake file. The use of the "if" statements make the conditionals
quite obvious and easy to use...

# If the user specified a root location for HDF5, use it.
if USE_HDF5_DIR
AM_CPPFLAGS += address@hidden@/include
AM_LDFLAGS += address@hidden@/lib
endif

# Tell automake that netcdf.h is a header file we want to install.
include_HEADERS = netcdf.h

# This is our output. The big enchilada.
lib_LTLIBRARIES = libnetcdf.la

# Our output library will also include contents of the netcdf3 and
# netcdf2 convenience libraries.
libnetcdf_la_LIBADD = ../libsrc/libnetcdf3.la ../libsrc/libnetcdf2.la

# If the f77 api is being built, include its convenience library.
if BUILD_F77
libnetcdf_la_LIBADD += ../fortran/libnetcdff.la
endif

...

And as someone who has done a lot with both makefiles and
automakefiles, I am glad to leave makefiles behind forever. They are
not that fun!

Ed
-- 
Ed Hartnett  -- address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]