Tristan Matthews | 0461646 | 2013-11-14 16:09:34 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | prefix=/usr/local |
| 4 | exec_prefix=${prefix} |
| 5 | exec_prefix_set=no |
| 6 | |
| 7 | if test yes = yes ; then |
| 8 | usage="Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--libs-cpp] [--cflags] [--cflags-posix]" |
| 9 | else |
| 10 | usage="Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--cflags] [--cflags-posix]" |
| 11 | fi |
| 12 | |
| 13 | if test $# -eq 0; then |
| 14 | echo "${usage}" 1>&2 |
| 15 | exit 1 |
| 16 | fi |
| 17 | |
| 18 | libR= |
| 19 | case `uname -s` in |
| 20 | *SunOS*) |
| 21 | libR=" -R${exec_prefix}/lib" |
| 22 | ;; |
| 23 | *BSD*) |
| 24 | libR=" -Wl,-R${exec_prefix}/lib" |
| 25 | ;; |
| 26 | esac |
| 27 | |
| 28 | libS= |
| 29 | if test ${exec_prefix}/lib != /usr/lib ; then |
| 30 | libS=-L${exec_prefix}/lib |
| 31 | fi |
| 32 | |
| 33 | while 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 |
| 84 | done |