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