1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
| #!/bin/sh
work_path=$(dirname $0)
cd $work_path
work_path=$(pwd)
if [ $# -ne 1 ]; then
echo "./script [file_name]"
exit 1
fi
file_name=$1
insert='i\
if test \"x${ac_cv_env_CFLAGS_set}\" = \"x\"; then : \
CFLAGS=\"-fPIC\" \
fi \
if test \"x${ac_cv_env_CXXFLAGS_set}\" = \"x\"; then : \
CXXFLAGS=\"-fPIC\" \
fi
'
insert_func() {
if [ $(uname -s) == "Darwin" ]; then
# mac
sed -i "" "2,7d" $file_name
sed -i "" "2$insert" $file_name
else
# linux
sed -i "2,7d" $file_name
sed -i "2$insert" $file_name
fi
}
insert_func
|