clarify that software double buffering is for AGG only.
[gnash.git] / configure.ac
blob23ea1ad8cab3027cb751c1adb76a8a2e1d8011f8
1 dnl  
2 dnl  Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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.59c)
19 AC_INIT(gnash, 0.8.10dev)
20 AC_CONFIG_SRCDIR([libcore/as_object.h])
21 AC_CONFIG_HEADERS([gnashconfig.h])
22 AC_CONFIG_MACRO_DIR([macros])
24 AC_CANONICAL_BUILD
25 AC_CANONICAL_HOST
27 dnl --------------------------------------------------------
28 dnl Figure out development tool stuff
29 dnl --------------------------------------------------------
31 AC_PROG_CXX
32 AC_PROG_CC
33 AM_PROG_CC_C_O
34 AC_EXEEXT
35 AC_PROG_INSTALL
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   *-*wince)
192     wince=yes
193     AC_DEFINE([WINCE_HOST], [1], [this is a WINCE platform])
194     ;;
195   *-*winmo)
196     wince=yes
197     AC_DEFINE([WINCE_HOST], [1], [this is a WINCE platform])
198     AC_DEFINE([WINCE6_HOST], [1], [this is a WINCE6 platform])
199     ;;
200   *-android*)
201     android=yes
202     AC_DEFINE([ANDROID_HOST], [1], [this is an Android platform])
203     ;;
204 esac
207 AM_CONDITIONAL(LINUX, test x$linux = xyes)
208 AM_CONDITIONAL(WIN32, test x$windows = xyes)
209 AM_CONDITIONAL(HAIKU, test x$haiku = xyes)
210 AM_CONDITIONAL(AMIGAOS4, test x$amigaos4 = xyes)
212 dnl Get build date for helping us debugging
213 BUILDDATE="`date +%Y%m%d`"
214 AC_SUBST(BUILDDATE)
216 dnl These are required by automake
217 AM_INIT_AUTOMAKE
218 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
219 AM_MAINTAINER_MODE
220 AC_PROG_MAKE_SET
222 AM_GNU_GETTEXT([external])
223 AM_CONDITIONAL(HAS_GETTEXT, test x$ac_cv_path_XGETTEXT != x)
225 dnl Many of the Gnash macros depend on gettext macros defining shlibext; recent
226 dnl gettext however does not.
227 if test x"${shlibext}" = x; then
228   if test x"${acl_cv_shlibext}" = x; then
229     echo "Gettext macros were supposed to define shared library extensions"
230     exit 1;
231   else
232     shlibext="${acl_cv_shlibext}"
233   fi
236 dnl This is primarily used when compiling for a similar architecture,
237 dnl like pentium->geode, which can use the same compiler, but have
238 dnl different development libraries.
240 AC_ARG_WITH(sysroot,
241   AC_HELP_STRING([--with-sysroot],
242   [system root directory for cross compiling]),
243   with_top_level=${withval} ;
244   cross_compiling=yes)
246 dnl Android is a little different when using a standard cross toolchain,
247 dnl so we have to configure especially for it for now. Usually it's
248 dnl something like this:
250 dnl arm-linux-eabi-gcc -Wl,--dynamic-linker -Wl,/system/bin/linker
251 dnl -nostdlib -Wl,-rpath -Wl,/system/lib -Wl,-rpath
252 dnl -Wl,/opt/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib
253 dnl -L/opt/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib
254 dnl -lc -o hello
255 dnl  /opt/android-ndk-r3/build/platforms/android-3/arch-arm/usr/lib/crtbegin_dynamic.o
256 dnl Recent versions of G++ (I'm using 4.5 from source
257 android_ndk=no
258 AC_ARG_WITH([android],
259   AC_HELP_STRING([--with-android], [directory where android NDK is installed]),
260         android_ndk=${withval}
261         if test x"${withval}" != x; then
262           android_ndk=${withval}
263         else
264           android_ndk=/opt/android-ndk-r3/build/platforms/android-5/arch-arm
265         fi
267 CROSS_CXXFLAGS=
268 if test x"${android_ndk}" != xno; then
269   CROSS_CXXFLAGS=-mandroid -fexceptions
270   if test x"${with_top_level}" = x; then
271     with_top_level=/usr/local/android-arm/sysroot/usr
272     cross_compiling=yes
273   fi
274   ANDROID_NDK=${android_ndk}
275   AC_DEFINE(ANDROID, [1], [This is an Android build])
276 else
277   ANDROID_NDK=
279 AC_SUBST(ANDROID_NDK)
280 AM_CONDITIONAL(ANDROID, [ test x"${android_ndk}" != xno ])
282 AC_C_BIGENDIAN
283 AC_C_CONST
284 AC_C_INLINE
286 AC_PATH_PROG(DEJAGNU, runtest)
288 dnl These options are for Cygnal, which collects optional statistics
289 dnl on all the network traffic By default, we turn on statistics
290 dnl collecting for the incoming and outgoing queues, since those are
291 dnl required to be compatiable with FMS 3, and the ActionScript server
292 dnl management API. buffers are the lowest level data storage, this
293 dnl data is the time spent in the queue, and is primarily only used
294 dnl for tuning the queueing API in Gnash. Memoryis the same, it's only
295 dnl used by developers for tuning performance of memory allocations in
296 dnl Gnash.
297 buffers=no
298 que=no
299 memory=no
300 cache=yes
301 stat_proplookup=no
302 AC_ARG_WITH(statistics,
303   AC_HELP_STRING([--with-statistics=], [Specify which statistics features to enable]),
304   if test -n ${withval}; then
305     if test "x${withval}" != "xno"; then
306       extlist="${withval}"
307       withval=`echo ${withval} | tr '\054' ' ' `
308     else
309       extlist=""
310       withval=""
311     fi
312   fi
313   statistics_list=""
314   nstatistics=0
315   while test -n "${withval}" ; do
316     val=`echo ${withval} | cut -d ' ' -f 1`
317     [case "${val}" in
318       buffers)
319         buffers=yes
320         nstatistics=$((nstatistics+1))
321         ;;
322       que)
323         que=yes
324         nstatistics=$((nstatistics+1))
325         ;;
326       memory)
327         memory=yes
328         nstatistics=$((nstatistics+1))
329         ;;
330       cache)
331         cache=yes
332         nstatistics=$((nstatistics+1))
333         ;;
334       proplookup)
335         stat_proplookup=yes
336         nstatistics=$((nstatistics+1))
337         ;;
338       all|ALL)
339         buffers=yes
340         memory=yes
341         queu=yes
342         cache=yes
343         stat_proplookup=yes
344         nstatistics=5           dnl this must be incremented if you add anything
345         ;;
346       *) AC_MSG_ERROR([invalid statistics feature specified: ${withval} given (accept: buffers|que|memory|cache|proplookup|all)])
347         ;;
348       esac]
349     withval=`echo ${withval} | cut -d ' ' -f 2-6`
350     if test "x$val" = "x$withval"; then
351       break;
352     fi
353   done
355 if test x${buffers} = xyes; then
356   statistics_list="${statistics_list} buffers"
357   AC_DEFINE(USE_STATS_BUFFERS, [1], [Support statistics collecting for the queue buffers])
358   AC_MSG_WARN([This option will effect your performance])
361 if test x${memory} = xyes; then
362   statistics_list="${statistics_list} memory"
363   AC_DEFINE(USE_STATS_MEMORY, [1], [Support statistics collecting for all memory profiling])
364   AC_MSG_WARN([This option will effect your performance])
367 if test x${que} = xyes; then
368   statistics_list="${statistics_list} queues"
369   AC_DEFINE(USE_STATS_QUEUE, [1], [Support statistics collecting for the queues])
372 if test x${cache} = xyes; then
373   statistics_list="${statistics_list} cache"
374   AC_DEFINE(USE_STATS_CACHE, [1], [Support statistics collecting for the cache])
377 if test x${stat_proplookup} = xyes; then
378   statistics_list="${statistics_list} proplookup"
379   AC_DEFINE(GNASH_STATS_OBJECT_URI_NOCASE, [1], [Collecting and report stats about ObjectURI case lookups])
380   AC_DEFINE(GNASH_STATS_PROPERTY_LOOKUPS, [1], [Collecting and report stats about property lookups])
381   AC_DEFINE(GNASH_STATS_STRING_TABLE_NOCASE, [1], [Collecting and report stats about string_table::key case lookups])
384 dnl this is just so Makefile can print the same list
385 STATISTICS_LIST="$statistics_list"
386 AC_SUBST(STATISTICS_LIST)
389 # These settings are compile time options for the security
390 # setting for anything that lets gnash exchange data with
391 # other applications. Currently this only supports Shared
392 # Objects and Local Connections. Shared Objects are like
393 # your web browsers cookies, and Local Connections use
394 # shared memory to execute methods remotely, and to
395 # exchange data.
397 # The default is to enable everything, and these can
398 # also be controlled dynamically by the $HOME/.gnashrc
399 # file.
401 solreadonly=no
402 localconnection=yes
404 AC_ARG_WITH(security,
405   AC_HELP_STRING([--with-security=], [Specify which security features to enable]),
406   if test -n ${withval}; then
407     if test "x${withval}" != "xno"; then
408       extlist="${withval}"
409       withval=`echo ${withval} | tr '\054' ' ' `
410     else
411       extlist=""
412       withval=""
413     fi
414   fi
415   security_list=""
416   nsecurity=0
417   while test -n "${withval}" ; do
418     val=`echo ${withval} | cut -d ' ' -f 1`
419     [case "${val}" in
420       solreadonly)
421         solreadonly=yes
422         nsecurity=$((nsecurity+1))
423         ;;
424       lc)
425         localconnection=yes
426         nsecurity=$((nsecurity+1))
427         ;;
428       all|ALL)
429         solreadonly=yes
430         lc=yes
431         nsecurity=3
432         ;;
433       *) AC_MSG_ERROR([invalid security feature specified: ${withval} given (accept: solreadonly|lc)])
434         ;;
435       esac]
436     withval=`echo ${withval} | cut -d ' ' -f 2-6`
437     if test "x$val" = "x$withval"; then
438       break;
439     fi
440   done
443 if test x$localconnection = xyes; then
444   security_list="${security_list} localconnection"
445   AC_DEFINE(USE_LC, [1],
446                  [Support LocalConnection])
447   AC_MSG_NOTICE([This build supports LocalConnection])
449 if test x$solreadonly = xyes; then
450   security_list="${security_list} solreadonly"
451   AC_DEFINE(USE_SOL_READONLY, [1],
452                  [Shared Objects are read-only])
453   AC_MSG_NOTICE([Shared Objects are read-only])
455 SECURITY_LIST="$security_list"
456 AC_SUBST(SECURITY_LIST)
458 dnl For Haiku, we know the sysroot is in a non-standard place
459 dnl it is important that -lagg comes before -lbe
460 if test x"${haiku}" = xyes; then
461   HAIKU_LIBS=-lbe
462   AC_SUBST(HAIKU_LIBS)
465 dnl Darwin uses libtool instead of ar to produce libraries. We determine which one
466 dnl we have here now. For some reason on Darwin, we don't get the
467 dnl count from grep via stdin correctly. Writing a temp file does the
468 dnl trick, so although it's ugly, that's what we gotta do...
469 AC_MSG_CHECKING([which type of library archiver we have])
470 rm -f .tmp
471 libtool > .tmp 2>&1
472 archiver=`grep -c dynamic .tmp 2>&1`
473 rm -f .tmp
474 dnl is there any good way to report what we found here?
475 AC_MSG_RESULT()
476 if test x"${archiver}" != x && test "${archiver}" -eq 1; then
477    export MACOSX_DEPLOYMENT_TARGET="10.3"
478    darwin=yes
479 else
480    darwin=no
483 dnl When cross compiling, limit the search directories cause otherwise
484 dnl we may get the host headers or libraries by accident. These values
485 dnl are exported, so all the other configure tests in macros/*.m4 use
486 dnl these same settings rather than duplicating them like we used to.
487 dnl To override thise, use the --with-*-incl= and --with-*-libs=
488 dnl options to configure.
489 if test x$cross_compiling = xyes; then
490   AC_MSG_NOTICE([Configuring Gnash for cross compilation])
491   export pkgroot="`$CXX -print-search-dirs | grep "install:" | sed -e 's/install: //' -e 's:/lib/gcc/.*::'`"
492   dnl pkgroot only works correctly with builds of cross tools not in
493   dnl /usr, ie... installed from the distribution packages, or just
494   dnl plain installed in the system tools. This contaminates configure
495   dnl when building for variations of the same basic architecture,
496   dnl like i686-linux -> i586-mingw32.
497   if test x"${pkgroot}" = x"/usr"; then
498     export pkgroot=""
499   fi
500   export incllist="`eval echo ${with_top_level}/include ${pkgroot}/${host_alias}/include ${pkgroot}/include`"
501   export libslist="`eval echo ${with_top_level}/lib ${pkgroot}/${host_alias}/lib ${pkgroot}/lib64 ${pkgroot}/lib32 ${pkgroot}/lib`"
502   export pathlist="`eval echo ${pkgroot}/${host_alias}/bin:${pkgroot}/bin`"
503   npapi=no
504 else
505   AC_MSG_NOTICE([Configuring Gnash for native compilation])
506   export DEB_HOST_MULTIARCH="`eval dpkg-architecture -qDEB_HOST_MULTIARCH`"
507   export incllist="`eval cat ${srcdir}/macros/incllist`"
508   libslist="`cat ${srcdir}/macros/libslist`"
509   export libslist="${libslist} /lib/${DEB_HOST_MULTIARCH} /usr/lib/${DEB_HOST_MULTIARCH}"
510   export pathlist=$PATH
513 if test x"${android_ndk}" != xno; then
514    incllist="${android_ndk}/include ${incllist}"
517 AM_CONDITIONAL(CROSS_COMPILING, [ test x$cross_compiling = xyes ])
519 for dir in ${incllist}; do
520   test -d ${dir} && pruned_incllist="${pruned_incllist} ${dir}";
521 done
523 for dir in ${libslist}; do
524   test -d ${dir} && pruned_libslist="${pruned_libslist} ${dir}";
525 done
527 libslist="${pruned_libslist}";
528 incllist="${pruned_incllist}";
530 dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
531 dnl !! 
532 dnl !! IMPORTANT NOTICE 
533 dnl !!
534 dnl !!  Any call to GNASH_PATH_XXX must be be given *after* this snippet.
535 dnl !!  This is to ensure that PKG_CONFIG, cross_compiling and incllist are
536 dnl !!  properly set at the time of call.
537 dnl !!
538 dnl !!  Also GNASH_PKG_FIND has to be called later. Not sure
539 dnl !!  why but calling before breaks detection of CPP (see
540 dnl !!  gnash-dev mailing archives for June 12 2009
541 dnl !!  http://lists.gnu.org/archive/html/gnash-dev/2009-06/index.html
542 dnl !! 
543 dnl !! 
544 dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
546 dnl Check for PKG_CONFIG before any GNASH_PATH call
547 PKG_PROG_PKG_CONFIG
549 dnl --------------------------------------------------------
550 dnl  GUI selection
551 dnl --------------------------------------------------------
553 build_haiku=no
554 build_aos4=no      dnl AmigaOS4 GUI
555 build_kde3=no      dnl WARNING: doesn't work (see https://savannah.gnu.org/bugs/index.php?31782)
556 build_qt4=no
557 build_qtopia3=no
558 build_qtopia4=no
559 build_gtk=no
560 build_fb=no                     dnl Raw framebuffer
561 build_fltk=no
562 build_sdl=no
563 build_aqua=no                   dnl Native MacOSX
564 build_dump=no
565 AC_ARG_ENABLE(gui,
566   AC_HELP_STRING([--enable-gui=], [Enable support for the specified GUI toolkits (default=gtk,qt4)]),
567   [if test -n ${enableval}; then
568     enableval=`echo ${enableval} | tr '\054' ' ' `
569   fi
570   while test -n "${enableval}" ; do
571     val=`echo ${enableval} | cut -d ' ' -f 1`
572     case "${val}" in
573       gtk|GTK|gtk2|GTK2)
574         build_gtk=yes
575         ;;
576       kde3|KDE3)
577         build_kde3=yes
578         ;;
579       qt4|QT4|kde4|KDE4)
580         build_qt4=yes
581         ;;
582       qtopia3|QTOPIA3)
583         build_qtopia3=yes
584         ;;
585       qtopia4|QTOPIA4)
586         build_qtopia4=yes
587         ;;
588       sdl|SDL)
589         build_sdl=yes
590         ;;
591       aqua|AQUA|Aqua)
592         build_aqua=yes
593         ;;
594       fltk|FLTK|fltk2|FLTK2)
595         build_fltk=yes
596         ;;
597       fb|FB)
598         build_fb=yes
599         ;;
600       aos4|AOS4)
601         build_aos4=yes
602         ;;
603       haiku|HAIKU)
604         build_haiku=yes
605         ;;
606       dump|DUMP)
607         build_dump=yes
608         ;;
609       all|ALL)
610         build_dump=yes
611         dnl BSD doesn't have a framebuffer interface
612         if test x${linux} = xyes; then
613           build_fb=yes
614         fi
615         if test x${openbsd} != xyes; then
616           build_qt4=yes
617         fi
618         build_sdl=yes
619         build_gtk=yes
620         ;;
621       *) AC_MSG_ERROR([invalid gui ${enableval} given (accept: gtk|kde3|qt4|fltk|sdl|aqua|fb|qtopia3|qtopia4|dump|aos4|haiku)])
622          ;;
623       esac
624     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
625     if test "x$val" = "x$enableval"; then
626       break;
627     fi
628   done],
629   [ dnl Run the following code if no --enable-gui is given
630   build_fb=auto
631   build_sdl=auto
632   if test x"${openbsd}" = xyes; then
633     build_gtk=yes
634     build_dump=auto
635   else if test x"${haiku}" = xyes; then
636     build_haiku=yes;
637   else
638     build_qt4=auto
639     build_gtk=yes
640     build_dump=auto
641   fi
642   fi
643   ]
646 if test x"${build_haiku}" = xyes; then
647   if test x"$haiku" != xyes; then
648     echo "        ERROR: Can not build Haiku gui outside of Haiku
649 operating system." >&3
650   fi
653 dnl We can use Xephyr or fbe to create a fake framebuffer instead of real
654 dnl video memory. This lets us test on a desktop machine.
655 AC_ARG_WITH(fakefb,
656 AC_HELP_STRING([--with-fakefb],
657  [specify a file to be mapped instead of a real framebuffer]),
658  with_fakefb=${withval})
660 fakefb=
661 if test x"${with_fakefb}" = xyes; then
662   dnl This is the default file name fbe uses.
663   fakefb=/tmp/fbe_buffer
664 else
665   if test x"${with_fakefb}" != x; then
666     fakefb=${with_fakefb}
667   fi
669 FAKEFB=${fakefb}
670 AC_SUBST(FAKEFB)
672 if test x"${fakefb}" != x; then
673     AC_DEFINE(ENABLE_FAKE_FRAMEBUFFER, [1], [Enable using a file instead of a real framebuffer])
676 dnl This enable a small handful of tests that aren't designed to be
677 dnl run as part of "make check", as they are either incomplete, or
678 dnl can only be run interactively. These are all primarily oriented
679 dnl towards code development and debugging, instead of regression
680 dnl or unit testing.
681 AC_ARG_ENABLE(devtests, AC_HELP_STRING([--enable-devtests],
682   [Developer only tests, not to be included in make check]),
683 [case "${enableval}" in
684   yes) devtests=yes ;;
685   no)  devtests=no ;;
686   *)   AC_MSG_ERROR([bad value ${enableval} for enable-devtests option]) ;;
687 esac], devtests=no)
688 AM_CONDITIONAL(ENABLE_DEVELOPER_TESTS, [test x${devtests} = xyes])
690 dnl --------------------------------------------------------
691 dnl  Sound handler selection
692 dnl --------------------------------------------------------
693 add_sound=
694 build_sound_none=no
695 build_sound_sdl=no
696 build_sound_ahi=no
697 build_sound_mkit=no
698 AC_ARG_ENABLE(sound,
699   AC_HELP_STRING([--enable-sound=[[sdl|ahi|mkit]]], [Use the specified sound handler (default=sdl)]),
700      [case "${enableval}" in
701       sdl|SDL|Sdl)
702         build_sound_sdl=yes
703         add_sound="sdl"
704         ;;
705       none|NONE|None)
706         build_sound_none=yes
707         add_sound="none"
708         ;;
709       ahi|AHI|Ahi)
710         build_sound_ahi=yes
711         add_sound="ahi"
712         ;;
713       mkit|MKIT|Mkit)
714         build_sound_mkit=yes
715         add_sound="mkit"
716         ;;
717      esac],
718   [if test x"${haiku}" = xyes; then
719      build_sound_mkit=yes
720      add_sound="mkit"
721    else
722      if test x${build_sound_none} = xno; then
723        build_sound_sdl=yes
724        add_sound=sdl
725      fi
726    fi]
729 dnl --------------------------------------------------------
730 dnl  Media handler selection
731 dnl --------------------------------------------------------
732 build_media_gst=no
733 build_media_ffmpeg=auto
734 build_media_none=no
735 AC_ARG_ENABLE(media,
736   AC_HELP_STRING([--enable-media=handler],
737     [Enable media handling support using the specified handler: gst, ffmpeg or none (no sound) [[gst]] ]),
738   
739     if test -n ${enableval}; then
740       enableval=`echo ${enableval} | tr '\054' ' ' `
741     fi
742     dnl When --enable-media is given, all media defaults to off
743     dnl except the explicitly enabled ones
744     build_media_ffmpeg=no
745     build_media_gst=no
746     while test -n "${enableval}"; do
747       val=`echo ${enableval} | cut -d ' ' -f 1`
748       [case "${val}" in
749         GST|gst)
750           build_media_gst=yes
751           media_list="${media_list}gst "
752           ;;
753         FFMPEG|ffmpeg)
754           build_media_ffmpeg=yes
755           media_list="${media_list}ffmpeg "
756           ;;
757         no|NO|none)
758           build_media_none=yes
759           media_list="none"
760           ;;
761         *)
762           AC_MSG_ERROR([bad value ${enableval} for --enable-media option])
763           ;;
764      
765       esac]
766       enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
767       if test "x$val" = "x$enableval"; then
768         break;
769       fi
770     done,
771     [if test x"${build_haiku}" = xyes; then
772         build_media_ffmpeg=yes
773         build_media_haiku=yes
774         media_list="ffmpeg haiku"
775      else
776         build_media_gst=yes
777         media_list="gst"
778     fi]
781 dnl If no render is selected, and media handling isn't disabled, them enable gst
782 if test x${build_media_none} = xno -a x${build_media_gst} = xno -a x${build_media_ffmpeg} = xno; then
783   build_media_gst=yes
786 if test x"$build_media_ffmpeg" != x"no"; then # yes or auto
787   GNASH_PATH_FFMPEG
788   if test x"${build_media_ffmpeg}" = xauto; then
789     dnl TODO: have GNASH_PATH_FFMPEG set ${has_ffmpeg}
790     if test x"$FFMPEG_LIBS" != x; then
791       build_media_ffmpeg=yes
792       media_list="${media_list} ffmpeg"
793     else
794       build_ogl=no
795     fi
796   fi
799 MEDIA_CONFIG="${media_list}"
800 AC_SUBST(MEDIA_CONFIG)
802 dnl Multiple input devices are supported. These can all work in
803 dnl varying combinations, so several may be listed. These are only
804 dnl required when using the Framebuffer, as without the X11 desktop,
805 dnl Gnash has to handle all these internally. This can get
806 dnl messy, as one might want to use a touchscreen with a normal mouse
807 dnl or keyboard attached. 
808 dnl By default, don't build any of these, as they are only for the 
809 dnl Framebuffer running without X11.
810 if test x"${build_fb}" = xyes -a x"${linux}" = xyes; then
811   build_ps2mouse=yes
812   build_ps2keyboard=yes
813   build_input_events=yes
814   build_tslib=yes
815   input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via Tslib"
816 else
817   build_ps2mouse=no
818   build_ps2keyboard=no
819   build_input_events=no
820   build_tslib=no
821   input_events=
823 AC_ARG_ENABLE(input,
824   AC_HELP_STRING([--enable-input], [Enable support for the specified input devices for the framebuffer GUI (default=ps2mouse|ps2keyboard|events|touchscreen)]),
825   [if test -n ${enableval}; then
826     enableval=`echo ${enableval} | tr '\054' ' ' `
827   fi
828   build_ps2mouse=no
829   build_ps2keyboard=no
830   build_input_events=no
831   build_tslib=no
832   while test -n "${enableval}" ; do
833     val=`echo ${enableval} | cut -d ' ' -f 1`
834     case "${val}" in
835       ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
836         build_ps2mouse=yes
837         input_events="${input_events}, PS/2 Mouse"
838         ;;
839       ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
840         build_ps2keyboard=yes
841         input_events="${input_events}, PS/2 Keyboard"
842         ;;
843       i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
844         input_events="${input_events}, Input Event Device"
845         build_input_events=yes
846         ;;
847       t*|T*) dnl use a touchscreen with tslib, which works like a mouse
848         build_tslib=yes
849         input_events="${input_events}, Touchscreen"
850         ;;
851       a*) dnl all
852         build_ps2mouse=yes
853         build_ps2keyboard=yes
854         build_tslib=yes
855         if test x"${build_fb}" = xyes -a x"${linux}" = xyes; then
856           build_input_events=yes
857           input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via Tslib"                
858         else
859           build_input_events=no
860           input_events="PS/2 Mouse, PS/2 Keyboard, Touchscreen via Tslib"                
861         fi
862         ;;
863       *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: ps2mouse|keyboard|events,touchscreen)])
864          ;;
865       esac
866     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
867     if test "x$val" = "x$enableval"; then
868       break;
869     fi
870   done],
873 if test x$build_sdl != xno -o x$build_sound_sdl = xyes; then
874   GNASH_PATH_SDL
876 AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} = xyes])
879 dnl -----------------------------------------------------
880 dnl Check for SDL and decide about auto gui accordingly.
881 dnl Need be done after build_sound_sdl and build_sdl are
882 dnl initialized and before they are checked for yes/no
883 dnl -----------------------------------------------------
884 if test x"${build_sdl}" = xauto; then
885   if test xyes = x"${has_sdl}"; then
886     build_sdl=yes
887   else
888     AC_MSG_NOTICE([sdl GUI will not be built (no sdl development files found)])
889     build_sdl=no
890   fi
893 dnl -------------------------------
894 dnl Renderer Selection
895 dnl -------------------------------
896 input_events=
897 dnl By default, we want to to build all renderers
898 dnl DirectFB has both a device layer and a rendering layer, although
899 dnl currently the rendering part is incomplete. Configure support is
900 dnl included for development purposes.
901 build_directfb=no
902 dnl The OpenVG support works on both the desktop and embedded devices
903 dnl that don't run X11. It is supported by iPhone/iPad/Android
904 dnl devices, and the nouveau driver on the desktop.
905 build_ovg=no
906 dnl The OpenGLES1 renderer is a work in progress. It is originally
907 dnl based on a patch to Gnash 0.8.5, which of course not only didn't
908 dnl compile anymore, it was all hardcoded into the framebuffer
909 dnl code. This version compiles with the latest internal rendering
910 dnl API, and works properly with the glue code for the Gnash GUIs.
911 build_gles1=no
912 dnl OpenGL works, but suffers from performance and rendering quality
913 dnl problems. This should eventually be replacd by the OpenGLES1 and
914 dnl OpenVG renders.
915 build_ogl=no
916 dnl AGG is a software only renderer
917 build_agg=yes
918 build_cairo=yes
919 renderer_list="agg cairo"
920 AC_ARG_ENABLE(renderer,
921   AC_HELP_STRING([--enable-renderer], [Enable support for the specified renderers (agg|cairo|opengl|openvg|all, default=all)]),
922   if test -n ${enableval}; then
923     if test "x${enableval}" != "xno" -o "x${enableval}" != "xnone" ; then
924       renderer_list="none"
925       enableval=`echo ${enableval} | tr '\054' ' ' `
926     else
927       renderer_list=""
928       enableval=""
929     fi
930   fi
931   renderer_list=""
932   build_ovg=no
933   build_ogl=no
934   build_gles1=no
935   build_gles2=no
936   build_agg=no
937   build_cairo=no
938   while test -n "${enableval}" ; do
939     val=`echo ${enableval} | cut -d ' ' -f 1`
940     [case "${val}" in
941       no*|NO*)
942         renderer_list="none"
943         build_ovg=no
944         build_ogl=no
945         build_gles1=no
946         build_gles2=no
947         build_agg=no
948         build_cairo=no
949         ;;
950       all|ALL)
951         renderer_list="agg cairo opengl openvg, opengles1"
952         build_ogl=yes
953         build_agg=yes
954         build_cairo=yes
955         build_ovg=yes
956         nrender=4
957         ;;
958       ogl|OGL|OpenGL|opengl)
959         renderer_list="${renderer_list} opengl"
960         build_ogl=yes
961         ;;
962       gles|GLES|gles1|GLES1)
963         renderer_list="${renderer_list} opengles1"
964         build_gles1=yes
965         build_ogl=no
966         nrender=$((nrender+1))
967         ;;
968       ovg|OVG|OpenVG|openvg)
969         renderer_list="${renderer_list} openvg"
970         build_ovg=yes
971         nrender=$((nrender+1))
972         ;;
973       directfb|dfb)
974         renderer_list="${renderer_list} DirectFB"
975         build_directfb=yes
976         nrender=$((nrender+1))
977         ;;
978       agg|AGG)
979         renderer_list="${renderer_list} agg"
980         build_agg=yes
981         ;;
982       cairo|CAIRO|Cairo*)
983         renderer_list="${renderer_list} cairo"
984         build_cairo=yes
985         ;;
986       *) AC_MSG_ERROR([invalid renderer specified: ${enableval} given (accept:  (opengl|openvg|cairo|agg|all)])
987         ;;
988       esac]
989     enableval=`echo ${enableval} | cut -d ' ' -f 2-`
990     if test "x$val" = "x$enableval"; then
991       break;
992     fi
993   done
996 if test x"${build_ovg}" = xyes; then
997   GNASH_PATH_OPENVG
998   dnl If OpenVG isn't installed, disable it
999   if test x"${has_openvg}" = xno; then
1000     AC_MSG_WARN([OpenVG specified but no development files found!])
1001     renderer_list=`echo ${renderer_list} | sed -e 's/ openvg//' `
1002     nrender=$((nrender-1))
1003   fi
1006 dnl VA API is used by default for all H.264 videos. HW requirements:
1007 dnl     * AMD GPUs with UVD2 and xvba-video VA driver
1008 dnl     * NVIDIA GPUs with vdpau-video VA driver
1009 dnl     * All HW with a VA driver supporting the VA/GLX extensions or
1010 dnl     vaPutSurface(Pixmap,...). This may include the Intel
1011 dnl     Moorestown platform and future G45 VA driver.
1012 dnl NOTE: it is possible to use Gnash/VAAPI on platforms with an Intel
1013 dnl GMA500 but you currently will have to build the AGG renderer
1014 dnl instead of the OGL (OpenGL) one. 
1015 build_vaapi_device=no
1016 build_openmax_device=no
1017 if test x"${build_ovg}" = xyes; then
1018   build_egl_device=yes
1019 else
1020   build_egl_device=no
1022 build_x11_device=no
1023 build_directfb_device=no
1024 if test x"${build_fb}" = xyes -o x"${build_fb}" = xauto; then
1025   build_fb_agg=yes
1027 dnl AGG support for the framebuffer requires the rawfb device
1028 if test x"${build_fb_agg}" = xyes -a x"${build_agg}" = xyes; then
1029   build_rawfb_device=yes
1030   device_list="RawFB"
1031   ndevice=1
1032 else
1033   build_rawfb_device=no
1034   device_list=""
1035   ndevice=0
1037 AC_ARG_ENABLE(device,
1038   AC_HELP_STRING([--enable-device], [Specify which hardware abstraction to use to support to enable (none,egl,directfb,rawfb,x11,vaapi)]),
1039   enableval=`echo ${enableval} | tr '\054' ' ' `
1040   build_egl_device=no
1041   build_rawfb_device=no
1042   device_list=""
1043   ndevice=0
1044   while test -n "${enableval}" ; do
1045     val=`echo ${enableval} | cut -d ' ' -f 1`
1046     [case "${val}" in
1047       no*|NO*)
1048         device_list="none"
1049         build_vaapi_device=no
1050         build_openmax_device=no
1051         build_egl_device=no
1052         build_directfb_device=no
1053         build_x11_device=no
1054         ndevice=0
1055         ;;
1056       va*|VA*)
1057         device_list="${device_list} VAAPI"
1058         build_vaapi_device=yes
1059         ndevice=$((ndevice+1))
1060         ;;
1061       eg*|EG*)
1062         device_list="${device_list} EGL"
1063         build_egl_device=yes
1064         ndevice=$((ndevice+1))
1065         ;;
1066       x1*|X1*)
1067         device_list="${device_list} X11"
1068         build_x11_device=yes
1069         ndevice=$((ndevice+1))
1070         ;;
1071       di*|Di*|DI*|dfb)
1072         device_list="${device_list} DirectFB"
1073         build_directfb_device=yes
1074         ndevice=$((ndevice+1))
1075         ;;
1076       ra*|RAW*)
1077         device_list="${device_list} RawFB"
1078         build_rawfb_device=yes
1079         ndevice=$((ndevice+1))
1080         ;;
1081       all|ALL)
1082         device_list="EGL DirectFB X11"
1083         build_openmax_device=no
1084         build_vaapi_device=no
1085         build_egl_device=yes
1086         build_rawfb_device=yes
1087         build_directfb_device=no
1088         build_x11_device=yes
1089         ndevice=5
1090         ;;
1091       op*|Op*|OP*)
1092         device_list="${device_list} OpenMAX"
1093         build_openmax_device=yes
1094         ndevice=$((ndevice+1))
1095         ;;
1096       *) AC_MSG_ERROR([invalid device feature specified: ${enableval} given (accept: none,vaapi)])
1097         ;;
1098       esac]
1099     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1100     if test "x$val" = "x$enableval"; then
1101       break;
1102     fi
1103   done
1106 dnl Lenny doesn't support this filed for Linux Input events
1107 AC_TRY_COMPILE([#include <linux/input.h>], [
1108   struct input_absinfo abs;
1109   abs.resolution = 0;; ],
1110  AC_DEFINE([ABSINFO_RESOLUTION], [1], [ABS Resolution field])
1113 if test x"${have_ffmpeg_vaapi}" = x"yes" -a x"${build_vaapi_device}" = x"yes"; then
1114   use_libva=no
1115   use_libva_x11=no
1116   use_libva_glx=no
1117   dnl if the version of FFmpeg is recent enough, (r20957, 52.45.0), then
1118   dnl look for VAAPI support so we can use use the VAAPI enabled FFmpeg.
1119   if test x"${have_ffmpeg_vaapi}" = xyes; then
1120     use_libva=yes
1121     GNASH_PKG_FIND([libva],
1122       [va/va.h],
1123       [Video Acceleration API],
1124       vaInitialize
1125     )
1126     use_libva_x11=yes
1127     GNASH_PKG_FIND([libva_x11],
1128       [va/va_x11.h],
1129       [VA API (X11 display)],
1130       vaGetDisplay,
1131       [], [-lva-x11]
1132     )
1134     if test x$build_ogl = xyes; then
1135       use_libva_glx=yes
1136       GNASH_PKG_FIND([libva_glx],
1137         [va/va_glx.h],
1138         [VA API (GLX display)],
1139         vaGetDisplayGLX,
1140         [], [-lva-glx]
1141       )
1142     fi
1143   fi
1146 dnl libVA drivers. We declare conditional for both the option being
1147 dnl selected, as well as whether or not it's found. This we can
1148 dnl generate better error handling if it's not found.
1149 AM_CONDITIONAL(USE_VAAPI, test x"${use_libva}" = xyes)
1151 dnl Until the hwaccel patches in FFmpeg wind up in the ffmpeg-plugin,
1152 dnl restrict using HW Accel to using FFmpeg directly.
1153 dnl test xyes = xyes -a ( x != xyes -o x != xyes )
1154 if test x"${build_vaapi}" = x"yes" -a x"${have_ffmpeg}" != x"yes"; then
1155   AC_MSG_ERROR(["Hardware acceleration currently not supported unless using FFmpeg."])
1158 AM_CONDITIONAL(HAVE_VAAPI, test x"${found_libva_incl}" = xyes)
1159 AM_CONDITIONAL(HAVE_VAAPI_GLX, test x"${found_libva_glx_incl}" = xyes)
1160 AM_CONDITIONAL(HAVE_VAAPI_X11, test x"${found_libva_x11_incl}" = xyes)
1162 if test x"${build_egl_device}" = xyes; then
1163   GNASH_PKG_FIND(EGL, [EGL/egl.h], [EGL library], eglGetDisplay)
1164   if test xyes = x"${has_EGL}"; then
1165     AC_DEFINE(BUILD_EGL_DEVICE, [ 1 ],
1166           [Build the EGL device for OpenVG, OpenGLES1&2, and X11/Mesa])
1167       device_list="${device_list} EGL"
1168       ndevice=$((ndevice+1))
1169   else
1170     AC_MSG_WARN(["EGL requested but development package not found!"])
1171     build_egl_device=no
1172   fi
1175 if test ${ndevice} -eq 0; then
1176       device_list="none"
1177       ndevice=1
1180 AM_CONDITIONAL(BUILD_DEVICES, test ${ndevice} -gt 0)
1182 dnl 16 bit: RGB555, RGB565
1183 dnl 24 bit: RGB24, BGR24
1184 dnl 32 bit: RGBA32, BGRA32
1185 pixelformat=all
1186 AC_ARG_WITH(pixelformat,
1187   AC_HELP_STRING([--with-pixelformat=], [Use the specified pixel format for AGG (default=all)]),
1188   [if test -n ${withval}; then
1189     pixelformat="${withval}"
1190     withval=`echo ${withval} | tr '\054' ' ' `
1191   fi
1192   while test -n "${withval}" ; do
1193     val=`echo ${withval} | cut -d ' ' -f 1`
1194     case "${val}" in
1195       all)
1196         # allow special value "all" set by user (handled below)
1197         ;; 
1198       argb32|ARGB32)
1199         AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32])
1200         ;;
1201       abgr32|ABGR32)
1202         AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32])
1203         ;;
1204       bgra32|BGRA32)
1205         AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
1206         ;;
1207       bgr24|BGR24)
1208         AC_DEFINE(PIXELFORMAT_BGR24, [1], [BGR24])
1209         ;;
1210       rgba32|RGBA32)
1211         AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32])
1212         ;;
1213       rgb24|RGB24)
1214         AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24])
1215         ;;
1216       rgb555|RGB555)
1217         AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555])
1218         ;;
1219       rgb565|RGB565)
1220         AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565])
1221         ;;
1222       *) AC_MSG_ERROR([invalid pixel format ${withval} given (accept: all|RGB555|RGB565|RGB24|BGR24|BGRA32|RGBA32|ARGB32|ABGR32)])
1223          ;;
1224       esac
1225     withval=`echo ${withval} | cut -d ' ' -f 2-6`
1226     if test "x$val" = "x$withval"; then
1227       break;
1228     fi
1229   done],
1230   [if test x$build_haiku = xyes -a x$build_sdl != xyes; then
1231         AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
1232         pixelformat=BGRA32
1233    fi]
1236 if test x$pixelformat = xall; then
1237   if test x$build_agg = xyes; then
1238     ### The fact that we're building GTK doesn't mean we're not also
1239     ### building KDE or SDL, each needing its own pixel format !
1240     #if test x$build_gtk = xyes; then
1241     #  AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24 pixel format])
1242     #  pixelformat="RGB24"
1243     #else
1244       AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555 pixel format])
1245       AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565 pixel format])
1246       AC_DEFINE(PIXELFORMAT_RGB24,  [1], [RGB24 pixel format])
1247       AC_DEFINE(PIXELFORMAT_BGR24,  [1], [BGR24 pixel format])
1248       AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32 pixel format])
1249       AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32 pixel format])
1250       AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32 pixel format])
1251       AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32 pixel format])
1252     #fi
1253   fi
1256 if test x"${build_ogl}" != xno; then # yes or auto
1257   GNASH_PATH_OPENGL
1258   if test x"${build_ogl}" = xauto; then
1259     if test xyes = x"${has_opengl}"; then
1260       build_ogl=yes
1261       renderer_list="${renderer_list} opengl"
1262     else
1263       build_ogl=no
1264     fi
1265   fi
1268 AM_CONDITIONAL(BUILD_OVG_RENDERER,   [ test x${build_ovg} = xyes ])
1269 AM_CONDITIONAL(BUILD_GLES1_RENDERER, [ test x${build_gles1} = xyes ])
1270 AM_CONDITIONAL(BUILD_GLES2_RENDERER, [ test x${build_gles2} = xyes ])
1271 AM_CONDITIONAL(BUILD_OGL_RENDERER,   [ test x${build_ogl} = xyes])
1272 AM_CONDITIONAL(BUILD_AGG_RENDERER,   [ test x${build_agg} = xyes ])
1273 AM_CONDITIONAL(BUILD_CAIRO_RENDERER, [ test x${build_cairo} = xyes ])
1275 if test x"${has_openvg}" = xyes; then
1276    AC_DEFINE([RENDERER_OPENVG], [1], [Use OpenVG renderer])
1279 if test x"${build_ogl}" = xyes; then
1280    AC_DEFINE([RENDERER_OPENGL], [1], [Use OpenGL renderer])
1283 if test x"${build_agg}" = xyes; then
1284   AC_DEFINE([RENDERER_AGG], [1], [Use AntiGrain renderer])
1287 if test x"${build_cairo}" = xyes; then
1288   GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
1289   AC_DEFINE([RENDERER_CAIRO], [1], [Use cairo renderer])
1292 if test x"${build_agg}" = xyes; then
1293    GNASH_PATH_AGG
1296 AC_PATH_PROG(PERL, perl)
1297 AM_CONDITIONAL(HAVE_PERL, test x"$PERL" != x)
1299 AC_PATH_PROG(CSOUND, csound)
1300 AM_CONDITIONAL(HAVE_CSOUND, test x"$CSOUND" != x)
1302 AC_PATH_PROG(GIT, git)
1303 AC_SUBST(GIT)
1305 dnl --------------------------------------------------------
1306 dnl Extension selection
1307 dnl --------------------------------------------------------
1308 ext_dejagnu=no
1309 ext_mysql=no
1310 ext_fileio=no
1311 ext_gtk=no
1312 ext_lirc=no
1313 ext_dbus=no
1314 ext_all=no
1315 extensions_list=
1316 extensions_support=yes
1317 nextensions=0
1318 AC_ARG_ENABLE(extensions,
1319   AC_HELP_STRING([--enable-extensions=], [Specify which extensions to build (default: none)])
1320   AC_HELP_STRING([--disable-extensions], [Disable support for extensions entirely]),
1321   if test -n ${enableval}; then
1322     if test "x${enableval}" != "xno"; then
1323       extlist="${enableval}"
1324       enableval=`echo ${enableval} | tr '\054' ' ' `
1325       AC_DEFINE([USE_EXTENSIONS], [1], [Specify that extension support is enabled.])
1326     else
1327       extlist=""
1328       enableval=""
1329       extensions_support=no
1330     fi
1331   fi
1332   nextensions=0
1333   while test -n "${enableval}" ; do
1334     val=`echo ${enableval} | cut -d ' ' -f 1`
1335     extensions_list="${extensions_list} ${val}"
1336     [case "${val}" in
1337       dejagnu|DEJAGNU|dj|DJ)
1338         AC_DEFINE(USE_DEJAGNU_EXT, [1], [Build the DejaGnu extension])
1339         AC_MSG_NOTICE([Adding DejaGnu extension])
1340         ext_dejagnu=yes
1341         nextensions=$((nextensions+1))
1342         ;;
1343       mysql|MYSQL|sql|SQL)
1344         AC_DEFINE(USE_MYSQL_EXT, [1], [Build the MySQL extension])
1345         AC_MSG_NOTICE([Adding MySql extension])
1346         ext_mysql=yes
1347         nextensions=$((nextensions+1))
1348         ;;
1349       fileio|FILEIO|io|IO)
1350         AC_DEFINE(USE_FILEIO_EXT, [1], [Build the FileIO extension])
1351         AC_MSG_NOTICE([Adding FileIO extension])
1352         ext_fileio=yes
1353         nextensions=$((nextensions+1))
1354         ;;
1355       gtk|GTK|gtk2|GTK2)
1356         AC_DEFINE(USE_GTK_EXT, [1], [Build the GTK extension])
1357         ext_gtk=yes
1358         nextensions=$((nextensions+1))
1359         ;;
1360       lirc|LIRC)
1361         AC_DEFINE(USE_LIRC_EXT, [1], [Build the LIRC extension])
1362         ext_lirc=yes
1363         nextensions=$((nextensions+1))
1364         ;;
1365       dbus|DBUS)
1366         AC_DEFINE(USE_DBUS_EXT, [1], [Build the DBUS extension])
1367         ext_dbus=yes
1368         nextensions=$((nextensions+1))
1369         ;;
1370       all|ALL)
1371         AC_DEFINE(USE_GTK_EXT, [1], [Build all the extensions])
1372         ext_dejagnu=yes
1373         ext_mysql=yes
1374         ext_fileio=yes
1375         ext_gtk=yes
1376         ext_lirc=yes
1377         ext_dbus=yes
1378         ext_all=yes
1379         nextensions=9
1380         ;;
1381       *) AC_MSG_ERROR([invalid extension specified: ${enableval} given (accept: MYSQL|DEJAGNU|FILEIO|GTK|LIRC|DBUS|METOME|ALL)])
1382          ;;
1383       esac]
1384     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1385     if test "x$val" = "x$enableval"; then
1386       break;
1387     fi
1388   done
1389   EXTENSIONS_LIST="$extensions_list"
1390   AC_SUBST(EXTENSIONS_LIST)
1393 if test x$ext_dbus = xyes; then
1394   GNASH_PATH_DBUS
1397 if test x$ext_mysql = xyes; then
1398   GNASH_PATH_MYSQL
1401 AM_CONDITIONAL(BUILD_DEJAGNU_EXT, [ test x$ext_dejagnu = xyes ])
1402 AM_CONDITIONAL(BUILD_FILEIO_EXT, [ test x$ext_fileio = xyes ])
1403 AM_CONDITIONAL(BUILD_MYSQL_EXT, [ test x$ext_mysql = xyes ])
1404 AM_CONDITIONAL(BUILD_GTK_EXT, [ test x$ext_gtk = xyes ])
1405 AM_CONDITIONAL(BUILD_LIRC_EXT, [ test x$ext_lirc = xyes ])
1406 AM_CONDITIONAL(BUILD_DBUS_EXT, [ test x$ext_dbus = xyes ])
1407 AM_CONDITIONAL(BUILD_EXTENSIONS, [ test -n "$extensions_list"])
1409 AM_CONDITIONAL(ENABLE_EXTENSIONS, [ test "x${extensions_support}" != "xno" ])
1411 dnl --------------------------------------------------------
1412 dnl Libtool
1413 dnl --------------------------------------------------------
1415 AC_LIBTOOL_DLOPEN
1416 AC_LIBTOOL_WIN32_DLL
1417 AC_DISABLE_STATIC
1418 AC_PROG_LIBTOOL
1419 AC_SUBST(LIBTOOL_DEPS)
1420 DLOPEN="-dlopen"
1421 DLPREOPEN="-dlpreopen"
1422 AC_SUBST(DLOPEN)
1423 AC_SUBST(DLPREOPEN)
1425 GNASH_PKG_FIND([ltdl], [ltdl.h], [libltdl library], [lt_dlinit])
1427 if test x"$has_ltdl" = x"yes";then
1428   AC_DEFINE(HAVE_LTDL, [1], [Libtool 2.x defines this, but libtool 1.5 does not])
1431 dnl --------------------------------------------------------
1432 dnl SOL dir
1433 dnl --------------------------------------------------------
1434 soldir=/tmp
1435 AC_ARG_WITH(soldir,
1436  AC_HELP_STRING([--with-soldir],
1437  [directory for .sol files]),
1438  with_soldir=${withval})
1439 if test x${with_soldir} != x; then
1440   soldir=${with_soldir}
1442 SOLDIR=${soldir}
1443 AC_SUBST(SOLDIR)
1445 dnl --------------------------------------------------------
1446 dnl AVM2
1447 dnl --------------------------------------------------------
1448 dnl AC_ARG_ENABLE(avm2,
1449 dnl   AC_HELP_STRING([--enable-avm2], [Enable support for AS3]),
1450 dnl   [case "${enableval}" in
1451 dnl     yes) avm2=yes ;;
1452 dnl     no)  avm2=no ;;
1453 dnl     *)   AC_MSG_ERROR([bad value ${enableval} for enable-avm2 option]) ;;
1454 dnl   esac], avm2=no
1455 dnl )
1456 dnl AM_CONDITIONAL(ENABLE_AVM2, [test x"$avm2" = xyes])
1457 dnl if test x$avm2 = xyes; then
1458 dnl     AC_DEFINE(ENABLE_AVM2, [1], [Enable AVM2 code])
1459 dnl fi
1460 AM_CONDITIONAL(ENABLE_AVM2, false)
1462 dnl This option is only used if you want Gnash to interwork with 
1463 dnl the Adobe player using the LocalConnection class.
1464 dnl lckey=0xdd3adabd
1465 AC_ARG_WITH(lckey,
1466  AC_HELP_STRING([--with-lckey],
1467  [shared memory key for your system]),
1468  with_lckey=${withval})
1470 if test x${with_lckey} != x; then
1471   lckey=${with_lckey}
1472 else
1473   lckey=0xcbc384f8
1475 LC_KEY=${lckey}
1476 AC_SUBST(LC_KEY)
1478 AC_ARG_ENABLE(python,
1479   AC_HELP_STRING([--enable-python],[Enable python for the python wrapper]),
1480 [case "${enableval}" in
1481   yes) python=yes ;;
1482   no)  python=no ;;
1483   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-python option]) ;;
1484 esac],python=no)
1486 dnl Look for python, which is optional. If enabled, a python loadable
1487 dnl module of Gnash is created.
1488 GNASH_PATH_PYTHON
1489 AM_CONDITIONAL([USE_PYTHON], test x"$python" = xyes)
1490 AM_CONDITIONAL([HAS_PYTHON], test x"$has_python" = xyes)
1492 dnl By default debug logging is enabled. For better performance, it can
1493 dnl be disabled, as when running as a plugin, nobody sees the debug messages
1494 dnl anyway. Debug logging is primarily for developers, so we can turn it off
1495 dnl for package builds.
1496 AC_ARG_ENABLE(log,
1497   AC_HELP_STRING([--enable-log],[Enable debug logging]),
1498 [case "${enableval}" in
1499   yes) debuglog=yes ;;
1500   no)  debuglog=no ;;
1501   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-log option]) ;;
1502 esac],debuglog=yes)
1504 if test x"${debuglog}" = x"yes"; then
1505   AC_DEFINE([DEBUG_LOGGING], [1], [Enable debug logging])
1508 # Maybe use jemalloc, which handles memory fragmentation for
1509 # ECAMscript languages better than the regular system malloc.
1510 # This seems like a good idea, as both the other player and
1511 # Mozilla/Firefox both recently switched to using jemalloc.
1512 AC_ARG_ENABLE(jemalloc,
1513   AC_HELP_STRING([--enable-jemalloc],[Enable jemalloc instead of system malloc]),
1514 [case "${enableval}" in
1515   yes) jemalloc=yes ;;
1516   no)  jemalloc=no ;;
1517   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-jemalloc option]) ;;
1518 esac],jemalloc=yes)
1520 AC_CHECK_SIZEOF([void *], [4])
1522 if test "x${ac_cv_sizeof_void_p}" != x4 -a x"${ac_cv_sizeof_void_p}" != x8; then
1523   dnl jemalloc doesn't support unusual pointer sizes
1524   jemalloc=no
1527 dnl There is some weird stuff going on with NetBSD and jemalloc, so don't 
1528 dnl build it for now.
1529 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
1530   jemalloc=no
1532 dnl If the compiler doesn't have local thread storage enabled, don't try to
1533 dnl use jemalloc.
1534 if test x"${jemalloc}" = x"yes"; then
1535   AC_TRY_COMPILE([], [
1536     extern __thread int global_i; ],
1537     has_local_thread_storage=yes
1538   )
1539   if test x"${has_local_thread_storage}" = x"yes"; then
1540     AC_DEFINE([HAVE_LOCAL_THREAD_STORAGE], [1], [Has __thread (local thread storage) support])
1541     AC_DEFINE([USE_JEMALLOC], [], [Use jemalloc instead of system malloc])
1542   else
1543     jemalloc=no
1544   fi
1547 dnl We can search libs for mallinfo to decide whether we have it or not.
1548 dnl This is added to the linker flags when it's found. Usually it's -lc, but
1549 dnl on OpenSolaris it's -lmalloc, so this fixes the build.
1550 AC_SEARCH_LIBS([mallinfo], [c malloc],
1551                AC_DEFINE(HAVE_MALLINFO, [1], [Has mallinfo()])
1552                mallinfo=yes
1553                )
1555 AM_CONDITIONAL([HAVE_MALLINFO], test x$mallinfo = xyes)
1556 AM_CONDITIONAL(JEMALLOC, test x$jemalloc = xyes)
1558 AC_ARG_ENABLE(fps-debug,
1559   AC_HELP_STRING([--enable-fps-debug],[Enable FPS debugging code]),
1560 [case "${enableval}" in
1561   yes) AC_DEFINE([GNASH_FPS_DEBUG], [1], [Enable FPS debugging code])
1562 esac])
1564 dnl IPC_INFO isn't portable, and doesn't exist on BSD
1565 AC_TRY_COMPILE([#include <sys/ipc.h> #include <sys/shm.h>], [
1566   int flag = IPC_INFO; ],
1567   AC_DEFINE([HAVE_IPC_INFO], [1], [Use ipc_info])
1570 dnl --------------------------------------------------------
1571 dnl Disable menus
1572 dnl --------------------------------------------------------
1573 dnl Don't add the GUI menu. Some educational systems think this adds
1574 dnl clutter and confusion, like on the OLPC.
1575 AC_ARG_ENABLE(menus,
1576   AC_HELP_STRING([--disable-menus],[Disable the GUI menus]),
1577 [case "${enableval}" in
1578   yes) menus=yes ;;
1579   no)  menus=no ;;
1580   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-menus option]) ;;
1581 esac],menus=yes)
1583 if test x"$menus" = x"yes"; then
1584   AC_DEFINE([USE_MENUS], [], [GUI Menu support])
1586 AM_CONDITIONAL(MENUS, test x$menus = xyes)
1588 dnl --------------------------------------------------------
1589 dnl Disable SWF information
1590 dnl --------------------------------------------------------
1591 dnl Don't gather SWF information in tree form. This takes
1592 dnl resources and memory that can be saved if there's no
1593 dnl need to examine SWF internals.
1594 AC_ARG_ENABLE(swftree,
1595   AC_HELP_STRING([--disable-swftree],[Disable showing SWF properties]),
1596 [case "${enableval}" in
1597   yes) swftree=yes ;;
1598   no)  swftree=no ;;
1599   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-swf-properties option]) ;;
1600 esac],swftree=yes)
1602 if test x"$swftree" = x"yes"; then
1603   AC_DEFINE([USE_SWFTREE], [], [View SWF information])
1605 AM_CONDITIONAL(SWFTREE, test x$swftree = xyes)
1607 dnl --------------------------------------------------------
1608 dnl Disable testsuite
1609 dnl --------------------------------------------------------
1610 dnl Disable running any tests for "make check". This may sound stupid, but
1611 dnl this option is designed to solely be used by maintainers in the 
1612 dnl DISTCHECK_CONFIGURE_FLAGS when building packages. Gnash's testing infrastructure
1613 dnl is complex, and often the the testsuites will work, but due to some obscure reason,
1614 dnl make distcheck fails.
1615 AC_ARG_ENABLE(testsuite,
1616   AC_HELP_STRING([--disable-testsuite],[Disable the testsuite, maintainers option only]),
1617 [case "${enableval}" in
1618   yes) testsuite=yes ;;
1619   no)  testsuite=no ;;
1620   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-testsuite option]) ;;
1621 esac],testsuite=yes)
1623 if test x"$testsuite" = x"yes"; then
1624   AC_DEFINE([USE_TESTSUITE], [], [Testsuite support, maintainers option only])
1626 AM_CONDITIONAL(TESTSUITE, test x$testsuite = xyes)
1628 dnl --------------------------------------------------------
1629 dnl Write the file to disk in the plugin
1630 dnl --------------------------------------------------------
1631 AC_ARG_ENABLE(write,
1632   AC_HELP_STRING([--enable-write], [Makes the Mozilla plugin write the currently playing SWF movie to /tmp.]),
1633 [case "${enableval}" in
1634   yes) write=yes ;;
1635   no)  write=no ;;
1636   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-write option]) ;;
1637 esac],write=no)
1639 if test x"$write" = x"yes"; then
1640   AC_DEFINE([WRITE_FILE], [], [Write files while streaming])
1643 dnl --------------------------------------------------------
1644 dnl Write a standalone gnash launcher to disk from the plugin
1645 dnl --------------------------------------------------------
1646 AC_ARG_ENABLE(sa-launcher,
1647   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.]),
1648 [case "${enableval}" in
1649   yes) sa_launcher=yes ;;
1650   no)  sa_launcher=no ;;
1651   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-sa-launcher option]) ;;
1652 esac],sa_launcher=yes)
1654 if test x"$sa_launcher" = x"yes"; then
1655   AC_DEFINE([CREATE_STANDALONE_GNASH_LAUNCHER], [], [Add support for writing a standalone executable launcher for movies embedded in web pages])
1658 dnl --------------------------------------------------------
1659 dnl Build the cygnal server if specified.
1660 dnl --------------------------------------------------------
1661 AC_ARG_ENABLE(cygnal,
1662   AC_HELP_STRING([--enable-cygnal], [Enable building of the Cygnal server]),
1663 [case "${enableval}" in
1664   yes) cygnal=yes ;;
1665   no)  cygnal=no ;;
1666   *)   AC_MSG_ERROR([bad value ${enableval} for enable-cygnal option]) ;;
1667 esac],cygnal=no)
1668 AM_CONDITIONAL(CYGNAL, test x$cygnal = xyes)
1670 dnl --------------------------------------------------------
1671 dnl Build the cgibins server if specified.
1672 dnl --------------------------------------------------------
1673 AC_ARG_ENABLE(cgibins,
1674   AC_HELP_STRING([--enable-cgibins], [Enable building of the CGIs for Cygnal]),
1675 [case "${enableval}" in
1676   yes) cgibin=yes ;;
1677   no)  cgibin=no ;;
1678   *)   AC_MSG_ERROR([bad value ${enableval} for enable-cgibins option]) ;;
1679 esac],cgibin=yes)
1680 AM_CONDITIONAL(USE_CGI, test x$cgibin = xyes)
1681 if test x"${cgibin}" = x"yes"; then
1682   AC_DEFINE([USE_CGIBIN], [1], [Enable cgi-bin processes for Cygnal])
1685 dnl --------------------------------------------------------
1686 dnl  Double buffer
1687 dnl --------------------------------------------------------
1688 dnl Add an option for double buffering when rendering, currently only used by
1689 dnl the frmaebuffer GUI.
1690 dnl If defined, an internal software-buffer is used for rendering and is then
1691 dnl copied to the video RAM. This avoids flicker and is faster for complex 
1692 dnl graphics, as video RAM access is usually slower. (strongly suggested)
1693 AC_ARG_ENABLE(doublebuf,
1694   AC_HELP_STRING([--enable-doublebuf], [Enable support for double buffering when rendering with AGG]),
1695   [case "${enableval}" in
1696     yes) doublebuf=yes ;;
1697     no)  doublebuf=no ;;
1698     *)   AC_MSG_ERROR([bad value ${enableval} for enable-doublebuf option]) ;;
1699   esac], doublebuf=no
1701 AM_CONDITIONAL(ENABLE_DBUF, [test x"$doublebuf" = xyes])
1702 if test x$doublebuf = xyes; then
1703     AC_DEFINE(ENABLE_DOUBLE_BUFFERING, [1], [Enable double buffering for AGG])
1706 dnl --------------------------------------------------------
1707 dnl  Offscreen buffer
1708 dnl --------------------------------------------------------
1709 dnl This enables rendering to an offscreen buffer, instead of directly to window
1710 AC_ARG_ENABLE(offscreen,
1711   AC_HELP_STRING([--enable-offscreen], [Enable support for rendering offscreen]),
1712   [case "${enableval}" in
1713     yes) offscreen=yes ;;
1714     no)  offscreen=no ;;
1715     *)   AC_MSG_ERROR([bad value ${enableval} for enable-offscreen option]) ;;
1716   esac], offscreen=no
1720 dnl --------------------------------------------------------
1721 dnl  SSH support selection
1722 dnl --------------------------------------------------------
1723 dnl Enable using libssh with libnet
1724 AC_ARG_ENABLE(ssh,
1725   AC_HELP_STRING([--enable-ssh], [Enable using SSH for network authentication]),
1726 [case "${enableval}" in
1727   yes) build_ssh=yes ;;
1728   no)  build_ssh=no ;;
1729   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-ssh option]) ;;
1730 esac], build_ssh=no)
1732 AM_CONDITIONAL(BUILD_SSH, test x"${build_ssh}" = xyes)
1733 if test x"${build_ssh}" = xyes; then
1734   GNASH_PKG_FIND(ssh, [libssh/libssh.h], [libssh library], ssh_socket_init)
1735 dnl  GNASH_PKG_FIND(poppler, [popt.h], [Poppler library], poppler_init)
1737 if test x"${has_ssh}" = x"yes"; then
1738   AC_DEFINE([USE_SSH], [1], [Use SSH for authentication])
1741 dnl --------------------------------------------------------
1742 dnl  SSL support selection
1743 dnl --------------------------------------------------------
1745 dnl Enable using OpenSSL with libnet.
1746 AC_ARG_ENABLE(ssl,
1747   AC_HELP_STRING([--enable-ssl], [Enable using OpenSSL directly]),
1748 [case "${enableval}" in
1749   yes) build_ssl=yes ;;
1750   no)  build_ssl=no ;;
1751   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-ssl option]) ;;
1752 esac], build_ssl=no)
1754 with_cert=
1755 with_pem=
1756 AM_CONDITIONAL(BUILD_SSL, test x"${build_ssl}" = xyes)
1757 AC_ARG_WITH(cert,
1758   AC_HELP_STRING([--with-cert],
1759   [cert file for SSL]),
1760   with_cert=${withval})
1761 AC_ARG_WITH(pem,
1762   AC_HELP_STRING([--with-pe],
1763   [pem file for SSL]),
1764   with_pem=${withval})
1766 if test x"${build_ssl}" = xyes; then
1767   GNASH_PKG_FIND(ssl, [openssl/ssl.h], [OpenSSL library], SSL_library_init)
1769 if test x"${has_ssl}" = x"yes"; then
1770   AC_DEFINE([USE_SSL], [1], [Use SSL for authentication])
1773 dnl -----------------------------------------------------------
1774 dnl Set the general plugins install policy here
1775 dnl (NOTE: before GNASH_PATH_FIREFOX and GNASH_PATH_KDE*)
1776 dnl -----------------------------------------------------------
1778 AC_ARG_WITH(plugins-install,
1779   AC_HELP_STRING([--with-plugins-install=system|user|prefix], [Policy for plugins install. Default: user.]),
1780         [case "${withval}" in
1781           user) PLUGINS_INSTALL_POLICY=user ;;
1782           system) PLUGINS_INSTALL_POLICY=system ;;
1783           prefix) PLUGINS_INSTALL_POLICY=prefix ;;
1784           *)  AC_MSG_ERROR([bad value ${withval} for --with-plugins-install]) ;;
1785          esac 
1786         ], PLUGINS_INSTALL_POLICY=user) 
1788 dnl -----------------------------------------------------------
1789 dnl   Verify dependencies for requested GUIs are met, and
1790 dnl   disable build of the GUIS for which deps are NOT met
1791 dnl ------------------------------------------------------------
1793 if test x$build_gtk = xyes; then
1794    GNASH_PATH_GTK2
1795    GNASH_PATH_PANGO
1796    GNASH_PKG_FIND(atk, [atk/atk.h], [atk library], atk_focus_tracker_init, [1.0])
1797    if test x"${build_ogl}" = xyes; then
1798       GNASH_PATH_GLEXT
1799    fi
1800    if test x"${build_cairo}" = xyes; then
1801       GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
1802    fi
1805 if test x"${build_qt4}" != xno; then
1806  GNASH_PATH_QT4
1809 if test x"${build_qt4}" = xauto; then
1810   if test x"${has_qt4}" = xyes; then
1811      build_qt4=yes
1812   else
1813      build_qt4=no
1814   fi
1817 if test x"${build_kde3}" != xno -o x"${build_qtopia3}" != xno; then
1818  GNASH_PATH_QT3
1821 if test x"${build_kde3}" != xno; then
1822   GNASH_PATH_KDE3
1826 if test x"${build_kde3}" = xauto; then
1827   if test x"${has_qt3}" = xyes -a x"${has_kde3}" = xyes; then
1828      build_kde3=yes
1829   else
1830      build_kde3=no
1831   fi
1834 dnl Check possibility to build DUMP gui, if requested
1835 if test x"${build_dump}" != xno; then
1836   if test x"${build_agg}" = xyes; then
1837     build_dump=yes
1838   else
1839     if test x"${build_dump}" = xyes; then
1840       dnl SHOULD we just check at the end of file instead ?
1841       AC_MSG_ERROR(dump GUI cannot be built without AGG renderer);
1842     fi
1843     build_dump=no
1844   fi
1847 dnl Check possibility to build FB gui, if requested
1848 dnl FB dependency is a linux system (linux/fb.h)
1849 if test x"${build_fb}" != xno; then
1850   if test x"${linux}" = xyes; then
1851       build_fb=yes
1852   else
1853     if test x"${build_fb}" = xyes; then
1854       dnl SHOULD we just check at the end of file instead ?
1855       AC_MSG_ERROR(fb GUI cannot be built on non-linux platforms);
1856     fi
1857     AC_MSG_NOTICE([fb GUI won't be built (non-linux platform)])
1858     build_fb=no
1859   fi
1862 dnl TODO: add checks for all other GUIs
1864 dnl -------------------------------
1865 dnl Input Device selection
1866 dnl -------------------------------
1868 dnl Multiple input devices are supported. These can all work in
1869 dnl varying combinations, so several may be listed. These are only
1870 dnl required when using the Framebuffer, as without the X11 desktop,
1871 dnl Gnash has to handle all these internally. This can get
1872 dnl messy, as one might want to use a touchscreen with a normal mouse
1873 dnl or keyboard attached. 
1874 dnl By default, don't build any of these, as they are only for the Framebuffer
1875 dnl running without X11.
1876 if test x"${build_fb}" = xyes; then
1877   build_ps2mouse=yes
1878   build_ps2keyboard=no
1879   build_input_events=yes
1880   build_tslib=yes
1881   input_events="PS/2 Mouse, Input Devices, Touchscreen via Tslib"
1882 else
1883   build_ps2mouse=no
1884   build_ps2keyboard=no
1885   build_input_events=no
1886   build_tslib=no
1887   input_events=
1889 AC_ARG_ENABLE(input,
1890   AC_HELP_STRING([--enable-input=], [Enable support for the specified input devices for the framebuffer GUI (default=ps2mouse|ps2keyboard|events|touchscreen)]),
1891   [if test -n ${enableval}; then
1892     enableval=`echo ${enableval} | tr '\054' ' ' `
1893   fi
1894   while test -n "${enableval}" ; do
1895     val=`echo ${enableval} | cut -d ' ' -f 1`
1896     case "${val}" in
1897       ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
1898         build_ps2mouse=yes
1899         input_events="${input_events}, PS/2 Mouse"
1900         ;;
1901       ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
1902         build_ps2keyboard=yes
1903         input_events="${input_events}, PS/2 Keyboard"
1904         ;;
1905       i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
1906         input_events="${input_events}, Input Event Device"
1907         build_input_events=yes
1908         ;;
1909       t*|T*) dnl use a touchscreen with tslib, which works like a mouse
1910         build_tslib=yes
1911         input_events="${input_events}, Touchscreen"
1912         ;;
1913       *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: ps2mouse|keyboard|events,touchscreen)])
1914          ;;
1915       esac
1916     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1917     if test "x$val" = "x$enableval"; then
1918       break;
1919     fi
1920   done],
1923 if test x"${build_tslib}" = xyes; then
1924   AC_DEFINE(USE_TSLIB, [1], [Use a tslib supported touchscreen])
1925   GNASH_PKG_FIND(ts, [tslib.h], [Touchscreen library], ts_config)
1927 AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} != xno])
1929 if test x"${build_ps2mouse}" = xyes; then
1930   AC_DEFINE(USE_MOUSE_PS2, [1], [Add support for a directly using a PS/2 Mouse])
1932 AM_CONDITIONAL(ENABLE_MOUSE, [test x"${build_ps2mouse}" = xyes])
1934 if test x"${build_ps2keyboard}" = xyes; then
1935   AC_DEFINE(USE_KEYBOARD_PS2, [1], [Add support for directly using a PS/2 Keyboard])
1937 if test x"${build_input_events}" = xyes; then
1938   AC_DEFINE(USE_INPUT_EVENTS, [1], [Add support for a directly using Linux Input Event Devices])
1940 AM_CONDITIONAL(ENABLE_INPUT_EVENTS, [test x"${build_input_events}" = xyes])
1941 dnl this is enabled if we have any input devices at all
1942 AM_CONDITIONAL(ENABLE_INPUT_DEVICES, [test x"${input_events}" != x])
1945 dnl -----------------------------------------------------------
1946 dnl Try to ignore stupid dependencies
1947 dnl -----------------------------------------------------------
1949 AC_MSG_CHECKING(linker --as-needed support)
1950 gcc_cv_ld_as_needed=no
1951 # Check if linker supports --as-needed and --no-as-needed options
1952 if $LD --help 2>/dev/null | grep as-needed > /dev/null; then
1953   gcc_cv_ld_as_needed=yes
1955 if test x"$gcc_cv_ld_as_needed" = xyes; then
1956   LDFLAGS="$LDFLAGS -Wl,--as-needed"
1958 AC_MSG_RESULT($gcc_cv_ld_as_needed)
1960 AC_DEFINE(USE_GIF, [1], [Use the GIF library])
1961 AC_DEFINE(USE_PNG, [1], [Use the PNG library])
1962 AM_CONDITIONAL(USE_GIF, true)
1963 AM_CONDITIONAL(USE_PNG, true)
1965 AC_PATH_TOOL([AUTOTRACE], [autotrace])
1966 AC_HEADER_DIRENT
1968 dnl -----------------------------------------------------------------
1969 dnl PLUGIN RELATED STUFF
1970 dnl -----------------------------------------------------------------
1972 dnl !! This has been moved here to make --enable-npapi work
1973 dnl !! All of plugin-related macro calls could be moved into
1974 dnl !! a specialized macros/plugin.m4
1976 dnl ----------------------------------------------------
1977 dnl Add KPARTS support, if specified or KDE gui is built
1978 dnl ----------------------------------------------------
1980 AC_ARG_ENABLE(kparts3,
1981   AC_HELP_STRING([--disable-kparts3], [Disable support for Konqueror 3.x plugin (default: enabled if kde3 gui is)]),
1982 [case "${enableval}" in
1983   yes) build_kparts3=yes ;;
1984   no)  build_kparts3=no ;;
1985   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-kparts3 option]) ;;
1986 esac],build_kparts3=$build_kde3)
1988 dnl --------------------------------------------------------
1989 dnl Add KPARTS 4.x support, if specified or KDE gui is built
1990 dnl --------------------------------------------------------
1992 AC_ARG_ENABLE(kparts4,
1993   AC_HELP_STRING([--disable-kparts4], [Disable support for Konqueror 4.x plugin (default: enabled if Qt4 gui is)]),
1994 [case "${enableval}" in
1995   yes) build_kparts4=yes ;;
1996   no)  build_kparts4=no ;;
1997   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-kparts4 option]) ;;
1998 esac],build_kparts4=$build_qt4)
2000 if test x"${build_kparts4}" != xno; then
2001   GNASH_PATH_KDE4
2004 dnl -----------------------------------------------------------
2005 dnl Add NPAPI support, if specified or GTK or Qt4 gui is built
2006 dnl -----------------------------------------------------------
2008 AC_ARG_ENABLE(npapi,
2009   AC_HELP_STRING([--disable-npapi], [Disable NPAPI plugin build (default: enabled if gtk or Qt4 gui is)]),
2010   [case "${enableval}" in
2011     yes) npapi=yes ;;
2012     no)  npapi=no ;;
2013     *)   AC_MSG_ERROR([bad value ${enableval} for disable-npapi option]) ;;
2014   esac],
2015   if test x$build_gtk = xyes -o x$build_qt4 = xyes; then
2016     npapi=yes
2017   fi
2020 if test x"$npapi" = x"yes"; then
2021   GNASH_PATH_NPAPI
2024 dnl -----------------------------------------------------------------
2025 dnl Enable us to disable building all browser plugins in one command.
2026 dnl -----------------------------------------------------------------
2028 AC_ARG_ENABLE(plugins,
2029   AC_HELP_STRING([--disable-plugins], [Disable all browser plugins from building (default=no)]),
2030   [case "${enableval}" in
2031     yes) plugins=yes ;;
2032     no)  plugins=no ;;
2033     *)   AC_MSG_ERROR([bad value ${enableval} for disable-plugins option]) ;;
2034   esac],
2035   plugins=yes
2037 if test x$plugins = xno; then
2038   npapi=no
2039   build_kparts3=no
2040   build_kparts4=no
2044 GNASH_PATH_FIREFOX
2046 dnl -----------------------------------------------------------------
2047 dnl END OF PLUGIN RELATED STUFF
2048 dnl -----------------------------------------------------------------
2050 AM_CONDITIONAL(LIRC, [test x$lirc_ext = xyes])
2052 AC_CHECK_HEADERS(getopt.h)
2053 AC_CHECK_HEADERS(libgen.h)
2054 AC_CHECK_HEADERS(pwd.h)
2055 AC_CHECK_HEADERS(sys/utsname.h)
2056 AC_CHECK_HEADERS(signal.h)
2057 AC_CHECK_HEADERS(unistd.h)
2058 AC_CHECK_HEADERS(sys/time.h)
2059 AC_CHECK_LIB(bz2, BZ2_bzopen, [AC_SUBST(BZ2_LIBS, -lbz2)])
2060 AC_CHECK_LIB(c, getpwnam, AC_DEFINE(HAVE_GETPWNAM, 1, [Has getpwnam] ))
2062 dnl X11 is needed for fltk (at least),
2063 dnl and probably for many other guis too ...
2064 dnl if ! test x$build_fb = xyes; then # <--- this is wrong as build_x is non-exclusive
2065 dnl AC_PATH_XTRA
2066 dnl AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation)
2067 dnl AC_CHECK_LIB(gmp, _gmp_get_memory_functions)
2068 GNASH_PATH_X11
2069 AC_CHECK_LIB(Xi, XInput_find_display)
2070 AC_CHECK_LIB(X11, XDisableAccessControl)
2071 dnl fi
2072 AM_CONDITIONAL(HAVE_X11, [test x${has_x11} = xyes])
2073 if test x${build_x11_device} = xyes -a  x${has_x11} = xyes; then
2074   AC_DEFINE(BUILD_X11_DEVICE, [1], [Build the X11 device])
2077 dnl See if ipc_perm structure has the ipc_perm.key field, and if so,
2078 dnl which variant of the name is used.
2079 ipc_key=no
2080 AC_TRY_COMPILE([
2081   #include <sys/ipc.h>
2082   #include <sys/shm.h>], [
2083  struct shmid_ds shmseg;      
2084  key_t x = shmseg.shm_perm.key;],
2085  ipc_key=yes
2086  AC_DEFINE(IPC_PERM_KEY, [key], [Has the key field in ipc_perm])
2089 if test x$ipc_key = xno; then
2090   AC_TRY_COMPILE([
2091     #include <sys/ipc.h>
2092     #include <sys/shm.h>], [
2093     struct shmid_ds shmseg;      
2094     key_t x = shmseg.shm_perm.__key;],
2095     AC_DEFINE(IPC_PERM_KEY, [__key], [Has the key field in ipc_perm])
2096     ipc_key=yes
2097   )
2100 AC_CACHE_CHECK([for finite], ac_cv_finite,
2101  [AC_TRY_COMPILE([
2102    #include <math.h>
2103    #ifdef HAVE_IEEEFP_H
2104    #include <ieeefp.h>
2105    #endif],
2106  [double x; int y; y = finite(x);],
2107  ac_cv_finite=yes,
2108  ac_cv_finite=no
2110 if test x"$ac_cv_finite" = x"yes"; then
2111   AC_SEARCH_LIBS(finite, m,
2112     [AC_DEFINE(HAVE_FINITE, [1], [Has finite])]
2113   )
2116 AC_LANG_PUSH(C++)
2117 AC_CACHE_CHECK([for isfinite], ac_cv_isfinite,
2118  [AC_TRY_COMPILE([#include <cmath>],
2119  [using namespace std; double x; int y; y = isfinite(x);],
2120  ac_cv_isfinite=yes,
2121  ac_cv_isfinite=no
2123 AC_LANG_POP(C++)
2124 if test x"$ac_cv_isfinite" = x"yes"; then
2125   dnl Don't give up if isfinite is not found in -lm
2126   dnl isfinite is defined as a macro in C99.
2127   AC_SEARCH_LIBS(isfinite, m)
2128   AC_DEFINE(HAVE_ISFINITE, [1], [Has isfinite])
2131 AC_LANG_PUSH(C++)
2132 AC_CACHE_CHECK([whether $CXX implements __PRETTY_FUNCTION__], ac_cv_implements___PRETTY_FUNCTION__, [
2133   AC_TRY_LINK([#include <cstdio>
2134 ], 
2135     [ std::printf("%s", __PRETTY_FUNCTION__); ], 
2136     [ ac_cv_implements___PRETTY_FUNCTION__="yes" ],
2137     [ ac_cv_implements___PRETTY_FUNCTION__="no" ]
2138   )
2140 if test "x$ac_cv_implements___PRETTY_FUNCTION__" = "xyes" ; then
2141   AC_DEFINE(HAVE_PRETTY_FUNCTION, [1], [__PRETTY_FUNCTION__ is defined])
2144 AC_CACHE_CHECK([whether $CXX implements __FUNCTION__], ac_cv_implements___FUNCTION__, [
2145   AC_TRY_LINK([#include <cstdio>
2146 ], 
2147     [ std::printf("%s", __FUNCTION__); ], 
2148     [ ac_cv_implements___FUNCTION__="yes" ],
2149     [ ac_cv_implements___FUNCTION__="no" ]
2150   )
2152 if test "x$ac_cv_implements___FUNCTION__" = "xyes" ; then
2153   AC_DEFINE(HAVE_FUNCTION, [1], [__FUNCTION__ is defined])
2156 AC_CACHE_CHECK([whether $CXX implements __func__], ac_cv_implements___func__, [
2157   AC_TRY_LINK([#include <cstdio>
2158 ], 
2159     [ std::printf("%s", __func__); ], 
2160     [ ac_cv_implements___func__="yes" ],
2161     [ ac_cv_implements___func__="no" ]
2162   )
2164 if test "x$ac_cv_implements___func__" = "xyes" ; then
2165   AC_DEFINE(HAVE_func, [1], [__func__ is defined])
2167 AC_LANG_POP(C++)
2168 AC_REPLACE_FUNCS(getopt)
2170 dnl Date portability stuff, used in server/asobj/Date.cpp
2171 AC_CHECK_FUNCS(gettimeofday)
2172 AC_CHECK_FUNCS(ftime)
2173 AC_CHECK_FUNCS(tzset)
2174 AC_CHECK_FUNCS(localtime_r)
2176 AC_CACHE_CHECK([whether struct tm has tm_gmtoff], ac_cv_tm_gmtoff, [
2177         AC_TRY_LINK([
2178 /* ctime(1) says "The glibc version of struct tm has additional fields
2179  * defined  when _BSD_SOURCE was set before including <time.h>"
2180  * In practice, you do not need to define it yourself (tested on glibc-2.2.1 
2181  * and 2.3.6) but if you *do* define it yourself, it makes *all* functions
2182  * favour BSD-like behaviour over of GNU/POSIX, which seems dangerous.
2183  */
2184 // #define _BSD_SOURCE 1
2185 #include <time.h>
2186 ], 
2187                 [ struct tm tm; long l = tm.tm_gmtoff; ], 
2188                 [ ac_cv_tm_gmtoff="yes" ],
2189                 [ ac_cv_tm_gmtoff="no" ]
2190         )
2192 if test "x$ac_cv_tm_gmtoff" = "xyes" ; then
2193         AC_DEFINE(HAVE_TM_GMTOFF, [1], [struct tm has member tm_gmtoff])
2196 AC_CACHE_CHECK([whether timezone is a long], ac_cv_long_timezone, [
2197         AC_TRY_LINK([
2198 /* On Linux/glibc, tzset(3) says "extern long timezone;" (seconds West of GMT)
2199  * but on BSD char *timezone(int,int) is a function returning a string name.
2200  * The BSD function timegm() may be the equivalent, but this should
2201  * not be necessary because on BSD the code should use tm.tm_gmtoff instead
2202  * (use of long timezone is a fallback strategy for when tm_gmtoff exists not).
2203  */
2204 #include <stdio.h>
2205 #include <time.h>
2206 extern long timezone;
2207   ], 
2208     [ printf("%ld", timezone); ], 
2209     [ ac_cv_long_timezone="yes" ],
2210     [ ac_cv_long_timezone="no" ]
2211    )
2213 if test "x$ac_cv_long_timezone" = "xyes" ; then
2214   AC_DEFINE(HAVE_LONG_TIMEZONE, [1], [extern timezone is a long integer, not a function])
2217 AC_CHECK_FUNCS(sysconf)
2218 AC_CHECK_FUNCS(shmget shmat shmdt mmap)
2219 AC_CHECK_FUNCS(scandir)         dnl supported by BSD and Linux, but you never know...
2220 AC_CHECK_LIB(rt, clock_gettime)
2221 AC_CHECK_FUNC(clock_gettime, AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Has clock_gettime()] ))
2222 dnl Look for Win32 networking stuff
2223 AC_CHECK_HEADERS(winsock.h)
2224 AC_CHECK_HEADERS(winsock2.h)
2226 GNASH_PKG_FIND(nspr, [nspr.h], [Netscape Portable Runtime (NSPR)], PR_Init)
2228 AC_PATH_TOOL(WINDRES, [windres])
2229 AC_SUBST(WINDRES)
2231 GNASH_PKG_FIND(z, [zlib.h], [zlib compression library], compress)
2232 GNASH_PKG_FIND(jpeg, [jpeglib.h], [jpeg images], jpeg_mem_init)
2233 GNASH_PKG_FIND(png, [png.h], [png images], png_info_init)
2234 GNASH_PKG_FIND(gif, [gif_lib.h], [gif images], DGifOpen)
2235 if test x"${GIF_LIBS}" = x ; then
2236  GNASH_PKG_FIND(ungif, [gif_lib.h], [gif images], DGifOpen)
2237  GIF_LIBS=${UNGIF_LIBS}
2238  GIF_CFLAGS=${UNGIF_CFLAGS}
2240 if test x"$testsuite" = x"yes"; then
2241   GNASH_PKG_INCLUDES([dejagnu], [dejagnu.h])
2244 GNASH_PKG_FIND(speex, [speex.h], [speex audio codec], speex_decode_int)
2245 AM_CONDITIONAL(HAVE_SPEEX, [ test x$has_speex = xyes ])
2246 if test x$has_speex = xyes ; then
2247   AC_DEFINE([DECODING_SPEEX], [1], [Speex codec available])
2250 GNASH_PKG_FIND(speexdsp, [speex_resampler.h], [speex DSP utilities], speex_resampler_process_int)
2251 if test x$has_speexdsp = xyes ; then
2252   AC_DEFINE([RESAMPLING_SPEEX], [1], [Speex resampler available])
2255 dnl Find freetype and fontconfig
2256 GNASH_PATH_FREETYPE2
2257 GNASH_PKG_FIND(fontconfig, [fontconfig/fontconfig.h], [fontconfig library], FcFontMatch)
2259 if test x$cross_compiling = xno; then
2260   AC_PATH_MING
2263 if test x"$MING_VERSION_CODE" = x; then
2264  MING_VERSION_CODE=00000000
2267 AM_CONDITIONAL(ENABLE_MING,
2268         [ test x"$MAKESWF" != x -a $MING_VERSION_CODE -gt 00040000 ])
2270 AM_CONDITIONAL(MING_VERSION_0_4,
2271         [ test $MING_VERSION_CODE -ge 00040000  ])
2272 AM_CONDITIONAL(MAKESWF_SUPPORTS_PREBUILT_CLIPS,
2273         [ test $MING_VERSION_CODE -ge 00040002  ])
2274 AM_CONDITIONAL(MING_SUPPORTS_INIT_ACTIONS,
2275         [ test $MING_VERSION_CODE -ge 00040004  ])
2276 AM_CONDITIONAL(MING_SUPPORTS_REPLACE_TAG,
2277         [ test $MING_VERSION_CODE -ge 00040005 ])
2278 AM_CONDITIONAL(MING_SUPPORTS_SWFBUTTON_ADD_CHARACTER,
2279         [ test $MING_VERSION_CODE -ge 00040005 ])
2280 AM_CONDITIONAL(MING_SUPPORTS_STREAMING_SOUND,
2281         [ test $MING_VERSION_CODE -ge 00040006 ])
2282 AM_CONDITIONAL(MING_SUPPORTS_SWFBUTTON_SET_DEPTH,
2283         [ test $MING_VERSION_CODE -ge 00040006 ])
2284 AM_CONDITIONAL(MING_VERSION_0_4_3,
2285         [ test $MING_VERSION_CODE -ge 00040300 ])
2286 AM_CONDITIONAL(MING_VERSION_0_4_4,
2287         [ test $MING_VERSION_CODE -ge 00040400 ])
2289 if test x$cross_compiling = xno; then
2290     AC_ARG_WITH([swfdec_testsuite],
2291         AC_HELP_STRING([--with-swfdec-testsuite],
2292             [directory where swfdec testsuite (the 'test' dir) is]),
2293         if test x"${withval}" = xyes; then
2294             dir=`dirname $0`
2295             dir=`cd ${dir} && pwd`
2296             withval="${dir}/testsuite/swfdec/src/test"
2297         fi
2298         SWFDEC_TESTSUITE=${withval}
2299     )
2300     AC_SUBST(SWFDEC_TESTSUITE)
2302 AM_CONDITIONAL(ENABLE_SWFDEC_TESTSUITE, [ test x"$SWFDEC_TESTSUITE" != x ])
2304 if test x$cross_compiling = xno; then
2305   AC_ARG_ENABLE([http_testsuite],
2306       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2307           AC_HELP_STRING([--enable-http-testsuite=<baseurl>],
2308                   [Enable http based testsuite (default url is http://www.gnashdev.org/testcases)]),
2309               [case "${enableval}" in
2310              no) HTTP_TESTSUITE="" ;;
2311             yes) HTTP_TESTSUITE="http://www.gnashdev.org/testcases" ;;
2312               *) HTTP_TESTSUITE="${enableval}";;
2313            esac])
2314   AC_SUBST(HTTP_TESTSUITE)
2316 AM_CONDITIONAL(ENABLE_HTTP_TESTSUITE, [ test x"$HTTP_TESTSUITE" != x ])
2318 if test x$cross_compiling = xno; then
2319   AC_ARG_ENABLE([red5_testing],
2320       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2321           AC_HELP_STRING([--enable-red5-testing=<host>],
2322                   [Enable red5 based testing (default host is www.gnashdev.org)]),
2323               [case "${enableval}" in
2324              no) RED5_HOST="" ;;
2325             yes) RED5_HOST="www.gnashdev.org" ;;
2326               *) RED5_HOST="${enableval}";;
2327            esac])
2328   AC_SUBST(RED5_HOST)
2330 AM_CONDITIONAL(ENABLE_RED5_TESTING, [ test x"$RED5_HOST" != x ])
2332 if test x$cross_compiling = xno; then
2333   AC_ARG_ENABLE([rtmpy_testing],
2334       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2335           AC_HELP_STRING([--enable-rtmpy-testing=<host>],
2336                   [Enable rtmpy based testing (default host is www.gnashdev.org)]),
2337               [case "${enableval}" in
2338              no) RTMPY_HOST="" ;;
2339             yes) RTMPY_HOST="www.gnashdev.org" ;;
2340               *) RTMPY_HOST="${enableval}";;
2341            esac])
2342   AC_SUBST(RTMPY_HOST)
2344 AM_CONDITIONAL(ENABLE_RTMPY_TESTING, [ test x"$RTMPY_HOST" != x ])
2346 dnl The name might differ between systems.
2347 if test x"$testsuite" = x"yes"; then
2348 AC_PATH_PROGS(NETCAT, [nc netcat])
2349 AC_PATH_PROG(WGET, wget)
2351 AM_CONDITIONAL(HAS_NETCAT, [ test x"$NETCAT" != x ])
2352 AM_CONDITIONAL(HAS_WGET, [ test x"$WGET" != x ])
2355 dnl See if we can use the swfmill, mtasc, swfc and haxe based testsuites 
2357 if test x"$testsuite" = x"yes" -a x$cross_compiling = xno; then
2358   AC_PATH_PROG(AS3COMPILE, as3compile)
2359   AC_PATH_PROG(SWFC, swfc)
2360   AC_PATH_SWFMILL
2361   AC_PATH_MTASC
2362   AC_PATH_HAXE
2365 AM_CONDITIONAL(ENABLE_SWFMILL, [ test x"$SWFMILL" != x ])
2366 AM_CONDITIONAL(SWFMILL_AS3_SUPPORT,
2367         [ test x"$SWFMILL" != x && test $SWFMILL_VERSION -ge 00021206 ])
2369 dnl SWFMILL versions older than 0.3 didn't get function2 flags order correctly
2370 AM_CONDITIONAL(SWFMILL_FUNCTION2_FLAGS_ORDER_CORRECT,
2371         [ test x"$SWFMILL" != x && test $SWFMILL_VERSION -ge 00021206 ])
2373 AM_CONDITIONAL(ENABLE_AS3COMPILE, [ test x"$AS3COMPILE" != x ])
2374 AM_CONDITIONAL(ENABLE_MTASC, [ test x"$MTASC" != x ])
2375 AM_CONDITIONAL(ENABLE_HAXE, [ test x"$HAXE" != x ])
2376 AM_CONDITIONAL(ENABLE_SWFC, [ test x"$SWFC" != x ])
2377 AM_CONDITIONAL(ENABLE_HAXE, [ test x"$HAXE" != x ])
2379 AC_PATH_PROG(DOXYGEN, doxygen)
2380 AM_CONDITIONAL(ENABLE_DOXYGEN, [ test x"$DOXYGEN" != x ])
2382 AM_CONDITIONAL(HAVE_KDE3,    [test x$has_kde3 = xyes])
2383 AM_CONDITIONAL(HAVE_KDE4,    [test x$has_kde4 = xyes])
2384 AM_CONDITIONAL(HAVE_QT3,     [test x$has_qt3 = xyes])
2385 AM_CONDITIONAL(HAVE_QT4,     [test x$has_qt4 = xyes])
2387 AM_CONDITIONAL([QT_X11],     [test "$platform" = "X11"])
2388 AM_CONDITIONAL([QTOPIA],     [test "$platform" = "Qtopia"])
2389 AM_CONDITIONAL([QT_OSX],     [test "$platform" = "OSX"])
2390 AM_CONDITIONAL([QT_OS9],     [test "$platform" = "OS9"])
2391 AM_CONDITIONAL([QT_WIN32],   [test "$platform" = "Win32"])
2393 dnl Need GLIB for both GTK and GST
2394 if test x"${build_gtk}" = xyes -o x"${build_media_gst}" = xyes; then
2395   GNASH_PATH_GLIB
2398 AM_CONDITIONAL(HAVE_GLIB, [ test x"${has_glib}" = xyes ])
2400 if test x$npapi = xyes; then
2401   if ! test x$build_gtk = xyes -o x$build_qt4 = xyes; then
2402     AC_MSG_WARN(["Enabled NPAPI plugin, but it's not supported by the selected GUI"])
2403   fi
2406 if test x$windows = xyes -a x$npapi = xyes; then
2407   if test "x$NSPR_CFLAGS" = x -a "x$NSPR_LIBS" = x; then
2408     AC_MSG_ERROR(["On Win32, NPAPI plugin requires NSPR."])
2409   fi
2410   if test "x$WINDRES" = x; then
2411     AC_MSG_ERROR(["On Win32, NPAPI plugin requires windres."])
2412   fi
2415 dnl Need GLIB for NPAPI plugin
2416 if test x$npapi = xyes; then
2417   GNASH_PATH_GLIB
2420 dnl if kde isn't installed, even if it's specified, don't try to build
2421 dnl the KPARTS plugin, which is KDE based.
2422 if test x$has_kde3 = xno -a x$build_kparts3 = xyes; then
2423   build_kparts3=no
2424   AC_MSG_WARN(["Disabling KPARTS 3.x plugin, no KDE development found"])
2427 if test x$build_kde3 = xno -a x$build_kparts3 = xyes; then
2428   AC_MSG_WARN(["Enabled KPARTS 3.x plugin, but you aren't building a KDE based GUI!"])
2430 if test x$has_kde4 = xno -a x$build_kparts4 = xyes; then
2431   build_kparts4=no
2432   AC_MSG_WARN(["Disabling KPARTS 4.x plugin, no KDE 4.x development found"])
2435 if test x$build_qt4 = xno -a x$kparts4 = xyes; then
2436   AC_MSG_WARN(["Enabled KPARTS 4.x plugin, but you aren't building a KDE 4.x based GUI!"])
2439 AM_CONDITIONAL(BUILD_QTOPIA3_GUI,  [ test x$build_qtopia3 = xyes ])
2440 AM_CONDITIONAL(BUILD_QTOPIA4_GUI,  [ test x$build_qtopia4 = xyes ])
2442 AM_CONDITIONAL(BUILD_KDE3_GUI,     [ test x$build_kde3 = xyes ])
2443 AM_CONDITIONAL(BUILD_QT4_GUI,     [ test x$build_qt4 = xyes ])
2445 AM_CONDITIONAL(BUILD_GTK_GUI,      [ test x$build_gtk = xyes ])
2446 AM_CONDITIONAL(BUILD_FLTK_GUI,     [ test x$build_fltk = xyes ])
2447 AM_CONDITIONAL(BUILD_SDL_GUI,      [ test x$build_sdl = xyes ])
2448 AM_CONDITIONAL(BUILD_FB_GUI,       [ test x$build_fb = xyes ])
2449 AM_CONDITIONAL(BUILD_AQUA_GUI,     [ test x$build_aqua = xyes ])
2450 AM_CONDITIONAL(BUILD_DUMP_GUI,     [ test x$build_dump = xyes ])
2451 AM_CONDITIONAL(BUILD_AMIGAOS4_GUI, [ test x$build_aos4 = xyes ])
2452 AM_CONDITIONAL(BUILD_HAIKU_GUI,    [ test x$build_haiku = xyes ])
2454 # plugin building flags
2455 AM_CONDITIONAL(NPAPI,   [test x"${npapi}" = xyes])
2456 AM_CONDITIONAL(KPARTS3, [test x"${build_kparts3}" = xyes])
2457 AM_CONDITIONAL(KPARTS4, [test x"${build_kparts4}" = xyes])
2459 if test x"${build_gles1}"; then
2460   GNASH_PATH_GLES
2463 dnl only Linux supports /dev/fb0
2464 if test x"${build_rawfb_device}" = xyes -a x"${linux}" = xyes; then
2465    AC_DEFINE([BUILD_RAWFB_DEVICE], [1], [Use raw Framebuffer device support])
2468 if test x"${build_directfb_device}" = xyes; then
2469    GNASH_PKG_FIND(directfb, [directfb.h], [DirectFB render library], DirectFBCreate)
2470    AC_DEFINE([BUILD_DIRECTFB_DEVICE], [1], [Use DirectFB device support])
2473 AM_CONDITIONAL(BUILD_VAAPI_DEVICE, [test x"${use_libva}" = xyes])
2474 AM_CONDITIONAL(BUILD_EGL_DEVICE, [test x"${build_egl_device}" = xyes])
2475 AM_CONDITIONAL(BUILD_DIRECTFB_DEVICE, [ test x${build_directfb_device} = xyes])
2476 AM_CONDITIONAL(BUILD_RAWFB_DEVICE, [ test x${build_rawfb_device} = xyes])
2477 AM_CONDITIONAL(BUILD_X11_DEVICE, [test x${build_x11_device} = xyes])
2479 if test x"${build_gtk}" = xyes; then
2480   AC_ARG_ENABLE(ghelp,
2481     AC_HELP_STRING([--enable-ghelp], [Enable support for the GNOME help system]),
2482     [case "${enableval}" in
2483       yes) ghelp=yes ;;
2484       no)  ghelp=no ;;
2485       *)   AC_MSG_ERROR([bad value ${enableval} for enable-ghelp option]) ;;
2486     esac], ghelp=no
2487   )
2489   if test x"${ghelp}" = x"yes" ; then
2490     AC_PATH_PROG(SCROLLKEEPER, scrollkeeper-config, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2491     AC_PATH_PROG(SCROLLUPDATE, scrollkeeper-update, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2492     AC_PATH_PROG(SCROLLINSTALL, scrollkeeper-preinstall, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2494     if test x"$SCROLLKEEPER" = x -o x"$SCROLLUPDATE" = x -o x"$SCROLLINSTALL" = x ; then
2495       ghelp=no
2496       AC_MSG_WARN([You need to install scrollkeeper for gnome help])
2497     fi
2498   fi
2500 AM_CONDITIONAL(GHELP, [test x${ghelp} = xyes])
2502 if test x${build_fltk} = xyes; then
2503   GNASH_PKG_FIND(Xft, [Xft.h], [xft library], XftGlyphRender)
2506 dnl Some systems have a pervered set of dependencies.
2507 dnl Fedora Core 6 appears to have a dependency on expat for fontconfig.
2508 dnl We only need the library, but this is the easy wind to find it.
2509 GNASH_PKG_FIND(expat, [expat.h], [Expat library], XML_ErrorString)
2511 dnl these conditionals were moved out of kde.m4
2512 AM_CONDITIONAL(HAS_KDE3, [test x$has_kde3 = xyes])
2513 # used to disable x11-specific stuff on special platforms
2514 AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
2515 AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
2516 AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
2518 AM_CONDITIONAL(HAVE_GLEXT, [test x$glext = xyes])
2520 dnl We don't have GTKGLExt, so default to SDL, and don't build the Firefox plugin
2521 if test x$glext = xno -a x$build_ogl = xyes; then
2522   if test x$gtk2 = xyes -a x$build_gtk = xyes; then
2523     AC_ERROR([You have GTK installed, but not GtkGLExt. You need GtkGLExt to use the OpenGL renderer. Attempting to build SDL version])
2524   fi
2525   gui=sdl
2526   npapi=no
2527   AC_MSG_WARN([GTK2 specified for the GUI, but GtkGlExt is not present. Trying SDL instead.])
2530 missing_codecs=""
2531 if test x"$build_media_gst" = "xyes"; then
2532   AC_PATH_PROG(GST_INSPECT, gst-inspect, ,[${pathlist}])
2533   if test "x$GST_INSPECT" != "x" -a x"${darwin}" = xno ; then
2534     AC_PATH_PROG(GST_INSPECT, gst-inspect-0.10, ,[${pathlist}])
2535   fi
2536   if test "x$GST_INSPECT" != "x" -a x"${darwin}" = xno ; then
2537     dnl FIXME: there may be multiple acceptable plugins that are acceptable for
2538     dnl our use. For example, mad or FFmpeg will play mp3.
2539     codecs="ffdec_flv ffdec_flashsv ffdec_vp6f ffdec_flashsv mad vorbisdec ffdec_vp6"
2540     for i in $codecs; do
2541        hits="`$GST_INSPECT $i | grep -c 'Long name'`"
2542        if test $hits -eq 0; then
2543          missing_codecs="$missing_codecs $i"
2544          AC_MSG_WARN([Missing codec: $i])
2545        fi
2546     done
2547   fi
2548   GNASH_PKG_FIND(gstreamer_plugins_base, [gst/interfaces/probeprobe.h], [gstreamer interfaces library], gst_property_probe_probe_and_get_values_name, [0.10])
2549   GNASH_PKG_FIND(gstreamer_app, [gst/app/gstappsink.h], [gstreamer app library], call_gmon_start, [0.10])
2550   GNASH_PKG_FIND(gstreamer, [gst/gst.h], [gstreamer library], gst_init, [0.10])
2551   dnl if cross compiling, we're usually not going to be able to pop up
2552   dnl the codec installer to download the package to install, so disable
2553   dnl it if cross compiling with gstreamer support.
2554   if test x$cross_compiling = xno; then
2555     GNASH_PKG_FIND(gstreamer_pbutils, [gst/pbutils/install-plugins.h], [gstreamer PB Utils library], gst_install_plugins_supported, [0.10])
2556   fi
2557   dnl when cross compiling Gstreamer, not all supplied SDKs include all the
2558   dnl development libraries since most devices don't need to support plugin
2559   dnl development, only the runtime. In these caes we often have the header
2560   dnl files but not the libraries.
2561   if test x"${has_gstreamer_plugins_base}" = xyes; then
2562     GSTREAMER_LIBS="-lgstinterfaces-0.10 $GSTREAMER_LIBS"
2563     AC_DEFINE(HAS_GSTREAMER_PLUGINS_BASE, [1], [Has the Gstreamer Plugin Dev package installed])
2564   fi
2567 AM_CONDITIONAL(HAVE_CAIRO, [true])
2568 AM_CONDITIONAL(HAVE_OPENGL, [true])
2570 AM_CONDITIONAL(USE_SOUND_SDL, test x$build_sound_sdl = xyes)
2571 AM_CONDITIONAL(USE_SOUND_AHI, test x$build_sound_ahi = xyes)
2572 AM_CONDITIONAL(USE_SOUND_MKIT, test x$build_sound_mkit = xyes)
2573 AM_CONDITIONAL(USE_FFMPEG_ENGINE, test x"${build_media_ffmpeg}" = x"yes")
2574 AM_CONDITIONAL(USE_GST_ENGINE, test x"${build_media_gst}" = x"yes")
2575 AM_CONDITIONAL(HAVE_OPENGL, test x"${OPENGL_LIBS}" != x)
2576 dnl for now the Haiku media handler is experimental
2577 AM_CONDITIONAL(USE_HAIKU_ENGINE, test x"$build_media_haiku" = xyes)
2579 if test x"${build_media_ffmpeg}" = x"yes"; then
2580   AC_DEFINE([ENABLE_FFMPEG_MEDIA],  [1], [Use FFmpeg for media decoding])
2583 if test x"${build_media_gst}" = x"yes"; then
2584   AC_DEFINE([ENABLE_GST_MEDIA],  [1], [Use gstreamer for media decoding])
2587 if test x"${build_media_haiku}" = x"yes"; then
2588   AC_DEFINE([ENABLE_HAIKU_MEDIA],  [1], [Use haiku for media decoding])
2591 if test x$build_sound_mkit = xyes; then
2592   if test x"${haiku}" != xyes; then
2593     AC_MSG_ERROR([Media Kit sound handling is supported only under Haiku]);
2594   else
2595     AC_DEFINE([SOUND_MKIT],  [1], [Use Haiku Media Kit for sound handling])
2596   fi
2599 if test x"${build_sound_sdl}" = xyes; then
2600   AC_DEFINE([SOUND_SDL],  [1], [Use SDL for sound handling])
2603 if test x"${build_sound_ahi}" = xyes; then
2604   if test x"$amigaos4" != xyes; then
2605     AC_MSG_ERROR([AHI sound handling is supported only under AmigaOS]);
2606   else
2607     AC_DEFINE([SOUND_AHI],  [1], [Use AmigaOS AHI for sound handling])
2608   fi
2611 if test x$build_fltk = xyes; then
2612   GNASH_PKG_FIND(fltk2, [fltk/FL_API.h], [Fast Light Toolkit], fl_window_flush)
2613   if test x"${has_fltk2}" = xyes; then
2614     AC_CHECK_LIB(Xi, XInput_find_display,
2615       [AC_SUBST(FLTK2_LIBS, "$FLTK2_LIBS -lXi")])
2616   fi
2619 AM_CONDITIONAL(HAVE_FLTK2, [ test x$has_fltk2 = xyes ])
2620 AM_CONDITIONAL(HAS_XFT, [ test x$has_xft = xyes ])
2622 GNASH_DOCBOOK
2623 AM_CONDITIONAL(ENABLE_INFO, test x${INSTALL_INFO} != x)
2624 AM_CONDITIONAL(DOCBOOK, test x$docbook = xyes)
2625 AM_CONDITIONAL(ENABLE_TEXI, [ test x"$DB2X_TEXI" != x -o x"$DB2X_TEXIXML" != x ])
2626 AM_CONDITIONAL(ENABLE_PDF, [ test x"$DB2X_PDF" ])
2627 AM_CONDITIONAL(ENABLE_HTML, [ test x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
2628 AM_CONDITIONAL(ENABLE_FOP, [ test x"$FOP" != x -a x"$docbook_styles" != x ])
2629 AM_CONDITIONAL(ENABLE_XMLTEX, [ test x"$PDFXMLTEX" != x -a x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
2630 AM_CONDITIONAL(ENABLE_MAN, [ test x"$DB2X_MAN" != x -o x"$DB2X_MANXML" != x ])
2631 AM_CONDITIONAL(HAVE_AGG, [test x"${AGG_LIBS}" != x])
2633 GNASH_PATH_CURL
2635 dnl Define winsock if we're on windows. We could do something complicated,
2636 dnl but since AC_EXEEXT does it for us, we'll do this the easy way.
2637 if test x"$EXEEXT" = "exe"; then
2638   AC_DEFINE(HAVE_WINSOCK,1,[This is defined is we are on Win32])
2641 dnl ****************************************
2642 dnl *** Check for ELF visibility support ***
2643 dnl ****************************************
2645 AC_ARG_ENABLE([visibility],
2646   AC_HELP_STRING([--enable-visibility], [Use ELF visibility attributes]), [], [enable_visibility=no])
2648 if test x"$enable_visibility" != x"no"; then
2649   dnl Check whether the compiler supports the visibility attribute
2650   save_CFLAGS="$CFLAGS"
2651   CFLAGS="$CFLAGS -Wall -Werror"
2652   AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute])
2653   AC_COMPILE_IFELSE([AC_LANG_SOURCE(
2654     [
2655       void __attribute__ ((visibility("default"))) test_default (void) {}
2656       void __attribute__ ((visibility("hidden"))) test_hidden (void) {}
2657       int main (int argc, char **argv) { test_default (); test_hidden (); return 0; }
2658     ])],
2659     [
2660       AC_DEFINE([HAVE_GNUC_VISIBILITY], [1], [Define this for GCC-visibility.])
2661       AC_MSG_RESULT([yes])
2662     ],
2663     [
2664       AC_MSG_RESULT([no])
2665     ]
2666   )
2667   CFLAGS="$save_CFLAGS"
2670 AC_ARG_ENABLE([pch],
2671   AC_HELP_STRING([--enable-pch], [Enable precompiled header support]), [], [enable_pch=no])
2673 AM_CONDITIONAL([ENABLE_PCH], [test x"$enable_pch" != x"no"])
2675 PCH_FLAGS="-include all-includes.h -Winvalid-pch"
2676 AC_SUBST(PCH_FLAGS)
2678 GNASH_PATH_PTHREADS
2680 GNASH_PATH_BOOST
2682 AC_ARG_ENABLE([strict],
2683   AC_HELP_STRING([--enable-strict],[Accept only standards compliant code (GCC only)]),
2684   [case "${enableval}" in
2685     yes) strict=yes ;;
2686     no) strict=no ;;
2687     *) AC_MSG_ERROR([bad value ${enableval} for --enable-strict option]) ;;
2688   esac],
2689   [strict=no]
2692 if test x"$strict" = x"yes" -a x$build_agg = xyes; then
2693    AC_MSG_ERROR([agg renderer will fail with --enable-strict.]);        
2696 # We want warnings, lots of warnings  :-)
2697 # It should be possible to build with -ansi, not with
2698 # -pedantic because of agg.
2700 # -ansi was actually dropped because it hides 'fileno', which
2701 # is used in a few places
2703 if test x"$GCC" = x"yes"; then
2704   CXXFLAGS="$CXXFLAGS \
2705     $CROSS_CXXFLAGS \
2706     -W \
2707     -Wall \
2708     -Wcast-align \
2709     -Wcast-qual \
2710     -Wpointer-arith \
2711     -Wreturn-type \
2712     -Wnon-virtual-dtor \
2713     -Wunused \
2714     "
2715   CFLAGS="$CFLAGS \
2716     $CROSS_CXXFLAGS \
2717     -W \
2718     -Wall \
2719     -Wcast-align \
2720     -Wcast-qual \
2721     -Wpointer-arith \
2722     -Wreturn-type \
2723     -Wmissing-declarations \
2724     -Wmissing-prototypes \
2725     -Wstrict-prototypes \
2726     "
2727   if test x"$strict" = x"yes"; then
2728     CXXFLAGS="$CXXFLAGS \
2729       -Wextra \   
2730       -pedantic \
2731       -Wno-long-long \
2732       "
2734     CFLAGS="$CFLAGS \
2735       -pedantic \
2736       -Wno-long-long \
2737       -ansi \
2738       "
2739   fi
2742 AC_ARG_ENABLE([cassert],
2743   AC_HELP_STRING([--disable-cassert],[Disable assertion checking]),
2744   [case "${enableval}" in
2745     yes) cassert=yes ;;
2746     no) cassert=no ;;
2747     *) AC_MSG_ERROR([bad value ${enableval} for --enable-cassert option]) ;;
2748   esac],
2749   [cassert=yes]
2752 if test x"$cassert" = x"no"; then
2753     CXXFLAGS="$CXXFLAGS \
2754       -DNDEBUG \
2755       "
2756     CFLAGS="$CFLAGS \
2757       -DNDEBUG \
2758       "
2761 dnl /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
2762 AC_DEFUN([CHECK_VISIBILITY_GCC_BUG],
2763   [
2764     AC_CACHE_CHECK([if -fvisibility-inlines-hidden is broken], ac_cv_gcc_visibility_bug, [
2765         AC_LANG_PUSH(C++)
2766         save_CXXFLAGS=$CXXFLAGS
2767         save_LDFLAGS=$LDFLAGS
2768         CXXFLAGS="-fPIC -fvisibility-inlines-hidden -O0"
2769         LDFLAGS="$LDFLAGS -shared -fPIC"
2771         AC_TRY_LINK(
2772         [          
2773           template<typename CharT>
2774           struct VisTest
2775           {
2776             inline VisTest ();
2777           };
2778           template<typename CharT>
2779           inline VisTest<CharT>::VisTest()
2780         {}
2781         extern template class VisTest<char>;  // It works if we drop that line
2782         int some_function( int do_something ) __attribute__((visibility("default")));
2783         int some_function( int )
2784           {
2785             VisTest<char> a;
2786             return 0;
2787           }
2788         ], [],
2789         ac_cv_gcc_visibility_bug=no, ac_cv_gcc_visibility_bug=yes)
2791         CXXFLAGS=$save_CXXFLAGS
2792         LDFLAGS=$save_LDFLAGS
2793         AC_LANG_POP(C++)
2794       ]
2795     )
2796     if test x$ac_cv_gcc_visibility_bug = xno; then
2797       CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
2798     fi
2799   ]
2802 CHECK_VISIBILITY_GCC_BUG
2804 if test x$ac_cv_gcc_visibility_bug = xno; then
2805   AC_LANG_PUSH(C++)
2806   AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
2807   save_CXXFLAGS=$CXXFLAGS
2808   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
2809   AC_LINK_IFELSE([AC_LANG_PROGRAM()], 
2810                  [ac_cv_gcc_visibility=yes;
2811                   AC_MSG_RESULT([yes])],
2812                  [ac_cv_gcc_visibility=no;
2813                   AC_MSG_RESULT([no])]);
2814   CXXFLAGS="$save_CXXFLAGS"
2815   AC_LANG_POP(C++)
2819 AM_CONDITIONAL(VISIBILITY_WORKS, test x"$ac_cv_gcc_visibility" = xyes)
2821 if test x"$ac_cv_gcc_visibility" = xyes -a x"$enable_visibility" != xno; then
2822   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
2825 dnl Define convenience constants so Gnash can print out the
2826 dnl default configuration of the build.
2827 RENDERER_CONFIG="${renderer_list}"
2828 RENDERER_LIBS=
2829 for rend in `echo "${add_renderer}" | tr ',' ' '`; do
2830         RENDERER_LIBS="${RENDERER_LIBS} \$(top_builddir)/librender/libgnash${rend}.la"
2831 done
2832 AC_SUBST(RENDERER_LIBS)
2833 AC_SUBST(RENDERER_CONFIG)
2835 HWACCEL_CONFIG="${device_list}"
2836 AC_SUBST(HWACCEL_CONFIG)
2838 dnl check for missing libraries and disable them.
2839 if test x"$BOOST_LIBS" != x; then
2840   if test x"${cygnal_missing_libs}" != x; then
2841     for i in ${cygnal_missing_libs}; do
2842       if test $i = serialization; then
2843         AC_DEFINE([BOOST_MULTI_INDEX_DISABLE_SERIALIZATION], ["1"], [if the library is missing, don't use it.])
2844       fi
2845     done
2846   fi
2849 CYGNAL_PATHS
2851 SUPPORTED_GUIS=
2852 if test x$build_qtopia3 = xyes; then
2853   SUPPORTED_GUIS="${SUPPORTED_GUIS},qtopia3"
2855 if test x$build_qtopia4 = xyes; then
2856   SUPPORTED_GUIS="${SUPPORTED_GUIS},qtopia4"
2858 if test x$build_fb = xyes; then
2859   SUPPORTED_GUIS="${SUPPORTED_GUIS},fb"
2861 if test x$build_fltk = xyes; then
2862   SUPPORTED_GUIS="${SUPPORTED_GUIS},fltk"
2864 if test x$build_kde3 = xyes; then
2865   SUPPORTED_GUIS="${SUPPORTED_GUIS},kde3"
2867 if test x$build_qt4 = xyes; then
2868   SUPPORTED_GUIS="${SUPPORTED_GUIS},qt4"
2870 if test x$build_gtk = xyes; then
2871   SUPPORTED_GUIS="${SUPPORTED_GUIS},gtk"
2873 if test x$build_sdl = xyes; then
2874   SUPPORTED_GUIS="${SUPPORTED_GUIS},sdl"
2876 if test x$build_aqua = xyes; then
2877   SUPPORTED_GUIS="${SUPPORTED_GUIS},aqua"
2879 if test x$build_dump = xyes; then
2880   SUPPORTED_GUIS="${SUPPORTED_GUIS},dump"
2882 if test x$build_aos4 = xyes; then
2883   SUPPORTED_GUIS="${SUPPORTED_GUIS},aos4"
2885 if test x$build_haiku = xyes; then
2886   SUPPORTED_GUIS="${SUPPORTED_GUIS},haiku"
2888 SUPPORTED_GUIS="`echo ${SUPPORTED_GUIS} | sed 's/,//'`" # Strip leading comma
2889 AC_SUBST(SUPPORTED_GUIS)
2891 AC_CONFIG_LINKS(cygnal/testsuite/cygnal.all/cygnalrc:cygnal/testsuite/cygnal.all/cygnalrc.in)
2892 AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc:testsuite/libbase.all/gnashrc.in)
2893 AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc-local:testsuite/libbase.all/gnashrc-local.in)
2895 AC_CONFIG_FILES(
2896 gnash.pc:gnash.pc.in
2897 desktop/gnash-gtk-launcher:desktop/gnash-gtk-launcher.in
2898 desktop/gnash-qt-launcher:desktop/gnash-qt-launcher.in
2901 AC_OUTPUT(Makefile
2902 desktop/Makefile
2903 po/Makefile
2904 libmedia/Makefile
2905 libsound/Makefile
2906 libbase/Makefile
2907 libcore/Makefile
2908 libcore/vm/Makefile
2909 libcore/parser/Makefile
2910 librender/Makefile
2911 utilities/Makefile
2912 doc/Makefile
2913 doc/C/Makefile
2914 doc/Doxyfile
2915 testsuite/Makefile
2916 testsuite/media/Makefile
2917 testsuite/libbase.all/Makefile
2918 testsuite/as3compile.all/Makefile
2919 testsuite/actionscript.all/Makefile
2920 testsuite/samples/Makefile
2921 testsuite/swfdec/Makefile
2922 testsuite/misc-ming.all/Makefile
2923 testsuite/misc-ming.all/action_order/Makefile
2924 testsuite/misc-ming.all/sound/Makefile
2925 testsuite/misc-ming.all/displaylist_depths/Makefile
2926 testsuite/misc-ming.all/init_action/Makefile
2927 testsuite/misc-ming.all/loop/Makefile
2928 testsuite/misc-ming.all/loading/Makefile
2929 testsuite/misc-ming.all/register_class/Makefile
2930 testsuite/misc-mtasc.all/Makefile
2931 testsuite/misc-haxe.all/Makefile
2932 testsuite/misc-haxe.all/classes.all/Makefile
2933 testsuite/misc-swfmill.all/Makefile
2934 testsuite/misc-swfmill.all/trace-as2/Makefile
2935 testsuite/misc-swfmill.all/trace-as3/Makefile
2936 testsuite/misc-swfc.all/Makefile
2937 testsuite/network.all/Makefile
2938 testsuite/movies.all/Makefile
2939 testsuite/libcore.all/Makefile
2940 testsuite/libmedia.all/Makefile
2941 gui/Makefile
2942 gui/Info.plist
2943 gui/pythonmod/Makefile
2944 extensions/Makefile
2945 extensions/dejagnu/Makefile
2946 extensions/mysql/Makefile
2947 extensions/fileio/Makefile
2948 extensions/gtk2/Makefile
2949 extensions/lirc/Makefile
2950 extensions/dbus/Makefile
2951 plugin/Makefile
2952 plugin/npapi/Makefile
2953 plugin/klash/Makefile
2954 plugin/klash4/Makefile
2955 plugin/win32/Makefile
2956 plugin/aos4/Makefile
2957 libdevice/Makefile
2958 cygnal/Makefile
2959 cygnal/libnet/Makefile
2960 cygnal/libamf/Makefile
2961 cygnal/cgi-bin/Makefile
2962 cygnal/cgi-bin/echo/Makefile
2963 cygnal/cgi-bin/oflaDemo/Makefile
2964 cygnal/cgi-bin/fitcDemo/Makefile
2965 cygnal/testsuite/Makefile
2966 cygnal/testsuite/libamf.all/Makefile
2967 cygnal/testsuite/libnet.all/Makefile
2968 cygnal/testsuite/cygnal.all/Makefile
2972 ########################## Final report begins... ############################
2975 dnl Create temporary directory in a secure way
2976 tmp=`mktemp -d ${TMPDIR=/tmp}/gnash-configure-XXXXXX`
2977 if test \! -n "$tmp" || test \! -d "$tmp"; then
2978   tmp=`(umask 077 && mkdir -d ${TMPDIR=/tmp}/gnash-configure-${RANDOM}-$$) 2>/dev/null`
2980 cerr="${tmp}/errors"
2981 cwarn="${tmp}/warnings"
2982 crec="${tmp}/recommended"
2983 deb_err="${tmp}/deb_err"
2984 deb_war="${tmp}/deb_war"
2985 deb_rec="${tmp}/deb_rec"
2986 rpm_err="${tmp}/rpm_err"
2987 rpm_war="${tmp}/rpm_war"
2988 rpm_rec="${tmp}/rpm_rec"
2989 yast_err="${tmp}/yast_err"
2990 yast_war="${tmp}/yast_war"
2991 yast_rec="${tmp}/yast_rec"
2992 echo ""
2994 #trap 'rm cerr' 0 # trap isn't a good idea, might override other traps
2995 exec 3> $cerr 
2996 exec 4> $cwarn
2997 exec 5> $crec
2999 for F in "$deb_err" "$deb_war" "$deb_rec" "$rpm_err" "$rpm_war" "$rpm_rec" "$yast_err" "$yast_war" "$yast_rec"; do
3000   touch "$F";
3001 done
3003 pkg_out_fd=
3004 deb_dest=
3005 rpm_dest=
3006 yast_dest=
3008 dnl These macros should be portable as I checked most things used are in
3009 dnl POSIX-2008, GNU CoreUtils, and shipped in MinGW. Old unices? No clue.
3010 dnl In any case, they are hardly relevant on non-GNU systems.
3012 dnl Beware, here comes some long scary shell commands.
3014 AC_DEFUN([PKG_ERR],
3016   pkg_out_fd=3
3017   echo "          ERROR: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3018   deb_dest="$deb_err"
3019   rpm_dest="$rpm_err"
3020   yast_dest="$yast_err"
3023 AC_DEFUN([PKG_WAR],
3025   pkg_out_fd=4
3026   echo "        WARNING: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3027   deb_dest="$deb_war"
3028   rpm_dest="$rpm_war"
3029   yast_dest="$yast_war"
3032 AC_DEFUN([PKG_REC],
3034   pkg_out_fd=5
3035   echo "    RECOMMENDED: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3036   deb_dest="$deb_rec"
3037   rpm_dest="$rpm_rec"
3038   yast_dest="$yast_rec"
3041 AC_DEFUN([PKG_SUGGEST],
3043   echo "`echo "$1" | fold -s -w 62 | sed 's/^/                 /'`" >&$pkg_out_fd
3046 AC_DEFUN([DEB_INSTALL],
3048   echo "                 or .deb users: `echo "apt-get install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3049   echo -n " $1" >> "$deb_dest"
3052 AC_DEFUN([DEB_ALTERNATIVE],
3054   echo "                 or maybe     : `echo "apt-get install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3055   echo -n "/$1" >> "$deb_dest"
3058 AC_DEFUN([RPM_INSTALL],
3060   echo "                 or .rpm users: `echo "yum install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3061   echo -n " $1" >> "$rpm_dest"
3064 AC_DEFUN([RPM_ALTERNATIVE],
3066   echo "                 or maybe     : `echo "yum install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3067   echo -n "/$1" >> "$rpm_dest"
3070 AC_DEFUN([YAST_INSTALL],
3072   echo "                 or yast users: `echo "yast install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3073   echo -n " $1" >> "$yast_dest"
3076 AC_DEFUN([YAST_ALTERNATIVE],
3078   echo "                 or maybe     : `echo "yast install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3079   echo -n "/$1" >> "$yast_dest"
3082 AC_DEFUN([PKG_ALTERNATIVE],
3084   echo "`echo "$1" | fold -s -w 62 | sed 's/^/                 /'`" >&$pkg_out_fd
3087 echo "Configurable options are:"
3089 if test x"${pthreads}" = x"yes"; then
3090   echo "        POSIX Threads support enabled (default)"
3091 else
3092   if test x"${build_haiku}" = x"yes"; then
3093      echo "        POSIX Thread support built into C library."
3094   else
3095      echo "        POSIX Thread support disabled."
3096   fi
3099 if test x"${npapi}" = x"yes"; then
3100   echo "        NPAPI plugin enabled (default). Use --disable-npapi to disable."
3101   echo "        NPAPI plugin will be installed in ${FIREFOX_PLUGINS}"
3102 else
3103   echo "        NPAPI plugin disabled."
3106 if test x"${build_kparts3}" = x"yes"; then
3107   echo "        KPARTS 3.x plugin enabled (default). Use --disable-kparts3 to disable"
3108   echo "            KPARTS 3.x plugin will be installed in ${KDE3_PLUGINDIR}"
3109   echo "            KPARTS 3.x service will be installed in ${KDE3_SERVICESDIR}"
3110   echo "            KPARTS 3.x config dir will be in ${KDE3_CONFIGDIR}"
3111   echo "            KPARTS 3.x appsdata will be installed in ${KDE3_APPSDATADIR}"
3112 else
3113   echo "        KPARTS 3.x plugin disabled."
3116 if test x"${build_kparts4}" = x"yes"; then
3117   echo "        KPARTS 4.x plugin enabled (default). Use --disable-kparts4 to disable"
3118   echo "            KPARTS 4.x plugin will be installed in ${KDE4_PLUGINDIR}"
3119   echo "            KPARTS 4.x service will be installed in ${KDE4_SERVICESDIR}"
3120   echo "            KPARTS 4.x config dir will be in ${KDE4_CONFIGDIR}"
3121   echo "            KPARTS 4.x appsdata will be installed in ${KDE4_APPSDATADIR}"
3122 else
3123   echo "        KPARTS 4.x plugin disabled."
3126 # set a variable if we shouldn't continue. This way we can print
3127 # out everything that is missing in one pass, hopefully making it
3128 # easy for new developers to get everything they need installed.
3130 echo ""
3131 echo "Configured paths for ${build} are:"
3133 dnl Dump QT3 options is the user specified a QTOPIA3 or KDE3 GUI
3134 if test x"${build_kde3}" = xyes -o x"${build_qtopia3}" = xyes; then
3135   if test x"${has_qt3}" = xyes; then
3136     echo "        QT3 flags are: ${QT3_CFLAGS}"
3137     echo "        QT3 libs are: ${QT3_LIBS}"
3138   else
3139     PKG_ERR([No QT 3.x development package installed!])
3140     PKG_SUGGEST([Install a QT 3.x development environment from http://qt.nokia.com/])
3141     DEB_INSTALL([libqt3-mt-dev])
3142     RPM_INSTALL([qt3-devel])
3143     RPM_ALTERNATIVE([qt-devel])
3144     PKG_ALTERNATIVE([or change to a different gui with --enable-gui=...])
3145   fi
3148 dnl Dump QT4 options is the user specified a QTOPIA4 or Qt4 GUI
3149 if test x"${build_qt4}" = xyes -o x"${build_qtopia4}" = xyes; then
3150   if test x"${has_qt4}" = xyes; then
3151     echo "        QT4 flags are: ${QT4_CFLAGS}"
3152     echo "        QT4 libs are: ${QT4_LIBS}"
3153   else
3154     PKG_ERR([No QT 4.x development package installed!])
3155     PKG_SUGGEST([Install a QT 4.x development environment from http://qt.nokia.com/])
3156     DEB_INSTALL([libqt4-dev])
3157     DEB_ALTERNATIVE([qt4-dev-tools]) dnl TODO: Is this required?
3158     RPM_INSTALL([qt4-devel])
3159     RPM_ALTERNATIVE([qt-devel])
3160     PKG_ALTERNATIVE([or change to a different gui with --enable-gui=...])
3161   fi
3164 if test x"${build_kparts4}" = xyes; then
3165   if test x"${has_kde4}" = xyes; then
3166     echo "        KDE4 flags are: ${KDE4_CFLAGS}"
3167     echo "        KDE4 libs are: ${KDE4_LIBS}"
3168   else
3169     PKG_WAR([kparts4 plugin is disabled!])
3170     PKG_SUGGEST([Install version 4.x of the KDE development environment from http://kde.org])
3171     DEB_INSTALL([kdelibs5-dev])
3172     RPM_INSTALL([kdelibs-devel])
3173   fi
3176 if test x"$build_qtopia3" = xyes; then
3177   if test x"${QTOPIA3_LIBS}" != x ; then
3178     if test x"${QTOPIA3_CFLAGS}" != x ; then
3179       echo "        QTOPIA 3.x flags are: $QTOPIA3_CFLAGS"
3180     else
3181       echo "        QTOPIA 3.x flags are: default include path"
3182     fi
3183     echo "        QTOPIA 3.x libs are: $QTOPIA3_LIBS"
3184   else
3185     PKG_ERR([No QTOPIA 3.x library development package installed!])
3186     PKG_SUGGEST([Install it from http://trolltech.com/downloads/ as binary packages are not available.]) dnl TODO: This link is no longer valid.
3187   fi
3190 if test x"$build_qtopia4" = xyes; then
3191   if test x"${QTOPIA4_LIBS}" != x ; then
3192     if test x"${QTOPIA4_CFLAGS}" != x ; then
3193       echo "        QTOPIA 4.x flags are: $QTOPIA4_CFLAGS"
3194     else
3195       echo "        QTOPIA 4.x flags are: default include path"
3196     fi
3197     echo "        QTOPIA 4.x libs are: $QTOPIA4_LIBS"
3198   else
3199     PKG_ERR([No QTOPIA 4.x library development package installed!])
3200     PKG_SUGGEST([Install it from http://trolltech.com/downloads/ as binary packages are not available.]) dnl TODO: This link is no longer valid.
3201   fi
3205 # -o x$build_kparts3 = xyes
3206 if test x$build_kde3 = xyes; then
3207   if test x"$has_kde3" = xyes; then
3208     echo "        KDE 3.x flags are: $KDE3_CFLAGS"
3209     echo "        KDE 3.x libs are: $KDE3_LIBS"
3210   else
3211     PKG_ERR([No KDE 3.x development package installed!])
3212     PKG_SUGGEST([Install version 3.x of the KDE development environment from http://kde.org])
3213     DEB_INSTALL([kdelibs4-dev])
3214     RPM_INSTALL([kdelibs3-devel])
3215     PKG_ALTERNATIVE([or disable the KDE 3.x gui, and reconfiguring using --enable-gui=<list-of-guis> and omitting kde from the list or avoiding --enable-gui=... as a whole.])
3216   fi
3219 if test x"${JPEG_LIBS}" != x ; then
3220   if test x"${JPEG_CFLAGS}" != x ; then
3221     echo "        JPEG flags are: $JPEG_CFLAGS"
3222   else
3223     echo "        JPEG flags are: default include path"
3224   fi
3225   echo "        JPEG libs are: $JPEG_LIBS"
3226 else
3227   PKG_ERR([No JPEG library development package installed!])
3228   PKG_SUGGEST([Install it from http://ijg.org])
3229   DEB_INSTALL([libjpeg-dev])
3230   RPM_INSTALL([libjpeg-devel])
3233 if test x"${GIF_LIBS}" != x ; then
3234   if test x"${GIF_CFLAGS}" != x ; then
3235     echo "        GIF flags are: $GIF_CFLAGS"
3236   else
3237     echo "        GIF flags are: default include path"
3238   fi
3239   echo "        GIF libs are: $GIF_LIBS"
3240 else
3241   PKG_ERR([No GIF library development package installed!])
3242   PKG_SUGGEST([Install it from http://sourceforge.net/projects/giflib/])
3243   DEB_INSTALL([libungif-dev])
3244   DEB_ALTERNATIVE([libgif-dev])
3245   RPM_INSTALL([libgif-devel])
3246   RPM_ALTERNATIVE([giflib-devel])
3247   RPM_ALTERNATIVE([libunfif-devel])
3250 if test x"${PNG_LIBS}" != x ; then
3251   if test x"${PNG_CFLAGS}" != x ; then
3252     echo "        PNG flags are: $PNG_CFLAGS"
3253   else
3254     echo "        PNG flags are: default include path"
3255   fi
3256   echo "        PNG libs are: $PNG_LIBS"
3257 else
3258   PKG_REC([No PNG library development package installed!])
3259   PKG_SUGGEST([Gnash will be built without support for dynamic loading of PNG files.])
3260   PKG_SUGGEST([Install it from http://www.libpng.org])
3261   DEB_INSTALL([libpng12-dev])
3262   RPM_INSTALL([libpng-devel])
3265 if test x"${build_ovg}" = x"yes"; then
3266   if test x"${has_openvg}" = xyes; then
3267     echo "        OpenVG flags are: $OPENVG_CFLAGS"
3268     echo "        OpenVG libs are: $OPENVG_LIBS"
3269     else
3270       echo "        ERROR: No OpenVG development package installed!" >&3
3271       echo "               You need to install the libmesa development package" >&3
3272       echo "               or .deb users: apt-get install libopenvg1-mesa-dev" >&3
3273       echo "               or .rpm users: yum install mesa-libOpenVG-devel-7.8.1-7.fc13.i686" >&3
3274       echo "               or use a different renderer with --enable-renderer=" >&3
3275   fi
3278 if test x"${build_ogl}" = x"yes"; then
3279   if test x"$OPENGL_LIBS" != x; then
3280     if test x"$OPENGL_CFLAGS" != x; then
3281       echo "        OpenGL flags are: $OPENGL_CFLAGS"
3282     else
3283       echo "        OpenGL flags are: default include path"
3284     fi
3285     echo "        OpenGL libs are: $OPENGL_LIBS"
3286     else
3287       PKG_ERR([No OpenGL development package installed!])
3288       PKG_SUGGEST([You need to install the libmesa development package])
3289       DEB_INSTALL([libgl1-mesa-dev])
3290       RPM_INSTALL([mesa-libGL-devel])
3291       RPM_ALTERNATIVE([xorg-x11-Mesa-libGL])
3292       PKG_ALTERNATIVE([or use a different renderer with --enable-renderer=])
3293   fi
3296 if test x"${build_gles1}" = x"yes"; then
3297   if test x"${has_gles1}" = xyes; then
3298     if test x"${GLES1_CFLAGS}" != x; then
3299       echo "        OpenGLES1 flags are: ${GLES1_CFLAGS}"
3300     else
3301       echo "        OpenGLES1 flags are: default include path"
3302     fi
3303     echo "        OpenGLES1 libs are: ${GLES1_LIBS}"
3304   else
3305       PKG_ERR([No OpenGL-ES development package installed!])
3306       PKG_SUGGEST([You need to install the this from source probably])
3307       PKG_ALTERNATIVE([or use a different renderer with --enable-renderer=])
3308   fi
3311 dnl GLEXT is only needed for GTK/OpenGL
3312 if test x$build_gtk = xyes -a x$build_ogl = xyes ; then
3313   if test x"$GLEXT_LIBS" != x; then
3314     if test x"$GLEXT_CFLAGS" != x; then
3315       echo "        GtkGLExt flags are: $GLEXT_CFLAGS"
3316     else
3317       echo "        GtkGLExt flags are: default include path"
3318     fi
3319       echo "        GtkGLExt libs are: $GLEXT_LIBS"
3320   else
3321     PKG_ERR([No GtkGLExt development package installed!])
3322     PKG_SUGGEST([It is needed to build the GTK/OpenGL GUI/renderer combination.])
3323     PKG_SUGGEST([Install it from http://gtkglext.sourceforge.net])
3324     DEB_INSTALL([libgtkglext1-dev])
3325     RPM_INSTALL([gtkglext-devel])
3326     PKG_ALTERNATIVE([or --enable-gui=sdl or --enable-renderer=agg])
3327   fi
3330 if test x$build_gtk = xyes; then #{
3331   if test x"$GTK2_LIBS" != x; then
3332     if test x"$GTK2_CFLAGS" != x; then
3333       echo "        GTK2 flags are: $GTK2_CFLAGS"
3334     else
3335       echo "        GTK2 flags are: default include path"
3336     fi
3337       echo "        GTK2 libs are: $GTK2_LIBS"
3338   else
3339     PKG_ERR([No GTK2 development package installed!])
3340     PKG_SUGGEST([Install it from http://gtk.org])
3341     DEB_INSTALL([libgtk2.0-dev])
3342     RPM_INSTALL([gtk2-devel])
3343   fi
3345   if test x"$PANGO_LIBS" != x; then
3346     if test x"$PANGO_CFLAGS" != x; then
3347       echo "        Pango flags are: $PANGO_CFLAGS"
3348     else
3349       echo "        Pango flags are: default include path"
3350     fi
3351     echo "        Pango libs are: $PANGO_LIBS"
3352   else
3353     PKG_ERR([No Pango development package installed!])
3354     PKG_SUGGEST([Install it from http://pango.org])
3355     DEB_INSTALL([libpango1.0-dev])
3356     RPM_INSTALL([pango-devel])
3357   fi
3359   if test x"$GLIB_LIBS" != x; then
3360     if test x"$GLIB_CFLAGS" != x; then
3361       echo "        GLib flags are: $GLIB_CFLAGS"
3362     else
3363       echo "        GLib flags are: default include path"
3364     fi
3365     echo "        GLib libs are: $GLIB_LIBS"
3366   else
3367     PKG_ERR([No GLib development package installed!])
3368     PKG_SUGGEST([Install it from http://gtk.org])
3369     DEB_INSTALL([libglib2.0-dev])
3370     RPM_INSTALL([glib2-devel])
3371   fi
3373   if test x"$ATK_LIBS" != x; then
3374     if test x"$ATK_CFLAGS" != x; then
3375       echo "        ATK flags are: $ATK_CFLAGS"
3376     else
3377       echo "        ATK flags are: default include path"
3378     fi
3379       echo "        ATK libs are: $ATK_LIBS"
3380   else
3381     PKG_ERR([No ATK development package installed!])
3382     PKG_SUGGEST([Install it from http://atk.org])
3383     DEB_INSTALL([libatk1.0-dev])
3384     RPM_INSTALL([atk-devel])
3385   fi
3389 if test x"$build_media_gst" = x"yes"; then
3390   if test x"$missing_codecs" != x; then   
3391       echo "        Your Gstreamer installation is missing these codecs: $missing_codecs"
3392       echo "        Please install the gstreamer-ffmpeg for Gstreamer"
3393   fi  
3394   if test x"$GSTREAMER_LIBS" != x; then
3395     if test x"$GSTREAMER_CFLAGS" != x; then
3396       echo "        Gstreamer flags are: $GSTREAMER_CFLAGS"
3397     else
3398       echo "        Gstreamer flags are: default include path"
3399     fi
3400     echo "        Gstreamer libs are: $GSTREAMER_LIBS"
3401   else
3402     PKG_ERR([GST media handling requested but gstreamer-0.10+ not found])
3403     PKG_SUGGEST([Install it from http://www.gstreamer.net])
3404     DEB_INSTALL([libgstreamer0.10-dev])
3405     RPM_INSTALL([gstreamer-devel])
3406     YAST_INSTALL([gstreamer010-devel])
3407   fi
3408   if test x"$has_gstreamer_pbutils" != "xyes"; then
3409     PKG_REC([If the user has not installed the necessary Gstreamer plugins, Gstreamer can pop up a message prompting them to.])
3410     PKG_SUGGEST([Install gstpbutils (>= 0.10.15) from http://www.gstreamer.net for that to be enabled])
3411     DEB_INSTALL([libgstreamer-plugins-base0.10-dev])
3412     PKG_SUGGEST([or .rpm users: simply install the below package]) dnl TODO: Can/should this notice be done cleaner?
3413     PKG_SUGGEST([Also see --with-gstpbutils-incl and --with-gstpbutils-lib])
3414   fi
3415   if test x"$has_gstreamer_plugins_base" = "xno"; then
3416     dnl TODO: Check if this is really a mandatory asset!
3417     PKG_ERR([Base plugins are required for gstreamer media!])
3418     PKG_SUGGEST([Install gstreamer-plugins-base from http://www.gstreamer.net])
3419     DEB_INSTALL([libgstreamer-plugins-base0.10-dev])
3420     RPM_INSTALL([gstreamer-plugins-base-devel])
3421   fi
3424 dnl TODO: figure out some RPM package names.
3425 dnl TODO: The following tests is probably incorrect for any/older/exotic systems! Could someone experienced look at it?
3426 if test x"${build_media_ffmpeg}" = x"yes"; then
3427   if test x"$FFMPEG_LIBS" != x; then
3428     echo "        MP3 and video support enabled through FFmpeg"
3429     if test x"$FFMPEG_CFLAGS" != x; then
3430       echo "        FFmpeg flags are: $FFMPEG_CFLAGS"
3431     else
3432       echo "        FFmpeg flags are: default include path"
3433     fi
3434     echo "        FFmpeg libs are: $FFMPEG_LIBS"
3435   else
3436     PKG_ERR([No FFmpeg development package installed!])
3437     PKG_SUGGEST([You can install FFmpeg from http://ffmpeg.org])
3438     DEB_INSTALL([libavcodec-dev])
3439     RPM_INSTALL([ffmpeg-devel])
3440     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3441   fi
3443   if test x"${avformat_h}" = x; then
3444     PKG_ERR([FFmpeg's avformat header is installed but not libavformat!])
3445     PKG_SUGGEST([You can install FFmpeg from http://ffmpeg.org])
3446     DEB_INSTALL([libavformat-dev])
3447     YAST_INSTALL([libavformat-api]) dnl (but currently installs into /usr/lib64)
3448     PKG_ALTERNATIVE(or explicitly set the path using --with-ffmpeg-incl=)
3449     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3450   fi
3452   if test x"${have_ffmpeg_swscale}" = "xno"; then
3453     PKG_ERR([No libswscale development package installed!])
3454     PKG_SUGGEST([You can install libswscale from http://ffmpeg.org])
3455     DEB_INSTALL([libswscale-dev])
3456     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3457   fi
3460 if test x$build_cairo = xyes; then
3461   if test x"$CAIRO_LIBS" != x; then
3462     if test x"$CAIRO_CFLAGS" != x; then
3463       echo "        Cairo flags are: $CAIRO_CFLAGS"
3464     else
3465       echo "        Cairo flags are: default include path"
3466     fi
3467     echo "        Cairo libs are: $CAIRO_LIBS"
3468   else
3469     PKG_ERR([No Cairo development package installed!])
3470     PKG_SUGGEST([You need to have the Cairo development package installed if you have used --enable-render=cairo to configure.])
3471     PKG_SUGGEST([Install it from http://cairographics.org])
3472     DEB_INSTALL([libcairo-dev])
3473     RPM_INSTALL([cairo-devel])
3474   fi
3477 if test x$build_fltk = xyes; then
3478   if test x"$FLTK2_LIBS" != x; then
3479     if test x"$FLTK2_CFLAGS" != x; then
3480       echo "        FLTK flags are: $FLTK2_CFLAGS"
3481     else
3482       echo "        FLTK flags are: default include path"
3483     fi
3484       echo "        FLTK libs are: $FLTK2_LIBS"
3485   else
3486     PKG_ERR([No FLTK2 development package installed!])
3487     PKG_SUGGEST([Install it from http://fltk.org])
3488     PKG_ALTERNATIVE(or change to a different gui with --enable-gui=...)
3489   fi
3492 if test x$build_fltk = xyes; then
3493   if test x"$XFT_LIBS" != x; then
3494     if test x"$XFT_CFLAGS" != x; then
3495       echo "        Xft flags are: $XFT_CFLAGS"
3496     else
3497       echo "        Xft flags are: default include path"
3498     fi
3499     echo "        Xft libs are: $XFT_LIBS"
3500   fi
3503 # See whether SDL is required
3504 need_sdl=false
3505 test x$build_sdl = xyes                 && need_sdl=true
3506 test x$build_sound_sdl = xyes   && need_sdl=true
3508 if $need_sdl; then
3509   if test x"$SDL_LIBS" != x; then
3510     echo "        SDL flags are: $SDL_CFLAGS"
3511     echo "        SDL libs are: $SDL_LIBS"
3512   else
3513     PKG_ERR([No SDL development package installed!])
3514     PKG_SUGGEST([Install it from http://www.libsdl.org/download-1.2.php])
3515     DEB_INSTALL([libsdl1.2-dev])
3516     RPM_INSTALL([SDL-devel])
3517     PKG_ALTERNATIVE(or change to a different gui with --enable-gui=...)
3518   fi
3520 unset need_sdl
3522 if test x"$nsapi" = x"yes"; then
3523     echo "        Plugin will be installed in ${FIREFOX_PLUGINS}"
3526 if test x"${pthreads}" = x"yes"; then
3527   if test x"$PTHREAD_CFLAGS" != x; then
3528     echo "        POSIX Threads flags are: $PTHREAD_CFLAGS"
3529   fi
3530   if test x"${PTHREAD_LIBS}" != x; then
3531     echo "        POSIX Threads lib is: $PTHREAD_LIBS"
3532   else
3533     if test x"${cross_compiling}" = xno; then
3534       echo "ERROR: No pthread development package installed!" >&3
3535     fi
3536   fi
3539 if test x"${docbook}" = x"yes"; then
3540   if test x"$MAKEINFO" = x; then
3541     PKG_ERR([No makeinfo tools installed!])
3542     PKG_SUGGEST([Install it from http://www.gnu.org/software/texinfo/])
3543     DEB_INSTALL([texinfo])
3544     RPM_INSTALL([texinfo])
3545     RPM_ALTERNATIVE([texinfo-tex])
3546   fi
3547   dnl low-level tools
3548   if test x"$DB2X_TEXIXML" = x -o x"$DB2X_MANXML" = x -o x"$DB2X_XSLTPROC" = x; then
3549     dnl high-level tools
3550     if test x"${DB2X_TEXI}" = x -o x"${DB2X_MAN}" = x; then
3551       PKG_ERR([No DocBook2X tools installed!])
3552       PKG_SUGGEST([Install it from http://docbook2x.sourceforge.net])
3553       dnl TODO: Could someone look at this and confirm the needed software is installed?
3554       dnl FIXME: I removed the texidocbook and docbook-utilsnfo packages as they are not on my system.
3555       DEB_INSTALL([docbook2x docbook-xml docbook-xsl texinfo xsltproc])
3556       PKG_ALTERNATIVE([or configure without --enable-docbook])
3557     fi
3558   else
3559     echo "        You have version $db2x_version of the DocBook2X tools."
3560   fi
3561 else
3562   PKG_WAR([without --enable-docbook we will use the cached documentation files included in the gnash distribution. If you change files in doc/C, you should --enable-docbook.])
3565 if test x"$CURL_LIBS" != x; then
3566   if test x"$CURL_CFLAGS" != x; then
3567     echo "        CURL flags are: $CURL_CFLAGS"
3568   else
3569     echo "        CURL flags are: default include path"
3570   fi
3571     echo "        CURL libs are: $CURL_LIBS"
3572 else
3573   PKG_REC([If you install the CURL library, Gnash will be able to display remote content (streaming from URLs) using CURL.])
3574   PKG_SUGGEST([Install libcurl from http://curl.haxx.se/libcurl])
3575   DEB_INSTALL([libcurl4-gnutls-dev]) dnl TODO: Do we prefer this one? GnuTLS is LGPL'd so it's probably more licensively compatible than OpenSSL?
3576   DEB_ALTERNATIVE([libcurl-dev])
3577   RPM_INSTALL([curl-devel])
3580 if test x"$SPEEX_LIBS" != x; then
3581   if test x"$SPEEX_CFLAGS" != x; then
3582     echo "        Speex flags are: $SPEEX_CFLAGS"
3583   else
3584     echo "        Speex flags are: default include path"
3585   fi
3586     echo "        Speex libs are: $SPEEX_LIBS"
3587 else
3588   PKG_REC([If you install the Speex library, Gnash will be able to decoded Speex encoded audio in FLV files.])
3589   PKG_SUGGEST([Install libspeex from http://speex.org])
3590   DEB_INSTALL([libspeex-dev])
3591   RPM_INSTALL([speex-devel])
3594 if test x"$SPEEXDSP_LIBS" != x; then
3595   if test x"$SPEEXDSP_CFLAGS" != x; then
3596     echo "        Speex DSP flags are: $SPEEXDSP_CFLAGS"
3597   else
3598     echo "        Speex DSP flags are: default include path"
3599   fi
3600     echo "        Speex DSP libs are: $SPEEXDSP_LIBS"
3601 else
3602   PKG_REC([If you install the Speex DSP library, Gnash will be able to resample Speex encoded audio in FLV files.])
3603   PKG_SUGGEST([Install libspeexdsp from http://speex.org])
3604   DEB_INSTALL([libspeexdsp-dev])
3605   RPM_INSTALL([speex-devel])
3608 if test x"$ext_dbus" = xyes; then
3609   if test x"$DBUS_LIBS" != x; then
3610     if test x"$DBUS_CFLAGS" != x; then
3611       echo "        DBUS flags are: $DBUS_CFLAGS"
3612     else
3613       echo "        DBUS flags are: default include path"
3614     fi
3615       echo "        DBUS libs are: $DBUS_LIBS"
3616   else
3617     PKG_WAR([No DBUS development package was found! Gnash will be built without support for remote controls.])
3618     PKG_SUGGEST([Install libdbus from http://www.dbus.org])
3619     DEB_INSTALL([dbus-dev])
3620     DEB_ALTERNATIVE([libdbus-1-dev])
3621     RPM_INSTALL([dbus-devel])
3622   fi
3625 if test x$build_agg = xyes; then # {
3626   echo "        AGG Pixel format is: $pixelformat"
3627   if test x"$AGG_LIBS" != x -a x"${agg25}" == xyes; then # {
3628     if test x"$AGG_CFLAGS" != x; then # {
3629       echo "        AGG flags are: $AGG_CFLAGS"
3630     else # }{
3631       echo "        AGG flags are: default include path"
3632     fi # }
3633     echo "        AGG libs are: $AGG_LIBS"
3634   else # }{
3635     if test x"$AGG_LIBS" != x -a x"${agg25}" != xyes; then
3636       PKG_ERR([Your installation of AGG appears to be version 2.4 or older. Please upgrade to AGG 2.5 or greater.])
3637     else
3638       PKG_ERR([No AGG development package installed!])
3639     fi
3640     PKG_SUGGEST([Install it from http://www.antigrain.com])
3641     DEB_INSTALL([libagg-dev])
3642     RPM_INSTALL([agg-devel])
3643   fi # }
3644 fi # }
3646 dnl TODO: This package is handled a bit stupidly in regard to the package
3647 dnl suggestion system. It would be better to check for each package
3648 dnl separately, instead of passing the missing ones in variables..
3649 if test x"$BOOST_LIBS" != x; then
3650   echo "        BOOST flags are: $BOOST_CFLAGS"
3651   echo "        BOOST libs are: $BOOST_LIBS"
3652   echo "        BOOST libs for cygnal are: $BOOST_CYGNAL_LIBS"
3654   if test x"${missing_headers}" != x; then
3655     for i in ${missing_headers}; do
3656       PKG_ERR([The Boost $i header is not installed])
3657       PKG_SUGGEST([Install it from http://www.boost.org])
3658     done
3659   fi
3661   if test x"${cygnal}" = x"yes"; then
3662     if test x"${cygnal_missing_libs}" != x; then
3663       for i in ${cygnal_missing_libs}; do
3664         PKG_ERR([No Boost $i package installed])
3665         PKG_SUGGEST([Install it from http://www.boost.org])
3666         debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
3667         DEB_INSTALL([$debtmppkg])
3668         PKG_ALTERNATIVE([or configure with --disable-cygnal])
3669       done
3670     fi
3671   fi
3673   if test x"${missing_libs}" != x; then
3674     for i in ${missing_libs}; do
3675       PKG_ERR([No Boost $i package installed])
3676       PKG_SUGGEST([Install it from http://www.boost.org])
3677       debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
3678       DEB_INSTALL([$debtmppkg])
3679     done
3680   fi
3681 else
3682   PKG_ERR([No Boost development package installed])
3683   PKG_SUGGEST([Install it from http://www.boost.org])
3684   dnl I am not sure that libboost-program-options-dev should be passed here, but
3685   dnl it seems like the cleanest way to get it.
3686   if test x"$cygnal" = xyes; then
3687     DEB_INSTALL([libboost-dev libboost-thread-dev libboost-program-options-dev libboost-date-time-dev])
3688   else
3689     DEB_INSTALL([libboost-dev libboost-thread-dev libboost-program-options-dev])
3690   fi
3691   RPM_INSTALL([boost-devel])
3694 dnl don't look for the flash compilers when cross compiling.
3695 if test x"$testsuite" = x"yes"; then
3696   if test x$cross_compiling = xno; then
3697     if test x"$MING_LIBS" != x; then
3698       echo "        MING flags are $MING_CFLAGS"
3699       echo "        MING libs are $MING_LIBS"
3700     else
3701       PKG_WAR([You need to have the Ming development package installed to run most of the tests in Gnash testsuite.])
3702       PKG_SUGGEST([Install it from http://www.libming.org/])
3703       DEB_INSTALL([libming-dev])
3704       RPM_INSTALL([libming-devel])
3705     fi
3707     if test x"$MAKESWF" != x; then
3708       echo "        MING version code is $MING_VERSION_CODE"
3709       echo "        MAKESWF is $MAKESWF"
3710     else
3711       PKG_WAR([You need to have the Ming utilities package version 0.4 or higher installed to run many of the tests in Gnash testsuite.])
3712       PKG_SUGGEST([Install it from http://www.libming.org/])
3713       DEB_INSTALL([libming-util])
3714       RPM_INSTALL([ming-util])
3715       RPM_ALTERNATIVE([ming-utils])
3716     fi
3718     if test x"$MAKESWF" != x && test $MING_VERSION_CODE -lt 00040006; then
3719       echo "        WARNING: You have an older version of Ming installed and will not" >&4
3720       echo "                 be able to run all of the tests in Gnash testsuite." >&4
3721       echo "                 Install the latest version from http://www.libming.org" >&4
3722     fi
3724     if test x"$SWFDEC_TESTSUITE" != x; then
3725       echo "        SWFDEC testsuite dir is $SWFDEC_TESTSUITE"
3726     fi
3728     if test x"$MTASC" != x; then
3729       echo "        MTASC is $MTASC"
3730       echo "        MTASC CLASSPATH is $MTASC_CLASSPATH"
3731     else
3732       PKG_WAR([You need to have the MTASC compiler packages installed to run some of the tests in Gnash testsuite.])
3733       PKG_SUGGEST([Install it from http://mtasc.org])
3734       DEB_INSTALL([mtasc])
3735       RPM_INSTALL([mtasc])
3736     fi
3738     if test x"$HAXE" != x; then
3739       echo "        HAXE is $HAXE"
3740       echo "        HAXE CLASSPATH is $HAXE_CLASSPATH"
3741     else
3742       PKG_WAR([You need to have the HAXE compiler package version 2.00 or higher installed to run some of the tests in Gnash testsuite.])
3743       PKG_SUGGEST([Install it from http://haxe.org])
3744       DEB_INSTALL([haxe])
3745       RPM_INSTALL([haxe])
3746     fi
3748     if test x"$SWFMILL" != x; then
3749       echo "        SWFMILL is $SWFMILL"
3750       if test x"$ENABLE_AVM2" != x -a "$SWFMILL_VERSION" -lt 00021206; then
3751         PKG_WAR([You are building Gnash with AVM2 support but your swfmill version is too old to run AS3 tests.])
3752       fi
3753     else
3754       PKG_WAR([You need to have the swfmill tool installed to run some of the tests in Gnash testsuite.])
3755       PKG_SUGGEST([Install it from http://swfmill.org])
3756       DEB_INSTALL([swfmill])
3757       RPM_INSTALL([swfmill])
3758     fi
3760     if test x"$SWFC" != x; then
3761       echo "        SWFC is $SWFC"
3762     else
3763       PKG_WAR([You need to have swfc from SWFTools installed to run some of the tests in Gnash testsuite.])
3764       PKG_SUGGEST([Install it from http://swftools.org])
3765       DEB_INSTALL([swftools])
3766       RPM_INSTALL([swftools])
3767     fi
3769     if test x"$AS3COMPILE" != x; then
3770       echo "        AS3COMPILE is $AS3COMPILE"
3771     else
3772       PKG_WAR([You need to have as3compile from SWFTools installed to run some of the tests in Gnash testsuite.])
3773       PKG_SUGGEST([Install it from http://swftools.org])
3774     fi
3776     if test x"$HTTP_TESTSUITE" != x; then
3777       echo "        HTTP testsuite dir is $HTTP_TESTSUITE"
3778     fi
3780     if test x"$RED5_HOST" != x; then
3781       echo "        RED5 testing host is $RED5_HOST"
3782     fi
3783   fi
3786   if test x"$PERL" != x; then
3787     echo "        PERL is $PERL"
3788   else
3789     PKG_WAR([You need to have perl installed to run some of the tests in Gnash testsuite.])
3790     PKG_SUGGEST([Install it from http://perl.org])
3791     DEB_INSTALL([perl])
3792     RPM_INSTALL([perl])
3793   fi
3795 if test x"$testsuite" = x"yes"; then
3796   if test x"$CSOUND" != x; then
3797     echo "        CSOUND is $CSOUND"
3798   else
3799     echo "        WARNING: You need to have csound installed" >&4
3800     echo "                 to have real fun." >&4
3801     echo "                 Install it from http://www.csounds.com/" >&4
3802     echo "                 or .deb users: apt-get install csound" >&4
3803     echo "                 or .rpm users: yum install csound" >&4
3804   fi
3807 if test x"$Z_LIBS" != x; then
3808   if test x"$Z_CFLAGS" != x; then
3809     echo "        Z flags are: $Z_CFLAGS"
3810   else
3811     echo "        Z flags are: default include path"
3812   fi
3813   echo "        Z libs are: $Z_LIBS"
3814 else
3815   PKG_REC([You need to have the zlib development packages installed to play compressed SWF (most of them from version 6 up) and to display some kinds of JPEG files.])
3816   PKG_SUGGEST([Install it from http://zlib.net])
3817   DEB_INSTALL([zlib1g-dev])
3818   RPM_INSTALL([zlib-devel])
3819   PKG_ALTERNATIVE([It may still be possible to configure without zlib.])
3822 if test x"$FREETYPE2_LIBS" != x; then
3823   if test x"$FREETYPE2_CFLAGS" != x; then
3824     echo "        FreeType flags are: $FREETYPE2_CFLAGS"
3825   else
3826     echo "        FreeType flags are: default include path"
3827   fi
3828   echo "        FreeType libs are: $FREETYPE2_LIBS"
3829 else
3830   PKG_REC([You need to have the freetype development packages installed to use device fonts.])
3831   PKG_SUGGEST([Install it from http://freetype.org])
3832   DEB_INSTALL([libfreetype6-dev])
3833   RPM_INSTALL([freetype-devel])
3834   PKG_ALTERNATIVE([It may still be possible to configure without freetype.])
3837 if test x"$FONTCONFIG_LIBS" != x; then
3838   if test x"$FONTCONFIG_CFLAGS" != x; then
3839     echo "        Fontconfig flags are: $FONTCONFIG_CFLAGS"
3840   else
3841     echo "        Fontconfig flags are: default include path"
3842   fi
3843   echo "        Fontconfig libs are: $FONTCONFIG_LIBS"
3844 else
3845   PKG_REC([You need to have the fontconfig development packages installed to use device fonts.])
3846   PKG_SUGGEST([Install it from http://fontconfig.org])
3847   DEB_INSTALL([libfontconfig1-dev])
3848   RPM_INSTALL([fontconfig-devel])
3849   PKG_ALTERNATIVE([It may still be possible to configure without fontconfig.])
3852 if test x$ext_mysql = xyes; then
3853   if test x$mysql != xno; then
3854     if test x"$MYSQL_LIBS" != x; then
3855       echo "        MYSQL flags are: $MYSQL_CFLAGS"
3856       echo "        MYSQL libs are: $MYSQL_LIBS"
3857     else
3858       PKG_ERR([No MySQL development package is installed.])
3859       PKG_SUGGEST([Install it from http://mysql.org])
3860       DEB_INSTALL([libmysqlclient-dev])
3861       RPM_INSTALL([mysql-devel])
3862       PKG_ALTERNATIVE([or reconfigure without --enable-extensions=mysql])
3863     fi
3864   fi
3867 if test "$GMSGFMT" = ":"; then
3868   PKG_WAR([You need the gettext package installed to use translations. Required for building a package or 'make distcheck'])
3869   PKG_SUGGEST([Install it from http://www.gnu.org/software/gettext/])
3870   DEB_INSTALL([gettext])
3871   RPM_INSTALL([gettext])
3874 if test x"${build_vaapi}" = x"yes"; then
3875   if test x"${LIBVA_CFLAGS}" = xyes; then
3876       echo "        LIBVA flags are: default"
3877     else
3878       echo "        LIBVA flags are: $LIBVA_CFLAGS"
3879       echo "        LIBVA libraries are: $LIBVA_LIBS"
3880   fi
3881   if test x$use_libva_x11 = xyes; then
3882     if test x"${LIBVA_X11_CFLAGS}" = xyes; then
3883       echo "        LIBVA X11 flags are: default"
3884     else
3885       echo "        LIBVA X11 flags are: $LIBVA_X11_CFLAGS"
3886       echo "        LIBVA X11 libraries are: $LIBVA_X11_LIBS"
3887     fi
3888   fi
3889   if test x$use_libva_glx = xyes; then
3890     if test x"${LIBVA_GLX_CFLAGS}" = xyes; then
3891       echo "        LIBVA GLXflags are: default"
3892     else
3893       echo "        LIBVA GLX flags are: $LIBVA_GLX_CFLAGS"
3894     fi
3895     echo "        LIBVA GLX libraries are: $LIBVA_GLX_LIBS"
3896   fi
3899 if test x"$ac_cv_gcc_visibility" != xyes; then
3900   if test x"$npapi" = xyes; then
3901     PKG_WAR([NPAPI (mozilla) plugin is enabled, but your compiler does not support symbol visibility. This may cause the plugin to malfunction and may result in small children being eaten. You have been warned!])
3902   fi
3905 if test x"$npapi" = xyes; then
3906   if test x"$has_npapi" = xyes; then
3907     echo "        NPAPI flags are: $NPAPI_CFLAGS"
3908   else
3909     PKG_ERR([No xulrunner development package is installed!])
3910     PKG_SUGGEST([Install it from http://releases.mozilla.org/pub/mozilla.org/xulrunner])
3911     DEB_INSTALL([xulrunner-dev])
3912     RPM_INSTALL([xulrunner-devel])
3913   fi
3914 else
3915   echo "        NPAPI plugin is disabled"
3918 if test x"${DEJAGNU}" != x""; then
3919   echo "        DEJAGNU's runtest is $DEJAGNU"
3920 else
3921   PKG_WAR([You need the dejagnu package installed to get a summary after running 'make check'.])
3922   PKG_SUGGEST([Install it from http://www.gnu.org/software/dejagnu/])
3923   DEB_INSTALL([dejagnu])
3924   RPM_INSTALL([dejagnu])
3927 dnl Haiku
3928 if test x"${build_haiku}" = xyes -o x"${build_sound_mkit}" = xyes -o x"${build_media_haiku}" = x"yes"; then
3929     echo "        Haiku libs are: $HAIKU_LIBS"
3932 if test x"$has_ltdl" = x"yes";then
3933   echo "        LIBLTDL flags are: $LTDL_CFLAGS"
3934   echo "        LIBLTDL libs are: $LTDL_LIBS"
3935 else
3936   if test x"${extensions_support}" != xno; then
3937     PKG_ERR([No libltdl development package is installed, yet --disable-extensions was not specified.])
3938     PKG_SUGGEST([Install it from ftp://ftp.gnu.org/gnu/libtool/])
3939     DEB_INSTALL([libltdl-dev])
3940     RPM_INSTALL([libtool-ltdl-devel])
3941   fi
3944 if test x"$python" = x"yes"; then
3945   if test x"$has_python" = x"yes"; then
3946     echo "        PYTHON flags are: $PYTHON_CFLAGS"
3947     echo "        PYTHON libs are: $PYTHON_LIBS"
3948     echo "        PYTHON executable is: $PYTHON"
3949   else
3950     PKG_ERR([No Python development package is installed, but it's enabled.])
3951   fi
3953 if test x${build_ssl} = xyes; then
3954   if test x"${has_ssl}" = xyes; then
3955     if test x"${SSL_CFLAGS}" = xyes; then
3956       echo "        SSL flags are: default"
3957     else
3958       echo "        SSL flags are: $SSL_CFLAGS"
3959     fi
3960     echo "        SSL libs are: $SSL_LIBS"
3961   else
3962     PKG_ERR([No SSL development package is installed, but it's enabled."])
3963   fi
3966 if test x${build_ssh} = xyes; then
3967   if test x"${has_ssh}" = xyes; then
3968     if test x"${SSH_CFLAGS}" = xyes; then
3969       echo "        SSH flags are: default"
3970     else
3971       echo "        SSH flags are: $SSH_CFLAGS"
3972     fi
3973     echo "        SSH libs are: $SSH_LIBS"
3974   else
3975     PKG_ERR([No SSH development package is installed, but it's enabled."])
3976   fi
3979 if test x"${build_all_as3}" = x"yes"; then
3980   echo "        Building the entire ActionScript class libary"
3981 else
3982   echo "        Only building these ActionScript classes into the library:"
3983   echo "     ${classlist}"
3986 if test x"$testsuite" = x"yes"; then
3987   if test x"$NETCAT" != x; then
3988     echo "        You have netcat installed, which is only used for testing"
3989   else
3990     echo "        Install netcat for networking test support"
3991   fi
3992   if test x"$WGET" != x; then
3993     echo "        You have wget installed, which is only used for testing"
3994   else
3995     echo "        Install wget for networking test support"
3996   fi
3999 if test x$cross_compiling = xyes; then
4000    if test x"${android_ndk}" != xno; then
4001       AC_MSG_NOTICE([This build is setup for cross compiling for Android])
4002    else
4003       AC_MSG_NOTICE([This build is setup for cross compiling])
4004    fi
4007 echo "--------"
4009 if test x"${cygnal}" = x"yes"; then
4010   echo "        Building Cygnal media server enabled (default). Use --disable-cygnal to disable."
4011 else
4012   echo "        Building Cygnal media server disabled."
4015 if test x"${with_top_level}" != x; then
4016   echo "        Top level for cross compiling support files is: $with_top_level"
4019 if test x"${build_gtk}" = xyes -a x"${pixelformat}" = xrgb565; then
4020   echo "        WARNING: Pixel format RGB565 selected in combination with the" >&4
4021   echo "                 GTK GUI. Only a hacked GTK will work (e.g. on the OLPC)." >&4
4024 if test x"${extensions_list}" != x; then
4025   echo "        Building extensions: ${extensions_list}"
4028 if test x"${extensions_support}" = xno; then
4029   echo "        Extension support disabled."
4032 if test x"${security_list}" != x; then
4033   echo "        Enabling security features: ${security_list}"
4036 if test x"${statistics_list}" != x; then
4037   echo "        Enabling statistics collecting for: ${statistics_list}"
4040 if test x"${SUPPORTED_GUIS}" = x; then
4041   AC_MSG_ERROR(no supported GUIs found);
4044 echo "        GUI toolkits supported: ${SUPPORTED_GUIS}"
4045 echo "        Renderers supported: ${renderer_list}"
4046 echo "        Hardware Acceleration: ${device_list}"
4047 echo "        Media handlers: ${media_list}"
4048 echo "        Using ${add_sound} for sound handling"
4050 if test x"$docbook" = x"yes"; then
4051   echo '        DocBook document processing enabled (for "make html" and "make pdf")'
4052   if test x"$docbook_styles" != x; then
4053     echo "        Docbook styles sheets in $docbook_styles"
4054   fi
4055 else
4056   echo "        DocBook document processing disabled (default)"
4059 dnl The Framebuffer GUI has several other settings. As it doesn't have X11,
4060 dnl we have to handle input devics ourselves.
4061 if test x"${build_fb}" = xyes; then
4062 echo "        Using ${input_events} for Input"
4063   if test x"${fakefb}" != x; then
4064     echo "        Using shared memory as a fake framebuffer"
4065   fi
4066   if test x"${offscreen}" = xyes; then
4067     echo "        Using offscreen rendering"
4068   fi
4069   if test x"${doublebuf}" = xyes; then
4070     echo "        Using double buffering when rendering"
4071   fi
4074 if test -s $cwarn; then
4075   echo ""
4076   cat $cwarn
4077   rm $cwarn
4078   echo ""
4079   echo "Gnash should still compile even with these warnings."
4080   echo "If it doesn't, report the warnings as a bug."
4081 else
4082   rm $cwarn
4085 if test -s $crec; then
4086   echo ""
4087   cat $crec
4088   rm $crec
4089   echo ""
4090   echo "Gnash should still compile, but you'll miss important support"
4091 else
4092   rm $crec
4095 if test -s $cerr; then
4096   echo ""
4097   cat $cerr >&2
4100 deb_err="`cat $deb_err`"
4101 deb_war="`cat $deb_war`"
4102 deb_rec="`cat $deb_rec`"
4103 rpm_err="`cat $rpm_err`"
4104 rpm_war="`cat $rpm_war`"
4105 rpm_rec="`cat $rpm_rec`"
4106 yast_err="`cat $yast_err`"
4107 yast_war="`cat $yast_war`"
4108 yast_rec="`cat $yast_rec`"
4110 # Pipe stderr to /dev/null since Fedora complains when target isn't there.
4111 if test x`which apt-get 2>/dev/null` != x; then
4112   if test x"$deb_err" != x -o x"$deb_war" != x -o x"$deb_rec" != x; then
4113     echo "#!/bin/sh" > deb-attempt-install-dependencies.sh
4114     echo "packages=\"$deb_err $deb_war $deb_rec\"" >> deb-attempt-install-dependencies.sh
4115     echo "PKGCOMMAND=\"apt-get install -y -q\"" >> deb-attempt-install-dependencies.sh
4116     cat ${srcdir}/base-attempter.sh >> deb-attempt-install-dependencies.sh
4117     chmod +x deb-attempt-install-dependencies.sh
4118     echo ""
4119     echo ".deb users might be able to install most dependencies by executing:"
4120     echo "sudo ./deb-attempt-install-dependencies.sh"
4121   fi
4124 if test x`which yum 2>/dev/null` != x; then
4125   if test x"$rpm_err" != x -o x"$rpm_war" != x -o x"$deb_rec" != x; then
4126     echo "#!/bin/sh" > rpm-attempt-install-dependencies.sh
4127     echo "packages=\"$rpm_err $rpm_war  $rpm_rec\"" >> rpm-attempt-install-dependencies.sh
4128     echo "PKGCOMMAND=\"yum install -y \""    >> rpm-attempt-install-dependencies.sh
4129     cat ${srcdir}/base-attempter.sh >> rpm-attempt-install-dependencies.sh
4130     chmod +x rpm-attempt-install-dependencies.sh
4131     echo ""
4132     echo ".rpm users might be able to install most dependencies by executing:"
4133     echo "sudo ./rpm-attempt-install-dependencies.sh"
4134   fi
4137 dnl TODO: Add support for yast here, which AFAIK is used on OpenSuse.
4139 dnl If anything critical is missing, don't bother to continue
4140 if test -s $cerr; then
4141   echo ""
4142   rm $cerr
4143   AC_MSG_ERROR([Please install required packages])
4144 else
4145   rm $cerr
4148 rm -rf $tmp
4150 if test x"$fork" = x"no"; then
4151   echo ""
4152   AC_MSG_ERROR([Currently only forking the standalone player works!])
4154 echo ""
4156 # Local Variables:
4157 # c-basic-offset: 2
4158 # tab-width: 2
4159 # indent-tabs-mode: nil
4160 # End: