build: build lib/ using non-recursive make
authorJim Meyering <meyering@redhat.com>
Sun, 9 Sep 2012 06:21:16 +0000 (08:21 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 11 Sep 2012 09:23:17 +0000 (11:23 +0200)
* bootstrap.conf (gnulib_modules): Use the new module.
(bootstrap_post_import_hook): Invoke prefix-gnulib-mk.
* configure.ac (AC_CONFIG_FILES): Remove lib/Makefile.
* lib/Makefile.am: Renamed...
* lib/local.mk: ...to this.
* src/local.mk (CLEANFILES): Append, don't set.
(noinst_LIBRARIES): Likewise.
(AM_CPPFLAGS): Don't set this here.
* Makefile.am (AM_CPPFLAGS): Define here instead.
(noinst_LIBRARIES, CLEANFILES, MOSTLYCLEANDIRS, MOSTLYCLEANFILES):
Initialize here, so we can append to them from each included local.mk
(SUBDIRS): Remove "lib".

Makefile.am
bootstrap.conf
configure.ac
lib/Makefile.am [deleted file]
lib/local.mk [new file with mode: 0644]
src/local.mk

index 384b9e9..dfbb591 100644 (file)
@@ -17,7 +17,7 @@
 
 ALL_RECURSIVE_TARGETS =
 
-SUBDIRS = lib po . gnulib-tests
+SUBDIRS = po . gnulib-tests
 
 changelog_etc =                                \
   ChangeLog-2005                       \
@@ -194,6 +194,14 @@ check-git-hook-script-sync:
        rm -rf $$t;                                                     \
        test $$fail = 0
 
+noinst_LIBRARIES =
+MOSTLYCLEANFILES =
+CLEANFILES =
+MOSTLYCLEANDIRS =
+
+AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib -Isrc -I$(top_srcdir)/src
+
+include $(top_srcdir)/lib/local.mk
 include $(top_srcdir)/src/local.mk
 include $(top_srcdir)/doc/local.mk
 include $(top_srcdir)/man/local.mk
index 0658e1b..01c85f5 100644 (file)
@@ -170,6 +170,7 @@ gnulib_modules="
   mountlist
   mpsort
   netinet_in
+  non-recursive-gnulib-prefix-hack
   nproc
   obstack
   parse-datetime
@@ -340,8 +341,12 @@ bootstrap_post_import_hook ()
     && build-aux/gen-lists-of-programs.sh --automake >$tmp-2 \
     && chmod a-w $tmp-1 $tmp-2 \
     && mv -f $tmp-1 $m4f && mv -f $tmp-2 $mkf)
+
+  # Massage lib/gnulib.mk before using it later in the bootstrapping process.
+  build-aux/prefix-gnulib-mk --lib-name=$gnulib_name lib/$gnulib_mk
 }
 
+
 bootstrap_epilogue()
 {
   # Since this is a "GNU" package, replace this line
index c6cd8b7..713a9b9 100644 (file)
@@ -482,7 +482,6 @@ gt_LOCALE_FR
 
 AC_CONFIG_FILES(
   Makefile
-  lib/Makefile
   po/Makefile.in
   gnulib-tests/Makefile
   )
diff --git a/lib/Makefile.am b/lib/Makefile.am
deleted file mode 100644 (file)
index 885f9b2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-## Makefile for gnulib/lib                             -*-Makefile-*-
-
-# Copyright (C) 1995-2012 Free Software Foundation, Inc.
-
-## This program is free software: you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation, either version 3 of the License, or
-## (at your option) any later version.
-##
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-AM_CFLAGS =
-AM_CPPFLAGS =
-BUILT_SOURCES =
-CLEANFILES =
-EXTRA_DIST =
-MAINTAINERCLEANFILES =
-MOSTLYCLEANDIRS =
-MOSTLYCLEANFILES =
-SUFFIXES =
-noinst_LIBRARIES =
-
-include gnulib.mk
-
-AM_CFLAGS += $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
-
-libcoreutils_a_SOURCES += \
-  buffer-lcm.c buffer-lcm.h
-
-libcoreutils_a_LIBADD += $(LIBOBJS)
-libcoreutils_a_DEPENDENCIES += $(LIBOBJS)
diff --git a/lib/local.mk b/lib/local.mk
new file mode 100644 (file)
index 0000000..decbad6
--- /dev/null
@@ -0,0 +1,5 @@
+include lib/gnulib.mk
+
+# Allow "make distdir" to succeed before "make all" has run.
+dist-hook: $(noinst_LIBRARIES)
+.PHONY: dist-hook
index 78e7743..0f9e000 100644 (file)
@@ -65,16 +65,14 @@ EXTRA_DIST +=               \
   src/extract-magic    \
   src/c99-to-c89.diff
 
-CLEANFILES = $(SCRIPTS)
+CLEANFILES += $(SCRIPTS)
 
 # Also remove these sometimes-built programs.
 # For example, even when excluded, they're built via 'sc_check-AUTHORS'
 # or 'dist'.
 CLEANFILES += $(no_install__progs)
 
-AM_CPPFLAGS = -I$(top_srcdir)/lib -Isrc
-
-noinst_LIBRARIES = src/libver.a
+noinst_LIBRARIES += src/libver.a
 nodist_src_libver_a_SOURCES = src/version.c src/version.h
 
 # Tell the linker to omit references to unused shared libraries.