aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2013-02-13 20:14:13 +0100
committerThomas Preud'homme <robotux@celest.fr>2013-02-13 20:14:13 +0100
commitf9ac2013779370e0d010922ae3684e601e53aa1d (patch)
treed2389c603a06c0373d8c4065737fba5bd89c489c /configure
parentaf4b27f0fd7d1ee247bbd1a330dfbff9ed16bcae (diff)
downloadtinycc-f9ac2013779370e0d010922ae3684e601e53aa1d.tar.gz
tinycc-f9ac2013779370e0d010922ae3684e601e53aa1d.tar.bz2
Detect multiarch triplet and lddir from ldd output
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure16
1 files changed, 8 insertions, 8 deletions
diff --git a/configure b/configure
index 761c20c..425f719 100755
--- a/configure
+++ b/configure
@@ -261,12 +261,12 @@ if $cc -o $TMPO $TMPC 2> /dev/null ; then
fi
if test -z "$cross_prefix" ; then
- if test -f "/usr/lib64" ; then
- lddir="lib64"
- elif test -z "$tcc_crtprefix" ; then # check if system is multiarch
- if test ! -f $sysroot/usr/lib/crti.o -o -L $sysroot/usr/lib/crti.o ; then
- use_multiarch="yes"
- fi
+ libc_dir="$(ldd ./print_env_info | grep libc.so | sed 's|[^/]*/\(.*/\)[^/]*|\1|')"
+ multiarch_triplet=${libc_dir#*/}
+ multiarch_triplet=${multiarch_triplet%/}
+ lddir="${libc_dir%%/*}"
+ if test -n "$multiarch_triplet" ; then
+ lddir="$lddir/$multiarch_triplet"
fi
fi
@@ -501,8 +501,8 @@ if test "$have_selinux" = "yes" ; then
echo "#define HAVE_SELINUX" >> $TMPH
echo "HAVE_SELINUX=yes" >> config.mak
fi
-if test "$use_multiarch" = "yes" ; then
- echo "#define CONFIG_TCC_MULTIARCH" >> $TMPH
+if test -n "$multiarch_triplet" ; then
+ echo "#define CONFIG_MULTIARCHDIR \"$multiarch_triplet\"" >> $TMPH
fi
if test -n "$lddir" ; then
echo "#define CONFIG_LDDIR \"$lddir\"" >> $TMPH