From 7bc1f5ba6b2055303264881afda118fd57b95963 Mon Sep 17 00:00:00 2001 From: ludwig Date: Sun, 28 Aug 2005 13:07:33 +0000 Subject: try to fix build using cons git-svn-id: svn://svn.icculus.org/quake3/trunk@20 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/Construct | 38 +++++++++++++++++++------------------- code/unix/Conscript-client | 22 ++++++++++++++++++++-- code/unix/Conscript-dedicated | 21 ++++++++++++++++++++- 3 files changed, 59 insertions(+), 22 deletions(-) diff --git a/code/Construct b/code/Construct index 82e6e0d..5a91b0f 100755 --- a/code/Construct +++ b/code/Construct @@ -48,9 +48,9 @@ else # detection of CPU type $cpu = `uname -m`; chop ($cpu); -if ($cpu +~ /i?86/) +if ($cpu =~ /i.86/) { - $cpu = 'x86'; + $cpu = 'i386'; } # OS $OS = `uname`; @@ -227,17 +227,17 @@ if ($do_sdk eq 1) # build the config directory $CONFIG_DIR = $config . '-' . $cpu . '-' . $OS . '-' . $libc; -$COMMON_CFLAGS = '-pipe -fsigned-char '; +$COMMON_CFLAGS = '-pipe '; if ($config eq 'debug') { # use -Werror for better QA - $BASE_CFLAGS = $COMMON_CFLAGS . '-g -Wall -Werror -O '; - $BSPC_BASE_CFLAGS = $COMMON_CFLAGS . '-g -O -DLINUX -DBSPC -Dstricmp=strcasecmp '; + $BASE_CFLAGS = $COMMON_CFLAGS . '-g -Wall -O0 '; + $BSPC_BASE_CFLAGS = $COMMON_CFLAGS . '-g -O0 -DLINUX -DBSPC -Dstricmp=strcasecmp '; } else { - $BASE_CFLAGS = $COMMON_CFLAGS . '-DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -fomit-frame-pointer -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce '; + $BASE_CFLAGS = $COMMON_CFLAGS . '-DNDEBUG -O3 -march=i686 -fomit-frame-pointer -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce '; $BSPC_BASE_CFLAGS = $BASE_CFLAGS . '-DLINUX -DBSPC -Dstricmp=strcasecmp '; } @@ -287,11 +287,11 @@ sub build_tools { system("mkdir qvmtools 2>/dev/null"); if (@_[0] eq 'q3lcc') { - system("cd ../lcc ; make all ; cp /tmp/lcc ../code/qvmtools/q3lcc ; cp /tmp/rcc ../code/qvmtools/q3rcc ; cp /tmp/cpp ../code/qvmtools/q3cpp"); + system("cd ../lcc && mkdir -p .obj && make all && cp .obj/q3lcc ../code/qvmtools/q3lcc && cp .obj/q3rcc ../code/qvmtools/q3rcc && cp .obj/q3cpp ../code/qvmtools/q3cpp"); } elsif (@_[0] eq 'q3asm') { - system("cd ../q3asm ; make ; cp q3asm ../code/qvmtools"); + system("cd ../q3asm && make && cp q3asm ../code/qvmtools"); } else { @@ -312,7 +312,7 @@ if ($do_bspc eq 1) $BUILD_DIR = $CONFIG_DIR . '/bspc'; Link $BUILD_DIR => '.'; $INSTALL_DIR = $INSTALL_BASEDIR . '/utils'; - Export qw( BSPC_BASE_CFLAGS BUILD_DIR INSTALL_DIR CC CXX LINK ); + Export qw( BSPC_BASE_CFLAGS BUILD_DIR INSTALL_DIR CC CXX LINK cpu ); Build $BUILD_DIR . '/bspc/Conscript'; } @@ -323,17 +323,17 @@ $INSTALL_DIR = $INSTALL_BASEDIR . '/baseq3'; $BUILD_DIR = $CONFIG_DIR . '/' . $TARGET_DIR . '/cgame'; Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); +Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK cpu ); Build $BUILD_DIR . '/cgame/Conscript'; $BUILD_DIR = $CONFIG_DIR . '/' . $TARGET_DIR . '/game'; Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); +Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK cpu ); Build $BUILD_DIR . '/game/Conscript'; $BUILD_DIR = $CONFIG_DIR . '/' . $TARGET_DIR . '/q3_ui'; Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); +Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK cpu ); Build $BUILD_DIR . '/q3_ui/Conscript'; # build TA @@ -343,17 +343,17 @@ $INSTALL_DIR = $INSTALL_BASEDIR . '/missionpack'; $BUILD_DIR = $CONFIG_DIR . "/" . $TARGET_DIR . '/cgame'; Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); +Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK cpu ); Build $BUILD_DIR . '/cgame/Conscript'; $BUILD_DIR = $CONFIG_DIR . "/" . $TARGET_DIR . '/game'; Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); +Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK cpu ); Build $BUILD_DIR . '/game/Conscript'; $BUILD_DIR = $CONFIG_DIR . '/' . $TARGET_DIR . '/ui'; Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); +Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK cpu ); Build $BUILD_DIR . '/ui/Conscript'; # core @@ -367,7 +367,7 @@ $BUILD_DIR = $CONFIG_DIR . '/core/dedicated'; Link $BUILD_DIR => '.'; $hack = $BASE_CFLAGS; # hit me! $BASE_CFLAGS .= '-DDEDICATED '; -Export qw( BASE_CFLAGS BUILD_DIR INSTALL_DIR CC CXX LINK ); +Export qw( BASE_CFLAGS BUILD_DIR INSTALL_DIR CC CXX LINK cpu ); Build $BUILD_DIR . '/unix/Conscript-dedicated'; $BASE_CFLAGS = $hack; @@ -378,7 +378,7 @@ $BUILD_DIR = $CONFIG_DIR . '/core/client'; $BASE_LDFLAGS = ''; Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS BASE_LDFLAGS BUILD_DIR INSTALL_DIR TARGETNAME CC CXX LINK ); +Export qw( BASE_CFLAGS BASE_LDFLAGS BUILD_DIR INSTALL_DIR TARGETNAME CC CXX LINK cpu ); Build $BUILD_DIR . '/unix/Conscript-client'; if ($do_smp eq 1) @@ -389,7 +389,7 @@ if ($do_smp eq 1) $BASE_LDFLAGS = '-lpthread '; Link $BUILD_DIR => '.'; - Export qw( BASE_CFLAGS BASE_LDFLAGS BUILD_DIR INSTALL_DIR TARGETNAME CC CXX LINK ); + Export qw( BASE_CFLAGS BASE_LDFLAGS BUILD_DIR INSTALL_DIR TARGETNAME CC CXX LINK cpu ); Build $BUILD_DIR . '/unix/Conscript-client'; } @@ -399,7 +399,7 @@ if ($NO_VM eq 0 && $do_pk3 eq 1) $INSTALL_DIR = $INSTALL_BASEDIR; $BUILD_DIR = $CONFIG_DIR . '/pk3-builder'; Link $BUILD_DIR => 'unix'; - Export qw( INSTALL_DIR BUILD_DIR CONFIG_DIR CC CXX LINK ); + Export qw( INSTALL_DIR BUILD_DIR CONFIG_DIR CC CXX LINK cpu ); Build $BUILD_DIR . '/Conscript-pk3'; } diff --git a/code/unix/Conscript-client b/code/unix/Conscript-client index 59173af..0765beb 100755 --- a/code/unix/Conscript-client +++ b/code/unix/Conscript-client @@ -153,7 +153,7 @@ $env = new cons( . $BUILD_DIR . '/unix/asmlib.a ' . $BUILD_DIR . '/unix/inlinelib.a ' . $BASE_LDFLAGS - . '-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -ldl -lm' + . '-L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -ldl -lm' ); @RENDERER_FILES = qw( @@ -253,9 +253,27 @@ $SERVER_REF = \@SERVER_FILES; # FIXME TTimo vm_.c @VM_FILES = qw( ../qcommon/vm.c - ../qcommon/vm_x86.c ../qcommon/vm_interpreted.c ); + +if ($cpu eq 'i386') +{ + push @VM_FILES, qw( + ../qcommon/vm_x86.c + ); +} +elsif ($cpu eq 'ppc') +{ + push @VM_FILES, qw( + ../qcommon/vm_ppc.c + ); +} +else +{ + push @VM_FILES, qw( + ../qcommon/vm_none.c + ); +} $VM_REF = \@VM_FILES; # FIXME: import the CPU string to build the name of the target diff --git a/code/unix/Conscript-dedicated b/code/unix/Conscript-dedicated index 0c64f23..56bcec3 100755 --- a/code/unix/Conscript-dedicated +++ b/code/unix/Conscript-dedicated @@ -109,7 +109,26 @@ $env = new cons( ); $FILESREF = \@FILES; +if ($cpu eq 'i386') +{ + push @FILES, qw( + ../qcommon/vm_x86.c + ); +} +elsif ($cpu eq 'ppc') +{ + push @FILES, qw( + ../qcommon/vm_ppc.c + ); +} +else +{ + push @FILES, qw( + ../qcommon/vm_none.c + ); +} + # DEDICATED_NAME is imported, holds the name of the target # wolfded.x86 usually -Program $env $DEDICATED_NAME, '../qcommon/vm_x86.c', @$FILESREF; +Program $env $DEDICATED_NAME, @$FILESREF; Install $env $INSTALL_DIR, $DEDICATED_NAME; -- cgit v1.2.3