1 #!/bin/sh 2 3 # This is a wrapper of pkg-config to simulate nspr-config/nss-config. 4 # Usage: nspr-nss-config nspr [--version] [--libs] [--cflags] 5 # or nspr-nss-config nss [--version] [--libs] [--cflags] 6 7 if test $# -eq 0; then 8 exit 1 9 fi 10 11 program_name=$1 12 shift 13 14 if test "$program_name" != "nspr" && test "$program_name" != "nss"; then 15 exit 1 16 fi 17 18 while test $# -gt 0; do 19 case $1 in 20 --version) 21 echo_version=yes 22 ;; 23 --cflags) 24 echo_cflags=yes 25 ;; 26 --libs) 27 echo_libs=yes 28 ;; 29 esac 30 shift 31 done 32 33 if test "$echo_version" = "yes"; then 34 # use sed to append .0 if it doesn't have micro version 35 pkg-config $program_name --modversion | sed 's/^\([0-9]*\)\.\([0-9]*\)$/\1.\2.0/' 36 37 fi 38 39 if test "$echo_cflags" = "yes"; then 40 pkg-config $program_name --cflags 41 fi 42 43 if test "$echo_libs" = "yes"; then 44 echo -R/usr/lib/mps `pkg-config $program_name --libs` 45 fi 46