[go: up one dir, main page]

Menu

[1c1a23]: / rmol-config.in  Maximize  Restore  History

Download this file

77 lines (62 with data), 1.2 kB

#!/bin/sh

prefix=@prefix@
exec_prefix=${prefix}
libdir=@libdir@
includedir=@includedir@

usage()
{
  cat <<EOF
Usage: @PACKAGE@-config [OPTION]

Known values for OPTION are:

  --prefix        print @PACKAGE_NAME@ installation prefix
  --libs          print library linking information
  --cflags        print pre-processor and compiler flags
  --help          display this help and exit
  --version       output version information
EOF
  exit $1
}

if test $# -eq 0; then
  usage 1
fi

cflags=false
libs=false

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
      ;;

    --prefix)
      echo $prefix
      ;;

    --version)
      echo @VERSION@
      ;;

    --help)
      usage 0
      ;;

    --cflags)
      if [ "${prefix}" != "/usr" ]; then
        echo -I${includedir}
      else
        echo
      fi
      ;;

    --libs)
      if [ "${prefix}" != "/usr" ]; then
        echo -L${libdir} -l@PACKAGE@
      else
        echo -l@PACKAGE@
      fi
      ;;

    *)
      usage
      exit 1
      ;;
  esac
  shift
done