From 03b6d952b5dde23e48352bee59d83c13b7f4b89f Mon Sep 17 00:00:00 2001 From: meep-eep Date: Wed, 19 Feb 2003 21:17:10 +0000 Subject: [PATCH] Some improvements on installation from source. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@785 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/Makeinfo | 10 ++++++---- sc2/build.sh | 2 +- sc2/build/unix/README | 5 +++++ sc2/build/{ => unix}/ansi | 0 sc2/build/{ => unix}/build.config | 11 ++++++++--- sc2/build/{ => unix}/build.docs | 0 sc2/build/{ => unix}/build.sh | 2 +- sc2/build/{ => unix}/build_functions | 18 ++++++++++-------- sc2/build/{ => unix}/config_functions | 2 +- sc2/build/{ => unix}/config_proginfo | 0 sc2/build/{ => unix}/menu_functions | 0 sc2/build/unix/uqm.in | 3 +++ 12 files changed, 35 insertions(+), 18 deletions(-) create mode 100644 sc2/build/unix/README rename sc2/build/{ => unix}/ansi (100%) rename sc2/build/{ => unix}/build.config (95%) rename sc2/build/{ => unix}/build.docs (100%) rename sc2/build/{ => unix}/build.sh (98%) rename sc2/build/{ => unix}/build_functions (95%) rename sc2/build/{ => unix}/config_functions (99%) rename sc2/build/{ => unix}/config_proginfo (100%) rename sc2/build/{ => unix}/menu_functions (100%) create mode 100755 sc2/build/unix/uqm.in diff --git a/sc2/Makeinfo b/sc2/Makeinfo index 0b73c152d..28eae7371 100644 --- a/sc2/Makeinfo +++ b/sc2/Makeinfo @@ -13,13 +13,15 @@ uqm_CFLAGS="$uqm_CFLAGS -I src -I src/sc2code -I src/sc2code/libs" # Stuff to install under the directory for libraries, as specified during # config. -uqm_INSTALL_LIBS=content +uqm_INSTALL_LIBS="content executable" uqm_INSTALL_LIB_content_SRC=content uqm_INSTALL_LIB_content_DEST=uqm/ +uqm_INSTALL_LIB_executable_SRC="$uqm_NAME" +uqm_INSTALL_LIB_executable_DEST=uqm/uqm # Stuff to install under the directory for binaries, as specified during # config. -uqm_INSTALL_BINS=uqm -uqm_INSTALL_BIN_uqm_SRC="$uqm_NAME" -uqm_INSTALL_BIN_uqm_dest="" +uqm_INSTALL_BINS=wrapper +uqm_INSTALL_BIN_wrapper_SRC="build/unix/uqm" +uqm_INSTALL_BIN_wrapper_DEST="uqm" diff --git a/sc2/build.sh b/sc2/build.sh index 673423fce..63501f985 100755 --- a/sc2/build.sh +++ b/sc2/build.sh @@ -22,5 +22,5 @@ SH="${SH:-/bin/sh}" export SH -$SH build/build.sh "$@" +$SH build/unix/build.sh "$@" diff --git a/sc2/build/unix/README b/sc2/build/unix/README new file mode 100644 index 000000000..0cad7d91e --- /dev/null +++ b/sc2/build/unix/README @@ -0,0 +1,5 @@ +This directory contains files used for building and installing +on unix-like environments. +There's no need to use any of those directly; type './build.sh' from +the top dir to get started. + diff --git a/sc2/build/ansi b/sc2/build/unix/ansi similarity index 100% rename from sc2/build/ansi rename to sc2/build/unix/ansi diff --git a/sc2/build/build.config b/sc2/build/unix/build.config similarity index 95% rename from sc2/build/build.config rename to sc2/build/unix/build.config index fbc420a63..3f30a1f30 100644 --- a/sc2/build/build.config +++ b/sc2/build/unix/build.config @@ -1,9 +1,9 @@ #!/bin/sh # Include build functions used here -. build/config_functions -. build/menu_functions -. build/ansi +. build/unix/config_functions +. build/unix/menu_functions +. build/unix/ansi # Some requirements: @@ -185,3 +185,8 @@ SUBSTITUTE_VARS="CFLAGS LDFLAGS MAKE DEBUG SOUNDMODULE HAVE_OPENGL \ SUBSTITUTE_FILES="build.vars" substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES +# Make 'uqm' shell script from build.vars.in, substituting variables. +SUBSTITUTE_VARS="INSTALL_LIBDIR INSTALL_BINDIR uqm_NAME" +SUBSTITUTE_FILES="build/unix/uqm" +substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES + diff --git a/sc2/build/build.docs b/sc2/build/unix/build.docs similarity index 100% rename from sc2/build/build.docs rename to sc2/build/unix/build.docs diff --git a/sc2/build/build.sh b/sc2/build/unix/build.sh similarity index 98% rename from sc2/build/build.sh rename to sc2/build/unix/build.sh index a6cf3d6ca..12b1336a2 100644 --- a/sc2/build/build.sh +++ b/sc2/build/unix/build.sh @@ -20,7 +20,7 @@ # You shouldn't need to change this file if your project changes. # Read in the functions we need -. build/build_functions +. build/unix/build_functions # Read in the config settings that affect the build, if present. # Don't reread for every dir when recursing. diff --git a/sc2/build/build_functions b/sc2/build/unix/build_functions similarity index 95% rename from sc2/build/build_functions rename to sc2/build/unix/build_functions index 893991a0b..17f318db8 100644 --- a/sc2/build/build_functions +++ b/sc2/build/unix/build_functions @@ -115,7 +115,7 @@ build_rec_collect_o_files() { # Start the configure program. build_config() { - $SH build/build.config + $SH build/unix/build.config } # Compile the lot. @@ -192,16 +192,17 @@ build_check_compile() { # Install the program build_install() { - local BINS LIBS SRC DEST BINDIR LIBDIR + local BINS LIBS SRC DEST DESTDIR BINDIR LIBDIR echo "Installing libraries..." 2>&1 eval LIBS="\${${BUILD_PROJECT}_INSTALL_LIBS}" eval LIBDIR="\${${BUILD_PROJECT}_INSTALL_LIBDIR%/}/" for LIB in $LIBS; do eval SRC="\${${BUILD_PROJECT}_INSTALL_LIB_${LIB}_SRC%/}" - eval DEST="\$LIBDIR\${${BUILD_PROJECT}_INSTALL_LIB_${LIB}_DEST%/}" - if [ ! -d "$DEST" ]; then - mkdir -p -- "$DEST" + eval DEST="\$LIBDIR\${${BUILD_PROJECT}_INSTALL_LIB_${LIB}_DEST}" + DESTDIR="${DEST%/*}" + if [ ! -d "$DESTDIR" ]; then + mkdir -p -- "$DESTDIR" fi cp -r -- "$SRC" "$DEST" done @@ -211,9 +212,10 @@ build_install() { eval BINDIR="\${${BUILD_PROJECT}_INSTALL_BINDIR%/}/" for BIN in $BINS; do eval SRC="\${${BUILD_PROJECT}_INSTALL_BIN_${BIN}_SRC%/}" - eval DEST="\$BINDIR\${${BUILD_PROJECT}_INSTALL_BIN_${BIN}_DEST%/}" - if [ ! -d "$DEST" ]; then - mkdir -p -- "$DEST" + eval DEST="\$BINDIR\${${BUILD_PROJECT}_INSTALL_BIN_${BIN}_DEST}" + DESTDIR="${DEST%/*}" + if [ ! -d "$DESTDIR" ]; then + mkdir -p -- "$DESTDIR" fi cp -r -- "$SRC" "$DEST" done diff --git a/sc2/build/config_functions b/sc2/build/unix/config_functions similarity index 99% rename from sc2/build/config_functions rename to sc2/build/unix/config_functions index fdcfc8c1d..ccf4a359f 100644 --- a/sc2/build/config_functions +++ b/sc2/build/unix/config_functions @@ -373,7 +373,7 @@ EOF # Include information about programs we can detect -. build/config_proginfo +. build/unix/config_proginfo # Some initialisations HAVE_SYMBOLS="" diff --git a/sc2/build/config_proginfo b/sc2/build/unix/config_proginfo similarity index 100% rename from sc2/build/config_proginfo rename to sc2/build/unix/config_proginfo diff --git a/sc2/build/menu_functions b/sc2/build/unix/menu_functions similarity index 100% rename from sc2/build/menu_functions rename to sc2/build/unix/menu_functions diff --git a/sc2/build/unix/uqm.in b/sc2/build/unix/uqm.in new file mode 100755 index 000000000..f382d9b62 --- /dev/null +++ b/sc2/build/unix/uqm.in @@ -0,0 +1,3 @@ +#!/bin/sh +# Wrapper script for starting The Ur-Quan Masters +"@INSTALL_LIBDIR@uqm/uqm" "--contentdir=@INSTALL_LIBDIR@uqm/content" "$@"