From cf6490f3db258915bb6bb67cb6a71e9ba85c1170 Mon Sep 17 00:00:00 2001 From: des Date: Thu, 19 Jul 2007 11:49:43 +0000 Subject: [PATCH] Use the correct cc command line on MacOS. This is a gross hack. Also, ignore the result of dlclose(). git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1721 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/mgt_vcc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/mgt_vcc.c b/varnish-cache/bin/varnishd/mgt_vcc.c index ab5b9663..7fbd0f18 100644 --- a/varnish-cache/bin/varnishd/mgt_vcc.c +++ b/varnish-cache/bin/varnishd/mgt_vcc.c @@ -181,7 +181,11 @@ mgt_CallCc(const char *source, struct vsb *sb) /* Attempt to open a pipe to the system C-compiler */ len = snprintf(buf, sizeof buf, "ln -f %s _.c ;" /* XXX: for debugging */ +#ifdef __APPLE__ + "exec cc -dynamiclib -Wl,-flat_namespace,-undefined,suppress -o %s -x c - < %s 2>&1", +#else "exec cc -fpic -shared -Wl,-x -o %s -x c - < %s 2>&1", +#endif sf, of, sf); xxxassert(len < sizeof buf); @@ -229,7 +233,7 @@ mgt_CallCc(const char *source, struct vsb *sb) free(of); of = NULL; } else - AZ(dlclose(p)); + (void)dlclose(p); /* clean up and return */ unlink(sf); -- 2.39.5