Initial version of qemu-sanity-check.
[qemu-sanity-check.git] / configure.ac
index 1807999..664f47b 100644 (file)
 AC_INIT([qemu-sanity-check],[1.1.1])
 AM_INIT_AUTOMAKE([foreign])
 
+dnl Check for basic C environment.
+AC_PROG_CC_STDC
+AC_PROG_INSTALL
+AC_PROG_CPP
+
+AC_C_PROTOTYPES
+test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
+
+AM_PROG_CC_C_O
+
+AC_PROG_SED
+
+AC_MSG_CHECKING([that a static binary can be built])
+old_CFLAGS="$CFLAGS"
+old_LDFLAGS="$LDFLAGS"
+CFLAGS="$CFLAGS -static"
+LDFLAGS="$LDFLAGS -static"
+AC_LINK_IFELSE([
+    #include <stdio.h>
+    #include <stdlib.h>
+    int main () { exit (0); }
+],[
+    AC_MSG_RESULT([yes])
+],[
+    AC_MSG_RESULT([no])
+    AC_MSG_ERROR([Building a static binary failed.  Make sure you have static libc installed.])
+])
+
 AC_CHECK_PROG([POD2MAN], [pod2man], [pod2man], [no])
 if test "x$POD2MAN" = "xno"; then
     AC_MSG_WARN([pod2man was not found.  This is needed to build man pages.])
@@ -26,7 +54,7 @@ AM_CONDITIONAL([HAVE_POD2MAN], [test "x$POD2MAN" != "xno"])
 
 dnl Produce output files.
 AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_FILES([qemu-sanity-check],[chmod +x qemu-sanity-check])
+AC_CONFIG_FILES([qemu-sanity-check],[chmod 0555 qemu-sanity-check])
 AC_CONFIG_FILES([Makefile])
 
 AC_OUTPUT