glib/glib-config.in

98 lines
1.5 KiB
Plaintext
Raw Normal View History

1998-06-11 01:21:14 +02:00
#!/bin/sh
prefix=@prefix@
exec_prefix=@exec_prefix@
exec_prefix_set=no
1998-08-09 10:32:18 +02:00
usage()
{
cat <<EOF
Usage: glib-config [OPTIONS] [LIBRARIES]
Options:
[--prefix[=DIR]]
[--exec-prefix[=DIR]]
[--version]
[--libs]
[--cflags]
Libraries:
glib
gmodule
EOF
exit $1
}
1998-06-11 01:21:14 +02:00
if test $# -eq 0; then
1998-08-09 10:32:18 +02:00
usage 1 1>&2
1998-06-11 01:21:14 +02:00
fi
1998-08-09 10:32:18 +02:00
lib_glib=yes
1998-06-11 01:21:14 +02:00
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 $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
1998-08-09 10:32:18 +02:00
echo_prefix=yes
1998-06-11 01:21:14 +02:00
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
1998-08-09 10:32:18 +02:00
echo_exec_prefix=yes
1998-06-11 01:21:14 +02:00
;;
--version)
echo @GLIB_VERSION@
1998-08-09 10:32:18 +02:00
exit 0
1998-06-11 01:21:14 +02:00
;;
--cflags)
1998-08-09 10:32:18 +02:00
if test "@includedir@" != /usr/include ; then
includes="-I@includedir@"
1998-06-11 01:21:14 +02:00
fi
1998-08-09 10:32:18 +02:00
echo_cflags=yes
1998-06-11 01:21:14 +02:00
;;
--libs)
1998-08-09 10:32:18 +02:00
echo_libs=yes
;;
glib)
lib_glib=yes
;;
gmodule)
lib_gmodule=yes
1998-06-11 01:21:14 +02:00
;;
*)
1998-08-09 10:32:18 +02:00
usage 1 1>&2
1998-06-11 01:21:14 +02:00
;;
esac
shift
done
1998-08-09 10:32:18 +02:00
if test "$echo_prefix" = "yes"; then
echo $prefix
fi
if test "$echo_exec_prefix" = "yes"; then
echo $exec_prefix
fi
if test "$echo_cflags" = "yes"; then
echo -I@libdir@/glib/include $includes
fi
if test "$echo_libs" = "yes"; then
libs=""
if test "$lib_glib" = "yes"; then
libs="$libs -lglib"
1998-08-09 10:32:18 +02:00
fi
if test "$lib_gmodule" = "yes"; then
libs="@G_MODULE_LDFLAGS@ -lgmodule $libs @G_MODULE_LIBS@"
1998-08-09 10:32:18 +02:00
fi
echo "-L@libdir@ $libs"
fi