From fb7a6cdf3b0c38fa17e3b847203edbe50965a8f5 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 11 Aug 2008 08:02:24 +0000 Subject: [PATCH] Move the C-compiler invocation determination to autoconf. (Fixed the apple & gnu compiler strings relative to submitted patch) Submitted by: Theo Schlossnagle git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3073 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/mgt_param.c | 8 +------- varnish-cache/configure.ac | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/varnish-cache/bin/varnishd/mgt_param.c b/varnish-cache/bin/varnishd/mgt_param.c index 936e3a07..68983863 100644 --- a/varnish-cache/bin/varnishd/mgt_param.c +++ b/varnish-cache/bin/varnishd/mgt_param.c @@ -705,13 +705,7 @@ static const struct parspec parspec[] = { "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." diff --git a/varnish-cache/configure.ac b/varnish-cache/configure.ac index 63ca4c00..bf26019f 100644 --- a/varnish-cache/configure.ac +++ b/varnish-cache/configure.ac @@ -305,6 +305,23 @@ AC_ARG_ENABLE(werror, 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 -- 2.39.5