From 16b72cb7fb0dfeb68eb0573cb39717c96a1bb13f Mon Sep 17 00:00:00 2001 From: meep-eep Date: Mon, 3 Feb 2003 01:48:13 +0000 Subject: [PATCH] Some updates. Still needs work. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@642 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/Makefile.build | 11 +++++ sc2/build/build.config | 6 +++ sc2/build/build.sh | 3 ++ sc2/build/build_functions | 22 ++++++++-- sc2/build/config_proginfo | 88 +++++++++++++++++++++------------------ sc2/src/Makeinfo | 2 +- 6 files changed, 88 insertions(+), 44 deletions(-) diff --git a/sc2/Makefile.build b/sc2/Makefile.build index 0d820c948..2fb25a6e6 100644 --- a/sc2/Makefile.build +++ b/sc2/Makefile.build @@ -1,6 +1,13 @@ default: ./build sc2 +%.rc.o: + @DIR=$(dir $@); \ + if [ ! -d $$DIR ]; then \ + mkdir -p "$$DIR"; \ + fi + $(WINDRES) -o $@ $< + %.o: @DIR=$(dir $@); \ if [ ! -d $$DIR ]; then \ @@ -13,3 +20,7 @@ target-%: -include $(DEPEND_FILE) +# Temporary: +obj/release/./src/res/UrQuanMasters.rc.o: ./src/res/UrQuanMasters.rc +obj/debug/./src/res/UrQuanMasters.rc.o: ./src/res/UrQuanMasters.rc + diff --git a/sc2/build/build.config b/sc2/build/build.config index 687e05205..f3bf8750f 100644 --- a/sc2/build/build.config +++ b/sc2/build/build.config @@ -10,6 +10,12 @@ have_program gcc || exit 1 COMPILE="$PROG_gcc_FILE" +case "$OSNAME" in + MINGW32*) + have_program windres + ;; +esac + # Define WORDS_BIGENDIAN on bigendian machines check_endianness diff --git a/sc2/build/build.sh b/sc2/build/build.sh index 34d52a858..be75824bd 100644 --- a/sc2/build/build.sh +++ b/sc2/build/build.sh @@ -51,6 +51,9 @@ done TOPDIR="$PWD" export TOPDIR +OSNAME=`uname -s` +export OSNAME + if [ $# -lt 1 ]; then usage 1>&2 exit 1; diff --git a/sc2/build/build_functions b/sc2/build/build_functions index 0ff494942..d34d8d65b 100644 --- a/sc2/build/build_functions +++ b/sc2/build/build_functions @@ -69,15 +69,21 @@ build_dependancies() { # Recursively build dependancy information build_rec_dependancies() { - local DEPEND_FILE + local DEPEND_FILE EXTRA_OFILES + echo "Building dependancy information..." 1>&2 - BUILD_FILES_VAR=${BUILD_PROJECT}_CFILES + + BUILD_FILES_VAR=${BUILD_PROJECT}_EXTRA_OFILES export BUILD_FILES_VAR + EXTRA_OFILES=`build_do_recursive build_collect_extra_o_files :` + + BUILD_FILES_VAR=${BUILD_PROJECT}_CFILES OFILES=`build_do_recursive build_collect_o_files :` + eval DEPEND_FILE=".depend.\${${BUILD_PROJECT}_NAME}" { eval echo -n "target-\${${BUILD_PROJECT}_NAME}:" - for OFILE in $OFILES; do + for OFILE in $OFILES $EXTRA_OFILES; do echo -n " $OFILE" done echo @@ -90,11 +96,21 @@ build_collect_o_files() { eval echo "\${${BUILD_PROJECT}_OBJS}\${1%.c}.o" } +# Output the extra .o file with the complete path +build_collect_extra_o_files() { + eval echo "\${${BUILD_PROJECT}_OBJS}\$1" +} + # Recursively collect .o-files build_rec_collect_o_files() { + local EXTRA_OFILES + BUILD_FILES_VAR=${BUILD_PROJECT}_CFILES export BUILD_FILES_VAR build_do_recursive build_collect_o_files : + + BUILD_FILES_VAR=${BUILD_PROJECT}_EXTRA_OFILES + build_do_recursive build_collect_extra_o_files : } # Start the configure program. diff --git a/sc2/build/config_proginfo b/sc2/build/config_proginfo index 9f517dd11..556b778d8 100644 --- a/sc2/build/config_proginfo +++ b/sc2/build/config_proginfo @@ -40,25 +40,29 @@ PROG_tr_FILE="tr" PROG_tr_ACTION="" PROG_tr_VERSION='' +PROG_windres_NAME=windres +PROG_windres_FILE=windres +PROG_windres_ACTION="" +PROG_windres_VERSION='windres --version' + # Describe the libaries (possibly) used: LIB_SDL_NAME="Simple DirectMedia Layer" -if [ `uname` = 'FreeBSD' ]; then - LIB_SDL_CFLAGS='$(sdl11-config --cflags)'; -else - LIB_SDL_CFLAGS='$(sdl-config --cflags)'; -fi -if [ `uname` = 'FreeBSD' ]; then - LIB_SDL_LDFLAGS='$(sdl11-config --libs)'; -else - LIB_SDL_LDFLAGS='$(sdl-config --libs)'; -fi -if [ `uname` = 'FreeBSD' ]; then - LIB_SDL_VERSION='$(sdl11-config --version)'; -else - LIB_SDL_VERSION='$(sdl-config --version)'; -fi +OSNAME=`uname -s` + +case "$OSNAME" in + FreeBSD) LIB_SDL_CFLAGS='$(sdl11-config --cflags)' ;; + *) LIB_SDL_CFLAGS='$(sdl-config --cflags)' ;; +esac +case "$OSNAME" in + FreeBSD) LIB_SDL_LDFLAGS='$(sdl11-config --libs)' ;; + *) LIB_SDL_LDFLAGS='$(sdl-config --libs)' ;; +esac +case "$OSNAME" in + FreeBSD) LIB_SDL_VERSION='$(sdl11-config --version)' ;; + *) LIB_SDL_VERSION='$(sdl-config --version)' ;; +esac LIB_SDL_mixer_NAME="SDL_mixer" LIB_SDL_mixer_CFLAGS="$LIB_SDL_CFLAGS" @@ -72,27 +76,28 @@ LIB_SDL_image_VERSION="" LIB_openal_NAME="OpenAL" LIB_openal_CFLAGS="" -if [ `uname` = 'FreeBSD' ]; then - LIB_openal_LDFLAGS="-L/usr/local/lib -pthread -lopenal" -elif [ `uname | $PROG_sed_FILE s/^MINGW32.*$/MINGW32/` = 'MINGW32' ]; then - LIB_openal_LDFLAGS="-lopenal32" -else - LIB_openal_LDFLAGS="-lopenal" -fi +case "$OSNAME" in + FreeBSD) LIB_openal_LDFLAGS="-L/usr/local/lib -pthread -lopenal" ;; + MINGW32*) LIB_openal_LDFLAGS="-lopenal32" ;; + *) LIB_openal_LDFLAGS="-lopenal" ;; +esac LIB_openal_VERSION="" - LIB_opengl_NAME="OpenGL" -if [ `uname` = 'FreeBSD' ]; then - LIB_opengl_CFLAGS="-I/usr/X11R6/include -D_THREAD_SAFE" - LIB_opengl_LDFLAGS="-L/usr/X11R6/lib -lX11 -lXext -pthread -lGL" -elif [ `uname | $PROG_sed_FILE s/^MINGW32.*$/MINGW32/` = 'MINGW32' ]; then - LIB_opengl_CFLAGS="" - LIB_opengl_LDFLAGS="-lopengl32" -else - LIB_opengl_CFLAGS="" - LIB_opengl_LDFLAGS="-lGL" -fi +case "$OSNAME" in + FreeBSD) + LIB_opengl_CFLAGS="-I/usr/X11R6/include -D_THREAD_SAFE" + LIB_opengl_LDFLAGS="-L/usr/X11R6/lib -lX11 -lXext -pthread -lGL" + ;; + MINGW32*) + LIB_opengl_CFLAGS="" + LIB_opengl_LDFLAGS="-lopengl32" + ;; + *) + LIB_opengl_CFLAGS="" + LIB_opengl_LDFLAGS="-lGL" + ;; +esac LIB_opengl_VERSION="" LIB_vorbis_NAME="Vorbis" @@ -101,12 +106,15 @@ LIB_vorbis_LDFLAGS="-lvorbis" LIB_vorbis_VERSION="" LIB_vorbisfile_NAME="Vorbisfile" -if [ `uname` = 'FreeBSD' ]; then - LIB_vorbisfile_CFLAGS="-I/usr/local/include" - LIB_vorbisfile_LDFLAGS="-L/usr/local/lib -lvorbisfile -lvorbis" -else - LIB_vorbisfile_CFLAGS="" - LIB_vorbisfile_LDFLAGS="-lvorbisfile -lvorbis" -fi +case "$OSNAME" in + FreeBSD) + LIB_vorbisfile_CFLAGS="-I/usr/local/include" + LIB_vorbisfile_LDFLAGS="-L/usr/local/lib -lvorbisfile -lvorbis" + ;; + *) + LIB_vorbisfile_CFLAGS="" + LIB_vorbisfile_LDFLAGS="-lvorbisfile -lvorbis" + ;; +esac LIB_vorbisfile_VERSION="" diff --git a/sc2/src/Makeinfo b/sc2/src/Makeinfo index 2fb879817..df83841a1 100644 --- a/sc2/src/Makeinfo +++ b/sc2/src/Makeinfo @@ -1,4 +1,4 @@ -uqm_SUBDIRS="sc2code getopt" +uqm_SUBDIRS="sc2code getopt res" uqm_CFILES="options.c port.c starcon2.c" test_CFILES=test.c