bug-gnulib
[Top][All Lists]
Advanced

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

Re: Use $(MKDIR_P) instead of @MKDIR_P@


From: Bruno Haible
Subject: Re: Use $(MKDIR_P) instead of @MKDIR_P@
Date: Sun, 4 Oct 2009 20:41:12 +0200
User-agent: KMail/1.9.9

Ralf Wildenhues wrote:
> > But for things like @LIBINTL@
> > and @LIBSOCKET@, it is still better to write them as @LIBINTL@, not 
> > $(LIBINTL),
> > because if the corresponding autoconf macro was not run, it makes the error
> > appear on all platforms. Otherwise it's too easy to write a Makefile.am
> > that builds fine on glibc systems but not on Solaris or MacOS X.
> 
> You can still have this additional safety feature by using both
> 
>   LIBINTL = @LIBINTL@
> 
> and
>   target:
>         $(LINK) ... $(LIBINTL)
> 
> in your Makefile.in files, or in your fragment.am snippets.
> 
> Overridability plus safety net!  :-)

I see how this could be useful in a normal autoconf+automake project, where
the entire Makefile.am is under the control of the same person.

For gnulib with its module structure, it becomes hairy. Applied, for example,
to LIBSOCKET, we could use this patch. But I get a bit of a stomach-ache when I
see the same Makefile variable being defined in three different locations.
If only one of these three gets changed, and the others don't, we immediately
get into a mess.

Bruno


--- modules/poll-tests.orig     2009-10-04 20:38:28.000000000 +0200
+++ modules/poll-tests  2009-10-04 20:38:03.000000000 +0200
@@ -25,6 +25,7 @@
 AC_CHECK_HEADERS_ONCE([unistd.h sys/wait.h])
 
 Makefile.am:
+LIBSOCKET = @LIBSOCKET@
 TESTS += test-poll
 check_PROGRAMS += test-poll
-test_poll_LDADD = $(LDADD) @LIBSOCKET@
+test_poll_LDADD = $(LDADD) $(LIBSOCKET)
--- modules/select-tests.orig   2009-10-04 20:38:28.000000000 +0200
+++ modules/select-tests        2009-10-04 20:38:03.000000000 +0200
@@ -29,13 +29,14 @@
 AC_CHECK_HEADERS_ONCE([unistd.h sys/wait.h])
 
 Makefile.am:
+LIBSOCKET = @LIBSOCKET@
 TESTS += test-select test-select-in.sh test-select-out.sh
 # test-select-stdin has to be run by hand.
 TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@'
 check_PROGRAMS += test-select test-select-fd test-select-stdin
-test_select_LDADD = $(LDADD) @LIBSOCKET@
-test_select_fd_LDADD = $(LDADD) @LIBSOCKET@
-test_select_stdin_LDADD = $(LDADD) @LIBSOCKET@
+test_select_LDADD = $(LDADD) $(LIBSOCKET)
+test_select_fd_LDADD = $(LDADD) $(LIBSOCKET)
+test_select_stdin_LDADD = $(LDADD) $(LIBSOCKET)
 
 License:
 LGPL
--- modules/sockets-tests.orig  2009-10-04 20:38:28.000000000 +0200
+++ modules/sockets-tests       2009-10-04 20:38:04.000000000 +0200
@@ -6,6 +6,7 @@
 configure.ac:
 
 Makefile.am:
+LIBSOCKET = @LIBSOCKET@
 TESTS += test-sockets
 check_PROGRAMS += test-sockets
-test_sockets_LDADD = $(LDADD) @LIBSOCKET@
+test_sockets_LDADD = $(LDADD) $(LIBSOCKET)




reply via email to

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