Patrick Georgi | 3b77b72 | 2011-07-07 15:41:53 +0200 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | # |
| 3 | # The idea to this kind of setup info script was stolen from numerous |
| 4 | # other packages, such as neon, libxml and gnome. |
| 5 | # |
| 6 | # $Id: xcurses-config.in,v 1.6 2007/11/07 23:33:07 wmcbrine Exp $ |
| 7 | # |
| 8 | |
| 9 | verdot=3.4 |
| 10 | |
| 11 | prefix=@prefix@ |
| 12 | exec_prefix=@exec_prefix@ |
| 13 | includedir=@includedir@/xcurses |
| 14 | |
| 15 | usage() |
| 16 | { |
| 17 | echo "Usage: xcurses-config [OPTION]" |
| 18 | echo "" |
| 19 | echo "Available values for OPTION include:" |
| 20 | echo "" |
| 21 | echo " --help display this help and exit" |
| 22 | echo " --cflags pre-processor and compiler flags" |
| 23 | echo " [-I$includedir]" |
| 24 | echo " --libs library linking information" |
| 25 | echo " [-L$prefix/lib -lXCurses @LDFLAGS@ @MH_XLIBS@ @MH_EXTRA_LIBS@" |
| 26 | echo " --prefix PDCurses install prefix" |
| 27 | echo " [$prefix]" |
| 28 | echo " --version output version information" |
| 29 | echo " [$verdot]" |
| 30 | exit $1 |
| 31 | } |
| 32 | |
| 33 | if test $# -eq 0; then |
| 34 | usage 1 |
| 35 | fi |
| 36 | |
| 37 | while test $# -gt 0; do |
| 38 | case "$1" in |
| 39 | # this deals with options in the style |
| 40 | # --option=value and extracts the value part |
| 41 | # [not currently used] |
| 42 | -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
| 43 | *) value= ;; |
| 44 | esac |
| 45 | |
| 46 | case "$1" in |
| 47 | --prefix) |
| 48 | echo $prefix |
| 49 | ;; |
| 50 | |
| 51 | --version) |
| 52 | echo $verdot |
| 53 | exit 0 |
| 54 | ;; |
| 55 | |
| 56 | --help) |
| 57 | usage 0 |
| 58 | ;; |
| 59 | |
| 60 | --cflags) |
| 61 | echo -I$includedir |
| 62 | ;; |
| 63 | |
| 64 | --libs) |
| 65 | echo -L$prefix/lib -lXCurses @LDFLAGS@ @MH_XLIBS@ @MH_EXTRA_LIBS@ |
| 66 | ;; |
| 67 | |
| 68 | *) |
| 69 | usage |
| 70 | exit 1 |
| 71 | ;; |
| 72 | esac |
| 73 | shift |
| 74 | done |
| 75 | |
| 76 | exit 0 |