#! /bin/sh
# config.in

prefix=/opt/ohpc/pub/libs/gnu9/example-nonzippy/1.0
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib

## Usage info
usage()
{
    cat <<EOF
Usage: amhello-config [OPTIONS]
Options:
    --prefix       Display architecture-independent installation dir
    --exec-prefix  Display architecture-dependent installation dir
    --version      Display version information
    --ldflags         
    --cflags       
EOF
    exit $1
}

## If no arguments, print usage info
if test $# -eq 0; then
    usage 1 1>&2
fi

## Parse command line
while test $# -gt 0; do
    case "$1" in
	-*=*)          optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
	*)             optarg= ;;
    esac

    case $1 in
	## Architecture-independent dir
    --prefix)       echo "$prefix" && exit 0 ;;

	## Architecture-dependent dir
	--exec-prefix)  echo "$exec_prefix" && exit 0 ;;

	## Object code dir
	--ldflags)      echo "-L$libdir" && exit 0 ;;

	## Header file dir
	--cflags)       echo "-I$includedir" && exit 0 ;;

	## Version information
	--version)      echo "1.0" && exit 0 ;;

	## Everything else
	*)             usage 1 1>&2 ;;
    esac
    shift
done
