[ioquake3] 05/10: debian/q3arch: update and simplify for new upstream
Simon McVittie
smcv at debian.org
Fri Oct 2 09:20:16 UTC 2015
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch master
in repository ioquake3.
commit fc205f047a10ac8ba25c7ec68599411e78ec8e7f
Author: Simon McVittie <smcv at debian.org>
Date: Sun Aug 2 13:36:29 2015 +0100
debian/q3arch: update and simplify for new upstream
- arm* CPU maps to ARCH=arm
- remove compat_arch: unused and never actually worked
- remove rtcw_file_arch: unused
---
debian/changelog | 4 ++
debian/copyright | 9 +++
debian/q3arch | 175 ++++++++++++++++++++++++++-----------------------------
debian/rules | 9 +--
4 files changed, 96 insertions(+), 101 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index f9a4946..d8bf307 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,10 @@ ioquake3 (1.36+u20150730+dfsg1-1) UNRELEASED; urgency=medium
- should hopefully be portable to new architectures by default
* Set FULLBINEXT="" to omit extension from executables, instead of
renaming them afterwards
+ * debian/q3arch: update and simplify for new upstream
+ - arm* CPU maps to ARCH=arm
+ - remove compat_arch: unused and never actually worked
+ - remove rtcw_file_arch: unused
-- Simon McVittie <smcv at debian.org> Tue, 14 Jul 2015 10:08:13 +0100
diff --git a/debian/copyright b/debian/copyright
index 3e3c18c..804925f 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -52,6 +52,15 @@ Copyright:
© 2010-2015 Simon McVittie
License: GPL-2+
+Files:
+ debian/q3arch
+Copyright:
+ © 2009-2015 Simon McVittie <smcv at debian.org>
+License: permissive
+ Copying and distribution of this file, with or without modification, are
+ permitted in any medium without royalty provided this notice is preserved.
+ This file is offered as-is, without any warranty.
+
Files: code/qcommon/md5.c
Copyright: no copyright is claimed
License: not-applicable
diff --git a/debian/q3arch b/debian/q3arch
index 1a04f95..f4c3e27 100755
--- a/debian/q3arch
+++ b/debian/q3arch
@@ -1,49 +1,57 @@
#!/bin/sh
-# Usage: q3arch arch|platform|compat_arch BUILD|HOST
#
-# Output an architecture or platform name that Quake 3 could use for the
+# Output an architecture and/or platform name that Quake 3 could use for the
# build or host CPU architecture or operating system.
set -e
-case $1 in
+case "$2" in
+ (BUILD|HOST)
+ eval "$(dpkg-architecture --print-set)"
+ eval "GNU_CPU=\"\${DEB_${2}_GNU_CPU}"\"
+ eval "GNU_SYSTEM=\"\${DEB_${2}_GNU_SYSTEM}"\"
+ ;;
+ (*)
+ GNU_CPU="$2"
+ GNU_SYSTEM="$3"
+ ;;
+esac
+
+# In the upstream Makefile the architecture is given by uname -m, with the
+# following substitutions:
+#
+# i.86 -> x86 (used to be i386)
+# arm* -> arm
+# powerpc -> ppc
+# powerpc64 -> ppc64
+# axp -> alpha on Linux and FreeBSD (used to be axp)
+#
+# alpha, i386, ppc(64), sparc and x86_64 are the architectures with special
+# handling in the Makefile (all except alpha can compile bytecode).
+#
+# Before PR #129 was merged, qcommon.h expected to see one of these:
+#
+# x86, x86_64, AXP (Windows)
+# x86, x86_64, ppc64, ppc, s390, s390x, ia64, alpha, sparc, arm, cris,
+# hppa, mips, sh (Linux, kFreeBSD)
+# some subset of the Linux set (Mac OS, *BSD, SunOS, Irix)
-arch|compat_arch|rtcw_file_arch)
- # In the upstream Makefile the architecture is given by uname -m, with the
- # following substitutions:
- #
- # i.86 -> x86 (used to be i386)
- # powerpc -> ppc
- # powerpc64 -> ppc64
- # axp -> alpha on Linux and FreeBSD (used to be axp)
- #
- # However, for most architectures the build system doesn't actually care,
- # it's just "some other architecture", so we can get away with using the
- # GNU CPU as-is. i386, ppc and x86_64 are the unusual ones.
- #
- # On the other hand, in q_platform.h it all becomes rather more
- # significant: the engine expects to see one of:
- #
- # x86, x86_64, AXP (Windows)
- # x86, x86_64, ppc64, ppc, s390, s390x, ia64, alpha, sparc, arm, cris,
- # hppa, mips, sh (Linux, kFreeBSD)
- # some subset of the Linux set (Mac OS, *BSD, SunOS, Irix)
-
- DEB_X_GNU_CPU=`dpkg-architecture -qDEB_$2_GNU_CPU`
- COMPAT_Q3ARCH=
- RTCW_FILE_ARCH=
-
- case ${DEB_X_GNU_CPU} in
+Q3ARCH="${GNU_CPU}"
+case ${GNU_CPU} in
i?86)
Q3ARCH=x86
- COMPAT_Q3ARCH=i386
- RTCW_FILE_ARCH=i386
+ # previously Q3ARCH=i386
+ # RTCW FILE_ARCH=i386
+ ;;
+
+ arm*)
+ Q3ARCH=arm
;;
alpha)
Q3ARCH=alpha
- COMPAT_Q3ARCH=axp
+ # previously Q3ARCH=axp
;;
powerpc)
@@ -55,68 +63,34 @@ arch|compat_arch|rtcw_file_arch)
;;
mipsel)
+ # both mips and mipsel have $(uname -m) = mips
Q3ARCH=mips
;;
- x86_64|s390|s390x|ia64|sparc|hppa|mips|arm|aarch64)
- Q3ARCH=${DEB_X_GNU_CPU}
- ;;
-
sh4)
Q3ARCH=sh
;;
+esac
- *)
- echo "CPU ${DEB_X_GNU_CPU} not supported by Quake 3, might not work" >&2
- Q3ARCH=${DEB_X_GNU_CPU}
- ;;
-
- esac
-
- case $1 in
- (arch)
- echo "DEB_$2_GNU_CPU = ${DEB_X_GNU_CPU}, using Q3 architecture ${Q3ARCH}">&2
- echo ${Q3ARCH}
- ;;
- (compat_arch)
- if test -n "${COMPAT_ARCH}"; then
- echo "DEB_$2_GNU_CPU = ${DEB_X_GNU_CPU}, older ioquake3 would use ${COMPAT_ARCH}">&2
- echo ${COMPAT_ARCH}
- fi
- ;;
- (rtcw_file_arch)
- if test -n "${RTCW_FILE_ARCH}"; then
- echo "DEB_$2_GNU_CPU = ${DEB_X_GNU_CPU}, RTCW files use ${RTCW_FILE_ARCH}">&2
- echo ${RTCW_FILE_ARCH}
- fi
- ;;
- esac
-
- ;;
-
-platform)
- # In the upstream Makefile the platform is given by uname, with the
- # following substitutions:
- #
- # anything after _ removed
- # folded to lower case
- # / -> _
- #
- # This would result in Debian builds being done for linux, gnu_kfreebsd and
- # gnu.
- #
- # However, for most platform names the build system doesn't actually care,
- # it's just "some other platform", so we can get away with using the
- # GNU system as-is.
- #
- # (For instance, on Debian kFreeBSD buildd, uname says GNU/kFreeBSD whereas
- # the GNU CPU type is kfreebsd-gnu, but that's not important because the
- # Makefile doesn't actually do anything different.)
-
- DEB_X_GNU_SYSTEM=`dpkg-architecture -qDEB_$2_GNU_SYSTEM`
-
- case ${DEB_X_GNU_SYSTEM} in
+# In the upstream Makefile the platform is given by uname, with the
+# following substitutions:
+#
+# anything after _ removed
+# folded to lower case
+# / -> _
+#
+# This would result in Debian builds being done for linux, gnu_kfreebsd and
+# gnu.
+#
+# However, for most platform names the build system doesn't actually care,
+# it's just "some other platform", so we can get away with using the
+# GNU system as-is.
+#
+# (For instance, on Debian kFreeBSD buildd, uname says GNU/kFreeBSD whereas
+# the GNU CPU type is kfreebsd-gnu, but that's not important because the
+# Makefile doesn't actually do anything different.)
+case ${GNU_SYSTEM} in
linux-gnu*)
# including, but not limited to:
# arm-linux-gnueabi (Debian armel: ARM EABI, LE)
@@ -124,26 +98,41 @@ platform)
# powerpc-linux-gnuspe (Debian powerpcspe: Signal Processing Extension)
Q3OS=linux
;;
-
*)
- Q3OS=${DEB_X_GNU_SYSTEM}
+ Q3OS=${GNU_SYSTEM}
;;
+esac
- esac
+echo "GNU CPU: ${GNU_CPU}" >&2
+echo " => Q3 ARCH: ${Q3ARCH}" >&2
+echo "GNU system ${GNU_SYSTEM}" >&2
+echo " => Q3 PLATFORM: ${Q3OS}" >&2
- echo "DEB_$2_GNU_SYSTEM = ${DEB_X_GNU_SYSTEM}, using Q3 platform ${Q3OS}">&2
- echo ${Q3OS}
+case $1 in
+(make)
+ echo "ARCH=\"${Q3ARCH}\" PLATFORM=\"${Q3OS}\""
+ ;;
+
+(arch)
+ echo ${Q3ARCH}
+ ;;
+
+(platform)
+ echo ${Q3OS}
;;
*)
- echo "Usage: sh q3arch.sh arch|compat_arch|platform BUILD|HOST" >&2
+ echo "Usage:" >&2
+ echo " q3arch MODE BUILD|HOST" >&2
+ echo " or q3arch MODE CPU SYSTEM" >&2
+ echo "MODE is: make|arch|platform" >&2
exit 1
;;
esac
-# Copyright 2009-2013 Simon McVittie <smcv at debian.org>
+# Copyright 2009-2015 Simon McVittie <smcv at debian.org>
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided this notice is preserved.
# This file is offered as-is, without any warranty.
diff --git a/debian/rules b/debian/rules
index 8ecf364..e285da1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,10 +14,6 @@ DEB_CFLAGS_MAINT_APPEND := \
include /usr/share/dpkg/default.mk
-Q3ARCH := $(shell $(CURDIR)/debian/q3arch arch HOST)
-Q3PLATFORM := $(shell $(CURDIR)/debian/q3arch platform HOST)
-Q3COMPILE_ARCH := $(shell $(CURDIR)/debian/q3arch arch BUILD)
-Q3COMPILE_PLATFORM := $(shell $(CURDIR)/debian/q3arch platform BUILD)
distro := $(shell lsb_release -is)
PRODUCT_DATE := $(shell date --utc --date="`dpkg-parsechangelog -SDate`" "+%b %_d %Y")
@@ -43,10 +39,7 @@ OPTIONS := \
USE_OPENAL=1 \
USE_OPENAL_DLOPEN=0 \
USE_VOIP=1 \
- ARCH=$(Q3ARCH) \
- PLATFORM=$(Q3PLATFORM) \
- COMPILE_ARCH=$(Q3COMPILE_ARCH) \
- COMPILE_PLATFORM=$(Q3COMPILE_PLATFORM) \
+ $(shell $(CURDIR)/debian/q3arch make ${DEB_HOST_GNU_CPU} ${DEB_HOST_GNU_SYSTEM}) \
BUILD_CLIENT_SMP=1 \
DEFAULT_BASEDIR=/usr/lib/ioquake3 \
BUILD_GAME_SO=1 \
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git
More information about the Pkg-games-commits
mailing list