summaryrefslogtreecommitdiff
path: root/source4/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'source4/SConstruct')
-rw-r--r--source4/SConstruct13
1 files changed, 12 insertions, 1 deletions
diff --git a/source4/SConstruct b/source4/SConstruct
index 10b7c5f64f..6e38428b56 100644
--- a/source4/SConstruct
+++ b/source4/SConstruct
@@ -67,6 +67,8 @@ defines = loadconfig()
if defines == None:
hostenv['configure'] = 1
+
+if hostenv['configure']:
defines = {}
Export('defines')
@@ -191,13 +193,22 @@ return 0;
""", '.c'):
defines['TIME_WITH_SYS_TIME'] = 1
- if conf.TryCompile("""
+ if conf.TryCompile("""
#include <sys/time.h>
#include <unistd.h>
main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}
""", '.c'):
defines['HAVE_GETTIMEOFDAY_TZ'] = 1
+ # Check for header that defines "DIR"
+ for h in ['dirent.h','sys/ndir.h','sys/dir.h','ndir.h']:
+ if conf.TryCompile("""
+#include <%s>
+
+int main() { DIR *x; return 0; }""" % h, '.c'):
+ defines['HAVE_' + h.upper().replace('.','_').replace('/','_')] = 1
+ break
+
conf.Finish()
[dynenv.Append(CPPDEFINES = {p: '\\"%s\\"' % paths[p]}) for p in paths]