1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/nsprpub/config/nspr-config.in Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,147 @@ 1.4 +#!/bin/sh 1.5 +# This Source Code Form is subject to the terms of the Mozilla Public 1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + 1.9 + 1.10 +prefix=@prefix@ 1.11 + 1.12 +major_version=@MOD_MAJOR_VERSION@ 1.13 +minor_version=@MOD_MINOR_VERSION@ 1.14 +patch_version=@MOD_PATCH_VERSION@ 1.15 + 1.16 +usage() 1.17 +{ 1.18 + cat <<EOF 1.19 +Usage: nspr-config [OPTIONS] [LIBRARIES] 1.20 +Options: 1.21 + [--prefix[=DIR]] 1.22 + [--exec-prefix[=DIR]] 1.23 + [--includedir[=DIR]] 1.24 + [--libdir[=DIR]] 1.25 + [--version] 1.26 + [--libs] 1.27 + [--cflags] 1.28 +Libraries: 1.29 + nspr 1.30 + plc 1.31 + plds 1.32 +EOF 1.33 + exit $1 1.34 +} 1.35 + 1.36 +if test $# -eq 0; then 1.37 + usage 1 1>&2 1.38 +fi 1.39 + 1.40 +lib_nspr=yes 1.41 +lib_plc=yes 1.42 +lib_plds=yes 1.43 + 1.44 +while test $# -gt 0; do 1.45 + case "$1" in 1.46 + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 1.47 + *) optarg= ;; 1.48 + esac 1.49 + 1.50 + case $1 in 1.51 + --prefix=*) 1.52 + prefix=$optarg 1.53 + ;; 1.54 + --prefix) 1.55 + echo_prefix=yes 1.56 + ;; 1.57 + --exec-prefix=*) 1.58 + exec_prefix=$optarg 1.59 + ;; 1.60 + --exec-prefix) 1.61 + echo_exec_prefix=yes 1.62 + ;; 1.63 + --includedir=*) 1.64 + includedir=$optarg 1.65 + ;; 1.66 + --includedir) 1.67 + echo_includedir=yes 1.68 + ;; 1.69 + --libdir=*) 1.70 + libdir=$optarg 1.71 + ;; 1.72 + --libdir) 1.73 + echo_libdir=yes 1.74 + ;; 1.75 + --version) 1.76 + echo ${major_version}.${minor_version}.${patch_version} 1.77 + ;; 1.78 + --cflags) 1.79 + echo_cflags=yes 1.80 + ;; 1.81 + --libs) 1.82 + echo_libs=yes 1.83 + ;; 1.84 + nspr) 1.85 + lib_nspr=yes 1.86 + ;; 1.87 + plc) 1.88 + lib_plc=yes 1.89 + ;; 1.90 + plds) 1.91 + lib_plds=yes 1.92 + ;; 1.93 + *) 1.94 + usage 1 1>&2 1.95 + ;; 1.96 + esac 1.97 + shift 1.98 +done 1.99 + 1.100 +# Set variables that may be dependent upon other variables 1.101 +if test -z "$exec_prefix"; then 1.102 + exec_prefix=@exec_prefix@ 1.103 +fi 1.104 +if test -z "$includedir"; then 1.105 + includedir=@includedir@ 1.106 +fi 1.107 +if test -z "$libdir"; then 1.108 + libdir=@libdir@ 1.109 +fi 1.110 + 1.111 +if test "$echo_prefix" = "yes"; then 1.112 + echo $prefix 1.113 +fi 1.114 + 1.115 +if test "$echo_exec_prefix" = "yes"; then 1.116 + echo $exec_prefix 1.117 +fi 1.118 + 1.119 +if test "$echo_includedir" = "yes"; then 1.120 + echo $includedir 1.121 +fi 1.122 + 1.123 +if test "$echo_libdir" = "yes"; then 1.124 + echo $libdir 1.125 +fi 1.126 + 1.127 +if test "$echo_cflags" = "yes"; then 1.128 + echo -I$includedir 1.129 +fi 1.130 + 1.131 +if test "$echo_libs" = "yes"; then 1.132 + libdirs=-L$libdir 1.133 + if test -n "$lib_plds"; then 1.134 + libdirs="$libdirs -lplds${major_version}" 1.135 + fi 1.136 + if test -n "$lib_plc"; then 1.137 + libdirs="$libdirs -lplc${major_version}" 1.138 + fi 1.139 + if test -n "$lib_nspr"; then 1.140 + libdirs="$libdirs -lnspr${major_version}" 1.141 + fi 1.142 + os_ldflags="@LDFLAGS@" 1.143 + for i in $os_ldflags ; do 1.144 + if echo $i | grep \^-L >/dev/null; then 1.145 + libdirs="$libdirs $i" 1.146 + fi 1.147 + done 1.148 + echo $libdirs @OS_LIBS@ 1.149 +fi 1.150 +