added autogen script to run autotools to generate configure and necessary make inputs
[ovirt-viewer.git] / configure.ac
1 # ovirt viewer console application
2 # Copyright (C) 2008 Red Hat Inc.
3 # Written by Richard W.M. Jones <rjones@redhat.com>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 AC_INIT(ovirt-viewer, 0.1)
20 AM_INIT_AUTOMAKE
21
22 dnl Basic C compiler environment.
23 AC_PROG_INSTALL
24 AC_PROG_CC
25 AM_PROG_CC_C_O
26 AC_EXEEXT
27
28 dnl Check for required packages.
29 dnl Note that we are using GLib threads, which are supported on Linux
30 dnl and Windows, but possibly not on some obscure platforms.
31 PKG_PROG_PKG_CONFIG
32 PKG_CHECK_MODULES([OVIRT_VIEWER],
33         [gtk+-2.0 gtk-vnc-1.0 glib-2.0 libxml-2.0 gnutls gthread-2.0 libcurl])
34
35 dnl Header files.
36 AC_CHECK_HEADERS([netdb.h netinet/in.h sys/socket.h sys/un.h windows.h])
37
38 dnl Optional functions.
39 AC_CHECK_FUNCS([socket gethostbyname htons connect])
40
41 dnl Default location for CA certificate bundle.
42 AC_ARG_ENABLE([cainfo],
43         [AS_HELP_STRING([--enable-cainfo=PATH],
44           [Set the path to the CA certificate bundle.])],
45         [CAINFO=$enableval],
46         [CAINFO=$sysconfdir/pki/tls/certs/ca-bundle.crt])
47 AC_SUBST([CAINFO])
48
49 dnl If the C compiler is really GCC, enable warnings and
50 dnl GCC-specific flags.  Bug in glib GStaticMutex prevents
51 dnl us from using strict aliasing safely.
52 dnl NB: We have to do this after all the function tests
53 dnl because '-Werror' tends to break them.
54 if test "$GCC" = "yes"; then
55   CFLAGS="$CFLAGS -Wall -Werror -fno-strict-aliasing"
56 fi
57
58 dnl Output.
59 AC_CONFIG_HEADERS([config.h])
60 AC_CONFIG_FILES([Makefile])
61 AC_OUTPUT