Bug 551763: Fix deletion of arguments ident. (r=Waldo)
[mozilla-central.git] / js / src / js-config.in
blob59b47198a51c10efee38d39d4da8e8555095a0cf
1 #!/bin/sh
3 prefix='@prefix@'
4 mozilla_version='@MOZILLA_VERSION@'
5 LIBRARY_NAME='@LIBRARY_NAME@'
6 NSPR_CFLAGS='@NSPR_CFLAGS@'
7 JS_CONFIG_LIBS='@JS_CONFIG_LIBS@'
8 MOZ_JS_LIBS='@MOZ_JS_LIBS@'
10 usage()
12 cat <<EOF
13 Usage: js-config [OPTIONS]
14 Options:
15 [--prefix[=DIR]]
16 [--exec-prefix[=DIR]]
17 [--includedir[=DIR]]
18 [--libdir[=DIR]]
19 [--version]
20 [--libs]
21 [--cflags]
22 [--lib-filenames]
23 EOF
24 exit $1
27 if test $# -eq 0; then
28 usage 1 1>&2
31 while test $# -gt 0; do
32 case "$1" in
33 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
34 *) optarg= ;;
35 esac
37 case $1 in
38 --prefix=*)
39 prefix=$optarg
41 --prefix)
42 echo_prefix=yes
44 --exec-prefix=*)
45 exec_prefix=$optarg
47 --exec-prefix)
48 echo_exec_prefix=yes
50 --includedir=*)
51 includedir=$optarg
53 --includedir)
54 echo_includedir=yes
56 --libdir=*)
57 libdir=$optarg
59 --libdir)
60 echo_libdir=yes
62 --version)
63 echo "$mozilla_version"
65 --cflags)
66 echo_cflags=yes
68 --libs)
69 echo_libs=yes
72 usage 1 1>&2
74 esac
75 shift
76 done
78 # Set variables that may be dependent upon other variables
79 if test -z "$exec_prefix"; then
80 exec_prefix=@exec_prefix@
82 if test -z "$includedir"; then
83 includedir=@includedir@
85 if test -z "$libdir"; then
86 libdir=@libdir@
89 if test "$echo_prefix" = "yes"; then
90 echo $prefix
93 if test "$echo_exec_prefix" = "yes"; then
94 echo $exec_prefix
97 if test "$echo_includedir" = "yes"; then
98 echo $includedir
101 if test "$echo_libdir" = "yes"; then
102 echo $libdir
105 if test "$echo_cflags" = "yes"; then
106 echo "-I$includedir/js $NSPR_CFLAGS"
109 if test "$echo_libs" = "yes"; then
110 echo "$MOZ_JS_LIBS $JS_CONFIG_LIBS"