Ditch 'historical compatibility' and use 'logic' instead

This commit is contained in:
Tim Angus 2013-03-22 11:33:27 +00:00
parent bba199e795
commit 8d70929d12
4 changed files with 38 additions and 63 deletions

View File

@ -6,15 +6,15 @@
COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'|sed -e 's/\//_/g')
COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/i386/)
COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/x86/)
ifeq ($(COMPILE_PLATFORM),sunos)
# Solaris uname and GNU uname differ
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/i386/)
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/x86/)
endif
ifeq ($(COMPILE_PLATFORM),darwin)
# Apple does some things a little differently...
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/i386/)
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/x86/)
endif
ifndef BUILD_STANDALONE
@ -57,9 +57,6 @@ PLATFORM=$(COMPILE_PLATFORM)
endif
export PLATFORM
ifeq ($(COMPILE_ARCH),i386)
COMPILE_ARCH=x86
endif
ifeq ($(COMPILE_ARCH),i86pc)
COMPILE_ARCH=x86
endif
@ -87,19 +84,6 @@ ARCH=$(COMPILE_ARCH)
endif
export ARCH
# For historical compatibility reasons on non-windows
# platforms output files use i386 instead of x86
ifeq ($(ARCH),x86)
ifneq ($(PLATFORM),mingw32)
FILE_ARCH=i386
endif
endif
ifndef FILE_ARCH
FILE_ARCH=$(ARCH)
endif
export FILE_ARCH
ifneq ($(PLATFORM),$(COMPILE_PLATFORM))
CROSS_COMPILING=1
else
@ -524,7 +508,6 @@ ifeq ($(PLATFORM),mingw32)
-fstrength-reduce
OPTIMIZE = $(OPTIMIZEVM) --fast-math
HAVE_VM_COMPILED = true
FILE_ARCH=x64
endif
ifeq ($(ARCH),x86)
OPTIMIZEVM = -O3 -march=i586 -fno-omit-frame-pointer \
@ -653,10 +636,6 @@ ifeq ($(PLATFORM),freebsd)
BASE_CFLAGS += -m64
endif
endif
ifeq ($(ARCH),x86_64)
FILE_ARCH=amd64
endif
else # ifeq freebsd
#############################################################################
@ -702,10 +681,6 @@ ifeq ($(PLATFORM),openbsd)
CLIENT_LIBS += -lcurl
endif
endif
ifeq ($(ARCH),x86_64)
FILE_ARCH=amd64
endif
else # ifeq openbsd
#############################################################################
@ -727,10 +702,6 @@ ifeq ($(PLATFORM),netbsd)
endif
BUILD_CLIENT = 0
ifeq ($(ARCH),x86_64)
FILE_ARCH=amd64
endif
else # ifeq netbsd
#############################################################################
@ -850,11 +821,11 @@ ifeq ($(USE_FREETYPE),1)
endif
ifndef FULLBINEXT
FULLBINEXT=.$(FILE_ARCH)$(BINEXT)
FULLBINEXT=.$(ARCH)$(BINEXT)
endif
ifndef SHLIBNAME
SHLIBNAME=$(FILE_ARCH).$(SHLIBEXT)
SHLIBNAME=$(ARCH).$(SHLIBEXT)
endif
ifneq ($(BUILD_SERVER),0)
@ -1142,7 +1113,6 @@ targets: makedirs
@echo "Building $(CLIENTBIN) in $(B):"
@echo " PLATFORM: $(PLATFORM)"
@echo " ARCH: $(ARCH)"
@echo " FILE_ARCH: $(FILE_ARCH)"
@echo " VERSION: $(VERSION)"
@echo " COMPILE_PLATFORM: $(COMPILE_PLATFORM)"
@echo " COMPILE_ARCH: $(COMPILE_ARCH)"

View File

@ -98,7 +98,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define PATH_SEP '\\'
#if defined( __WIN64__ )
#define ARCH_STRING "x64"
#define ARCH_STRING "x86_64"
#elif defined _M_ALPHA
#define ARCH_STRING "AXP"
#endif
@ -154,7 +154,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define ARCH_STRING "ppc"
#define Q3_BIG_ENDIAN
#elif defined __i386__
#define ARCH_STRING "i386"
#define ARCH_STRING "x86"
#define Q3_LITTLE_ENDIAN
#elif defined __x86_64__
#undef idx64
@ -184,7 +184,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define PATH_SEP '/'
#if defined __i386__
#define ARCH_STRING "i386"
#define ARCH_STRING "x86"
#elif defined __x86_64__
#undef idx64
#define idx64 1
@ -248,11 +248,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define PATH_SEP '/'
#ifdef __i386__
#define ARCH_STRING "i386"
#define ARCH_STRING "x86"
#elif defined __amd64__
#undef idx64
#define idx64 1
#define ARCH_STRING "amd64"
#define ARCH_STRING "x86_64"
#elif defined __axp__
#define ARCH_STRING "alpha"
#endif
@ -279,7 +279,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define PATH_SEP '/'
#ifdef __i386__
#define ARCH_STRING "i386"
#define ARCH_STRING "x86"
#elif defined __sparc
#define ARCH_STRING "sparc"
#endif

View File

