build: Fix quota tests, including move of sysquotas.c to the top level
authorAndrew Bartlett <abartlet@samba.org>
Sat, 29 Sep 2012 04:28:57 +0000 (14:28 +1000)
committerKarolin Seeger <kseeger@samba.org>
Fri, 2 Nov 2012 08:23:51 +0000 (09:23 +0100)
This correctly detects quotas on FreeBSD

Andrew Bartlett

source3/configure.in
source3/wscript
tests/sysquotas.c [moved from source3/tests/sysquotas.c with 99% similarity]

index f3c1edc0d906ea2b4296d7e27538fa00989372fc..2c5fbb34325247b49845b1364ed9c726e5dda273 100644 (file)
@@ -4611,7 +4611,7 @@ AC_TRY_RUN_STRICT([
 #define HAVE_QUOTACTL_4A 1
 #define AUTOCONF_TEST 1
 #include "confdefs.h"
-#include "${srcdir-.}/../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
+#include "${srcdir-.}/../../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
            samba_cv_HAVE_QUOTACTL_4A=yes,samba_cv_HAVE_QUOTACTL_4A=no,samba_cv_HAVE_QUOTACTL_4A=cross)])
 if test x"$samba_cv_HAVE_QUOTACTL_4A" = x"yes"; then
     samba_cv_SYSQUOTA_FOUND=yes;
@@ -4625,7 +4625,7 @@ AC_TRY_RUN_STRICT([
 #define HAVE_QUOTACTL_4B 1
 #define AUTOCONF_TEST 1
 #include "confdefs.h"
-#include "${srcdir-.}/../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
+#include "${srcdir-.}/../../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
            samba_cv_HAVE_QUOTACTL_4B=yes,samba_cv_HAVE_QUOTACTL_4B=no,samba_cv_HAVE_QUOTACTL_4B=cross)])
 if test x"$samba_cv_HAVE_QUOTACTL_4B" = x"yes"; then
     samba_cv_SYSQUOTA_FOUND=yes;
index 230db5981ab533203c4508acf26ced4ee196893f..9cd66e1b2947d9525a91305522260e4379b11c21 100644 (file)
@@ -1245,23 +1245,24 @@ main() {
             if not conf.CHECK_CODE('''
                 #define HAVE_QUOTACTL_4A 1
                 #define AUTOCONF_TEST 1
-                #include "confdefs.h"
-                #include "${srcdir-.}/../tests/sysquotas.c"
+                #include "../tests/sysquotas.c"
                 ''',
+                                   cflags=conf.env['WERROR_CFLAGS'],
                                    define='HAVE_QUOTACTL_4A',
                                    msg='for QUOTACTL_4A: long quotactl(int cmd, char *special, qid_t id, caddr_t addr)',
                                    execute=True,
-                                   local_include=False):
+                                   addmain=False):
+
                 conf.CHECK_CODE('''
                 #define HAVE_QUOTACTL_4B 1
                 #define AUTOCONF_TEST 1
-                #include "confdefs.h"
-                #include "${srcdir-.}/../tests/sysquotas.c"
+                #include "../tests/sysquotas.c"
                 ''',
+                                cflags=conf.env['WERROR_CFLAGS'],
                                 define='HAVE_QUOTACTL_4B',
                                 msg='for QUOTACTL_4B:  int quotactl(const char *path, int cmd, int id, char *addr)',
                                 execute=True,
-                                local_include=False)
+                                addmain=False)
 
         conf.CHECK_CODE('''
                      clnt_create("", RQUOTAPROG, RQUOTAVERS, "udp");
similarity index 99%
rename from source3/tests/sysquotas.c
rename to tests/sysquotas.c
index 1544dca7cfbe3aa0c28d4b1064d1dd1887a00687..afec3f162446a492450baceee37030822a40c861 100644 (file)
@@ -42,7 +42,7 @@ extern int quotactl(int cmd, const char *special, uid_t uid, void *addr);
        struct SYS_DQBLK D;
 
        ret = quotactl(Q_GETQUOTA,"/dev/hda1",0,(void *)&D);
-       
+
        return ret;
 }
 
@@ -84,7 +84,7 @@ extern int quotactl(int cmd, const char *special, uid_t uid, void *addr);
 #endif
 
  int main(void)
-{      
+{
        autoconf_quota();
        return 0;
 }