1#!@SHELL@
2# $Id: ncurses-config.in,v 1.12 2007/03/17 20:02:19 tom Exp $
3##############################################################################
4# Copyright (c) 2006,2007 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
32
33prefix="@prefix@"
34exec_prefix="@exec_prefix@"
35
36bindir="@bindir@"
37libdir="@libdir@"
38datadir="@datadir@"
39mandir="@mandir@"
40
41THIS="ncurses@DFT_ARG_SUFFIX@"
42
43LANG=C;		export LANG
44LANGUAGE=C;	export LANGUAGE
45LC_ALL=C;	export LC_ALL
46LC_CTYPE=C;	export LC_CTYPE
47
48test $# = 0 && exec @SHELL@ $0 --error
49
50while test $# -gt 0; do
51	case "$1" in
52	-*=*)
53		ARG=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
54		;;
55	*)
56		ARG=
57		;;
58	esac
59
60	case "$1" in
61	# basic configuration
62	--prefix=*)
63		prefix="$ARG"
64		test -z "$exec_prefix" && exec_prefix="$ARG"
65		;;
66	--prefix)
67		echo "$prefix"
68		;;
69	--exec-prefix=*)
70		exec_prefix="$ARG"
71		;;
72	--exec-prefix)
73		echo "$exec_prefix"
74		;;
75	# compile/link
76	--cflags)
77		INCS=
78		if test "${prefix}/include" != /usr/include ; then
79			INCS="-I${prefix}/include"
80		fi
81		if test "@WITH_OVERWRITE@" != no ; then
82			INCS="$INCS -I${prefix}/include/${THIS}"
83		fi
84		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
85			$INCS
86ENDECHO
87		;;
88	--libs)
89		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
90			-L${exec_prefix}/lib @EXTRA_LDFLAGS@ -l${THIS} @LIBS@
91ENDECHO
92		;;
93	# identification
94	--version)
95		echo "@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
96		;;
97	--abi-version)
98		echo "@cf_cv_abi_version@"
99		;;
100	--mouse-version)
101		echo "@NCURSES_MOUSE_VERSION@"
102		;;
103	# locations
104	--bindir)
105		echo "${bindir}"
106		;;
107	--datadir)
108		echo "${datadir}"
109		;;
110	--libdir)
111		echo "${libdir}"
112		;;
113	--mandir)
114		echo "${mandir}"
115		;;
116	--terminfo)
117		echo "@TERMINFO@"
118		;;
119	--terminfo-dirs)
120		echo "@TERMINFO_DIRS@"
121		;;
122	--termpath)
123		echo "@TERMPATH@"
124		;;
125	# general info
126	--help)
127		cat <<ENDHELP
128Usage: ${THIS}-config [options]
129
130Options:
131  --prefix           echos the package-prefix of ${THIS}
132  --prefix=ARG       sets the package-prefix of ${THIS}
133  --exec-prefix      echos the executable-prefix of ${THIS}
134  --exec-prefix=ARG  sets the executable-prefix of ${THIS}
135
136  --cflags           echos the C compiler flags needed to compile with ${THIS}
137  --libs             echos the libraries needed to link with ${THIS}
138
139  --version          echos the release+patchdate version of ${THIS}
140  --abi-version      echos the ABI version of ${THIS}
141  --mouse-version    echos the mouse-interface version of ${THIS}
142
143  --bindir           echos the directory containing ${THIS} programs
144  --datadir          echos the directory containing ${THIS} data
145  --libdir           echos the directory containing ${THIS} libraries
146  --mandir           echos the directory containing ${THIS} manpages
147  --terminfo         echos the \$TERMINFO terminfo database path
148  --terminfo-dirs    echos the \$TERMINFO_DIRS directory list
149  --termpath         echos the \$TERMPATH termcap list
150
151  --help             prints this message
152ENDHELP
153		;;
154	--error|*)
155		@SHELL@ $0 --help 1>&2
156		exit 1
157		;;
158	esac
159	shift
160done
161# vile:shmode
162