]> err.no Git - varnish/commitdiff
Use the correct cc command line on MacOS. This is a gross hack.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 19 Jul 2007 11:49:43 +0000 (11:49 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 19 Jul 2007 11:49:43 +0000 (11:49 +0000)
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

index ab5b96632e7891cbf8410dedd69b4593d851e03b..7fbd0f1888f5d512c8cd5705700e5c371dbbc71a 100644 (file)
@@ -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);