1#!/bin/sh
2
3prefix=@prefix@
4exec_prefix=@exec_prefix@
5exec_prefix_set=no
6
7usage="\
8Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--cflags] [--cflags-posix]"
9
10if test $# -eq 0; then
11      echo "${usage}" 1>&2
12      exit 1
13fi
14
15libR=
16case `uname -s` in
17  *SunOS*)
18  libR=" -R@libdir@"
19  ;;
20esac
21
22while test $# -gt 0; do
23  case "$1" in
24  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
25  *) optarg= ;;
26  esac
27
28  case $1 in
29    --prefix=*)
30      prefix=$optarg
31      if test $exec_prefix_set = no ; then
32        exec_prefix=$optarg
33      fi
34      ;;
35    --prefix)
36      echo $prefix
37      ;;
38    --exec-prefix=*)
39      exec_prefix=$optarg
40      exec_prefix_set=yes
41      ;;
42    --exec-prefix)
43      echo $exec_prefix
44      ;;
45    --version)
46      echo @PCRE_VERSION@
47      ;;
48    --cflags | --cflags-posix)
49      if test @includedir@ != /usr/include ; then
50        includes=-I@includedir@
51      fi
52      echo $includes
53      ;;
54    --libs-posix)
55      echo -L@libdir@$libR -lpcreposix -lpcre
56      ;;
57    --libs)
58      echo -L@libdir@$libR -lpcre
59      ;;
60    *)
61      echo "${usage}" 1>&2
62      exit 1
63      ;;
64  esac
65  shift
66done
67