Bruno Haible <[EMAIL PROTECTED]> writes:

> I would love to replace
>
>      DEFS += -DLIBDIR=\"$(libdir)\"
>
> with
>
>      localcharset_CPPFLAGS = $(AM_CPPFLAGS) -DLIBDIR=\"$(libdir)\"

That would certainly be an improvement, but it sounds like a bit of a
pain to manage all the foo_CPPFLAGS variables.  coreutils needs the
same sort of thing for LOCALEDIR, for example, and I don't want to
have to bother to keep track of which files need LOCALEDIR in
hand-maintained makefiles.

Also, it's nicer to avoid the -DLIBDIR="/usr/local/lib" business in
all 'make' output, not just for files that don't need LIBDIR.

How about the following patch to gnulib instead?  It's short and
sweet, doesn't require any changes to Automake, and should be easier
to maintain.  And it simplifies the 'make' output for all files.

2006-08-25  Paul Eggert  <[EMAIL PROTECTED]>

        * lib/localcharset.c: Include configmake.h.
        (get_charset_aliases): LIBDIR -> CONFIGMAKE_LIBDIR.
        * modules/localcharset (Depends-on): Add configmake.
        (Makefile.am): Remove DEFS.

--- lib/localcharset.c  31 Jul 2006 16:09:08 -0000      1.23
+++ lib/localcharset.c  25 Aug 2006 23:19:08 -0000
@@ -30,6 +30,8 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "configmake.h"
+
 #if defined _WIN32 || defined __WIN32__
 # define WIN32_NATIVE
 #endif
@@ -117,7 +119,7 @@ get_charset_aliases (void)
         necessary for running the testsuite before "make install".  */
       dir = getenv ("CHARSETALIASDIR");
       if (dir == NULL || dir[0] == '\0')
-       dir = relocate (LIBDIR);
+       dir = relocate (CONFIGMAKE_LIBDIR);
 
       /* Concatenate dir and base into freshly allocated file_name.  */
       {
--- modules/localcharset        22 Sep 2004 15:11:04 -0000      1.6
+++ modules/localcharset        25 Aug 2006 23:19:08 -0000
@@ -12,6 +12,7 @@ m4/glibc21.m4
 m4/localcharset.m4
 
 Depends-on:
+configmake
 
 configure.ac:
 gl_LOCALCHARSET
@@ -19,7 +20,6 @@ gl_LOCALCHARSET
 Makefile.am:
 lib_SOURCES += localcharset.h localcharset.c
 EXTRA_DIST += config.charset ref-add.sin ref-del.sin
-DEFS += -DLIBDIR=\"$(libdir)\"
 
 # We need the following in order to install a simple file in $(libdir)
 # which is shared with other installed packages. We use a list of referencing


Reply via email to