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