summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames O'Gorman <james@netinertia.co.uk>2011-05-02 11:25:49 +0000
committerJames O'Gorman <james@netinertia.co.uk>2011-05-02 11:25:49 +0000
commite10e0258106df1d93e60b046c9ef51770d8997fd (patch)
tree641619381adbb65bc43b8f52987171d5fa4ef804
parent2b087f259eee2e18b40a649f6bf5dfc44751db31 (diff)
Finally unbreak build on Solaris!
* Add code to configure to detect whether we should compile with -m32 or -m64. GCC on Solaris defaults to 32-bit even of the OS is running in 64-bit mode. (Solaris only) * Change the CFLAGS, CXXFLAGS and LDFLAGS definitions to be append rather than set. This allows passing them at compile-time to make(1).
-rw-r--r--configure.ac12
-rwxr-xr-xinfrastructure/makebuildenv.pl.in6
2 files changed, 14 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index e4b4dda4..7a7c8332 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,16 @@ if test "x$ac_cv_cxx_exceptions" != "xyes" || \
AC_MSG_ERROR([[basic compile checks failed, the C++ compiler is broken]])
fi
+case $build_os in
+solaris*)
+ isa_bits=`isainfo -b`
+ AC_MSG_NOTICE([setting compiler to use -m$isa_bits on Solaris])
+ CFLAGS="$CFLAGS -m$isa_bits"
+ CXXFLAGS="$CXXFLAGS -m$isa_bits"
+ LDFLAGS="$LDFLAGS -m$isa_bits"
+ ;;
+esac
+
if test "x$GXX" = "xyes"; then
# Use -Wall if we have gcc. This gives better warnings
AC_SUBST([CXXFLAGS_STRICT], ['-Wall -Wundef'])
@@ -411,7 +421,7 @@ fi
cat parcels.txt | sed -e 's/#.*//' | while read cmd subdir configure_args; do
if test "$cmd" = "subdir"; then
echo
- export CC CXX CXXFLAGS LDFLAGS LIBS
+ export CC CXX CFLAGS CXXFLAGS LDFLAGS LIBS
args="$configure_args --target=$target_alias"
echo "Configuring $subdir with: $args"
diff --git a/infrastructure/makebuildenv.pl.in b/infrastructure/makebuildenv.pl.in
index db081dd4..8fe1baeb 100755
--- a/infrastructure/makebuildenv.pl.in
+++ b/infrastructure/makebuildenv.pl.in
@@ -568,16 +568,16 @@ WINDRES = @WINDRES@
DEFAULT_CXXFLAGS = @CPPFLAGS@ $default_cxxflags @CXXFLAGS_STRICT@ \\
$include_paths $extra_platform_defines \\
-DBOX_VERSION="\\"$product_version\\""
-LDFLAGS = @LDFLAGS@ @LDADD_RDYNAMIC@
+LDFLAGS += @LDFLAGS@ @LDADD_RDYNAMIC@
.ifdef RELEASE
-CXXFLAGS = -DBOX_RELEASE_BUILD $release_flags \$(DEFAULT_CXXFLAGS)
+CXXFLAGS += -DBOX_RELEASE_BUILD $release_flags \$(DEFAULT_CXXFLAGS)
OUTBASE = ../../release
OUTDIR = ../../release/$mod
DEPENDMAKEFLAGS = -D RELEASE
VARIENT = RELEASE
.else
-CXXFLAGS = -g \$(DEFAULT_CXXFLAGS)
+CXXFLAGS += -g \$(DEFAULT_CXXFLAGS)
OUTBASE = ../../debug
OUTDIR = ../../debug/$mod
DEPENDMAKEFLAGS =