Steps to start a cross-compile
Steven Edwards
steven_ed4153 at yahoo.com
Thu May 5 20:16:54 GMT 2005
Hi,
If anyone wants to help on Cross building samba4 for Windows here is how to go about doing it.
This assumes you have a CrossCompiler installed and have it in your path. Mine has a prefix of
mingw32-* others may differ
1. co samba4 sources from SVN
2. autogen and configure as normal
3. Apply the patch at the end of this message
4. rerun configure with --host=mingw32 (depending on your mingw prefix)
5. You can now run make bin/smbclient and it will get a bit further along.
Thanks
Steven
Index: source/include/includes.h
===================================================================
--- source/include/includes.h (revision 6621)
+++ source/include/includes.h (working copy)
@@ -28,6 +28,10 @@
#include "local.h"
+#if !defined(HAVE_OS_WIN32) && (defined(_MSC_VER) || defined(__MINGW32__))
+#define HAVE_OS_WIN32
+#endif
+
#if (__GNUC__ >= 3)
/** Use gcc attribute to check printf fns. a1 is the 1-based index of
* the parameter containing the format, and a2 the index of the first
@@ -70,6 +74,18 @@
#include <varargs.h>
#endif
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
+#if defined(HAVE_WINDOWS_H) || defined(HAVE_WINSOCK2_H)
+#undef interface
+#endif
+
/* we support ADS if we want it and have krb5 and ldap libs */
#if defined(WITH_ADS) && defined(HAVE_KRB5) && defined(HAVE_LDAP)
#define HAVE_ADS
Index: source/build/m4/rewrite.m4
===================================================================
--- source/build/m4/rewrite.m4 (revision 6621)
+++ source/build/m4/rewrite.m4 (working copy)
@@ -69,8 +69,8 @@
AC_CHECK_HEADERS(stropts.h)
AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
AC_CHECK_HEADERS(sys/acl.h)
+AC_CHECK_HEADERS(windows.h winsock2.h)
-
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_MODE_T
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html
More information about the samba-technical
mailing list