isc-config.sh.in 2.48 KB
Newer Older
Brian Wellington's avatar
Brian Wellington committed
1
#!/bin/sh
Andreas Gustafsson's avatar
Andreas Gustafsson committed
2
#
Brian Wellington's avatar
Brian Wellington committed
3
# Copyright (C) 2000, 2001  Internet Software Consortium.
4
#
Andreas Gustafsson's avatar
Andreas Gustafsson committed
5
6
7
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
8
#
9
10
11
12
13
14
15
16
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Andreas Gustafsson's avatar
Andreas Gustafsson committed
17

18
# $Id: isc-config.sh.in,v 1.9 2001/03/03 05:28:52 halley Exp $
Brian Wellington's avatar
Brian Wellington committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

prefix=@prefix@
exec_prefix=@exec_prefix@
exec_prefix_set=

usage()
{
	cat << EOF
Usage: isc-config [OPTIONS] [LIBRARIES]
Options:
	[--prefix[=DIR]]
	[--exec-prefix[=DIR]]
	[--version]
	[--libs]
	[--cflags]
Libraries:
	isc
	dns
	lwres
EOF
	exit $1
}

if test $# -eq 0; then
	usage 1 1>&2
fi

while test $# -gt 0; do
	case "$1" in
	-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
	*) optarg= ;;
	esac

	case "$1" in
	--prefix=*)
		prefix=$optarg
		if test "x$exec_prefix_set" = x ; then
			exec_prefix=$prefix
		fi
		;;
	--prefix)
		echo_prefix=true
		;;
	--exec-prefix=*)
		exec_prefix=$optarg
		;;
	--exec-prefix)
		echo_exec_prefix=true
		;;
	--version)
		echo @BIND9_VERSION@
		exit 0
		;;
	--cflags)
		echo_cflags=true
		;;
	--libs)
		echo_libs=true;
		;;
	isc)
		libisc=true;
		;;
	dns)
		libdns=true;
		;;
	lwres)
		liblwres=true;
		;;
	*)
		usage 1 1>&2
	esac
	shift
done

if test x"$echo_prefix" = x"true" ; then
	echo $prefix
fi
if test x"$echo_exec_prefix" = x"true" ; then
	echo $exec_prefix
fi
if test x"$echo_cflags" = x"true"; then
100
101
	includes="-I${exec_prefix}/include"
	if test x"$libdns" = x"true" -o x"$libisc" = x"true"; then
102
		includes="$includes @ALWAYS_DEFINES@ @STD_CINCLUDES@ @STD_CDEFINES@ @CCOPT@"
103
104
	fi
	echo $includes
Brian Wellington's avatar
Brian Wellington committed
105
106
107
108
109
110
111
112
fi
if test x"$echo_libs" = x"true"; then
	libs=-L${exec_prefix}/lib
	if test x"$liblwres" = x"true" ; then
		libs="$libs -llwres"
	fi
	if test x"$libdns" = x"true" ; then
		libs="$libs -ldns @DNS_OPENSSL_LIBS@"
113
		needothers=true
Brian Wellington's avatar
Brian Wellington committed
114
115
116
	fi
	if test x"$libisc" = x"true" ; then
		libs="$libs -lisc"
117
118
119
		needothers=true
	fi
	if test x"$needothers" = x"true" ; then
120
		libs="$libs @CCOPT@ @LIBS@"
Brian Wellington's avatar
Brian Wellington committed
121
	fi
122
	echo $libs
Brian Wellington's avatar
Brian Wellington committed
123
fi