replace: use replace for non 'samba' compliant strptime
authorMatthieu Patou <mat@matws.net>
Wed, 20 Oct 2010 22:14:39 +0000 (02:14 +0400)
committerMatthieu Patou <mat@matws.net>
Thu, 21 Oct 2010 21:00:54 +0000 (01:00 +0400)
lib/replace/wscript

index 1778ea71b075c3b76d1ab2478e86814657ed451b..95cbb3752015f988c331ffac41f9d016374cb122 100644 (file)
@@ -229,6 +229,25 @@ def configure(conf):
                            addmain=False,
                            msg='Checking for working strptime'):
         conf.DEFINE('REPLACE_STRPTIME', 1)
+    else:
+       conf.CHECK_CODE('''
+                        const char *s = "20070414101546Z";
+                        char *ret;
+                        struct tm t;
+                        memset(&t, 0, sizeof(t));
+                        ret = strptime(s, "%Y%m%d%H%M%S", &t);
+                        if (ret == NULL || t.tm_wday != 6) {
+                            return 0;
+                        } else {
+                            return 1;
+                        }
+                        ''',
+                        msg="Checking correct behavior of strptime",
+                        headers = 'time.h',
+                        execute = True,
+                        define_ret = True,
+                        define = 'REPLACE_STRPTIME',
+                        )
 
     if conf.CONFIG_SET('HAVE_KRB5_H'):
         # Check for KRB5_DEPRECATED handling