some basic LLVM+clang (with “ccc” driver example) support
This commit is contained in:
11
Build.sh
11
Build.sh
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.330 2008/06/29 18:08:55 tg Exp $'
|
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.331 2008/06/29 18:18:56 tg Exp $'
|
||||||
#-
|
#-
|
||||||
# Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS
|
# Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS
|
||||||
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI
|
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI
|
||||||
@@ -411,6 +411,7 @@ $e $bi$me: Scanning for functions... please ignore any errors.$ao
|
|||||||
# notes:
|
# notes:
|
||||||
# – ICC defines __GNUC__ too
|
# – ICC defines __GNUC__ too
|
||||||
# – GCC defines __hpux too
|
# – GCC defines __hpux too
|
||||||
|
# - LLVM+clang defines __GNUC__ too
|
||||||
CPP="$CC -E"
|
CPP="$CC -E"
|
||||||
$e ... which compiler seems to be used
|
$e ... which compiler seems to be used
|
||||||
cat >scn.c <<-'EOF'
|
cat >scn.c <<-'EOF'
|
||||||
@@ -448,6 +449,8 @@ cat >scn.c <<-'EOF'
|
|||||||
ct=tendra
|
ct=tendra
|
||||||
#elif defined(__TINYC__)
|
#elif defined(__TINYC__)
|
||||||
ct=tcc
|
ct=tcc
|
||||||
|
#elif defined(__llvm__) && defined(__clang__)
|
||||||
|
ct=clang
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
ct=gcc
|
ct=gcc
|
||||||
#elif defined(_COMPILER_VERSION)
|
#elif defined(_COMPILER_VERSION)
|
||||||
@@ -484,6 +487,10 @@ bcc)
|
|||||||
echo >&2 " produce broken executables. Continue at your own risk,"
|
echo >&2 " produce broken executables. Continue at your own risk,"
|
||||||
echo >&2 " please report success/failure to the developers."
|
echo >&2 " please report success/failure to the developers."
|
||||||
;;
|
;;
|
||||||
|
clang)
|
||||||
|
# does not work with current "ccc" compiler driver
|
||||||
|
vv '|' "$CC -version"
|
||||||
|
;;
|
||||||
dec)
|
dec)
|
||||||
vv '|' "$CC -V"
|
vv '|' "$CC -V"
|
||||||
;;
|
;;
|
||||||
@@ -761,6 +768,8 @@ elif test $ct = tendra; then
|
|||||||
ac_flags 1 extansi -Xa
|
ac_flags 1 extansi -Xa
|
||||||
elif test $ct = tcc; then
|
elif test $ct = tcc; then
|
||||||
ac_flags 1 boundschk -b
|
ac_flags 1 boundschk -b
|
||||||
|
elif test $ct = clang; then
|
||||||
|
i=1
|
||||||
fi
|
fi
|
||||||
# flags common to a subset of compilers
|
# flags common to a subset of compilers
|
||||||
if test 1 = $i; then
|
if test 1 = $i; then
|
||||||
|
Reference in New Issue
Block a user