build/clang-plugin/configure

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rwxr-xr-x

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 #!/bin/sh
     3 # Default srcdir to this directory
     4 srcdir=
     6 for option; do
     7   case "$option" in
     8   -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
     9   *) optarg= ;;
    10   esac
    12   case "$option" in
    13   --srcdir=*) srcdir="$optarg";;
    14   esac
    15 done
    17 if test -z "$CXX"; then
    18   CXX=`which clang++`
    19 fi
    21 echo -n "checking for llvm-config... "
    23 if test -z "$LLVMCONFIG"; then
    24   LLVMCONFIG=`which llvm-config`
    25 fi
    27 if test -z "$LLVMCONFIG"; then
    28   LLVMCONFIG=`dirname $CXX`/llvm-config
    29 fi
    31 if test ! -x "$LLVMCONFIG"; then
    32   echo "configure: error: Cannot find an llvm-config binary for building a clang plugin" 1>&2
    33   exit 1
    34 fi
    36 echo "$LLVMCONFIG"
    38 LLVMCXXFLAGS=`$LLVMCONFIG --cxxflags`
    39 LLVMLDFLAGS=`$LLVMCONFIG --ldflags`
    40 CXXFLAGS="$CXXFLAGS $LLVMCXXFLAGS -fno-rtti -fno-exceptions"
    41 LDFLAGS="$LDFLAGS $LLVMLDFLAGS"
    43 cat $srcdir/Makefile.in | sed \
    44   -e "s%@CXX@%$CXX%" \
    45   -e "s%@CXXFLAGS@%$CXXFLAGS%" \
    46   -e "s%@LDFLAGS@%$LDFLAGS%" \
    47   -e "s%@srcdir@%$srcdir%" \
    48   > Makefile

mercurial