From: Michael Wagner Date: Fri, 10 Jul 2020 20:04:33 +0000 (+0200) Subject: posaune X-Git-Tag: verleihnix_0.1-2~5 X-Git-Url: http://wagnertech.de/git?p=projects.git;a=commitdiff_plain;h=34ecd5514a12ba36dc75ad43f995a388ca94d7f2 posaune --- diff --git a/tools/make/c_configure.sh b/tools/make/c_configure.sh index 9f21ef1..434eae8 100755 --- a/tools/make/c_configure.sh +++ b/tools/make/c_configure.sh @@ -13,12 +13,24 @@ function check_arch { function install_cpp_make { # $1: dir to install + + # find makefile + if [ -f /usr/share/mbuild/cpp.make ] + then + makefile=/usr/share/mbuild/cpp.make + elif [ -f $cwd/projects/tools/make/cpp.make ] + then + makefile=$cwd/projects/tools/make/cpp.make + else + echo "cannot find cpp makefile." >&2 + exit 1 + fi src=$(pwd); pushd $1 if [ -f makefile ]; then rm makefile; fi if [ -L makefile ]; then rm makefile; fi if [ -f make.post ]; then rm make.post; fi - ln -s $cwd/projects/tools/make/cpp.make makefile + ln -s $makefile makefile echo "SOURCE = \\" > make.pre for file in $(ls *.cpp) do @@ -49,6 +61,12 @@ function append_dependency { echo "$3:" >> $1/make.post echo " cd $src/$2 && make TARGET=$3" >> $1/make.post echo "" >> $1/make.post + + # check for shared library + if [ "${3##*.}" == "so" ] + then + echo "CXXFLAGS += -fPIC" >> $2/make.pre + fi } function add_include { @@ -96,5 +114,12 @@ function append_library { echo " cd $src/$2 && make TARGET=$3" >> $1/make.post echo " ln -sf $src/$2/$3 ." >> $1/make.post echo "" >> $1/make.post + + # check for shared library + if [ "${3##*.}" == "so" ] + then + echo "CXXFLAGS += -fPIC" >> $2/make.pre + fi + }