]> ncurses.scripts.mit.edu Git - ncurses.git/blob - misc/ncurses-config.in
ncurses 5.7 - patch 20090103
[ncurses.git] / misc / ncurses-config.in
1 #!@SHELL@
2 # $Id: ncurses-config.in,v 1.15 2009/01/03 21:10:18 tom Exp $
3 ##############################################################################
4 # Copyright (c) 2006-2007,2009 Free Software Foundation, Inc.                #
5 #                                                                            #
6 # Permission is hereby granted, free of charge, to any person obtaining a    #
7 # copy of this software and associated documentation files (the "Software"), #
8 # to deal in the Software without restriction, including without limitation  #
9 # the rights to use, copy, modify, merge, publish, distribute, distribute    #
10 # with modifications, sublicense, and/or sell copies of the Software, and to #
11 # permit persons to whom the Software is furnished to do so, subject to the  #
12 # following conditions:                                                      #
13 #                                                                            #
14 # The above copyright notice and this permission notice shall be included in #
15 # all copies or substantial portions of the Software.                        #
16 #                                                                            #
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
18 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
20 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
21 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
22 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
23 # DEALINGS IN THE SOFTWARE.                                                  #
24 #                                                                            #
25 # Except as contained in this notice, the name(s) of the above copyright     #
26 # holders shall not be used in advertising or otherwise to promote the sale, #
27 # use or other dealings in this Software without prior written               #
28 # authorization.                                                             #
29 ##############################################################################
30 #
31 # Author: Thomas E. Dickey, 2006
32
33 prefix="@prefix@"
34 exec_prefix="@exec_prefix@"
35
36 bindir="@bindir@"
37 includedir="@includedir@"
38 libdir="@libdir@"
39 datadir="@datadir@"
40 mandir="@mandir@"
41
42 THIS="${LIB_NAME}@DFT_ARG_SUFFIX@"
43
44 LANG=C;         export LANG
45 LANGUAGE=C;     export LANGUAGE
46 LC_ALL=C;       export LC_ALL
47 LC_CTYPE=C;     export LC_CTYPE
48
49 test $# = 0 && exec @SHELL@ $0 --error
50
51 while test $# -gt 0; do
52         case "$1" in
53         -*=*)
54                 ARG=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
55                 ;;
56         *)
57                 ARG=
58                 ;;
59         esac
60
61         case "$1" in
62         # basic configuration
63         --prefix=*)
64                 prefix="$ARG"
65                 test -z "$exec_prefix" && exec_prefix="$ARG"
66                 ;;
67         --prefix)
68                 echo "$prefix"
69                 ;;
70         --exec-prefix=*)
71                 exec_prefix="$ARG"
72                 ;;
73         --exec-prefix)
74                 echo "$exec_prefix"
75                 ;;
76         # compile/link
77         --cflags)
78                 INCS=
79                 if test "${includedir}" != /usr/include ; then
80                         INCS="-I${includedir}"
81                 fi
82                 if test "@WITH_OVERWRITE@" != no ; then
83                         INCS="$INCS -I${includedir}/${THIS}"
84                 fi
85                 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
86                         $INCS
87 ENDECHO
88                 ;;
89         --libs)
90                 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
91                         -L$libdir @EXTRA_LDFLAGS@ -l${THIS} @LIBS@
92 ENDECHO
93                 ;;
94         # identification
95         --version)
96                 echo "@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
97                 ;;
98         --abi-version)
99                 echo "@cf_cv_abi_version@"
100                 ;;
101         --mouse-version)
102                 echo "@NCURSES_MOUSE_VERSION@"
103                 ;;
104         # locations
105         --bindir)
106                 echo "${bindir}"
107                 ;;
108         --datadir)
109                 echo "${datadir}"
110                 ;;
111         --includedir)
112                 echo "${includedir}"
113                 ;;
114         --libdir)
115                 echo "${libdir}"
116                 ;;
117         --mandir)
118                 echo "${mandir}"
119                 ;;
120         --terminfo)
121                 echo "@TERMINFO@"
122                 ;;
123         --terminfo-dirs)
124                 echo "@TERMINFO_DIRS@"
125                 ;;
126         --termpath)
127                 echo "@TERMPATH@"
128                 ;;
129         # general info
130         --help)
131                 cat <<ENDHELP
132 Usage: ${THIS}-config [options]
133
134 Options:
135   --prefix           echos the package-prefix of ${THIS}
136   --prefix=ARG       sets the package-prefix of ${THIS}
137   --exec-prefix      echos the executable-prefix of ${THIS}
138   --exec-prefix=ARG  sets the executable-prefix of ${THIS}
139
140   --cflags           echos the C compiler flags needed to compile with ${THIS}
141   --libs             echos the libraries needed to link with ${THIS}
142
143   --version          echos the release+patchdate version of ${THIS}
144   --abi-version      echos the ABI version of ${THIS}
145   --mouse-version    echos the mouse-interface version of ${THIS}
146
147   --bindir           echos the directory containing ${THIS} programs
148   --datadir          echos the directory containing ${THIS} data
149   --includedir       echos the directory containing ${THIS} header files
150   --libdir           echos the directory containing ${THIS} libraries
151   --mandir           echos the directory containing ${THIS} manpages
152   --terminfo         echos the \$TERMINFO terminfo database path
153   --terminfo-dirs    echos the \$TERMINFO_DIRS directory list
154   --termpath         echos the \$TERMPATH termcap list
155
156   --help             prints this message
157 ENDHELP
158                 ;;
159         --error|*)
160                 @SHELL@ $0 --help 1>&2
161                 exit 1
162                 ;;
163         esac
164         shift
165 done
166 # vile:shmode