r3073 - in trunk/varnish-cache: . bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Mon Aug 11 10:02:24 CEST 2008
Author: phk
Date: 2008-08-11 10:02:24 +0200 (Mon, 11 Aug 2008)
New Revision: 3073
Modified:
trunk/varnish-cache/bin/varnishd/mgt_param.c
trunk/varnish-cache/configure.ac
Log:
Move the C-compiler invocation determination to autoconf.
(Fixed the apple & gnu compiler strings relative to submitted patch)
Submitted by: Theo Schlossnagle
Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_param.c 2008-08-11 07:47:24 UTC (rev 3072)
+++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2008-08-11 08:02:24 UTC (rev 3073)
@@ -705,13 +705,7 @@
"the string will be replaced with the source file name, "
"and %o will be replaced with the output file name.",
MUST_RELOAD,
-#ifdef __APPLE__
- "exec cc -dynamiclib -Wl,-undefined,dynamic_lookup -o %o %s"
-#elif defined(__SOLARIS__)
- "exec cc -shared -fpic -c %o %s"
-#else /* default: GCC on Linux & FreeBSD */
- "exec cc -fpic -shared -Wl,-x -o %o %s"
-#endif
+ VCC_CC
, NULL },
{ "max_restarts", tweak_uint, &master.max_restarts, 0, UINT_MAX,
"Upper limit on how many times a request can restart."
Modified: trunk/varnish-cache/configure.ac
===================================================================
--- trunk/varnish-cache/configure.ac 2008-08-11 07:47:24 UTC (rev 3072)
+++ trunk/varnish-cache/configure.ac 2008-08-11 08:02:24 UTC (rev 3073)
@@ -305,6 +305,23 @@
AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]),
CFLAGS="${CFLAGS} -Werror")
+# Command line for compiling VCL code. I wish there were a simple way
+# to figure this out dynamically without introducing a run-time
+# dependency on libtool.
+case $host in
+*-*-solaris*)
+ VCC_CC="cc -Kpic ${CFLAGS} -G -o %o %s"
+ ;;
+*-*-darwin*)
+ VCC_CC="exec cc -dynamiclib -Wl,-undefined,dynamic_lookup -o %o %s"
+ ;;
+*)
+ VCC_CC="exec cc -fpic -shared -Wl,-x -o %o %s"
+ ;;
+esac
+
+AC_DEFINE_UNQUOTED([VCC_CC],"$VCC_CC",[C compiler command line for VCL code])
+
# Generate output
AC_CONFIG_FILES([
Makefile
More information about the varnish-commit
mailing list