projects
/
projects.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
34ecd55
)
posaune
author
Michael Wagner
<michael@wagnertech.de>
Mon, 7 Sep 2020 08:14:58 +0000
(10:14 +0200)
committer
Michael Wagner
<michael@wagnertech.de>
Mon, 7 Sep 2020 08:14:58 +0000
(10:14 +0200)
tools/make/c_configure.sh
patch
|
blob
|
history
diff --git
a/tools/make/c_configure.sh
b/tools/make/c_configure.sh
index
434eae8
..
246f1ed
100755
(executable)
--- a/
tools/make/c_configure.sh
+++ b/
tools/make/c_configure.sh
@@
-13,6
+13,7
@@
function check_arch {
function install_cpp_make {
# $1: dir to install
function install_cpp_make {
# $1: dir to install
+# $2 (opt): if set to "lib" the fPIC flag is added
# find makefile
if [ -f /usr/share/mbuild/cpp.make ]
# find makefile
if [ -f /usr/share/mbuild/cpp.make ]
@@
-46,11
+47,18
@@
function install_cpp_make {
else
echo "CXXFLAGS += -std=c++0x" >> make.pre
fi
else
echo "CXXFLAGS += -std=c++0x" >> make.pre
fi
+
+ # compilation of libraries need fPIC flag
+ if [ "$2" == "lib" ]
+ then
+ echo "CXXFLAGS += -fPIC" >> make.pre
+ fi
+
popd
}
popd
}
-function append_dependency {
-#
adds another drectory, where a c++ compile is performed
+function append_dependency
_common
{
+#
common part of append_dependency and append_library
# parameter:
# $1: main directory
# $2: dependency directory
# parameter:
# $1: main directory
# $2: dependency directory
@@
-60,13
+68,12
@@
function append_dependency {
echo "DEPS += $3" >> $1/make.pre
echo "$3:" >> $1/make.post
echo " cd $src/$2 && make TARGET=$3" >> $1/make.post
echo "DEPS += $3" >> $1/make.pre
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 append_dependency {
+# adds another drectory, where a c++ compile is performed
+ append_dependency_common $*
+ echo "" >> $1/make.post
}
function add_include {
}
function add_include {
@@
-106,20
+113,12
@@
function append_library {
# $2: dependency directory
# $3: dependency artefact
# $2: dependency directory
# $3: dependency artefact
- src=$(pwd)
- echo "DEPS += $3" >> $1/make.pre
- echo "LDLIBS += $3" >> $1/make.pre
- echo "CXXFLAGS += -I$src/$2" >> $1/make.pre
- echo "$3:" >> $1/make.post
- echo " cd $src/$2 && make TARGET=$3" >> $1/make.post
+ append_dependency_common $*
echo " ln -sf $src/$2/$3 ." >> $1/make.post
echo "" >> $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
+ echo "LDLIBS += $3" >> $1/make.pre
+ echo "CXXFLAGS += -I$src/$2" >> $1/make.pre
}
}