build: Fix waf build on MacOS X
authorAndrew Bartlett <abartlet@samba.org>
Wed, 21 Sep 2011 01:19:58 +0000 (18:19 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 23 Sep 2011 08:58:02 +0000 (10:58 +0200)
The -framework CoreFoundation is required by the charset_macosxfs module

The system/time.h header is required to access the replacement clock_gettime()

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Sep 23 10:58:02 CEST 2011 on sn-devel-104

lib/util/charset/charset_macosxfs.c
source3/lib/pthreadpool/pthreadpool.c
wscript

index dfd142a51e470557175533c5f3ca432c2970abc6..b32aa2bcd1cbd8cbe3378ca26b0a0989e961e505 100644 (file)
@@ -33,7 +33,7 @@
 #include "charset_proto.h"
 #undef realloc
 
-#ifdef DARWIN
+#ifdef DARWINOS
 
 /*
  * Include OS frameworks.  These are only needed in this module.
index 9981ed25ae6f7ab3ede05adc44cfe07d75e5b5a9..42b550d7ed7567f0b7d2f636481f008f871e90cb 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "config.h"
 #include <errno.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -26,7 +27,7 @@
 #include <signal.h>
 #include <assert.h>
 #include <fcntl.h>
-#include <sys/time.h>
+#include "system/time.h"
 
 #include "pthreadpool.h"
 #include "lib/util/dlinklist.h"
diff --git a/wscript b/wscript
index 548f8ec3ef594fa6fbe0fb1f037c75047629ccd0..8454146ba53e906ec12987690814444a415610f6 100755 (executable)
--- a/wscript
+++ b/wscript
@@ -77,6 +77,10 @@ def configure(conf):
             conf.ADD_CFLAGS('-fno-common')
         if not conf.CHECK_SHLIB_W_PYTHON("Checking if -undefined dynamic_lookup is not need"):
             conf.env.append_value('shlib_LINKFLAGS', ['-undefined', 'dynamic_lookup'])
+
+    if sys.platform == 'darwin':
+        conf.ADD_LDFLAGS('-framework CoreFoundation')
+
     if int(conf.env['PYTHON_VERSION'][0]) >= 3:
         raise Utils.WafError('Python version 3.x is not supported by Samba yet')