summaryrefslogtreecommitdiff
path: root/gnome/configure.ac
blob: aa698eaf2ac98d087ac5d13286e104dd52f6674b (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
AC_INIT(DAPI GNOME Daemon, 0.2, dapi_gnome)
AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (C) 2003-2006 Imendio AB])

AC_CONFIG_SRCDIR(src/dapi-daemon.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define)

AM_MAINTAINER_MODE

AC_CANONICAL_HOST

AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

AC_ISC_POSIX
AC_HEADER_STDC
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL

AM_PATH_GLIB_2_0

IDT_COMPILE_WARNINGS

changequote(,)dnl
if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac
fi
changequote([,])dnl

AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)

LM_CHECK_TIMEZONE

# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_SELECT_ARGTYPES
AC_CHECK_FUNCS([gethostname select socket strrchr])


# Check for sudo command. 
#
# We could do this ourself, but it is easier to use an external
# command since they blank the screen and handle it much nicer.
#
AC_PATH_PROG(have_gksu, gksu, "no")

if test x$have_gksu != xno; then
   AC_DEFINE_UNQUOTED(HAVE_GKSU, "$have_gksu", [Define path to gksu if you have support])
fi


# Check for gnome-screensaver
AC_PATH_PROG(have_gnome_screensaver, gnome-screensaver-command, "no")

if test x$have_gnome_screensaver != xno; then
   AC_DEFINE_UNQUOTED(HAVE_GNOME_SCREENSAVER, "$have_gnome_screensaver", [Define path to gnome-screensaver-command if you have it])
fi


# Dependencies
AC_SUBST(GLIB2_REQUIRED, 2.10.0)
AC_SUBST(GTK_REQUIRED, 2.8.0)
AC_SUBST(GNOMEVFS_REQUIRED, 2.0.0)
AC_SUBST(GCONF_REQUIRED, 1.2.0) 
AC_SUBST(EBOOK_REQUIRED, 1.6.1)
AC_SUBST(DBUS_REQUIRED, 0.60)
AC_SUBST(DBUS_GLIB_REQUIRED, 0.71)

PKG_CHECK_MODULES(DAPI_GNOME,
[
	glib-2.0 >= $GLIB2_REQUIRED
	gtk+-2.0 >= $GTK_REQUIRED
	gnome-vfs-2.0 >= $GNOMEVFS_REQUIRED
	gconf-2.0 >= $GCONF_REQUIRED
	libebook-1.2 >= $EBOOK_REQUIRED
	dbus-1 >= $DBUS_REQUIRED
	dbus-glib-1 >= $DBUS_GLIB_REQUIRED
])

# Check we have the DBUS binding tool we need
AC_PATH_PROG(DBUSBINDINGTOOL, dbus-binding-tool)
if test -z $DBUSBINDINGTOOL; then
   	AC_MSG_ERROR([Could not find 'dbus-binding-tool'])
fi


# Check that we have test suite
m4_ifdef([AM_PATH_CHECK],[AM_PATH_CHECK(0.9.0, have_check=yes, have_check=no)],[have_check=no]) 


# Define a MAINT-like variable REBUILD which is set if Perl
# and awk are found, so autogenerated sources can be rebuilt
AC_ARG_ENABLE(rebuilds,
              AS_HELP_STRING([--enable-rebuilds=@<:@no/yes/auto@:>@],
                             [Enable source autogeneration rules [[default=yes]]]), ,
              enable_rebuilds=yes)

REBUILD=\#
if test "x$enable_rebuilds" = "xyes" && \
     test -n "$PERL" && \
     $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
     test -n "$AWK" ; then
  REBUILD=
fi
AC_SUBST(REBUILD)


# Build flags
DOC_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $WARN_CFLAGS"
AC_SUBST(DOC_CFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)


# Debugging
AC_ARG_ENABLE(debug,
              AS_HELP_STRING([--enable-debug=@<:@no/yes/auto@:>@],
                             [Enable debugging [[default=yes]]]), ,
              enable_debug=yes)

if test x$enable_debug = xno ; then
	DAPI_GNOME_CFLAGS="$DAPI_GNOME_CFLAGS -DDAPI_GNOME_NO_DEBUG"
fi


# Finish
AC_SUBST(DAPI_GNOME_CFLAGS)
AC_SUBST(DAPI_GNOME_LIBS)

AC_OUTPUT([
Makefile
data/Makefile
src/Makefile
tests/Makefile])

echo "

        DAPI-Gnome $VERSION 
	===================

        Prefix:                   ${prefix}
        Compiler:                 ${CC}
        Debugging:                ${enable_debug}
	Check test suite:         ${have_check}

	Gksu:                     ${have_gksu}
	Gnome Screensaver:        ${have_gnome_screensaver}
	
        Now type 'make' to build DAPI Gnome 
"