[master] a04892d A bit of work on the alternate build scheme
Poul-Henning Kamp
phk at FreeBSD.org
Fri Dec 20 13:38:47 CET 2013
commit a04892d286eb7459c7ac0a4cf59d0c785bbcb7a6
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Fri Dec 20 12:38:34 2013 +0000
A bit of work on the alternate build scheme
diff --git a/Makefile.inc.phk b/Makefile.inc.phk
index 24756e0..72fb6b8 100644
--- a/Makefile.inc.phk
+++ b/Makefile.inc.phk
@@ -33,7 +33,7 @@ LIB_VGZ = -L $(TOPDIR)/lib/libvgz -lvgz
LIB_PCRE = -L /usr/local/lib -lpcre
LIB_EXECINFO = -lexecinfo
LIB_CURSES = -lcurses
-LIB_READLINE = -lreadline
+LIB_READLINE = ${LINEDISC}
#######################################################################
ifdef USE_THREADS
diff --git a/config.phk b/config.phk
index 89ed5f9..7870b02 100644
--- a/config.phk
+++ b/config.phk
@@ -75,6 +75,13 @@ if true ; then
if [ -f /usr/include/$i ] ; then
n=`echo $i | tr '[a-z/.]' '[A-Z__]'`
echo "#define HAVE_$n 1" >> ${CONFIG_H}_
+ else
+ echo "#include <$i>" > _.c
+ if cc -E _.c > /dev/null 2>& 1 ; then
+ n=`echo $i | tr '[a-z/.]' '[A-Z__]'`
+ echo "#define HAVE_$n 1" >> ${CONFIG_H}_
+ fi
+ rm -f _.c
fi
done
echo "#define PACKAGE_TARNAME \"${ADM_PROJECT}\"" >> ${CONFIG_H}_
@@ -147,7 +154,6 @@ ask_compiler CF_CWFLAGS '
"-W"
"-fstack-protector"
"-Wno-format-y2k"
- "-Wno-unused-parameter"
"-Wstrict-prototypes"
"-Wmissing-prototypes"
"-Wpointer-arith"
@@ -171,6 +177,15 @@ ask_compiler CF_CWFLAGS '
"-Wno-string-plus-int"
#endif
#endif
+ /*
+ * Write is marked with this on some Linux, and while that is
+ * well intentioned, they have implemented it so that the usual
+ * (void)bla;
+ * marker of intent does not work.
+ * I dont want to write bogo-code just to slip the best effort
+ * 4xx responses in cache_http1_fetch.c past the compiler.
+ */
+ "-Wno-unused-result"
'
# Configuration options
@@ -191,6 +206,10 @@ ask_compiler CF_CFLAGS '
"-DSO_RCVTIMEO_WORKS"
"-DHAVE_TCP_KEEP"
+ #if defined(__linux__)
+ "-D_GNU_SOURCE=1"
+ #endif
+
"-DVCC_CC=~\~exec $(CC) -D_THREAD_SAFE -std=gnu99 -g -O2 -Wall -Werror -pthread -fpic -shared -Wl,-x -o %o %s\~~"
"-DVCC_WARNS=~\~$(CF_CWFLAGS)\~~"
@@ -219,7 +238,23 @@ if echo | rst2html > /dev/null 2>&1 ; then
echo "HAVE_RST2HTML=1" >> _.cache
fi
+#######################################################################
+# Check for libedit
+
+if [ -f /usr/include/edit/readline/readline.h ] ; then
+ echo "LINEDISC=-ledit" >> _.cache
+elif [ -f /usr/include/editline/readline.h ] ; then
+ echo "LINEDISC=-ledit" >> _.cache
+elif [ -f /usr/include/readline/readline.h ] ; then
+ echo "LINEDISC=-lreadline" >> _.cache
+else
+ echo "LINEDISC=" >> _.cache
+fi
+
+#######################################################################
+# Done...
cat _.cache
+
exit 0
More information about the varnish-commit
mailing list