Allow compilation in an other directory on unix, keeping the source tree
clean, by setting the BUILD_WORK environment variable. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1333 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$BUILD_WORK" ]; then
|
||||
BUILD_WORK=.
|
||||
fi
|
||||
|
||||
# Include build functions used here
|
||||
. build/unix/config_functions
|
||||
. build/unix/menu_functions
|
||||
@@ -82,7 +86,7 @@ strictdebug_action() {
|
||||
# We shouldn't do this until we actually nail them
|
||||
# all in the original code. Then we can enforce them
|
||||
# on ourselves.
|
||||
# CFLAGS="$CFLAGS -pedantic-errors -ansi -trigraphs" # ANSI
|
||||
# CFLAGS="$CFLAGS -pedantic-errors -ansi -trigraphs" # ANSI
|
||||
# CFLAGS="$CFLAGS -Wnested-externs"
|
||||
# We know they're in the code, and though we'd like to get
|
||||
# rid of them, they're not bugs.
|
||||
@@ -182,7 +186,7 @@ INPUT_install_sharedir_VALIDATOR=validate_path
|
||||
|
||||
|
||||
# Show the menu and let people set things
|
||||
do_menu MENU main config.state
|
||||
do_menu MENU main "$BUILD_WORK/config.state"
|
||||
echo "Configuration complete."
|
||||
|
||||
# Set INSTALL_LIBDIR, INSTALL_BINDIR, and INSTALL_SHAREDIR to the specified
|
||||
@@ -197,22 +201,23 @@ prefix="$INPUT_install_prefix_VALUE" \
|
||||
# Set the content dir
|
||||
CONTENTDIR="${INSTALL_SHAREDIR}uqm/content"
|
||||
|
||||
CFLAGS="$CFLAGS -I \"$BUILD_WORK\""
|
||||
|
||||
# Export the HAVE_ symbols to config.h, using config.h.in as template
|
||||
# Export the HAVE_ symbols to config_unix.h, using config_unix.h.in as template
|
||||
SUBSTITUTE_VARS="$HAVE_SYMBOLS CONTENTDIR"
|
||||
SUBSTITUTE_FILES="src/config.h"
|
||||
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES
|
||||
SUBSTITUTE_FILES="config_unix.h"
|
||||
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES src "$BUILD_WORK"
|
||||
|
||||
# Make build.vars from build.vars.in, substituting variables.
|
||||
SUBSTITUTE_VARS="CFLAGS LDFLAGS MAKE DEBUG SOUNDMODULE HAVE_OPENGL \
|
||||
USE_ZIP_IO \
|
||||
INSTALL_LIBDIR INSTALL_BINDIR INSTALL_SHAREDIR WINDRES"
|
||||
SUBSTITUTE_FILES="build.vars"
|
||||
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES
|
||||
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES . "$BUILD_WORK"
|
||||
|
||||
# Make 'uqm' shell script from build.vars.in, substituting variables.
|
||||
SUBSTITUTE_VARS="INSTALL_LIBDIR INSTALL_BINDIR INSTALL_SHAREDIR uqm_NAME"
|
||||
SUBSTITUTE_FILES="build/unix/uqm"
|
||||
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES
|
||||
SUBSTITUTE_FILES="uqm-wrapper"
|
||||
substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES build/unix "$BUILD_WORK"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user