projects
/
projects.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dbe417b
)
posaune
author
Michael Wagner
<michael@wagnertech.de>
Fri, 10 Jul 2020 20:04:33 +0000
(22:04 +0200)
committer
Michael Wagner
<michael@wagnertech.de>
Fri, 10 Jul 2020 20:04:33 +0000
(22:04 +0200)
tools/make/c_configure.sh
patch
|
blob
|
history
diff --git
a/tools/make/c_configure.sh
b/tools/make/c_configure.sh
index
9f21ef1
..
434eae8
100755
(executable)
--- 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
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
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.mak
e makefile
+ ln -s $
makefil
e makefile
echo "SOURCE = \\" > make.pre
for file in $(ls *.cpp)
do
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
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 {
}
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
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
+
}
}