Backslash ${prefix} for kde3 too...
[gnash.git] / configure.ac
blob79fea4ab46f6bcd5886cae8c750798db375f1f56
1 dnl  
2 dnl  Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 dnl  
4 dnl  This program is free software; you can redistribute it and/or modify
5 dnl  it under the terms of the GNU General Public License as published by
6 dnl  the Free Software Foundation; either version 3 of the License, or
7 dnl  (at your option) any later version.
8 dnl  
9 dnl  This program is distributed in the hope that it will be useful,
10 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl  GNU General Public License for more details.
13 dnl  You should have received a copy of the GNU General Public License
14 dnl  along with this program; if not, write to the Free Software
15 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16 dnl  
18 AC_PREREQ(2.50)
19 AC_INIT(gnash, 0.8.9dev)
20 AC_CONFIG_SRCDIR([libcore/as_object.h])
21 AC_CONFIG_HEADERS([gnashconfig.h])
23 dnl AC_CONFIG_SUBDIRS(libltdl)
24 AC_CANONICAL_BUILD
25 AC_CANONICAL_HOST
27 dnl --------------------------------------------------------
28 dnl Figure out development tool stuff
29 dnl --------------------------------------------------------
31 AC_PROG_CC
32 AC_PROG_CXX
33 AC_EXEEXT
34 AC_PROG_INSTALL
35 AM_COMPILER_LIB
37 dnl Set the default values for Flash Version. These are converted into
38 dnl various strings to make JavaScript or ActionScript detectors
39 dnl recognize Gnash as a SWF Player.
40 DEFAULT_FLASH_MAJOR_VERSION="10"
41 DEFAULT_FLASH_MINOR_VERSION="1"
42 DEFAULT_FLASH_REV_NUMBER="999"
43 AC_SUBST(DEFAULT_FLASH_MAJOR_VERSION)
44 AC_SUBST(DEFAULT_FLASH_MINOR_VERSION)
45 AC_SUBST(DEFAULT_FLASH_REV_NUMBER)
47 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_MAJOR_VERSION], ["${DEFAULT_FLASH_MAJOR_VERSION}"], [Default Flash major version])
48 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_MINOR_VERSION], ["${DEFAULT_FLASH_MINOR_VERSION}"], [Default Flash minor version])
49 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_REV_NUMBER], ["${DEFAULT_FLASH_REV_NUMBER}"], [Default Flash revision number])
51 dnl TODO: use host/build/target -- whatever is more appropriate
52 case "${host}" in
53   *-apple-*)
54     DEFAULT_FLASH_PLATFORM_ID="MAC"
55     DEFAULT_FLASH_SYSTEM_OS="MacOS"
56     ;;
57   *-openbsd*)
58     DEFAULT_FLASH_PLATFORM_ID="BSD"
59     DEFAULT_FLASH_SYSTEM_OS="OpenBSD"
60     ;;
61   *-freebsd* | *-kfreebsd*)
62     DEFAULT_FLASH_PLATFORM_ID="BSD"
63     DEFAULT_FLASH_SYSTEM_OS="FreeBSD"
64     ;;
65   *-netbsd*)
66     DEFAULT_FLASH_PLATFORM_ID="BSD"
67     DEFAULT_FLASH_SYSTEM_OS="NetBSD"
68     ;;
69   *-linux-gnu)
70     DEFAULT_FLASH_PLATFORM_ID="LNX"
71     DEFAULT_FLASH_SYSTEM_OS="GNU/Linux"
72     ;;
73   *-linux*)
74     DEFAULT_FLASH_PLATFORM_ID="LNX"
75     DEFAULT_FLASH_SYSTEM_OS="Linux"
76     ;;
77   *-cygwin* | *-mingw* | *-pw32*)
78     DEFAULT_FLASH_PLATFORM_ID="WIN"
79     DEFAULT_FLASH_SYSTEM_OS="Windows"
80     ;;
81   *-*solaris*)
82     DEFAULT_FLASH_PLATFORM_ID="SUN"
83     DEFAULT_FLASH_SYSTEM_OS="Solaris"
84     ;;
85   *-os2*)
86     DEFAULT_FLASH_PLATFORM_ID="OS2"
87     DEFAULT_FLASH_SYSTEM_OS="OS/2"
88     ;;
89   *-sco*)
90     DEFAULT_FLASH_PLATFORM_ID="SCO"
91     DEFAULT_FLASH_SYSTEM_OS="SCO/Unix"
92     ;;
93   *-irix*)
94     DEFAULT_FLASH_PLATFORM_ID="IRX"
95     DEFAULT_FLASH_SYSTEM_OS="IRIX"
96     ;;
97   *-hpux*)
98     DEFAULT_FLASH_PLATFORM_ID="HPX"
99     DEFAULT_FLASH_SYSTEM_OS="HPUX"
100     ;;    
101   *-amigaos*)
102     DEFAULT_FLASH_PLATFORM_ID="OS4"
103     DEFAULT_FLASH_SYSTEM_OS="AmigaOS4"
104     ;;    
105   *-haiku*)
106     DEFAULT_FLASH_PLATFORM_ID="HAIKU"
107     DEFAULT_FLASH_SYSTEM_OS="Haiku"
108     ;;    
109   *-gnu*)
110     DEFAULT_FLASH_PLATFORM_ID="GNU"
111     DEFAULT_FLASH_SYSTEM_OS="GNU/HURD"
112     ;;    
113   *)
114     DEFAULT_FLASH_PLATFORM_ID="UNK"
115     DEFAULT_FLASH_SYSTEM_OS="Unknown"
116     ;;
117 esac
119 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_PLATFORM_ID], ["${DEFAULT_FLASH_PLATFORM_ID}"], [Default 3-letter platform identifier for version string])
120 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_SYSTEM_OS], ["${DEFAULT_FLASH_SYSTEM_OS}"], [Default value for System.capabilities.os])
122 AC_SUBST(DEFAULT_FLASH_PLATFORM_ID)
123 AC_SUBST(DEFAULT_FLASH_SYSTEM_OS)
125 DEFAULT_STREAMS_TIMEOUT=60
126 AC_SUBST(DEFAULT_STREAMS_TIMEOUT)
127 AC_DEFINE_UNQUOTED([DEFAULT_STREAMS_TIMEOUT], [${DEFAULT_STREAMS_TIMEOUT}], [Default streams timeout in seconds])
129 DEFAULT_SOL_SAFEDIR="~/.gnash/SharedObjects"
130 AC_SUBST(DEFAULT_SOL_SAFEDIR)
131 AC_DEFINE_UNQUOTED([DEFAULT_SOL_SAFEDIR], ["${DEFAULT_SOL_SAFEDIR}"], [Default SharedObject base directory])
134 dnl Some things you can only do by looking at the platform name.
135 case "${host}" in
136   powerpc-apple-darwin*)
137     AC_DEFINE([__powerpc64__], [1], [this is a 64 bit powerpc])
138     darwin=yes
139     AC_DEFINE([DARWIN_HOST], [1], [this is a Darwin platform])
140     ;;
141   *-apple-darwin*)
142     darwin=yes
143     AC_DEFINE([DARWIN_HOST], [1], [this is a Darwin platform])
144     ;;
145     dnl Unfortunately, all BSD distributions are not identical, so 
146     dnl as tacky as it is to look for the distribution name, we don't
147     dnl have much choice. The use of these should be avoid as much as possible.
148   *-openbsd*)
149     bsd=yes
150     openbsd=yes
151     AC_DEFINE([OPENBSD_HOST], [1], [this is an OpenBSD platform])
152     ;;
153   *-freebsd* | *-kfreebsd*)
154     bsd=yes
155     freebsd=yes
156     AC_DEFINE([FREEBSD_HOST], [1], [this is a FreeBSD platform])
157     ;;
158   *-netbsd*)
159     bsd=yes
160     netbsd=yes
161     AC_DEFINE([NETBSD_HOST], [1], [this is a NetBSD platform])
162     ;;
163   *-*solaris*)
164     solaris=yes
165     AC_DEFINE([SOLARIS_HOST], [1], [this is a Solaris platform])
166     ;;
167   *-*linux*)
168     linux=yes
169     AC_DEFINE([LINUX_HOST], [1], [this is a Linux platform])
170     ;;
171   *-cygwin* | *-mingw* | *-pw32*)
172     windows=yes
173     AC_DEFINE([WIN32_HOST], [1], [this is a Win32 platform])
174     ;;
175   *64-*-*bsd*)
176     bsd_os=bsd 
177     AC_DEFINE([WORDSIZE], [64], [this is a 64 platform])
178     ;;
179   *-*amigaos*)
180     amigaos4=yes
181     AC_DEFINE([AMIGAOS4_HOST], [1], [this is an AmigaOS4 platform])
182     ;;
183   *-*haiku*)
184     haiku=yes
185     AC_DEFINE([HAIKU_HOST], [1], [this is a Haiku platform])
186     ;;
187   *-gnu*)
188     gnu=yes
189     AC_DEFINE([GNU_HOST], [1], [this is a GNU platform])
190     ;;
191 esac
194 AM_CONDITIONAL(PLUGIN_LINK_UNDEFINED, test x$openbsd_os = xopenbsd)
195 AM_CONDITIONAL(WIN32, test x$windows = xyes)
196 AM_CONDITIONAL(HAIKU, test x$haiku = xyes)
197 AM_CONDITIONAL(AMIGAOS4, test x$amigaos4 = xyes)
199 dnl Get build date for helping us debugging
200 BUILDDATE="`date +%Y%m%d`"
201 AC_SUBST(BUILDDATE)
203 dnl These are required by automake
204 dnl AM_INIT_AUTOMAKE(gnash, "trunk$BUILDDATE")
205 AM_INIT_AUTOMAKE
206 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
207 AM_MAINTAINER_MODE
208 AC_PROG_MAKE_SET
210 dnl AC_DISABLE_STATIC dnl Disable building static libs.
212 AM_GNU_GETTEXT([external])
213 AM_CONDITIONAL(HAS_GETTEXT, test x$ac_cv_path_XGETTEXT != x)
214 dnl AM_GNU_GETTEXT_VERSION(0.15)
216 dnl This is primarily used when compiling for a similar architecture,
217 dnl like pentium->geode, which can use the same compiler, but have
218 dnl different development libraries.
220 dnl I want to deprecate this option for the new sysroot name to be
221 dnl consistant with other tools. This will be left for a while as 
222 dnl a transistion.
223 AC_ARG_WITH(top_level,
224   AC_HELP_STRING([--with-top-level],
225   [top level directory for cross compiling files]),
226   with_top_level=${withval} ;
227   cross_compiling=yes)
229 AC_ARG_WITH(sysroot,
230   AC_HELP_STRING([--with-sysroot],
231   [system root directory for cross compiling]),
232   with_top_level=${withval} ;
233   cross_compiling=yes)
235 dnl Android is a little different when using a standard cross toolchain,
236 dnl so we have to configure especially for it for now. Usually it's
237 dnl something like this:
239 dnl arm-linux-eabi-gcc -Wl,--dynamic-linker -Wl,/system/bin/linker
240 dnl -nostdlib -Wl,-rpath -Wl,/system/lib -Wl,-rpath
241 dnl -Wl,/opt/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib
242 dnl -L/opt/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib
243 dnl -lc -o hello
244 dnl  /opt/android-ndk-r3/build/platforms/android-3/arch-arm/usr/lib/crtbegin_dynamic.o
245 dnl Recent versions of G++ (I'm using 4.5 from source
246 android_ndk=no
247 AC_ARG_WITH([android],
248   AC_HELP_STRING([--with-android], [directory where android NDK is installed]),
249         android_ndk=${withval}
250         if test x"${withval}" != x; then
251           android_ndk=${withval}
252         else
253           android_ndk=/opt/android-ndk-r3/build/platforms/android-5/arch-arm
254         fi
256 CROSS_CXXFLAGS=
257 if test x"${android_ndk}" != xno; then
258 dnl  LDFLAGS=-Wl,--dynamic-linker -Wl,/system/bin/linker -nostdlib -Wl,-rpath -Wl,/system/lib -Wl,-rpath -Wl,${android_ndk}/usr/lib -L${android_ndk}/usr/lib -lc -o hello ${android_ndk}/usr/lib/crtbegin_dynamic.o
259 dnl  CROSS_CXXFLAGS=-mandroid -fexceptions -I${android_ndk}/include
260   CROSS_CXXFLAGS=-mandroid -fexceptions
261   if test x"${with_top_level}" = x; then
262     with_top_level=/usr/local/android-arm/sysroot/usr
263     cross_compiling=yes
264   fi
265   ANDROID_NDK=${android_ndk}
266   AC_DEFINE(ANDROID, [1], [This is an Android build])
267 else
268   ANDROID_NDK=
270 AC_SUBST(ANDROID_NDK)
271 AM_CONDITIONAL(ANDROID, [ test x"${android_ndk}" != xno ])
273 AC_ARG_WITH(cpu,
274   AC_HELP_STRING([--with-cpu],[specify a cpu when cross compiling.]),
275   [case "${withval}" in
276     geode) with_cpu=geode ;;
277     *)   AC_MSG_ERROR([bad value ${enableval} for --with-cpu option]) ;;
278    esac],with_cpu=none)
280 if test x"$with_cpu" != x"none"; then
281 dnl   $CXXFLAGS="$CXXFLAGS -march=${with_cpu}"
282    cross_compiling=yes
285 AC_C_BIGENDIAN
286 AC_C_CONST
287 AC_C_INLINE
289 AM_CONDITIONAL(ENABLE_SHARED, [test x"${enable_shared}" = xyes])
290 AM_CONDITIONAL(ENABLE_STATIC, [test x"${enable_shared}" = xno])
291 dnl -- AM_CONDITIONAL(STATIC_GUI, test x"${dynamic_gui}" = xno -o x"${enable_shared}" = xno)
293 AC_PATH_PROG(DEJAGNU, runtest)
295 dnl AC_CHECK_LIB(ltdl, lt_dlmutex_register, AC_DEFINE(LT_DLMUTEX, 1, [Has lt_dlmutex_register]),
296 dnl                                         AC_DEFINE(LT_DLMUTEX, 0, [doesn't have lt_dlmutex_register]) )
298 dnl These options are for Cygnal, which collects optional statistics
299 dnl on all the network traffic By default, we turn on statistics
300 dnl collecting for the incoming and outgoing queues, since those are
301 dnl required to be compatiable with FMS 3, and the ActionScript server
302 dnl management API. buffers are the lowest level data storage, this
303 dnl data is the time spent in the queue, and is primarily only used
304 dnl for tuning the queueing API in Gnash. Memoryis the same, it's only
305 dnl used by developers for tuning performance of memory allocations in
306 dnl Gnash.
307 buffers=no
308 que=no
309 memory=no
310 cache=yes
311 stat_proplookup=no
312 AC_ARG_WITH(statistics,
313   AC_HELP_STRING([--with-statistics=], [Specify which statistics features to enable]),
314   if test -n ${withval}; then
315     if test "x${withval}" != "xno"; then
316       extlist="${withval}"
317       withval=`echo ${withval} | tr '\054' ' ' `
318     else
319       extlist=""
320       withval=""
321     fi
322   fi
323   statistics_list=""
324   nstatistics=0
325   while test -n "${withval}" ; do
326     val=`echo ${withval} | cut -d ' ' -f 1`
327     [case "${val}" in
328       buffers)
329         buffers=yes
330         nstatistics=$((nstatistics+1))
331         ;;
332       que)
333         que=yes
334         nstatistics=$((nstatistics+1))
335         ;;
336       memory)
337         memory=yes
338         nstatistics=$((nstatistics+1))
339         ;;
340       cache)
341         cache=yes
342         nstatistics=$((nstatistics+1))
343         ;;
344       proplookup)
345         stat_proplookup=yes
346         nstatistics=$((nstatistics+1))
347         ;;
348       all|ALL)
349         buffers=yes
350         memory=yes
351         queu=yes
352         cache=yes
353         stat_proplookup=yes
354         nstatistics=5           dnl this must be incremented if you add anything
355         ;;
356       *) AC_MSG_ERROR([invalid statistics feature specified: ${withval} given (accept: buffers|que|memory|cache|proplookup|all)])
357         ;;
358       esac]
359     withval=`echo ${withval} | cut -d ' ' -f 2-6`
360     if test "x$val" = "x$withval"; then
361       break;
362     fi
363   done
365 if test x${buffers} = xyes; then
366   statistics_list="${statistics_list} buffers"
367   AC_DEFINE(USE_STATS_BUFFERS, [1], [Support statistics collecting for the queue buffers])
368   AC_MSG_WARN([This option will effect your performance])
371 if test x${memory} = xyes; then
372   statistics_list="${statistics_list} memory"
373   AC_DEFINE(USE_STATS_MEMORY, [1], [Support statistics collecting for all memory profiling])
374   AC_MSG_WARN([This option will effect your performance])
377 if test x${que} = xyes; then
378   statistics_list="${statistics_list} queues"
379   AC_DEFINE(USE_STATS_QUEUE, [1], [Support statistics collecting for the queues])
382 if test x${cache} = xyes; then
383   statistics_list="${statistics_list} cache"
384   AC_DEFINE(USE_STATS_CACHE, [1], [Support statistics collecting for the cache])
387 if test x${stat_proplookup} = xyes; then
388   statistics_list="${statistics_list} proplookup"
389   AC_DEFINE(GNASH_STATS_OBJECT_URI_NOCASE, [1], [Collecting and report stats about ObjectURI case lookups])
390   AC_DEFINE(GNASH_STATS_PROPERTY_LOOKUPS, [1], [Collecting and report stats about property lookups])
391   AC_DEFINE(GNASH_STATS_STRING_TABLE_NOCASE, [1], [Collecting and report stats about string_table::key case lookups])
394 dnl this is just so Makefile can print the same list
395 STATISTICS_LIST="$statistics_list"
396 AC_SUBST(STATISTICS_LIST)
399 # These settings are compile time options for the security
400 # setting for anything that lets gnash exchange data with
401 # other applications. Currently this only supports Shared
402 # Objects and Local Connections. Shared Objects are like
403 # your web browsers cookies, and Local Connections use
404 # shared memory to execute methods remotely, and to
405 # exchange data.
407 # The default is to enable everything, and these can
408 # also be controlled dynamically by the $HOME/.gnashrc
409 # file.
411 solreadonly=no
412 localconnection=yes
413 lctrace=yes
415 AC_ARG_WITH(security,
416   AC_HELP_STRING([--with-security=], [Specify which security features to enable]),
417   if test -n ${withval}; then
418     if test "x${withval}" != "xno"; then
419       extlist="${withval}"
420       withval=`echo ${withval} | tr '\054' ' ' `
421     else
422       extlist=""
423       withval=""
424     fi
425   fi
426   security_list=""
427   nsecurity=0
428   while test -n "${withval}" ; do
429     val=`echo ${withval} | cut -d ' ' -f 1`
430 dnl    security_list="${security_list} ${val}"
431     [case "${val}" in
432       solreadonly)
433         solreadonly=yes
434         nsecurity=$((nsecurity+1))
435         ;;
436       lc)
437         localconnection=yes
438         nsecurity=$((nsecurity+1))
439         ;;
440       lctrace)
441         lctrace=yes
442         nsecurity=$((nsecurity+1))
443         ;;
444       all|ALL)
445         solreadonly=yes
446         lc=yes
447         lctrace=yes
448         nsecurity=3
449         ;;
450       *) AC_MSG_ERROR([invalid security feature specified: ${withval} given (accept: solreadonly|lc|lctrace)])
451         ;;
452       esac]
453     withval=`echo ${withval} | cut -d ' ' -f 2-6`
454     if test "x$val" = "x$withval"; then
455       break;
456     fi
457   done
459 if test xlctrace = xyes; then
460   security_list="${security_list} lctrace"
461   AC_DEFINE(USE_LC_TRACE, [1],
462            [Support LocalConnection])
463   AC_MSG_NOTICE([This build supports LocalConnection tracing])
464   AC_MSG_WARN([This option will effect your performance])
467 if test x$localconnection = xyes; then
468   security_list="${security_list} localconnection"
469   AC_DEFINE(USE_LC, [1],
470                  [Support LocalConnection])
471   AC_MSG_NOTICE([This build supports LocalConnection])
473 if test x$solreadonly = xyes; then
474   security_list="${security_list} solreadonly"
475   AC_DEFINE(USE_SOL_READONLY, [1],
476                  [Shared Objects are read-only])
477   AC_MSG_NOTICE([Shared Objects are read-only])
479 SECURITY_LIST="$security_list"
480 AC_SUBST(SECURITY_LIST)
482 dnl For Haiku, we know the sysroot is in a non-standard place
483 dnl it is important that -lagg comes before -lbe
484 if test x"${haiku}" = xyes; then
485   HAIKU_LIBS=-lbe
486   AC_SUBST(HAIKU_LIBS)
489 dnl Darwin uses libtool instead of ar to produce libraries. We determine which one
490 dnl we have here now. For some reason on Darwin, we don't get the
491 dnl count from grep via stdin correctly. Writing a temp file does the
492 dnl trick, so although it's ugly, that's what we gotta do...
493 AC_MSG_CHECKING([which type of library archiver we have])
494 rm -f .tmp
495 libtool > .tmp 2>&1
496 archiver=`grep -c dynamic .tmp 2>&1`
497 rm -f .tmp
498 dnl is there any good way to report what we found here?
499 AC_MSG_RESULT()
500 if test x"${archiver}" != x && test "${archiver}" -eq 1; then
501 dnl   if test "$enable_shared" = no; then
502 dnl     AR="libtool -static"
503 dnl   else
504 dnl     AR="libtool -dynamic"
505 dnl     CXXFLAGS="${CXXFLAGS} -dynamic"
506    export MACOSX_DEPLOYMENT_TARGET="10.3"
507 dnl   fi
508 dnl   AR_FLAGS="-o"
509    darwin=yes
510 else
511    darwin=no
514 dnl When cross compiling, limit the search directories cause otherwise
515 dnl we may get the host headers or libraries by accident. These values
516 dnl are exported, so all the other configure tests in macros/*.m4 use
517 dnl these same settings rather than duplicating them like we used to.
518 dnl To override thise, use the --with-*-incl= and --with-*-libs=
519 dnl options to configure.
520 if test x$cross_compiling = xyes; then
521   AC_MSG_NOTICE([Configuring Gnash for cross compilation])
522   export pkgroot="`$CXX -print-search-dirs | grep "install:" | sed -e 's/install: //' -e 's:/lib/gcc/.*::'`"
523   dnl pkgroot only works correctly with builds of cross tools not in
524   dnl /usr, ie... installed from the distribution packages, or just
525   dnl plain installed in the system tools. This contaminates configure
526   dnl when building for variations of the same basic architecture,
527   dnl like i686-linux -> i586-mingw32.
528   if test x${pkgroot} = "/usr"; then
529     export pkgroot=""
530   fi
531   export incllist="`eval echo ${with_top_level}/include ${pkgroot}/${host_alias}/include ${pkgroot}/include`"
532   export libslist="`eval echo ${with_top_level}/lib ${pkgroot}/${host_alias}/lib ${pkgroot}/lib64 ${pkgroot}/lib32 ${pkgroot}/lib`"
533   export pathlist="`eval echo ${pkgroot}/${host_alias}/bin:${pkgroot}/bin`"
534   npapi=no
535 else
536   AC_MSG_NOTICE([Configuring Gnash for native compilation])
537   export incllist="`eval cat ${srcdir}/macros/incllist`"
538   export libslist="`eval cat ${srcdir}/macros/libslist`"
539   export pathlist=$PATH
542 if test x"${android_ndk}" != xno; then
543    incllist="${android_ndk}/include ${incllist}"
546 AM_CONDITIONAL(CROSS_COMPILING, [ test x$cross_compiling = xyes ])
548 dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
549 dnl !! 
550 dnl !! IMPORTANT NOTICE 
551 dnl !!
552 dnl !!  Any call to GNASH_PATH_XXX must be be given *after* this snippet.
553 dnl !!  This is to ensure that PKG_CONFIG, cross_compiling and incllist are
554 dnl !!  properly set at the time of call.
555 dnl !!
556 dnl !!  Also GNASH_PKG_FIND has to be called later. Not sure
557 dnl !!  why but calling before breaks detection of CPP (see
558 dnl !!  gnash-dev mailing archives for June 12 2009
559 dnl !!  http://lists.gnu.org/archive/html/gnash-dev/2009-06/index.html
560 dnl !! 
561 dnl !! 
562 dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
564 dnl Check for PKG_CONFIG before any GNASH_PATH call
565 PKG_PROG_PKG_CONFIG
567 dnl --------------------------------------------------------
568 dnl  GUI selection
569 dnl --------------------------------------------------------
571 build_haiku=no
572 build_aos4=no      dnl AmigaOS4 GUI
573 build_kde3=no      dnl WARNING: doesn't work (see https://savannah.gnu.org/bugs/index.php?31782)
574 build_kde4=no
575 build_qtopia3=no
576 build_qtopia4=no
577 build_gtk=no
578 build_fb=no                     dnl Raw framebuffer
579 build_fltk=no
580 build_sdl=no
581 build_riscos=no                 dnl Native OS2 GUI
582 build_aqua=no                   dnl Native MacOSX
583 build_hildon=no                 dnl Native LIMO
584 build_alp=no                    dnl Acess Linux Platform using Hiker
585 build_dump=no
586 AC_ARG_ENABLE(gui,
587   AC_HELP_STRING([--enable-gui=], [Enable support for the specified GUI toolkits (default=gtk,kde4)]),
588   [if test -n ${enableval}; then
589     enableval=`echo ${enableval} | tr '\054' ' ' `
590   fi
591   while test -n "${enableval}" ; do
592     val=`echo ${enableval} | cut -d ' ' -f 1`
593     case "${val}" in
594       gtk|GTK|gtk2|GTK2)
595         build_gtk=yes
596         ;;
597       kde3|KDE3)
598         build_kde3=yes
599         ;;
600       kde4|KDE4)
601         build_kde4=yes
602         ;;
603       qtopia3|QTOPIA3)
604         build_qtopia3=yes
605         ;;
606       qtopia4|QTOPIA4)
607         build_qtopia4=yes
608         ;;
609       sdl|SDL)
610         build_sdl=yes
611         ;;
612       aqua|AQUA|Aqua)
613         build_aqua=yes
614         ;;
615       riscos|RISCOS|RiscOS)
616         build_riscos=yes
617         ;;
618       fltk|FLTK|fltk2|FLTK2)
619         build_fltk=yes
620         ;;
621       fb|FB)
622         build_fb=yes
623         ;;
624       aos4|AOS4)
625         build_aos4=yes
626         ;;
627       haiku|HAIKU)
628         build_haiku=yes
629         ;;
630       dump|DUMP)
631         build_dump=yes
632         ;;
633       all|ALL)
634         build_dump=yes
635         dnl BSD doesn't have a framebuffer interface
636         if test x${linux} = xyes; then
637           build_fb=yes
638         fi
639         build_kde4=yes
640         build_sdl=yes
641         ;;
642       *) AC_MSG_ERROR([invalid gui ${enableval} given (accept: gtk|kde3|kde4|fltk|sdl|riscos|aqua|fb|qtopia3|qtopia4|dump|aos4|haiku)])
643          ;;
644       esac
645     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
646     if test "x$val" = "x$enableval"; then
647       break;
648     fi
649   done],
650   [ dnl Run the following code if no --enable-gui is given
651   build_fb=auto
652   build_sdl=auto
653   if test x"${openbsd_os}" = x"openbsd"; then
654     build_kde3=yes;
655     build_gtk=yes;
656   else if test x"${haiku}" = xyes; then
657     build_haiku=yes;
658   else
659     build_kde4=auto
660     build_gtk=yes
661     build_dump=auto
662   fi
663   fi
664   ]
667 if test x"${build_haiku}" = xyes; then
668   if test x"$haiku" != xyes; then
669     echo "        ERROR: Can not build Haiku gui outside of Haiku
670 operating system." >&3
671   fi
674 dnl We can use Xephyr or fbe to create a fake framebuffer instead of real
675 dnl video memory. This lets us test on a desktop machine.
676 AC_ARG_WITH(fakefb,
677 AC_HELP_STRING([--with-fakefb],
678  [specify a file to be mapped instead of a real framebuffer]),
679  with_fakefb=${withval})
681 fakefb=
682 if test x"${with_fakefb}" = xyes; then
683   dnl This is the default file name fbe uses.
684   fakefb=/tmp/fbe_buffer
685 else
686   if test x"${with_fakefb}" != x; then
687     fakefb=${with_fakefb}
688   fi
690 FAKEFB=${fakefb}
691 AC_SUBST(FAKEFB)
693 if test x"${fakefb}" != x; then
694     AC_DEFINE(ENABLE_FAKE_FRAMEBUFFER, [1], [Enable using a file instead of a real framebuffer])
698 dnl --------------------------------------------------------
699 dnl  Sound handler selection
700 dnl --------------------------------------------------------
701 add_sound=
702 build_sound_none=no
703 build_sound_sdl=no
704 build_sound_ahi=no
705 build_sound_mkit=no
706 AC_ARG_ENABLE(sound,
707   AC_HELP_STRING([--enable-sound=[[sdl|ahi|mkit]]], [Use the specified sound handler (default=sdl)]),
708      [case "${enableval}" in
709       sdl|SDL|Sdl)
710         build_sound_sdl=yes
711         add_sound="sdl"
712         ;;
713       none|NONE|None)
714         build_sound_none=yes
715         add_sound="none"
716         ;;
717       ahi|AHI|Ahi)
718         build_sound_ahi=yes
719         add_sound="ahi"
720         ;;
721       mkit|MKIT|Mkit)
722         build_sound_mkit=yes
723         add_sound="mkit"
724         ;;
725      esac],
726   [if test x"${haiku}" = xyes; then
727      build_sound_mkit=yes
728      add_sound="mkit"
729    else
730      if test x${build_sound_none} = xno; then
731        build_sound_sdl=yes
732        add_sound=sdl
733      fi
734    fi]
737 dnl --------------------------------------------------------
738 dnl  Media handler selection
739 dnl --------------------------------------------------------
740 build_media_gst=no
741 build_media_ffmpeg=auto
742 build_media_none=no
743 AC_ARG_ENABLE(media,
744   AC_HELP_STRING([--enable-media=handler],
745     [Enable media handling support using the specified handler: gst, ffmpeg or none (no sound) [[gst]] ]),
746   
747     if test -n ${enableval}; then
748       enableval=`echo ${enableval} | tr '\054' ' ' `
749     fi
750     dnl When --enable-media is given, all media defaults to off
751     dnl except the explicitly enabled ones
752     build_media_ffmpeg=no
753     build_media_gst=no
754     while test -n "${enableval}"; do
755       val=`echo ${enableval} | cut -d ' ' -f 1`
756       [case "${val}" in
757         GST|gst)
758           build_media_gst=yes
759           media_list="${media_list}gst "
760           ;;
761         FFMPEG|ffmpeg)
762           build_media_ffmpeg=yes
763           media_list="${media_list}ffmpeg "
764           ;;
765         no|NO|none)
766           build_media_none=yes
767           media_list="none"
768           ;;
769         *)
770           AC_MSG_ERROR([bad value ${enableval} for --enable-media option])
771           ;;
772      
773       esac]
774       enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
775       if test "x$val" = "x$enableval"; then
776         break;
777       fi
778     done,
779     [if test x"${build_haiku}" = xyes; then
780         build_media_ffmpeg=yes
781         build_media_haiku=yes
782         media_list="ffmpeg haiku"
783      else
784         build_media_gst=yes
785         media_list="gst"
786     fi]
789 dnl If no render is selected, and media handling isn't disabled, them enable gst
790 if test x${build_media_none} = xno -a x${build_media_gst} = xno -a x${build_media_ffmpeg} = xno; then
791   build_media_gst=yes
794 if test x"$build_media_ffmpeg" != x"no"; then # yes or auto
795   GNASH_PATH_FFMPEG
796   if test x"${build_media_ffmpeg}" = xauto; then
797     dnl TODO: have GNASH_PATH_FFMPEG set ${has_ffmpeg}
798     if test x"$FFMPEG_LIBS" != x; then
799       build_media_ffmpeg=yes
800       media_list="${media_list} ffmpeg"
801     else
802       build_ogl=no
803     fi
804   fi
807 MEDIA_CONFIG="${media_list}"
808 AC_SUBST(MEDIA_CONFIG)
810 dnl -----------------------------------------------------
811 dnl Check for SDL and decide about auto gui accordingly.
812 dnl Need be done after build_sound_sdl and build_sdl are
813 dnl initialized and before they are checked for yes/no
814 dnl -----------------------------------------------------
816 if test x$build_sdl != xno -o x$build_sound_sdl = xyes; then
817   GNASH_PATH_SDL
820 if test x"${build_sdl}" = xauto; then
821   if test xyes = x"${has_sdl}"; then
822     build_sdl=yes
823   else
824     AC_MSG_NOTICE([sdl GUI won't be built (no sdl development files found)])
825     build_sdl=no
826   fi
830 dnl -------------------------------
831 dnl Renderer Selection
832 dnl -------------------------------
833 input_events=
834 dnl By default, we want to to build all renderers
835 build_ovg=no
836 build_gles=no
837 build_ogl=auto
838 build_agg=yes
839 build_cairo=yes
840 renderer_list="AGG Cairo"
841 nrender=3
842 AC_ARG_ENABLE(renderer,
843   AC_HELP_STRING([--enable-renderer=], [Enable support for the specified renderers (ogl|gles|cairo|agg|all, default=all)]),
844   if test -n ${enableval}; then
845     if test "x${enableval}" != "xno" -o "x${enableval}" != "xnone" ; then
846       renderer_list="none"
847       enableval=`echo ${enableval} | tr '\054' ' ' `
848     else
849       renderer_list=""
850       enableval=""
851     fi
852   fi
853   renderer_list=""
854   nrender=0
855   build_ovg=no
856   build_ogl=no
857   build_gles=no
858   build_agg=no
859   build_cairo=no
860   while test -n "${enableval}" ; do
861     val=`echo ${enableval} | cut -d ' ' -f 1`
862     [case "${val}" in
863       no*|NO*)
864         renderer_list="none"
865         build_ovg=no
866         build_ogl=no
867         build_gles=no
868         build_agg=no
869         build_cairo=no
870         nrender=1
871         ;;
872       all|ALL)
873         renderer_list="OpenGL, Cairo, AGG"
874         build_ogl=yes
875         build_agg=yes
876         build_cairo=yes
877         build_ovg=yes
878         nrender=4
879         ;;
880       ogl|OGL|OpenGL|opengl)
881         renderer_list="${renderer_list} OpenGL"
882         build_gles=no
883         build_ogl=yes
884         nrender=$((nrender+1))
885         ;;
886       gles|GLES|GL-ES|gl-es)
887         renderer_list="${renderer_list} OpenGL-ES"
888         build_gles=yes
889         build_ogl=no
890         nrender=$((nrender+1))
891         ;;
892       ovg|OVG|OpenVG|openvg)
893         renderer_list="${renderer_list} OpenVG"
894         build_ogv=yes
895         nrender=$((nrender+1))
896         ;;
897       agg|AGG)
898         renderer_list="${renderer_list} AGG"
899         build_agg=yes
900         nrender=$((nrender+1))
901         ;;
902       cairo|CAIRO|Cairo*)
903         renderer_list="${renderer_list} Cairo"
904         build_cairo=yes
905         nrender=$((nrender+1))
906         ;;
907       *) AC_MSG_ERROR([invalid renderer specified: ${enableval} given (accept:  (ogl|cairo|agg|all)])
908         ;;
909       esac]
910     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
911     if test "x$val" = "x$enableval"; then
912       break;
913     fi
914   done
916 dnl 16 bit: RGB555, RGB565
917 dnl 24 bit: RGB24, BGR24
918 dnl 32 bit: RGBA32, BGRA32
919 pixelformat=all
920 AC_ARG_WITH(pixelformat,
921   AC_HELP_STRING([--with-pixelformat=], [Use the specified pixel format for AGG (default=all)]),
922   [if test -n ${withval}; then
923     pixelformat="${withval}"
924     withval=`echo ${withval} | tr '\054' ' ' `
925   fi
926   while test -n "${withval}" ; do
927     val=`echo ${withval} | cut -d ' ' -f 1`
928     case "${val}" in
929       all)
930         # allow special value "all" set by user (handled below)
931         ;; 
932       argb32|ARGB32)
933         AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32])
934         ;;
935       abgr32|ABGR32)
936         AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32])
937         ;;
938       bgra32|BGRA32)
939         AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
940         ;;
941       bgr24|BGR24)
942         AC_DEFINE(PIXELFORMAT_BGR24, [1], [BGR24])
943         ;;
944       rgba32|RGBA32)
945         AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32])
946         ;;
947       rgb24|RGB24)
948         AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24])
949         ;;
950       rgb555|RGB555)
951         AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555])
952         ;;
953       rgb565|RGB565)
954         AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565])
955         ;;
956       *) AC_MSG_ERROR([invalid pixel format ${withval} given (accept: all|RGB555|RGB565|RGB24|BGR24|BGRA32|RGBA32|ARGB32|ABGR32)])
957          ;;
958       esac
959     withval=`echo ${withval} | cut -d ' ' -f 2-6`
960     if test "x$val" = "x$withval"; then
961       break;
962     fi
963   done],
964   [if test x$build_haiku = xyes -a x$build_sdl != xyes; then
965         AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
966         pixelformat=BGRA32
967    fi]
970 if test x$pixelformat = xall; then
971   if test x$build_agg = xyes; then
972     ### The fact that we're building GTK doesn't mean we're not also
973     ### building KDE or SDL, each needing its own pixel format !
974     #if test x$build_gtk = xyes; then
975     #  AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24 pixel format])
976     #  pixelformat="RGB24"
977     #else
978       AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555 pixel format])
979       AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565 pixel format])
980       AC_DEFINE(PIXELFORMAT_RGB24,  [1], [RGB24 pixel format])
981       AC_DEFINE(PIXELFORMAT_BGR24,  [1], [BGR24 pixel format])
982       AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32 pixel format])
983       AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32 pixel format])
984       AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32 pixel format])
985       AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32 pixel format])
986     #fi
987   fi
990 if test x"${build_ogl}" != xno; then # yes or auto
991   GNASH_PATH_OPENGL
992   if test x"${build_ogl}" = xauto; then
993     if test xyes = x"${has_opengl}"; then
994       build_ogl=yes
995       renderer_list="${renderer_list} OpenGL"
996     else
997       build_ogl=no
998     fi
999   fi
1002 AM_CONDITIONAL(BUILD_OVG_RENDERER, [ test x$build_ovg = xyes ])
1003 AM_CONDITIONAL(BUILD_GLES_RENDERER, [ test x$build_gles = xyes ])
1004 AM_CONDITIONAL(BUILD_OGL_RENDERER, [ test x$build_ogl = xyes])
1005 AM_CONDITIONAL(BUILD_AGG_RENDERER, [ test x$build_agg = xyes ])
1006 AM_CONDITIONAL(BUILD_CAIRO_RENDERER, [ test x$build_cairo = xyes ])
1008 if test x"${build_ogl}" = xyes; then
1009    AC_DEFINE([RENDERER_OPENGL], [], [Use OpenGL renderer])
1012 if test x"$build_agg" = xyes; then
1013   AC_DEFINE([RENDERER_AGG], [], [Use AntiGrain renderer])
1016 if test x"$build_cairo" = xyes; then
1017   GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
1018   AC_DEFINE([RENDERER_CAIRO], [], [Use cairo renderer])
1021 if test x"${build_agg}" = xyes; then
1022    GNASH_PATH_AGG
1025 dnl VA API is used by default for all H.264 videos. HW requirements:
1026 dnl     * AMD GPUs with UVD2 and xvba-video VA driver
1027 dnl     * NVIDIA GPUs with vdpau-video VA driver
1028 dnl     * All HW with a VA driver supporting the VA/GLX extensions or
1029 dnl     vaPutSurface(Pixmap,...). This may include the Intel
1030 dnl     Moorestown platform and future G45 VA driver.
1031 dnl NOTE: it is possible to use Gnash/VAAPI on platforms with an Intel
1032 dnl GMA500 but you currently will have to build the AGG renderer
1033 dnl instead of the OGL (OpenGL) one. 
1035 build_vaapi=yes
1036 hwaccel_list="VAAPI"
1037 nhwaccel=1
1038 AC_ARG_ENABLE(hwaccel,
1039   AC_HELP_STRING([--enable-hwaccel], [Specify which accleration to support to enable (none,vaapi,omap)]),
1040   if test -z ${enableval}; then
1041       hwaccel_list="none"
1042       nhwaccel=0
1043       enableval=""
1044   fi
1045   while test -n "${enableval}" ; do
1046     val=`echo ${enableval} | cut -d ' ' -f 1`
1047     [case "${val}" in
1048       no*|NO*)
1049         hwaccel_list="none"
1050         build_vaapi=no
1051         build_omap=no
1052         nhwaccel=0
1053         ;;
1054       va*|VA*)
1055         hwaccel_list="${hwaccel_list} vaapi"
1056         build_vaapi=yes
1057         nhwaccel=$((nhwaccel+1))
1058         ;;
1059       all|ALL)
1060         hwaccel_list="VAAPI OMAP"
1061         nhwaccel=2
1062         build_omap=yes
1063         build_vaapi=yes
1064         ;;
1065       omap*|OMAP*)
1066         hwaccel_list="${hwaccel_list} omap"
1067         build_omap=yes
1068         nhwaccel=$((nhwaccel+1))
1069         ;;
1070       *) AC_MSG_ERROR([invalid hwaccel feature specified: ${enableval} given (accept: none,vaapi,omap)])
1071         ;;
1072       esac]
1073     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1074     if test "x$val" = "x$enableval"; then
1075       break;
1076     fi
1077   done
1080 if test x"${have_ffmpeg_vaapi}" = x"yes" -a x"${build_vaapi}" = x"yes"; then
1081   use_libva=no
1082   use_libva_x11=no
1083   use_libva_glx=no
1084   dnl if the version of FFmpeg is recent enough, (r20957, 52.45.0), then
1085   dnl look for VAAPI support so we can use use the VAAPI enabled FFmpeg.
1086   if test x"${have_ffmpeg_vaapi}" = xyes; then
1087     use_libva=yes
1088     GNASH_PKG_FIND([libva],
1089       [va/va.h],
1090       [Video Acceleration API],
1091       vaInitialize
1092     )
1094     use_libva_x11=yes
1095     GNASH_PKG_FIND([libva_x11],
1096       [va/va_x11.h],
1097       [VA API (X11 display)],
1098       vaGetDisplay,
1099       [], [-lva-x11]
1100     )
1102     if test x$build_ogl = xyes; then
1103       use_libva_glx=yes
1104       GNASH_PKG_FIND([libva_glx],
1105         [va/va_glx.h],
1106         [VA API (GLX display)],
1107         vaGetDisplayGLX,
1108         [], [-lva-glx]
1109       )
1110     fi
1111   fi
1114 dnl libVA drivers. We declare conditional for both the option being
1115 dnl selected, as well as whether or not it's found. This we can
1116 dnl generate better error handling if it's not found.
1117 AM_CONDITIONAL(BUILD_OMAP, test x"${build_omap}" = xyes)
1118 AM_CONDITIONAL(USE_VAAPI, test x"${use_libva}" = xyes)
1120 dnl Only build the vaapi support if we have a version of FFmpeg that
1121 dnl supports it.
1122 if test x"${have_ffmpeg_vaapi}" = x"yes" -a x"${found_libva_incl}" = xyes; then
1123   build_vaapi=yes
1124   hwaccel_list="VAAPI"
1125   nhwaccel=1
1126 else
1127   build_vaapi=no
1128   hwaccel_list=""
1129   nhwaccel=0
1132 dnl Until the hwaccel patches in FFmpeg wind up in the ffmpeg-plugin,
1133 dnl restrict using HW Accel to using FFmpeg directly.
1134 dnl test xyes = xyes -a ( x != xyes -o x != xyes )
1135 if test x"${build_vaapi}" = x"yes" -a x"${have_ffmpeg}" != x"yes"; then
1136   AC_MSG_ERROR(["Hardware acceleration currently not supported unless using FFmpeg."])
1139 AM_CONDITIONAL(HAVE_VAAPI, test x"${found_libva_incl}" = xyes)
1140 AM_CONDITIONAL(HAVE_VAAPI_GLX, test x"${found_libva_glx_incl}" = xyes)
1141 AM_CONDITIONAL(HAVE_VAAPI_X11, test x"${found_libva_x11_incl}" = xyes)
1144 AC_PATH_PROG(PERL, perl)
1145 AM_CONDITIONAL(HAVE_PERL, test x"$PERL" != x)
1147 AC_PATH_PROG(CSOUND, csound)
1148 AM_CONDITIONAL(HAVE_CSOUND, test x"$CSOUND" != x)
1150 AC_PATH_PROG(GIT, git)
1151 AC_SUBST(GIT)
1153 dnl -------------------------------------
1154 dnl LIRC
1155 dnl -------------------------------------
1156 AC_ARG_ENABLE(lirc, AC_HELP_STRING([--enable-lirc], [Disable support for Lirc]),
1157 [case "${enableval}" in
1158   yes) lirc=yes ;;
1159   no)  lirc=no ;;
1160   *)   AC_MSG_ERROR([bad value ${enableval} for enable-lirc option]) ;;
1161 esac], lirc=no)
1163 if test x"$lirc" = x"yes"; then
1164   AC_DEFINE([USE_LIRC], [], [LIRC daemon support])
1166 AM_CONDITIONAL(USE_LIRC, test x$lirc = xyes)
1168 dnl --------------------------------------------------------
1169 dnl Extension selection
1170 dnl --------------------------------------------------------
1171 ext_dejagnu=no
1172 ext_mysql=no
1173 ext_fileio=no
1174 ext_gtk=no
1175 ext_lirc=no
1176 ext_dbus=no
1177 ext_all=no
1178 ext_launcher=no
1179 extensions_list=
1180 nextensions=0
1181 AC_ARG_ENABLE(extensions,
1182   AC_HELP_STRING([--enable-extensions=], [Specify which extensions to build]),
1183   if test -n ${enableval}; then
1184     if test "x${enableval}" != "xno"; then
1185       extlist="${enableval}"
1186       enableval=`echo ${enableval} | tr '\054' ' ' `
1187     else
1188       extlist=""
1189       enableval=""
1190     fi
1191   fi
1192   nextensions=0
1193   while test -n "${enableval}" ; do
1194     val=`echo ${enableval} | cut -d ' ' -f 1`
1195     extensions_list="${extensions_list} ${val}"
1196     [case "${val}" in
1197       dejagnu|DEJAGNU|dj|DJ)
1198         AC_DEFINE(USE_DEJAGNU_EXT, [1], [Build the DejaGnu extension])
1199         AC_MSG_NOTICE([Adding DejaGnu extension])
1200         ext_dejagnu=yes
1201         nextensions=$((nextensions+1))
1202         ;;
1203       mysql|MYSQL|sql|SQL)
1204         AC_DEFINE(USE_MYSQL_EXT, [1], [Build the MySQL extension])
1205         AC_MSG_NOTICE([Adding MySql extension])
1206         ext_mysql=yes
1207         nextensions=$((nextensions+1))
1208         ;;
1209       fileio|FILEIO|io|IO)
1210         AC_DEFINE(USE_FILEIO_EXT, [1], [Build the FileIO extension])
1211         AC_MSG_NOTICE([Adding FileIO extension])
1212         ext_fileio=yes
1213         nextensions=$((nextensions+1))
1214         ;;
1215       gtk|GTK|gtk2|GTK2)
1216         AC_DEFINE(USE_GTK_EXT, [1], [Build the GTK extension])
1217         ext_gtk=yes
1218         nextensions=$((nextensions+1))
1219         ;;
1220       launcher|LAUNCHER)
1221         AC_DEFINE(USE_LAUNCHER_EXT, [1], [Build the Launcher extension])
1222         ext_launcher=yes
1223         nextensions=$((nextensions+1))
1224         ;;
1225       lirc|LIRC)
1226         AC_DEFINE(USE_LIRC_EXT, [1], [Build the LIRC extension])
1227         ext_lirc=yes
1228         nextensions=$((nextensions+1))
1229         ;;
1230       dbus|DBUS)
1231         AC_DEFINE(USE_DBUS_EXT, [1], [Build the DBUS extension])
1232         ext_dbus=yes
1233         nextensions=$((nextensions+1))
1234         ;;
1235       all|ALL)
1236         AC_DEFINE(USE_GTK_EXT, [1], [Build all the extensions])
1237         ext_dejagnu=yes
1238         ext_mysql=yes
1239         ext_fileio=yes
1240         ext_gtk=yes
1241         ext_lirc=yes
1242         ext_dbus=yes
1243         ext_launcher=yes
1244         ext_all=yes
1245         nextensions=9
1246         ;;
1247       *) AC_MSG_ERROR([invalid extension specified: ${enableval} given (accept: MYSQL|DEJAGNU|FILEIO|GTK|LIRC|DBUS|METOME|ALL)])
1248          ;;
1249       esac]
1250     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1251     if test "x$val" = "x$enableval"; then
1252       break;
1253     fi
1254   done
1255   EXTENSIONS_LIST="$extensions_list"
1256   AC_SUBST(EXTENSIONS_LIST)
1259 if test x$ext_dbus = xyes; then
1260   GNASH_PATH_DBUS
1263 if test x$ext_mysql = xyes; then
1264   GNASH_PATH_MYSQL
1267 AM_CONDITIONAL(BUILD_DEJAGNU_EXT, [ test x$ext_dejagnu = xyes ])
1268 AM_CONDITIONAL(BUILD_FILEIO_EXT, [ test x$ext_fileio = xyes ])
1269 AM_CONDITIONAL(BUILD_MYSQL_EXT, [ test x$ext_mysql = xyes ])
1270 AM_CONDITIONAL(BUILD_LAUNCHER_EXT, [ test x$ext_launcher = xyes ])
1271 AM_CONDITIONAL(BUILD_GTK_EXT, [ test x$ext_gtk = xyes ])
1272 AM_CONDITIONAL(BUILD_LIRC_EXT, [ test x$ext_lirc = xyes ])
1273 AM_CONDITIONAL(BUILD_DBUS_EXT, [ test x$ext_dbus = xyes ])
1274 AM_CONDITIONAL(BUILD_EXTENSIONS, [ test -n "$extensions_list"])
1276 GNASH_PKG_CLASSFILE
1278 ltmajor=0
1279 AC_MSG_CHECKING([For the version of libtool])
1280 if test -d ${srcdir}/libltdl/libltdl; then
1281   ltver=2.x
1282 else
1283   ltver=1.x
1285 ltmajor=`echo $ltver | cut -d '.' -f 1`
1286 AC_MSG_RESULT([$ltver])
1287 if test $ltmajor -eq 1; then
1288   AC_LIBLTDL_CONVENIENCE
1289   AC_LIBTOOL_DLOPEN
1290   if test x"${windows}" = x"yes"; then
1291     dnl The following macro may be empty; the colon is necessary
1292     dnl in this case to avoid an empty if statement (which is a syntax error).
1293     AC_LIBTOOL_WIN32_DLL
1294     :
1295   fi
1296   AC_DISABLE_STATIC
1297 else
1298   LT_INIT([dlopen win32-dll disable-static])
1299   LTDL_INIT([convenience recursive])
1301 AC_LIB_LTDL
1303 DLOPEN="-dlopen"
1304 DLPREOPEN="-dlpreopen"
1305 AC_SUBST(DLOPEN)
1306 AC_SUBST(DLPREOPEN)
1308 dnl dnl Substitute INCLTDL and LIBLTDL in the Makefiles
1309 AC_SUBST(INCLTDL)
1310 AC_SUBST(LIBLTDL)
1312 AC_PROG_LIBTOOL
1313 AC_SUBST(LIBTOOL_DEPS)
1315 AM_CONDITIONAL(LIBLTDL2, [test $ltmajor -eq 2])
1316 AM_CONDITIONAL(LIBLTDL1, [test $ltmajor -eq 1])
1317 AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
1318 AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
1320 dnl --------------------------------------------------------
1321 dnl SOL dir
1322 dnl --------------------------------------------------------
1323 soldir=/tmp
1324 AC_ARG_WITH(soldir,
1325  AC_HELP_STRING([--with-soldir],
1326  [directory for .sol files]),
1327  with_soldir=${withval})
1328 if test x${with_soldir} != x; then
1329   soldir=${with_soldir}
1331 SOLDIR=${soldir}
1332 AC_SUBST(SOLDIR)
1334 dnl --------------------------------------------------------
1335 dnl AVM2
1336 dnl --------------------------------------------------------
1337 dnl AC_ARG_ENABLE(avm2,
1338 dnl   AC_HELP_STRING([--enable-avm2], [Enable support for AS3]),
1339 dnl   [case "${enableval}" in
1340 dnl     yes) avm2=yes ;;
1341 dnl     no)  avm2=no ;;
1342 dnl     *)   AC_MSG_ERROR([bad value ${enableval} for enable-avm2 option]) ;;
1343 dnl   esac], avm2=no
1344 dnl )
1345 dnl AM_CONDITIONAL(ENABLE_AVM2, [test x"$avm2" = xyes])
1346 dnl if test x$avm2 = xyes; then
1347 dnl     AC_DEFINE(ENABLE_AVM2, [1], [Enable AVM2 code])
1348 dnl fi
1349 AM_CONDITIONAL(ENABLE_AVM2, false)
1351 dnl This option is only used if you want Gnash to interwork with 
1352 dnl the Adobe player using the LocalConnection class.
1353 dnl lckey=0xdd3adabd
1354 AC_ARG_WITH(lckey,
1355  AC_HELP_STRING([--with-lckey],
1356  [shared memory key for your system]),
1357  with_lckey=${withval})
1359 if test x${with_lckey} != x; then
1360   lckey=${with_lckey}
1361 else
1362   lckey=0xcbc384f8
1364 LC_KEY=${lckey}
1365 AC_SUBST(LC_KEY)
1367 AC_ARG_ENABLE(python,
1368   AC_HELP_STRING([--enable-python],[Enable python for the python wrapper]),
1369 [case "${enableval}" in
1370   yes) python=yes ;;
1371   no)  python=no ;;
1372   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-python option]) ;;
1373 esac],python=no)
1375 dnl Look for python, which is optional. If enabled, a python loadable
1376 dnl module of Gnash is created.
1377 GNASH_PATH_PYTHON
1378 AM_CONDITIONAL([USE_PYTHON], test x"$python" = xyes)
1379 AM_CONDITIONAL([HAS_PYTHON], test x"$has_python" = xyes)
1381 # Maybe use jemalloc, which handles memory fragmentation for
1382 # ECAMscript languages better than the regular system malloc.
1383 # This seems like a good idea, as both the other player and
1384 # Mozilla/Firefox both recently switched to using jemalloc.
1385 AC_ARG_ENABLE(jemalloc,
1386   AC_HELP_STRING([--enable-jemalloc],[Enable jemalloc instead of system malloc]),
1387 [case "${enableval}" in
1388   yes) jemalloc=yes ;;
1389   no)  jemalloc=no ;;
1390   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-jemalloc option]) ;;
1391 esac],jemalloc=yes)
1393 dnl There is some weird stuff going on with NetBSD and jemalloc, so don't 
1394 dnl build it for now.
1395 if test x"${netbsd}" = x"yes" -o x"${windows}" = x"yes" -o x"${freebsd}" = x"yes" -o x"${haiku}" = x"yes" -o x"${gnu}" = x"yes"; then
1396   jemalloc=no
1398 dnl If the compiler doesn't have local thread storage enabled, don't try to
1399 dnl use jemalloc.
1400 if test x"${jemalloc}" = x"yes"; then
1401   AC_TRY_COMPILE([], [
1402     extern __thread int global_i; ],
1403     has_local_thread_storage=yes
1404   )
1405   if test x"${has_local_thread_storage}" = x"yes"; then
1406     AC_DEFINE([HAVE_LOCAL_THREAD_STORAGE], [1], [Has __thread (local thread storage) support])
1407     AC_DEFINE([USE_JEMALLOC], [], [Use jemalloc instead of system malloc])
1408   else
1409     jemalloc=no
1410   fi
1413 dnl We can search libs for mallinfo to decide whether we have it or not.
1414 dnl This is added to the linker flags when it's found. Usually it's -lc, but
1415 dnl on OpenSolaris it's -lmalloc, so this fixes the build.
1416 AC_SEARCH_LIBS([mallinfo], [c malloc],
1417                AC_DEFINE(HAVE_MALLINFO, [1], [Has mallinfo()])
1418                mallinfo=yes
1419                )
1421 AM_CONDITIONAL([HAVE_MALLINFO], test x$mallinfo = xyes)
1422 AM_CONDITIONAL(JEMALLOC, test x$jemalloc = xyes)
1424 AC_ARG_ENABLE(fps-debug,
1425   AC_HELP_STRING([--enable-fps-debug],[Enable FPS debugging code]),
1426 [case "${enableval}" in
1427   yes) AC_DEFINE([GNASH_FPS_DEBUG], [1], [Enable FPS debugging code])
1428 esac])
1430 dnl When we're making binary releases, it's often nice to just statically link
1431 dnl the final executables so we don't worry about what's installed, or which
1432 dnl version it is.
1433 AC_ARG_ENABLE(allstatic,
1434   AC_HELP_STRING([--enable-allstatic],[Enable using static libraries when possible for dependencies]),
1435 [case "${enableval}" in
1436   yes) allstatic=yes ;;
1437   no)  allstatic=no ;;
1438   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-allstatic option]) ;;
1439 esac],allstatic=no)
1440 AM_CONDITIONAL(ALLSTATIC, test x$allstatic = xyes)
1443 dnl --------------------------------------------------------
1444 dnl SHM
1445 dnl --------------------------------------------------------
1446 AC_ARG_WITH(shm,
1447   AC_HELP_STRING([--with-shm],[specify a shared memory type.]),
1448   [case "${withval}" in
1449     sysv) with_shm=sysv
1450           ;;
1451     posix) with_shm=posix
1452           ;;    
1453     *)   AC_MSG_ERROR([bad value ${enableval} for --with-shm option (try sysv or posix])
1454           ;;
1455    esac],with_shm=sysv)
1457 if test x"${with_shm}" = x"sysv"; then
1458   AC_DEFINE([USE_SYSV_SHM], [1], [Use SYSV shared memory for compatability])
1459   dnl IPC_INFO isn't portable, and doesn't exist on BSD
1460   AC_TRY_COMPILE([#include <sys/ipc.h> #include <sys/shm.h>], [
1461     int flag = IPC_INFO; ],
1462     AC_DEFINE([HAVE_IPC_INFO], [1], [Use shm_info])
1463   )
1464 else
1465   AC_DEFINE([USE_POSIX_SHM], [1], [Use POSIX shared memory])
1468 dnl --------------------------------------------------------
1469 dnl Disable menus
1470 dnl --------------------------------------------------------
1471 dnl Don't add the GUI menu. Some educational systems think this adds
1472 dnl clutter and confusion, like on the OLPC.
1473 AC_ARG_ENABLE(menus,
1474   AC_HELP_STRING([--disable-menus],[Disable the GUI menus]),
1475 [case "${enableval}" in
1476   yes) menus=yes ;;
1477   no)  menus=no ;;
1478   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-menus option]) ;;
1479 esac],menus=yes)
1481 if test x"$menus" = x"yes"; then
1482   AC_DEFINE([USE_MENUS], [], [GUI Menu support])
1484 AM_CONDITIONAL(MENUS, test x$menus = xyes)
1486 dnl --------------------------------------------------------
1487 dnl Disable SWF information
1488 dnl --------------------------------------------------------
1489 dnl Don't gather SWF information in tree form. This takes
1490 dnl resources and memory that can be saved if there's no
1491 dnl need to examine SWF internals.
1492 AC_ARG_ENABLE(swftree,
1493   AC_HELP_STRING([--disable-swftree],[Disable showing SWF properties]),
1494 [case "${enableval}" in
1495   yes) swftree=yes ;;
1496   no)  swftree=no ;;
1497   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-swf-properties option]) ;;
1498 esac],swftree=yes)
1500 if test x"$swftree" = x"yes"; then
1501   AC_DEFINE([USE_SWFTREE], [], [View SWF information])
1503 AM_CONDITIONAL(SWFTREE, test x$swftree = xyes)
1505 dnl --------------------------------------------------------
1506 dnl Disable testsuite
1507 dnl --------------------------------------------------------
1508 dnl Disable running any tests for "make check". This may sound stupid, but
1509 dnl this option is designed to solely be used by maintainers in the 
1510 dnl DISTCHECK_CONFIGURE_FLAGS when building packages. Gnash's testing infrastructure
1511 dnl is complex, and often the the testsuites will work, but due to some obscure reason,
1512 dnl make distcheck fails.
1513 AC_ARG_ENABLE(testsuite,
1514   AC_HELP_STRING([--disable-testsuite],[Disable the testsuite, maintainers option only]),
1515 [case "${enableval}" in
1516   yes) testsuite=yes ;;
1517   no)  testsuite=no ;;
1518   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-testsuite option]) ;;
1519 esac],testsuite=yes)
1521 if test x"$testsuite" = x"yes"; then
1522   AC_DEFINE([USE_TESTSUITE], [], [Testsuite support, maintainers option only])
1524 AM_CONDITIONAL(TESTSUITE, test x$testsuite = xyes)
1526 dnl --------------------------------------------------------
1527 dnl Write the file to disk in the plugin
1528 dnl --------------------------------------------------------
1529 AC_ARG_ENABLE(write,
1530   AC_HELP_STRING([--enable-write], [Makes the Mozilla plugin write the currently playing SWF movie to /tmp.]),
1531 [case "${enableval}" in
1532   yes) write=yes ;;
1533   no)  write=no ;;
1534   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-write option]) ;;
1535 esac],write=no)
1537 if test x"$write" = x"yes"; then
1538   AC_DEFINE([WRITE_FILE], [], [Write files while streaming])
1541 dnl --------------------------------------------------------
1542 dnl Write a standalone gnash launcher to disk from the plugin
1543 dnl --------------------------------------------------------
1544 AC_ARG_ENABLE(sa-launcher,
1545   AC_HELP_STRING([--disable-sa-launcher], [Drops support for the NPAPI plugin writing of standalone executable launcher scripts for the currently playing SWF movie to /tmp.]),
1546 [case "${enableval}" in
1547   yes) sa_launcher=yes ;;
1548   no)  sa_launcher=no ;;
1549   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-sa-launcher option]) ;;
1550 esac],sa_launcher=yes)
1552 if test x"$sa_launcher" = x"yes"; then
1553   AC_DEFINE([CREATE_STANDALONE_GNASH_LAUNCHER], [], [Add support for writing a standalone executable launcher for movies embedded in web pages])
1556 dnl --------------------------------------------------------
1557 dnl Build the cygnal server if specified.
1558 dnl --------------------------------------------------------
1559 AC_ARG_ENABLE(cygnal,
1560   AC_HELP_STRING([--enable-cygnal], [Enable building of the Cygnal server]),
1561 [case "${enableval}" in
1562   yes) cygnal=yes ;;
1563   no)  cygnal=no ;;
1564   *)   AC_MSG_ERROR([bad value ${enableval} for enable-cygnal option]) ;;
1565 esac],cygnal=no)
1566 AM_CONDITIONAL(CYGNAL, test x$cygnal = xyes)
1568 dnl --------------------------------------------------------
1569 dnl Build the cgibins server if specified.
1570 dnl --------------------------------------------------------
1571 AC_ARG_ENABLE(cgibins,
1572   AC_HELP_STRING([--enable-cgibins], [Enable building of the CGIs for Cygnal]),
1573 [case "${enableval}" in
1574   yes) cgibin=yes ;;
1575   no)  cgibin=no ;;
1576   *)   AC_MSG_ERROR([bad value ${enableval} for enable-cgibins option]) ;;
1577 esac],cgibin=yes)
1578 AM_CONDITIONAL(USE_CGI, test x$cgibin = xyes)
1579 if test x"${cgibin}" = x"yes"; then
1580   AC_DEFINE([USE_CGIBIN], [1], [Enable cgi-bin processes for Cygnal])
1583 dnl --------------------------------------------------------
1584 dnl Fix the Intel 810 LOD bias problem
1585 dnl --------------------------------------------------------
1586 AC_ARG_ENABLE(i810-lod-bias,
1587   AC_HELP_STRING([--enable-i810-lod-bias], [Enable fix for Intel 810 LOD bias problem]),
1588 [case "${enableval}" in
1589   yes) i810lodbias=yes ;;
1590   no)  i810lodbias=no ;;
1591   *)   AC_MSG_ERROR([bad value ${enableval} for enable-i810-lod-bias option]) ;;
1592 esac])
1594 if test x"${i810lodbias}" = xyes; then
1595     AC_DEFINE([FIX_I810_LOD_BIAS], [], [Fix i810 LOD bias problem])
1598 dnl --------------------------------------------------------
1599 dnl  Double buffer
1600 dnl --------------------------------------------------------
1601 dnl Add an option for double buffering when rendering, currently only used by
1602 dnl the frmaebuffer GUI.
1603 dnl If defined, an internal software-buffer is used for rendering and is then
1604 dnl copied to the video RAM. This avoids flicker and is faster for complex 
1605 dnl graphics, as video RAM access is usually slower. (strongly suggested)
1606 AC_ARG_ENABLE(doublebuf,
1607   AC_HELP_STRING([--enable-doublebuf], [Enable support for double buffering when rendering]),
1608   [case "${enableval}" in
1609     yes) doublebuf=yes ;;
1610     no)  doublebuf=no ;;
1611     *)   AC_MSG_ERROR([bad value ${enableval} for enable-doublebuf option]) ;;
1612   esac], doublebuf=no
1614 AM_CONDITIONAL(ENABLE_DBUF, [test x"$doublebuf" = xyes])
1615 if test x$doublebuf = xyes; then
1616     AC_DEFINE(ENABLE_DOUBLE_BUFFERING, [1], [Enable double buffering])
1619 dnl --------------------------------------------------------
1620 dnl  Offscreen buffer
1621 dnl --------------------------------------------------------
1622 dnl This enables rendering to an offscreen buffer, instead of directly to window
1623 AC_ARG_ENABLE(offscreen,
1624   AC_HELP_STRING([--enable-offscreen], [Enable support for rendering offscreen]),
1625   [case "${enableval}" in
1626     yes) offscreen=yes ;;
1627     no)  offscreen=no ;;
1628     *)   AC_MSG_ERROR([bad value ${enableval} for enable-offscreen option]) ;;
1629   esac], offscreen=no
1633 dnl --------------------------------------------------------
1634 dnl  SSH support selection
1635 dnl --------------------------------------------------------
1636 dnl Enable using libssh with libnet
1637 AC_ARG_ENABLE(ssh,
1638   AC_HELP_STRING([--enable-ssh], [Enable using SSH for network authentication]),
1639 [case "${enableval}" in
1640   yes) build_ssh=yes ;;
1641   no)  build_ssh=no ;;
1642   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-ssh option]) ;;
1643 esac], build_ssh=no)
1645 AM_CONDITIONAL(BUILD_SSH, test x"${build_ssh}" = xyes)
1646 if test x"${build_ssh}" = xyes; then
1647   GNASH_PKG_FIND(ssh, [libssh/libssh.h], [libssh library], ssh_socket_init)
1648 dnl  GNASH_PKG_FIND(poppler, [popt.h], [Poppler library], poppler_init)
1650 if test x"${has_ssh}" = x"yes"; then
1651   AC_DEFINE([USE_SSH], [1], [Use SSH for authentication])
1654 dnl --------------------------------------------------------
1655 dnl  SSL support selection
1656 dnl --------------------------------------------------------
1658 dnl Enable using OpenSSL with libnet.
1659 AC_ARG_ENABLE(ssl,
1660   AC_HELP_STRING([--enable-ssl], [Enable using OpenSSL directly]),
1661 [case "${enableval}" in
1662   yes) build_ssl=yes ;;
1663   no)  build_ssl=no ;;
1664   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-ssl option]) ;;
1665 esac], build_ssl=no)
1667 with_cert=
1668 with_pem=
1669 AM_CONDITIONAL(BUILD_SSL, test x"${build_ssl}" = xyes)
1670 AC_ARG_WITH(cert,
1671   AC_HELP_STRING([--with-cert],
1672   [cert file for SSL]),
1673   with_cert=${withval})
1674 AC_ARG_WITH(pem,
1675   AC_HELP_STRING([--with-pe],
1676   [pem file for SSL]),
1677   with_pem=${withval})
1679 if test x"${build_ssl}" = xyes; then
1680   GNASH_PKG_FIND(ssl, [openssl/ssl.h], [OpenSSL library], SSL_library_init)
1682 if test x"${has_ssl}" = x"yes"; then
1683   AC_DEFINE([USE_SSL], [1], [Use SSL for authentication])
1686 dnl -----------------------------------------------------------
1687 dnl Set the general plugins install policy here
1688 dnl (NOTE: before GNASH_PATH_FIREFOX and GNASH_PATH_KDE*)
1689 dnl -----------------------------------------------------------
1691 AC_ARG_WITH(plugins-install,
1692   AC_HELP_STRING([--with-plugins-install=system|user|prefix], [Policy for plugins install. Default: user.]),
1693         [case "${withval}" in
1694           user) PLUGINS_INSTALL_POLICY=user ;;
1695           system) PLUGINS_INSTALL_POLICY=system ;;
1696           prefix) PLUGINS_INSTALL_POLICY=prefix ;;
1697           *)  AC_MSG_ERROR([bad value ${withval} for --with-plugins-install]) ;;
1698          esac 
1699         ], PLUGINS_INSTALL_POLICY=user) 
1701 dnl -----------------------------------------------------------
1702 dnl   Verify dependencies for requested GUIs are met, and
1703 dnl   disable build of the GUIS for which deps are NOT met
1704 dnl ------------------------------------------------------------
1706 dnl Look for scratchbox (used in GNASH_PATH_ALP)
1707 dnl FIXME: move it in macros/alp.m4 or at least after
1708 dnl        the build_alp conditional ?
1709 sbox=no
1710 if test x"${SBOX_REDIRECT_FROM_DIRS}" != x; then
1711   sbox=yes
1714 if test x$build_gtk = xyes -o $build_alp = xyes; then
1715    GNASH_PATH_GTK2
1716    GNASH_PATH_PANGO
1717    GNASH_PKG_FIND(atk, [atk/atk.h], [atk library], atk_focus_tracker_init, [1.0])
1718    if test x"${build_ogl}" = xyes; then
1719       GNASH_PATH_GLEXT
1720    fi
1721    if test x"${build_cairo}" = xyes; then
1722       GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
1723    fi
1727 if test x"${build_kde4}" != xno -o x"${build_qtopia4}" != xno; then
1728  GNASH_PATH_QT4
1731 if test x"${build_kde4}" != xno; then
1732   GNASH_PATH_KDE4
1735 if test x"${build_kde4}" = xauto; then
1736   if test x"${has_qt4}" = xyes -a x"${has_kde4}" = xyes; then
1737      build_kde4=yes
1738   else
1739      build_kde4=no
1740   fi
1743 if test x"${build_kde3}" != xno -o x"${build_qtopia3}" != xno; then
1744  GNASH_PATH_QT3
1747 if test x"${build_kde3}" != xno; then
1748   GNASH_PATH_KDE3
1752 if test x"${build_kde3}" = xauto; then
1753   if test x"${has_qt3}" = xyes -a x"${has_kde3}" = xyes; then
1754      build_kde3=yes
1755   else
1756      build_kde3=no
1757   fi
1760 dnl Check possibility to build DUMP gui, if requested
1761 if test x"${build_dump}" != xno; then
1762   if test x"${build_agg}" = xyes; then
1763     build_dump=yes
1764   else
1765     if test x"${build_dump}" = xyes; then
1766       dnl SHOULD we just check at the end of file instead ?
1767       AC_MSG_ERROR(dump GUI cannot be built without AGG renderer);
1768     fi
1769     build_dump=no
1770   fi
1773 dnl Check possibility to build FB gui, if requested
1774 dnl FB dependencies are a linux system (linux/fb.h) 
1775 dnl and AGG renderer
1776 if test x"${build_fb}" != xno; then
1777   if test x"${linux}" = xyes; then
1778     if test x"${build_agg}" = xyes; then
1779       build_fb=yes
1780     else
1781       if test x"${build_fb}" = xyes; then
1782         dnl SHOULD we just check at the end of file instead ?
1783         AC_MSG_ERROR([fb GUI cannot be built without AGG renderer])
1784       fi
1785       AC_MSG_NOTICE([fb GUI won't be built (needs AGG renderer)])
1786       build_fb=no
1787     fi
1788   else
1789     if test x"${build_fb}" = xyes; then
1790       dnl SHOULD we just check at the end of file instead ?
1791       AC_MSG_ERROR(fb GUI cannot be built on non-linux platforms);
1792     fi
1793     AC_MSG_NOTICE([fb GUI won't be built (non-linux platform)])
1794     build_fb=no
1795   fi
1798 dnl TODO: add checks for all other GUIs
1800 dnl -------------------------------
1801 dnl Input Device selection
1802 dnl -------------------------------
1804 dnl Multiple input devices are supported. These can all work in
1805 dnl varying combinations, so several may be listed. These are only
1806 dnl required when using the Framebuffer, as without the X11 desktop,
1807 dnl Gnash has to handle all these internally. This can get
1808 dnl messy, as one might want to use a touchscreen with a normal mouse
1809 dnl or keyboard attached. 
1810 dnl By default, don't build any of these, as they are only for the Framebuffer
1811 dnl running without X11.
1812 if test x"${build_fb}" = xyes; then
1813 build_ps2mouse=yes
1814 build_ps2keyboard=no
1815 build_input_events=yes
1816 build_tslib=yes
1817 input_events="PS/2 Mouse, Input Devices, Touchscreen via Tslib"
1818 else
1819 build_ps2mouse=no
1820 build_ps2keyboard=no
1821 build_input_events=no
1822 build_tslib=no
1823 input_events=
1825 AC_ARG_ENABLE(input,
1826   AC_HELP_STRING([--enable-input=], [Enable support for the specified input devices for the framebuffer GUI (default=ps2mouse|ps2keyboard|events|touchscreen)]),
1827   [if test -n ${enableval}; then
1828     enableval=`echo ${enableval} | tr '\054' ' ' `
1829   fi
1830   while test -n "${enableval}" ; do
1831     val=`echo ${enableval} | cut -d ' ' -f 1`
1832     case "${val}" in
1833       ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
1834         build_ps2mouse=yes
1835         input_events="${input_events}, PS/2 Mouse"
1836         ;;
1837       ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
1838         build_ps2keyboard=yes
1839         input_events="${input_events}, PS/2 Keyboard"
1840         ;;
1841       i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
1842         input_events="${input_events}, Input Event Device"
1843         build_input_events=yes
1844         ;;
1845       t*|T*) dnl use a touchscreen with tslib, which works like a mouse
1846         build_tslib=yes
1847         input_events="${input_events}, Touchscreen"
1848         ;;
1849       *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: ps2mouse|keyboard|events,touchscreen)])
1850          ;;
1851       esac
1852     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1853     if test "x$val" = "x$enableval"; then
1854       break;
1855     fi
1856   done],
1859 if test x"${build_tslib}" = xyes; then
1860   AC_DEFINE(USE_TSLIB, [1], [Use a tslib supported touchscreen])
1861   GNASH_PKG_FIND(ts, [tslib.h], [Touchscreen library], ts_config)
1863 AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} != xno])
1865 if test x"${build_ps2mouse}" = xyes; then
1866   AC_DEFINE(USE_MOUSE_PS2, [1], [Add support for a directly using a PS/2 Mouse])
1868 AM_CONDITIONAL(ENABLE_MOUSE, [test x"${build_ps2mouse}" = xyes])
1870 if test x"${build_ps2keyboard}" = xyes; then
1871   AC_DEFINE(USE_KEYBOARD_PS2, [1], [Add support for directly using a PS/2 Keyboard])
1873 if test x"${build_input_events}" = xyes; then
1874   AC_DEFINE(USE_INPUT_EVENTS, [1], [Add support for a directly using Linux Input Event Devices])
1876 AM_CONDITIONAL(ENABLE_INPUT_EVENTS, [test x"${build_input_events}" = xyes])
1877 dnl this is enabled if we have any input devices at all
1878 AM_CONDITIONAL(ENABLE_INPUT_DEVICES, [test x"${input_events}" != x])
1881 dnl -----------------------------------------------------------
1882 dnl Try to ignore stupid dependencies
1883 dnl -----------------------------------------------------------
1885 AC_MSG_CHECKING(linker --as-needed support)
1886 gcc_cv_ld_as_needed=no
1887 # Check if linker supports --as-needed and --no-as-needed options
1888 if $LD --help 2>/dev/null | grep as-needed > /dev/null; then
1889   gcc_cv_ld_as_needed=yes
1891 if test x"$gcc_cv_ld_as_needed" = xyes; then
1892   LDFLAGS="$LDFLAGS -Wl,--as-needed"
1894 AC_MSG_RESULT($gcc_cv_ld_as_needed)
1896 dnl AC_MSG_CHECKING(linker --no-undefined support)
1897 dnl gcc_cv_ld_undef_needed=no
1898 dnl # Check if linker supports --no-undefined
1899 dnl if $LD --help 2>/dev/null | grep as-needed > /dev/null; then
1900 dnl     gcc_cv_ld_undef_needed=yes
1901 dnl fi
1902 dnl if test x"$gcc_cv_ld_undef_needed" = xyes; then
1903 dnl     LDFLAGS=" ${LDFLAGS} -Wl,--no-undefined"
1904 dnl fi
1905 dnl AC_MSG_RESULT($gcc_cv_ld_undef_needed)
1907 AC_DEFINE(USE_GIF, [1], [Use the GIF library])
1908 AC_DEFINE(USE_PNG, [1], [Use the PNG library])
1909 AM_CONDITIONAL(USE_GIF, true)
1910 AM_CONDITIONAL(USE_PNG, true)
1912 dnl GNASH_PKG_FIND(dmalloc, [dmalloc.h], [dmalloc], mallinfo)
1913 AM_CONDITIONAL(HAVE_DMALLOC, [ test x$has_dmalloc = xyes ])
1915 AC_PATH_TOOL([AUTOTRACE], [autotrace])
1916 AC_HEADER_DIRENT
1918 dnl -----------------------------------------------------------------
1919 dnl PLUGIN RELATED STUFF
1920 dnl -----------------------------------------------------------------
1922 dnl Zip is used insted of tar when building an xpi package
1923 dnl for Mozilla/Firefox.
1924 AC_PATH_PROG(ZIP, zip, ,[${pathlist}])
1926 dnl !! This has been moved here to make --enable-npapi work
1927 dnl !! All of plugin-related macro calls could be moved into
1928 dnl !! a specialized macros/plugin.m4
1930 dnl ----------------------------------------------------
1931 dnl Add KPARTS support, if specified or KDE gui is built
1932 dnl ----------------------------------------------------
1934 AC_ARG_ENABLE(kparts3,
1935   AC_HELP_STRING([--disable-kparts3], [Disable support for Konqueror 3.x plugin (default: enabled if kde3 gui is)]),
1936 [case "${enableval}" in
1937   yes) build_kparts3=yes ;;
1938   no)  build_kparts3=no ;;
1939   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-kparts3 option]) ;;
1940 esac],build_kparts3=$build_kde3)
1942 dnl --------------------------------------------------------
1943 dnl Add KPARTS 4.x support, if specified or KDE gui is built
1944 dnl --------------------------------------------------------
1946 AC_ARG_ENABLE(kparts4,
1947   AC_HELP_STRING([--disable-kparts4], [Disble support for Konqueror 4.x plugin (default: enabled if kde4 gui is)]),
1948 [case "${enableval}" in
1949   yes) build_kparts4=yes ;;
1950   no)  build_kparts4=no ;;
1951   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-kparts4 option]) ;;
1952 esac],build_kparts4=$build_kde4)
1954 dnl -----------------------------------------------------------
1955 dnl Add NPAPI support, if specified or GTK or KDE4 gui is built
1956 dnl -----------------------------------------------------------
1958 AC_ARG_ENABLE(npapi,
1959   AC_HELP_STRING([--disable-npapi], [Disable NPAPI plugin build (default: enabled if gtk or kde4 gui is)]),
1960   [case "${enableval}" in
1961     yes) npapi=yes ;;
1962     no)  npapi=no ;;
1963     *)   AC_MSG_ERROR([bad value ${enableval} for disable-npapi option]) ;;
1964   esac],
1965   if test x$build_gtk = xyes -o x$build_kde4 = xyes; then
1966     npapi=yes
1967   fi
1970 dnl -----------------------------------------------------------------
1971 dnl Enable us to disable building all browser plugins in one command.
1972 dnl -----------------------------------------------------------------
1974 AC_ARG_ENABLE(plugins,
1975   AC_HELP_STRING([--disable-plugins], [Disable all browser plugins from building (default=no)]),
1976   [case "${enableval}" in
1977     yes) plugins=yes ;;
1978     no)  plugins=no ;;
1979     *)   AC_MSG_ERROR([bad value ${enableval} for disable-plugins option]) ;;
1980   esac],
1981   plugins=yes
1983 if test x$plugins = xno; then
1984   npapi=no
1985   build_kparts3=no
1986   build_kparts4=no
1990 GNASH_PATH_FIREFOX
1992 dnl -----------------------------------------------------------------
1993 dnl END OF PLUGIN RELATED STUFF
1994 dnl -----------------------------------------------------------------
1996 dnl IRIX-hack.
1997 case $host in
1998   *-*-irix*)
1999   dnl ABI-check
2000   save_LIBS=$LIBS
2001   dir="/usr/lib /usr/lib32 /usr/lib/lib64"
2002   for i in $dir; do
2003     LIBS=-L$i
2004     AC_SEARCH_LIBS(XDisableAccessControl, X11, [
2005       xpathed=$i
2006       break
2007     ])
2008     unset ac_cv_search_XDisableAccessControl
2009   done
2010   ac_x_libraries=$xpathed
2011   x_libraries=$xpathed
2012   LIBS=$save_LIBS
2013   ;;
2014 esac
2016 AM_CONDITIONAL(LIRC, [test x$lirc_ext = xyes])
2018 AC_CHECK_HEADERS(endian.h machine/endian.h)
2019 AC_CHECK_HEADERS(malloc.h malloc/malloc.h)
2020 AC_CHECK_HEADERS(getopt.h)
2021 AC_CHECK_HEADERS(libgen.h)
2022 AC_CHECK_HEADERS(pwd.h)
2023 AC_CHECK_HEADERS(sys/utsname.h)
2024 AC_CHECK_HEADERS(signal.h)
2025 AC_CHECK_HEADERS(unistd.h)
2026 AC_CHECK_HEADERS(sys/time.h)
2027 AC_CHECK_HEADERS(ieeefp.h)
2028 dnl libcurl3-dev on Ubuntu has a dependency on lber, and Gnash won't link
2029 dnl on most machines without it. While it isn't diretly used by Gnash at all,
2030 dnl it's to work around an Ubuntu packaging bug.
2031 AC_CHECK_LIB(lber, ber_free)
2032 AC_CHECK_LIB(bz2, BZ2_bzopen)
2033 AC_CHECK_LIB(c, getpwnam, AC_DEFINE(HAVE_GETPWNAM, 1, [Has getpwnam] ))
2035 dnl X11 is needed for fltk (at least),
2036 dnl and probably for many other guis too ...
2037 dnl if ! test x$build_fb = xyes; then # <--- this is wrong as build_x is non-exclusive
2038 dnl AC_PATH_XTRA
2039 dnl AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation)
2040 dnl AC_CHECK_LIB(gmp, _gmp_get_memory_functions)
2041   GNASH_PATH_X11
2042   AC_CHECK_LIB(Xi, XInput_find_display)
2043   AC_CHECK_LIB(X11, XDisableAccessControl)
2044 dnl fi
2045 AM_CONDITIONAL(HAVE_X11, [test x$x11 = xyes])
2046 AC_CHECK_LIB(rt, shm_unlink)
2047 AC_CHECK_FUNCS(shm_open shm_unlink)
2048 AC_TRY_COMPILE([#include <strings.h>], [
2049   char *p1 = (char *)"Hello";
2050   char *p2 = (char *)"World";
2051   strcasecmp(p1, p2); ],
2052   AC_DEFINE(HAVE_STRINGCASECMP, [1], [Has strcasecmp])
2055 dnl if test x$cross_compiling = xno; then
2056 AC_LANG_PUSH(C++)
2057 AC_MSG_CHECKING([to see if float formatting is broken])
2058 AC_RUN_IFELSE([
2059   AC_LANG_PROGRAM([#include <cmath>
2060     void testFloat(double d, double& s)
2061     {
2062         d /= 1000.0;
2063         s = std::fmod(d, 86400.0);
2064     }], [
2065      double d = 3.0935415006117e+23;
2066      double s;
2067      testFloat(d, s);
2068      if (static_cast<int>(s) != 61440) {
2069          return 1;
2070      }])],                         dnl end of LANG_PROGRAM
2071      broken_float=no,              dnl returns 0, works
2072      broken_float=yes,             dnl returns 1, broken
2073      broken_float=no               dnl cross compiling
2074 )                                  dnl end of RUN_IFELSE
2075 AC_LANG_POP(C++)
2076 dnl fi
2078 if test x${broken_float} = xyes; then
2079   AC_MSG_RESULT([yes])
2080   AC_DEFINE(HAVE_BROKEN_FLOAT, [1], [Has broken float support])
2081 else
2082   AC_MSG_RESULT([no])
2084 AM_CONDITIONAL(BROKEN_FLOAT, [ test x$broken_float = xyes ])
2086 dnl See if ipc_perm structure has the ipc_perm.key field, and if so,
2087 dnl which variant of the name is used.
2088 ipc_key=no
2089 AC_TRY_COMPILE([
2090   #include <sys/ipc.h>
2091   #include <sys/shm.h>], [
2092  struct shmid_ds shmseg;      
2093  key_t x = shmseg.shm_perm.key;],
2094  ipc_key=yes
2095  AC_DEFINE(IPC_PERM_KEY, [key], [Has the key field in ipc_perm])
2098 if test x$ipc_key = xno; then
2099   AC_TRY_COMPILE([
2100     #include <sys/ipc.h>
2101     #include <sys/shm.h>], [
2102     struct shmid_ds shmseg;      
2103     key_t x = shmseg.shm_perm.__key;],
2104     AC_DEFINE(IPC_PERM_KEY, [__key], [Has the key field in ipc_perm])
2105     ipc_key=yes
2106   )
2109 dnl AC_CHECK_FUNCS(strcasecmp stricmp)
2110 dnl AC_CHECK_FUNCS(vsnprintf)
2112 AC_CACHE_CHECK([for finite], ac_cv_finite,
2113  [AC_TRY_COMPILE([
2114    #include <math.h>
2115    #ifdef HAVE_IEEEFP_H
2116    #include <ieeefp.h>
2117    #endif],
2118  [double x; int y; y = finite(x);],
2119  ac_cv_finite=yes,
2120  ac_cv_finite=no
2122 if test x"$ac_cv_finite" = x"yes"; then
2123   AC_SEARCH_LIBS(finite, m,
2124     [AC_DEFINE(HAVE_FINITE, [1], [Has finite])]
2125   )
2128 AC_LANG_PUSH(C++)
2129 AC_CACHE_CHECK([for isfinite], ac_cv_isfinite,
2130  [AC_TRY_COMPILE([#include <cmath>],
2131  [using namespace std; double x; int y; y = isfinite(x);],
2132  ac_cv_isfinite=yes,
2133  ac_cv_isfinite=no
2135 AC_LANG_POP(C++)
2136 if test x"$ac_cv_isfinite" = x"yes"; then
2137   dnl Don't give up if isfinite is not found in -lm
2138   dnl isfinite is defined as a macro in C99.
2139   AC_SEARCH_LIBS(isfinite, m)
2140   AC_DEFINE(HAVE_ISFINITE, [1], [Has isfinite])
2143 AC_LANG_PUSH(C++)
2144 AC_CACHE_CHECK([whether $CXX implements __PRETTY_FUNCTION__], ac_cv_implements___PRETTY_FUNCTION__, [
2145   AC_TRY_LINK([#include <cstdio>
2146 ], 
2147     [ std::printf("%s", __PRETTY_FUNCTION__); ], 
2148     [ ac_cv_implements___PRETTY_FUNCTION__="yes" ],
2149     [ ac_cv_implements___PRETTY_FUNCTION__="no" ]
2150   )
2152 if test "x$ac_cv_implements___PRETTY_FUNCTION__" = "xyes" ; then
2153   AC_DEFINE(HAVE_PRETTY_FUNCTION, [1], [__PRETTY_FUNCTION__ is defined])
2156 AC_CACHE_CHECK([whether $CXX implements __FUNCTION__], ac_cv_implements___FUNCTION__, [
2157   AC_TRY_LINK([#include <cstdio>
2158 ], 
2159     [ std::printf("%s", __FUNCTION__); ], 
2160     [ ac_cv_implements___FUNCTION__="yes" ],
2161     [ ac_cv_implements___FUNCTION__="no" ]
2162   )
2164 if test "x$ac_cv_implements___FUNCTION__" = "xyes" ; then
2165   AC_DEFINE(HAVE_FUNCTION, [1], [__FUNCTION__ is defined])
2168 AC_CACHE_CHECK([whether $CXX implements __func__], ac_cv_implements___func__, [
2169   AC_TRY_LINK([#include <cstdio>
2170 ], 
2171     [ std::printf("%s", __func__); ], 
2172     [ ac_cv_implements___func__="yes" ],
2173     [ ac_cv_implements___func__="no" ]
2174   )
2176 if test "x$ac_cv_implements___func__" = "xyes" ; then
2177   AC_DEFINE(HAVE_func, [1], [__func__ is defined])
2179 AC_LANG_POP(C++)
2180 AC_REPLACE_FUNCS(getopt)
2182 dnl Date portability stuff, used in server/asobj/Date.cpp
2183 AC_CHECK_FUNCS(gettimeofday)
2184 AC_CHECK_FUNCS(ftime)
2185 AC_CHECK_FUNCS(tzset)
2186 AC_CHECK_FUNCS(localtime_r)
2188 AC_CACHE_CHECK([whether struct tm has tm_gmtoff], ac_cv_tm_gmtoff, [
2189         AC_TRY_LINK([
2190 /* ctime(1) says "The glibc version of struct tm has additional fields
2191  * defined  when _BSD_SOURCE was set before including <time.h>"
2192  * In practice, you don't need to define it yourself (tested on glibc-2.2.1 
2193  * and 2.3.6) but if you *do* define it yourself, it makes *all* functions
2194  * favour BSD-like behaviour over of GNU/POSIX, which seems dangerous.
2195  */
2196 // #define _BSD_SOURCE 1
2197 #include <time.h>
2198 ], 
2199                 [ struct tm tm; long l = tm.tm_gmtoff; ], 
2200                 [ ac_cv_tm_gmtoff="yes" ],
2201                 [ ac_cv_tm_gmtoff="no" ]
2202         )
2204 if test "x$ac_cv_tm_gmtoff" = "xyes" ; then
2205         AC_DEFINE(HAVE_TM_GMTOFF, [1], [struct tm has member tm_gmtoff])
2208 AC_CACHE_CHECK([whether timezone is a long], ac_cv_long_timezone, [
2209         AC_TRY_LINK([
2210 /* On Linux/glibc, tzset(3) says "extern long timezone;" (seconds West of GMT)
2211  * but on BSD char *timezone(int,int) is a function returning a string name.
2212  * The BSD function timegm() may be the equivalent, but this should
2213  * not be necessary because on BSD the code should use tm.tm_gmtoff instead
2214  * (use of long timezone is a fallback strategy for when tm_gmtoff exists not).
2215  */
2216 #include <stdio.h>
2217 #include <time.h>
2218 extern long timezone;
2219   ], 
2220     [ printf("%ld", timezone); ], 
2221     [ ac_cv_long_timezone="yes" ],
2222     [ ac_cv_long_timezone="no" ]
2223    )
2225 if test "x$ac_cv_long_timezone" = "xyes" ; then
2226   AC_DEFINE(HAVE_LONG_TIMEZONE, [1], [extern timezone is a long integer, not a function])
2229 AC_CHECK_FUNCS(sysconf)
2230 AC_CHECK_FUNCS(shmget shmat shmdt mmap)
2231 AC_CHECK_FUNCS(memmove)
2232 AC_CHECK_FUNCS(scandir)         dnl supported by BSD and Linux, but you never know...
2233 dnl AC_CHECK_FUNC(strndup, AC_DEFINE(HAVE_STRNDUP, 1, [Has strndup()] ))
2234 AC_CHECK_FUNC(clock_gettime, AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Has clock_gettime()] ))
2235 dnl AC_CHECK_FUNCS(strlcpy, AC_DEFINE(HAVE_STRLCPY_PROTO, [1],[Define if you have the strlcpy prototype]))
2236 dnl AC_CHECK_FUNCS(strlcat, AC_DEFINE(HAVE_STRLCAT_PROTO, [1],[Define if you have the strlcat prototype]))
2237 dnl Look for Win32 networking stuff
2238 AC_CHECK_HEADERS(winsock.h)
2239 AC_CHECK_HEADERS(winsock2.h)
2240 AC_CHECK_FUNCS(socket)
2241 AC_CHECK_FUNCS(CreateFileMappingA)
2243 dnl Shm::resize() uses this if it exists
2244 AC_CHECK_LIB(c, mremap)
2246 GNASH_PKG_FIND(nspr, [nspr.h], [Netscape Portable Runtime (NSPR)], PR_Init)
2248 AC_PATH_TOOL(WINDRES, [windres])
2249 AC_SUBST(WINDRES)
2251 GNASH_PKG_FIND(z, [zlib.h], [zlib compression library], compress)
2252 GNASH_PKG_FIND(jpeg, [jpeglib.h], [jpeg images], jpeg_mem_init)
2253 if test x"${openbsd_os}" = x"yes"; then
2254   GNASH_PKG_FIND(libpng, [png.h], [png images], png_info_init)
2255 else
2256   GNASH_PKG_FIND(png, [png.h], [png images], png_info_init)
2258 GNASH_PKG_FIND(gif, [gif_lib.h], [gif images], DGifOpen)
2259 if test x"${GIF_LIBS}" = x ; then
2260  GNASH_PKG_FIND(ungif, [gif_lib.h], [gif images], DGifOpen)
2261  GIF_LIBS=${UNGIF_LIBS}
2262  GIF_CFLAGS=${UNGIF_CFLAGS}
2264 if test x"$testsuite" = x"yes"; then
2265   GNASH_PKG_INCLUDES([dejagnu], [dejagnu.h])
2268 GNASH_PKG_FIND(speex, [speex.h], [speex audio codec], speex_decode_int)
2269 AM_CONDITIONAL(HAVE_SPEEX, [ test x$has_speex = xyes ])
2270 if test x$has_speex = xyes ; then
2271   AC_DEFINE([DECODING_SPEEX], [1], [Speex codec available])
2274 GNASH_PKG_FIND(speexdsp, [speex_resampler.h], [speex DSP utilities], speex_resampler_process_int)
2275 if test x$has_speexdsp = xyes ; then
2276   AC_DEFINE([RESAMPLING_SPEEX], [1], [Speex resampler available])
2279 dnl Find freetype and fontconfig
2280 GNASH_PATH_FREETYPE2
2281 GNASH_PKG_FIND(fontconfig, [fontconfig/fontconfig.h], [fontconfig library], FcFontMatch)
2283 if test x$cross_compiling = xno; then
2284   AC_PATH_MING
2287 if test x"$MING_VERSION_CODE" = x; then
2288  MING_VERSION_CODE=00000000
2291 AM_CONDITIONAL(ENABLE_MING,
2292         [ test x"$MAKESWF" != x -a $MING_VERSION_CODE -gt 00040000 ])
2294 AM_CONDITIONAL(MING_VERSION_0_4,
2295         [ test $MING_VERSION_CODE -ge 00040000  ])
2296 AM_CONDITIONAL(MAKESWF_SUPPORTS_PREBUILT_CLIPS,
2297         [ test $MING_VERSION_CODE -ge 00040002  ])
2298 AM_CONDITIONAL(MING_SUPPORTS_INIT_ACTIONS,
2299         [ test $MING_VERSION_CODE -ge 00040004  ])
2300 AM_CONDITIONAL(MING_SUPPORTS_REPLACE_TAG,
2301         [ test $MING_VERSION_CODE -ge 00040005 ])
2302 AM_CONDITIONAL(MING_SUPPORTS_SWFBUTTON_ADD_CHARACTER,
2303         [ test $MING_VERSION_CODE -ge 00040005 ])
2304 AM_CONDITIONAL(MING_SUPPORTS_STREAMING_SOUND,
2305         [ test $MING_VERSION_CODE -ge 00040006 ])
2306 AM_CONDITIONAL(MING_SUPPORTS_SWFBUTTON_SET_DEPTH,
2307         [ test $MING_VERSION_CODE -ge 00040006 ])
2308 AM_CONDITIONAL(MING_VERSION_0_4_3,
2309         [ test $MING_VERSION_CODE -ge 00040300 ])
2310 AM_CONDITIONAL(MING_VERSION_0_4_4,
2311         [ test $MING_VERSION_CODE -ge 00040400 ])
2313 if test x$cross_compiling = xno; then
2314     AC_ARG_WITH([swfdec_testsuite],
2315         AC_HELP_STRING([--with-swfdec-testsuite],
2316             [directory where swfdec testsuite (the 'test' dir) is]),
2317         if test x"${withval}" = xyes; then
2318             dir=`dirname $0`
2319             dir=`cd ${dir} && pwd`
2320             withval="${dir}/testsuite/swfdec/src/test"
2321         fi
2322         SWFDEC_TESTSUITE=${withval}
2323     )
2324     AC_SUBST(SWFDEC_TESTSUITE)
2326 AM_CONDITIONAL(ENABLE_SWFDEC_TESTSUITE, [ test x"$SWFDEC_TESTSUITE" != x ])
2328 if test x$cross_compiling = xno; then
2329   AC_ARG_ENABLE([http_testsuite],
2330       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2331           AC_HELP_STRING([--enable-http-testsuite=<baseurl>],
2332                   [Enable http based testsuite (default url is http://www.gnashdev.org/testcases)]),
2333               [case "${enableval}" in
2334              no) HTTP_TESTSUITE="" ;;
2335             yes) HTTP_TESTSUITE="http://www.gnashdev.org/testcases" ;;
2336               *) HTTP_TESTSUITE="${enableval}";;
2337            esac])
2338   AC_SUBST(HTTP_TESTSUITE)
2340 AM_CONDITIONAL(ENABLE_HTTP_TESTSUITE, [ test x"$HTTP_TESTSUITE" != x ])
2342 if test x$cross_compiling = xno; then
2343   AC_ARG_ENABLE([red5_testing],
2344       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2345           AC_HELP_STRING([--enable-red5-testing=<host>],
2346                   [Enable red5 based testing (default host is www.gnashdev.org)]),
2347               [case "${enableval}" in
2348              no) RED5_HOST="" ;;
2349             yes) RED5_HOST="www.gnashdev.org" ;;
2350               *) RED5_HOST="${enableval}";;
2351            esac])
2352   AC_SUBST(RED5_HOST)
2354 AM_CONDITIONAL(ENABLE_RED5_TESTING, [ test x"$RED5_HOST" != x ])
2356 if test x$cross_compiling = xno; then
2357   AC_ARG_ENABLE([rtmpy_testing],
2358       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2359           AC_HELP_STRING([--enable-rtmpy-testing=<host>],
2360                   [Enable rtmpy based testing (default host is www.gnashdev.org)]),
2361               [case "${enableval}" in
2362              no) RTMPY_HOST="" ;;
2363             yes) RTMPY_HOST="www.gnashdev.org" ;;
2364               *) RTMPY_HOST="${enableval}";;
2365            esac])
2366   AC_SUBST(RTMPY_HOST)
2368 AM_CONDITIONAL(ENABLE_RTMPY_TESTING, [ test x"$RTMPY_HOST" != x ])
2370 dnl The name might differ between systems.
2371 if test x"$testsuite" = x"yes"; then
2372 AC_PATH_PROGS(NETCAT, [nc netcat])
2373 AC_PATH_PROG(WGET, wget)
2375 AM_CONDITIONAL(HAS_NETCAT, [ test x"$NETCAT" != x ])
2376 AM_CONDITIONAL(HAS_WGET, [ test x"$WGET" != x ])
2379 dnl See if we can use the swfmill, mtasc, swfc and haxe based testsuites 
2381 if test x"$testsuite" = x"yes" -a x$cross_compiling = xno; then
2382   AC_PATH_PROG(AS3COMPILE, as3compile)
2383   AC_PATH_PROG(SWFC, swfc)
2384   AC_PATH_SWFMILL
2385   AC_PATH_MTASC
2386   AC_PATH_HAXE
2389 AM_CONDITIONAL(ENABLE_SWFMILL, [ test x"$SWFMILL" != x ])
2390 AM_CONDITIONAL(SWFMILL_AS3_SUPPORT,
2391         [ test x"$SWFMILL" != x && test $SWFMILL_VERSION -ge 00021206 ])
2393 dnl SWFMILL versions older than 0.3 didn't get function2 flags order correctly
2394 AM_CONDITIONAL(SWFMILL_FUNCTION2_FLAGS_ORDER_CORRECT,
2395         [ test x"$SWFMILL" != x && test $SWFMILL_VERSION -ge 00021206 ])
2397 AM_CONDITIONAL(ENABLE_AS3COMPILE, [ test x"$AS3COMPILE" != x ])
2398 AM_CONDITIONAL(ENABLE_MTASC, [ test x"$MTASC" != x ])
2399 AM_CONDITIONAL(ENABLE_HAXE, [ test x"$HAXE" != x ])
2400 AM_CONDITIONAL(ENABLE_SWFC, [ test x"$SWFC" != x ])
2401 AM_CONDITIONAL(ENABLE_HAXE, [ test x"$HAXE" != x ])
2403 AC_PATH_PROG(DOXYGEN, doxygen)
2404 AM_CONDITIONAL(ENABLE_DOXYGEN, [ test x"$DOXYGEN" != x ])
2406 dnl currently unused
2407 dnl GNASH_PKG_FIND(ogg, [ogg.h], [decode ogg streams], ogg_stream_init)
2409 dnl Qtopia is a desktop environment for embedded devices.
2410 dnl GNASH_PATH_QTOPIA3
2411 dnl GNASH_PATH_QTOPIA4
2412 has_qtopia3=no
2413 has_qtopia4=no
2416 AM_CONDITIONAL(HAVE_QTOPIA3, [test x$has_qtopia3 = xyes])
2417 AM_CONDITIONAL(HAVE_QTOPIA4, [test x$has_qtopia4 = xyes])
2418 AM_CONDITIONAL(HAVE_KDE3,    [test x$has_kde3 = xyes])
2419 AM_CONDITIONAL(HAVE_KDE4,    [test x$has_kde4 = xyes])
2420 AM_CONDITIONAL(HAVE_QT3,     [test x$has_qt3 = xyes])
2421 AM_CONDITIONAL(HAVE_QT4,     [test x$has_qt4 = xyes])
2423 AM_CONDITIONAL(WITH_KDE4,    [test "$with_kde4" != "no"])
2424 AM_CONDITIONAL([QT_X11],     [test "$platform" = "X11"])
2425 AM_CONDITIONAL([QTOPIA],     [test "$platform" = "Qtopia"])
2426 AM_CONDITIONAL([QT_OSX],     [test "$platform" = "OSX"])
2427 AM_CONDITIONAL([QT_OS9],     [test "$platform" = "OS9"])
2428 AM_CONDITIONAL([QT_WIN32],   [test "$platform" = "Win32"])
2430 dnl Need GLIB for both GTK and GST
2431 if test x"${build_gtk}" = xyes -o x"${build_media_gst}" = xyes; then
2432   GNASH_PATH_GLIB
2435 AM_CONDITIONAL(HAVE_GLIB, [ test x"${has_glib}" = xyes ])
2437 if test x$npapi = xyes; then
2438   if ! test x$build_gtk = xyes -o x$build_kde4 = xyes; then
2439     AC_MSG_WARN(["Enabled NPAPI plugin, but it's not supported by the selected GUI"])
2440   fi
2443 if test x$windows = xyes -a x$npapi = xyes; then
2444   if test "x$NSPR_CFLAGS" = x -a "x$NSPR_LIBS" = x; then
2445     AC_MSG_ERROR(["On Win32, NPAPI plugin requires NSPR."])
2446   fi
2447   if test "x$WINDRES" = x; then
2448     AC_MSG_ERROR(["On Win32, NPAPI plugin requires windres."])
2449   fi
2452 dnl Need GLIB for NPAPI plugin
2453 if test x$npapi = xyes; then
2454   GNASH_PATH_GLIB
2457 dnl if kde isn't installed, even if it's specified, don't try to build
2458 dnl the KPARTS plugin, which is KDE based.
2459 if test x$has_kde3 = xno -a x$build_kparts3 = xyes; then
2460   build_kparts3=no
2461 dnl  build_kde3=no
2462   AC_MSG_WARN(["Disabling KPARTS 3.x plugin, no KDE development found"])
2465 if test x$build_kde3 = xno -a x$build_kparts3 = xyes; then
2466   AC_MSG_WARN(["Enabled KPARTS 3.x plugin, but you aren't building a KDE based GUI!"])
2468 if test x$has_kde4 = xno -a x$build_kparts4 = xyes; then
2469   build_kparts4=no
2470 dnl  build_kde4=no
2471   AC_MSG_WARN(["Disabling KPARTS 4.x plugin, no KDE 4.x development found"])
2474 if test x$build_kde4 = xno -a x$kparts4 = xyes; then
2475   AC_MSG_WARN(["Enabled KPARTS 4.x plugin, but you aren't building a KDE 4.x based GUI!"])
2478 AM_CONDITIONAL(BUILD_QTOPIA3_GUI,  [ test x$build_qtopia3 = xyes ])
2479 AM_CONDITIONAL(BUILD_QTOPIA4_GUI,  [ test x$build_qtopia4 = xyes ])
2481 dnl Drop these conditionals ?
2482 AM_CONDITIONAL(BUILD_QT3_GUI,
2483     [ test x"${build_kde3}" = xyes -o x"${build_qtopia3}" = xyes ])
2484 AM_CONDITIONAL(BUILD_QT4_GUI,
2485     [ test x"${build_kde4}" = xyes -o x"${build_qtopia4}" = xyes ])
2487 AM_CONDITIONAL(BUILD_KDE3_GUI,     [ test x$build_kde3 = xyes ])
2488 AM_CONDITIONAL(BUILD_KDE4_GUI,     [ test x$build_kde4 = xyes ])
2490 AM_CONDITIONAL(BUILD_GTK_GUI,      [ test x$build_gtk = xyes ])
2491 AM_CONDITIONAL(BUILD_FLTK_GUI,     [ test x$build_fltk = xyes ])
2492 AM_CONDITIONAL(BUILD_SDL_GUI,      [ test x$build_sdl = xyes ])
2493 AM_CONDITIONAL(BUILD_FB_GUI,       [ test x$build_fb = xyes ])
2494 AM_CONDITIONAL(BUILD_AQUA_GUI,     [ test x$build_aqua = xyes ])
2495 AM_CONDITIONAL(ALLSTATIC,          [ test x$build_aqua = xyes ]) dnl the Aqua-binary is always static.
2496 AM_CONDITIONAL(BUILD_RISCOS_GUI,   [ test x$build_riscos = xyes ])
2497 AM_CONDITIONAL(BUILD_DUMP_GUI,     [ test x$build_dump = xyes ])
2498 AM_CONDITIONAL(BUILD_AMIGAOS4_GUI, [ test x$build_aos4 = xyes ])
2499 AM_CONDITIONAL(BUILD_HAIKU_GUI,    [ test x$build_haiku = xyes ])
2501 # plugin building flags
2502 AM_CONDITIONAL(NPAPI,   [test x"${npapi}" = xyes])
2503 AM_CONDITIONAL(KPARTS3, [test x"${build_kparts3}" = xyes])
2504 AM_CONDITIONAL(KPARTS4, [test x"${build_kparts4}" = xyes])
2506 if test x"${build_gles}" = xyes; then
2507   GNASH_PKG_FIND(EGL, [EGL/egl.h], [EGL library], eglGetDisplay)
2508   GNASH_PATH_GLES
2511 if test x"${build_ogv}" = xyes; then
2512   GNASH_PKG_FIND(EGL, [EGL/egl.h], [EGL library], eglGetDisplay)
2513   GNASH_PKG_FIND(OpenVG, [vg/openvg.h], [OpenVG library], vgDrawImage)
2516 if test x"${build_gtk}" = xyes; then
2517   AC_ARG_ENABLE(ghelp,
2518     AC_HELP_STRING([--enable-ghelp], [Enable support for the GNOME help system]),
2519     [case "${enableval}" in
2520       yes) ghelp=yes ;;
2521       no)  ghelp=no ;;
2522       *)   AC_MSG_ERROR([bad value ${enableval} for enable-ghelp option]) ;;
2523     esac], ghelp=no
2524   )
2526   if test x"${ghelp}" = x"yes" ; then
2527     AC_PATH_PROG(SCROLLKEEPER, scrollkeeper-config, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2528     AC_PATH_PROG(SCROLLUPDATE, scrollkeeper-update, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2529     AC_PATH_PROG(SCROLLINSTALL, scrollkeeper-preinstall, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2531     if test x"$SCROLLKEEPER" = x -o x"$SCROLLUPDATE" = x -o x"$SCROLLINSTALL" = x ; then
2532       ghelp=no
2533       AC_MSG_WARN([You need to install scrollkeeper for gnome help])
2534     fi
2535   fi
2537 AM_CONDITIONAL(GHELP, [test x${ghelp} = xyes])
2539 if test x${build_fltk} = xyes; then
2540   GNASH_PKG_FIND(Xft, [Xft.h], [xft library], XftGlyphRender)
2543 dnl Some systems have a pervered set of dependencies.
2544 dnl Fedora Core 6 appears to have a dependency on expat for fontconfig.
2545 dnl We only need the library, but this is the easy wind to find it.
2546 GNASH_PKG_FIND(expat, [expat.h], [Expat library], XML_ErrorString)
2548 dnl these conditionals were moved out of kde.m4
2549 AM_CONDITIONAL(HAS_KDE3, [test x$has_kde3 = xyes])
2550 # used to disable x11-specific stuff on special platforms
2551 AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
2552 AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
2553 AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
2555 AM_CONDITIONAL(HAVE_GLEXT, [test x$glext = xyes])
2557 dnl We don't have GTKGLExt, so default to SDL, and don't build the Firefox plugin
2558 if test x$glext = xno -a x$build_ogl = xyes; then
2559   if test x$gtk2 = xyes -a x$build_gtk = xyes; then
2560     AC_ERROR([You have GTK installed, but not GtkGLExt. You need GtkGLExt to use the OpenGL renderer. Attempting to build SDL version])
2561   fi
2562   gui=sdl
2563   npapi=no
2564   AC_MSG_WARN([GTK2 specified for the GUI, but GtkGlExt is not present. Trying SDL instead.])
2567 missing_codecs=""
2568 if test x"$build_media_gst" = "xyes"; then
2569   AC_PATH_PROG(GST_INSPECT, gst-inspect, ,[${pathlist}])
2570   if test "x$GST_INSPECT" != "x" -a x"${darwin}" = xno ; then
2571     AC_PATH_PROG(GST_INSPECT, gst-inspect-0.10, ,[${pathlist}])
2572   fi
2573   if test "x$GST_INSPECT" != "x" -a x"${darwin}" = xno ; then
2574     dnl FIXME: there may be multiple acceptable plugins that are acceptable for
2575     dnl our use. For example, mad or FFmpeg will play mp3.
2576     codecs="ffdec_flv ffdec_flashsv ffdec_vp6f ffdec_flashsv mad vorbisdec ffdec_vp6"
2577     for i in $codecs; do
2578        hits="`$GST_INSPECT $i | grep -c 'Long name'`"
2579        if test $hits -eq 0; then
2580          missing_codecs="$missing_codecs $i"
2581          AC_MSG_WARN([Missing codec: $i])
2582        fi
2583     done
2584   fi
2585   GNASH_PKG_FIND(gstreamer_plugins_base, [gst/interfaces/probeprobe.h], [gstreamer interfaces library], gst_property_probe_probe_and_get_values_name, [0.10])
2586   GNASH_PKG_FIND(gstreamer_app, [gst/app/gstappsink.h], [gstreamer app library], call_gmon_start, [0.10])
2587   GNASH_PKG_FIND(gstreamer, [gst/gst.h], [gstreamer library], gst_init, [0.10])
2588   dnl if cross compiling, we're usually not going to be able to pop up
2589   dnl the codec installer to download the package to install, so disable
2590   dnl it if cross compiling with gstreamer support.
2591   if test x$cross_compiling = xno; then
2592     GNASH_PKG_FIND(gstreamer_pbutils, [gst/pbutils/install-plugins.h], [gstreamer PB Utils library], gst_install_plugins_supported, [0.10])
2593   fi
2594   dnl when cross compiling Gstreamer, not all supplied SDKs include all the
2595   dnl development libraries since most devices don't need to support plugin
2596   dnl development, only the runtime. In these caes we often have the header
2597   dnl files but not the libraries.
2598   if test x"${has_gstreamer_plugins_base}" = xyes; then
2599     GSTREAMER_LIBS="-lgstinterfaces-0.10 $GSTREAMER_LIBS"
2600     AC_DEFINE(HAS_GSTREAMER_PLUGINS_BASE, [1], [Has the Gstreamer Plugin Dev package installed])
2601   fi
2604 AM_CONDITIONAL(HAVE_CAIRO, [true])
2605 dnl AM_CONDITIONAL(HAVE_CAIRO, [test x"${has_cairo}" = xyes])
2606 AM_CONDITIONAL(HAVE_OPENGL, [true])
2607 dnl AM_CONDITIONAL(HAVE_OPENGL, test x"${has_opengl}" = xyes)
2609 AM_CONDITIONAL(USE_SOUND_SDL, test x$build_sound_sdl = xyes)
2610 AM_CONDITIONAL(USE_SOUND_AHI, test x$build_sound_ahi = xyes)
2611 AM_CONDITIONAL(USE_SOUND_MKIT, test x$build_sound_mkit = xyes)
2612 AM_CONDITIONAL(USE_FFMPEG_ENGINE, test x"${build_media_ffmpeg}" = x"yes")
2613 AM_CONDITIONAL(USE_GST_ENGINE, test x"${build_media_gst}" = x"yes")
2614 AM_CONDITIONAL(HAVE_OPENGL, test x"${OPENGL_LIBS}" != x)
2615 dnl for now the Haiku media handler is experimental
2616 AM_CONDITIONAL(USE_HAIKU_ENGINE, test x"$build_media_haiku" = xyes)
2618 if test x"${build_media_ffmpeg}" = x"yes"; then
2619   AC_DEFINE([ENABLE_FFMPEG_MEDIA],  [1], [Use FFmpeg for media decoding])
2622 if test x"${build_media_gst}" = x"yes"; then
2623   AC_DEFINE([ENABLE_GST_MEDIA],  [1], [Use gstreamer for media decoding])
2626 if test x"${build_media_haiku}" = x"yes"; then
2627   AC_DEFINE([ENABLE_HAIKU_MEDIA],  [1], [Use haiku for media decoding])
2630 if test x$build_sound_mkit = xyes; then
2631   if test x"${haiku}" != xyes; then
2632     AC_MSG_ERROR([Media Kit sound handling is supported only under Haiku]);
2633   else
2634     AC_DEFINE([SOUND_MKIT],  [1], [Use Haiku's Media Kit for sound handling])
2635   fi
2638 if test x"${build_sound_sdl}" = xyes; then
2639   AC_DEFINE([SOUND_SDL],  [1], [Use SDL for sound handling])
2642 if test x"${build_sound_ahi}" = xyes; then
2643   if test x"$amigaos4" != xyes; then
2644     AC_MSG_ERROR([AHI sound handling is supported only under AmigaOS]);
2645   else
2646     AC_DEFINE([SOUND_AHI],  [1], [Use AmigaOS AHI for sound handling])
2647   fi
2650 if test x$build_fltk = xyes; then
2651   GNASH_PKG_FIND(fltk2, [fltk/FL_API.h], [Fast Light Toolkit], fl_window_flush)
2654 AM_CONDITIONAL(HAVE_FLTK2, [ test x$has_fltk2 = xyes ])
2655 AM_CONDITIONAL(HAS_XFT, [ test x$has_xft = xyes ])
2657 GNASH_DOCBOOK
2658 AM_CONDITIONAL(ENABLE_INFO, test x${INSTALL_INFO} != x)
2659 AM_CONDITIONAL(DOCBOOK, test x$docbook = xyes)
2660 AM_CONDITIONAL(ENABLE_TEXI, [ test x"$DB2X_TEXI" != x -o x"$DB2X_TEXIXML" != x ])
2661 AM_CONDITIONAL(ENABLE_PDF, [ test x"$DB2X_PDF" ])
2662 AM_CONDITIONAL(ENABLE_HTML, [ test x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
2663 AM_CONDITIONAL(ENABLE_FOP, [ test x"$FOP" != x -a x"$docbook_styles" != x ])
2664 AM_CONDITIONAL(ENABLE_XMLTEX, [ test x"$PDFXMLTEX" != x -a x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
2665 dnl  AM_CONDITIONAL(ENABLE_DBLATEX, [ test x"$DBLATEX" != x ])
2666 AM_CONDITIONAL(ENABLE_MAN, [ test x"$DB2X_MAN" != x -o x"$DB2X_MANXML" != x ])
2667 AM_CONDITIONAL(HAVE_AGG, [test x"${AGG_LIBS}" != x])
2669 GNASH_PATH_CURL
2671 dnl Define winsock if we're on windows. We could do something complicated,
2672 dnl but since AC_EXEEXT does it for us, we'll do this the easy way.
2673 if test x"$EXEEXT" = "exe"; then
2674   AC_DEFINE(HAVE_WINSOCK,1,[This is defined is we are on Win32])
2677 dnl ****************************************
2678 dnl *** Check for ELF visibility support ***
2679 dnl ****************************************
2681 AC_ARG_ENABLE([visibility],
2682   AC_HELP_STRING([--enable-visibility], [Use ELF visibility attributes]), [], [enable_visibility=no])
2684 if test x"$enable_visibility" != x"no"; then
2685   dnl Check whether the compiler supports the visibility attribute
2686   save_CFLAGS="$CFLAGS"
2687   CFLAGS="$CFLAGS -Wall -Werror"
2688   AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute])
2689   AC_COMPILE_IFELSE(AC_LANG_SOURCE(
2690     [
2691       void __attribute__ ((visibility("default"))) test_default (void) {}
2692       void __attribute__ ((visibility("hidden"))) test_hidden (void) {}
2693       int main (int argc, char **argv) { test_default (); test_hidden (); return 0; }
2694     ]),
2695     [
2696       AC_DEFINE([HAVE_GNUC_VISIBILITY], [1], [Define this for GCC-visibility.])
2697       AC_MSG_RESULT([yes])
2698     ],
2699     [
2700       AC_MSG_RESULT([no])
2701     ]
2702   )
2703   CFLAGS="$save_CFLAGS"
2706 AC_ARG_ENABLE([pch],
2707   AC_HELP_STRING([--enable-pch], [Enable precompiled header support]), [], [enable_pch=no])
2709 AM_CONDITIONAL([ENABLE_PCH], [test x"$enable_pch" != x"no"])
2711 PCH_FLAGS="-include all-includes.h -Winvalid-pch"
2712 AC_SUBST(PCH_FLAGS)
2714 GNASH_PATH_PTHREADS
2716 GNASH_PATH_BOOST
2717 dnl AX_GCC_ARCHFLAG(no)
2719 AC_ARG_ENABLE([strict],
2720   AC_HELP_STRING([--enable-strict],[Accept only standards compliant code (GCC only)]),
2721   [case "${enableval}" in
2722     yes) strict=yes ;;
2723     no) strict=no ;;
2724     *) AC_MSG_ERROR([bad value ${enableval} for --enable-strict option]) ;;
2725   esac],
2726   [strict=no]
2729 if test x"$strict" = x"yes" -a x$build_agg = xyes; then
2730    AC_MSG_ERROR([agg renderer will fail with --enable-strict.]);        
2733 # We want warnings, lots of warnings  :-)
2734 # It should be possible to build with -ansi, not with
2735 # -pedantic because of agg.
2737 # -ansi was actually dropped because it hides 'fileno', which
2738 # is used in a few places
2740 if test x"$GCC" = x"yes"; then
2741   CXXFLAGS="$CXXFLAGS \
2742     $CROSS_CXXFLAGS \
2743     -W \
2744     -Wall \
2745     -Wcast-align \
2746     -Wcast-qual \
2747     -Wpointer-arith \
2748     -Wreturn-type \
2749     -Wnon-virtual-dtor \
2750     -Wunused \
2751     "
2752   CFLAGS="$CFLAGS \
2753     $CROSS_CXXFLAGS \
2754     -W \
2755     -Wall \
2756     -Wcast-align \
2757     -Wcast-qual \
2758     -Wpointer-arith \
2759     -Wreturn-type \
2760     -Wmissing-declarations \
2761     -Wmissing-prototypes \
2762     -Wstrict-prototypes \
2763     "
2764   if test x"$strict" = x"yes"; then
2765     CXXFLAGS="$CXXFLAGS \
2766       -Wextra \   
2767       -pedantic \
2768       -Wno-long-long \
2769       "
2771     CFLAGS="$CFLAGS \
2772       -pedantic \
2773       -Wno-long-long \
2774       -ansi \
2775       "
2776   fi
2779 AC_ARG_ENABLE([cassert],
2780   AC_HELP_STRING([--disable-cassert],[Disable assertion checking]),
2781   [case "${enableval}" in
2782     yes) cassert=yes ;;
2783     no) cassert=no ;;
2784     *) AC_MSG_ERROR([bad value ${enableval} for --enable-cassert option]) ;;
2785   esac],
2786   [cassert=yes]
2789 if test x"$cassert" = x"no"; then
2790     CXXFLAGS="$CXXFLAGS \
2791       -DNDEBUG \
2792       "
2793     CFLAGS="$CFLAGS \
2794       -DNDEBUG \
2795       "
2798 dnl /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
2799 AC_DEFUN([CHECK_VISIBILITY_GCC_BUG],
2800   [
2801     AC_CACHE_CHECK([if -fvisibility-inlines-hidden is broken], ac_cv_gcc_visibility_bug, [
2802         AC_LANG_PUSH(C++)
2803         save_CXXFLAGS=$CXXFLAGS
2804         save_LDFLAGS=$LDFLAGS
2805         CXXFLAGS="-fPIC -fvisibility-inlines-hidden -O0"
2806         LDFLAGS="$LDFLAGS -shared -fPIC"
2808         AC_TRY_LINK(
2809         [          
2810           template<typename CharT>
2811           struct VisTest
2812           {
2813             inline VisTest ();
2814           };
2815           template<typename CharT>
2816           inline VisTest<CharT>::VisTest()
2817         {}
2818         extern template class VisTest<char>;  // It works if we drop that line
2819         int some_function( int do_something ) __attribute__((visibility("default")));
2820         int some_function( int )
2821           {
2822             VisTest<char> a;
2823             return 0;
2824           }
2825         ], [],
2826         ac_cv_gcc_visibility_bug=no, ac_cv_gcc_visibility_bug=yes)
2828         CXXFLAGS=$save_CXXFLAGS
2829         LDFLAGS=$save_LDFLAGS
2830         AC_LANG_POP(C++)
2831       ]
2832     )
2833     if test x$ac_cv_gcc_visibility_bug = xno; then
2834       CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
2835     fi
2836   ]
2839 CHECK_VISIBILITY_GCC_BUG
2841 if test x$ac_cv_gcc_visibility_bug = xno; then
2842   AC_LANG_PUSH(C++)
2843   AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
2844   save_CXXFLAGS=$CXXFLAGS
2845   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
2846   AC_LINK_IFELSE([AC_LANG_PROGRAM()], 
2847                  [ac_cv_gcc_visibility=yes;
2848                   AC_MSG_RESULT([yes])],
2849                  [ac_cv_gcc_visibility=no;
2850                   AC_MSG_RESULT([no])]);
2851   CXXFLAGS="$save_CXXFLAGS"
2852   AC_LANG_POP(C++)
2856 AM_CONDITIONAL(VISIBILITY_WORKS, test x"$ac_cv_gcc_visibility" = xyes)
2858 if test x"$ac_cv_gcc_visibility" = xyes -a x"$enable_visibility" != xno; then
2859   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
2862 dnl Define convienience constants so Gnash can print out the
2863 dnl default configuration of the build.
2864 RENDERER_CONFIG="${renderer_list}"
2865 RENDERER_LIBS=
2866 for rend in `echo "${add_renderer}" | tr ',' ' '`; do
2867         RENDERER_LIBS="${RENDERER_LIBS} \$(top_builddir)/librender/libgnash${rend}.la"
2868 done
2869 dnl echo "RENDERER_LIBS=$RENDERER_LIBS"
2870 AC_SUBST(RENDERER_LIBS)
2871 AC_SUBST(RENDERER_CONFIG)
2873 HWACCEL_CONFIG="${hwaccel_list}"
2874 AC_SUBST(HWACCEL_CONFIG)
2876 dnl check for missing libraries and disable them.
2877 if test x"$BOOST_LIBS" != x; then
2878   if test x"${cygnal_missing_libs}" != x; then
2879     for i in ${cygnal_missing_libs}; do
2880       if test $i = serialization; then
2881         AC_DEFINE([BOOST_MULTI_INDEX_DISABLE_SERIALIZATION], ["1"], [if the library is missing, don't use it.])
2882       fi
2883     done
2884   fi
2887 CYGNAL_PATHS
2889 SUPPORTED_GUIS=
2890 if test x$build_qtopia3 = xyes; then
2891   SUPPORTED_GUIS="${SUPPORTED_GUIS},qtopia3"
2893 if test x$build_qtopia4 = xyes; then
2894   SUPPORTED_GUIS="${SUPPORTED_GUIS},qtopia4"
2896 if test x$build_fb = xyes; then
2897   SUPPORTED_GUIS="${SUPPORTED_GUIS},fb"
2899 if test x$build_fltk = xyes; then
2900   SUPPORTED_GUIS="${SUPPORTED_GUIS},fltk"
2902 if test x$build_kde3 = xyes; then
2903   SUPPORTED_GUIS="${SUPPORTED_GUIS},kde3"
2905 if test x$build_kde4 = xyes; then
2906   SUPPORTED_GUIS="${SUPPORTED_GUIS},kde4"
2908 if test x$build_gtk = xyes; then
2909   SUPPORTED_GUIS="${SUPPORTED_GUIS},gtk"
2911 if test x$build_sdl = xyes; then
2912   SUPPORTED_GUIS="${SUPPORTED_GUIS},sdl"
2914 if test x$build_riscos = xyes; then
2915   SUPPORTED_GUIS="${SUPPORTED_GUIS},riscos"
2917 if test x$build_aqua = xyes; then
2918   SUPPORTED_GUIS="${SUPPORTED_GUIS},aqua"
2920 if test x$build_dump = xyes; then
2921   SUPPORTED_GUIS="${SUPPORTED_GUIS},dump"
2923 if test x$build_aos4 = xyes; then
2924   SUPPORTED_GUIS="${SUPPORTED_GUIS},aos4"
2926 if test x$build_haiku = xyes; then
2927   SUPPORTED_GUIS="${SUPPORTED_GUIS},haiku"
2929 SUPPORTED_GUIS="`echo ${SUPPORTED_GUIS} | sed 's/,//'`" # Strip leading comma
2930 AC_SUBST(SUPPORTED_GUIS)
2932 dnl AC_CONFIG_LINKS(doc/C/images)
2933 dnl AC_CONFIG_LINKS(gnashconfig.h,libltdl/config.h)
2934 AC_CONFIG_LINKS(cygnal/testsuite/cygnal.all/cygnalrc:cygnal/testsuite/cygnal.all/cygnalrc.in)
2935 AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc:testsuite/libbase.all/gnashrc.in)
2936 AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc-local:testsuite/libbase.all/gnashrc-local.in)
2938 AC_CONFIG_FILES(gnash.pc:gnash.pc.in)
2940 AC_OUTPUT(Makefile
2941 po/Makefile
2942 libltdl/Makefile
2943 libmedia/Makefile
2944 libsound/Makefile
2945 libbase/Makefile
2946 libcore/Makefile
2947 libcore/vm/Makefile
2948 libcore/parser/Makefile
2949 libvaapi/Makefile
2950 librender/Makefile
2951 utilities/Makefile
2952 doc/Makefile
2953 doc/C/Makefile
2954 doc/Doxyfile
2955 testsuite/Makefile
2956 testsuite/media/Makefile
2957 testsuite/libbase.all/Makefile
2958 testsuite/as3compile.all/Makefile
2959 testsuite/actionscript.all/Makefile
2960 testsuite/samples/Makefile
2961 testsuite/swfdec/Makefile
2962 testsuite/misc-ming.all/Makefile
2963 testsuite/misc-ming.all/action_order/Makefile
2964 testsuite/misc-ming.all/displaylist_depths/Makefile
2965 testsuite/misc-ming.all/loop/Makefile
2966 testsuite/misc-ming.all/loading/Makefile
2967 testsuite/misc-mtasc.all/Makefile
2968 testsuite/misc-haxe.all/Makefile
2969 testsuite/misc-haxe.all/classes.all/Makefile
2970 testsuite/misc-swfmill.all/Makefile
2971 testsuite/misc-swfmill.all/trace-as2/Makefile
2972 testsuite/misc-swfmill.all/trace-as3/Makefile
2973 testsuite/misc-swfc.all/Makefile
2974 testsuite/network.all/Makefile
2975 testsuite/movies.all/Makefile
2976 testsuite/libcore.all/Makefile
2977 testsuite/libmedia.all/Makefile
2978 gui/Makefile
2979 gui/fb/Makefile
2980 gui/Info.plist
2981 gui/pythonmod/Makefile
2982 extensions/Makefile
2983 extensions/dejagnu/Makefile
2984 extensions/mysql/Makefile
2985 extensions/fileio/Makefile
2986 extensions/gtk2/Makefile
2987 extensions/lirc/Makefile
2988 extensions/dbus/Makefile
2989 plugin/Makefile
2990 plugin/npapi/Makefile
2991 plugin/klash/Makefile
2992 plugin/klash4/Makefile
2993 plugin/win32/Makefile
2994 plugin/aos4/Makefile
2995 cygnal/Makefile
2996 cygnal/libnet/Makefile
2997 cygnal/libamf/Makefile
2998 cygnal/cgi-bin/Makefile
2999 cygnal/cgi-bin/echo/Makefile
3000 cygnal/cgi-bin/oflaDemo/Makefile
3001 cygnal/cgi-bin/fitcDemo/Makefile
3002 cygnal/testsuite/Makefile
3003 cygnal/testsuite/libamf.all/Makefile
3004 cygnal/testsuite/libnet.all/Makefile
3005 cygnal/testsuite/cygnal.all/Makefile
3009 ########################## Final report begins... ############################
3012 cerr=/tmp/gnash-configure-errors.$$
3013 cwarn=/tmp/gnash-configure-warnings.$$
3014 crec=/tmp/gnash-configure-recommended.$$
3015 echo ""
3017 #trap 'rm cerr' 0 # trap isn't a good idea, might override other traps
3018 exec 3> $cerr 
3019 exec 4> $cwarn
3020 exec 5> $crec
3022 echo "Configurable options are:"
3024 if test x"${i810lodbias}" = x"yes"; then
3025   echo "        Intel 810 LOD bias hack enabled"
3026 else
3027   echo "        Intel 810 LOD bias hack disabled (default). Use --enable-i810-lod-bias to enable."
3030 if test x"${pthreads}" = x"yes"; then
3031   echo "        POSIX Threads support enabled (default)"
3032 else
3033   if test x"${build_haiku}" = x"yes"; then
3034      echo "        POSIX Thread support built into C library."
3035   els
3036      echo "        POSIX Thread support disabled."
3037   fi
3040 if test x"${dmalloc}" = x"yes"; then
3041   echo "        DMalloc support enabled"
3042   echo "        For a list of the command-line options enter: dmalloc --usage"
3043 else
3044   echo "        DMalloc support disabled (default). Use --enable-dmalloc to enable."
3047 if test x"${npapi}" = x"yes"; then
3048   echo "        NPAPI plugin enabled (default). Use --disable-npapi to disable."
3049   echo "            NPAPI plugin will be installed in ${FIREFOX_PLUGINS}"
3050 else
3051   echo "        NPAPI plugin disabled."
3054 if test x"${build_kparts3}" = x"yes"; then
3055   echo "        KPARTS 3.x plugin enabled (default). Use --disable-kparts3 to disable"
3056   echo "            KPARTS 3.x plugin will be installed in ${KDE3_PLUGINDIR}"
3057   echo "            KPARTS 3.x service will be installed in ${KDE3_SERVICESDIR}"
3058   echo "            KPARTS 3.x config dir will be in ${KDE3_CONFIGDIR}"
3059   echo "            KPARTS 3.x appsdata will be installed in ${KDE3_APPSDATADIR}"
3060 else
3061   echo "        KPARTS 3.x plugin disabled."
3064 if test x"${build_kparts4}" = x"yes"; then
3065   echo "        KPARTS 4.x plugin enabled (default). Use --disable-kparts4 to disable"
3066   echo "            KPARTS 4.x plugin will be installed in ${KDE4_PLUGINDIR}"
3067   echo "            KPARTS 4.x service will be installed in ${KDE4_SERVICESDIR}"
3068   echo "            KPARTS 4.x config dir will be in ${KDE4_CONFIGDIR}"
3069   echo "            KPARTS 4.x appsdata will be installed in ${KDE4_APPSDATADIR}"
3070 else
3071   echo "        KPARTS 4.x plugin disabled."
3074 dnl -- if test x"${dynamic_gui}" = x"yes"; then
3075 dnl --   echo "        Loadable GUI & renderer enabled."
3076 dnl -- else
3077 dnl --   echo "        Loadable GUI & renderer disabled (default). Use --enable-dynamic-gui to enable."
3078 dnl -- fi
3080 # set a variable if we shouldn't continue. This way we can print
3081 # out everything that is missing in one pass, hopefully making it
3082 # easy for new developers to get everything they need installed.
3084 echo "Configured paths for ${build} are:"
3086 dnl Dump QT3 options is the user specified a QTOPIA3 or KDE3 GUI
3087 if test x"${build_kde3}" = xyes -o x"${build_qtopia3}" = xyes; then
3088   if test x"${has_qt3}" = xyes; then
3089     echo "        QT3 flags are: ${QT3_CFLAGS}"
3090     echo "        QT3 libs are: ${QT3_LIBS}"
3091   else
3092     echo "        ERROR: No QT 3.x development package installed!" >&3
3093     echo "               Install a QT 3.x development environment from http://trolltech.com" >&3
3094     echo "               or .deb users: apt-get install libqt3-mt-dev" >&3
3095     echo "               or change to a different gui with --enable-gui=..." >&3
3096   fi
3099 dnl Dump QT4 options is the user specified a QTOPIA4 or KDE4 GUI
3100 if test x"${build_kde4}" = xyes -o x"${build_qtopia4}" = xyes; then
3101   if test x"${has_qt4}" = xyes; then
3102     echo "        QT4 flags are: ${QT4_CFLAGS}"
3103     echo "        QT4 libs are: ${QT4_LIBS}"
3104   else
3105     echo "        ERROR: No QT 4.x development package installed!" >&3
3106     echo "               Install a QT 4.x development environment from http://trolltech.com" >&3
3107     echo "               or .deb users: apt-get install qt4-dev-tools" >&3
3108     echo "               or change to a different gui with --enable-gui=..." >&3
3109   fi
3112 if test x"$build_qtopia3" = xyes; then
3113   if test x"${QTOPIA3_LIBS}" != x ; then
3114     if test x"${QTOPIA3_CFLAGS}" != x ; then
3115       echo "        QTOPIA 3.x flags are: $QTOPIA3_CFLAGS"
3116     else
3117       echo "        QTOPIA 3.x flags are: default include path"
3118     fi
3119     echo "        QTOPIA 3.x libs are: $QTOPIA3_LIBS"
3120   else
3121     echo "        ERROR: No QTOPIA 3.x library development package installed!" >&3
3122     echo "               Install it from http://trolltech.com/downloads/" >&3
3123     echo "               binary packages are not available." >&3
3124   fi
3127 if test x"$build_qtopia4" = xyes; then
3128   if test x"${QTOPIA4_LIBS}" != x ; then
3129     if test x"${QTOPIA4_CFLAGS}" != x ; then
3130       echo "        QTOPIA 4.x flags are: $QTOPIA4_CFLAGS"
3131     else
3132       echo "        QTOPIA 4.x flags are: default include path"
3133     fi
3134     echo "        QTOPIA 4.x libs are: $QTOPIA4_LIBS"
3135   else
3136     echo "        ERROR: No QTOPIA 4.x library development package installed!" >&3
3137     echo "               Install it from http://trolltech.com/downloads/" >&3
3138     echo "               binary packages are not available." >&3
3139   fi
3143 # -o x$build_kparts3 = xyes
3144 if test x$build_kde3 = xyes; then
3145   if test x"$has_kde3" = xyes; then
3146     echo "        KDE 3.x flags are: $KDE3_CFLAGS"
3147     echo "        KDE 3.x libs are: $KDE3_LIBS"
3148   else
3149       echo "        ERROR: No KDE 3.x development package installed!" >&3
3150       echo "               To disable the KDE 3.x gui," >&3
3151       echo "               reconfigure using --enable-gui=<list-of-guis>" >&3
3152       echo "               and omit "kde" from the list." >&3
3153       echo "               or avoid --enable-gui=... as a whole." >&3
3154       echo "               To be able to build the kde 3.x gui," >&3
3155       echo "               install version 3.x of the KDE development environment" >&3
3156       echo "               from http://kde.org" >&3
3157       echo "               or .deb users: apt-get install kdelibs4-dev" >&3
3158       echo "               or .rpm users: yum install kdelibs3-devel." >&3
3159   fi
3162 # -o x$build_kparts4 = xyes
3163 if test x$build_kde4 = xyes; then
3164   if test x"$has_kde4" = xyes; then
3165     echo "        KDE 4.x flags are: $KDE4_CFLAGS"
3166     echo "        KDE 4.x libs are: $KDE4_LIBS"
3167   else
3168       echo "        ERROR: No KDE 4.x development package installed!" >&3
3169       echo "               To disable the KDE 4.x gui," >&3
3170       echo "               reconfigure using --enable-gui=<list-of-guis>" >&3
3171       echo "               and omit "kde4" from the list" >&3
3172       echo "               or avoid --enable-gui=... as a whole." >&3
3173       echo "               To be able to build the kde 4.x gui," >&3
3174       echo "               install version 4.x of the KDE development environment" >&3
3175       echo "               from http://kde.org" >&3
3176       echo "               or .deb users: apt-get install kdelibs5-dev" >&3
3177       echo "               or .rpm users: yum install kdelibs-devel." >&3
3178   fi
3181 if test x"${JPEG_LIBS}" != x ; then
3182   if test x"${JPEG_CFLAGS}" != x ; then
3183     echo "        JPEG flags are: $JPEG_CFLAGS"
3184   else
3185     echo "        JPEG flags are: default include path"
3186   fi
3187   echo "        JPEG libs are: $JPEG_LIBS"
3188 else
3189   echo "        ERROR: No JPEG library development package installed!" >&3
3190   echo "               Install it from http://ijg.org" >&3
3191   echo "               or .deb users: apt-get install libjpeg-dev" >&3
3192   echo "               or .rpm users: yum install libjpeg-devel" >&3
3195 if test x"${GIF_LIBS}" != x ; then
3196   if test x"${GIF_CFLAGS}" != x ; then
3197     echo "        GIF flags are: $GIF_CFLAGS"
3198   else
3199     echo "        GIF flags are: default include path"
3200   fi
3201   echo "        GIF libs are: $GIF_LIBS"
3202 else
3203   echo "        ERROR: No GIF library development package installed!" >&3
3204   echo "               Install it from http://sourceforge.net/projects/giflib/" >&3
3205   echo "               or .deb users: apt-get install libungif-dev" >&3
3206   echo "               or maybe     : apt-get install libgif-dev" >&3
3207   echo "               or .rpm users: yum install libungif-devel" >&3
3210 if test x"${PNG_LIBS}" != x ; then
3211   if test x"${PNG_CFLAGS}" != x ; then
3212     echo "        PNG flags are: $PNG_CFLAGS"
3213   else
3214     echo "        PNG flags are: default include path"
3215   fi
3216   echo "        PNG libs are: $PNG_LIBS"
3217 else
3218   echo "        RECOMMENDED: No PNG library development package installed!" >&5
3219   echo "                     Gnash will be built without support for dynamic loading of PNG files." >&5
3220   echo "                     Install it from http://www.libpng.org" >&5
3221   echo "                     or .deb users: apt-get install libpng12-dev" >&5
3222   echo "                     or .rpm users: yum install libpng-devel" >&5
3225 if test x"${build_ogl}" = x"yes"; then
3226   if test x"$OPENGL_LIBS" != x; then
3227     if test x"$OPENGL_CFLAGS" != x; then
3228       echo "        OpenGL flags are: $OPENGL_CFLAGS"
3229     else
3230       echo "        OpenGL flags are: default include path"
3231     fi
3232     echo "        OpenGL libs are: $OPENGL_LIBS"
3233     else
3234       echo "        ERROR: No OpenGL development package installed!" >&3
3235       echo "               You need to install the libmesa development package" >&3
3236       echo "               or .deb users: apt-get install libgl1-mesa-dev" >&3
3237       echo "               or .rpm users: yum install xorg-x11-Mesa-libGL" >&3
3238       echo "               or use a different renderer with --enable-renderer=" >&3
3239   fi
3242 if test x"${build_gles}" = x"yes"; then
3243   if test x"${has_gles}" != x; then
3244     if test x"$GLES_CFLAGS" != x; then
3245       echo "        OpenGL-ES flags are: $GLES_CFLAGS"
3246     else
3247       echo "        OpenGL-ES flags are: default include path"
3248     fi
3249     echo "        OpenGL-ES libs are: $GLES_LIBS"
3250   else
3251       echo "        ERROR: No OpenGL-ES development package installed!" >&3
3252       echo "               You need to install the this from source proobably" >&3
3253       echo "               or use a different renderer with --enable-renderer=" >&3
3254   fi
3257 dnl GLEXT is only needed for GTK/OpenGL
3258 if test x$build_gtk = xyes -a x$build_ogl = xyes ; then
3259   if test x"$GLEXT_LIBS" != x; then
3260     if test x"$GLEXT_CFLAGS" != x; then
3261       echo "        GtkGLExt flags are: $GLEXT_CFLAGS"
3262     else
3263       echo "        GtkGLExt flags are: default include path"
3264     fi
3265       echo "        GtkGLExt libs are: $GLEXT_LIBS"
3266   else
3267     if test x$build_gtk = xyes; then
3268       if test x$build_ogl = xyes; then
3269         echo "        ERROR: No GtkGLExt development package installed!" >&3
3270         echo "               It is needed to build the GTK/OpenGL GUI/renderer combination." >&3
3271         echo "               Either install it from http://gtkglext.sourceforge.net" >&3
3272         echo "               or .deb users: apt-get install libgtkglext1-dev" >&3
3273         echo "               or .rpm users: yum install gtkglext-devel" >&3
3274         echo "               or --enable-gui=sdl or --enable-renderer=agg" >&3
3275       fi
3276     fi
3277   fi
3281 if test x$build_gtk = xyes; then #{
3282   if test x"$GTK2_LIBS" != x; then
3283     if test x"$GTK2_CFLAGS" != x; then
3284       echo "        GTK2 flags are: $GTK2_CFLAGS"
3285     else
3286       echo "        GTK2 flags are: default include path"
3287     fi
3288       echo "        GTK2 libs are: $GTK2_LIBS"
3289   else
3290     echo "        ERROR: No GTK2 development package installed!" >&3
3291     echo "               Install it from http://gtk.org" >&3
3292     echo "               or .deb users: apt-get install libgtk2.0-dev" >&3
3293     echo "               or .rpm users: yum install gtk2-devel" >&3
3294   fi
3296   if test x"$PANGO_LIBS" != x; then
3297     if test x"$PANGO_CFLAGS" != x; then
3298       echo "        Pango flags are: $PANGO_CFLAGS"
3299     else
3300       echo "        Pango flags are: default include path"
3301     fi
3302     echo "        Pango libs are: $PANGO_LIBS"
3303   else
3304     echo "        ERROR: No Pango development package installed!" >&3
3305     echo "               Install it from http://pango.org" >&3
3306     echo "               or .deb users: apt-get install libpango1.0-dev" >&3
3307     echo "               or .rpm users: yum install pango-devel" >&3
3308   fi
3310   if test x"$GLIB_LIBS" != x; then
3311     if test x"$GLIB_CFLAGS" != x; then
3312       echo "        GLib flags are: $GLIB_CFLAGS"
3313     else
3314       echo "        GLib flags are: default include path"
3315     fi
3316     echo "        GLib libs are: $GLIB_LIBS"
3317   else
3318     echo "        ERROR: No GLib development package installed!" >&3
3319     echo "               Install it from http://gtk.org" >&3
3320     echo "               or .deb users: apt-get install libglib2.0-dev" >&3
3321     echo "               or .rpm users: yum install glib2-devel" >&3
3322   fi
3324   if test x"$ATK_LIBS" != x; then
3325     if test x"$ATK_CFLAGS" != x; then
3326       echo "        ATK flags are: $ATK_CFLAGS"
3327     else
3328       echo "        ATK flags are: default include path"
3329     fi
3330       echo "        ATK libs are: $ATK_LIBS"
3331   else
3332     echo "        ERROR: No ATK development package installed!" >&3
3333     echo "               Install it from http://gtk.org" >&3
3334     echo "               or .deb users: apt-get install libatk1.0-dev" >&3
3335     echo "               or .rpm users: yum install atk-devel" >&3
3336   fi
3340 if test x"$build_media_gst" = x"yes"; then
3341   if test x"$missing_codecs" != x; then   
3342       echo "        Your Gstreamer installation is missing these codecs: $missing_codecs"
3343       echo "        Please install the gstreamer-ffmpeg for Gstreamer"
3344   fi  
3345   if test x"$GSTREAMER_LIBS" != x; then
3346     if test x"$GSTREAMER_CFLAGS" != x; then
3347       echo "        Gstreamer flags are: $GSTREAMER_CFLAGS"
3348     else
3349       echo "        Gstreamer flags are: default include path"
3350     fi
3351     echo "        Gstreamer libs are: $GSTREAMER_LIBS"
3352     if test x"$has_gstreamer_pbutils" != "xyes"; then
3353       echo "        RECOMMENDED: If the user has not installed the necessary Gstreamer plugins," >&5
3354       echo "                     Gstreamer can pop up a message prompting them to." >&5
3355       echo "                     Install gstpbutils (>= 0.10.15) from http://www.gstreamer.net for that to be enabled" >&5
3356       echo "                     or .deb users: apt-get install libgstreamer-plugins-base0.10-dev" >&5
3357       echo "                     Also see --with-gstpbutils-incl and --with-gstpbutils-lib" >&5
3358     fi
3359     if test x"$has_gstreamer_plugins_base" = "xno"; then
3360       dnl check if this is really a mandatory asset !
3361       echo "        ERROR: base plugins are required for gstreamer media" >&3
3362       echo "                        Install gstreamer-plugins-base from http://www.gstreamer.net" >&3
3363       echo "                        or .rpm users: yum install gstreamer-plugins-base-devel" >&3
3364       echo "                        or .deb users: apt-get install libgstreamer-plugins-base0.10-dev" >&3
3365     fi
3366   else
3367     echo "        ERROR: GST media handling requested but gstreamer-0.10+ not found" >&3
3368     echo "               Install it from http://www.gstreamer.net" >&3
3369     echo "               or .deb users: apt-get install libgstreamer0.10-dev" >&3
3370     echo "               or .rpm users: yum install gstreamer-devel" >&3
3371     echo "               or             yast install gstreamer010-devel" >&3
3372   fi
3375   if test x"${build_media_ffmpeg}" = x"yes"; then
3376     if test x"$FFMPEG_LIBS" != x; then
3377       echo "        MP3 and video support enabled through FFmpeg"
3378       if test x"${ffmpeg_version_check}" != xok; then
3379         echo "        ERROR: You have version ${ffmpeg_version} of FFmpeg installed," >&3
3380         if test x"${have_ffmpeg_swscale}" = "xno"; then
3381           echo "               with no swscale enabled." >&3
3382         else
3383           echo "               with swscale enabled." >&3
3384         fi
3385         echo "               This setup isn't supported!" >&3
3386         echo "               Version 51.11.0 or newer is required, enabling swscale if >= 52.0.0." >&3
3387         echo "               You can install libswscale from http://ffmpeg.org" >&3
3388         echo "               or .deb users: apt-get install libswscale-dev" >&3
3389       else
3390         if test x"${avformat_h}" = x; then
3391           echo "        ERROR: FFmpeg's libavcodec header is installed but not libavformat." >&3
3392           echo "               You can install FFmpeg from http://ffmpeg.org" >&3
3393           echo "               or .deb users: apt-get install libavformat-dev" >&3
3394           echo "               or YaST users: yast -i libavformat-api (but currently installs into /usr/lib64)" >&3
3395           echo "               or explicitly set the path using --with-ffmpeg-incl=" >&5
3396           echo "               or reconfigure with --enable-media=gst" >&3
3397         else
3398           if test x"$FFMPEG_CFLAGS" != x; then
3399             echo "        FFmpeg flags are: $FFMPEG_CFLAGS"
3400           else
3401             echo "        FFmpeg flags are: default include path"
3402           fi
3403           echo "        FFmpeg libs are: $FFMPEG_LIBS"
3404         fi
3405       fi
3406     else
3407       echo "        ERROR: No FFmpeg development package installed!" >&3
3408       echo "               You can install FFmpeg from http://ffmpeg.org" >&3
3409       echo "               or .deb users: apt-get install libavformat-dev" >&3
3410       echo "               or .rpm users: yum install ffmpeg-devel" >&3
3411       echo "               or reconfigure with --enable-media=gst" >&3
3412     fi
3413   fi
3415 if test x$build_cairo = xyes; then
3416   if test x"$CAIRO_LIBS" != x; then
3417     if test x"$CAIRO_CFLAGS" != x; then
3418       echo "        Cairo flags are: $CAIRO_CFLAGS"
3419     else
3420       echo "        Cairo flags are: default include path"
3421     fi
3422     echo "        Cairo libs are: $CAIRO_LIBS"
3423   else
3424     echo "        ERROR: No Cairo development package installed!" >&3
3425     echo "               You need to have the Cairo development package installed" >&3
3426     echo "               if you have used --enable-render=cairo to configure." >&3
3427     echo "               Install it from http://cairographics.org" >&3
3428     echo "               or .deb users: apt-get install libcairo-dev" >&3
3429     echo "               or .rpm users: yum install cairo-devel" >&3
3430   fi
3433 if test x$build_fltk = xyes; then
3434   if test x"$FLTK2_LIBS" != x; then
3435     if test x"$FLTK2_CFLAGS" != x; then
3436       echo "        FLTK flags are: $FLTK2_CFLAGS"
3437     else
3438       echo "        FLTK flags are: default include path"
3439     fi
3440       echo "        FLTK libs are: $FLTK2_LIBS"
3441   else
3442     echo "        ERROR: No FLTK2 development package installed!" >&3
3443     echo "               There are currently no Debian or RPM packages for FLTK2;" >&3
3444     echo "               see http://www.fltk.org to install it from source." >&3
3445     echo "               or change to a different gui with --enable-gui=..." >&3
3446 dnl What it was for FLTK 1:
3447 dnl    echo "               or .deb users: apt-get install fltk-1.1-dev"
3448 dnl    echo "               or .rpm users: yum install fltk-devel"
3449   fi
3452 if test x$build_fltk = xyes; then
3453   if test x"$XFT_LIBS" != x; then
3454     if test x"$XFT_CFLAGS" != x; then
3455       echo "        Xft flags are: $XFT_CFLAGS"
3456     else
3457       echo "        Xft flags are: default include path"
3458     fi
3459       echo "        Xft libs are: $XFT_LIBS"
3460 dnl     else
3461 dnl       echo "        ERROR: No Xft development package installed!" >&3
3462 dnl       echo "               Install the xft development package" >&3
3463 dnl       echo "               or .deb users: apt-get install libxft-dev" >&3
3464 dnl       echo "               or .rpm users: yum install xft-devel" >&3
3465   fi
3468 # See whether SDL is required
3469 need_sdl=false
3470 test x$build_sdl = xyes                 && need_sdl=true
3471 test x$build_sound_sdl = xyes   && need_sdl=true
3473 if $need_sdl; then
3474   if test x"$SDL_LIBS" != x; then
3475     echo "        SDL flags are: $SDL_CFLAGS"
3476     echo "        SDL libs are: $SDL_LIBS"
3477   else
3478     echo "        ERROR: No SDL development package installed!" >&3
3479     echo "               Install it from http://www.libsdl.org/download-1.2.php" >&3
3480     echo "               or .deb users: apt-get install libsdl1.2-dev" >&3
3481     echo "               or .rpm users: yum install SDL-devel" >&3
3482     test x$build_sdl = xyes &&
3483         echo "               or select a different GUI with --enable-gui= " >&3
3484   fi
3486 unset need_sdl
3488 if test x"$nsapi" = x"yes"; then
3489 dnl  if test x"$FIREFOX_CFLAGS" != x; then
3490 dnl    echo "        Firefox flags are: $FIREFOX_CFLAGS"
3491 dnl    echo "        Firefox libs are: $FIREFOX_LIBS"
3492     echo "        Plugin will be installed in ${FIREFOX_PLUGINS}"
3493 dnl  else
3494 dnl    echo "        ERROR: No Firefox or Mozilla development package installed!" >&3
3495 dnl  fi
3498 if test x"${pthreads}" = x"yes"; then
3499   if test x"$PTHREAD_CFLAGS" != x; then
3500     echo "        POSIX Threads flags are: $PTHREAD_CFLAGS"
3501   fi
3502   if test x"${PTHREAD_LIBS}" != x; then
3503     echo "        POSIX Threads lib is: $PTHREAD_LIBS"
3504   else
3505     if test x"${cross_compiling}" = xno; then
3506       echo "ERROR: No pthread development package installed!" >&3
3507     fi
3508   fi
3511 if test x"${docbook}" = x"yes"; then
3512   if test x"$MAKEINFO" = x; then
3513     echo "        ERROR: no makeinfo tools installed!" >&3
3514     echo "               Either install it from http://www.gnu.org/software/texinfo/" >&3
3515     echo "               or .deb users: apt-get install texinfo" >&3
3516     echo "               or configure without --enable-docbook" >&3
3517   fi
3518   dnl low-level tools
3519   if test x"$DB2X_TEXIXML" = x -o x"$DB2X_MANXML" = x -o x"$DB2X_XSLTPROC" = x; then
3520     dnl high-level tools
3521     if test x"${DB2X_TEXI}" = x -o x"${DB2X_MAN}" = x; then
3522       echo "        ERROR: No DocBook2X tools installed!" >&3
3523       echo "               Either install it from http://docbook2x.sourceforge.net" >&3
3524       echo "               or .deb users: apt-get install docbook docbook2x docbook-utils" >&3
3525       echo "                              docbook-xml docbook-xsl texinfo xsltproc" >&3
3526       echo "               or configure without --enable-docbook" >&3
3527     fi
3528   else
3529     echo "        You have version $db2x_version of the DocBook2X tools."
3530   fi
3531 else
3532   echo "        WARNING: without --enable-docbook we will use the cached" >&4
3533   echo "                 documentation files included in the gnash distribution." >&4
3534   echo "                 If you change files in doc/C, you should --enable-docbook." >&4
3537 if test x"$CURL_LIBS" != x; then
3538   if test x"$CURL_CFLAGS" != x; then
3539     echo "        CURL flags are: $CURL_CFLAGS"
3540   else
3541     echo "        CURL flags are: default include path"
3542   fi
3543     echo "        CURL libs are: $CURL_LIBS"
3544 else
3545   echo "        RECOMMENDED: If you install the CURL library, Gnash will be able to" >&5
3546   echo "                     display remote content (streaming from URLs) using CURL." >&5
3547   echo "                     Install libcurl from http://curl.haxx.se/libcurl" >&5
3548   echo "                     or .deb users: apt-get install libcurl-dev" >&5
3549   echo "                     or .rpm users: yum install curl-devel" >&5
3552 if test x"$SPEEX_LIBS" != x; then
3553   if test x"$SPEEX_CFLAGS" != x; then
3554     echo "        Speex flags are: $SPEEX_CFLAGS"
3555   else
3556     echo "        Speex flags are: default include path"
3557   fi
3558     echo "        Speex libs are: $SPEEX_LIBS"
3559 else
3560   echo "        RECOMMENDED: If you install the Speex library, Gnash will be able to" >&5
3561   echo "                     decoded Speex encoded audio in FLV files." >&5
3562   echo "                     Install libspeex from http://speex.org" >&5
3563   echo "                     or .deb users: apt-get install libspeex-dev" >&5
3564   echo "                     or .rpm users: yum install speex-devel" >&5
3567 if test x"$ext_dbus" = xyes; then
3568   if test x"$DBUS_LIBS" != x; then
3569     if test x"$DBUS_CFLAGS" != x; then
3570       echo "        DBUS flags are: $DBUS_CFLAGS"
3571     else
3572       echo "        DBUS flags are: default include path"
3573     fi
3574       echo "        DBUS libs are: $DBUS_LIBS"
3575   else
3576     echo "        WARNING: DBUS library not found." >&4
3577     echo "                 Gnash will be built without support for remote controls." >&4
3578     echo "                 Why not install libdbus from http://www.dbus.org" >&4
3579     echo "                 or .deb users: apt-get install dbus-dev" >&4
3580     echo "                 or .rpm users: yum install dbus-devel" >&4
3581   fi
3584 if test x$build_agg = xyes; then # {
3585   echo "        AGG Pixel format is: $pixelformat"
3586     if test x"$AGG_LIBS" != x; then # {
3587       if test x"${agg25}" != xyes; then # {
3588         echo "        ERROR: Your installation of AGG appears to be version 2.4 or older." >&3
3589         echo "               Please upgrade to AGG 2.5 or greater." >&3
3590         echo "               Install it from http://www.antigrain.com" >&3
3591         echo "               or .deb users: apt-get install libagg-dev" >&3
3592         echo "               or .rpm users: yum install agg-devel" >&3
3593       else # }{
3594         if test x"$AGG_CFLAGS" != x; then # {
3595           echo "        AGG flags are: $AGG_CFLAGS"
3596         else # }{
3597           echo "        AGG flags are: default include path"
3598         fi # }
3599         echo "        AGG libs are: $AGG_LIBS"
3600       fi # }
3601     else # }{
3602       echo "        ERROR: No AGG development package installed!" >&3
3603       echo "               Install it from http://www.antigrain.com" >&3
3604       echo "               or .deb users: apt-get install libagg-dev" >&3
3605       echo "               or .rpm users: yum install agg-devel" >&3
3606     fi # }
3607 fi # }
3609 if test x"$BOOST_LIBS" != x; then
3610         echo "        BOOST flags are: $BOOST_CFLAGS"
3611         echo "        BOOST libs are: $BOOST_LIBS"
3612         echo "        BOOST libs for cygnal are: $BOOST_CYGNAL_LIBS"
3613     dnl fi
3614     if test x"${missing_headers}" != x; then
3615       for i in ${missing_headers}; do
3616         echo "        ERROR: The BOOST $i header file is needed!" >&3
3617         echo "               Install it from http://boost.org" >&3
3618         echo "               or from a Boost development package" >&3
3619       done
3620     fi
3622     if test x"${cygnal}" = x"yes"; then
3623         if test x"${cygnal_missing_libs}" != x; then
3624           for i in ${cygnal_missing_libs}; do
3625             echo "          ERROR: The BOOST $i library is required for cygnal!" >&4
3626             echo "                 Either configure with --disable-cygnal or" >&4
3627             echo "                 install it from http://www.boost.org" >&4
3628             echo "                 or .deb users: apt-get install libboost-"`echo ${i} | sed 's/_/-/g'`"-dev" >&4
3629           done
3630         fi
3631     fi
3633     if test x"${missing_libs}" != x; then
3634       for i in ${missing_libs}; do
3635         echo "        ERROR: The BOOST $i library is needed!" >&3
3636         echo "               Install it from http://boost.org" >&3
3637         echo "               or .deb users: apt-get install libboost-"`echo ${i} | sed 's/_/-/g'`"-dev" >&3
3638       done
3639     fi
3640 else
3641     echo "        ERROR: No BOOST development package installed!" >&3
3642     echo "               Install it from http://www.boost.org" >&3
3643     echo "               or .deb users: apt-get install libboost-dev libboost-thread-dev" >&3
3644     if test x"$cygnal" = xyes; then
3645     echo "                              and libboost-date-time-dev (for cygnal)" >&3
3646     fi
3647     echo "               or .rpm users: yum install boost-devel" >&3
3650 dnl don't look for the flash compilers when cross compiling.
3651 if test x"$testsuite" = x"yes"; then
3652   if test x$cross_compiling = xno; then
3653     if test x"$MING_LIBS" != x; then
3654       echo "        MING flags are $MING_CFLAGS"
3655       echo "        MING libs are $MING_LIBS"
3656     else
3657       echo "        WARNING: You need to have the Ming development package" >&4
3658       echo "                 installed to run most of the tests in Gnash testsuite." >&4
3659       echo "                 Install it from http://www.libming.org/" >&4
3660       echo "                 or .deb users: apt-get install libming-dev" >&4
3661     fi
3663     if test x"$MAKESWF" != x; then
3664       echo "        MING version code is $MING_VERSION_CODE"
3665       echo "        MAKESWF is $MAKESWF"
3666     else
3667       echo "        WARNING: You need to have the Ming utilities package" >&4
3668       echo "                 version 0.4 or higher installed to run" >&4
3669       echo "                 many of the tests in Gnash testsuite." >&4
3670       echo "                 Install it from http://www.libming.org" >&4
3671       echo "                 or .deb users: apt-get install libming-util" >&4
3672     fi
3674     if test x"$MAKESWF" != x && test $MING_VERSION_CODE -lt 00040006; then
3675       echo "        WARNING: You have an older version of Ming installed and will not" >&4
3676       echo "                 be able to run all of the tests in Gnash testsuite." >&4
3677       echo "                 Install the latest version from http://www.libming.org" >&4
3678     fi
3680     if test x"$SWFDEC_TESTSUITE" != x; then
3681       echo "        SWFDEC testsuite dir is $SWFDEC_TESTSUITE"
3682     fi
3684     if test x"$MTASC" != x; then
3685       echo "        MTASC is $MTASC"
3686       echo "        MTASC CLASSPATH is $MTASC_CLASSPATH"
3687     else
3688       echo "        WARNING: You need to have the MTASC compiler packages installed" >&4
3689       echo "                 to run some of the tests in Gnash testsuite." >&4
3690       echo "                 You can install it from http://mtasc.org" >&4
3691       echo "                 or .deb users: apt-get install mtasc" >&4
3692     fi
3694     if test x"$HAXE" != x; then
3695       echo "        HAXE is $HAXE"
3696       echo "        HAXE CLASSPATH is $HAXE_CLASSPATH"
3697     else
3698       echo "        WARNING: You need to have the HAXE compiler package " >&4
3699       echo "                 version 2.00 or higher installed" >&4
3700       echo "                 to run some of the tests in Gnash testsuite." >&4
3701       echo "                 You can install it from http://haxe.org" >&4
3702       echo "                 or .deb users: apt-get install haxe" >&4
3703     fi
3705     if test x"$SWFMILL" != x; then
3706       echo "        SWFMILL is $SWFMILL"
3707       if test x"$ENABLE_AVM2" != x -a "$SWFMILL_VERSION" -lt 00021206; then
3708         echo "        WARNING: You are building Gnash with AVM2 support but" >&4
3709         echo "                 your swfmill version is too old to run AS3" >&4
3710         echo "                 tests." >&4
3711       fi
3712     else
3713       echo "        WARNING: You need to have the 'swfmill' tool installed" >&4
3714       echo "                 to run some of the tests in Gnash testsuite." >&4
3715       echo "                 You can install it from http://swfmill.org/" >&4
3716       echo "                 or .deb users: apt-get install swfmill" >&4
3717     fi
3719     if test x"$SWFC" != x; then
3720       echo "        SWFC is $SWFC"
3721     else
3722       echo "        WARNING: You need to have 'swfc' from SWFTools installed" >&4
3723       echo "                 to run some of the tests in Gnash testsuite." >&4
3724       echo "                 You can install it from http://www.swftools.org/" >&4
3725       echo "                 or .deb users: apt-get install swftools" >&4
3726     fi
3728     if test x"$AS3COMPILE" != x; then
3729       echo "        AS3COMPILE is $AS3COMPILE"
3730     else
3731       echo "        WARNING: you need as3compile from SWFTools" >&4
3732       echo "                 to run some of the tests in Gnash testsuite." >&4
3733       echo "                 You can install it from http://www.swftools.org/" >&4
3734     fi
3736     if test x"$HTTP_TESTSUITE" != x; then
3737       echo "        HTTP testsuite dir is $HTTP_TESTSUITE"
3738     fi
3740     if test x"$RED5_HOST" != x; then
3741       echo "        RED5 testing host is $RED5_HOST"
3742     fi
3743   fi
3746   if test x"$PERL" != x; then
3747     echo "        PERL is $PERL"
3748   else
3749     echo "        WARNING: You need to have perl installed" >&4
3750     echo "                 to run some of the tests in Gnash testsuite." >&4
3751   fi
3753 if test x"$testsuite" = x"yes"; then
3754   if test x"$CSOUND" != x; then
3755     echo "        CSOUND is $CSOUND"
3756   fi
3759 if test x"$Z_LIBS" != x; then
3760   if test x"$Z_CFLAGS" != x; then
3761     echo "        Z flags are: $Z_CFLAGS"
3762   else
3763     echo "        Z flags are: default include path"
3764   fi
3765   echo "        Z libs are: $Z_LIBS"
3766 else
3767   echo "        RECOMMENDED: You need to have the zlib development packages installed" >&5
3768   echo "                     to play compressed SWF (most of them from version 6 up)" >&5
3769   echo "                     and to display some kinds of JPEG files." >&5
3770   echo "                     Install it from http://www.zlib.net" >&5
3771   echo "                     or .deb users: apt-get install zlib1g-dev" >&5
3772   echo "                     or .rpm users: yum install zlib-devel." >&5
3773   echo "                     It may still be possible to configure without zlib." >&5
3776 if test x"$FREETYPE2_LIBS" != x; then
3777   if test x"$FREETYPE2_CFLAGS" != x; then
3778     echo "        FreeType flags are: $FREETYPE2_CFLAGS"
3779   else
3780     echo "        FreeType flags are: default include path"
3781   fi
3782   echo "        FreeType libs are: $FREETYPE2_LIBS"
3783 else
3784   echo "        RECOMMENDED: You need to have the freetype development packages installed" >&5
3785   echo "                     to use device fonts." >&5
3786   echo "                     Install it from http://www.freetype.org" >&5
3787   echo "                     or .deb users: apt-get install libfreetype6-dev" >&5
3788   echo "                     or .rpm users: yum install freetype-devel" >&5
3789   echo "                     It may still be possible to configure without freetype." >&5
3792 if test x"$FONTCONFIG_LIBS" != x; then
3793   if test x"$FONTCONFIG_CFLAGS" != x; then
3794     echo "        Fontconfig flags are: $FONTCONFIG_CFLAGS"
3795   else
3796     echo "        Fontconfig flags are: default include path"
3797   fi
3798   echo "        Fontconfig libs are: $FONTCONFIG_LIBS"
3799 else
3800   echo "        RECOMMENDED: You need to have the fontconfig development packages installed" >&5
3801   echo "                     to use device fonts." >&5
3802   echo "                     Install it from http://www.fontconfig.org" >&5
3803   echo "                     or .deb users: apt-get install libfontconfig1-dev" >&5
3804   echo "                     or .rpm users: yum install fontconfig-devel" >&5
3805   echo "                     It may still be possible to configure without fontconfig." >&5
3808 if test x$ext_mysql = xyes; then
3809   if test x$mysql != xno; then
3810     if test x"$MYSQL_LIBS" != x; then
3811       echo "        MYSQL flags are: $MYSQL_CFLAGS"
3812       echo "        MYSQL libs are: $MYSQL_LIBS"
3813     else
3814       echo "        ERROR: No MySQL development package is installed." >&3
3815       echo "               Either reconfigure without --enable-extensions=mysql" >&3
3816       echo "               or install MySQL header files from http://www.mysql.org" >&3
3817       echo "               or .deb users: apt-get install libmysqlclient-dev" >&3
3818       echo "                 or .rpm users: yum install mysql-devel" >&4
3819     fi
3820   fi
3823 if test "$GMSGFMT" = ":"; then
3824   echo "        WARNING: You need the gettext package installed to use translations." >&4
3825   echo "                 Required for building a package or 'make distcheck'" >&4
3826   echo "                 Install it from http://www.gnu.org/software/gettext/" >&4
3827   echo "                 or .deb users: apt-get install gettext" >&4
3828   echo "                 or .rpm users: yum install gettext" >&4
3831 if test x"${build_vaapi}" = x"yes"; then
3832   if test x"${LIBVA_CFLAGS}" = xyes; then
3833       echo "        LIBVA flags are: default"
3834     else
3835       echo "        LIBVA flags are: $LIBVA_CFLAGS"
3836       echo "        LIBVA libraries are: $LIBVA_LIBS"
3837   fi
3838   if test x$use_libva_x11 = xyes; then
3839     if test x"${LIBVA_X11_CFLAGS}" = xyes; then
3840       echo "        LIBVA X11 flags are: default"
3841     else
3842       echo "        LIBVA X11 flags are: $LIBVA_X11_CFLAGS"
3843       echo "        LIBVA X11 libraries are: $LIBVA_X11_LIBS"
3844     fi
3845   fi
3846   if test x$use_libva_glx = xyes; then
3847     if test x"${LIBVA_GLX_CFLAGS}" = xyes; then
3848       echo "        LIBVA GLXflags are: default"
3849     else
3850       echo "        LIBVA GLX flags are: $LIBVA_GLX_CFLAGS"
3851     fi
3852     echo "        LIBVA GLX libraries are: $LIBVA_GLX_LIBS"
3853   fi
3856 if test x"$ac_cv_gcc_visibility" != xyes; then
3857   if test x"$npapi" = xyes; then
3858     echo "        WARNING: NPAPI (mozilla) plugin is enabled, but your compiler"
3859     echo "                 does not support symbol visibility. This may cause "
3860     echo "                 the plugin to malfunction and may result in small "
3861     echo "                 children being eaten. You have been warned!"
3862   fi
3865 if test x"${DEJAGNU}" != x""; then
3866   echo "        DEJAGNU's runtest is $DEJAGNU"
3867 else
3868   echo "        WARNING: You need the dejagnu package installed to get a summary" >&4
3869   echo "                 report after running ''make check''" >&4
3870   echo "                 Install it from http://www.gnu.org/software/dejagnu/" >&4
3871   echo "                 or .deb users: apt-get install dejagnu" >&4
3872   echo "                 or .rpm users: yum install dejagnu" >&4
3875 dnl Haiku
3876 if test x"${build_haiku}" = xyes -o x"${build_sound_mkit}" = xyes -o x"${build_media_haiku}" = x"yes"; then
3877     echo "        Haiku libs are: $HAIKU_LIBS"
3880 if test x"$python" = x"yes"; then
3881   if test x"$has_python" = x"yes"; then
3882     echo "        PYTHON flags are: $PYTHON_CFLAGS"
3883     echo "        PYTHON libs are: $PYTHON_LIBS"
3884     echo "        PYTHON executable is are: $PYTHON"
3885   else
3886     echo "        ERROR: No Python development package is installed, but it's enabled." >&3
3887   fi
3889 if test x${build_ssl} = xyes; then
3890   if test x"${has_ssl}" = xyes; then
3891     if test x"${SSL_CFLAGS}" = xyes; then
3892       echo "        SSL flags are: default"
3893     else
3894       echo "        SSL flags are: $SSL_CFLAGS"
3895     fi
3896     echo "        SSL libs are: $SSL_LIBS"
3897   else
3898     echo "        ERROR: No SSL development package is installed, but it's enabled." >&3
3899   fi
3902 if test x${build_ssh} = xyes; then
3903   if test x"${has_ssh}" = xyes; then
3904     if test x"${SSH_CFLAGS}" = xyes; then
3905       echo "        SSH flags are: default"
3906     else
3907       echo "        SSH flags are: $SSH_CFLAGS"
3908     fi
3909     echo "        SSH libs are: $SSH_LIBS"
3910   else
3911     echo "        ERROR: No SSH development package is installed, but it's enabled." >&3
3912   fi
3915 if test x"${build_all_as3}" = x"yes"; then
3916   echo "        Building the entire ActionScript class libary"
3917 else
3918   echo "        Only building these ActionScript classes into the library:"
3919   echo "     ${classlist}"
3922 if test x"$testsuite" = x"yes"; then
3923   if test x"$NETCAT" != x; then
3924     echo "        You have netcat installed, which is only used for testing"
3925   else
3926     echo "        Install netcat for networking test support"
3927   fi
3928   if test x"$WGET" != x; then
3929     echo "        You have wget installed, which is only used for testing"
3930   else
3931     echo "        Install wget for networking test support"
3932   fi
3935 if test x$cross_compiling = xyes; then
3936    if test x"${android_ndk}" != xno; then
3937       AC_MSG_NOTICE([This build is setup for cross compiling for Android])
3938    else
3939       AC_MSG_NOTICE([This build is setup for cross compiling])
3940    fi
3943 echo "--------"
3945 if test x"${cygnal}" = x"yes"; then
3946   echo "        Building Cygnal media server enabled (default). Use --disable-cygnal to disable."
3947 else
3948   echo "        Building Cygnal media server disabled."
3951 if test x"${with-top_level}" != x; then
3952   echo "        Top level for cross compiling support files is: $with_top_level"
3955 if test x"${build_gtk}" = xyes -a x"${pixelformat}" = xrgb565; then
3956   echo "        WARNING: Pixel format RGB565 selected in combination with the" >&4
3957   echo "                 GTK GUI. Only a hacked GTK will work (e.g. on the OLPC)." >&4
3960 if test x"${extensions_list}" != x; then
3961   echo "        Building extensions: ${extensions_list}"
3964 if test x"${security_list}" != x; then
3965   echo "        Enabling security features: ${security_list}"
3968 if test x"${hwaccel_list}" != xnone; then
3969   echo "        Enabling hardware acceleration features: ${hwaccel_list}"
3972 if test x"${statistics_list}" != x; then
3973   echo "        Enabling statistics collecting for: ${statistics_list}"
3976 if test x"${SUPPORTED_GUIS}" = x; then
3977   AC_MSG_ERROR(no supported GUIs found);
3980 echo "        GUI toolkits supported: ${SUPPORTED_GUIS}"
3981 echo "        Renderers supported: ${renderer_list}"
3982 echo "        Hardware Acceleration: ${hwaccel_list}"
3983 echo "        Media handlers: ${media_list}"
3984 echo "        Using ${add_sound} for sound handling"
3985 echo "        Using $with_shm mode for shared memory"
3987 if test x"$docbook" = x"yes"; then
3988   echo '        DocBook document processing enabled (for "make html" and "make pdf")'
3989   if test x"$docbook_styles" != x; then
3990     echo "        Docbook styles sheets in $docbook_styles"
3991   fi
3992 else
3993   echo "        DocBook document processing disabled (default)"
3996 dnl The Framebuffer GUI has several other settings. As it doesn't have X11,
3997 dnl we have to handle input devices ourselves.
3998 if test x"${build_fb}" = xyes; then
3999 echo "        Using ${input_events} for Input"
4000   if test x"${fakefb}" != x; then
4001     echo "        Using shared memory as a fake framebuffer"
4002   fi
4003   if test x"${offscreen}" = xyes; then
4004     echo "        Using offscreen rendering"
4005   fi
4006   if test x"${doublebuf}" = xyes; then
4007     echo "        Using double buffering when rendering"
4008   fi
4011 if test -s $cwarn; then
4012   echo ""
4013   cat $cwarn
4014   rm $cwarn
4015   echo ""
4016   echo "Gnash should still compile even with these warnings."
4017   echo "If it doesn't, report the warnings as a bug."
4018 else
4019   rm $cwarn
4022 if test -s $crec; then
4023   echo ""
4024   cat $crec
4025   rm $crec
4026   echo ""
4027   echo "Gnash should still compile, but you'll miss important support"
4028 else
4029   rm $crec
4032 dnl If anything critical is missing, don't bother to continue
4033 if test -s $cerr; then
4034   echo ""
4035   cat $cerr >&2
4036   rm $cerr
4037   AC_MSG_ERROR([Please install required packages])
4038 else
4039   rm $cerr
4043 if test x"$fork" = x"no"; then
4044   AC_MSG_ERROR([Currently only forking the standalone player works!])
4046 echo ""
4048 # Local Variables:
4049 # c-basic-offset: 2
4050 # tab-width: 2
4051 # indent-tabs-mode: nil
4052 # End: