glib/glib-config.in

112 lines
1.8 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
gthread
1998-08-09 10:32:18 +02:00
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
;;
gthread)
lib_gthread=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
cflags=""
if test "$lib_gthread" = "yes"; then
cflags="$cflags @G_THREAD_CFLAGS@"
fi
echo -I@libdir@/glib/include $includes $cflags
1998-08-09 10:32:18 +02:00
fi
if test "$echo_libs" = "yes"; then
libsp=""
libsa=""
1998-08-09 10:32:18 +02:00
if test "$lib_glib" = "yes"; then
libsp="$libsp -lglib"
1998-08-09 10:32:18 +02:00
fi
if test "$lib_gthread" = "yes"; then
libsp="-lgthread $libsp"
libsa="$libsa @G_THREAD_LIBS@"
fi
if test "$lib_gmodule" = "yes"; then
libsp="@G_MODULE_LDFLAGS@ -lgmodule $libsp"
libsa="$libsa @G_MODULE_LIBS@"
fi
echo -L@libdir@ $libsp $libsa
1998-08-09 10:32:18 +02:00
fi