From b5955ba7af6da71f79de2f7c6162c31432caddb5 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 2597061f23374892991621a6201d2f681a92f89d 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 b81ad10ffd6c33e5dacae2d6a1c03351f8ce7334 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 33f7c5e60ab8c8f5efbc0b82d52f01898db3dd6f 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 b5296e50469a881c34f1d9db9fc35172d1374358 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 dfb9438ad796e49cde368c5e73cb5b88833547a6 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 5e8e7dacdd6cac0f5a1d00e389b6616807d1c518 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 5cc3f59002dcfd9772c83a19dc5ade1bf34101df 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 391804712ced65c85a57038d2b8bd9bb6ded631e 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 9a012201cb1dcd7613649e1c9ad21546e7978cbe 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 75ff5d1a054175bf5dc659ceb0c6bc3f6f1a2525 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