summaryrefslogtreecommitdiff
path: root/build_posix
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2016-06-02 22:54:40 -0400
committerMichael Cahill <michael.cahill@mongodb.com>2016-06-03 12:54:40 +1000
commitd3a8060e5b8917d8bec927cd54c229e313e22258 (patch)
tree93f1806e38d89c25f38a3954b051d7355db30d38 /build_posix
parenta27db763dc3d694bf57ec9755fc1b4f0d06a10ab (diff)
downloadmongo-d3a8060e5b8917d8bec927cd54c229e313e22258.tar.gz
WT-2658 Only include PPC-specific files in PPC builds (#2758)
* WT-2658 Only include PPC-specific files in PPC builds * Add support for conditional file inclusion by adding a second argument on lines in dist/filelist. Add a new automake conditional, POWERPC_HOST, set for the various PPC host CPUs. Change dist/filelist to only compile the checksum/power8 files if POWERPC_HOST is set. * Merge the Windows and POSIX file lists, use POSIX_HOST and WINDOWS_HOST to mark source files needed for builds on those systems.
Diffstat (limited to 'build_posix')
-rw-r--r--build_posix/configure.ac.in18
-rwxr-xr-xbuild_posix/makemake22
2 files changed, 28 insertions, 12 deletions
diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in
index 9251873be73..617304f9215 100644
--- a/build_posix/configure.ac.in
+++ b/build_posix/configure.ac.in
@@ -34,6 +34,16 @@ AC_PROG_CC(cc gcc)
AC_PROG_CXX(c++ g++)
AM_PROG_AS(as gas)
+AM_CONDITIONAL([POSIX_HOST], [true])
+AM_CONDITIONAL([WINDOWS_HOST], [false])
+
+AS_CASE([$host_cpu],
+ [ppc64*], [wt_cv_powerpc="yes"],
+ [elf64lppc], [wt_cv_powerpc="yes"],
+ [powerpc*], [wt_cv_powerpc="yes"],
+ [wt_cv_powerpc="no"])
+AM_CONDITIONAL([POWERPC_HOST], [test "$wt_cv_powerpc" = "yes"])
+
# This is a workaround as part of WT-2459. Currently, clang (v3.7) does not
# support compiling the ASM code we have to perform the CRC checks on PowerPC.
# To compile with clang we need to override the ASM compiler with CCAS to use
@@ -41,12 +51,8 @@ AM_PROG_AS(as gas)
# determine what tag to use for that one .S file. If we catch that we are using
# two different compilers for CC and CCAS and we are on a PowerPC system we
# overload the libtool flags to provide CC by default.
-if test "$CC" != "$CCAS"; then
- AS_CASE([$host_cpu],
- [ppc64*], [AM_LIBTOOLFLAGS+="--tag=CC"],
- [elf64lppc], [AM_LIBTOOLFLAGS+="--tag=CC"],
- [powerpc*], [AM_LIBTOOLFLAGS+="--tag=CC"],
- [])
+if test "$wt_cv_powerpc" = "yes" -a "$CC" != "$CCAS"; then
+ [AM_LIBTOOLFLAGS+="--tag=CC"]
fi
AC_SUBST(AM_LIBTOOLFLAGS)
diff --git a/build_posix/makemake b/build_posix/makemake
index 9ed9d252911..506420b4aaf 100755
--- a/build_posix/makemake
+++ b/build_posix/makemake
@@ -7,7 +7,7 @@
(sed -n '1,/BEGIN SUBDIRS/p' Make.base
echo "SUBDIRS ="
-sed -e 's/#.*$//' -e '/^$/d' Make.subdirs | (while read dir cond ; do
+sed -e 's/#.*$//' -e '/^$/d' Make.subdirs | while read dir cond ; do
test -d ../$dir || continue
if test -n "$cond" ; then
cat <<END_CONDITIONAL
@@ -18,17 +18,27 @@ END_CONDITIONAL
else
echo "SUBDIRS += $dir"
fi
-done)
+done
# Write the rest of Make.base, up to SOURCES
sed -n '/END SUBDIRS/,/BEGIN SOURCES/p' Make.base
+# Write the list of sources.
echo
echo "libwiredtiger_la_LDFLAGS = -release @VERSION@"
-echo "libwiredtiger_la_SOURCES=\\"
-sed -e '/^[a-z]/!d' \
- -e 's/.*/ & \\/' \
- -e '$s/ \\$//' < ../dist/filelist
+echo "libwiredtiger_la_SOURCES ="
+sed -e '/^[a-z]/!d' < ../dist/filelist | while read file cond; do
+ if test -n "$cond"; then
+ cat <<END_CONDITIONAL
+# DO NOT indent the "libwiredtiger_la_SOURCES" lines, it breaks the build.
+if ${cond}
+libwiredtiger_la_SOURCES += $file
+endif
+END_CONDITIONAL
+ else
+ echo "libwiredtiger_la_SOURCES += $file"
+ fi
+done
# Write the rest of Make.base
sed -n '/END SOURCES/,$p' Make.base