"Fossies" - the Fresh Open Source Software Archive

Member "yajl-2.1.0/configure" (19 Mar 2014, 2083 Bytes) of package /linux/www/yajl-2.1.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 #
    3 # Copyright (c) 2007-2014, Lloyd Hilaiel <me@lloyd.io>
    4 #
    5 # Permission to use, copy, modify, and/or distribute this software for any
    6 # purpose with or without fee is hereby granted, provided that the above
    7 # copyright notice and this permission notice appear in all copies.
    8 #
    9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
   10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
   12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   16 
   17 prefix="/usr/local"
   18 if [ "$1" = "--help" ]
   19 then
   20     cat <<EOS
   21 Usage: configure [options]
   22     -p, --prefix PATH                Set installation prefix
   23     -h, --help                       Output usage summary
   24 EOS
   25     exit 0
   26 fi
   27 if [ "$1" = "-p" ]; then
   28     if [ "$#" != 2 ]; then
   29         ./configure.sh --help
   30         exit 1
   31     fi
   32     prefix="$2"
   33 fi
   34 
   35 echo "== removing old build files"
   36 rm -rf build
   37 rm -f Makefile
   38 echo "== running CMake in build directory"
   39 mkdir build || exit 1
   40 cd build || exit 1
   41 cmake -DCMAKE_INSTALL_PREFIX="$prefix" .. ||
   42 {
   43     echo "The \"cmake\" program is required to configure yajl."
   44     echo "It's available from most ports/packaging systems and http://cmake.org"
   45     exit 1
   46 }
   47 cd ..
   48 
   49 echo "== Generating Makefile"
   50 cat > ./Makefile <<EOS
   51 .PHONY: all clean distclean install package test distro
   52 all: distro doc test test-api
   53 
   54 distro:
   55     @cd build && make
   56 
   57 doc:
   58     @cd build && make doc
   59 
   60 test:
   61     @cd build && make test
   62 
   63 test-api:
   64     @cd build && make test-api
   65 
   66 clean:
   67     @cd build && make clean
   68 
   69 distclean:
   70     @rm -rf Makefile build
   71     @rm -f yajl-*.tgz
   72 
   73 install: distro doc
   74     @cd build && make install
   75 
   76 package: all
   77     @echo \"compressing to $(basename build/yajl-*).tgz\"
   78     @cd build && tar czf ../$(basename yajl-*).tgz yajl-*
   79 EOS
   80 
   81 echo "== Configured with installation prefix: $prefix"