-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfigure.ac
481 lines (364 loc) · 14.1 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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
dnl
dnl configure.ac -- configuration script;
dnl
dnl Copyright (C) 2016, 2017 Bruno Félix Rezende Ribeiro <oitofelix@gnu.org>
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation, either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
dnl
##################
# Initialization #
##################
# Release definitions;
AC_INIT([MININIM], m4_esyscmd_s([date -u +%y%m%d]),
[oitofelix@gnu.org], [mininim],
[http://oitofelix.freeshell.org/mininim/])
AC_SUBST([PACKAGE_MAILING_LIST], [])
AC_DEFINE_UNQUOTED([PACKAGE_MAILING_LIST], ["$PACKAGE_MAILING_LIST"],
[Help and support mailing list])
AC_DEFINE(PACKAGE_TRANSLATION_BUGREPORT,
["http://translationproject.org/team/"], [Translation bugs reporting address])
AC_DEFINE(PACKAGE_COPYRIGHT_HOLDER, ["Bruno Félix Rezende Ribeiro"],
[Copyright holder's name])
# GNU Autoconf settings;
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux])
AC_PREREQ(2.60)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/mininim.c])
# GNU Automake settings;
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])
dnl AM_EXTRA_RECURSIVE_TARGETS([homepage install-man])
dnl AM_GNU_GETTEXT_VERSION([0.18.1])
dnl AM_GNU_GETTEXT([external])
# Decide whether you are configuring from VCS.
AS_IF([[test -d "$srcdir"/.git]], [[VCS=y]], [[VCS=n]])
AC_SUBST([VCS])
# Compute the canonical build-system variables.
AC_CANONICAL_BUILD
# Debug option
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Turn on debugging])],
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],[debug=false])
AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
AS_IF([[test x$debug != xtrue]],
[AC_DEFINE([NDEBUG], [1], [Define to 1 to disable assert macro.])],
dnl [debug_suffix=-debug]
)
# Optimizations option
AC_ARG_ENABLE([optimizations],
[AS_HELP_STRING([--enable-optimizations],[Turn on optimizations])],
[case "${enableval}" in
yes) optimizations=true ;;
no) optimizations=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-optimizations]) ;;
esac],[optimizations=false])
AM_CONDITIONAL([OPTIMIZATIONS], [test x$optimizations = xtrue])
# Profiling option
AC_ARG_ENABLE([profiling],
[AS_HELP_STRING([--enable-profiling], [Turn on profiling])],
[case "${enableval}" in
yes) profiling=true ;;
no) profiling=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-profiling]) ;;
esac],[profiling=false])
AM_CONDITIONAL([PROFILING], [test x$profiling = xtrue])
# Automake conditional for platform specific builds
AM_CONDITIONAL([mingw_build], [expr "x$host_os" : "xmingw"])
################################
# Programs Search and Checking #
################################
# Check for `mkdir'.
AC_PROG_MKDIR_P
# Check for `ln'.
AC_PROG_LN_S
# Check for `grep'.
AC_PROG_GREP
# Check for `sed'.
AC_PROG_SED
# Check for `cc'.
AC_PROG_CC
# GNUlib;
gl_EARLY
gl_INIT
##########
### Check for Allegro library
######
allegro_minver=5.0.9
AS_CASE([$host],
# MinGW
[*-*-mingw*],
# Joystick in MinGW crashes for Allegro non-debug builds
[debug_suffix=-debug]
[ALLEGRO_CFLAGS=""
ALLEGRO_LIBS="-lallegro${debug_suffix}"
ALLEGRO_IMAGE_CFLAGS="${ALLEGRO_CFLAGS}"
ALLEGRO_IMAGE_LIBS="-lallegro_image${debug_suffix} ${ALLEGRO_LIBS}"
ALLEGRO_AUDIO_CFLAGS="${ALLEGRO_CFLAGS}"
ALLEGRO_AUDIO_LIBS="-lallegro_audio${debug_suffix} ${ALLEGRO_LIBS}"
ALLEGRO_ACODEC_CFLAGS="${ALLEGRO_CFLAGS}"
ALLEGRO_ACODEC_LIBS="-lallegro_acodec${debug_suffix} ${ALLEGRO_AUDIO_LIBS}"
ALLEGRO_FONT_CFLAGS="${ALLEGRO_CFLAGS}"
ALLEGRO_FONT_LIBS="-lallegro_font${debug_suffix} ${ALLEGRO_LIBS}"
ALLEGRO_PRIMITIVES_CFLAGS="${ALLEGRO_CFLAGS}"
ALLEGRO_PRIMITIVES_LIBS="-lallegro_primitives${debug_suffix} ${ALLEGRO_LIBS}"
ALLEGRO_DIALOG_CFLAGS="${ALLEGRO_CFLAGS}"
ALLEGRO_DIALOG_LIBS="-lallegro_dialog${debug_suffix} ${ALLEGRO_LIBS}"
ALLEGRO_COLOR_CFLAGS="${ALLEGRO_CFLAGS}"
ALLEGRO_COLOR_LIBS="-lallegro_color${debug_suffix} ${ALLEGRO_LIBS}"
mingw_ldadd="-lFLAC \
-lfreetype \
-lvorbisfile \
-lvorbis \
-logg \
-lz \
-lgdiplus \
-luuid \
-lkernel32 \
-lwinmm \
-lpsapi \
-lopengl32 \
-lglu32 \
-luser32 \
-lcomdlg32 \
-lgdi32 \
-lshell32 \
-lole32 \
-ladvapi32 \
-lws2_32 \
-lshlwapi \
-lstdc++"],
# Default
[PKG_CHECK_MODULES([ALLEGRO],
[allegro${debug_suffix}-5 >= $allegro_minver],,
[PKG_CHECK_MODULES([ALLEGRO],
[allegro${debug_suffix}-5.0 >= $allegro_minver],,
AC_MSG_ERROR([MININIM requires Allegro $allegro_minver (or superior)]))])
PKG_CHECK_MODULES([ALLEGRO_IMAGE],
[allegro_image${debug_suffix}-5 >= $allegro_minver],,
[PKG_CHECK_MODULES([ALLEGRO_IMAGE],
[allegro_image${debug_suffix}-5.0 >= $allegro_minver],,
AC_MSG_ERROR([MININIM requires Allegro $allegro_minver (or superior) image addon]))])
PKG_CHECK_MODULES([ALLEGRO_AUDIO],
[allegro_audio${debug_suffix}-5 >= $allegro_minver],,
[PKG_CHECK_MODULES([ALLEGRO_AUDIO],
[allegro_audio${debug_suffix}-5.0 >= $allegro_minver],,
AC_MSG_ERROR([MININIM requires Allegro $allegro_minver (or superior) audio addon]))])
PKG_CHECK_MODULES([ALLEGRO_ACODEC],
[allegro_acodec${debug_suffix}-5 >= $allegro_minver],,
[PKG_CHECK_MODULES([ALLEGRO_ACODEC],
[allegro_acodec${debug_suffix}-5.0 >= $allegro_minver],,
AC_MSG_ERROR([MININIM requires Allegro $allegro_minver (or superior) audio codecs addon]))])
PKG_CHECK_MODULES([ALLEGRO_FONT],
[allegro_font${debug_suffix}-5 >= $allegro_minver],,
[PKG_CHECK_MODULES([ALLEGRO_FONT],
[allegro_font${debug_suffix}-5.0 >= $allegro_minver],,
AC_MSG_ERROR([MININIM requires Allegro $allegro_minver (or superior) font addon]))])
PKG_CHECK_MODULES([ALLEGRO_PRIMITIVES],
[allegro_primitives${debug_suffix}-5 >= $allegro_minver],,
[PKG_CHECK_MODULES([ALLEGRO_PRIMITIVES],
[allegro_primitives${debug_suffix}-5.0 >= $allegro_minver],,
AC_MSG_ERROR([MININIM requires Allegro $allegro_minver (or superior) primitives addon]))])
PKG_CHECK_MODULES([ALLEGRO_MAIN],
[allegro_main${debug_suffix}-5 >= $allegro_minver],,
[PKG_CHECK_MODULES([ALLEGRO_MAIN],
[allegro_main${debug_suffix}-5.0 >= $allegro_minver],,
AC_MSG_ERROR([MININIM requires Allegro $allegro_minver (or superior) main addon]))])
PKG_CHECK_MODULES([ALLEGRO_DIALOG],
[allegro_dialog${debug_suffix}-5 >= $allegro_minver],,
[PKG_CHECK_MODULES([ALLEGRO_DIALOG],
[allegro_dialog${debug_suffix}-5.0 >= $allegro_minver],,
AC_MSG_ERROR([MININIM requires Allegro $allegro_minver (or superior) dialogs addon]))])
PKG_CHECK_MODULES([ALLEGRO_COLOR],
[allegro_color${debug_suffix}-5 >= $allegro_minver],,
[PKG_CHECK_MODULES([ALLEGRO_COLOR],
[allegro_color${debug_suffix}-5.0 >= $allegro_minver],,
AC_MSG_ERROR([MININIM requires Allegro $allegro_minver (or superior) colors addon]))])
])
AC_SUBST([ALLEGRO_CFLAGS])
AC_SUBST([ALLEGRO_LIBS])
AC_SUBST([ALLEGRO_IMAGE_CFLAGS])
AC_SUBST([ALLEGRO_IMAGE_LIBS])
AC_SUBST([ALLEGRO_AUDIO_CFLAGS])
AC_SUBST([ALLEGRO_AUDIO_LIBS])
AC_SUBST([ALLEGRO_ACODEC_CFLAGS])
AC_SUBST([ALLEGRO_ACODEC_LIBS])
AC_SUBST([ALLEGRO_FONT_CFLAGS])
AC_SUBST([ALLEGRO_FONT_LIBS])
AC_SUBST([ALLEGRO_PRIMITIVES_CFLAGS])
AC_SUBST([ALLEGRO_PRIMITIVES_LIBS])
AC_SUBST([ALLEGRO_MAIN_CFLAGS])
AC_SUBST([ALLEGRO_MAIN_LIBS])
AC_SUBST([ALLEGRO_DIALOG_CFLAGS])
AC_SUBST([ALLEGRO_DIALOG_LIBS])
AC_SUBST([ALLEGRO_COLOR_CFLAGS])
AC_SUBST([ALLEGRO_COLOR_LIBS])
AC_SUBST([mingw_ldadd])
##########
### Check for Lua
######
AX_PROG_LUA([5.0], [5.1], [],
AC_MSG_ERROR([MININIM requires Lua 5.0 (or superior)]))
AX_LUA_HEADERS(, AC_MSG_ERROR([MININIM requires Lua headers]))
AX_LUA_LIBS(, AC_MSG_ERROR([MININIM requires Lua libraries]))
AX_LUA_READLINE(, AC_MSG_ERROR([MININIM requires GNU Readline]))
##########
### Check for programs needed to build documentation.
######
AC_MSG_NOTICE([checking programs needed in order to build documentation])
### Declare `MAKEINFO' as a precious variable.
AC_ARG_VAR([MAKEINFO], [Texinfo `makeinfo' program])
### Check for `makeinfo'.
AC_PATH_PROG([MAKEINFO], [makeinfo])
AM_CONDITIONAL([MAKEINFO], [test x$MAKEINFO != x])
# Check for GNU Texinfo program `makeinfo'.
### Define GNU Texinfo minimal version.
m4_define([TEXINFO_MINVER], 5.1)
# If GNU Texinfo was not found and you are not building from a VCS
# checkout, warn the user about what the lack of that optional
# dependence means.
AS_IF([[test x$MAKEINFO = x]],
AC_MSG_WARN(
[[GNU Texinfo not found. It is required at least version ]]TEXINFO_MINVER.
[[You can find it at https://gnu.org/software/texinfo/.]]
[[It will not be possible to rebuild the Info documentation
nor generate any other documentation format.]]))
### If `makeinfo' was found, test whether its version is at least
### TEXINFO_MINVER.
AS_IF([[test x$MAKEINFO != x]],
# Put `makeinfo' version in variable `texinfo_version'.
[[texinfo_version=`$MAKEINFO --version |
$SED -n '1s/^.* \(@<:@@<:@:digit:@:>@.@:>@*\)$/\1/p'`]]
# If `makeinfo' version is less than TEXINFO_VER, print an error
# message and abort when building from VCS checkout or warn the user
# otherwise.
AS_VERSION_COMPARE([[$texinfo_version]], TEXINFO_MINVER,
[AC_MSG_WARN(
[[GNU Texinfo is too old. It is required at least version ]]TEXINFO_MINVER.
[[You can find it at https://gnu.org/software/texinfo/.]]
[[It will not be possible to rebuild the Info documentation
nor generate any other documentation format.]])]))
AM_MISSING_PROG([MAKEINFO], [makeinfo])
### Declare `HELP2MAN' as a precious variable.
AC_ARG_VAR([HELP2MAN], ['help2man' program])
### Check for `help2man'.
AC_PATH_PROG([HELP2MAN], [help2man])
AM_CONDITIONAL([HELP2MAN], [test x$HELP2MAN != x])
# Check for GNU help2man existence. If not building from a VCS
# checkout, it is not required.
AS_IF([[test x$HELP2MAN = x]],
AC_MSG_WARN(
[[GNU help2man not found. You can get it at https://gnu.org/software/help2man/.]]))
# Check for GNU help2man existence. It should only be used if not
# cross-compiling.
AS_IF([[test $cross_compiling = no]],
[AM_MISSING_PROG([HELP2MAN], [help2man])], HELP2MAN=:)
# rsync is needed to fetch PO files from 'translationproject.org'.
AM_MISSING_PROG([RSYNC], [rsync])
####################
# Meta-information #
####################
AC_MSG_NOTICE([[Checking meta-information]])
dnl AC_MSG_CHECKING([available translations])
dnl AC_SUBST([LINGUAS], $(echo $(ls $srcdir/po/*.po | $GREP -v quot |
dnl $SED 's,^.*po/\(.*\)\.po$,\1,')))
dnl AC_MSG_RESULT([$LINGUAS])
AS_IF([test x$VCS = xy],
AC_MSG_CHECKING([release date])
AC_SUBST([RELEASE_DATE], $(LINGUA=C LANG=C date '+%B %d, %Y'))
AC_MSG_RESULT([$RELEASE_DATE])
AC_MSG_CHECKING([Autoconf version])
AC_SUBST([AUTOCONF_VERSION], m4_defn([AC_AUTOCONF_VERSION]))
AC_MSG_RESULT([$AUTOCONF_VERSION])
AC_MSG_CHECKING([Automake version])
AC_SUBST([AUTOMAKE_VERSION], `automake --version |
$SED -n 's/^automake.* \(@<:@@<:@:digit:@:>@.@:>@*\)$/\1/p'`)
AC_MSG_RESULT([$AUTOMAKE_VERSION])
AC_MSG_CHECKING([Texinfo version])
AC_SUBST([TEXINFO_VERSION], `$MAKEINFO --version |
$SED -n '1s/^.* \(@<:@@<:@:digit:@:>@.@:>@*\)$/\1/p'`)
AC_MSG_RESULT([$TEXINFO_VERSION]))
################
# Output Files #
################
# Output files;
dnl po/Makefile.in
dnl po/LINGUAS
dnl doc/Doxyfile
dnl src/Makefile
AC_CONFIG_FILES(
[Makefile
doc/Makefile
doc/man/Makefile
doc/release/release.texi
gnulib/Makefile])
AC_OUTPUT
###########################
# Help about Make targets #
###########################
AS_ECHO("")
AS_BOX([[GNU Make Targets Table]])
AS_ECHO("")
AS_ECHO("")
AS_ECHO(["\
Build:
all Compile entire program.
info, html, pdf, ps, dvi
Build documentation in the respective format.
doxygen-doc Build source-code documentation.
check Run test suite.
tags, ctags
Build respective tags table file.
Installation:
install-exec Install architecture-dependent files.
install-data Install architecture-independent files.
install Same as \`install-exec' followed by \`install-data'.
install-strip Same as \`install' but strip executables.
install-{info,html,pdf,ps,dvi}
Install documentation in the respective format.
install-man Install man pages.
installdirs Create the installation directory tree.
installcheck Perform installation tests.
uninstall Delete installed files.
Cleaning:
mostlyclean Delete files that \`make' built and usually
one would like to rebuild.
clean Same as \`mostlyclean' but delete also
any file \`make' built but was ignored by
\`mostlyclean'.
distclean Same as \`clean' but delete also files
generated by the configuration script.
maintainer-clean Same as \`distclean' but delete also
files maintainers built.
Distribution:
distdir Create distribution directory.
dist Same as \`distdir' but package the distribution
directory into a tarball.
distcheck Same as \`dist' but also check generated
tarball for correctness.
Maintenance:
These can only be made from VCS checkouts.
homepage Generate package's homepage.
distgnu Same as \`distcheck' but also sign and upload the
resulting tarball to the GNU ftp site.
announcegnu Send release announcement to 'info-gnu@gnu.org',
'$PACKAGE_MAILING_LIST' and
'coordinator@translationproject.org'
fetchpo Fetch the latest PO translation files from the
Translation Project.
"])