]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Put LOCALEDIR macro definition in new file: localedir.h.
authorJim Meyering <jim@meyering.net>
Fri, 4 Apr 2003 15:50:05 +0000 (15:50 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 4 Apr 2003 15:50:05 +0000 (15:50 +0000)
(DEFS): Remove definition.
(localedir.h): New rule.
(BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.

src/Makefile.am

index 815980e179442b6378febd9e9eb0a07335d38329..4f51e79f34ae979d4a41a3326a25d03aa45f0008 100644 (file)
@@ -14,8 +14,6 @@ bin_PROGRAMS = chgrp chown chmod cp dd dircolors du \
   test true tty whoami yes \
   @OPTIONAL_BIN_PROGS@ @DF_PROG@
 
-localedir = $(datadir)/locale
-
 noinst_HEADERS = \
   system.h sys2.h checksum.h copy.h cp-hash.h ls.h dircolors.h remove.h \
   chown-core.h fs.h \
@@ -25,7 +23,6 @@ EXTRA_DIST = dcgen dircolors.hin tac-pipe.c \
 CLEANFILES = $(SCRIPTS) su
 
 INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir)/lib -I../lib
-DEFS = -DLOCALEDIR=\"$(localedir)\" -DSHAREDIR=\"$(datadir)\" @DEFS@
 
 # Sometimes, the expansion of @LIBINTL@ includes -lc which may
 # include modules defining variables like `optind', so libfetish.a
@@ -149,6 +146,15 @@ sha1sum_SOURCES = md5sum.c sha1sum.c
 PERL = @PERL@
 editpl = sed -e 's,@''PERL''@,$(PERL),g'
 
+localedir = $(datadir)/locale
+BUILT_SOURCES = localedir.h
+DISTCLEANFILES = localedir.h
+localedir.h: Makefile
+       @rm -f $@-t
+       echo '#define LOCALEDIR "$(localedir)"' >$@-t
+       @chmod a-w $@-t
+       cmp $@-t $@ 2>&1 > /dev/null && rm -f $@-t || { rm -f $@; mv $@-t $@; }
+
 MAINTAINERCLEANFILES = dircolors.h \
   wheel.h wheel-size.h
 
@@ -167,7 +173,7 @@ wheel.h: wheel-gen.pl Makefile.am
          > $@-t
        mv $@-t $@
 
-BUILT_SOURCES = dircolors.h false.c wheel.h wheel-size.h
+BUILT_SOURCES += dircolors.h false.c wheel.h wheel-size.h
 
 # false exits nonzero even with --help or --version.
 # Tell automake to exempt it from that installcheck test.