home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 March / PCWELT_3_2006.ISO / base / 05_common.mo / usr / bin / wv2-config < prev    next >
Encoding:
Text File  |  2004-05-15  |  1.7 KB  |  104 lines

  1. #!/bin/sh
  2.  
  3. prefix=/usr
  4. exec_prefix=${prefix}
  5. exec_prefix_set=no
  6.  
  7. usage()
  8. {
  9.     cat <<EOF
  10. Usage: wv2-config [OPTIONS] [LIBRARIES]
  11. Options:
  12.     [--prefix[=DIR]]
  13.     [--exec-prefix[=DIR]]
  14.     [--version]
  15.     [--libs]
  16.     [--cflags]
  17. Libraries/Headers:
  18.     wv2
  19. EOF
  20.     exit $1
  21. }
  22.  
  23. if test $# -eq 0; then
  24.     usage 1 1>&2
  25. fi
  26.  
  27. lib_wv2=yes
  28.  
  29. while test $# -gt 0; do
  30.   case "$1" in
  31.   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  32.   *) optarg= ;;
  33.   esac
  34.  
  35.   case $1 in
  36.     --prefix=*)
  37.       prefix=$optarg
  38.       if test $exec_prefix_set = no ; then
  39.         exec_prefix=$optarg
  40.       fi
  41.       ;;
  42.     --prefix)
  43.       echo_prefix=yes
  44.       ;;
  45.     --exec-prefix=*)
  46.       exec_prefix=$optarg
  47.       exec_prefix_set=yes
  48.       ;;
  49.     --exec-prefix)
  50.       echo_exec_prefix=yes
  51.       ;;
  52.     --version)
  53.       echo 0.2.2
  54.       ;;
  55.     --cflags)
  56.       echo_cflags=yes
  57.       ;;
  58.     --libs)
  59.       echo_libs=yes
  60.       ;;
  61.     wv2)
  62.       lib_wv2=yes
  63.       ;;
  64.     *)
  65.       usage 1 1>&2
  66.       ;;
  67.   esac
  68.   shift
  69. done
  70.  
  71. if test "$echo_prefix" = "yes"; then
  72.     echo $prefix
  73. fi
  74.  
  75. if test "$echo_exec_prefix" = "yes"; then
  76.     echo $exec_prefix
  77. fi
  78.  
  79. wv2_libs="-lwv2 -lgsf-1 -lgobject-2.0 -lxml2 -lpthread -lz -lm -lglib-2.0   "
  80.  
  81. if test "$echo_cflags" = "yes"; then
  82.     includes="-I/usr/include/libgsf-1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2   "
  83.     if test "$lib_wv2" = "yes"; then
  84.         includes="-I${prefix}/include $includes"
  85.     fi
  86.     echo $includes
  87. fi
  88.  
  89. if test "$echo_libs" = "yes"; then
  90.     libdirs=-L${exec_prefix}/lib
  91.     my_wv2_libs=
  92.     for i in $wv2_libs ; do
  93.         if test "x$i" != "x-L${exec_prefix}/lib" ; then
  94.             if test -z "$my_wv2_libs" ; then
  95.                 my_wv2_libs="$i"
  96.             else
  97.                 my_wv2_libs="$my_wv2_libs $i"
  98.             fi
  99.         fi
  100.     done
  101.  
  102.     echo $libdirs $my_wv2_libs
  103. fi      
  104.