summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2012-01-05 12:34:51 +0100
committerThomas Preud'homme <robotux@celest.fr>2012-01-05 12:34:51 +0100
commitd178eb7650ef7356ca4e6d9d64ac242dcff64811 (patch)
tree9f2084d9f6ace2c57691d8efd9ea2cc9bff8d197 /configure
parentcfef8921f4b5dfa31fd2336484d86e24e3beb2f3 (diff)
Imported Upstream version 0.9.26~git20120104.83d57c0
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure49
1 files changed, 44 insertions, 5 deletions
diff --git a/configure b/configure
index 7d2b2db..3d68b1c 100755
--- a/configure
+++ b/configure
@@ -38,6 +38,12 @@ ar="ar"
strip="strip"
cygwin="no"
cpu=`uname -m`
+
+tcc_sysincludepaths=""
+tcc_libpaths=""
+tcc_crtprefix=""
+tcc_elfinterp=""
+
case "$cpu" in
i386|i486|i586|i686|i86pc|BePC|i686-AT386)
cpu="x86"
@@ -132,6 +138,14 @@ for opt do
;;
--extra-libs=*) extralibs=${opt#--extra-libs=}
;;
+ --sysincludepaths=*) tcc_sysincludepaths=`echo $opt | cut -d '=' -f 2`
+ ;;
+ --libpaths=*) tcc_libpaths=`echo $opt | cut -d '=' -f 2`
+ ;;
+ --crtprefix=*) tcc_crtprefix=`echo $opt | cut -d '=' -f 2`
+ ;;
+ --elfinterp=*) tcc_elfinterp=`echo $opt | cut -d '=' -f 2`
+ ;;
--cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
;;
--enable-gprof) gprof="yes"
@@ -146,18 +160,22 @@ for opt do
;;
--disable-rpath) disable_rpath="yes"
;;
+ --strip-binaries) strip_binaries="yes"
+ ;;
--with-libgcc) use_libgcc="yes"
;;
--with-selinux) have_selinux="yes"
;;
--help|-h) show_help="yes"
;;
+ *) echo "configure: unrecognized option $opt"; exit 1
+ ;;
esac
done
# Checking for CFLAGS
if test -z "$CFLAGS"; then
- CFLAGS="-O2"
+ CFLAGS="-Wall -g -O2"
fi
cc="${cross_prefix}${cc}"
@@ -253,6 +271,7 @@ echo " --sysroot=PREFIX prepend PREFIX to library/include paths []"
echo " --cc=CC use C compiler CC [$cc]"
echo " --disable-static make libtcc.so instead of libtcc.a"
echo " --disable-rpath disable use of -rpath with the above"
+echo " --strip-binaries strip symbol tables from resulting binaries"
echo " --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a"
echo " --enable-mingw32 build windows version on linux with mingw32"
echo " --enable-cygwin build windows version on windows with cygwin"
@@ -262,6 +281,10 @@ echo " --extra-cflags= extra compiler flags"
echo " --extra-ldflags= extra linker options"
echo " --with-selinux use mmap instead of exec mem"
echo " [requires write access to /tmp]"
+echo " --sysincludepaths=... specify system include paths, colon separated"
+echo " --libpaths=... specify system library paths, colon separated"
+echo " --crtprefix=... specify locations of crt?.o, colon separated"
+echo " --elfinterp=... specify elf interpreter"
echo ""
#echo "NOTE: The object files are build at the place where configure is launched"
exit 1
@@ -349,11 +372,23 @@ echo "includedir=\$(DESTDIR)$includedir" >> config.mak
echo "mandir=\$(DESTDIR)$mandir" >> config.mak
echo "infodir=\$(DESTDIR)$infodir" >> config.mak
echo "docdir=\$(DESTDIR)$docdir" >> config.mak
+print_var1()
+{
+ echo "#ifndef $1" >> $TMPH
+ echo "# define $1 \"$2\"" >> $TMPH
+ echo "#endif" >> $TMPH
+}
+print_var2()
+{
+ if test -n "$2"; then print_var1 $1 "$2"; fi
+}
+print_var2 CONFIG_SYSROOT "$sysroot"
+print_var1 CONFIG_TCCDIR "$tccdir"
+print_var2 CONFIG_TCC_SYSINCLUDEPATHS "$tcc_sysincludepaths"
+print_var2 CONFIG_TCC_LIBPATHS "$tcc_libpaths"
+print_var2 CONFIG_TCC_CRTPREFIX "$tcc_crtprefix"
+print_var2 CONFIG_TCC_ELFINTERP "$tcc_elfinterp"
-echo "#define CONFIG_SYSROOT \"$sysroot\"" >> $TMPH
-echo "#ifndef CONFIG_TCCDIR" >> $TMPH
-echo "#define CONFIG_TCCDIR \"$tccdir\"" >> $TMPH
-echo "#endif" >> $TMPH
echo "CC=$cc" >> config.mak
echo "GCC_MAJOR=$gcc_major" >> config.mak
echo "#define GCC_MAJOR $gcc_major" >> $TMPH
@@ -364,6 +399,7 @@ echo "CFLAGS=$CFLAGS" >> config.mak
echo "LDFLAGS=$LDFLAGS" >> config.mak
echo "LIBSUF=$LIBSUF" >> config.mak
echo "EXESUF=$EXESUF" >> config.mak
+
if test "$cpu" = "x86" ; then
echo "ARCH=i386" >> config.mak
echo "#define HOST_I386 1" >> $TMPH
@@ -419,6 +455,9 @@ fi
if test "$disable_rpath" = "yes" ; then
echo "DISABLE_RPATH=yes" >> config.mak
fi
+if test "$strip_binaries" = "yes" ; then
+ echo "STRIP_BINARIES=yes" >> config.mak
+fi
if test "$use_libgcc" = "yes" ; then
echo "#define CONFIG_USE_LIBGCC" >> $TMPH
echo "CONFIG_USE_LIBGCC=yes" >> config.mak