391c46
#!/bin/sh
391c46
391c46
prefix=@prefix@
391c46
391c46
major_version=@MOD_MAJOR_VERSION@
391c46
minor_version=@MOD_MINOR_VERSION@
391c46
patch_version=@MOD_PATCH_VERSION@
391c46
391c46
usage()
391c46
{
391c46
	cat <
391c46
Usage: nss-util-config [OPTIONS] [LIBRARIES]
391c46
Options:
391c46
	[--prefix[=DIR]]
391c46
	[--exec-prefix[=DIR]]
391c46
	[--includedir[=DIR]]
391c46
	[--libdir[=DIR]]
391c46
	[--version]
391c46
	[--libs]
391c46
	[--cflags]
391c46
Dynamic Libraries:
391c46
	nssutil
391c46
EOF
391c46
	exit $1
391c46
}
391c46
391c46
if test $# -eq 0; then
391c46
	usage 1 1>&2
391c46
fi
391c46
391c46
lib_nssutil=yes
391c46
391c46
while test $# -gt 0; do
391c46
  case "$1" in
391c46
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
391c46
  *) optarg= ;;
391c46
  esac
391c46
391c46
  case $1 in
391c46
    --prefix=*)
391c46
      prefix=$optarg
391c46
      ;;
391c46
    --prefix)
391c46
      echo_prefix=yes
391c46
      ;;
391c46
    --exec-prefix=*)
391c46
      exec_prefix=$optarg
391c46
      ;;
391c46
    --exec-prefix)
391c46
      echo_exec_prefix=yes
391c46
      ;;
391c46
    --includedir=*)
391c46
      includedir=$optarg
391c46
      ;;
391c46
    --includedir)
391c46
      echo_includedir=yes
391c46
      ;;
391c46
    --libdir=*)
391c46
      libdir=$optarg
391c46
      ;;
391c46
    --libdir)
391c46
      echo_libdir=yes
391c46
      ;;
391c46
    --version)
391c46
      echo ${major_version}.${minor_version}.${patch_version}
391c46
      ;;
391c46
    --cflags)
391c46
      echo_cflags=yes
391c46
      ;;
391c46
    --libs)
391c46
      echo_libs=yes
391c46
      ;;
391c46
    *)
391c46
      usage 1 1>&2
391c46
      ;;
391c46
  esac
391c46
  shift
391c46
done
391c46
391c46
# Set variables that may be dependent upon other variables
391c46
if test -z "$exec_prefix"; then
391c46
    exec_prefix=`pkg-config --variable=exec_prefix nss-util`
391c46
fi
391c46
if test -z "$includedir"; then
391c46
    includedir=`pkg-config --variable=includedir nss-util`
391c46
fi
391c46
if test -z "$libdir"; then
391c46
    libdir=`pkg-config --variable=libdir nss-util`
391c46
fi
391c46
391c46
if test "$echo_prefix" = "yes"; then
391c46
    echo $prefix
391c46
fi
391c46
391c46
if test "$echo_exec_prefix" = "yes"; then
391c46
    echo $exec_prefix
391c46
fi
391c46
391c46
if test "$echo_includedir" = "yes"; then
391c46
    echo $includedir
391c46
fi
391c46
391c46
if test "$echo_libdir" = "yes"; then
391c46
    echo $libdir
391c46
fi
391c46
391c46
if test "$echo_cflags" = "yes"; then
391c46
    echo -I$includedir
391c46
fi
391c46
391c46
if test "$echo_libs" = "yes"; then
391c46
      libdirs="-Wl,-rpath-link,$libdir -L$libdir"
391c46
      if test -n "$lib_nssutil"; then
391c46
	libdirs="$libdirs -lnssutil${major_version}"
391c46
      fi
391c46
      echo $libdirs
391c46
fi
391c46