1#!/bin/sh
2
3# sqlrclient-config provides various informations about the sqlrclient
4# libraries. Julien MOUTTE 17/04/2002
5
6prefix=@prefix@
7exec_prefix=@exec_prefix@
8version=@SQLR_VERSION@
9
10# fake out rpmlint
11rp="rp"
12ath="ath"
13
14if ( test "@libdir@" = "/usr/lib" ); then
15	sqlrclient_libs="-l@SQLR@client "
16	sqlrclient_libs_with_rpath="$sqlrclient_libs"
17else
18	sqlrclient_libs="-L@libdir@ -l@SQLR@client "
19	sqlrclient_libs_with_rpath="-Wl,-$rp$ath @libdir@ $sqlrclient_libs"
20fi
21sqlrclient_cflags="@FPIC@ -I@includedir@"
22
23usage()
24{
25	cat <<EOF
26Usage: @SQLR@client-config [OPTIONS]
27Options:
28	[--prefix]
29	[--exec-prefix]
30	[--version]
31	[--libs]
32	[--with-$rp$ath]
33	[--cflags]
34EOF
35	exit $1
36}
37
38if ( test "$#" -eq "0" ); then
39	usage 1 1>&2
40fi
41
42while ( test "$#" -gt "0" ); do
43
44	case "$1" in
45		-*=*)
46			optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
47			;;
48		*)
49			optarg=
50			;;
51	esac
52
53	case $1 in
54		--prefix)
55			echo_prefix=yes
56			;;
57		--exec-prefix)
58			echo_exec_prefix=yes
59			;;
60		--version)
61			echo $version
62			;;
63		--cflags)
64			echo_cflags=yes
65			;;
66		--libs)
67			echo_libs=yes
68			;;
69		--with-$rp$ath)
70			with_rpath=yes
71			;;
72		*)
73			usage 1 1>&2
74			;;
75	esac
76	shift
77done
78
79if ( test "$echo_prefix" = "yes" ); then
80	echo $prefix
81fi
82
83if ( test "$echo_exec_prefix" = "yes" ); then
84	echo $exec_prefix
85fi
86
87if ( test "$echo_cflags" = "yes" ); then
88	echo $sqlrclient_cflags
89fi
90
91if ( test "$echo_libs" = "yes" ); then
92	if ( test "$with_rpath" = "yes" ); then
93		echo $sqlrclient_libs_with_rpath
94	else
95		echo $sqlrclient_libs
96	fi
97fi
98