Added version.h
[unicode-screensaver.git] / configure.ac
1 # Process this file with autoconf to produce a configure script.
2
3 #AC_PREREQ(2.60)
4 AC_INIT(unicode-screensaver, 0.1, mail@joachim-breitner.de)
5 AC_CONFIG_SRCDIR([unicode.c])
6 AC_CONFIG_HEADER([config.h])
7 AC_CONFIG_MACRO_DIR([m4])
8 AM_INIT_AUTOMAKE
9
10 # Checks for programs.
11 AC_PROG_CC
12 AC_PROG_INSTALL
13 AC_PROG_MAKE_SET
14
15 # Checks for libraries.
16 AM_PROG_LIBTOOL
17
18 PKG_CHECK_MODULES(X11, x11)
19 AC_SUBST(X11_CFLAGS)
20 AC_SUBST(X11_LIBS)
21
22 PKG_CHECK_MODULES(XMU, xmu)
23 AC_SUBST(XMU_CFLAGS)
24 AC_SUBST(XMU_LIBS)
25
26 PKG_CHECK_MODULES(XT, xt)
27 AC_SUBST(XT_CFLAGS)
28 AC_SUBST(XT_LIBS)
29
30 PKG_CHECK_MODULES(XFT, xft)
31 AC_SUBST(XFT_CFLAGS)
32 AC_SUBST(XFT_LIBS)
33
34 PKG_CHECK_MODULES(FC, fontconfig)
35 AC_SUBST(FC_CFLAGS)
36 AC_SUBST(FC_LIBS)
37
38 # Checks for header files.
39
40 # Checks for typedefs, structures, and compiler characteristics.
41
42
43 ###############################################################################
44 #
45 #       Function to check whether gettimeofday() exists, and how to call it.
46 #       This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
47 #
48 ###############################################################################
49
50 AH_TEMPLATE([HAVE_GETTIMEOFDAY],
51             [Define this if you have the gettimeofday function.])
52
53 AH_TEMPLATE([GETTIMEOFDAY_TWO_ARGS],
54             [Define this if gettimeofday() takes two arguments.])
55
56 AC_DEFUN([AC_GETTIMEOFDAY_ARGS],
57  [AC_MSG_CHECKING(how to call gettimeofday)
58   AC_CACHE_VAL(ac_cv_gettimeofday_args,
59    [AC_TRY_COMPILE([#include <stdlib.h>
60                     #include <sys/time.h>],
61                    [struct timeval tv; struct timezone tzp;
62                     gettimeofday(&tv, &tzp);],
63                    [ac_gettimeofday_args=2],
64                    [AC_TRY_COMPILE([#include <stdlib.h>
65                                     #include <sys/time.h>],
66                                    [struct timeval tv; gettimeofday(&tv);],
67                                    [ac_gettimeofday_args=1],
68                                    [ac_gettimeofday_args=0])])
69     ac_cv_gettimeofday_args=$ac_gettimeofday_args])
70   ac_gettimeofday_args=$ac_cv_gettimeofday_args
71   if test "$ac_gettimeofday_args" = 1 ; then
72     AC_DEFINE(HAVE_GETTIMEOFDAY)
73     AC_MSG_RESULT(one argument)
74   elif test "$ac_gettimeofday_args" = 2 ; then
75     AC_DEFINE(HAVE_GETTIMEOFDAY)
76     AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
77     AC_MSG_RESULT(two arguments)
78   else
79     AC_MSG_RESULT(unknown)
80   fi
81 ])
82
83 AC_GETTIMEOFDAY_ARGS
84
85 # Checks for library functions.
86
87 AC_CONFIG_FILES([Makefile])
88 AC_OUTPUT