From 17cf0dcf7067355cfd3ee2020e389ef0c2bd753d Mon Sep 17 00:00:00 2001 From: grischka Date: Wed, 30 Jan 2013 18:39:09 +0100 Subject: configure: use relative paths for in-tree build Also - move CPPFLAGS to Makefile - Use top_srcdir in lib/Makefile --- configure | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'configure') diff --git a/configure b/configure index c0c0bd9..fa2c97d 100755 --- a/configure +++ b/configure @@ -409,14 +409,14 @@ print_var2 CONFIG_TCC_LIBPATHS "$tcc_libpaths" print_var2 CONFIG_TCC_CRTPREFIX "$tcc_crtprefix" print_var2 CONFIG_TCC_ELFINTERP "$tcc_elfinterp" -echo "CC=$cc" >> config.mak -echo "GCC_MAJOR=$gcc_major" >> config.mak echo "#define GCC_MAJOR $gcc_major" >> $TMPH -echo "HOST_CC=$host_cc" >> config.mak -echo "AR=$ar" >> config.mak -echo "STRIP=$strip -s -R .comment -R .note" >> config.mak + cat >> config.mak <> $TMPH echo "HAVE_SELINUX=yes" >> config.mak fi + version=`head $source_path/VERSION` echo "VERSION=$version" >>config.mak echo "#define TCC_VERSION \"$version\"" >> $TMPH echo "@set VERSION $version" > config.texi +echo "SRC_PATH=$source_path" >>config.mak # build tree in object directory if source path is different from current one if test "$source_path_used" = "yes" ; then @@ -511,15 +513,14 @@ if test "$source_path_used" = "yes" ; then esac ln -sf $dest $f done + case $source_path in + /*) echo "top_srcdir=$source_path";; + *) echo "top_srcdir=\$(TOP)/$source_path";; + esac >>config.mak +else + echo 'top_srcdir=$(TOP)' >>config.mak fi -cat >>config.mak <>config.mak +echo 'top_builddir=$(TOP)' >>config.mak diff $TMPH config.h >/dev/null 2>&1 if test $? -ne 0 ; then -- cgit v1.3.1