-
Notifications
You must be signed in to change notification settings - Fork 9
/
configure.ac
365 lines (282 loc) · 8.38 KB
/
configure.ac
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# Process this file with GNU autoconf to produce a configure script.
#
# Use the following command to recreate build env:
# autoreconf -f -i
#
AC_INIT([GtkSheet], [3.5.1])
AC_LANG([C])
AC_CONFIG_MACRO_DIR([m4])
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS:+set}
CFLAGS=${CFLAGS:-""}
AC_DIVERT_PUSH(NOTICE)dnl
# GtkSheet versioning: before making releases, be sure to read
# https://github.com/fpaquet/gtksheet/wiki/GtkSheet-Version-Numbering
GTK_SHEET_MAJOR_VERSION=3
GTK_SHEET_MINOR_VERSION=5
GTK_SHEET_MICRO_VERSION=1
GTK_SHEET_VERSION=$GTK_SHEET_MAJOR_VERSION.$GTK_SHEET_MINOR_VERSION.$GTK_SHEET_MICRO_VERSION
GTK_SHEET_VERSION_SHORT=$GTK_SHEET_MAJOR_VERSION.$GTK_SHEET_MINOR_VERSION
AC_DIVERT_POP()dnl
AC_SUBST(GTK_SHEET_MAJOR_VERSION)
AC_SUBST(GTK_SHEET_MINOR_VERSION)
AC_SUBST(GTK_SHEET_MICRO_VERSION)
AC_SUBST(GTK_SHEET_VERSION)
AC_SUBST(GTK_SHEET_VERSION_SHORT)
# libtool versioning
LT_CURRENT=10
LT_REVISION=1
LT_AGE=0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
LIBGTKSHEET_SO_VERSION=$LT_CURRENT:$LT_REVISION:$LT_AGE
AC_SUBST(LIBGTKSHEET_SO_VERSION)
# For automake
VERSION=$GTK_SHEET_VERSION
PACKAGE=gtksheet
AC_CONFIG_AUX_DIR([build-aux])
# Initialize automake stuff
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
#AM_SILENT_RULES([yes])
# Specify a configuration file
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_DEFINE([ENABLE_NLS],1, [NLS enabled])
AC_DEFINE([HAVE_GETTEXT],1, [have gettext])
# Build time sanity check...
AM_SANITY_CHECK
# Checks for programs.
AC_PROG_CC
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# Initialize libtool
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AM_MAINTAINER_MODE
AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
;;
*)
platform_win32=no
;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
os_win32=yes
;;
*)
os_win32=no
;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
if test "$os_win32" = "yes"; then
AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
fi
AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
# --enable-debug option
AC_MSG_CHECKING([whether to enable debugging])
AC_ARG_ENABLE(debug,
AC_HELP_STRING(
[--enable-debug=[no/yes]],
[turn on debugging [default=no]]),
,
enable_debug=no)
if test "x$enable_debug" = "xyes"; then
test "$cflags_set" = set || CFLAGS="$CFLAGS -g -DDEBUG"
AC_MSG_RESULT(yes)
else
test "$cflags_set" = set || CFLAGS="$CFLAGS -O2"
AC_MSG_RESULT(no)
fi
# --enable-tests option
AC_MSG_CHECKING([whether to enable tests])
AC_ARG_ENABLE(tests,
AC_HELP_STRING(
[--enable-tests=[no/yes]],
[turn on tests [default=yes]]),
,
enable_tests=yes)
if test "x$enable_tests" = "xyes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(ENABLE_TESTS, test x$enable_tests = xyes)
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
# Compiler and Lib Stuff
# AC_PROG_CXX
# Checks for header files.
AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl header file checks
AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H, 1, [unistd.h found]))
AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H, 1, [dirent.h found]))
AC_CHECK_HEADERS([locale.h])
AC_CHECK_HEADERS([sys/time.h])
dnl Don't attempt to use fnmatch under win32 due to problems with creating DLLs.
if test "$platform_win32" = "no"; then
AC_CHECK_HEADERS(fnmatch.h, AC_DEFINE(HAVE_FNMATCH_H, 1, [fnmatch.h found]))
fi
# Checks for nonportable Functions
AC_CHECK_FUNCS([floor getcwd gethostname gettimeofday])
AC_CHECK_FUNCS([pow setlocale strstr strtol sin])
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRTOD
dnl NeXTStep cc seems to need this
AC_MSG_CHECKING([for extra flags for POSIX compliance])
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
AC_MSG_RESULT(none needed),
gtk_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -posix"
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
AC_MSG_RESULT(-posix),
AC_MSG_RESULT()
CFLAGS=$gtk_save_CFLAGS
AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
##################################################
# Checks for gtk-doc and docbook-tools
##################################################
# check for gtk-doc
GTK_DOC_CHECK(1.8)
AC_CHECK_PROG(DB2HTML, db2html, true, false)
AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
# --enable-man option
AC_MSG_CHECKING([whether to enable man pages])
AC_ARG_ENABLE(man,
AC_HELP_STRING(
[--enable-man],
[regenerate man pages from Docbook [default=no]])],
,
enable_man=no)
if test "${enable_man}" != no; then
AC_MSG_RESULT(yes)
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test -z "$XSLTPROC"; then
enable_man=no
fi
if test "$enable_man" = "no" ; then
AC_MSG_WARN([xsltproc is missing - disabling man pages])
fi
#check for DocBook DTD and stylesheets in the local catalog
JH_CHECK_XML_CATALOG(
[-//OASIS//DTD DocBook XML V4.1.2//EN],
[DocBook XML DTD V4.1.2],
,
enable_man=no)
if test "$enable_man" = "no" ; then
AC_MSG_WARN([missing DocBook DTD - disabling man pages])
fi
JH_CHECK_XML_CATALOG(
[http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
[DocBook XSL Stylesheets],
,
enable_man=no)
if test "$enable_man" = "no" ; then
AC_MSG_WARN([missing DocBook XML stylesheets - disabling man pages])
fi
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
##################################################
# Start of pkg-config checks
##################################################
PKG_PROG_PKG_CONFIG
# Find the GTK+ include and library directories.
# 4.5.10/fp - fontconfig should be implicit to pango
#PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.12.0 fontconfig])
PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.12.0])
AC_SUBST(GLIB_GENMARSHAL, `$PKG_CONFIG --variable=glib_genmarshal glib-2.0`)
# --enable-glade option
AC_MSG_CHECKING([whether to enable glade integration])
AC_ARG_ENABLE(glade,
AC_HELP_STRING(
[--enable-glade],
[build glade integration files [default=no]]),
,
enable_glade=no)
if test "x$enable_glade" != xno; then
AC_MSG_RESULT(yes)
PKG_CHECK_MODULES([GLADE], [gladeui-1.0 >= 3.6])
AC_SUBST(GLADE_CATALOG_DIR, `$PKG_CONFIG --variable=catalogdir gladeui-1.0`)
AC_SUBST(GLADE_MODULE_DIR, `$PKG_CONFIG --variable=moduledir gladeui-1.0`)
AC_SUBST(GLADE_PIXMAP_DIR, `$PKG_CONFIG --variable=pixmapdir gladeui-1.0`)
#You must define GETTEXT_PACKAGE before including gi18n-lib.h
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
[Name of the gettext package.])
AM_GLIB_GNU_GETTEXT
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(ENABLE_GLADE, test x$enable_glade != xno)
# --enable-introspection
AC_MSG_CHECKING([whether to enable gobject-introspection])
AC_ARG_ENABLE(introspection,
AC_HELP_STRING(
[--enable-introspection],
[build gobject-introspection [default=no]]),
,
enable_introspection=no)
if test "x$enable_introspection" != xno; then
AC_MSG_RESULT(yes)
GOBJECT_INTROSPECTION_CHECK([0.6.14])
else
AC_MSG_RESULT(no)
AM_CONDITIONAL(HAVE_INTROSPECTION, test 1=0)
fi
AM_CONDITIONAL(ENABLE_INTROSPECTION, test x$enable_introspection != xno)
if test "$platform_win32" = "yes"; then
AC_SUBST(libgladegtksheet_soname, [libgladegtksheet.dll])
else
AC_SUBST(libgladegtksheet_soname, [libgladegtksheet.so])
fi
AC_SUBST(gdktarget, `$PKG_CONFIG --variable=target gtk+-2.0`)
gtksheettargetlib=libgtksheet-$gdktarget-3.0.la
AC_SUBST(gtksheettargetlib)
AC_CHECK_LIB(m, sqrt)
if test "x$gdktarget" = "xwin32"; then
AM_CONDITIONAL(USE_WIN32, true)
else
AM_CONDITIONAL(USE_WIN32, false)
fi
# configure output definition
AC_CONFIG_FILES(
Makefile
glade/Makefile
glade/pixmaps/Makefile
glade/gtksheet-catalog.xml
gtksheet/Makefile
gtksheet/gtksheetfeatures.h
docs/Makefile
docs/reference/Makefile
docs/reference/gtkdocentities.ent
docs/tutorial/Makefile
gtksheet-3.0.spec
gtksheet-3.0.pc
)
AC_OUTPUT