move linkage check (which uses sh.h INCLUDES_ONLY) to when all of its

prerequisites are actually fulfilled, i.e. evrn further down than with
the last commit doing this, and move some prerequisites of stuff that
has wandered outside the !INCLUDES_ONLY block with the compile-time
assert changes to the outside, too

fixes FTBFS on MSYS which has neither <stdint.h> nor uint32_t
reported by RT
This commit is contained in:
tg
2012-01-03 00:58:09 +00:00
parent 7564594bb8
commit 2578c66b61
3 changed files with 86 additions and 79 deletions

View File

@@ -1,7 +1,8 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.502 2011/12/31 02:54:15 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.503 2012/01/03 00:58:06 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012
# Thorsten Glaser <tg@mirbsd.org>
#
# Provided that these terms and disclaimer and all copyright notices
@@ -1161,51 +1162,6 @@ ac_header strings.h sys/types.h string.h
ac_header ulimit.h sys/types.h
ac_header values.h
#
# check whether whatever we use for the final link will succeed
#
if test $cm = makefile; then
: nothing to check
else
HAVE_LINK_WORKS=x
ac_testinit link_works '' 'checking if the final link command may succeed'
fv=1
cat >conftest.c <<-'EOF'
#define EXTERN
#define MKSH_INCLUDES_ONLY
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.502 2011/12/31 02:54:15 tg Exp $");
int main(void) { printf("Hello, World!\n"); return (0); }
EOF
case $cm in
llvm)
v "$CC $CFLAGS $CPPFLAGS $NOWARN -emit-llvm -c conftest.c" || fv=0
rmf mksh.s
test $fv = 0 || v "llvm-link -o - conftest.o | opt $optflags | llc -o mksh.s" || fv=0
test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn mksh.s $LIBS $ccpr"
;;
dragonegg)
v "$CC $CFLAGS $CPPFLAGS $NOWARN -S -flto conftest.c" || fv=0
test $fv = 0 || v "mv conftest.s conftest.ll"
test $fv = 0 || v "llvm-as conftest.ll" || fv=0
rmf mksh.s
test $fv = 0 || v "llvm-link -o - conftest.bc | opt $optflags | llc -o mksh.s" || fv=0
test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn mksh.s $LIBS $ccpr"
;;
combine)
v "$CC $CFLAGS $CPPFLAGS $LDFLAGS -fwhole-program --combine $NOWARN -o $tcfn conftest.c $LIBS $ccpr"
;;
lto|normal)
cm=normal
v "$CC $CFLAGS $CPPFLAGS $NOWARN -c conftest.c" || fv=0
test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn conftest.o $LIBS $ccpr"
;;
esac
test -f $tcfn || fv=0
ac_testdone
test $fv = 1 || exit 1
fi
#
# Environment: definitions
#
@@ -1292,6 +1248,51 @@ fi
test 1 = $HAVE_SIG_T || add_cppflags -Dsig_t=nosig_t
ac_cppflags SIG_T
#
# check whether whatever we use for the final link will succeed
#
if test $cm = makefile; then
: nothing to check
else
HAVE_LINK_WORKS=x
ac_testinit link_works '' 'checking if the final link command may succeed'
fv=1
cat >conftest.c <<-'EOF'
#define EXTERN
#define MKSH_INCLUDES_ONLY
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.503 2012/01/03 00:58:06 tg Exp $");
int main(void) { printf("Hello, World!\n"); return (0); }
EOF
case $cm in
llvm)
v "$CC $CFLAGS $CPPFLAGS $NOWARN -emit-llvm -c conftest.c" || fv=0
rmf mksh.s
test $fv = 0 || v "llvm-link -o - conftest.o | opt $optflags | llc -o mksh.s" || fv=0
test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn mksh.s $LIBS $ccpr"
;;
dragonegg)
v "$CC $CFLAGS $CPPFLAGS $NOWARN -S -flto conftest.c" || fv=0
test $fv = 0 || v "mv conftest.s conftest.ll"
test $fv = 0 || v "llvm-as conftest.ll" || fv=0
rmf mksh.s
test $fv = 0 || v "llvm-link -o - conftest.bc | opt $optflags | llc -o mksh.s" || fv=0
test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn mksh.s $LIBS $ccpr"
;;
combine)
v "$CC $CFLAGS $CPPFLAGS $LDFLAGS -fwhole-program --combine $NOWARN -o $tcfn conftest.c $LIBS $ccpr"
;;
lto|normal)
cm=normal
v "$CC $CFLAGS $CPPFLAGS $NOWARN -c conftest.c" || fv=0
test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn conftest.o $LIBS $ccpr"
;;
esac
test -f $tcfn || fv=0
ac_testdone
test $fv = 1 || exit 1
fi
#
# Environment: signals
#