summaryrefslogtreecommitdiff
path: root/build_posix
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2011-09-30 17:32:42 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2011-09-30 17:32:42 +1000
commita7c151b41903a23b5fd991d419989983566bea72 (patch)
tree4836f76f39da1958093d6f3708e0bae28ff62b86 /build_posix
parent5e23906bb7164f9ebc0217432b8fee5bf0a8e8d0 (diff)
downloadmongo-a7c151b41903a23b5fd991d419989983566bea72.tar.gz
Put build subdirs into build_posix/Make.subdirs, use that to generate both Makefile.am and configure.ac. This addresses issues in releases where some of those subdirs are excluded.
Diffstat (limited to 'build_posix')
-rw-r--r--build_posix/Make.base21
-rw-r--r--build_posix/Make.subdirs16
-rw-r--r--build_posix/configure.ac.in13
-rwxr-xr-xbuild_posix/makemake34
-rwxr-xr-xbuild_posix/reconf12
5 files changed, 44 insertions, 52 deletions
diff --git a/build_posix/Make.base b/build_posix/Make.base
index 757c31f8e7b..3184bff5de4 100644
--- a/build_posix/Make.base
+++ b/build_posix/Make.base
@@ -1,24 +1,7 @@
ACLOCAL_AMFLAGS = -I build_posix/aclocal
-if BZIP2
- BZIP2_BUILD = ext/compressors/bzip2_compress
-endif
-if PYTHON
- PYTHON_BUILD = lang/python
-endif
-if HAVE_BDB
- FORMAT_BUILD = test/format
-endif
-
-SUBDIRS = . \
- bench/tcbench \
- examples/c \
- ext/compressors/nop_compress \
- test/salvage \
- test/thread \
- $(BZIP2_BUILD) \
- $(FORMAT_BUILD) \
- $(PYTHON_BUILD)
+# BEGIN SUBDIRS, maintained by makemake and subdirs.list
+# END SUBDIRS
lib_LTLIBRARIES = libwiredtiger.la
LDADD = $(lib_LTLIBRARIES)
diff --git a/build_posix/Make.subdirs b/build_posix/Make.subdirs
new file mode 100644
index 00000000000..46fa488969c
--- /dev/null
+++ b/build_posix/Make.subdirs
@@ -0,0 +1,16 @@
+# List of sub-directories, used by makemake to create Makefile.am
+#
+# The format is:
+# <dir>[ <condition>]
+#
+# If the directory exists, it is added to AUTO_SUBDIRS.
+# If a condition is included, the subdir is made conditional via AM_CONDITIONAL
+bench/tcbench
+examples/c
+ext/compressors/bzip2_compress BZIP2
+ext/compressors/nop_compress
+lang/python PYTHON
+test/format HAVE_BDB
+test/insert
+test/salvage
+test/thread
diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in
index 12de43cf551..d41199ba202 100644
--- a/build_posix/configure.ac.in
+++ b/build_posix/configure.ac.in
@@ -86,18 +86,7 @@ AM_CONDITIONAL([HAVE_BDB], [test -d ../test/format && test -e db])
# Output files
AC_CONFIG_HEADERS([wiredtiger_config.h:build_posix/config.hin])
-# BEGIN check existence -- code that may be excluded
-AC_CONFIG_LINKS([test/format/s_dumpcmp:test/format/s_dumpcmp])
-
-AC_CONFIG_FILES([bench/tcbench/Makefile])
-AC_CONFIG_FILES([examples/c/Makefile])
-AC_CONFIG_FILES([ext/compressors/bzip2_compress/Makefile])
-AC_CONFIG_FILES([ext/compressors/nop_compress/Makefile])
-AC_CONFIG_FILES([lang/python/Makefile])
-AC_CONFIG_FILES([test/format/Makefile])
-AC_CONFIG_FILES([test/insert/Makefile])
-AC_CONFIG_FILES([test/salvage/Makefile])
-AC_CONFIG_FILES([test/thread/Makefile])
+# BEGIN check existence -- maintained by reconf and Make.subdirs
# END check existence
AC_CONFIG_FILES([
diff --git a/build_posix/makemake b/build_posix/makemake
index e95747f6d6f..2737138322f 100755
--- a/build_posix/makemake
+++ b/build_posix/makemake
@@ -5,24 +5,32 @@
# Build Makefile.am
-# Process Make.base, removing any subdirs that don't exist.
-# This is used in release trees, which exclude some parts of
-# the development tree.
-(sed -n '1,/^SUBDIRS/p' Make.base
+# Process Make.base, insert subdirs that exist from Make.subdirs
+# (in release trees, some of the subdirs might be excluded).
+(sed -n '1,/BEGIN SUBDIRS/p' Make.base
-sed '1,/^SUBDIRS/d' Make.base | sed -e '/^$/,$d' -e 's/ \\$//' | \
- while read d ; do
- case "$d" in
- [a-z]*) [ -d ../$d ] || continue ;;
- esac
- echo " $d \\"
- done | sed '$s/ \\$//'
+SUBDIRS=.
+sed -e 's/#.*$//' -e '/^$/d' Make.subdirs | (while read dir cond ; do
+ test -d ../$dir || continue
+ if test -n "$cond" ; then
+ cat <<EOF
+if ${cond}
+ ${cond}_BUILD = $dir
+endif
+EOF
+ SUBDIRS="$SUBDIRS \\
+ \$(${cond}_BUILD)"
+ else
+ SUBDIRS="$SUBDIRS \\
+ $dir"
+ fi
+done
-# Terminate the list with a blank line
echo
+echo "SUBDIRS = $SUBDIRS")
# Write the rest of Make.base
-sed '1,/^SUBDIRS/d' Make.base | sed '1,/^$/d'
+sed -n '/END SUBDIRS/,$p' Make.base
echo
echo "libwiredtiger_la_LDFLAGS = -release @VERSION@"
diff --git a/build_posix/reconf b/build_posix/reconf
index 6923b7758da..ee6533241de 100755
--- a/build_posix/reconf
+++ b/build_posix/reconf
@@ -33,14 +33,10 @@ echo "# This file is built automatically from build_posix/configure.ac.in."
sed -n '1,/BEGIN check existence/p' configure.ac.in
-sed -n '/BEGIN check existence/,/END check existence/p' configure.ac.in |
- sed '/^#/d' | while read l ; do
- f=`echo $l | sed -e 's/^.*\[//' -e 's/:.*//' -e 's/\].*//'`
- case "$f" in
- [a-z]*) [ -d ../`dirname $f` ] || continue ;;
- esac
- echo "$l"
- done
+sed -e 's/#.*$//' -e '/^$/d' Make.subdirs | while read dir cond ; do
+ test -d ../$dir || continue
+ echo 'AC_CONFIG_FILES(['$dir/Makefile'])'
+done
sed -n '/END check existence/,$p' configure.ac.in
) > ../configure.ac