2 # $Id: ncurses-config.in,v 1.42 2019/12/25 00:54:55 tom Exp $
3 ##############################################################################
4 # Copyright (c) 2006-2018,2019 Free Software Foundation, Inc. #
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: #
14 # The above copyright notice and this permission notice shall be included in #
15 # all copies or substantial portions of the Software. #
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. #
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 #
29 ##############################################################################
31 # Author: Thomas E. Dickey, 2006-on
34 LANGUAGE=C; export LANGUAGE
35 LC_ALL=C; export LC_ALL
36 LC_CTYPE=C; export LC_CTYPE
39 exec_prefix="@exec_prefix@"
42 includedir="@includedir@"
44 datarootdir="@datarootdir@"
48 THIS="@LIB_NAME@@USE_LIB_SUFFIX@"
49 TINFO_LIB="@TINFO_ARG_SUFFIX@"
50 RPATH_LIST="@RPATH_LIST@"
52 includesubdir="@includedir@/${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 [ -n "$RPATH_LIST" ]
60 IFS='@PATH_SEPARATOR@'
62 for item in $RPATH_LIST
68 [ -n "$filtered" ] && filtered="${filtered}@PATH_SEPARATOR@"
69 filtered="${filtered}${item}"
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@LIB_SUFFIX@/curses.h>
81 if [ x@WITH_OVERWRITE@ = xno ]; then
83 $prefix/include/ncurses@LIB_SUFFIX@@EXTRA_SUFFIX@)
84 includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
90 if [ "@TINFO_NAME@" = "@LIB_NAME@" ]; then
91 LIBS="-l${THIS} $LIBS"
93 LIBS="-l${THIS} -l${TINFO_LIB} $LIBS"
96 # Ignore -L options which do not correspond to an actual directory, or which
97 # are standard library directories (i.e., the linker is supposed to search
100 # There is no portable way to find the list of standard library directories.
101 # Require a POSIX shell anyway, to keep this simple.
103 for opt in -L$libdir @LDFLAGS@ @EXTRA_LDFLAGS@ $LIBS
106 -specs*) # ignore linker specs-files which were used to build library
109 -Wl,-z,*) # ignore flags used to manipulate shared image
113 [ -d ${opt##-L} ] || continue
115 @LD_SEARCHPATH@) # skip standard libdir
120 for check in $lib_flags
122 if [ "x$check" = "x$opt" ]
128 [ $found = yes ] && continue
133 lib_flags="$lib_flags $opt"
136 [ $# = 0 ] && exec @SHELL@ $0 --error
138 while [ $# -gt 0 ]; do
140 # basic configuration
150 if [ "x@WITH_OVERWRITE@" = xno ]; then
151 INCS="$INCS -I${includesubdir}"
153 if [ "${includedir}" != /usr/include ]; then
154 INCS="$INCS -I${includedir}"
156 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
162 for opt in $lib_flags
164 [ -n "$OPTS" ] && OPTS="$OPTS "
167 printf "%s\n" "$OPTS"
171 for opt in $lib_flags
175 [ -n "$OPTS" ] && OPTS="$OPTS "
180 printf "%s\n" "$OPTS"
184 for opt in $lib_flags
188 [ -n "$OPTS" ] && OPTS="$OPTS "
193 printf "%s\n" "$OPTS"
197 for opt in $lib_flags
203 [ -n "$OPTS" ] && OPTS="$OPTS "
208 printf "%s\n" "$OPTS"
212 echo "@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
215 echo "@cf_cv_abi_version@"
218 echo "@NCURSES_MOUSE_VERSION@"
229 if [ "x@WITH_OVERWRITE@" = xno ]; then
230 INCS="${includesubdir}"
231 elif [ "${includedir}" != /usr/include ]; then
246 echo "@TERMINFO_DIRS@"
254 Usage: `basename $0` [options]
257 --prefix echos the package-prefix of ${THIS}
258 --exec-prefix echos the executable-prefix of ${THIS}
260 --cflags echos the C compiler flags needed to compile with ${THIS}
261 --libs echos the libraries needed to link with ${THIS}
263 --libs-only-L echos -L linker options (search path) for ${THIS}
264 --libs-only-l echos -l linker options (libraries) for ${THIS}
265 --libs-only-other echos linker options other than -L/-l
267 --version echos the release+patchdate version of ${THIS}
268 --abi-version echos the ABI version of ${THIS}
269 --mouse-version echos the mouse-interface version of ${THIS}
271 --bindir echos the directory containing ${THIS} programs
272 --datadir echos the directory containing ${THIS} data
273 --includedir echos the directory containing ${THIS} header files
274 --libdir echos the directory containing ${THIS} libraries
275 --mandir echos the directory containing ${THIS} manpages
276 --terminfo echos the \$TERMINFO terminfo database path
277 --terminfo-dirs echos the \$TERMINFO_DIRS directory list
278 --termpath echos the \$TERMPATH termcap list
280 --help prints this message
284 @SHELL@ $0 --help 1>&2