Changeset

7619:f5016c8985d7

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 19 Aug 2016 22:49:36 +0200
parents 7606:f40f1d9b7872 (current diff) 7618:5a09c1166d89 (diff)
children 7622:96e6df712359
files
diffstat 2 files changed, 70 insertions(+), 70 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Thu Aug 18 17:41:00 2016 +0200
+++ b/configure	Fri Aug 19 22:49:36 2016 +0200
@@ -2,7 +2,7 @@
 
 # Defaults
 
-PREFIX=/usr/local
+PREFIX="/usr/local"
 SYSCONFDIR="$PREFIX/etc/prosody"
 LIBDIR="$PREFIX/lib"
 DATADIR="$PREFIX/var/lib/prosody"
@@ -11,20 +11,20 @@
 LUA_BINDIR="/usr/bin"
 LUA_INCDIR="/usr/include"
 LUA_LIBDIR="/usr/lib"
-IDN_LIB=idn
+IDN_LIB="idn"
 ICU_FLAGS="-licui18n -licudata -licuuc"
-OPENSSL_LIB=crypto
-CC=gcc
-LD=gcc
-RUNWITH=lua
-EXCERTS=yes
+OPENSSL_LIB="crypto"
+CC="gcc"
+LD="gcc"
+RUNWITH="lua"
+EXCERTS="yes"
 PRNG=
 PRNGLIBS=
 
-CFLAGS="-fPIC -Wall"
+CFLAGS="-fPIC -Wall -pedantic -std=c89"
 LDFLAGS="-shared"
 
-IDN_LIBRARY=idn
+IDN_LIBRARY="idn"
 # Help
 
 show_help() {
@@ -106,43 +106,59 @@
       OSTYPE="$value"
       OSTYPE_SET=yes
       if [ "$OSTYPE" = "debian" ]; then
-        LUA_SUFFIX="5.1";
-      	LUA_SUFFIX_SET=yes
-      	RUNWITH="lua5.1"
-      	LUA_INCDIR=/usr/include/lua5.1;
-      	LUA_INCDIR_SET=yes
-      	CFLAGS="$CFLAGS -D_GNU_SOURCE"
-    	fi
-    	if [ "$OSTYPE" = "macosx" ]; then
-        LUA_INCDIR=/usr/local/include;
-      	LUA_INCDIR_SET=yes
-      	LUA_LIBDIR=/usr/local/lib
-      	LUA_LIBDIR_SET=yes
-      	CFLAGS="$CFLAGS -mmacosx-version-min=10.3"
-      	LDFLAGS="-bundle -undefined dynamic_lookup"
-    	fi
+         if [ "$LUA_SUFFIX_SET" != "yes" ]; then
+            LUA_SUFFIX="5.1";
+            LUA_SUFFIX_SET=yes
+         fi
+         RUNWITH="lua$LUA_SUFFIX"
+         LUA_INCDIR="/usr/include/lua$LUA_SUFFIX"
+         LUA_INCDIR_SET=yes
+         CFLAGS="$CFLAGS -ggdb -D_GNU_SOURCE"
+      fi
+      if [ "$OSTYPE" = "macosx" ]; then
+         LUA_INCDIR=/usr/local/include;
+         LUA_INCDIR_SET=yes
+         LUA_LIBDIR=/usr/local/lib
+         LUA_LIBDIR_SET=yes
+         CFLAGS="$CFLAGS -mmacosx-version-min=10.3"
+         LDFLAGS="-bundle -undefined dynamic_lookup"
+      fi
       if [ "$OSTYPE" = "linux" ]; then
-        LUA_INCDIR=/usr/local/include;
-        LUA_INCDIR_SET=yes
-        LUA_LIBDIR=/usr/local/lib
-        LUA_LIBDIR_SET=yes
-        CFLAGS="-Wall -fPIC -D_GNU_SOURCE"
-        LDFLAGS="-shared"
+         LUA_INCDIR=/usr/local/include;
+         LUA_INCDIR_SET=yes
+         LUA_LIBDIR=/usr/local/lib
+         LUA_LIBDIR_SET=yes
+         CFLAGS="$CFLAGS -ggdb -D_GNU_SOURCE"
       fi
       if [ "$OSTYPE" = "freebsd" -o "$OSTYPE" = "openbsd" ]; then
-        LUA_INCDIR="/usr/local/include/lua51"
-        LUA_INCDIR_SET=yes
-        CFLAGS="-Wall -fPIC -I/usr/local/include"
-        LDFLAGS="-I/usr/local/include -L/usr/local/lib -shared"
-        LUA_SUFFIX="-5.1"
-        LUA_SUFFIX_SET=yes
-        LUA_DIR=/usr/local
-        LUA_DIR_SET=yes
-        CC=cc
-        LD=ld
+         LUA_INCDIR="/usr/local/include/lua51"
+         LUA_INCDIR_SET=yes
+         CFLAGS="-Wall -fPIC -I/usr/local/include"
+         LDFLAGS="-I/usr/local/include -L/usr/local/lib -shared"
+         LUA_SUFFIX="-5.1"
+         LUA_SUFFIX_SET=yes
+         LUA_DIR=/usr/local
+         LUA_DIR_SET=yes
+         CC=cc
+         LD=ld
       fi
       if [ "$OSTYPE" = "openbsd" ]; then
-        LUA_INCDIR="/usr/local/include";
+         LUA_INCDIR="/usr/local/include";
+         LUA_INCDIR_SET="yes"
+      fi
+      if [ "$OSTYPE" = "pkg-config" ]; then
+         if [ "$LUA_SUFFIX_SET" != "yes" ]; then
+            LUA_SUFFIX="5.1";
+            LUA_SUFFIX_SET=yes
+         fi
+         LUA_CF="$(pkg-config --cflags-only-I lua$LUA_SUFFIX)"
+         LUA_CF="${LUA_CF#*-I}"
+         LUA_CF="${LUA_CF%% *}"
+         if [ "$LUA_CF" != "" ]; then
+            LUA_INCDIR="$LUA_CF"
+            LUA_INCDIR_SET=yes
+         fi
+         CFLAGS="$CFLAGS -D_GNU_SOURCE"
       fi
       ;;
    --libdir=*)
