summaryrefslogtreecommitdiff
path: root/installplatform
diff options
context:
space:
mode:
Diffstat (limited to 'installplatform')
-rwxr-xr-xinstallplatform139
1 files changed, 134 insertions, 5 deletions
diff --git a/installplatform b/installplatform
index a68b3c06a..79209e080 100755
--- a/installplatform
+++ b/installplatform
@@ -6,9 +6,10 @@ platformdir="${pkglibdir}/platform"
RPMRC="${1:-rpmrc}"
PLATFORM="${2:-platform}"
-VENDOR="${3}"
-OS="${4}"
-RPMRC_GNU="${5}"
+MACROS="${3:-macros}"
+VENDOR="${4}"
+OS="${5}"
+RPMRC_GNU="${6}"
for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
RPMRC_OPTFLAGS="`sed -n 's/^optflags: '$ARCH' //p' $RPMRC`"
@@ -53,12 +54,18 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
CANONARCH=s390x
CANONCOLOR=3
;;
- ppc64*)
+ ppc64|ppc64p7)
ISANAME=ppc
ISABITS=64
CANONARCH=ppc64
CANONCOLOR=3
;;
+ ppc64le)
+ ISANAME=ppc
+ ISABITS=64
+ CANONARCH=ppc64le
+ CANONCOLOR=3
+ ;;
ppc*)
ISANAME=ppc
ISABITS=32
@@ -89,6 +96,12 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
CANONARCH=${ARCH}
CANONCOLOR=0
;;
+ armv7h*)
+ ISANAME=armv7hl
+ ISABITS=32
+ CANONARCH=arm
+ CANONCOLOR=0
+ ;;
arm*)
ISANAME=`echo ${ARCH} | sed "s/^\([^-]*\)-.*/\1/"`
ISABITS=32
@@ -101,6 +114,72 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
CANONARCH=alpha
CANONCOLOR=0
;;
+ aarch64)
+ ISANAME=aarch
+ ISABITS=64
+ CANONARCH=aarch64
+ CANONCOLOR=3
+ ;;
+ mips)
+ ISANAME=mips
+ ISABITS=32
+ CANONARCH=mips
+ CANONCOLOR=0
+ ;;
+ mipsel)
+ ISANAME=mips
+ ISABITS=32
+ CANONARCH=mipsel
+ CANONCOLOR=0
+ ;;
+ mips64)
+ ISANAME=mips
+ ISABITS=64
+ CANONARCH=mips64
+ CANONCOLOR=3
+ ;;
+ mips64el)
+ ISANAME=mips
+ ISABITS=64
+ CANONARCH=mips64el
+ CANONCOLOR=3
+ ;;
+ mipsr6)
+ ISANAME=mipsr6
+ ISABITS=32
+ CANONARCH=mipsr6
+ CANONCOLOR=0
+ ;;
+ mipsr6el)
+ ISANAME=mipsr6
+ ISABITS=32
+ CANONARCH=mipsr6el
+ CANONCOLOR=0
+ ;;
+ mips64r6)
+ ISANAME=mipsr6
+ ISABITS=64
+ CANONARCH=mips64r6
+ CANONCOLOR=3
+ ;;
+ mips64r6el)
+ ISANAME=mipsr6
+ ISABITS=64
+ CANONARCH=mips64r6el
+ CANONCOLOR=3
+ ;;
+ m68k)
+ ISANAME=m68k
+ ISABITS=32
+ CANONARCH=m68k
+ CANONCOLOR=0
+ ;;
+ riscv64)
+ ISANAME=riscv
+ ISABITS=64
+ CANONARCH=riscv64
+ CANONCOLOR=3
+ ;;
noarch)
CANONARCH=noarch
CANONCOLOR=0
@@ -111,6 +190,53 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
# skip architectures for which we dont have full config parameters
[ -z "$CANONARCH" ] && continue
+ for macro in $(rpm --showrc | grep _host_cpu | cut -f2 );do
+ case "$macro" in
+ sparc64*)
+ CANONCOLOR=3
+ ;;
+ sparc*)
+ CANONCOLOR=0
+ ;;
+ s390)
+ CANONCOLOR=0
+ ;;
+ s390x)
+ CANONCOLOR=3
+ ;;
+ ppc64*)
+ CANONCOLOR=3
+ ;;
+ ppc*)
+ CANONCOLOR=0
+ ;;
+ i?86|pentium?|athlon|geode)
+ CANONCOLOR=0
+ ;;
+ x86_64|amd64|ia32e)
+ CANONCOLOR=3
+ ;;
+ ia64)
+ CANONCOLOR=2
+ ;;
+ sh*)
+ CANONCOLOR=0
+ ;;
+ arm*)
+ CANONCOLOR=0
+ ;;
+ alpha*)
+ CANONCOLOR=0
+ ;;
+ aarch64)
+ CANONCOLOR=3
+ ;;
+ noarch)
+ CANONCOLOR=0
+ ;;
+ esac
+ done
+
if [ "$OS" = "linux" ] && [ "$CANONCOLOR" = 3 ]; then
LIB=${LIB}64
fi
@@ -119,7 +245,7 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
[ -d $PPD ] || mkdir -p $PPD
cat $PLATFORM \
- | sed -e "s,@RPMRC_OPTFLAGS@,$RPMRC_OPTFLAGS," \
+ | sed -e "s#@RPMRC_OPTFLAGS@#$RPMRC_OPTFLAGS#" \
-e "s,@RPMCANONARCH@,$CANONARCH,g" \
-e "s,@RPMCANONCOLOR@,$CANONCOLOR," \
-e "s,@RPMRC_GNU@,$RPMRC_GNU," \
@@ -134,3 +260,6 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
> ${PPD}/macros
done
+
+# gently adjust undefined autoconf variables to rpm macros...
+cat $MACROS | sed -e 's,${prefix},%{_prefix},g' > ${DESTDIR}/${pkglibdir}/macros