forked from GNOME/babl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
421 lines (330 loc) · 10.9 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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.54)
# Making releases on the stable branch:
# BABL_MICRO_VERSION += 1;
# BABL_INTERFACE_AGE += 1;
# BABL_BINARY_AGE += 1;
# if any functions have been added,
# set BABL_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set BABL_BINARY_AGE _and_ BABL_INTERFACE_AGE to 0.
m4_define([babl_major_version], [0])
m4_define([babl_minor_version], [1])
m4_define([babl_micro_version], [11])
m4_define([babl_real_version],
[babl_major_version.babl_minor_version.babl_micro_version])
m4_define([babl_version], [babl_real_version])
dnl Number of releases since we've added interfaces
m4_define([babl_interface_age], [1])
m4_define([babl_binary_age],
[m4_eval(100 * babl_minor_version + babl_micro_version)])
# This is the X.Y used in -lbabl-X.Y
m4_define([babl_api_version], [babl_major_version.babl_minor_version])
m4_define([stability_version_number],
m4_if(m4_eval(babl_major_version || babl_minor_version), [0],
[babl_micro_version], [babl_minor_version]))
m4_define([babl_unstable],
m4_if(m4_eval(stability_version_number % 2), [1], [yes], [no]))
m4_define([babl_stable],
m4_if(m4_eval(stability_version_number % 2), [0], [yes], [no]))
AC_INIT(babl, babl_major_version.babl_minor_version.babl_micro_version)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR(babl/babl.h)
AC_CONFIG_MACRO_DIR([m4])
BABL_MAJOR_VERSION=babl_major_version
BABL_MINOR_VERSION=babl_minor_version
BABL_MICRO_VERSION=babl_micro_version
BABL_INTERFACE_AGE=babl_interface_age
BABL_BINARY_AGE=babl_binary_age
BABL_VERSION=babl_version
BABL_REAL_VERSION=babl_real_version
BABL_API_VERSION=babl_api_version
AC_SUBST(BABL_MAJOR_VERSION)
AC_SUBST(BABL_MINOR_VERSION)
AC_SUBST(BABL_MICRO_VERSION)
AC_SUBST(BABL_INTERFACE_AGE)
AC_SUBST(BABL_BINARY_AGE)
AC_SUBST(BABL_VERSION)
AC_SUBST(BABL_REAL_VERSION)
AC_SUBST(BABL_API_VERSION)
BABL_RELEASE=babl_api_version
AC_SUBST(BABL_RELEASE)
# GObject Introspection
GOBJECT_INTROSPECTION_CHECK([0.10])
# Vala
AC_ARG_WITH(vala, [ --without-vala build without Vala support])
have_vapigen="no"
if test "x$with_vala" != "xno"; then
AC_PATH_PROG(VAPIGEN, vapigen, no)
if test "$VAPIGEN" = "no"; then
have_vapigen="no (vapigen executable not found)"
AC_MSG_RESULT([*** Check for vapigen failed.])
else
have_vapigen="yes"
fi
fi
have_vala=$have_vapigen
AM_CONDITIONAL(HAVE_VALA, test "$have_vala" = "yes")
dnl The symbol BABL_UNSTABLE is defined above for substitution in
dnl Makefiles and conditionally defined here as a preprocessor symbol
dnl and automake conditional.
BABL_UNSTABLE=babl_unstable
if test "x$BABL_UNSTABLE" = "xyes"; then
AC_DEFINE(BABL_UNSTABLE, 1,
[Define to 1 if this is an unstable version of BABL])
fi
AM_CONDITIONAL(BABL_UNSTABLE, test "x$BABL_UNSTABLE" = "xyes")
AC_SUBST(BABL_UNSTABLE)
# libtool versioning
m4_define([lt_current], [m4_eval(100 * babl_minor_version + babl_micro_version - babl_interface_age)])
m4_define([lt_revision], [babl_interface_age])
m4_define([lt_age], [m4_eval(babl_binary_age - babl_interface_age)])
BABL_LIBRARY_VERSION="lt_current:lt_revision:lt_age"
BABL_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
AC_SUBST(BABL_LIBRARY_VERSION)
AC_SUBST(BABL_CURRENT_MINUS_AGE)
dnl ==========================================================================
AM_INIT_AUTOMAKE([1.11 foreign no-define dist-bzip2 no-dist-gzip -Wno-portability])
# Enable silent build rules by default, requires at least
# Automake-1.11. Disable by either passing --disable-silent-rules to
# configure or passing V=1 to make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
BABL_VARIADIC_MACROS
# Check for programs
AC_PROG_CC
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static win32-dll])
dnl Initialize maintainer mode
AM_MAINTAINER_MODE([enable])
AC_HEADER_STDC
AM_SANITY_CHECK
WEBSITE_HOST=pippin.gimp.org
AC_SUBST(WEBSITE_HOST)
WEBSITE_LOCATION=public_html/babl/
AC_SUBST(WEBSITE_LOCATION)
if eval "test x$GCC = xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
BABL_DETECT_CFLAGS(extra_warnings, '-Wdeclaration-after-statement')
CFLAGS="$CFLAGS $extra_warnings"
BABL_DETECT_CFLAGS(extra_warnings, '-Wmissing-prototypes')
CFLAGS="$CFLAGS $extra_warnings"
BABL_DETECT_CFLAGS(extra_warnings, '-Wmissing-declarations')
CFLAGS="$CFLAGS $extra_warnings"
BABL_DETECT_CFLAGS(extra_warnings, '-Winit-self')
CFLAGS="$CFLAGS $extra_warnings"
BABL_DETECT_CFLAGS(extra_warnings, '-Wpointer-arith')
CFLAGS="$CFLAGS $extra_warnings"
BABL_DETECT_CFLAGS(extra_warnings, '-Wold-style-definition')
CFLAGS="$CFLAGS $extra_warnings"
fi
AC_PATH_PROG(RSVG, rsvg, no)
AM_CONDITIONAL(HAVE_RSVG, test "x$RSVG" != "xno")
AC_PATH_PROG(W3M, w3m, no)
AM_CONDITIONAL(HAVE_W3M, test "x$W3M" != "xno")
###########################
# Check target architecture
###########################
AC_MSG_CHECKING([for target architecture])
case x"$target" in
xNONE | x)
target_or_host="$host" ;;
*)
target_or_host="$target" ;;
esac
AC_MSG_RESULT([$target_or_host])
case "$target_or_host" in
i*86-*-*)
have_x86=yes
AC_DEFINE(ARCH_X86, 1, [Define to 1 if you are compiling for ix86.])
;;
x86_64-*-*)
have_x86=yes
AC_DEFINE(ARCH_X86, 1, [Define to 1 if you are compiling for ix86.])
AC_DEFINE(ARCH_X86_64, 1, [Define to 1 if you are compiling for amd64.])
;;
ppc-*-* | powerpc-*)
have_ppc=yes
AC_DEFINE(ARCH_PPC, 1, [Define to 1 if you are compiling for PowerPC.])
;;
ppc64-*-* | powerpc64-*)
have_ppc=yes
AC_DEFINE(ARCH_PPC, 1, [Define to 1 if you are compiling for PowerPC.])
AC_DEFINE(ARCH_PPC64, 1, [Define to 1 if you are compiling for PowerPC64.])
;;
*)
;;
esac
############################
# Check how to find plug-ins
############################
AC_MSG_CHECKING([for some Win32 platform])
case "$target_or_host" in
hppa*-hpux*) # HP/UX
shrext=.sl
;;
*-*-mingw* | *-*-cygwin*) # windows
shrext=.dll
;;
*) # linux (and BSD?)
shrext=.so
;;
esac
SHREXT=$shrext
AC_SUBST(SHREXT)
AC_DEFINE_UNQUOTED(SHREXT, "$shrext", [File extension for shared libraries])
dnl ===========================================================================
#################
# Check for Win32
#################
AC_MSG_CHECKING([for some Win32 platform])
case "$target_or_host" in
*-*-mingw* | *-*-cygwin*)
platform_win32=yes
;;
*)
platform_win32=no
;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
MATH_LIB=-lm
AC_MSG_CHECKING([for native Win32])
case "$target_or_host" in
*-*-mingw*)
os_win32=yes
PATH_SEP=';'
DIR_SEP='\\'
MATH_LIB=
;;
*)
os_win32=no
PATH_SEP=':'
DIR_SEP='/'
;;
esac
AC_MSG_RESULT([$os_win32])
AC_SUBST(PATH_SEP)
AC_SUBST(DIR_SEP)
AC_SUBST(MATH_LIB)
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
dnl ===========================================================================
########################
# Check for MMX assembly
########################
AC_ARG_ENABLE(mmx,
[ --enable-mmx enable MMX support (default=auto)],,
enable_mmx=$have_x86)
AC_ARG_ENABLE(sse,
[ --enable-sse enable SSE support (default=auto)],,
enable_sse=$enable_mmx)
if test "x$enable_mmx" = xyes; then
BABL_DETECT_CFLAGS(MMX_EXTRA_CFLAGS, '-mmmx')
SSE_EXTRA_CFLAGS=
AC_MSG_CHECKING(whether we can compile MMX code)
mmx_save_CFLAGS="$CFLAGS"
CFLAGS="$mmx_save_CFLAGS $MMX_EXTRA_CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[asm ("movq 0, %mm0");])],
AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.])
AC_MSG_RESULT(yes)
if test "x$enable_sse" = xyes; then
BABL_DETECT_CFLAGS(sse_flag, '-msse')
SSE_EXTRA_CFLAGS="$MMX_EXTRA_CFLAGS $sse_flag"
AC_MSG_CHECKING(whether we can compile SSE code)
CFLAGS="$CFLAGS $sse_flag"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[asm ("movntps %xmm0, 0");])],
AC_DEFINE(USE_SSE, 1, [Define to 1 if SSE assembly is available.])
AC_MSG_RESULT(yes)
,
enable_sse=no
AC_MSG_RESULT(no)
AC_MSG_WARN([The assembler does not support the SSE command set.])
)
fi
,
enable_mmx=no
AC_MSG_RESULT(no)
AC_MSG_WARN([The assembler does not support the MMX command set.])
)
CFLAGS="$mmx_save_CFLAGS"
AC_SUBST(MMX_EXTRA_CFLAGS)
AC_SUBST(SSE_EXTRA_CFLAGS)
fi
############################
# Check for AltiVec assembly
############################
AC_ARG_ENABLE(altivec,
[ --enable-altivec enable AltiVec support (default=auto)],,
enable_altivec=$have_ppc)
if test "x$enable_altivec" = xyes; then
BABL_DETECT_CFLAGS(altivec_flag, '-faltivec' '-maltivec -mabi=altivec')
ALTIVEC_EXTRA_CFLAGS=
case "$altivec_flag" in
-maltivec*)
altivec_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$altivec_save_CPPFLAGS $altivec_flag"
AC_CHECK_HEADERS(altivec.h, [ALTIVEC_EXTRA_CFLAGS="$altivec_flag"])
CPPFLAGS="$altivec_save_CPPFLAGS"
;;
*)
ALTIVEC_EXTRA_CFLAGS="$altivec_flag"
;;
esac
AC_SUBST(ALTIVEC_EXTRA_CFLAGS)
AC_MSG_CHECKING(whether we can compile AltiVec code)
can_use_altivec=no
if test -z "$ALTIVEC_EXTRA_CFLAGS"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([The compiler does not support the AltiVec command set.])
else
case "$target_or_host" in
*-*-darwin*)
can_use_altivec=yes
AC_DEFINE(HAVE_ALTIVEC_SYSCTL, 1,
[Define to 1 if the altivec runtime test should use a sysctl.])
;;
*)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[asm ("vand %v0, %v0, %v0");])],
can_use_altivec=yes, can_use_altivec=no)
;;
esac
AC_MSG_RESULT($can_use_altivec)
if test "x$can_use_altivec" = "xyes"; then
AC_DEFINE(USE_ALTIVEC, 1, [Define to 1 if AltiVec support is available.])
else
enable_altivec=no
AC_MSG_WARN([The assembler does not support the AltiVec command set.])
fi
fi
enable_altivec="$can_use_altivec"
fi
dnl ===========================================================================
AC_CHECK_HEADERS(dl.h)
AC_SEARCH_LIBS([dlopen], [dl])
AC_SEARCH_LIBS([rint], [m])
AC_REPLACE_FUNCS(gettimeofday)
AC_CHECK_FUNCS(rint)
#BABL_PATH_SEPARATOR must be defined as a character.
#BABL_DIR_SEPARATOR must be defined as a string.
AC_DEFINE_UNQUOTED(BABL_PATH_SEPARATOR, '$PATH_SEP', [separator between paths in BABL_PATH])
AC_DEFINE_UNQUOTED(BABL_DIR_SEPARATOR, "$DIR_SEP", [separator between directories in BABL_PATH])
AC_DEFINE_UNQUOTED(BABL_LIBRARY, "$PACKAGE_NAME-$BABL_API_VERSION", [name of BABL library])
dnl ===========================================================================
AC_CONFIG_FILES(
Makefile
babl.pc
babl/Makefile
babl/babl-version.h
babl/base/Makefile
docs/Makefile
docs/index-static.html
docs/graphics/Makefile
tests/Makefile
extensions/Makefile
INSTALL
)
AC_OUTPUT