blob: 3fcf94231f6805729bdfb857f9392d798b70b456 [file] [log] [blame]
Tristan Matthews04616462013-11-14 16:09:34 -05001#!/bin/sh
2
3prefix=/usr/local
4exec_prefix=${prefix}
5exec_prefix_set=no
6
7if test yes = yes ; then
8 usage="Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--libs-cpp] [--cflags] [--cflags-posix]"
9else
10 usage="Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--cflags] [--cflags-posix]"
11fi
12
13if test $# -eq 0; then
14 echo "${usage}" 1>&2
15 exit 1
16fi
17
18libR=
19case `uname -s` in
20 *SunOS*)
21 libR=" -R${exec_prefix}/lib"
22 ;;
23 *BSD*)
24 libR=" -Wl,-R${exec_prefix}/lib"
25 ;;
26esac
27
28libS=
29if test ${exec_prefix}/lib != /usr/lib ; then
30 libS=-L${exec_prefix}/lib
31fi
32
33while test $# -gt 0; do
34 case "$1" in
35 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
36 *) optarg= ;;
37 esac
38
39 case $1 in
40 --prefix=*)
41 prefix=$optarg
42 if test $exec_prefix_set = no ; then
43 exec_prefix=$optarg
44 fi
45 ;;
46 --prefix)
47 echo $prefix
48 ;;
49 --exec-prefix=*)
50 exec_prefix=$optarg
51 exec_prefix_set=yes
52 ;;
53 --exec-prefix)
54 echo $exec_prefix
55 ;;
56 --version)
57 echo 8.21
58 ;;
59 --cflags | --cflags-posix)
60 if test ${prefix}/include != /usr/include ; then
61 includes=-I${prefix}/include
62 fi
63 echo $includes
64 ;;
65 --libs-posix)
66 echo $libS$libR -lpcreposix -lpcre
67 ;;
68 --libs)
69 echo $libS$libR -lpcre
70 ;;
71 --libs-cpp)
72 if test yes = yes ; then
73 echo $libS$libR -lpcrecpp -lpcre
74 else
75 echo "${usage}" 1>&2
76 fi
77 ;;
78 *)
79 echo "${usage}" 1>&2
80 exit 1
81 ;;
82 esac
83 shift
84done