From 7ed43415380ec6270e53c0ed3f42e5cb99df1f6e Mon Sep 17 00:00:00 2001 From: seyko Date: Wed, 4 Mar 2015 10:57:13 +0300 Subject: [PATCH] a libraries paths * x86_64-tcc: use /usr/lib64,.. instead of /usr/lib,.. * don't set tcc_lddir="lib64" if cpu="x86" * put a definition of the CONFIG_LDDIR into config.h instead of the config.mak Otherwise a "lib" string may be used by default. This is a usual case when building a x86_64-tcc (there was no -DCONFIG_LDDIR building this binary). * suppress -Wdeprecated-declarations for gcc which complain on malloc hooks in bcheck.c if glibc is quite new. --- configure | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 318b7887..9b0c34a7 100755 --- a/configure +++ b/configure @@ -237,15 +237,25 @@ else if test x"$execprefix" = x""; then execprefix="${prefix}" fi + if test x"$tccdir" = x""; then + tccdir="tcc" + fi if test x"$libdir" = x""; then - libdir="${execprefix}/lib" + libdir="${execprefix}/lib" + if test -n "${tccdir}"; then + tccdir="${libdir}/${tccdir}" + else + tccdir="${libdir}" + fi + if test "$cpu" = "x86-64"; then + libdir="${execprefix}/lib64" + fi + else + tccdir="${libdir}/${tccdir}" fi if test x"$bindir" = x""; then bindir="${execprefix}/bin" fi - if test x"$tccdir" = x""; then - tccdir="tcc" - fi if test x"$docdir" = x""; then docdir="${sharedir}/doc/${tccdir}" fi @@ -255,7 +265,6 @@ else if test x"$infodir" = x""; then infodir="${sharedir}/info" fi - tccdir="${libdir}/${tccdir}" fi # mingw32 if test x"$includedir" = x""; then @@ -325,7 +334,7 @@ if test -z "$cross_prefix" ; then if test -f "/usr/lib/$triplet/crti.o" ; then tcc_lddir="lib" multiarch_triplet="$triplet" - elif test -f "/usr/lib64/crti.o" ; then + elif test "$cpu" != "x86" -a -f "/usr/lib64/crti.o" ; then tcc_lddir="lib64" fi @@ -363,6 +372,11 @@ else esac fi +# a final configuration tuning +W_PRESENT="$($cc -v --help 2>&1 | grep deprecated-declarations)" +if test -n "$W_PRESENT"; then cc="$cc -Wno-deprecated-declarations"; fi +if test -z "$tcc_lddir" -a "$cpu" = "x86-64"; then tcc_lddir="lib64"; fi + echo "Binary directory $bindir" echo "TinyCC directory $tccdir" echo "Library directory $libdir" @@ -424,11 +438,11 @@ echo "/* Automatically generated by configure - do not modify */" > $TMPH print_inc CONFIG_SYSROOT "$sysroot" print_inc CONFIG_TCCDIR "$tccdir" +print_inc CONFIG_LDDIR "$tcc_lddir" print_mak CONFIG_TCC_SYSINCLUDEPATHS "$tcc_sysincludepaths" print_mak CONFIG_TCC_LIBPATHS "$tcc_libpaths" print_mak CONFIG_TCC_CRTPREFIX "$tcc_crtprefix" print_mak CONFIG_TCC_ELFINTERP "$tcc_elfinterp" -print_mak CONFIG_LDDIR "$tcc_lddir" print_mak CONFIG_MULTIARCHDIR "$multiarch_triplet" echo "#define GCC_MAJOR $gcc_major" >> $TMPH -- 2.11.4.GIT