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