[PATCH 1/3] build: don't execute tests/summary.c
Gustavo Zacarias
gustavo at zacarias.com.ar
Thu Jan 30 13:59:48 MST 2014
tests/summary.c will never be able to be executed when cross compiling.
Use #error and #warning directives to fail or warn accordingly when
compiling it.
Signed-off-by: Gustavo Zacarias <gustavo at zacarias.com.ar>
---
tests/summary.c | 14 +++++---------
wscript | 1 -
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/tests/summary.c b/tests/summary.c
index 27f7d4d..0843ee2 100644
--- a/tests/summary.c
+++ b/tests/summary.c
@@ -5,27 +5,23 @@ void exit(int);
int main()
{
#if !defined(HAVE_FCNTL_LOCK)
- printf("ERROR: No locking available. Running Samba would be unsafe\n");
- exit(1);
+#error "ERROR: No locking available. Running Samba would be unsafe"
#endif
#if !(defined(HAVE_IFACE_GETIFADDRS) || defined(HAVE_IFACE_IFCONF) || defined(HAVE_IFACE_IFREQ) || defined(HAVE_IFACE_AIX))
- printf("WARNING: No automated network interface determination\n");
+#warning "WARNING: No automated network interface determination"
#endif
#if !(defined(USE_SETEUID) || defined(USE_SETREUID) || defined(USE_SETRESUID) || defined(USE_SETUIDX) || defined(USE_LINUX_THREAD_CREDENTIALS))
- printf("ERROR: no seteuid method available\n");
- exit(1);
+#error "ERROR: no seteuid method available"
#endif
#if !(defined(STAT_STATVFS) || defined(STAT_STATFS3_OSF1) || defined(STAT_STATFS2_BSIZE) || defined(STAT_STATFS4) || defined(STAT_STATFS2_FSIZE) || defined(STAT_STATFS2_FS_DATA))
- printf("ERROR: No disk free routine!\n");
- exit(1);
+#error "ERROR: No disk free routine!"
#endif
#if !((defined(HAVE_RANDOM) || defined(HAVE_RAND)) && (defined(HAVE_SRANDOM) || defined(HAVE_SRAND)))
- printf("ERROR: No random or srandom routine!\n");
- exit(1);
+#error "ERROR: No random or srandom routine!"
#endif
exit(0);
diff --git a/wscript b/wscript
index 47b7b50..26431a4 100644
--- a/wscript
+++ b/wscript
@@ -170,7 +170,6 @@ def configure(conf):
if not conf.CHECK_CODE('#include "tests/summary.c"',
define='SUMMARY_PASSES',
addmain=False,
- execute=True,
msg='Checking configure summary'):
raise Utils.WafError('configure summary failed')
--
1.8.3.2
More information about the samba-technical
mailing list