@@ -150,8 +166,8 @@
       LIBDIR_SET=yes
       ;;
    --datadir=*)
-   	DATADIR="$value"
-   	DATADIR_SET=yes
+      DATADIR="$value"
+      DATADIR_SET=yes
       ;;
    --require-config)
       REQUIRE_CONFIG=yes
@@ -174,9 +190,9 @@
    --with-idn=*)
       IDN_LIB="$value"
       ;;
-	--idn-library=*)
-		IDN_LIBRARY="$value"
-		;;
+   --idn-library=*)
+      IDN_LIBRARY="$value"
+      ;;
    --with-ssl=*)
       OPENSSL_LIB="$value"
       ;;
@@ -208,6 +224,10 @@
     --no-example-certs)
       EXCERTS=
       ;;
+   --compiler-wrapper=*)
+      CC="$value $CC"
+      LD="$value $LD"
+      ;;
    *)
       echo "Error: Unknown flag: $1"
       exit 1
@@ -318,12 +338,12 @@
 
 if [ "$IDN_LIBRARY" = "icu" ]
 then
-	IDNA_LIBS="$ICU_FLAGS"
-	CFLAGS="$CFLAGS -DUSE_STRINGPREP_ICU"
+   IDNA_LIBS="$ICU_FLAGS"
+   CFLAGS="$CFLAGS -DUSE_STRINGPREP_ICU"
 fi
 if [ "$IDN_LIBRARY" = "idn" ]
 then
-	IDNA_LIBS="-l$IDN_LIB"
+   IDNA_LIBS="-l$IDN_LIB"
 fi
 
 OPENSSL_LIBS="-l$OPENSSL_LIB"
@@ -339,26 +359,6 @@
    exit 1
 fi
 
-find_helper() {
-   explanation="$1"
-   shift
-   tried="$*"
-   while [ "$1" ]
-   do
-      found=`find_program "$1"`
-      if [ "$found" ]
-      then
-         echo "$1 found at $found"
-         HELPER=$1
-         return
-      fi
-      shift
-   done
-   echo "Could not find a $explanation. Tried: $tried."
-   echo "Make sure one of them is installed and available in your PATH."
-   exit 1
-}
-
 # Write config
 
 echo "Writing configuration..."
--- a/util-src/Makefile	Thu Aug 18 17:41:00 2016 +0200
+++ b/util-src/Makefile	Fri Aug 19 22:49:36 2016 +0200
@@ -1,7 +1,7 @@
 
 include ../config.unix
 
-CFLAGS+=-ggdb -Wall -pedantic -I$(LUA_INCDIR)
+CFLAGS+=-I$(LUA_INCDIR)
 
 INSTALL_DATA=install -m644
 TARGET?=../util/