xref: /freebsd/contrib/ncurses/misc/ncurses-config.in (revision 06bfebdedb0d353f1771adb65731f64461d9bd01)
14a1a9510SRong-En Fan#!@SHELL@
2*06bfebdeSXin LI# $Id: ncurses-config.in,v 1.25 2011/03/19 22:43:38 tom Exp $
34a1a9510SRong-En Fan##############################################################################
4*06bfebdeSXin LI# Copyright (c) 2006-2010,2011 Free Software Foundation, Inc.                #
54a1a9510SRong-En Fan#                                                                            #
64a1a9510SRong-En Fan# Permission is hereby granted, free of charge, to any person obtaining a    #
74a1a9510SRong-En Fan# copy of this software and associated documentation files (the "Software"), #
84a1a9510SRong-En Fan# to deal in the Software without restriction, including without limitation  #
94a1a9510SRong-En Fan# the rights to use, copy, modify, merge, publish, distribute, distribute    #
104a1a9510SRong-En Fan# with modifications, sublicense, and/or sell copies of the Software, and to #
114a1a9510SRong-En Fan# permit persons to whom the Software is furnished to do so, subject to the  #
124a1a9510SRong-En Fan# following conditions:                                                      #
134a1a9510SRong-En Fan#                                                                            #
144a1a9510SRong-En Fan# The above copyright notice and this permission notice shall be included in #
154a1a9510SRong-En Fan# all copies or substantial portions of the Software.                        #
164a1a9510SRong-En Fan#                                                                            #
174a1a9510SRong-En Fan# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
184a1a9510SRong-En Fan# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
194a1a9510SRong-En Fan# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
204a1a9510SRong-En Fan# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
214a1a9510SRong-En Fan# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
224a1a9510SRong-En Fan# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
234a1a9510SRong-En Fan# DEALINGS IN THE SOFTWARE.                                                  #
244a1a9510SRong-En Fan#                                                                            #
254a1a9510SRong-En Fan# Except as contained in this notice, the name(s) of the above copyright     #
264a1a9510SRong-En Fan# holders shall not be used in advertising or otherwise to promote the sale, #
274a1a9510SRong-En Fan# use or other dealings in this Software without prior written               #
284a1a9510SRong-En Fan# authorization.                                                             #
294a1a9510SRong-En Fan##############################################################################
304a1a9510SRong-En Fan#
31*06bfebdeSXin LI# Author: Thomas E. Dickey, 2006-on
324a1a9510SRong-En Fan
334a1a9510SRong-En Fanprefix="@prefix@"
344a1a9510SRong-En Fanexec_prefix="@exec_prefix@"
354a1a9510SRong-En Fan
364a1a9510SRong-En Fanbindir="@bindir@"
37*06bfebdeSXin LIincludedir="@includedir@"
384a1a9510SRong-En Fanlibdir="@libdir@"
394a1a9510SRong-En Fandatadir="@datadir@"
404a1a9510SRong-En Fanmandir="@mandir@"
414a1a9510SRong-En Fan
42*06bfebdeSXin LITHIS="@LIB_NAME@@DFT_ARG_SUFFIX@"
43*06bfebdeSXin LITINFO_LIB="@TINFO_ARG_SUFFIX@"
444a1a9510SRong-En Fan
455ca44d1cSRong-En FanLANG=C;		export LANG
465ca44d1cSRong-En FanLANGUAGE=C;	export LANGUAGE
475ca44d1cSRong-En FanLC_ALL=C;	export LC_ALL
485ca44d1cSRong-En FanLC_CTYPE=C;	export LC_CTYPE
495ca44d1cSRong-En Fan
50*06bfebdeSXin LI# with --disable-overwrite, we installed into a subdirectory, but transformed
51*06bfebdeSXin LI# the headers to include like this:
52*06bfebdeSXin LI#	<ncurses@LIB_SUFFIX@/curses.h>
53*06bfebdeSXin LIif test x@WITH_OVERWRITE@ = xno ; then
54*06bfebdeSXin LI	case $includedir in
55*06bfebdeSXin LI	$prefix/include/ncurses@LIB_SUFFIX@)
56*06bfebdeSXin LI		includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
57*06bfebdeSXin LI		;;
58*06bfebdeSXin LI	esac
59*06bfebdeSXin LIfi
60*06bfebdeSXin LI
614a1a9510SRong-En Fantest $# = 0 && exec @SHELL@ $0 --error
624a1a9510SRong-En Fan
634a1a9510SRong-En Fanwhile test $# -gt 0; do
644a1a9510SRong-En Fan	case "$1" in
654a1a9510SRong-En Fan	# basic configuration
664a1a9510SRong-En Fan	--prefix)
674a1a9510SRong-En Fan		echo "$prefix"
684a1a9510SRong-En Fan		;;
694a1a9510SRong-En Fan	--exec-prefix)
704a1a9510SRong-En Fan		echo "$exec_prefix"
714a1a9510SRong-En Fan		;;
724a1a9510SRong-En Fan	# compile/link
734a1a9510SRong-En Fan	--cflags)
744a1a9510SRong-En Fan		INCS=
75*06bfebdeSXin LI		if test "x@WITH_OVERWRITE@" = xno ; then
76*06bfebdeSXin LI			INCS="$INCS -I${includedir}/${THIS}"
774a1a9510SRong-En Fan		fi
78*06bfebdeSXin LI		if test "${includedir}" != /usr/include ; then
79*06bfebdeSXin LI			INCS="$INCS -I${includedir}"
804a1a9510SRong-En Fan		fi
814a1a9510SRong-En Fan		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
824a1a9510SRong-En Fan			$INCS
834a1a9510SRong-En FanENDECHO
844a1a9510SRong-En Fan		;;
854a1a9510SRong-En Fan	--libs)
86*06bfebdeSXin LI		if test @TINFO_NAME@ = @LIB_NAME@ ; then
874a1a9510SRong-En Fan		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
88*06bfebdeSXin LI			-L$libdir @EXTRA_LDFLAGS@ -l${THIS} @LIBS@
894a1a9510SRong-En FanENDECHO
90*06bfebdeSXin LI		else
91*06bfebdeSXin LI		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
92*06bfebdeSXin LI			-L$libdir @EXTRA_LDFLAGS@ -l${THIS} -l${TINFO_LIB} @LIBS@
93*06bfebdeSXin LIENDECHO
94*06bfebdeSXin LI		fi
954a1a9510SRong-En Fan		;;
964a1a9510SRong-En Fan	# identification
974a1a9510SRong-En Fan	--version)
984a1a9510SRong-En Fan		echo "@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
994a1a9510SRong-En Fan		;;
1004a1a9510SRong-En Fan	--abi-version)
1014a1a9510SRong-En Fan		echo "@cf_cv_abi_version@"
1024a1a9510SRong-En Fan		;;
1034a1a9510SRong-En Fan	--mouse-version)
1044a1a9510SRong-En Fan		echo "@NCURSES_MOUSE_VERSION@"
1054a1a9510SRong-En Fan		;;
1064a1a9510SRong-En Fan	# locations
1074a1a9510SRong-En Fan	--bindir)
1084a1a9510SRong-En Fan		echo "${bindir}"
1094a1a9510SRong-En Fan		;;
1104a1a9510SRong-En Fan	--datadir)
1114a1a9510SRong-En Fan		echo "${datadir}"
1124a1a9510SRong-En Fan		;;
113*06bfebdeSXin LI	--includedir)
114*06bfebdeSXin LI		echo "${includedir}"
115*06bfebdeSXin LI		;;
1164a1a9510SRong-En Fan	--libdir)
1174a1a9510SRong-En Fan		echo "${libdir}"
1184a1a9510SRong-En Fan		;;
1194a1a9510SRong-En Fan	--mandir)
1204a1a9510SRong-En Fan		echo "${mandir}"
1214a1a9510SRong-En Fan		;;
1224a1a9510SRong-En Fan	--terminfo)
1234a1a9510SRong-En Fan		echo "@TERMINFO@"
1244a1a9510SRong-En Fan		;;
1254a1a9510SRong-En Fan	--terminfo-dirs)
1264a1a9510SRong-En Fan		echo "@TERMINFO_DIRS@"
1274a1a9510SRong-En Fan		;;
1284a1a9510SRong-En Fan	--termpath)
1294a1a9510SRong-En Fan		echo "@TERMPATH@"
1304a1a9510SRong-En Fan		;;
1314a1a9510SRong-En Fan	# general info
1324a1a9510SRong-En Fan	--help)
1334a1a9510SRong-En Fan		cat <<ENDHELP
1344a1a9510SRong-En FanUsage: ${THIS}-config [options]
1354a1a9510SRong-En Fan
1364a1a9510SRong-En FanOptions:
1374a1a9510SRong-En Fan  --prefix           echos the package-prefix of ${THIS}
1384a1a9510SRong-En Fan  --exec-prefix      echos the executable-prefix of ${THIS}
1394a1a9510SRong-En Fan
1404a1a9510SRong-En Fan  --cflags           echos the C compiler flags needed to compile with ${THIS}
1414a1a9510SRong-En Fan  --libs             echos the libraries needed to link with ${THIS}
1424a1a9510SRong-En Fan
1434a1a9510SRong-En Fan  --version          echos the release+patchdate version of ${THIS}
1444a1a9510SRong-En Fan  --abi-version      echos the ABI version of ${THIS}
1454a1a9510SRong-En Fan  --mouse-version    echos the mouse-interface version of ${THIS}
1464a1a9510SRong-En Fan
1474a1a9510SRong-En Fan  --bindir           echos the directory containing ${THIS} programs
1484a1a9510SRong-En Fan  --datadir          echos the directory containing ${THIS} data
149*06bfebdeSXin LI  --includedir       echos the directory containing ${THIS} header files
1504a1a9510SRong-En Fan  --libdir           echos the directory containing ${THIS} libraries
1514a1a9510SRong-En Fan  --mandir           echos the directory containing ${THIS} manpages
1524a1a9510SRong-En Fan  --terminfo         echos the \$TERMINFO terminfo database path
1534a1a9510SRong-En Fan  --terminfo-dirs    echos the \$TERMINFO_DIRS directory list
1544a1a9510SRong-En Fan  --termpath         echos the \$TERMPATH termcap list
1554a1a9510SRong-En Fan
1564a1a9510SRong-En Fan  --help             prints this message
1574a1a9510SRong-En FanENDHELP
1584a1a9510SRong-En Fan		;;
1594a1a9510SRong-En Fan	--error|*)
1604a1a9510SRong-En Fan		@SHELL@ $0 --help 1>&2
1614a1a9510SRong-En Fan		exit 1
1624a1a9510SRong-En Fan		;;
1634a1a9510SRong-En Fan	esac
1644a1a9510SRong-En Fan	shift
1654a1a9510SRong-En Fandone
1664a1a9510SRong-En Fan# vile:shmode
167