Better system build flags handling.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1923 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2005-10-25 15:38:28 +00:00
parent eebed92d12
commit 6c08bf462b
3 changed files with 40 additions and 2 deletions
+6 -2
View File
@@ -67,12 +67,14 @@ EOF
# Returns: 0 - if compile successful # Returns: 0 - if compile successful
# something else - if compile failed # something else - if compile failed
try_compile_c() { try_compile_c() {
local SYSTEM_FLAGS
if [ -z "$COMPILE" ]; then if [ -z "$COMPILE" ]; then
echo "Fatal: Program \$COMPILE is not defined!" >&2 echo "Fatal: Program \$COMPILE is not defined!" >&2
exit 1 exit 1
fi fi
SYSTEM_FLAGS="$SYSTEM_BUILD_CFLAGS $SYSTEM_BUILD_LDFLAGS $SYSTEM_HOST_CFLAGS $SYSTEM_HOST_LDFLAGS"
cat > "$TEMPFILE.c" cat > "$TEMPFILE.c"
echo_and_perform $COMPILE $1 $2 "$TEMPFILE.c" \ echo_and_perform $COMPILE $SYSTEM_FLAGS $1 $2 "$TEMPFILE.c" \
-o "$TEMPFILE.out" >> "$BUILDLOG" 2>&1 -o "$TEMPFILE.out" >> "$BUILDLOG" 2>&1
RESULT=$? RESULT=$?
if [ $RESULT -ne 0 ]; then if [ $RESULT -ne 0 ]; then
@@ -92,12 +94,14 @@ try_compile_c() {
# Returns: -1 - if compile failed # Returns: -1 - if compile failed
# otherwise - exit status of the program # otherwise - exit status of the program
try_compile_and_run_c() { try_compile_and_run_c() {
local SYSTEM_FLAGS
if [ -z "$COMPILE" ]; then if [ -z "$COMPILE" ]; then
echo "Fatal: Program \$COMPILE is not defined!" >&2 echo "Fatal: Program \$COMPILE is not defined!" >&2
exit 1 exit 1
fi fi
SYSTEM_FLAGS="$SYSTEM_BUILD_CFLAGS $SYSTEM_BUILD_LDFLAGS $SYSTEM_HOST_CFLAGS $SYSTEM_HOST_LDFLAGS"
cat > "$TEMPFILE.c" cat > "$TEMPFILE.c"
echo_and_perform $COMPILE $1 $2 "$TEMPFILE.c" \ echo_and_perform $COMPILE $SYSTEM_FLAGS $1 $2 "$TEMPFILE.c" \
-o "$TEMPFILE.out" >> "$BUILDLOG" 2>&1 -o "$TEMPFILE.out" >> "$BUILDLOG" 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
return -1 return -1
+12
View File
@@ -18,6 +18,18 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
# System specific build flags #
##############################################################################
# CFLAGS
SYSTEM_BUILD_CFLAGS=""
# LDFLAGS
SYSTEM_BUILD_LDFLAGS=""
############################################################################## ##############################################################################
# Describe the programs (possibly) used: # # Describe the programs (possibly) used: #
############################################################################## ##############################################################################
+22
View File
@@ -18,6 +18,28 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
# System specific build flags #
##############################################################################
# CFLAGS
case "$HOST_SYSTEM" in
CYGWIN*)
# HACK: sdl-config on Cygwin supplies -mno-cygwin which means that
# dependencies detected without that flag may not be available at
# the actual build.
SYSTEM_HOST_CFLAGS="-mno-cygwin"
;;
*)
SYSTEM_HOST_CFLAGS=""
;;
esac
# LDFLAGS
SYSTEM_HOST_LDFLAGS=""
############################################################################## ##############################################################################
# Describe the programs (possibly) used: # # Describe the programs (possibly) used: #
############################################################################## ##############################################################################