[PATCH] allow cross-compiling samba-2.2.7
Dan Kegel
dank at kegel.com
Sat Dec 14 01:48:00 GMT 2002
Gerald (Jerry) Carter wrote:
> Dan,
>
> Please send me the patch and I'll work on getting it in.
>
> On Fri, 6 Dec 2002, Dan Kegel wrote:
>
>
>>Here's the only use of HAVE_GETTIMEOFDAY_TZ:
>>
>>void GetTimeOfDay(struct timeval *tval)
>>{
>>#ifdef HAVE_GETTIMEOFDAY_TZ
>> gettimeofday(tval,NULL);
>>#else
>> gettimeofday(tval);
>>#endif
>>}
>>
>>Thus all it's trying to do is tell whether the 2nd parameter
>>has to be there. You can do that without a runtime check --
>>unless you're trying to be sneaky and optimize away one
>>parameter for performance reasons.
>>
>>If the group feels that there's an important performance reason
>>to avoid that 2nd parameter, then sure, I can submit another
>>patch that keeps the current "skip the 2nd parameter if it
>>didn't crash the first time we called it with only 1 parameter" behavior.
Thanks, looking forward to hearing what you think about the patch.
Patch attached.
- Dan
-------------- next part --------------
--- samba-2.2.7/source/configure.in.orig Thu Dec 5 12:09:07 2002
+++ samba-2.2.7/source/configure.in Thu Dec 5 12:18:52 2002
@@ -1167,10 +1167,10 @@
fi
AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
-AC_TRY_RUN([
+AC_TRY_COMPILE([
#include <sys/time.h>
-#include <unistd.h>
-main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
+#include <unistd.h>],
+[struct timeval tv; exit(gettimeofday(&tv, NULL));],
samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
More information about the samba-technical
mailing list