summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-09-09 08:21:16 +0200
committerJim Meyering <meyering@redhat.com>2012-09-11 11:23:17 +0200
commit8a0e1bce040f982b27cd715a253d6c83bf806dbe (patch)
treedf71e707f1accd01f745a89860276e0142b7af04
parentada994274cacac427e7a2004e7bd6c16e7f140a7 (diff)
downloadcoreutils-8a0e1bce040f982b27cd715a253d6c83bf806dbe.tar.xz
build: build lib/ using non-recursive make
* 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".
-rw-r--r--Makefile.am10
-rw-r--r--bootstrap.conf5
-rw-r--r--configure.ac1
-rw-r--r--lib/Makefile.am37
-rw-r--r--lib/local.mk5
-rw-r--r--src/local.mk6
6 files changed, 21 insertions, 43 deletions
diff --git a/Makefile.am b/Makefile.am
index 384b9e937..dfbb59195 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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
diff --git a/bootstrap.conf b/bootstrap.conf
index 0658e1b7b..01c85f5da 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -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
diff --git a/configure.ac b/configure.ac
index c6cd8b778..713a9b986 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
index 885f9b2dc..000000000
--- a/lib/Makefile.am
+++ /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
index 000000000..decbad627
--- /dev/null
+++ b/lib/local.mk
@@ -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
diff --git a/src/local.mk b/src/local.mk
index 78e7743fb..0f9e000a9 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -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.