Unleashed v1.4
[unleashed.git] / contrib / ncurses / misc / ncurses-config
blob94865f556e3921a68b0b15339fc63a05a93a7cb1
1 #!/bin/sh
2 # $Id: ncurses-config.in,v 1.35 2015/04/22 00:54:19 tom Exp $
3 ##############################################################################
4 # Copyright (c) 2006-2012,2015 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 ##############################################################################
31 # Author: Thomas E. Dickey, 2006-on
33 LANG=C; export LANG
34 LANGUAGE=C; export LANGUAGE
35 LC_ALL=C; export LC_ALL
36 LC_CTYPE=C; export LC_CTYPE
38 prefix="/usr"
39 exec_prefix="${prefix}"
41 bindir="${exec_prefix}/bin"
42 includedir="${prefix}/include"
43 libdir="${exec_prefix}/lib"
44 datarootdir="${prefix}/share"
45 datadir="${datarootdir}"
46 mandir="${datarootdir}/man"
48 THIS="ncurses"
49 TINFO_LIB="ncurses"
50 RPATH_LIST="${libdir}"
52 includesubdir="${prefix}/include/${THIS}"
54 # Ensure that RPATH_LIST contains only absolute pathnames, if it is nonempty.
55 # We cannot filter it out within the build-process since the variable is used
56 # in some special cases of installation using a relative path.
57 if test -n "$RPATH_LIST"
58 then
59 save_IFS="$IFS"
60 IFS=':'
61 filtered=
62 for item in $RPATH_LIST
64 case "$item" in
65 ./*|../*|*/..|*/../*)
68 test -n "$filtered" && filtered="${filtered}:"
69 filtered="${filtered}${item}"
71 esac
72 done
73 IFS="$save_IFS"
74 # if the result is empty, there is little we can do to fix it
75 RPATH_LIST="$filtered"
78 # with --disable-overwrite, we installed into a subdirectory, but transformed
79 # the headers to include like this:
80 # <ncurses/curses.h>
81 if test xno = xno ; then
82 case $includedir in
83 $prefix/include/ncurses)
84 includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
86 esac
89 test $# = 0 && exec /bin/sh $0 --error
91 while test $# -gt 0; do
92 case "$1" in
93 # basic configuration
94 --prefix)
95 echo "$prefix"
97 --exec-prefix)
98 echo "$exec_prefix"
100 # compile/link
101 --cflags)
102 INCS=" -D__EXTENSIONS__"
103 if test "xno" = xno ; then
104 INCS="$INCS -I${includesubdir}"
106 if test "${includedir}" != /usr/include ; then
107 INCS="$INCS -I${includedir}"
109 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
110 $INCS
111 ENDECHO
113 --libs)
114 if test "$libdir" = /usr/lib
115 then
116 LIBDIR=
117 else
118 LIBDIR=-L$libdir
120 if test ncurses = ncurses ; then
121 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
122 $LIBDIR -l${THIS}
123 ENDECHO
124 else
125 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
126 $LIBDIR -l${THIS} -l${TINFO_LIB}
127 ENDECHO
130 # identification
131 --version)
132 echo "6.0.20170916"
134 --abi-version)
135 echo "6"
137 --mouse-version)
138 echo "2"
140 # locations
141 --bindir)
142 echo "${bindir}"
144 --datadir)
145 echo "${datadir}"
147 --includedir)
148 echo "${includedir}"
150 --libdir)
151 echo "${libdir}"
153 --mandir)
154 echo "${mandir}"
156 --terminfo)
157 echo "/usr/share/terminfo"
159 --terminfo-dirs)
160 echo "/usr/share/terminfo"
162 --termpath)
163 echo ""
165 # general info
166 --help)
167 cat <<ENDHELP
168 Usage: `basename $0` [options]
170 Options:
171 --prefix echos the package-prefix of ${THIS}
172 --exec-prefix echos the executable-prefix of ${THIS}
174 --cflags echos the C compiler flags needed to compile with ${THIS}
175 --libs echos the libraries needed to link with ${THIS}
177 --version echos the release+patchdate version of ${THIS}
178 --abi-version echos the ABI version of ${THIS}
179 --mouse-version echos the mouse-interface version of ${THIS}
181 --bindir echos the directory containing ${THIS} programs
182 --datadir echos the directory containing ${THIS} data
183 --includedir echos the directory containing ${THIS} header files
184 --libdir echos the directory containing ${THIS} libraries
185 --mandir echos the directory containing ${THIS} manpages
186 --terminfo echos the \$TERMINFO terminfo database path
187 --terminfo-dirs echos the \$TERMINFO_DIRS directory list
188 --termpath echos the \$TERMPATH termcap list
190 --help prints this message
191 ENDHELP
193 --error|*)
194 /bin/sh $0 --help 1>&2
195 exit 1
197 esac
198 shift
199 done
200 # vi:ts=4 sw=4
201 # vile:shmode