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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
dnl $Id$
dnl
dnl Copyright (c) 2007 The Xfce development team.
dnl All rights reserved.
dnl
dnl Written for Xfce by Jannis Pohlmann <jannis@xfce.org>.
dnl
dnl ***************************
dnl *** Version information ***
dnl ***************************
m4_define([libxfce4menu_verinfo], [0:0:0])
m4_define([libxfce4menu_version_api_major], [0])
m4_define([libxfce4menu_version_api_minor], [1])
m4_define([libxfce4menu_version_major], [4])
m4_define([libxfce4menu_version_minor], [5])
m4_define([libxfce4menu_version_micro], [90])
m4_define([libxfce4menu_version_nano], [])
m4_define([libxfce4menu_version_build], [r@REVISION@])
m4_define([libxfce4menu_version_tag], [svn])
m4_define([libxfce4menu_version], [libxfce4menu_version_major().libxfce4menu_version_minor().libxfce4menu_version_micro()ifelse(libxfce4menu_version_nano(), [], [], [.libxfce4menu_version_nano()])ifelse(libxfce4menu_version_tag(), [svn], [libxfce4menu_version_tag()-libxfce4menu_version_build()], [libxfce4menu_version_tag()])])
dnl ********************************************
dnl *** Full debug support for SVN snapshots ***
dnl ********************************************
m4_define([libxfce4menu_debug_default], [ifelse(libxfce4menu_version_tag(), [svn], [full], [minimum])])
dnl ***************************
dnl *** Initialize autoconf ***
dnl ***************************
AC_COPYRIGHT([Copyright (c) 2007 The Xfce development team.
All rights reserved.
Written for Xfce by Jannis Pohlmann <jannis@xfce.org>.])
AC_INIT([libxfce4menu], [libxfce4menu_version], [http://bugzilla.xfce.org/])
AC_PREREQ([2.50])
AC_REVISION([$Id$])
AC_CANONICAL_TARGET()
dnl ***************************
dnl *** Initialize automake ***
dnl ***************************
AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()])
AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE()
dnl **************************
dnl *** Libtool versioning ***
dnl **************************
LIBXFCE4MENU_VERINFO=libxfce4menu_verinfo()
AC_SUBST([LIBXFCE4MENU_VERINFO])
dnl ****************************
dnl *** Subst libxfce4menu version ***
dnl ****************************
LIBXFCE4MENU_VERSION_MAJOR=libxfce4menu_version_major()
LIBXFCE4MENU_VERSION_MINOR=libxfce4menu_version_minor()
LIBXFCE4MENU_VERSION_MICRO=libxfce4menu_version_micro()
LIBXFCE4MENU_VERSION_API_MAJOR=libxfce4menu_version_api_major()
LIBXFCE4MENU_VERSION_API_MINOR=libxfce4menu_version_api_minor()
LIBXFCE4MENU_VERSION_API=$LIBXFCE4MENU_VERSION_API_MAJOR.$LIBXFCE4MENU_VERSION_API_MINOR
AC_SUBST([LIBXFCE4MENU_VERSION_MAJOR])
AC_SUBST([LIBXFCE4MENU_VERSION_MINOR])
AC_SUBST([LIBXFCE4MENU_VERSION_MICRO])
AC_SUBST([LIBXFCE4MENU_VERSION_API_MAJOR])
AC_SUBST([LIBXFCE4MENU_VERSION_API_MINOR])
AC_SUBST([LIBXFCE4MENU_VERSION_API])
dnl *******************************
dnl *** Check for UNIX variants ***
dnl *******************************
AC_AIX()
AC_ISC_POSIX()
AC_MINIX()
dnl ********************************
dnl *** Check for basic programs ***
dnl ********************************
AM_PROG_AS()
AC_PROG_CC()
AC_PROG_INSTALL()
AC_PROG_INTLTOOL([0.31], [no-xml])
AC_PROG_LIBTOOL()
AM_PROG_CC_C_O()
dnl ***********************************************
dnl *** Determine the u32 type required for tdb ***
dnl ***********************************************
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([short])
AC_MSG_CHECKING([for 32bit unsigned integer])
case 4 in
$ac_cv_sizeof_int) TDB_U32_TYPE="unsigned int" ;;
$ac_cv_sizeof_long) TDB_U32_TYPE="unsigned long" ;;
$ac_cv_sizeof_short) TDB_U32_TYPE="unsigned short" ;;
esac
AC_SUBST([TDB_U32_TYPE])
AC_MSG_RESULT([$TDB_U32_TYPE])
dnl ***************************************
dnl *** Check for standard header files ***
dnl ***************************************
AC_HEADER_STDC()
AC_CHECK_HEADERS([fcntl.h errno.h sys/mman.h sys/stat.h sys/wait.h memory.h \
stdlib.h stdio.h string.h sys/types.h sys/time.h unistd.h \
time.h stdarg.h sys/types.h sys/uio.h sched.h ctype.h])
dnl ************************************
dnl *** Check for standard functions ***
dnl ************************************
AC_FUNC_MMAP()
dnl AC_CHECK_FUNCS([])
dnl ******************************
dnl *** Check for i18n support ***
dnl ******************************
XDT_I18N([@LINGUAS@], [libxfce4menu-libxfce4menu_version_api_major().libxfce4menu_version_api_minor()])
dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.6.0])
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.2.2])
dnl *************************
dnl *** Check for gtk-doc ***
dnl *************************
GTK_DOC_CHECK([1.0])
dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@], [Turn on debugging @<:@default=libxfce4menu_debug_default@:>@]),
[], [enable_debug=libxfce4menu_debug_default])
AC_MSG_CHECKING([whether to enable debugging support])
if test x"$enable_debug" = x"yes" -o x"$enable_debug" = x"full"; then
dnl Print the result
AC_MSG_RESULT([$enable_debug])
dnl Make sure we detect possible errors (if supported)
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
AC_MSG_CHECKING([whether $CC accepts -Wall -Werror])
AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
AC_MSG_RESULT([yes])
], [
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT([no])
])
dnl Paranoia for --enable-debug=full
if test x"$enable_debug" = x"full"; then
dnl Enable extensive debugging
CFLAGS="$CFLAGS -DG_ENABLE_DEBUG"
dnl Use -O0 -g3 if the compiler supports it
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -O0 -g3"
AC_MSG_CHECKING([whether $CC accepts -O0 -g3])
AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
AC_MSG_RESULT([yes])
], [
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT([no])
])
fi
else
dnl Print the result
AC_MSG_RESULT([$enable_debug])
dnl Disable debugging (release build)
CFLAGS="$CFLAGS -DNDEBUG"
dnl Disable object cast checks
CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS"
dnl Disable all checks for --enable-debug=no
if test x"$enable_debug" = x"no"; then
CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
fi
fi
dnl **************************************
dnl *** Check for linker optimizations ***
dnl **************************************
AC_MSG_CHECKING([whether $LD accepts --as-needed])
case `$LD --as-needed -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
LDFLAGS="$LDFLAGS -Wl,--as-needed"
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac
AC_MSG_CHECKING([whether $LD accepts -O1])
case `$LD -O1 -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
LDFLAGS="$LDFLAGS -Wl,-O1"
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac
AC_OUTPUT([
Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
libxfce4menu/Makefile
libxfce4menu/libxfce4menu-0.1.pc
libxfce4menu/libxfce4menu-config.h
po/Makefile.in
tdb/tdbconfig.h
tdb/Makefile
tests/Makefile
])
dnl ***************************
dnl *** Print configuration ***
dnl ***************************
echo
echo "Build Configuration:"
echo
echo "* Debug Support: $enable_debug"
echo
|