]> ncurses.scripts.mit.edu Git - ncurses.git/blob - misc/ncurses-config.in
ncurses 5.9 - patch 20121006
[ncurses.git] / misc / ncurses-config.in
1 #!@SHELL@
2 # $Id: ncurses-config.in,v 1.28 2012/08/11 21:45:20 tom Exp $
3 ##############################################################################
4 # Copyright (c) 2006-2010,2011 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-on
32
33 prefix="@prefix@"
34 exec_prefix="@exec_prefix@"
35
36 bindir="@bindir@"
37 includedir="@includedir@"
38 libdir="@libdir@"
39 datarootdir="@datarootdir@"
40 datadir="@datadir@"
41 mandir="@mandir@"
42
43 THIS="@LIB_NAME@@DFT_ARG_SUFFIX@"
44 TINFO_LIB="@TINFO_ARG_SUFFIX@"
45 RPATH_LIST="@RPATH_LIST@"
46
47 LANG=C;         export LANG
48 LANGUAGE=C;     export LANGUAGE
49 LC_ALL=C;       export LC_ALL
50 LC_CTYPE=C;     export LC_CTYPE
51
52 # with --disable-overwrite, we installed into a subdirectory, but transformed
53 # the headers to include like this:
54 #       <ncurses@LIB_SUFFIX@/curses.h>
55 if test x@WITH_OVERWRITE@ = xno ; then
56         case $includedir in
57         $prefix/include/ncurses@LIB_SUFFIX@)
58                 includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
59                 ;;
60         esac
61 fi
62
63 test $# = 0 && exec @SHELL@ $0 --error
64
65 while test $# -gt 0; do
66         case "$1" in
67         # basic configuration
68         --prefix)
69                 echo "$prefix"
70                 ;;
71         --exec-prefix)
72                 echo "$exec_prefix"
73                 ;;
74         # compile/link
75         --cflags)
76                 INCS=
77                 if test "x@WITH_OVERWRITE@" = xno ; then
78                         INCS="$INCS -I${includedir}/${THIS}"
79                 fi
80                 if test "${includedir}" != /usr/include ; then
81                         INCS="$INCS -I${includedir}"
82                 fi
83                 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
84                         $INCS
85 ENDECHO
86                 ;;
87         --libs)
88                 if test "$libdir" = /usr/lib
89                 then
90                         LIBDIR=
91                 else
92                         LIBDIR=-L$libdir
93                 fi
94                 if test @TINFO_NAME@ = @LIB_NAME@ ; then
95                 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
96                         $LIBDIR @EXTRA_LDFLAGS@ -l${THIS} @LIBS@
97 ENDECHO
98                 else
99                 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
100                         $LIBDIR @EXTRA_LDFLAGS@ -l${THIS} -l${TINFO_LIB} @LIBS@
101 ENDECHO
102                 fi
103                 ;;
104         # identification
105         --version)
106                 echo "@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
107                 ;;
108         --abi-version)
109                 echo "@cf_cv_abi_version@"
110                 ;;
111         --mouse-version)
112                 echo "@NCURSES_MOUSE_VERSION@"
113                 ;;
114         # locations
115         --bindir)
116                 echo "${bindir}"
117                 ;;
118         --datadir)
119                 echo "${datadir}"
120                 ;;
121         --includedir)
122                 echo "${includedir}"
123                 ;;
124         --libdir)
125                 echo "${libdir}"
126                 ;;
127         --mandir)
128                 echo "${mandir}"
129                 ;;
130         --terminfo)
131                 echo "@TERMINFO@"
132                 ;;
133         --terminfo-dirs)
134                 echo "@TERMINFO_DIRS@"
135                 ;;
136         --termpath)
137                 echo "@TERMPATH@"
138                 ;;
139         # general info
140         --help)
141                 cat <<ENDHELP
142 Usage: ${THIS}-config [options]
143
144 Options:
145   --prefix           echos the package-prefix of ${THIS}
146   --exec-prefix      echos the executable-prefix of ${THIS}
147
148   --cflags           echos the C compiler flags needed to compile with ${THIS}
149   --libs             echos the libraries needed to link with ${THIS}
150
151   --version          echos the release+patchdate version of ${THIS}
152   --abi-version      echos the ABI version of ${THIS}
153   --mouse-version    echos the mouse-interface version of ${THIS}
154
155   --bindir           echos the directory containing ${THIS} programs
156   --datadir          echos the directory containing ${THIS} data
157   --includedir       echos the directory containing ${THIS} header files
158   --libdir           echos the directory containing ${THIS} libraries
159   --mandir           echos the directory containing ${THIS} manpages
160   --terminfo         echos the \$TERMINFO terminfo database path
161   --terminfo-dirs    echos the \$TERMINFO_DIRS directory list
162   --termpath         echos the \$TERMPATH termcap list
163
164   --help             prints this message
165 ENDHELP
166                 ;;
167         --error|*)
168                 @SHELL@ $0 --help 1>&2
169                 exit 1
170                 ;;
171         esac
172         shift
173 done
174 # vi:ts=4 sw=4
175 # vile:shmode