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