xref: /freebsd/contrib/dialog/dialog-config.in (revision 2a3e3873a1e4cd958f2b0f85d3b10cfa40575d30)
14c8945a0SNathan Whitehorn#!@SHELL@
2*2a3e3873SBaptiste Daroussin# $Id: dialog-config.in,v 1.6 2012/10/06 14:29:45 tom Exp $
34c8945a0SNathan Whitehorn##############################################################################
4*2a3e3873SBaptiste Daroussin# Copyright (c) 2007-2011,2012 Thomas E. Dickey                              #
54c8945a0SNathan Whitehorn#                                                                            #
64c8945a0SNathan Whitehorn# Permission is hereby granted, free of charge, to any person obtaining a    #
74c8945a0SNathan Whitehorn# copy of this software and associated documentation files (the "Software"), #
84c8945a0SNathan Whitehorn# to deal in the Software without restriction, including without limitation  #
94c8945a0SNathan Whitehorn# the rights to use, copy, modify, merge, publish, distribute, distribute    #
104c8945a0SNathan Whitehorn# with modifications, sublicense, and/or sell copies of the Software, and to #
114c8945a0SNathan Whitehorn# permit persons to whom the Software is furnished to do so, subject to the  #
124c8945a0SNathan Whitehorn# following conditions:                                                      #
134c8945a0SNathan Whitehorn#                                                                            #
144c8945a0SNathan Whitehorn# The above copyright notice and this permission notice shall be included in #
154c8945a0SNathan Whitehorn# all copies or substantial portions of the Software.                        #
164c8945a0SNathan Whitehorn#                                                                            #
174c8945a0SNathan Whitehorn# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
184c8945a0SNathan Whitehorn# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
194c8945a0SNathan Whitehorn# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
204c8945a0SNathan Whitehorn# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
214c8945a0SNathan Whitehorn# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
224c8945a0SNathan Whitehorn# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
234c8945a0SNathan Whitehorn# DEALINGS IN THE SOFTWARE.                                                  #
244c8945a0SNathan Whitehorn#                                                                            #
254c8945a0SNathan Whitehorn# Except as contained in this notice, the name(s) of the above copyright     #
264c8945a0SNathan Whitehorn# holders shall not be used in advertising or otherwise to promote the sale, #
274c8945a0SNathan Whitehorn# use or other dealings in this Software without prior written               #
284c8945a0SNathan Whitehorn# authorization.                                                             #
294c8945a0SNathan Whitehorn##############################################################################
304c8945a0SNathan Whitehorn
314c8945a0SNathan Whitehornprefix="@prefix@"
324c8945a0SNathan Whitehornexec_prefix="@exec_prefix@"
33*2a3e3873SBaptiste Daroussindatarootdir="@datarootdir@"
344c8945a0SNathan Whitehorn
354c8945a0SNathan Whitehornbindir="@bindir@"
364c8945a0SNathan Whitehornlibdir="@libdir@"
374c8945a0SNathan Whitehorndatadir="@datadir@"
384c8945a0SNathan Whitehornmandir="@mandir@"
394c8945a0SNathan Whitehorn
407a1c0d96SNathan WhitehornTHIS="@PACKAGE@"
414c8945a0SNathan Whitehorn
424c8945a0SNathan Whitehorntest $# = 0 && exec @SHELL@ $0 --error
434c8945a0SNathan Whitehorn
444c8945a0SNathan Whitehornwhile test $# -gt 0; do
454c8945a0SNathan Whitehorn	case "$1" in
464c8945a0SNathan Whitehorn	-*=*)
474c8945a0SNathan Whitehorn		ARG=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
484c8945a0SNathan Whitehorn		;;
494c8945a0SNathan Whitehorn	*)
504c8945a0SNathan Whitehorn		ARG=
514c8945a0SNathan Whitehorn		;;
524c8945a0SNathan Whitehorn	esac
534c8945a0SNathan Whitehorn
544c8945a0SNathan Whitehorn	case "$1" in
554c8945a0SNathan Whitehorn	# basic configuration
564c8945a0SNathan Whitehorn	--prefix=*)
574c8945a0SNathan Whitehorn		prefix="$ARG"
584c8945a0SNathan Whitehorn		test -z "$exec_prefix" && exec_prefix="$ARG"
594c8945a0SNathan Whitehorn		;;
604c8945a0SNathan Whitehorn	--prefix)
614c8945a0SNathan Whitehorn		echo "$prefix"
624c8945a0SNathan Whitehorn		;;
634c8945a0SNathan Whitehorn	--exec-prefix=*)
644c8945a0SNathan Whitehorn		exec_prefix="$ARG"
654c8945a0SNathan Whitehorn		;;
664c8945a0SNathan Whitehorn	--exec-prefix)
674c8945a0SNathan Whitehorn		echo "$exec_prefix"
684c8945a0SNathan Whitehorn		;;
694c8945a0SNathan Whitehorn	# compile/link
704c8945a0SNathan Whitehorn	--cflags)
714c8945a0SNathan Whitehorn		INCS=
724c8945a0SNathan Whitehorn		if test "${prefix}/include" != /usr/include ; then
734c8945a0SNathan Whitehorn			INCS="-I${prefix}/include"
744c8945a0SNathan Whitehorn		fi
754c8945a0SNathan Whitehorn		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
764c8945a0SNathan Whitehorn			$INCS
774c8945a0SNathan WhitehornENDECHO
784c8945a0SNathan Whitehorn		;;
794c8945a0SNathan Whitehorn	--libs)
804c8945a0SNathan Whitehorn		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
814c8945a0SNathan Whitehorn			-L${exec_prefix}/lib -l${THIS} @LIBS@
824c8945a0SNathan WhitehornENDECHO
834c8945a0SNathan Whitehorn		;;
844c8945a0SNathan Whitehorn	# identification
854c8945a0SNathan Whitehorn	--version)
864c8945a0SNathan Whitehorn		echo "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@"
874c8945a0SNathan Whitehorn		;;
884c8945a0SNathan Whitehorn	--abi-version)
894c8945a0SNathan Whitehorn		echo "@VERSION@" | sed -e 's/:/./g'
904c8945a0SNathan Whitehorn		;;
914c8945a0SNathan Whitehorn	# locations
924c8945a0SNathan Whitehorn	--bindir)
934c8945a0SNathan Whitehorn		echo "${bindir}"
944c8945a0SNathan Whitehorn		;;
954c8945a0SNathan Whitehorn	--datadir)
964c8945a0SNathan Whitehorn		echo "${datadir}"
974c8945a0SNathan Whitehorn		;;
984c8945a0SNathan Whitehorn	--libdir)
994c8945a0SNathan Whitehorn		echo "${libdir}"
1004c8945a0SNathan Whitehorn		;;
1014c8945a0SNathan Whitehorn	--mandir)
1024c8945a0SNathan Whitehorn		echo "${mandir}"
1034c8945a0SNathan Whitehorn		;;
1044c8945a0SNathan Whitehorn	# general info
1054c8945a0SNathan Whitehorn	--help)
1064c8945a0SNathan Whitehorn		cat <<ENDHELP
1074c8945a0SNathan WhitehornUsage: ${THIS}-config [options]
1084c8945a0SNathan Whitehorn
1094c8945a0SNathan WhitehornOptions:
1104c8945a0SNathan Whitehorn  --prefix           echos the package-prefix of ${THIS}
1114c8945a0SNathan Whitehorn  --prefix=ARG       sets the package-prefix of ${THIS}
1124c8945a0SNathan Whitehorn  --exec-prefix      echos the executable-prefix of ${THIS}
1134c8945a0SNathan Whitehorn  --exec-prefix=ARG  sets the executable-prefix of ${THIS}
1144c8945a0SNathan Whitehorn
1154c8945a0SNathan Whitehorn  --cflags           echos the C compiler flags needed to compile with ${THIS}
1164c8945a0SNathan Whitehorn  --libs             echos the libraries needed to link with ${THIS}
1174c8945a0SNathan Whitehorn
1184c8945a0SNathan Whitehorn  --version          echos the release+patchdate version of ${THIS}
1194c8945a0SNathan Whitehorn  --abi-version      echos the ABI version of ${THIS}
1204c8945a0SNathan Whitehorn
1214c8945a0SNathan Whitehorn  --bindir           echos the directory containing ${THIS} programs
1224c8945a0SNathan Whitehorn  --datadir          echos the directory containing ${THIS} data
1234c8945a0SNathan Whitehorn  --libdir           echos the directory containing ${THIS} libraries
1244c8945a0SNathan Whitehorn  --mandir           echos the directory containing ${THIS} manpages
1254c8945a0SNathan Whitehorn
1264c8945a0SNathan Whitehorn  --help             prints this message
1274c8945a0SNathan WhitehornENDHELP
1284c8945a0SNathan Whitehorn		;;
1294c8945a0SNathan Whitehorn	--error|*)
1304c8945a0SNathan Whitehorn		@SHELL@ $0 --help 1>&2
1314c8945a0SNathan Whitehorn		exit 1
1324c8945a0SNathan Whitehorn		;;
1334c8945a0SNathan Whitehorn	esac
1344c8945a0SNathan Whitehorn	shift
1354c8945a0SNathan Whitehorndone
1364c8945a0SNathan Whitehorn# vile:shmode
137