1#!/bin/sh
2# Copyright (C) 2006  K.Kosako
3
4ONIG_VERSION=@PACKAGE_VERSION@
5
6show_usage()
7{
8  cat <<EOF
9Usage: onig-config [OPTION]
10
11  Values for OPTION are:
12  --prefix[=DIR]       change prefix to DIR
13  --prefix             print prefix
14  --exec-prefix[=DIR]  change exec_prefix to DIR
15  --exec-prefix        print exec_prefix
16  --cflags             print C compiler flags
17  --libs               print library information
18  --version            print oniguruma version
19  --help               print this help
20
21EOF
22
23  exit 1
24}
25
26if test $# -eq 0; then
27  show_usage
28fi
29
30prefix=@prefix@
31exec_prefix=@exec_prefix@
32is_set_exec_prefix=no
33
34while test $# -gt 0; do
35  case "$1" in
36  -*=*) val=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
37     ;;
38  *) val=
39     ;;
40  esac
41
42  case $1 in
43    --prefix=*)
44      prefix=$val
45      if test $is_set_exec_prefix = no ; then
46        exec_prefix=$val
47      fi
48      ;;
49    --prefix)
50      echo $prefix
51      ;;
52    --exec-prefix=*)
53      exec_prefix=$val
54      is_set_exec_prefix=yes
55      ;;
56    --exec-prefix)
57      echo $exec_prefix
58      ;;
59    --cflags)
60      if test @includedir@ != /usr/include ; then
61        show_includedir=-I@includedir@
62      fi
63      echo $show_includedir
64      ;;
65    --libs)
66      echo -L@libdir@ -lonig
67      ;;
68    --version)
69      echo $ONIG_VERSION
70      ;;
71    *)
72      show_usage
73      ;;
74  esac
75  shift
76done
77
78# END
79