• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/json-c/cmake-configure

  1 #!/bin/bash
  2 
  3 # Wrapper around cmake to emulate useful options
  4 # from the previous autoconf-based configure script.
  5 
  6 RUNDIR=$(dirname "$0")
  7 RUNDIR=$(cd "$RUNDIR" && pwd)
  8 CURDIR=$(pwd)
  9 
 10 FLAGS=()
 11 
 12 usage()
 13 {
 14         exitval="$1"
 15         errmsg="$2"
 16 
 17         if [ $exitval -ne 0 ] ; then
 18                 exec 1>&2
 19         fi
 20         if [ ! -z "$errmsg" ] ; then
 21                 echo "ERROR: $errmsg" 1>&2
 22         fi
 23         cat <<EOF
 24 $0 [<configure_options>] [-- [<cmake options>]]
 25   --prefix=PREFIX         install architecture-independent files in PREFIX
 26   --enable-threading      Enable code to support partly multi-threaded use
 27   --enable-rdrand         Enable RDRAND Hardware RNG Hash Seed generation on
 28                           supported x86/x64 platforms.
 29   --enable-shared         build shared libraries [default=yes]
 30   --enable-static         build static libraries [default=yes]
 31   --disable-Bsymbolic     Avoid linking with -Bsymbolic-function
 32   --disable-werror        Avoid treating compiler warnings as fatal errors
 33 
 34 EOF
 35         exit
 36 }
 37 
 38 if [ "$CURDIR" = "$RUNDIR" ] ; then
 39         usage 1 "Please mkdir some other build directory, and run this script from there."
 40 fi
 41 
 42 if ! cmake --version ; then
 43         usage 1 "Unable to find a working cmake, please be sure you have it installed and on your PATH"
 44 fi
 45 
 46 while [ $# -gt 0 ] ; do
 47         case "$1" in
 48         -h|--help)
 49                 usage 0
 50                 ;;
 51         --prefix)
 52                 FLAGS+=(-DCMAKE_INSTALL_PREFIX="$2")
 53                 shift
 54                 ;;
 55         --prefix=*)
 56                 FLAGS+=(-DCMAKE_INSTALL_PREFIX="${1##--prefix=}")
 57                 ;;
 58         --enable-threading)
 59                 FLAGS+=(-DENABLE_THREADING=ON)
 60                 ;;
 61         --enable-rdrand)
 62                 FLAGS+=(-DENABLE_RDRAND=ON)
 63                 ;;
 64         --enable-shared)
 65                 FLAGS+=(-DBUILD_SHARED_LIBS=ON)
 66                 ;;
 67         --enable-static)
 68                 FLAGS+=(-DBUILD_STATIC_LIBS=ON)
 69                 ;;
 70         --disable-Bsymbolic)
 71                 FLAGS+=(-DDISABLE_BSYMBOLIC=ON)
 72                 ;;
 73         --disable-werror)
 74                 FLAGS+=(-DDISABLE_WERROR=ON)
 75                 ;;
 76         --)
 77                 shift
 78                 break
 79                 ;;
 80         -*)
 81                 usage 1 "Unknown arguments: $*"
 82                 ;;
 83         *)
 84                 break
 85                 ;;
 86         esac
 87         shift
 88 done
 89 
 90 exec cmake "${FLAGS[@]}" "$@" "${RUNDIR}"

This page was automatically generated by LXR 0.3.1.  •  OpenWrt