-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.ac
632 lines (566 loc) · 21.4 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
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
dnl Process this file with autoconf to produce a configure script.
AC_INIT([mjpegtools],[2.0.1],[[email protected]])
AC_PREREQ(2.57)
AC_CONFIG_SRCDIR([lavtools/lav_io.c])
MJPEG_MAJOR_VERSION=2
MJPEG_MINOR_VERSION=0
MJPEG_MICRO_VERSION=1
MJPEG_VERSION=$MJPEG_MAJOR_VERSION.$MJPEG_MINOR_VERSION.$MJPEG_MICRO_VERSION
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.7])
AM_MAINTAINER_MODE
# libtool versioning
LT_RELEASE=$MJPEG_MAJOR_VERSION.$MJPEG_MINOR_VERSION
LT_CURRENT=$MJPEG_MICRO_VERSION
LT_REVISION=$MJPEG_MICRO_VERSION
LT_AGE=$MJPEG_MICRO_VERSION
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_STATIC)
dnl **********************************************************************
dnl Options
AC_ARG_ENABLE(compile-warnings,
AC_HELP_STRING([--enable-compile-warnings],
[Turn on compiler warnings.]))
AC_ARG_ENABLE(warnings_as_errors,
AC_HELP_STRING([--enable-warnings_as_errors],
[Compiler warnings are errors.]))
AC_ARG_ENABLE(static-build,
AC_HELP_STRING([--enable-static-build],
[Force static linkage instead of shared libraries (useful for profiling etc).]))
AC_ARG_ENABLE(simd-accel,
AC_HELP_STRING([--enable-simd-accel],
[use SIMD multimedia instructions
(MMX, AltiVec, etc.) if possible]))
AC_ARG_WITH(extra-cflags,
AC_HELP_STRING([--with-extra-cflags=flags],
[Options to be added to CFLAGS (optional)]))
AC_ARG_WITH(libquicktime,
AC_HELP_STRING([--without-libquicktime],
[Do not use libquicktime.]),
[], [with_libquicktime=yes])
AC_ARG_WITH(libdv,
AC_HELP_STRING([--without-libdv], [Do not use libdv.]),
[], [with_libdv=yes])
AC_ARG_WITH(libpng,
AC_HELP_STRING([--without-libpng], [Do not use libpng.]),
[], [with_libpng=yes])
AC_ARG_WITH(dga,
AC_HELP_STRING([--without-dga], [Do not use dga.]),
[], [with_dga=yes])
AC_ARG_WITH(gtk,
AC_HELP_STRING([--without-gtk], [Do not use gtk.]),
[], [with_gtk=yes])
AC_ARG_WITH(libsdl,
AC_HELP_STRING([--without-libsdl], [Do not use libsdl.]),
[], [with_libsdl=yes])
AC_ARG_WITH(sdlgfx,
AC_HELP_STRING([--without-sdlgfx], [Do not use sdlgfx.]),
[], [with_sdlgfx=yes])
AC_GNU_SOURCE
dnl Initialize libtool
AC_PROG_LIBTOOL
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
# automake 1.9 could use AM_PROG_STDC but 1.10 became picky and needs CC_C_0
AM_PROG_CC_C_O
# AM_PROG_CC_STDC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_SYS_LARGEFILE
dnl configure AS and ASFLAGS...
AM_PROG_AS
if test x"$with_extra_cflags" != "x"; then
CFLAGS="$CFLAGS $with_extra_cflags"
CXXFLAGS="$CXXFLAGS $with_extra_cflags"
CCASFLAGS="$CCASFLAGS $with_extra_cflags"
fi
AC_CHECK_HEADERS([stdint.h inttypes.h sys/types.h getopt.h malloc.h sys/soundcard.h])
#maddog: check for math lib, and add it to LIBS (needed for fmax, lround...)
#maddog: (How does this interact with cpml stuff below???????)
AC_CHECK_LIB([m],[sin])
AC_CHECK_FUNCS([posix_memalign memalign fmax fmin lround])
AC_CHECK_FUNC(getopt_long,
[AC_DEFINE(HAVE_GETOPT_LONG, 1, [long getopt support])],
[ # FreeBSD and BSD/OS have a gnugetopt library for this:
AC_CHECK_LIB([gnugetopt], [getopt_long],
[AC_DEFINE(HAVE_GETOPT_LONG, 1,
[long getopt support])
LIBGETOPT_LIB="-lgnugetopt"])
])
AC_SUBST(LIBGETOPT_LIB)
AC_TYPE_SIGNAL
AC_MSG_NOTICE([The host is $host $host_cpu $host_vendor $host_os .])
dnl test for alpha architecture, and Compaq Math Library (cpml) -- much faster
dnl than GNU libm on this arch.
LIBM_LIBS="-lm "
AC_SUBST(LIBM_LIBS)
AC_MSG_CHECKING([for alpha architecture])
case $host in
alpha*-*-linux-*)
AC_MSG_RESULT([yes])
AC_CHECK_LIB(cpml, asin,
[ LIBM_LIBS="-lcpml"
have_cpml=true ],,)
;;
*)
AC_MSG_RESULT([no])
;;
esac
dnl *********************************************************************
dnl Some host-specific tweaks:
dnl o OS-X/Darwin needs "-no-cpp-precomp" to avoid compile errors.
dnl o (e.g) Cygwin shared libs cannot have undefined symbols, libtool only
dnl builds them if really given flag to force this (see ltmain.sh)
dnl This also requires inter-library dependency to be indicated in _LIBADD;
dnl (probably good libtool practice in any case) to have all symbols satisfied
dnl o Linux handles with or without this flag, but at least on OS-X/Darwin
dnl altivec (utils) can cause circular library dependency (with mpeg2enc),
dnl so better limit this flag
dnl *********************************************************************
case $host in
*-apple-darwin*)
CFLAGS="$CFLAGS -no-cpp-precomp"
;;
*-unknown-netbsdelf2.*)
LIBS="-lossaudio"
;;
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) EXTRA_LDFLAGS="-no-undefined"
;;
esac
AC_SUBST(EXTRA_LDFLAGS)
dnl *********************************************************************
dnl Test whether we're linux or not. If so, define HAVE_V4L and build the
dnl video4linux/hardware dependent tools. Else, undefine HAVE_V4L
have_video4linux=false
AC_ARG_WITH([v4l], AC_HELP_STRING([--without-v4l], [Disable v4l1 API]))
AS_IF([test "x$with_v4l" != "xno"], [
case $host in
*-*-linux*)
AC_CHECK_HEADER(linux/videodev.h,
[have_video4linux=true
AC_DEFINE(HAVE_V4L, 1,
[Building for Linux - using the video4linux API])], [])
;;
esac])
AS_IF([test "x$have_video4linux" != "xtrue" && test "x$with_v4l" != "xno"],
[have_video4linux=false
AC_MSG_WARN([videodev.h not found - please install the linux kernel headers programms needing v4l disabled])])
AM_CONDITIONAL(HAVE_V4L, test x$have_video4linux = xtrue)
dnl *********************************************************************
dnl Figure out how to build with POSIX threads.
dnl (Creates PTHREAD_LIBS, PTHREAD_CFLAGS, PTHREAD_CC,
dnl and defines HAVE_PTHREAD.)
dnl *********************************************************************
ACX_PTHREAD
dnl maddog: The following matches the original pthread-checking behavior
dnl in this script, i.e. "If a CFLAG is necessary, use it for
dnl *everything*." Hopefully, any CFLAGs will eventually go away.
dnl The other option is to stick PTHREAD_CFLAGS/CC in Makefile.am....
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
oldLIBS="$LIBS"
LIBS="$LIBS $PTHREAD_LIBS"
AC_CHECK_FUNC(pthread_attr_getstacksize,
[AC_DEFINE(HAVE_PTHREADSTACKSIZE, 1,
[pthread stack sizes accesible])])
LIBS="$oldLIBS"
AC_CHECK_LIB(jpeg, jpeg_start_compress,
[ JPEG_LIBS="-ljpeg"
JPEG_CFLAGS=""
have_libjpeg=true ],,)
if test x$have_libjpeg != "xtrue"; then
AC_MSG_ERROR([JPEG 6b library missing - Go to http://www.ijg.org/])
fi
AC_SUBST(JPEG_LIBS)
AC_SUBST(JPEG_CFLAGS)
PKG_PROG_PKG_CONFIG
have_libquicktime=false
if test x$with_libquicktime != xno ; then
PKG_CHECK_MODULES(LIBQUICKTIME, [libquicktime > 0.9.7],
[have_libquicktime=true
AC_DEFINE(HAVE_LIBQUICKTIME, 1, [libquicktime > 0.9.7 present])],
[have_libquicktime=false])
fi
AM_CONDITIONAL(HAVE_LIBQUICKTIME, test x$have_libquicktime = xtrue)
dnl *********************************************************************
dnl Check for PNG library
dnl (creates LIBPNG_CFLAGS, LIBPNG_LIBS)
dnl *********************************************************************
have_libpng=false
if test x$with_libpng != xno ; then
PKG_CHECK_MODULES(LIBPNG, [libpng], [have_libpng=true], [have_libpng=false])
if test x$have_libpng = xfalse ; then
PKG_CHECK_MODULES(LIBPNG, [libpng12], [have_libpng=true], [have_libpng=false])
fi
fi
AM_CONDITIONAL(HAVE_LIBPNG, test x$have_libpng = xtrue)
dnl *********************************************************************
dnl Check for libdv
dnl (creates LIBDV_CFLAGS, LIBDV_LIBS; defines HAVE_LIBDV)
dnl *********************************************************************
have_libdv=false
if test x$with_libdv != xno ; then
PKG_CHECK_MODULES(LIBDV, [libdv >= 0.9],
[have_libdv=true
AC_DEFINE(HAVE_LIBDV, 1, [libdv is present])],
[have_libdv=false])
fi
dnl *********************************************************************
dnl Look for X Window System.
dnl (creates X_CFLAGS, X_PRE_LIBS, X_EXTRA_LIBS, X_LIBS;
dnl defines X_DISPLAY_MISSING if no X)
dnl *********************************************************************
AC_PATH_XTRA
dnl ********************************************************************
dnl Check to see if __progname is provided by the system
dnl ********************************************************************
AC_CACHE_CHECK([for __progname],
[mjt_cv_extern___progname],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
[[extern char *__progname;
puts(__progname);]])],
[mjt_cv_extern___progname=yes],
[mjt_cv_extern___progname=no])])
if test x$mjt_cv_extern___progname = xyes ; then
AC_DEFINE(HAVE___PROGNAME, 1, [Is __progname defined by system?])
fi
dnl ********************************************************************
dnl Check for DGA (for v4l-conf)
dnl ********************************************************************
have_dga=false
if test x$with_dga != xno ; then
AC_SUBST(V4LCONF_LIBS)
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
V4LCONF_LIBS="$X_LIBS -lXxf86dga"
have_dga="true"
AC_DEFINE(HAVE_LIBXXF86DGA,1, [libxf86dga is present]),
have_dga="false",
$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS)
fi
AM_CONDITIONAL(HAVE_LIBXXF86DGA, test x$have_dga = xtrue)
dnl ********************************************************************
dnl Check for Gtk+/glib (for glav). 2.4.0 or greater required (should
dnl not be a problem on recent distributions).
dnl (defines GTK_CFLAGS and GTK_LIBS)
dnl ********************************************************************
have_gtk=false
if test x$with_gtk != xno ; then
PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.4.0],
have_gtk="true", have_gtk="false")
fi
AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xtrue)
dnl ********************************************************************
dnl Check for the SDL library (for software playback)
dnl (defines SDL_CFLAGS and SDL_LIBS)
dnl ********************************************************************
have_sdl=false
if test x$with_libsdl != xno ; then
PKG_CHECK_MODULES(SDL, [sdl > 1.1.3],
[have_sdl=true
AC_DEFINE(HAVE_SDL, 1, [libsdl > 1.1.3 present])],
[have_sdl=false])
fi
AM_CONDITIONAL(HAVE_SDL, test x$have_sdl = xtrue)
dnl ********************************************************************
dnl Check for SDL_gfx which is used by y4mhist to display a graphical
dnl histogram.
dnl ********************************************************************
have_sdlgfx=false
if test x$with_sdlgfx != xno ; then
AC_SUBST(SDLgfx_LIBS)
if test x$have_sdl = xtrue; then
OLD_LIBS="$LIBS"
LIBS="$LIBS -lSDL -lSDL_gfx"
AC_CHECK_LIB(SDL_gfx, vlineColor,
[SDLgfx_LIBS="-lSDL_gfx"
AC_DEFINE(HAVE_SDLgfx, 1, [SDL_gfx library present])
have_sdlgfx=true ],[have_sdlgfx=false])
LIBS="$OLD_LIBS"
fi
fi
AM_CONDITIONAL(HAVE_SDLgfx, test x$have_sdlgfx = xtrue)
dnl ********************************************************************
dnl Test for MMX support if an IA32 platform. If on a PPC then look for
dnl Altivec support. For the IA32 platform see if gcc understands inline
dnl MMX instructions.
dnl
dnl TODO: host = non intel, target = intel <blah> do the checks also?
dnl Remember we are checking that the toolchain can generate the
dnl code, not whether the host can execute the code, thats done
dnl at run time with the exception of the SSE code.
have_asm_mmx=false
have_x86cpu=false
have_altivec=false
AC_MSG_CHECKING([Architecture])
case $host_cpu in
i[[3-7]]86)
AC_MSG_RESULT(IA32)
AC_DEFINE(HAVE_X86CPU,1, [Compiling for x86 architecture CPU])
have_x86cpu=true
PROGRAM_NOPIC="-fno-PIC"
;;
x86_64*)
AC_MSG_RESULT(x86_64)
AC_DEFINE(HAVE_X86CPU,1, [Compiling for x86-64 architecture CPU])
have_x86cpu=true
have_x86_64cpu=true
PROGRAM_NOPIC="-fno-PIC"
;;
powerpc | powerpc64)
AC_MSG_RESULT(PowerPC)
AC_DEFINE(HAVE_PPCCPU,1, [Compiling for PowerPC CPU])
have_ppccpu=true
PROGRAM_NOPIC=""
;;
*)
AC_MSG_RESULT(unknown)
PROGRAM_NOPIC=""
;;
esac
dnl Apple's darwin works on multiple hosts now, so add a catchall override
dnl after processing normal hosts
case $host in
*-apple-darwin*)
PROGRAM_NOPIC="-mdynamic-no-pic" # dynamic-no-pic is an Apple gcc option
;;
esac
dnl This flag is used for PROGRAMS not SHARED LIBRARIES. PIC code is required
dnl for shared libraries but is slower than non-pic code. Compute bound
dnl programs such as yuvdenoise and y4mspatialfilter can use this flag by
dnl simply adding programname_CFLAGS=@PROGRAM_NOPIC@ to the Makefile.am
AC_SUBST(PROGRAM_NOPIC)
if test "$enable_simd_accel" != "false" -a "$enable_simd_accel" != "no"
then
if test x$have_x86cpu = xtrue
then
AC_MSG_CHECKING([if C compiler accepts inline MMX assembly])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
[[__asm__ __volatile__("emms":::"memory");]])],
[have_asm_mmx=true],
[have_asm_mmx=false])
if test $have_asm_mmx = true; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
if test $have_asm_mmx = true; then
AC_DEFINE(HAVE_ASM_MMX,1,[Inline MMX assembly accepted by C compiler])
fi
fi
if test x$have_ppccpu = xtrue
then
AC_MSG_CHECKING([compiler support for AltiVec])
cat > conftest.c <<EOF
#ifdef HAVE_ALTIVEC_H
#include <altivec.h>
#endif
int main() {
union { vector signed int v;
signed int i;
} vi;
vi.v = vec_splat_s32(1);
return vi.i;
}
EOF
ALTIVEC_CFLAGS=""
if $CC -o conftest conftest.c >/dev/null 2>&1; then
have_altivec=true
elif $CC $CFLAGS -faltivec -maltivec -o conftest conftest.c >/dev/null 2>&1; then
# Mac OS X style with -maltivec
have_altivec=true
ALTIVEC_CFLAGS="-faltivec -maltivec"
elif $CC $CFLAGS -faltivec -o conftest conftest.c >/dev/null 2>&1; then
# Mac OS X style without -maltivec
have_altivec=true
ALTIVEC_CFLAGS="-faltivec"
elif $CC $CFLAGS -fvec -o conftest conftest.c >/dev/null 2>&1; then
# Motorola style
have_altivec=true
ALTIVEC_CFLAGS="-fvec"
elif $CC $CFLAGS -DHAVE_ALTIVEC_H=1 -maltivec -mabi=altivec -o conftest conftest.c >/dev/null 2>&1; then
# gcc 3.1 style
have_altivec=true
ALTIVEC_CFLAGS="-DHAVE_ALTIVEC_H=1 -maltivec -mabi=altivec"
fi
rm -f conftest*;
if test x$have_altivec = xtrue
then
CFLAGS="$CFLAGS ${ALTIVEC_CFLAGS}"
CXXFLAGS="$CXXFLAGS ${ALTIVEC_CFLAGS}"
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ALTIVEC,1, [Inline PPC Altivec primitives available])
else
AC_MSG_RESULT(no)
fi
fi
fi
dnl *********************************************************************
dnl For x86 and ppc machines check which code model we should use. This is
dnl done with the helper script cpuinfo.sh because the logic to do the job
dnl correctly is complex and lengthy (about as long as the entire configure.ac
dnl file).
if test x$have_x86cpu = xtrue -o x$have_ppccpu = xtrue; then
if test x$host_alias != x; then
dnl This is to allow cross compiling
AC_MSG_CHECKING(sub-architecture settings)
if test x$have_x86cpu = xtrue; then
host_mod_cpu=`echo $host_cpu | tr _ -`
ARCHFLAGS="-march=$host_mod_cpu -mcpu=$host_mod_cpu"
fi
else
if test ! -r $srcdir/cpuinfo.sh; then
AC_MSG_ERROR([cpuinfo.sh script not found - do a cvs update])
fi
AC_MSG_CHECKING(sub-architecture settings)
chmod +x $srcdir/cpuinfo.sh
if test x$have_x86cpu = xtrue; then
ARCHFLAGS=`$srcdir/cpuinfo.sh x86`
elif test x$have_ppccpu = xtrue; then
ARCHFLAGS=`$srcdir/cpuinfo.sh ppc`
fi
fi
AC_MSG_RESULT($ARCHFLAGS)
fi
dnl **********************************************************************
dnl Handle forcing static linkage in key places
if test "x$enable_static_build" = "xyes" ; then
echo "Forcing static linkage..."
LT_STATIC=-all-static
else
echo enable_static_build="\'${enable_static_build}\'"
fi
dnl **********************************************************************
dnl All the conditional stuff for the Makefiles
AM_CONDITIONAL(HAVE_ASM_MMX, test x$have_asm_mmx = xtrue)
AM_CONDITIONAL(HAVE_X86CPU, test x$have_x86cpu = xtrue)
AM_CONDITIONAL(HAVE_PPCCPU, test x$have_ppccpu = xtrue)
AM_CONDITIONAL(HAVE_ALTIVEC, test x$have_altivec = xtrue)
# This is a redhat ppc hack - OSX (which also uses gcc4) does NOT have any
# of the problems with undefined symbols, etc caused by a misplaced reference
# to an encoder routine (next_larger_quant) in the utils/altivec routines.
ALTIVEC_EXTRA_LIBS=
if test x$have_altivec = xtrue; then
ALTIVEC_EXTRA_LIBS=-lmpeg2encpp
fi
AC_SUBST(ALTIVEC_EXTRA_LIBS)
have_v4l_or_sdl=false
if test x$have_video4linux = xtrue; then
have_v4l_or_sdl=true
else
if test x$have_sdl = xtrue; then
have_v4l_or_sdl=true
fi
fi
AM_CONDITIONAL(HAVE_V4L_OR_SDL, test x$have_v4l_or_sdl = xtrue)
dnl *********************************************************************
dnl Check for what warnings we want gcc to use and adjust the CFLAGS
dnl as needed. This only works for GCC.
dnl We do this last as it can screw up library detection etc...
CFLAGS="$ARCHFLAGS $CFLAGS"
CXXFLAGS="$ARCHFLAGS $CXXFLAGS"
if test "x${GCC}" != "xyes" ; then
enable_compile_warnings=no
fi
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
warnCFLAGS=
warnCXXFLAGS=
if test "x$enable_compile_warnings" != "xno" ; then
if test "x$GCC" = "xyes" ; then
case "$CFLAGS" in
*-Wall*) ;;
*) warnCFLAGS="-Wall -Wunused" ;;
esac
if test "x$enable_compile_warnings" = "xyes" ; then
warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual"
warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual"
fi
if test "x$enable_warnings_as_errors" = "xyes" ; then
warnCFLAGS="$warnCFLAGS -Werror"
warnCXXFLAGS="$warnCXXFLAGS -Werror"
fi
fi
fi
AC_MSG_RESULT($warnCFLAGS)
AC_MSG_RESULT($warnCXXFLAGS)
if test "x$cflags_set" != "xyes" ; then
CFLAGS="$CFLAGS $warnCFLAGS"
CXXFLAGS="$CXXFLAGS $warnCXXFLAGS"
cflags_set=yes
fi
AC_ARG_ENABLE(assert,
AC_HELP_STRING([--disable-assert],
[Disable assertions (compile with NDEBUG).]),
[ case "$enableval" in yes|no) : ;; *) AC_MSG_ERROR(bad value for --enable-assert) ;; esac ],
[ enable_assert=yes ])
if test x"$enable_assert" = x"no"; then NDEBUG=1; fi
AC_DEFINE(MJPEGTOOLS,1, [Building mjpegtools])
case x"$NDEBUG" in x"1")
AC_DEFINE(NDEBUG,1, [Optimised no DEBUG build, assertions disabled])
;;
esac
dnl **********************************************************************
dnl Output a Makefile or two and the lib/header descriptor script
dnl **********************************************************************
AC_CONFIG_FILES([
Makefile
debian/Makefile
debian/control
docs/Makefile
lavtools/Makefile
yuvcorrect/Makefile
yuvdenoise/Makefile
yuvdeinterlace/Makefile
yuvscaler/Makefile
y4munsharp/Makefile
y4mutils/Makefile
yuvfilters/Makefile
mpeg2enc/Makefile
aenc/Makefile
mplex/Makefile
scripts/Makefile
utils/Makefile
utils/altivec/Makefile
utils/mmxsse/Makefile
y4mdenoise/Makefile
mjpegtools.pc
mjpegtools.spec
])
AC_OUTPUT
dnl ************************************************************************
dnl Summarize the config for the user.
dnl ************************************************************************
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ MJPEG tools ${VERSION} build configuration :])
AC_MSG_NOTICE([])
if test "$have_x86cpu" = "true" ; then
AC_MSG_NOTICE([ - X86 Optimizations:])
AC_MSG_NOTICE([ - MMX/3DNow!/SSE enabled : ${have_asm_mmx}])
fi
if test "$have_ppccpu" = "true" ; then
AC_MSG_NOTICE([ - PowerPC Optimizations:])
AC_MSG_NOTICE([ - AltiVec enabled : ${have_altivec}])
fi
if test x"$ARCHFLAGS" != x; then
AC_MSG_NOTICE([ - arch/cpu compiler flags : ${ARCHFLAGS}])
fi
if test x"$with_extra_cflags" != "x"; then
AC_MSG_NOTICE([ - extra_cflags added to CFLAGS: ${with_extra_cflags}])
fi
AC_MSG_NOTICE([ - video4linux recording/playback: ${have_video4linux}])
AC_MSG_NOTICE([ - software MJPEG playback : ${have_sdl}])
AC_MSG_NOTICE([ - Quicktime playback/recording : ${have_libquicktime}])
AC_MSG_NOTICE([ - PNG input support : ${have_libpng}])
AC_MSG_NOTICE([ - AVI MJPEG playback/recording : true (always)])
AC_MSG_NOTICE([ - libDV (digital video) support : ${have_libdv} ])
AC_MSG_NOTICE([ - Gtk+ support for glav : ${have_gtk}])
AC_MSG_NOTICE([])