From 75e324559292a24a8c820ba57c3b26173bd9dcc0 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 14:43:38 +0200 Subject: configure: Normalize whitespace --- configure | 80 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 35946cf6..b91d0b37 100755 --- a/configure +++ b/configure @@ -106,43 +106,43 @@ do 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 + 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 [ "$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="-Wall -fPIC -D_GNU_SOURCE" + LDFLAGS="-shared" 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"; fi ;; --libdir=*) @@ -150,8 +150,8 @@ do LIBDIR_SET=yes ;; --datadir=*) - DATADIR="$value" - DATADIR_SET=yes + DATADIR="$value" + DATADIR_SET=yes ;; --require-config) REQUIRE_CONFIG=yes @@ -174,9 +174,9 @@ do --with-idn=*) IDN_LIB="$value" ;; - --idn-library=*) - IDN_LIBRARY="$value" - ;; + --idn-library=*) + IDN_LIBRARY="$value" + ;; --with-ssl=*) OPENSSL_LIB="$value" ;; @@ -318,12 +318,12 @@ fi 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" -- cgit v1.2.3 From 4a913a573e5293208433f9e628555283e81e2b54 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 15:30:42 +0200 Subject: configure: Respect Lua suffix in Debian preset if already set --- configure | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'configure') diff --git a/configure b/configure index b91d0b37..7d7393b6 100755 --- a/configure +++ b/configure @@ -106,10 +106,12 @@ do 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; + 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 -D_GNU_SOURCE" fi -- cgit v1.2.3 From 4725db3f2fe264f30ec65fbfe6279958d868e397 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 15:46:38 +0200 Subject: configure: Quote strings --- configure | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 7d7393b6..8541150e 100755 --- a/configure +++ b/configure @@ -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_DIR="/usr" 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" LDFLAGS="-shared" -IDN_LIBRARY=idn +IDN_LIBRARY="idn" # Help show_help() { -- cgit v1.2.3 From 8e3f4f30e805734b9677660987c4bacc10d687b0 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 15:50:57 +0200 Subject: configure: Indicate that LUA_INCDIR is set in openbsd preset --- configure | 1 + 1 file changed, 1 insertion(+) (limited to 'configure') diff --git a/configure b/configure index 8541150e..ee3b8940 100755 --- a/configure +++ b/configure @@ -145,6 +145,7 @@ do fi if [ "$OSTYPE" = "openbsd" ]; then LUA_INCDIR="/usr/local/include"; + LUA_INCDIR_SET="yes" fi ;; --libdir=*) -- cgit v1.2.3 From 565a6406387e15c4d9a01e086529deb018575209 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 15:55:55 +0200 Subject: configure: Remove unused 'find_helper' function --- configure | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'configure') diff --git a/configure b/configure index ee3b8940..3fc43852 100755 --- a/configure +++ b/configure @@ -342,26 +342,6 @@ else 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..." -- cgit v1.2.3 From 060615205169082d9c23397414257eb7fae5e115 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 15:59:12 +0200 Subject: Move C compiler flag -pedantic from Makefile to configure --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 3fc43852..d5e29d57 100755 --- a/configure +++ b/configure @@ -21,7 +21,7 @@ EXCERTS="yes" PRNG= PRNGLIBS= -CFLAGS="-fPIC -Wall" +CFLAGS="-fPIC -Wall -pedantic" LDFLAGS="-shared" IDN_LIBRARY="idn" -- cgit v1.2.3 From 22b52c77ce80ba551ce09139ea7f3989d3631296 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 16:00:12 +0200 Subject: configure: Add C compiler flag to indicate C89 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index d5e29d57..6d3cd84f 100755 --- a/configure +++ b/configure @@ -21,7 +21,7 @@ EXCERTS="yes" PRNG= PRNGLIBS= -CFLAGS="-fPIC -Wall -pedantic" +CFLAGS="-fPIC -Wall -pedantic -std=c89" LDFLAGS="-shared" IDN_LIBRARY="idn" -- cgit v1.2.3 From cf3f198a225bab2073ef76195ab41fcea7fd6b82 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 16:03:10 +0200 Subject: configure: Move -ggdb flag here from util-src/Make --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 6d3cd84f..d76180a3 100755 --- a/configure +++ b/configure @@ -113,7 +113,7 @@ do RUNWITH="lua$LUA_SUFFIX" LUA_INCDIR="/usr/include/lua$LUA_SUFFIX" LUA_INCDIR_SET=yes - CFLAGS="$CFLAGS -D_GNU_SOURCE" + CFLAGS="$CFLAGS -ggdb -D_GNU_SOURCE" fi if [ "$OSTYPE" = "macosx" ]; then LUA_INCDIR=/usr/local/include; -- cgit v1.2.3 From bfb6b3b7e0e165cfef099c71001579dee6592533 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 16:05:36 +0200 Subject: configure: Do the same to CFLAGS and LDFLAGS in linux preset as for debian --- configure | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index d76180a3..48ac5fa4 100755 --- a/configure +++ b/configure @@ -128,8 +128,7 @@ do LUA_INCDIR_SET=yes LUA_LIBDIR=/usr/local/lib LUA_LIBDIR_SET=yes - CFLAGS="-Wall -fPIC -D_GNU_SOURCE" - LDFLAGS="-shared" + CFLAGS="$CFLAGS -ggdb -D_GNU_SOURCE" fi if [ "$OSTYPE" = "freebsd" -o "$OSTYPE" = "openbsd" ]; then LUA_INCDIR="/usr/local/include/lua51" -- cgit v1.2.3 From 74635e9edbd1426ff7feff4713d69d8e90b0d1ea Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 16:06:07 +0200 Subject: configure: Add initial attempt at pkg-config preset --- configure | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 48ac5fa4..e9e62a84 100755 --- a/configure +++ b/configure @@ -146,6 +146,20 @@ do 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=*) LIBDIR="$value" -- cgit v1.2.3 From 8370703ece4eef92aa1b96cc39f4886ae2af01ac Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Aug 2016 16:25:15 +0200 Subject: configure: Add --compiler-wrapper flag for using things like ccache or distcc --- configure | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'configure') diff --git a/configure b/configure index e9e62a84..2c1ecabe 100755 --- a/configure +++ b/configure @@ -224,6 +224,10 @@ do --no-example-certs) EXCERTS= ;; + --compiler-wrapper=*) + CC="$value $CC" + LD="$value $LD" + ;; *) echo "Error: Unknown flag: $1" exit 1 -- cgit v1.2.3