diff -r f5bdca63bbe7 -r 27f8a41882a7 configure --- a/configure Tue Aug 13 21:13:43 2019 +0200 +++ b/configure Tue Aug 13 21:50:16 2019 +0200 @@ -186,6 +186,16 @@ done return 1 } +isnotplatform() +{ + for p in $PLATFORM + do + if [ $p = $1 ]; then + return 1 + fi + done + return 0 +} # generate config.mk and config.h cat > $TEMP_DIR/config.mk << __EOF__ @@ -252,8 +262,8 @@ if ! $PKG_CONFIG libpq ; then break fi - CFLAGS+=" `$PKG_CONFIG --cflags libpq`" - LDFLAGS+=" `$PKG_CONFIG --libs libpq`" + CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libpq`" + LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs libpq`" echo yes return 0 done @@ -273,8 +283,8 @@ if ! $PKG_CONFIG openssl ; then break fi - CFLAGS+=" `$PKG_CONFIG --cflags openssl`" - LDFLAGS+=" `$PKG_CONFIG --libs openssl`" + CFLAGS="$CFLAGS `$PKG_CONFIG --cflags openssl`" + LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs openssl`" echo yes return 0 done @@ -294,8 +304,8 @@ if ! $PKG_CONFIG libxml-2.0 ; then break fi - CFLAGS+=" `$PKG_CONFIG --cflags libxml-2.0`" - LDFLAGS+=" `$PKG_CONFIG --libs libxml-2.0`" + CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libxml-2.0`" + LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs libxml-2.0`" echo yes return 0 done @@ -311,14 +321,14 @@ LDFLAGS= while true do - if ! isplatform "linux"; then + if isnotplatform "linux"; then break fi while true do - CFLAGS+="-DLINUX" - LDFLAGS+="-lpthread -ldl -lm -lldap" + CFLAGS="CFLAGS -DLINUX" + LDFLAGS="LDFLAGS -lpthread -ldl -lm -lldap" cat >> $TEMP_DIR/make.mk << __EOF__ # platform dependend source files PLATFORM_DAEMONOBJ = event_linux.o @@ -337,7 +347,7 @@ done while true do - if ! isplatform "bsd"; then + if isnotplatform "bsd"; then break fi if isplatform "macos"; then @@ -346,8 +356,8 @@ while true do - CFLAGS+="-DBSD" - LDFLAGS+="-lpthread -lm -lldap" + CFLAGS="CFLAGS -DBSD" + LDFLAGS="LDFLAGS -lpthread -lm -lldap" cat >> $TEMP_DIR/make.mk << __EOF__ # platform dependend source files PLATFORM_DAEMONOBJ = event_bsd.o @@ -366,14 +376,14 @@ done while true do - if ! isplatform "macos"; then + if isnotplatform "macos"; then break fi while true do - CFLAGS+="-DBSD -DOSX" - LDFLAGS+="-lpthread -ldl -lm -lldap" + CFLAGS="CFLAGS -DBSD -DOSX" + LDFLAGS="LDFLAGS -lpthread -ldl -lm -lldap" cat >> $TEMP_DIR/make.mk << __EOF__ # platform dependend source files PLATFORM_DAEMONOBJ = event_bsd.o @@ -392,14 +402,14 @@ done while true do - if ! isplatform "solaris"; then + if isnotplatform "solaris"; then break fi while true do - CFLAGS+="-DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" - LDFLAGS+="-lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap" + CFLAGS="CFLAGS -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" + LDFLAGS="LDFLAGS -lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap" cat >> $TEMP_DIR/make.mk << __EOF__ # platform dependend source files PLATFORM_DAEMONOBJ = event_solaris.o @@ -447,12 +457,12 @@ dependency_libxml2 if [ $? -ne 0 ]; then - DEPENDENCIES_FAILED+="libxml2 " + DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " ERROR=1 fi dependency_openssl if [ $? -ne 0 ]; then - DEPENDENCIES_FAILED+="openssl " + DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " ERROR=1 fi