@ -11,42 +11,42 @@ MPACKDIR=missionpack
BIN_OBJ="
build/release-darwin-x86_64/ioquake3.x86_64
build/release-darwin-i386/ioquake3.i386
build/release-darwin-x86/ioquake3.x86
build/release-darwin-ppc/ioquake3.ppc
"
BIN_DEDOBJ="
build/release-darwin-x86_64/ioq3ded.x86_64
build/release-darwin-i386/ioq3ded.i386
build/release-darwin-x86/ioq3ded.x86
build/release-darwin-ppc/ioq3ded.ppc
"
BASE_OBJ="
build/release-darwin-x86_64/$BASEDIR/cgamex86_64.dylib
build/release-darwin-i386/$BASEDIR/cgamei386.dylib
build/release-darwin-x86/$BASEDIR/cgamex86.dylib
build/release-darwin-ppc/$BASEDIR/cgameppc.dylib
build/release-darwin-x86_64/$BASEDIR/uix86_64.dylib
build/release-darwin-i386/$BASEDIR/uii386.dylib
build/release-darwin-x86/$BASEDIR/uix86.dylib
build/release-darwin-ppc/$BASEDIR/uippc.dylib
build/release-darwin-x86_64/$BASEDIR/qagamex86_64.dylib
build/release-darwin-i386/$BASEDIR/qagamei386.dylib
build/release-darwin-x86/$BASEDIR/qagamex86.dylib
build/release-darwin-ppc/$BASEDIR/qagameppc.dylib
"
MPACK_OBJ="
build/release-darwin-x86_64/$MPACKDIR/cgamex86_64.dylib
build/release-darwin-i386/$MPACKDIR/cgamei386.dylib
build/release-darwin-x86/$MPACKDIR/cgamex86.dylib
build/release-darwin-ppc/$MPACKDIR/cgameppc.dylib
build/release-darwin-x86_64/$MPACKDIR/uix86_64.dylib
build/release-darwin-i386/$MPACKDIR/uii386.dylib
build/release-darwin-x86/$MPACKDIR/uix86.dylib
build/release-darwin-ppc/$MPACKDIR/uippc.dylib
build/release-darwin-x86_64/$MPACKDIR/qagamex86_64.dylib
build/release-darwin-i386/$MPACKDIR/qagamei386.dylib
build/release-darwin-x86/$MPACKDIR/qagamex86.dylib
build/release-darwin-ppc/$MPACKDIR/qagameppc.dylib
"
RENDER_OBJ="
build/release-darwin-x86_64/renderer_opengl1_x86_64.dylib
build/release-darwin-i386/renderer_opengl1_i386.dylib
build/release-darwin-x86/renderer_opengl1_x86.dylib
build/release-darwin-ppc/renderer_opengl1_ppc.dylib
build/release-darwin-x86_64/renderer_opengl2_x86_64.dylib
build/release-darwin-i386/renderer_opengl2_i386.dylib
build/release-darwin-x86/renderer_opengl2_x86.dylib
build/release-darwin-ppc/renderer_opengl2_ppc.dylib
"
@ -133,11 +133,11 @@ fi
echo;echo
# i386 client and server
if [ -d build/release-darwin-i386 ]; then
rm -r build/release-darwin-i386
# x86 client and server
if [ -d build/release-darwin-x86 ]; then
rm -r build/release-darwin-x86
fi
(ARCH=i386 CC=gcc-4.0 CFLAGS=$X86_CFLAGS LDFLAGS=$X86_LDFLAGS make -j$NCPU) || exit 1;
(ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS LDFLAGS=$X86_LDFLAGS make -j$NCPU) || exit 1;
echo;echo
@ -198,7 +198,7 @@ echo "
</plist>
" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
# Make UB's from previous builds of i386, x86_64 and ppc binaries
# Make UB's from previous builds of x86, x86_64 and ppc binaries
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN $BIN_DEDOBJ

View File

@ -5,25 +5,30 @@
if [ $# -ne 1 ]; then
echo "Usage: $0 target_architecture"
echo "Example: $0 i386"
echo "Example: $0 x86"
echo "other valid options are x86_64 or ppc"
echo
echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
exit 1
fi
if [ "$1" == "i386" ]; then
BUILDARCH=i386
if [ "$1" == "x86" ]; then
BUILDARCH=x86
DARWIN_GCC_ARCH=i386
elif [ "$1" == "x86_64" ]; then
BUILDARCH=x86_64
elif [ "$1" == "ppc" ]; then
BUILDARCH=ppc
else
echo "Invalid architecture: $1"
echo "Valid architectures are i386, x86_64 or ppc"
echo "Valid architectures are x86, x86_64 or ppc"
exit 1
fi
if [ -z "$DARWIN_GCC_ARCH" ]; then
DARWIN_GCC_ARCH=${BUILDARCH}
fi
CC=gcc-4.0
APPBUNDLE=ioquake3.app
BINARY=ioquake3.${BUILDARCH}
@ -35,10 +40,10 @@ BASEDIR=baseq3
MPACKDIR=missionpack
BIN_OBJ="
build/release-darwin-${BUILDARCH}/ioquake3.${BUILDARCH}
build/release-darwin-${BUILDARCH}/${BINARY}
"
BIN_DEDOBJ="
build/release-darwin-${BUILDARCH}/ioq3ded.${BUILDARCH}
build/release-darwin-${BUILDARCH}/${DEDBIN}
"
BASE_OBJ="
build/release-darwin-${BUILDARCH}/$BASEDIR/cgame${BUILDARCH}.dylib
@ -79,7 +84,7 @@ unset ARCH_LDFLAGS
if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk
ARCH_CFLAGS="-arch ${BUILDARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk \
ARCH_CFLAGS="-arch ${DARWIN_GCC_ARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1050"
ARCH_LDFLAGS=" -mmacosx-version-min=10.5"
fi