home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / wvhtm064.zip / glib128.zip / XFree86 / bin / glib-config
Text File  |  2000-06-14  |  2KB  |  112 lines

  1. #!/bin/sh
  2.  
  3. prefix=${X11ROOT}/XFree86
  4. exec_prefix=${prefix}
  5. exec_prefix_set=no
  6.  
  7. usage()
  8. {
  9.     cat <<EOF
  10. Usage: glib-config [OPTIONS] [LIBRARIES]
  11. Options:
  12.     [--prefix[=DIR]]
  13.     [--exec-prefix[=DIR]]
  14.     [--version]
  15.     [--libs]
  16.     [--cflags]
  17. Libraries:
  18.     glib
  19.     gmodule
  20.     gthread
  21. EOF
  22.     exit $1
  23. }
  24.  
  25. if test $# -eq 0; then
  26.     usage 1 1>&2
  27. fi
  28.  
  29. lib_glib=yes
  30.  
  31. while test $# -gt 0; do
  32.   case "$1" in
  33.   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  34.   *) optarg= ;;
  35.   esac
  36.  
  37.   case $1 in
  38.     --prefix=*)
  39.       prefix=$optarg
  40.       if test $exec_prefix_set = no ; then
  41.         exec_prefix=$optarg
  42.       fi
  43.       ;;
  44.     --prefix)
  45.       echo_prefix=yes
  46.       ;;
  47.     --exec-prefix=*)
  48.       exec_prefix=$optarg
  49.       exec_prefix_set=yes
  50.       ;;
  51.     --exec-prefix)
  52.       echo_exec_prefix=yes
  53.       ;;
  54.     --version)
  55.       echo 1.2.8
  56.       exit 0
  57.       ;;
  58.     --cflags)
  59.       if test "${prefix}/include" != /usr/include ; then
  60.         includes="-I${prefix}/include"
  61.       fi
  62.       echo_cflags=yes
  63.       ;;
  64.     --libs)
  65.       echo_libs=yes
  66.       ;;
  67.     glib)
  68.       lib_glib=yes
  69.       ;;
  70.     gmodule)
  71.       lib_gmodule=yes
  72.       ;;
  73.     gthread)
  74.       lib_gthread=yes
  75.       ;;
  76.     *)
  77.       usage 1 1>&2
  78.       ;;
  79.   esac
  80.   shift
  81. done
  82.  
  83. if test "$echo_prefix" = "yes"; then
  84.     echo $prefix
  85. fi
  86. if test "$echo_exec_prefix" = "yes"; then
  87.     echo $exec_prefix
  88. fi
  89. if test "$echo_cflags" = "yes"; then
  90.     cflags=""
  91.     if test "$lib_gthread" = "yes"; then
  92.         cflags="$cflags "
  93.     fi
  94.     echo -Zmt -D__ST_MT_ERRNO__ -I${prefix}/include/glib12 $includes $cflags
  95. fi
  96. if test "$echo_libs" = "yes"; then
  97.     libsp=""
  98.     libsa=""
  99.     if test "$lib_glib" = "yes"; then
  100.         libsp="$libsp -lglib12"
  101.     fi
  102.     if test "$lib_gthread" = "yes"; then
  103.         libsp="-lgthread $libsp"
  104.         libsa="$libsa "
  105.     fi
  106.     if test "$lib_gmodule" = "yes"; then
  107.         libsp=" -lgmodule $libsp"
  108.         libsa="$libsa -ldl"
  109.     fi
  110.     echo -Zmtd -Zsysv-signals -Zbin-files -L${prefix}/lib $libsp $libsa
  111. fi
  112.