PageRenderTime 18ms CodeModel.GetById 2ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/js-config.in

http://github.com/zpao/v8monkey
Autoconf | 147 lines | 97 code | 12 blank | 38 comment | 11 complexity | 10149b858aed9f95d9d6b55825b6cfa6 MD5 | raw file
  1#!/bin/sh
  2# ***** BEGIN LICENSE BLOCK *****
  3# Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4#
  5# The contents of this file are subject to the Mozilla Public License Version
  6# 1.1 (the "License"); you may not use this file except in compliance with
  7# the License. You may obtain a copy of the License at
  8# http://www.mozilla.org/MPL/
  9#
 10# Software distributed under the License is distributed on an "AS IS" basis,
 11# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 12# for the specific language governing rights and limitations under the
 13# License.
 14#
 15# The Original Code is SpiderMonkey JavaScript engine.
 16#
 17# The Initial Developer of the Original Code is
 18# Mozilla Corporation.
 19# Portions created by the Initial Developer are Copyright (C) 2008
 20# the Initial Developer. All Rights Reserved.
 21#
 22# Contributor(s):
 23#   Jim Blandy <jimb@mozilla.com>
 24#
 25# Alternatively, the contents of this file may be used under the terms of
 26# either the GNU General Public License Version 2 or later (the "GPL"), or
 27# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 28# in which case the provisions of the GPL or the LGPL are applicable instead
 29# of those above. If you wish to allow use of your version of this file only
 30# under the terms of either the GPL or the LGPL, and not to allow others to
 31# use your version of this file under the terms of the MPL, indicate your
 32# decision by deleting the provisions above and replace them with the notice
 33# and other provisions required by the GPL or the LGPL. If you do not delete
 34# the provisions above, a recipient may use your version of this file under
 35# the terms of any one of the MPL, the GPL or the LGPL.
 36#
 37# ***** END LICENSE BLOCK *****
 38
 39prefix='@prefix@'
 40mozilla_version='@MOZILLA_VERSION@'
 41LIBRARY_NAME='@LIBRARY_NAME@'
 42NSPR_CFLAGS='@NSPR_CFLAGS@'
 43JS_CONFIG_LIBS='@JS_CONFIG_LIBS@'
 44MOZ_JS_LIBS='@MOZ_JS_LIBS@'
 45
 46usage()
 47{
 48	cat <<EOF
 49Usage: js-config [OPTIONS]
 50Options:
 51	[--prefix[=DIR]]
 52	[--exec-prefix[=DIR]]
 53	[--includedir[=DIR]]
 54	[--libdir[=DIR]]
 55	[--version]
 56	[--libs]
 57	[--cflags]
 58	[--lib-filenames]
 59EOF
 60	exit $1
 61}
 62
 63if test $# -eq 0; then
 64	usage 1 1>&2
 65fi
 66
 67while test $# -gt 0; do
 68  case "$1" in
 69  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
 70  *) optarg= ;;
 71  esac
 72
 73  case $1 in
 74    --prefix=*)
 75      prefix=$optarg
 76      ;;
 77    --prefix)
 78      echo_prefix=yes
 79      ;;
 80    --exec-prefix=*)
 81      exec_prefix=$optarg
 82      ;;
 83    --exec-prefix)
 84      echo_exec_prefix=yes
 85      ;;
 86    --includedir=*)
 87      includedir=$optarg
 88      ;;
 89    --includedir)
 90      echo_includedir=yes
 91      ;;
 92    --libdir=*)
 93      libdir=$optarg
 94      ;;
 95    --libdir)
 96      echo_libdir=yes
 97      ;;
 98    --version)
 99      echo "$mozilla_version"
100      ;;
101    --cflags)
102      echo_cflags=yes
103      ;;
104    --libs)
105      echo_libs=yes
106      ;;
107    *)
108      usage 1 1>&2
109      ;;
110  esac
111  shift
112done
113
114# Set variables that may be dependent upon other variables
115if test -z "$exec_prefix"; then
116    exec_prefix=@exec_prefix@
117fi
118if test -z "$includedir"; then
119    includedir=@includedir@
120fi
121if test -z "$libdir"; then
122    libdir=@libdir@
123fi
124
125if test "$echo_prefix" = "yes"; then
126    echo $prefix
127fi
128
129if test "$echo_exec_prefix" = "yes"; then
130    echo $exec_prefix
131fi
132
133if test "$echo_includedir" = "yes"; then
134    echo $includedir
135fi
136
137if test "$echo_libdir" = "yes"; then
138    echo $libdir
139fi
140
141if test "$echo_cflags" = "yes"; then
142    echo "-I$includedir/js $NSPR_CFLAGS"
143fi
144
145if test "$echo_libs" = "yes"; then
146    echo "$MOZ_JS_LIBS $JS_CONFIG_LIBS"
147fi