From 0355d6d047884f5ba41ef526fc7d13fba1f6b258 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 1 Jan 2016 21:44:12 -0500 Subject: [PATCH] Fix build system to be compatible with BSD pmake This fixes a number of incompatibilities which caused maint branch to fail to build on on FreeBSD. Also fix the Makefile in the tests directory so that "make -jN check" works correctly on FreeBSD. Previously the Makefile in the tests directory used a construct which was specific to GNU Make, which which silently expanded to an empty list, which caused "make check" to be a no-op when running using BSD's pmake. This Makefile has been changed to use the != macro assignment syntax which is common to GNU make and BSD pmake. It's technically not completely portable (it will not be recognized by Solaris's ccs make, for example), but most other operating systems ship GNU make (Solaris, AIX), or BSD pmake (*BSD, Mac OS) as either the primary or alternative make utility that this should an acceptable compromise, since it makes running all of tests using something like "make -j8 check" or "make -j16 check" run *much* faster. There are still some caveats if using BSD pmake; in particular, if the configure script is run on a system which has GNU make (installed as gmake on FreeBSD for example), the configure script will find it, and enable some GNU make features in the Makefile, and the generated makefiles *must* be built using gmake. However, if isolated build jail / chroot is used which only has pmake, the Makefiles should now work with pmake. Signed-off-by: Theodore Ts'o --- MCONFIG.in | 4 ++-- Makefile.in | 3 ++- misc/Makefile.in | 4 ++-- tests/Makefile.in | 8 +++++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/MCONFIG.in b/MCONFIG.in index f1003cfa..10c3025b 100644 --- a/MCONFIG.in +++ b/MCONFIG.in @@ -59,11 +59,11 @@ pkgconfigdir = $(libdir)/pkgconfig @ifGNUmake@ ifeq ("$(C)", "1") @ifGNUmake@ CHECK_CMD=$(CHECK) $(CHECK_OPTS) @ifGNUmake@ else -@ifGNUmake@ CHECK_CMD=@true +@ifGNUmake@ CHECK_CMD=true @ifGNUmake@ endif @ifGNUmake@ endif -@ifNotGNUmake@ CHECK_CMD=@true +@ifNotGNUmake@ CHECK_CMD=true CC = @CC@ BUILD_CC = @BUILD_CC@ diff --git a/Makefile.in b/Makefile.in index f5727a80..f443fba5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -19,7 +19,7 @@ LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) $(BLKID_LIB_SUBDIR) $(QUOTA PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests -SUBS= util/subst.conf lib/config.h lib/dirpaths.h \ +SUBS= util/subst.conf lib/config.h $(top_builddir)/lib/dirpaths.h \ lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h TAR=tar @@ -34,6 +34,7 @@ subs: $(DEP_SUBSTITUTE) then $(MAKE) $$i || exit $$? ; fi ; done @(if test -d lib/et ; then cd lib/et && $(MAKE) compile_et; fi) @(if test -d lib/ext2fs ; then cd lib/ext2fs && $(MAKE) ext2_err.h; fi) + @(if test -d e2fsck ; then cd e2fsck && $(MAKE) prof_err.h; fi) progs: all-progs-recursive libs: all-libs-recursive diff --git a/misc/Makefile.in b/misc/Makefile.in index c203fb43..e7642c69 100644 --- a/misc/Makefile.in +++ b/misc/Makefile.in @@ -123,8 +123,8 @@ prof_err.c prof_err.h: $(srcdir)/../e2fsck/prof_err.et $(Q) $(COMPILE_ET) $(srcdir)/../e2fsck/prof_err.et profile.h: $(top_srcdir)/e2fsck/profile.h - $(E) " CP $<" - $(Q) cp $< $@ + $(E) " CP $@" + $(Q) cp $(top_srcdir)/e2fsck/profile.h $@ mke2fs.conf: $(srcdir)/mke2fs.conf.in if test -f $(srcdir)/mke2fs.conf.custom.in ; then \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 37a043ea..d9845510 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -35,10 +35,16 @@ mke2fs.conf: $(srcdir)/mke2fs.conf.in .PHONY : test_pre test_post check always_run -TESTS=$(wildcard $(srcdir)/[a-z]_*) +always_run: + +TESTS != echo $(srcdir)/[a-z]_* + $(TESTS):: test_one always_run @./test_one $@ +foo: + echo $(TESTS) + test_pre: @$(RM) -f *.failed @echo "Running e2fsprogs test suite..."