Skip to content

Commit 9d0c8e0

Browse files
author
Le Yao
committed
Add pcre prefix config script
Signed-off-by: Le Yao <le.yao@intel.com>
1 parent f2a52c6 commit 9d0c8e0

File tree

1 file changed

+134
-0
lines changed

1 file changed

+134
-0
lines changed

pcre-config

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
#!/bin/sh
2+
3+
prefix=/usr
4+
exec_prefix=${prefix}
5+
exec_prefix_set=no
6+
7+
cflags="[--cflags]"
8+
9+
if test yes = yes ; then
10+
libs="[--libs-cpp]"
11+
else
12+
libs=
13+
fi
14+
15+
if test yes = yes ; then
16+
libs="[--libs16] $libs"
17+
fi
18+
19+
if test yes = yes ; then
20+
libs="[--libs32] $libs"
21+
fi
22+
23+
if test yes = yes ; then
24+
libs="[--libs] [--libs-posix] $libs"
25+
cflags="$cflags [--cflags-posix]"
26+
fi
27+
28+
usage="Usage: pcre-config [--prefix] [--exec-prefix] [--version] $libs $cflags"
29+
30+
if test $# -eq 0; then
31+
echo "${usage}" 1>&2
32+
exit 1
33+
fi
34+
35+
libR=
36+
case `uname -s` in
37+
*SunOS*)
38+
libR=" -R${prefix}/lib"
39+
;;
40+
*BSD*)
41+
libR=" -Wl,-R${prefix}/lib"
42+
;;
43+
esac
44+
45+
libS=
46+
if test ${prefix}/lib != /usr/lib ; then
47+
libS=-L${prefix}/lib
48+
fi
49+
50+
while test $# -gt 0; do
51+
case "$1" in
52+
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
53+
*) optarg= ;;
54+
esac
55+
56+
case $1 in
57+
--prefix=*)
58+
prefix=$optarg
59+
if test $exec_prefix_set = no ; then
60+
exec_prefix=$optarg
61+
fi
62+
;;
63+
--prefix)
64+
echo $prefix
65+
;;
66+
--exec-prefix=*)
67+
exec_prefix=$optarg
68+
exec_prefix_set=yes
69+
;;
70+
--exec-prefix)
71+
echo $exec_prefix
72+
;;
73+
--version)
74+
echo 8.39
75+
;;
76+
--cflags)
77+
if test ${prefix}/include != /usr/include ; then
78+
includes=-I${prefix}/include
79+
fi
80+
includes=-I/root/ModSecurity/include
81+
echo $includes
82+
;;
83+
--cflags-posix)
84+
if test yes = yes ; then
85+
if test ${prefix}/include != /usr/include ; then
86+
includes=-I${prefix}/include
87+
fi
88+
echo $includes
89+
else
90+
echo "${usage}" 1>&2
91+
fi
92+
;;
93+
--libs-posix)
94+
if test yes = yes ; then
95+
echo $libS$libR -lpcreposix -lpcre
96+
else
97+
echo "${usage}" 1>&2
98+
fi
99+
;;
100+
--libs)
101+
if test yes = yes ; then
102+
echo $libS$libR -lpcre -L/usr/local/pcre
103+
else
104+
echo "${usage}" 1>&2
105+
fi
106+
;;
107+
--libs16)
108+
if test yes = yes ; then
109+
echo $libS$libR -lpcre16
110+
else
111+
echo "${usage}" 1>&2
112+
fi
113+
;;
114+
--libs32)
115+
if test yes = yes ; then
116+
echo $libS$libR -lpcre32
117+
else
118+
echo "${usage}" 1>&2
119+
fi
120+
;;
121+
--libs-cpp)
122+
if test yes = yes ; then
123+
echo $libS$libR -lpcrecpp -lpcre
124+
else
125+
echo "${usage}" 1>&2
126+
fi
127+
;;
128+
*)
129+
echo "${usage}" 1>&2
130+
exit 1
131+
;;
132+
esac
133+
shift
134+
done

0 commit comments

Comments
 (0)