added autogen script to run autotools to generate configure and necessary make inputs
[ovirt-viewer.git] / configure.ac
index edea64c..13276ea 100644 (file)
@@ -33,10 +33,10 @@ PKG_CHECK_MODULES([OVIRT_VIEWER],
        [gtk+-2.0 gtk-vnc-1.0 glib-2.0 libxml-2.0 gnutls gthread-2.0 libcurl])
 
 dnl Header files.
-AC_CHECK_HEADERS([sys/socket.h sys/un.h windows.h])
+AC_CHECK_HEADERS([netdb.h netinet/in.h sys/socket.h sys/un.h windows.h])
 
 dnl Optional functions.
-AC_CHECK_FUNCS([socketpair fork])
+AC_CHECK_FUNCS([socket gethostbyname htons connect])
 
 dnl Default location for CA certificate bundle.
 AC_ARG_ENABLE([cainfo],
@@ -46,6 +46,15 @@ AC_ARG_ENABLE([cainfo],
        [CAINFO=$sysconfdir/pki/tls/certs/ca-bundle.crt])
 AC_SUBST([CAINFO])
 
+dnl If the C compiler is really GCC, enable warnings and
+dnl GCC-specific flags.  Bug in glib GStaticMutex prevents
+dnl us from using strict aliasing safely.
+dnl NB: We have to do this after all the function tests
+dnl because '-Werror' tends to break them.
+if test "$GCC" = "yes"; then
+  CFLAGS="$CFLAGS -Wall -Werror -fno-strict-aliasing"
+fi
+
 dnl Output.
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([Makefile])