1dc743
#!/bin/sh
1dc743
1dc743
prefix=@prefix@
1dc743
1dc743
major_version=@MOD_MAJOR_VERSION@
1dc743
minor_version=@MOD_MINOR_VERSION@
1dc743
patch_version=@MOD_PATCH_VERSION@
1dc743
1dc743
usage()
1dc743
{
1dc743
	cat <
1dc743
Usage: nss-softokn-config [OPTIONS] [LIBRARIES]
1dc743
Options:
1dc743
	[--prefix[=DIR]]
1dc743
	[--exec-prefix[=DIR]]
1dc743
	[--includedir[=DIR]]
1dc743
	[--libdir[=DIR]]
1dc743
	[--version]
1dc743
	[--libs]
1dc743
	[--cflags]
1dc743
Dynamic Libraries:
1dc743
	softokn3 - Requires full dynamic linking
1dc743
	freebl3  - for internal use only (and glibc for self-integrity check)
1dc743
	nssdbm3  - for internal use only
1dc743
Dymamically linked
1dc743
EOF
1dc743
	exit $1
1dc743
}
1dc743
1dc743
if test $# -eq 0; then
1dc743
	usage 1 1>&2
1dc743
fi
1dc743
1dc743
while test $# -gt 0; do
1dc743
  case "$1" in
1dc743
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
1dc743
  *) optarg= ;;
1dc743
  esac
1dc743
1dc743
  case $1 in
1dc743
    --prefix=*)
1dc743
      prefix=$optarg
1dc743
      ;;
1dc743
    --prefix)
1dc743
      echo_prefix=yes
1dc743
      ;;
1dc743
    --exec-prefix=*)
1dc743
      exec_prefix=$optarg
1dc743
      ;;
1dc743
    --exec-prefix)
1dc743
      echo_exec_prefix=yes
1dc743
      ;;
1dc743
    --includedir=*)
1dc743
      includedir=$optarg
1dc743
      ;;
1dc743
    --includedir)
1dc743
      echo_includedir=yes
1dc743
      ;;
1dc743
    --libdir=*)
1dc743
      libdir=$optarg
1dc743
      ;;
1dc743
    --libdir)
1dc743
      echo_libdir=yes
1dc743
      ;;
1dc743
    --version)
1dc743
      echo ${major_version}.${minor_version}.${patch_version}
1dc743
      ;;
1dc743
    --cflags)
1dc743
      echo_cflags=yes
1dc743
      ;;
1dc743
    --libs)
1dc743
      echo_libs=yes
1dc743
      ;;
1dc743
    *)
1dc743
      usage 1 1>&2
1dc743
      ;;
1dc743
  esac
1dc743
  shift
1dc743
done
1dc743
1dc743
# Set variables that may be dependent upon other variables
1dc743
if test -z "$exec_prefix"; then
1dc743
    exec_prefix=`pkg-config --variable=exec_prefix nss-softokn`
1dc743
fi
1dc743
if test -z "$includedir"; then
1dc743
    includedir=`pkg-config --variable=includedir nss-softokn`
1dc743
fi
1dc743
if test -z "$libdir"; then
1dc743
    libdir=`pkg-config --variable=libdir nss-softokn`
1dc743
fi
1dc743
1dc743
if test "$echo_prefix" = "yes"; then
1dc743
    echo $prefix
1dc743
fi
1dc743
1dc743
if test "$echo_exec_prefix" = "yes"; then
1dc743
    echo $exec_prefix
1dc743
fi
1dc743
1dc743
if test "$echo_includedir" = "yes"; then
1dc743
    echo $includedir
1dc743
fi
1dc743
1dc743
if test "$echo_libdir" = "yes"; then
1dc743
    echo $libdir
1dc743
fi
1dc743
1dc743
if test "$echo_cflags" = "yes"; then
1dc743
    echo -I$includedir
1dc743
fi
1dc743
1dc743
if test "$echo_libs" = "yes"; then
1dc743
      libdirs="-Wl,-rpath-link,$libdir -L$libdir"
1dc743
      echo $libdirs
1dc743
fi
1dc743