summaryrefslogtreecommitdiff
path: root/source4/lib/replace
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/replace')
-rw-r--r--source4/lib/replace/SConscript11
-rw-r--r--source4/lib/replace/win32/SConscript22
2 files changed, 30 insertions, 3 deletions
diff --git a/source4/lib/replace/SConscript b/source4/lib/replace/SConscript
index 48abf2c081..47bfa481f2 100644
--- a/source4/lib/replace/SConscript
+++ b/source4/lib/replace/SConscript
@@ -1,6 +1,8 @@
#!/usr/bin/env python
Import('hostenv defines')
+rep_files = ['replace.c', 'snprintf.c','dlfcn.c']
+
if hostenv['configure']:
conf = Configure(hostenv)
for f in ['memset','syslog','setnetgrent','getnetgrent','endnetgrent', \
@@ -33,7 +35,7 @@ int main() {
if conf.CheckCHeader('dlfcn.h'):
defines['HAVE_' + h.upper().replace('.','_').replace('/','_')] = 1
- if not conf.CheckType('socklen_t'):
+ if not conf.CheckType('socklen_t', "#include <sys/socket.h>"):
defines['socklen_t'] = 'int'
needed_types = {
@@ -59,7 +61,10 @@ int main() {
if not conf.CheckType(t,type_headers):
defines[t] = needed_types[t]
+ if not conf.TryRun(open("../../build/tests/os2_delete.c").read(), '.c'):
+ rep_files += ['repdir/repdir.c']
+
conf.Finish()
-hostenv.StaticLibrary('repdir', ['repdir/repdir.c'])
-hostenv.StaticLibrary('replace', ['replace.c', 'snprintf.c','dlfcn.c'])
+hostenv.StaticLibrary('replace', rep_files)
+SConscript(dirs=['win32'])
diff --git a/source4/lib/replace/win32/SConscript b/source4/lib/replace/win32/SConscript
new file mode 100644
index 0000000000..a23fb6a878
--- /dev/null
+++ b/source4/lib/replace/win32/SConscript
@@ -0,0 +1,22 @@
+Import('hostenv defines')
+
+if hostenv['configure']:
+ conf = Configure(hostenv)
+ for h in ['direct.h','windows.h','winsock2.h','ws2tcpip.h']:
+ if conf.CheckCHeader(h):
+ defines['HAVE_' + h.upper().replace('.','_')] = 1
+ conf.TryCompile("""
+#include <stdio.h>
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#endif
+
+int main()
+{
+ mkdir("foo",0777);
+ return 0;
+}
+""", '.c')
+
+ conf.Finish()
+