summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMatteo Cypriani <mcy@lm7.fr>2014-09-05 22:23:49 -0400
committerMatteo Cypriani <mcy@lm7.fr>2014-09-05 22:23:49 -0400
commitc23b49885426f043d0dff7658deb6dc7ef82149d (patch)
treeca45695a2d8f7420e898978f94750a2e934805a2 /configure
parent494749572823610f5ac6dcc3b3d4afe5ebb6371e (diff)
Imported Upstream version 0.9.27~git20140801.14745bd
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure122
1 files changed, 70 insertions, 52 deletions
diff --git a/configure b/configure
index 6a7fae5..f6df9ad 100755
--- a/configure
+++ b/configure
@@ -19,6 +19,7 @@ TMPH=$TMPN.h
# default parameters
build_cross="no"
use_libgcc="no"
+enable_assert="no"
prefix=""
execprefix=""
bindir=""
@@ -54,6 +55,8 @@ case $targetos in
MINGW32*) mingw32=yes;;
DragonFly) noldl=yes;;
OpenBSD) noldl=yes;;
+ FreeBSD) noldl=yes;;
+ NetBSD) noldl=yes;;
*) ;;
esac
@@ -68,46 +71,52 @@ if test -z "$source_path" -o "$source_path" = "." ; then
source_path_used="no"
fi
-case "$cpu" in
- i386|i486|i586|i686|i86pc|BePC|i686-AT386)
- cpu="x86"
- ;;
- x86_64)
- cpu="x86-64"
- ;;
- arm*)
- case "$cpu" in
- arm|armv4l)
- cpuver=4
- ;;
- armv5tel|armv5tejl)
- cpuver=5
- ;;
- armv6j|armv6l)
- cpuver=6
- ;;
- armv7a|armv7l)
- cpuver=7
- ;;
- esac
- cpu="armv4l"
- ;;
- alpha)
- cpu="alpha"
- ;;
- "Power Macintosh"|ppc|ppc64)
- cpu="powerpc"
- ;;
- mips)
- cpu="mips"
- ;;
- s390)
- cpu="s390"
- ;;
- *)
- cpu="unknown"
- ;;
-esac
+classify_cpu ()
+{
+ cpu="$1"
+
+ case "$cpu" in
+ x86|i386|i486|i586|i686|i86pc|BePC|i686-AT386)
+ cpu="x86"
+ ;;
+ x86_64|amd64)
+ cpu="x86-64"
+ ;;
+ arm*)
+ case "$cpu" in
+ arm|armv4l)
+ cpuver=4
+ ;;
+ armv5tel|armv5tejl)
+ cpuver=5
+ ;;
+ armv6j|armv6l)
+ cpuver=6
+ ;;
+ armv7a|armv7l)
+ cpuver=7
+ ;;
+ esac
+ cpu="armv4l"
+ ;;
+ alpha)
+ cpu="alpha"
+ ;;
+ "Power Macintosh"|ppc|ppc64)
+ cpu="powerpc"
+ ;;
+ mips)
+ cpu="mips"
+ ;;
+ s390)
+ cpu="s390"
+ ;;
+ *)
+ echo "Unsupported CPU: $cpu"
+ exit 1
+ ;;
+ esac
+}
for opt do
eval opt=\"$opt\"
@@ -138,14 +147,6 @@ for opt do
;;
--cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
;;
- --cc=*) cc=`echo $opt | cut -d '=' -f 2`
- ;;
- --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
- ;;
- --extra-ldflags=*) LDFLAGS="${opt#--extra-ldflags=}"
- ;;
- --extra-libs=*) extralibs=${opt#--extra-libs=}
- ;;
--sysincludepaths=*) tcc_sysincludepaths=`echo $opt | cut -d '=' -f 2`
;;
--libpaths=*) tcc_libpaths=`echo $opt | cut -d '=' -f 2`
@@ -154,7 +155,15 @@ for opt do
;;
--elfinterp=*) tcc_elfinterp=`echo $opt | cut -d '=' -f 2`
;;
- --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
+ --cc=*) cc=`echo $opt | cut -d '=' -f 2`
+ ;;
+ --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
+ ;;
+ --extra-ldflags=*) LDFLAGS="${opt#--extra-ldflags=}"
+ ;;
+ --extra-libs=*) extralibs=${opt#--extra-libs=}
+ ;;
+ --cpu=*) build_cpu=`echo $opt | cut -d '=' -f 2`
;;
--enable-gprof) gprof="yes"
;;
@@ -164,6 +173,8 @@ for opt do
;;
--enable-cross) build_cross="yes"
;;
+ --enable-assert) enable_assert="yes"
+ ;;
--disable-static) disable_static="yes"
;;
--disable-rpath) disable_rpath="yes"
@@ -181,6 +192,8 @@ for opt do
esac
done
+classify_cpu "$cpu"
+
# Checking for CFLAGS
if test -z "$CFLAGS"; then
CFLAGS="-Wall -g -O2"
@@ -266,13 +279,15 @@ Advanced options (experts only):
--cc=CC use C compiler CC [$cc]
--extra-cflags= specify compiler flags [$CFLAGS]
--extra-ldflags= specify linker options []
+ --cpu=CPU CPU [$cpu]
--strip-binaries strip symbol tables from resulting binaries
--disable-static make libtcc.so instead of libtcc.a
--disable-rpath disable use of -rpath with the above
- --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a
+ --with-libgcc use libgcc_s.so.1 instead of libtcc1.a in dynamic link
--enable-mingw32 build windows version on linux with mingw32
--enable-cygwin build windows version on windows with cygwin
--enable-cross build cross compilers
+ --enable-assert enable debug assertions
--with-selinux use mmap for exec mem [needs writable /tmp]
--sysincludepaths=... specify system include paths, colon separated
--libpaths=... specify system library paths, colon separated
@@ -299,7 +314,7 @@ if test -z "$cross_prefix" ; then
if test "$mingw32" = "no" ; then
triplet="$($CONFTEST triplet)"
if test -f "/usr/lib/$triplet/crti.o" ; then
- tcc_lddir="lib/$triplet"
+ tcc_lddir="lib"
multiarch_triplet="$triplet"
elif test -f "/usr/lib64/crti.o" ; then
tcc_lddir="lib64"
@@ -350,8 +365,8 @@ Doc directory $docdir
Target root prefix $sysroot
Source path $source_path
C compiler $cc
+Build CPU $cpu
Target OS $targetos
-CPU $cpu
Big Endian $bigendian
gprof enabled $gprof
cross compilers $build_cross
@@ -483,6 +498,9 @@ if test "$have_selinux" = "yes" ; then
echo "#define HAVE_SELINUX" >> $TMPH
echo "HAVE_SELINUX=yes" >> config.mak
fi
+if test "$enable_assert" = "yes" ; then
+ echo "#define CONFIG_TCC_ASSERT" >> $TMPH
+fi
version=`head $source_path/VERSION`
echo "VERSION=$version" >>config.mak