aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
blob: 25dbbed76183e5cd3d67d93af92f8673dab0db25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
dnl Process this file with autoconf to produce a configure script.
AC_INIT(TuxMessenger, 2.0.13, taw27@srcf.ucam.org)

dnl Version number
VERSION=AC_PACKAGE_VERSION

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(tuxmessenger, "$VERSION")

OLD_CFLAGS="$CFLAGS"
AC_PROG_CC
CFLAGS="$OLD_CFLAGS"

AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S

AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h])
AC_C_CONST
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_FUNC_STAT
AC_FUNC_REALLOC
AC_CHECK_FUNCS([gethostbyname memmove memset socket strdup strstr strcasecmp mkdir])

dnl Check for GTK+ 2.6.0 (prefered version, but not mandatory)
AM_PATH_GTK_2_0(2.6.0,AC_DEFINE(HAVE_GTK_2_6_0, TRUE, [Have GTK 2.6.0?]),AC_MSG_WARN([
*** Didn't find GTK 2.6.0 or above - some (insignificant) features will be disabled...]))

dnl Now check for GTK+ 2.4.0 (minimum acceptable version)
dnl	This has to be done after checking for 2.6.x in order to have the flags set up.
AM_PATH_GTK_2_0(2.4.0,,AC_MSG_ERROR([
*** GTK+ 2.4.0 or above is required by TuxMessenger.  Please make sure you have the GTK+
*** development files installed. The latest version of GTK+ is
*** always available at http://www.gtk.org/.]))

AM_PATH_XML2(2.5.0,,AC_MSG_ERROR([
*** Libxml is required to build TuxMessenger; Available at
http://www.libxml.org/.]))

dnl Check for OpenSSL
AC_MSG_CHECKING([if openssl is available])
LIBS="$LIBS -lssl -lcrypto"
AC_TRY_LINK([#include <openssl/opensslv.h>], [ return OPENSSL_VERSION_NUMBER; ],
	[ AC_MSG_RESULT(yes) ],
	[ AC_MSG_RESULT(no)
	  AC_MSG_ERROR([*** Couldn't find OpenSSL ***]) ] )

dnl Check for GNOME-Canvas
AC_MSG_CHECKING([for GNOME-Canvas])
CFLAGS="$CFLAGS `pkg-config --cflags libgnomecanvas-2.0`"
LIBS="$LIBS `pkg-config --libs libgnomecanvas-2.0`"
AC_TRY_LINK([#include <libgnomecanvas/libgnomecanvas.h>], ,
	[ AC_MSG_RESULT(found) ],
	[ AC_MSG_RESULT(not found)
	  AC_MSG_ERROR([*** Couldn't find GNOME-Canvas ***]) ] )

AC_OUTPUT(Makefile src/Makefile data/Makefile)