blob: 73cbfff6bfbf2f684abfeded2cfb0f866a2aa1ce [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301#!@SHELL@
Steve Kondikae271bc2015-11-15 02:50:53 +01002# $Id: ncurses-config.in,v 1.35 2015/04/22 00:54:19 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303##############################################################################
Steve Kondikae271bc2015-11-15 02:50:53 +01004# Copyright (c) 2006-2012,2015 Free Software Foundation, Inc. #
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05305# #
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#
Steve Kondikae271bc2015-11-15 02:50:53 +010031# Author: Thomas E. Dickey, 2006-on
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053032
33LANG=C; export LANG
34LANGUAGE=C; export LANGUAGE
35LC_ALL=C; export LC_ALL
36LC_CTYPE=C; export LC_CTYPE
37
Steve Kondikae271bc2015-11-15 02:50:53 +010038prefix="@prefix@"
39exec_prefix="@exec_prefix@"
40
41bindir="@bindir@"
42includedir="@includedir@"
43libdir="@libdir@"
44datarootdir="@datarootdir@"
45datadir="@datadir@"
46mandir="@mandir@"
47
48THIS="@LIB_NAME@@USE_LIB_SUFFIX@"
49TINFO_LIB="@TINFO_ARG_SUFFIX@"
50RPATH_LIST="@RPATH_LIST@"
51
52includesubdir="@includedir@/${THIS}"
53
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.
57if test -n "$RPATH_LIST"
58then
59 save_IFS="$IFS"
60 IFS='@PATH_SEPARATOR@'
61 filtered=
62 for item in $RPATH_LIST
63 do
64 case "$item" in
65 ./*|../*|*/..|*/../*)
66 ;;
67 *)
68 test -n "$filtered" && filtered="${filtered}@PATH_SEPARATOR@"
69 filtered="${filtered}${item}"
70 ;;
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"
76fi
77
78# with --disable-overwrite, we installed into a subdirectory, but transformed
79# the headers to include like this:
80# <ncurses@LIB_SUFFIX@/curses.h>
81if test x@WITH_OVERWRITE@ = xno ; then
82 case $includedir in
83 $prefix/include/ncurses@LIB_SUFFIX@@EXTRA_SUFFIX@)
84 includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
85 ;;
86 esac
87fi
88
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053089test $# = 0 && exec @SHELL@ $0 --error
90
91while test $# -gt 0; do
92 case "$1" in
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053093 # basic configuration
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053094 --prefix)
95 echo "$prefix"
96 ;;
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053097 --exec-prefix)
98 echo "$exec_prefix"
99 ;;
100 # compile/link
101 --cflags)
Steve Kondikae271bc2015-11-15 02:50:53 +0100102 INCS="@PKG_CFLAGS@"
103 if test "x@WITH_OVERWRITE@" = xno ; then
104 INCS="$INCS -I${includesubdir}"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530105 fi
Steve Kondikae271bc2015-11-15 02:50:53 +0100106 if test "${includedir}" != /usr/include ; then
107 INCS="$INCS -I${includedir}"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530108 fi
109 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
110 $INCS
111ENDECHO
112 ;;
113 --libs)
Steve Kondikae271bc2015-11-15 02:50:53 +0100114 if test "$libdir" = /usr/lib
115 then
116 LIBDIR=
117 else
118 LIBDIR=-L$libdir
119 fi
120 if test @TINFO_NAME@ = @LIB_NAME@ ; then
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530121 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
Steve Kondikae271bc2015-11-15 02:50:53 +0100122 $LIBDIR @EXTRA_LDFLAGS@ -l${THIS} @LIBS@
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530123ENDECHO
Steve Kondikae271bc2015-11-15 02:50:53 +0100124 else
125 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
126 $LIBDIR @EXTRA_LDFLAGS@ -l${THIS} -l${TINFO_LIB} @LIBS@
127ENDECHO
128 fi
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530129 ;;
130 # identification
131 --version)
132 echo "@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
133 ;;
134 --abi-version)
135 echo "@cf_cv_abi_version@"
136 ;;
137 --mouse-version)
138 echo "@NCURSES_MOUSE_VERSION@"
139 ;;
140 # locations
141 --bindir)
142 echo "${bindir}"
143 ;;
144 --datadir)
145 echo "${datadir}"
146 ;;
Steve Kondikae271bc2015-11-15 02:50:53 +0100147 --includedir)
148 echo "${includedir}"
149 ;;
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530150 --libdir)
151 echo "${libdir}"
152 ;;
153 --mandir)
154 echo "${mandir}"
155 ;;
156 --terminfo)
157 echo "@TERMINFO@"
158 ;;
159 --terminfo-dirs)
160 echo "@TERMINFO_DIRS@"
161 ;;
162 --termpath)
163 echo "@TERMPATH@"
164 ;;
165 # general info
166 --help)
167 cat <<ENDHELP
Steve Kondikae271bc2015-11-15 02:50:53 +0100168Usage: `basename $0` [options]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530169
170Options:
171 --prefix echos the package-prefix of ${THIS}
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530172 --exec-prefix echos the executable-prefix of ${THIS}
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530173
174 --cflags echos the C compiler flags needed to compile with ${THIS}
175 --libs echos the libraries needed to link with ${THIS}
176
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}
180
181 --bindir echos the directory containing ${THIS} programs
182 --datadir echos the directory containing ${THIS} data
Steve Kondikae271bc2015-11-15 02:50:53 +0100183 --includedir echos the directory containing ${THIS} header files
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530184 --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
189
190 --help prints this message
191ENDHELP
192 ;;
193 --error|*)
194 @SHELL@ $0 --help 1>&2
195 exit 1
196 ;;
197 esac
198 shift
199done
Steve Kondikae271bc2015-11-15 02:50:53 +0100200# vi:ts=4 sw=4
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530201# vile:shmode