mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
all: update build scripts to fix AIX XL/C compatibility
This commit is contained in:
parent
c3c9c7b6ae
commit
4982d4ebc3
6 changed files with 35 additions and 11 deletions
19
bin/9c
19
bin/9c
|
@ -82,6 +82,23 @@ useclang()
|
||||||
cflags="$ngflags -g"
|
cflags="$ngflags -g"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
usexlc()
|
||||||
|
{
|
||||||
|
cc=${CC9:-xlc_r}
|
||||||
|
ngflags=" \
|
||||||
|
-c \
|
||||||
|
-O0 \
|
||||||
|
-qmaxmem=-1 \
|
||||||
|
-qsuppress=1506-236 \
|
||||||
|
-qsuppress=1506-358 \
|
||||||
|
-qsuppress=1500-010 \
|
||||||
|
-qsuppress=1506-224 \
|
||||||
|
-qsuppress=1506-1300 \
|
||||||
|
-qsuppress=1506-342 \
|
||||||
|
"
|
||||||
|
cflags="$ngflags -g -qfullpath"
|
||||||
|
}
|
||||||
|
|
||||||
tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
|
tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
|
||||||
case "$tag" in
|
case "$tag" in
|
||||||
*DragonFly*gcc*|*BSD*gcc*) usegcc ;;
|
*DragonFly*gcc*|*BSD*gcc*) usegcc ;;
|
||||||
|
@ -120,7 +137,7 @@ case "$tag" in
|
||||||
cflags="$ngflags -g"
|
cflags="$ngflags -g"
|
||||||
cflags="$cflags -D__sun__ -D__${s}__"
|
cflags="$cflags -D__sun__ -D__${s}__"
|
||||||
;;
|
;;
|
||||||
*AIX*) usegcc
|
*AIX*) usexlc
|
||||||
cflags="$ngflags -g -D__AIX__"
|
cflags="$ngflags -g -D__AIX__"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
13
bin/9l
13
bin/9l
|
@ -61,8 +61,9 @@ case "$tag" in
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*AIX*)
|
*AIX*)
|
||||||
ld=${CC9:-gcc}
|
ld="${CC9:-xlc_r} -g -O0"
|
||||||
nmflags="-B"
|
nmflags="-A -B"
|
||||||
|
extralibs="$extralibs -lpthread"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo do not know how to link on "$tag" 1>&2
|
echo do not know how to link on "$tag" 1>&2
|
||||||
|
@ -113,8 +114,8 @@ then
|
||||||
then
|
then
|
||||||
a=`
|
a=`
|
||||||
nm $nmflags $ofiles |
|
nm $nmflags $ofiles |
|
||||||
grep '__p9l_autolib_[a-zA-Z0-9+-]*$' |
|
grep '__p9l_autolib_[a-zA-Z0-9+-]*' |
|
||||||
sed 's/.*__p9l_autolib_//' |
|
sed 's/.*__p9l_autolib_//; s/:.*//' |
|
||||||
sort -u
|
sort -u
|
||||||
`
|
`
|
||||||
for i in $a
|
for i in $a
|
||||||
|
@ -144,8 +145,8 @@ then
|
||||||
do
|
do
|
||||||
b=`
|
b=`
|
||||||
nm $lpath/lib$i.a 2>/dev/null |
|
nm $lpath/lib$i.a 2>/dev/null |
|
||||||
grep '__p9l_autolib_[a-zA-Z0-9+-]*$' |
|
grep '__p9l_autolib_[a-zA-Z0-9+-]*' |
|
||||||
sed 's/.*__p9l_autolib_//' |
|
sed 's/.*__p9l_autolib_//; s/:.*//' |
|
||||||
sort -u |
|
sort -u |
|
||||||
egrep -v '^(thread|draw)$'
|
egrep -v '^(thread|draw)$'
|
||||||
`
|
`
|
||||||
|
|
|
@ -20,7 +20,7 @@ extern "C" {
|
||||||
#define _NETBSD_SOURCE 1 /* NetBSD */
|
#define _NETBSD_SOURCE 1 /* NetBSD */
|
||||||
#define _SVID_SOURCE 1
|
#define _SVID_SOURCE 1
|
||||||
#define _DEFAULT_SOURCE 1
|
#define _DEFAULT_SOURCE 1
|
||||||
#if !defined(__APPLE__) && !defined(__OpenBSD__)
|
#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__AIX__)
|
||||||
# define _XOPEN_SOURCE 1000
|
# define _XOPEN_SOURCE 1000
|
||||||
# define _XOPEN_SOURCE_EXTENDED 1
|
# define _XOPEN_SOURCE_EXTENDED 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,7 +33,7 @@ extern "C" {
|
||||||
# define __LONG_LONG_SUPPORTED
|
# define __LONG_LONG_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
#if defined(__AIX__)
|
#if defined(__AIX__)
|
||||||
# define _XOPEN_SOURCE 1
|
# define _XOPEN_SOURCE 600
|
||||||
#endif
|
#endif
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
# define _DARWIN_NO_64_BIT_INODE /* Snow Leopard */
|
# define _DARWIN_NO_64_BIT_INODE /* Snow Leopard */
|
||||||
|
|
|
@ -27,7 +27,7 @@ $PLAN9/bin/lex: $PLAN9/bin/yacc
|
||||||
|
|
||||||
# This should not be necessary.
|
# This should not be necessary.
|
||||||
$PLAN9/bin/yacc: $O.yacc
|
$PLAN9/bin/yacc: $O.yacc
|
||||||
install -c $O.yacc $PLAN9/bin/yacc
|
$INSTALL -c $O.yacc $PLAN9/bin/yacc
|
||||||
$O.yacc: yacc.$O
|
$O.yacc: yacc.$O
|
||||||
$LD -o $target $prereq
|
$LD -o $target $prereq
|
||||||
yacc.$O: yacc.c
|
yacc.$O: yacc.c
|
||||||
|
|
2
src/mk.AIX-power
Normal file
2
src/mk.AIX-power
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
INSTALL=installbsd
|
||||||
|
|
|
@ -211,5 +211,9 @@ echo cd `pwd`
|
||||||
9c word.c
|
9c word.c
|
||||||
9c unix.c
|
9c unix.c
|
||||||
9l -o o.mk arc.o archive.o bufblock.o env.o file.o graph.o job.o lex.o main.o match.o mk.o parse.o recipe.o rc.o rule.o run.o sh.o shell.o shprint.o symtab.o var.o varsub.o word.o unix.o
|
9l -o o.mk arc.o archive.o bufblock.o env.o file.o graph.o job.o lex.o main.o match.o mk.o parse.o recipe.o rc.o rule.o run.o sh.o shell.o shprint.o symtab.o var.o varsub.o word.o unix.o
|
||||||
install o.mk $PLAN9/bin/mk
|
if [ `uname` = AIX ]; then
|
||||||
|
installbsd o.mk $PLAN9/bin/mk
|
||||||
|
else
|
||||||
|
install o.mk $PLAN9/bin/mk
|
||||||
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
|
|
Loading…
Reference in a new issue