print messages cleaned up for translations
[gnash.git] / configure.ac
blobda922d5990de03ef8a2a835abdc52fdd3d7860a1
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 incllist="`eval cat ${srcdir}/macros/incllist`"
507   libslist="`cat ${srcdir}/macros/libslist`"
508   if test -f /usr/bin/dpkg-architecture; then
509     export DEB_HOST_MULTIARCH="`eval dpkg-architecture -qDEB_HOST_MULTIARCH`"
510     export libslist="${libslist} /lib/${DEB_HOST_MULTIARCH} /usr/lib/${DEB_HOST_MULTIARCH}"
511   fi
512   export pathlist=$PATH
515 if test x"${android_ndk}" != xno; then
516    incllist="${android_ndk}/include ${incllist}"
519 AM_CONDITIONAL(CROSS_COMPILING, [ test x$cross_compiling = xyes ])
521 for dir in ${incllist}; do
522   test -d ${dir} && pruned_incllist="${pruned_incllist} ${dir}";
523 done
525 for dir in ${libslist}; do
526   test -d ${dir} && pruned_libslist="${pruned_libslist} ${dir}";
527 done
529 libslist="${pruned_libslist}";
530 incllist="${pruned_incllist}";
532 dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
533 dnl !! 
534 dnl !! IMPORTANT NOTICE 
535 dnl !!
536 dnl !!  Any call to GNASH_PATH_XXX must be be given *after* this snippet.
537 dnl !!  This is to ensure that PKG_CONFIG, cross_compiling and incllist are
538 dnl !!  properly set at the time of call.
539 dnl !!
540 dnl !!  Also GNASH_PKG_FIND has to be called later. Not sure
541 dnl !!  why but calling before breaks detection of CPP (see
542 dnl !!  gnash-dev mailing archives for June 12 2009
543 dnl !!  http://lists.gnu.org/archive/html/gnash-dev/2009-06/index.html
544 dnl !! 
545 dnl !! 
546 dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
548 dnl Check for PKG_CONFIG before any GNASH_PATH call
549 PKG_PROG_PKG_CONFIG
551 dnl --------------------------------------------------------
552 dnl  GUI selection
553 dnl --------------------------------------------------------
555 build_haiku=no
556 build_aos4=no      dnl AmigaOS4 GUI
557 build_kde3=no      dnl WARNING: doesn't work (see https://savannah.gnu.org/bugs/index.php?31782)
558 build_qt4=no
559 build_qtopia3=no
560 build_qtopia4=no
561 build_gtk=no
562 build_fb=no                     dnl Raw framebuffer
563 build_fltk=no
564 build_sdl=no
565 build_aqua=no                   dnl Native MacOSX
566 build_dump=no
567 AC_ARG_ENABLE(gui,
568   AC_HELP_STRING([--enable-gui=], [Enable support for the specified GUI toolkits (default=gtk,qt4)]),
569   [if test -n ${enableval}; then
570     enableval=`echo ${enableval} | tr '\054' ' ' `
571   fi
572   while test -n "${enableval}" ; do
573     val=`echo ${enableval} | cut -d ' ' -f 1`
574     case "${val}" in
575       gtk|GTK|gtk2|GTK2)
576         build_gtk=yes
577         ;;
578       kde3|KDE3)
579         build_kde3=yes
580         ;;
581       qt4|QT4|kde4|KDE4)
582         build_qt4=yes
583         ;;
584       qtopia3|QTOPIA3)
585         build_qtopia3=yes
586         ;;
587       qtopia4|QTOPIA4)
588         build_qtopia4=yes
589         ;;
590       sdl|SDL)
591         build_sdl=yes
592         ;;
593       aqua|AQUA|Aqua)
594         build_aqua=yes
595         ;;
596       fltk|FLTK|fltk2|FLTK2)
597         build_fltk=yes
598         ;;
599       fb|FB)
600         build_fb=yes
601         ;;
602       aos4|AOS4)
603         build_aos4=yes
604         ;;
605       haiku|HAIKU)
606         build_haiku=yes
607         ;;
608       dump|DUMP)
609         build_dump=yes
610         ;;
611       all|ALL)
612         build_dump=yes
613         dnl BSD doesn't have a framebuffer interface
614         if test x${linux} = xyes; then
615           build_fb=yes
616         fi
617         if test x${openbsd} != xyes; then
618           build_qt4=yes
619         fi
620         build_sdl=yes
621         build_gtk=yes
622         ;;
623       *) AC_MSG_ERROR([invalid gui ${enableval} given (accept: gtk|kde3|qt4|fltk|sdl|aqua|fb|qtopia3|qtopia4|dump|aos4|haiku)])
624          ;;
625       esac
626     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
627     if test "x$val" = "x$enableval"; then
628       break;
629     fi
630   done],
631   [ dnl Run the following code if no --enable-gui is given
632   build_fb=auto
633   build_sdl=auto
634   if test x"${openbsd}" = xyes; then
635     build_gtk=yes
636     build_dump=auto
637   else if test x"${haiku}" = xyes; then
638     build_haiku=yes;
639   else
640     build_qt4=auto
641     build_gtk=yes
642     build_dump=auto
643   fi
644   fi
645   ]
648 if test x"${build_haiku}" = xyes; then
649   if test x"$haiku" != xyes; then
650     echo "        ERROR: Can not build Haiku gui outside of Haiku
651 operating system." >&3
652   fi
655 dnl We can use Xephyr or fbe to create a fake framebuffer instead of real
656 dnl video memory. This lets us test on a desktop machine.
657 AC_ARG_WITH(fakefb,
658 AC_HELP_STRING([--with-fakefb],
659  [specify a file to be mapped instead of a real framebuffer]),
660  with_fakefb=${withval})
662 fakefb=
663 if test x"${with_fakefb}" = xyes; then
664   dnl This is the default file name fbe uses.
665   fakefb=/tmp/fbe_buffer
666 else
667   if test x"${with_fakefb}" != x; then
668     fakefb=${with_fakefb}
669   fi
671 FAKEFB=${fakefb}
672 AC_SUBST(FAKEFB)
674 if test x"${fakefb}" != x; then
675     AC_DEFINE(ENABLE_FAKE_FRAMEBUFFER, [1], [Enable using a file instead of a real framebuffer])
678 dnl This enable a small handful of tests that aren't designed to be
679 dnl run as part of "make check", as they are either incomplete, or
680 dnl can only be run interactively. These are all primarily oriented
681 dnl towards code development and debugging, instead of regression
682 dnl or unit testing.
683 AC_ARG_ENABLE(devtests, AC_HELP_STRING([--enable-devtests],
684   [Developer only tests, not to be included in make check]),
685 [case "${enableval}" in
686   yes) devtests=yes ;;
687   no)  devtests=no ;;
688   *)   AC_MSG_ERROR([bad value ${enableval} for enable-devtests option]) ;;
689 esac], devtests=no)
690 AM_CONDITIONAL(ENABLE_DEVELOPER_TESTS, [test x${devtests} = xyes])
692 dnl --------------------------------------------------------
693 dnl  Sound handler selection
694 dnl --------------------------------------------------------
695 add_sound=
696 build_sound_none=no
697 build_sound_sdl=no
698 build_sound_ahi=no
699 build_sound_mkit=no
700 AC_ARG_ENABLE(sound,
701   AC_HELP_STRING([--enable-sound=[[sdl|ahi|mkit]]], [Use the specified sound handler (default=sdl)]),
702      [case "${enableval}" in
703       sdl|SDL|Sdl)
704         build_sound_sdl=yes
705         add_sound="sdl"
706         ;;
707       none|NONE|None)
708         build_sound_none=yes
709         add_sound="none"
710         ;;
711       ahi|AHI|Ahi)
712         build_sound_ahi=yes
713         add_sound="ahi"
714         ;;
715       mkit|MKIT|Mkit)
716         build_sound_mkit=yes
717         add_sound="mkit"
718         ;;
719      esac],
720   [if test x"${haiku}" = xyes; then
721      build_sound_mkit=yes
722      add_sound="mkit"
723    else
724      if test x${build_sound_none} = xno; then
725        build_sound_sdl=yes
726        add_sound=sdl
727      fi
728    fi]
731 dnl --------------------------------------------------------
732 dnl  Media handler selection
733 dnl --------------------------------------------------------
734 build_media_gst=no
735 build_media_ffmpeg=auto
736 build_media_none=no
737 AC_ARG_ENABLE(media,
738   AC_HELP_STRING([--enable-media=handler],
739     [Enable media handling support using the specified handler: gst, ffmpeg or none (no sound) [[gst]] ]),
740   
741     if test -n ${enableval}; then
742       enableval=`echo ${enableval} | tr '\054' ' ' `
743     fi
744     dnl When --enable-media is given, all media defaults to off
745     dnl except the explicitly enabled ones
746     build_media_ffmpeg=no
747     build_media_gst=no
748     while test -n "${enableval}"; do
749       val=`echo ${enableval} | cut -d ' ' -f 1`
750       [case "${val}" in
751         GST|gst)
752           build_media_gst=yes
753           media_list="${media_list}gst "
754           ;;
755         FFMPEG|ffmpeg)
756           build_media_ffmpeg=yes
757           media_list="${media_list}ffmpeg "
758           ;;
759         no|NO|none)
760           build_media_none=yes
761           media_list="none"
762           ;;
763         *)
764           AC_MSG_ERROR([bad value ${enableval} for --enable-media option])
765           ;;
766      
767       esac]
768       enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
769       if test "x$val" = "x$enableval"; then
770         break;
771       fi
772     done,
773     [if test x"${build_haiku}" = xyes; then
774         build_media_ffmpeg=yes
775         build_media_haiku=yes
776         media_list="ffmpeg haiku"
777      else
778         build_media_gst=yes
779         media_list="gst"
780     fi]
783 dnl If no render is selected, and media handling isn't disabled, them enable gst
784 if test x${build_media_none} = xno -a x${build_media_gst} = xno -a x${build_media_ffmpeg} = xno; then
785   build_media_gst=yes
788 if test x"$build_media_ffmpeg" != x"no"; then # yes or auto
789   GNASH_PATH_FFMPEG
790   if test x"${build_media_ffmpeg}" = xauto; then
791     dnl TODO: have GNASH_PATH_FFMPEG set ${has_ffmpeg}
792     if test x"$FFMPEG_LIBS" != x; then
793       build_media_ffmpeg=yes
794       media_list="${media_list} ffmpeg"
795     else
796       build_ogl=no
797     fi
798   fi
801 MEDIA_CONFIG="${media_list}"
802 AC_SUBST(MEDIA_CONFIG)
804 dnl Multiple input devices are supported. These can all work in
805 dnl varying combinations, so several may be listed. These are only
806 dnl required when using the Framebuffer, as without the X11 desktop,
807 dnl Gnash has to handle all these internally. This can get
808 dnl messy, as one might want to use a touchscreen with a normal mouse
809 dnl or keyboard attached. 
810 dnl By default, don't build any of these, as they are only for the 
811 dnl Framebuffer running without X11.
812 if test x"${build_fb}" = xyes -a x"${linux}" = xyes; then
813   build_ps2mouse=no
814   build_ps2keyboard=yes
815   build_input_events=yes
816   build_tslib=yes
817   input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via Tslib"
818 else
819   build_ps2mouse=no
820   build_ps2keyboard=no
821   build_input_events=no
822   build_tslib=no
823   input_events=
825 AC_ARG_ENABLE(input,
826   AC_HELP_STRING([--enable-input], [Enable support for the specified input devices for the framebuffer GUI (default=ps2mouse|ps2keyboard|events|touchscreen)]),
827   [if test -n ${enableval}; then
828     enableval=`echo ${enableval} | tr '\054' ' ' `
829   fi
830   build_ps2mouse=no
831   build_ps2keyboard=no
832   build_input_events=no
833   build_tslib=no
834   while test -n "${enableval}" ; do
835     val=`echo ${enableval} | cut -d ' ' -f 1`
836     case "${val}" in
837       ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
838         build_ps2mouse=yes
839         input_events="${input_events}, PS/2 Mouse"
840         ;;
841       ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
842         build_ps2keyboard=yes
843         input_events="${input_events}, PS/2 Keyboard"
844         ;;
845       i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
846         input_events="${input_events}, Input Event Device"
847         build_input_events=yes
848         ;;
849       t*|T*) dnl use a touchscreen with tslib, which works like a mouse
850         build_tslib=yes
851         input_events="${input_events}, Touchscreen"
852         ;;
853       a*) dnl all
854         build_ps2mouse=yes
855         build_ps2keyboard=yes
856         build_tslib=yes
857         if test x"${linux}" = xyes; then
858           build_input_events=yes
859           input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via Tslib"                
860         else
861           build_input_events=no
862           input_events="PS/2 Mouse, PS/2 Keyboard, Touchscreen via Tslib"                
863         fi
864         ;;
865       *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: ps2mouse|keyboard|events,touchscreen)])
866          ;;
867       esac
868     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
869     if test "x$val" = "x$enableval"; then
870       break;
871     fi
872   done],
875 if test x$build_sdl != xno -o x$build_sound_sdl = xyes; then
876   GNASH_PATH_SDL
878 AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} = xyes])
881 dnl -----------------------------------------------------
882 dnl Check for SDL and decide about auto gui accordingly.
883 dnl Need be done after build_sound_sdl and build_sdl are
884 dnl initialized and before they are checked for yes/no
885 dnl -----------------------------------------------------
886 if test x"${build_sdl}" = xauto; then
887   if test xyes = x"${has_sdl}"; then
888     build_sdl=yes
889   else
890     AC_MSG_NOTICE([sdl GUI will not be built (no sdl development files found)])
891     build_sdl=no
892   fi
895 dnl -------------------------------
896 dnl Renderer Selection
897 dnl -------------------------------
898 input_events=
899 dnl By default, we want to to build all renderers
900 dnl DirectFB has both a device layer and a rendering layer, although
901 dnl currently the rendering part is incomplete. Configure support is
902 dnl included for development purposes.
903 build_directfb=no
904 dnl The OpenVG support works on both the desktop and embedded devices
905 dnl that don't run X11. It is supported by iPhone/iPad/Android
906 dnl devices, and the nouveau driver on the desktop.
907 build_ovg=no
908 dnl The OpenGLES1 renderer is a work in progress. It is originally
909 dnl based on a patch to Gnash 0.8.5, which of course not only didn't
910 dnl compile anymore, it was all hardcoded into the framebuffer
911 dnl code. This version compiles with the latest internal rendering
912 dnl API, and works properly with the glue code for the Gnash GUIs.
913 build_gles1=no
914 dnl OpenGL works, but suffers from performance and rendering quality
915 dnl problems. This should eventually be replacd by the OpenGLES1 and
916 dnl OpenVG renders.
917 build_ogl=no
918 dnl AGG is a software only renderer
919 build_agg=yes
920 build_cairo=yes
921 renderer_list="agg cairo"
922 AC_ARG_ENABLE(renderer,
923   AC_HELP_STRING([--enable-renderer], [Enable support for the specified renderers (agg|cairo|opengl|openvg|all, default=all)]),
924   if test -n ${enableval}; then
925     if test "x${enableval}" != "xno" -o "x${enableval}" != "xnone" ; then
926       renderer_list="none"
927       enableval=`echo ${enableval} | tr '\054' ' ' `
928     else
929       renderer_list=""
930       enableval=""
931     fi
932   fi
933   renderer_list=""
934   build_ovg=no
935   build_ogl=no
936   build_gles1=no
937   build_gles2=no
938   build_agg=no
939   build_cairo=no
940   while test -n "${enableval}" ; do
941     val=`echo ${enableval} | cut -d ' ' -f 1`
942     [case "${val}" in
943       no*|NO*)
944         renderer_list="none"
945         build_ovg=no
946         build_ogl=no
947         build_gles1=no
948         build_gles2=no
949         build_agg=no
950         build_cairo=no
951         ;;
952       all|ALL)
953         renderer_list="agg cairo opengl openvg, opengles1"
954         build_ogl=yes
955         build_agg=yes
956         build_cairo=yes
957         build_ovg=no
958         nrender=3
959         ;;
960       ogl|OGL|OpenGL|opengl)
961         renderer_list="${renderer_list} opengl"
962         build_ogl=yes
963         ;;
964       gles|GLES|gles1|GLES1)
965         renderer_list="${renderer_list} opengles1"
966         build_gles1=yes
967         build_ogl=no
968         nrender=$((nrender+1))
969         ;;
970       ovg|OVG|OpenVG|openvg)
971         renderer_list="${renderer_list} openvg"
972         build_ovg=yes
973         nrender=$((nrender+1))
974         ;;
975       directfb|dfb)
976         renderer_list="${renderer_list} DirectFB"
977         build_directfb=yes
978         nrender=$((nrender+1))
979         ;;
980       agg|AGG)
981         renderer_list="${renderer_list} agg"
982         build_agg=yes
983         ;;
984       cairo|CAIRO|Cairo*)
985         renderer_list="${renderer_list} cairo"
986         build_cairo=yes
987         ;;
988       *) AC_MSG_ERROR([invalid renderer specified: ${enableval} given (accept:  (opengl|openvg|cairo|agg|all)])
989         ;;
990       esac]
991     enableval=`echo ${enableval} | cut -d ' ' -f 2-`
992     if test "x$val" = "x$enableval"; then
993       break;
994     fi
995   done
998 if test x"${build_ovg}" = xyes; then
999   GNASH_PATH_OPENVG
1000   dnl If OpenVG isn't installed, disable it
1001   if test x"${has_openvg}" = xno; then
1002     AC_MSG_WARN([OpenVG specified but no development files found!])
1003     renderer_list=`echo ${renderer_list} | sed -e 's/ openvg//' `
1004     nrender=$((nrender-1))
1005   fi
1008 dnl VA API is used by default for all H.264 videos. HW requirements:
1009 dnl     * AMD GPUs with UVD2 and xvba-video VA driver
1010 dnl     * NVIDIA GPUs with vdpau-video VA driver
1011 dnl     * All HW with a VA driver supporting the VA/GLX extensions or
1012 dnl     vaPutSurface(Pixmap,...). This may include the Intel
1013 dnl     Moorestown platform and future G45 VA driver.
1014 dnl NOTE: it is possible to use Gnash/VAAPI on platforms with an Intel
1015 dnl GMA500 but you currently will have to build the AGG renderer
1016 dnl instead of the OGL (OpenGL) one. 
1017 build_vaapi_device=no
1018 build_openmax_device=no
1019 build_egl_device=no
1020 build_x11_device=no
1021 build_directfb_device=no
1022 if test x"${build_fb}" = xyes -o x"${build_fb}" = xauto; then
1023   build_fb_agg=yes
1025 dnl AGG support for the framebuffer requires the rawfb device
1026 if test x"${build_fb_agg}" = xyes -a x"${build_agg}" = xyes; then
1027   build_rawfb_device=yes
1028   device_list="RawFB"
1029   ndevice=1
1030 else
1031   build_rawfb_device=no
1032   device_list=""
1033   ndevice=0
1035 AC_ARG_ENABLE(device,
1036   AC_HELP_STRING([--enable-device], [Specify which hardware abstraction to use to support to enable (none,egl,directfb,rawfb,x11,vaapi)]),
1037   enableval=`echo ${enableval} | tr '\054' ' ' `
1038   build_egl_device=no
1039   build_rawfb_device=no
1040   device_list=""
1041   ndevice=0
1042   while test -n "${enableval}" ; do
1043     val=`echo ${enableval} | cut -d ' ' -f 1`
1044     [case "${val}" in
1045       no*|NO*)
1046         device_list="none"
1047         build_vaapi_device=no
1048         build_openmax_device=no
1049         build_egl_device=no
1050         build_directfb_device=no
1051         build_x11_device=no
1052         ndevice=0
1053         ;;
1054       va*|VA*)
1055         device_list="${device_list} VAAPI"
1056         build_vaapi_device=yes
1057         ndevice=$((ndevice+1))
1058         ;;
1059       eg*|EG*)
1060         device_list="${device_list} EGL"
1061         build_egl_device=yes
1062         ndevice=$((ndevice+1))
1063         ;;
1064       x1*|X1*)
1065         device_list="${device_list} X11"
1066         build_x11_device=yes
1067         ndevice=$((ndevice+1))
1068         ;;
1069       di*|Di*|DI*|dfb)
1070         device_list="${device_list} DirectFB"
1071         build_directfb_device=yes
1072         ndevice=$((ndevice+1))
1073         ;;
1074       ra*|RAW*)
1075         device_list="${device_list} RawFB"
1076         build_rawfb_device=yes
1077         ndevice=$((ndevice+1))
1078         ;;
1079       all|ALL)
1080         device_list="EGL RawFB X11"
1081         build_openmax_device=no
1082         build_vaapi_device=no
1083         build_egl_device=yes
1084         build_rawfb_device=yes
1085         build_directfb_device=no
1086         build_x11_device=yes
1087         ndevice=3
1088         ;;
1089       op*|Op*|OP*)
1090         device_list="${device_list} OpenMAX"
1091         build_openmax_device=yes
1092         ndevice=$((ndevice+1))
1093         ;;
1094       *) AC_MSG_ERROR([invalid device feature specified: ${enableval} given (accept: none,vaapi)])
1095         ;;
1096       esac]
1097     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1098     if test "x$val" = "x$enableval"; then
1099       break;
1100     fi
1101   done
1104 if test x"${have_ffmpeg_vaapi}" = x"yes" -a x"${build_vaapi_device}" = x"yes"; then
1105   use_libva=no
1106   use_libva_x11=no
1107   use_libva_glx=no
1108   dnl if the version of FFmpeg is recent enough, (r20957, 52.45.0), then
1109   dnl look for VAAPI support so we can use use the VAAPI enabled FFmpeg.
1110   if test x"${have_ffmpeg_vaapi}" = xyes; then
1111     use_libva=yes
1112     GNASH_PKG_FIND([libva],
1113       [va/va.h],
1114       [Video Acceleration API],
1115       vaInitialize
1116     )
1117     use_libva_x11=yes
1118     GNASH_PKG_FIND([libva_x11],
1119       [va/va_x11.h],
1120       [VA API (X11 display)],
1121       vaGetDisplay,
1122       [], [-lva-x11]
1123     )
1125     if test x$build_ogl = xyes; then
1126       use_libva_glx=yes
1127       GNASH_PKG_FIND([libva_glx],
1128         [va/va_glx.h],
1129         [VA API (GLX display)],
1130         vaGetDisplayGLX,
1131         [], [-lva-glx]
1132       )
1133     fi
1134   fi
1137 dnl libVA drivers. We declare conditional for both the option being
1138 dnl selected, as well as whether or not it's found. This we can
1139 dnl generate better error handling if it's not found.
1140 AM_CONDITIONAL(USE_VAAPI, test x"${use_libva}" = xyes)
1142 dnl Until the hwaccel patches in FFmpeg wind up in the ffmpeg-plugin,
1143 dnl restrict using HW Accel to using FFmpeg directly.
1144 dnl test xyes = xyes -a ( x != xyes -o x != xyes )
1145 if test x"${build_vaapi}" = x"yes" -a x"${have_ffmpeg}" != x"yes"; then
1146   AC_MSG_ERROR(["Hardware acceleration currently not supported unless using FFmpeg."])
1149 AM_CONDITIONAL(HAVE_VAAPI, test x"${found_libva_incl}" = xyes)
1150 AM_CONDITIONAL(HAVE_VAAPI_GLX, test x"${found_libva_glx_incl}" = xyes)
1151 AM_CONDITIONAL(HAVE_VAAPI_X11, test x"${found_libva_x11_incl}" = xyes)
1153 if test x"${build_egl_device}" = xyes; then
1154   GNASH_PKG_FIND(EGL, [EGL/egl.h], [EGL library], eglGetDisplay)
1155   if test xyes = x"${has_EGL}"; then
1156     AC_DEFINE(BUILD_EGL_DEVICE, [ 1 ],
1157           [Build the EGL device for OpenVG, OpenGLES1&2, and X11/Mesa])
1158       device_list="${device_list} EGL"
1159       ndevice=$((ndevice+1))
1160   else
1161     AC_MSG_WARN(["EGL requested but development package not found!"])
1162     build_egl_device=no
1163   fi
1166 if test ${ndevice} -eq 0; then
1167       device_list="none"
1168       ndevice=1
1171 AM_CONDITIONAL(BUILD_DEVICES, test ${ndevice} -gt 0)
1173 dnl 16 bit: RGB555, RGB565
1174 dnl 24 bit: RGB24, BGR24
1175 dnl 32 bit: RGBA32, BGRA32
1176 pixelformat=all
1177 AC_ARG_WITH(pixelformat,
1178   AC_HELP_STRING([--with-pixelformat=], [Use the specified pixel format for AGG (default=all)]),
1179   [if test -n ${withval}; then
1180     pixelformat="${withval}"
1181     withval=`echo ${withval} | tr '\054' ' ' `
1182   fi
1183   while test -n "${withval}" ; do
1184     val=`echo ${withval} | cut -d ' ' -f 1`
1185     case "${val}" in
1186       all)
1187         # allow special value "all" set by user (handled below)
1188         ;; 
1189       argb32|ARGB32)
1190         AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32])
1191         ;;
1192       abgr32|ABGR32)
1193         AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32])
1194         ;;
1195       bgra32|BGRA32)
1196         AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
1197         ;;
1198       bgr24|BGR24)
1199         AC_DEFINE(PIXELFORMAT_BGR24, [1], [BGR24])
1200         ;;
1201       rgba32|RGBA32)
1202         AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32])
1203         ;;
1204       rgb24|RGB24)
1205         AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24])
1206         ;;
1207       rgb555|RGB555)
1208         AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555])
1209         ;;
1210       rgb565|RGB565)
1211         AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565])
1212         ;;
1213       *) AC_MSG_ERROR([invalid pixel format ${withval} given (accept: all|RGB555|RGB565|RGB24|BGR24|BGRA32|RGBA32|ARGB32|ABGR32)])
1214          ;;
1215       esac
1216     withval=`echo ${withval} | cut -d ' ' -f 2-6`
1217     if test "x$val" = "x$withval"; then
1218       break;
1219     fi
1220   done],
1221   [if test x$build_haiku = xyes -a x$build_sdl != xyes; then
1222         AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
1223         pixelformat=BGRA32
1224    fi]
1227 if test x$pixelformat = xall; then
1228   if test x$build_agg = xyes; then
1229     ### The fact that we're building GTK doesn't mean we're not also
1230     ### building KDE or SDL, each needing its own pixel format !
1231     #if test x$build_gtk = xyes; then
1232     #  AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24 pixel format])
1233     #  pixelformat="RGB24"
1234     #else
1235       AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555 pixel format])
1236       AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565 pixel format])
1237       AC_DEFINE(PIXELFORMAT_RGB24,  [1], [RGB24 pixel format])
1238       AC_DEFINE(PIXELFORMAT_BGR24,  [1], [BGR24 pixel format])
1239       AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32 pixel format])
1240       AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32 pixel format])
1241       AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32 pixel format])
1242       AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32 pixel format])
1243     #fi
1244   fi
1247 if test x"${build_ogl}" != xno; then # yes or auto
1248   GNASH_PATH_OPENGL
1249   if test x"${build_ogl}" = xauto; then
1250     if test xyes = x"${has_opengl}"; then
1251       build_ogl=yes
1252       renderer_list="${renderer_list} opengl"
1253     else
1254       build_ogl=no
1255     fi
1256   fi
1259 AM_CONDITIONAL(BUILD_OVG_RENDERER,   [ test x${build_ovg} = xyes ])
1260 AM_CONDITIONAL(BUILD_GLES1_RENDERER, [ test x${build_gles1} = xyes ])
1261 AM_CONDITIONAL(BUILD_GLES2_RENDERER, [ test x${build_gles2} = xyes ])
1262 AM_CONDITIONAL(BUILD_OGL_RENDERER,   [ test x${build_ogl} = xyes])
1263 AM_CONDITIONAL(BUILD_AGG_RENDERER,   [ test x${build_agg} = xyes ])
1264 AM_CONDITIONAL(BUILD_CAIRO_RENDERER, [ test x${build_cairo} = xyes ])
1266 if test x"${has_openvg}" = xyes; then
1267    AC_DEFINE([RENDERER_OPENVG], [1], [Use OpenVG renderer])
1270 if test x"${build_ogl}" = xyes; then
1271    AC_DEFINE([RENDERER_OPENGL], [1], [Use OpenGL renderer])
1274 if test x"${build_agg}" = xyes; then
1275   AC_DEFINE([RENDERER_AGG], [1], [Use AntiGrain renderer])
1278 if test x"${build_cairo}" = xyes; then
1279   GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
1280   AC_DEFINE([RENDERER_CAIRO], [1], [Use cairo renderer])
1283 if test x"${build_agg}" = xyes; then
1284    GNASH_PATH_AGG
1287 AC_PATH_PROG(PERL, perl)
1288 AM_CONDITIONAL(HAVE_PERL, test x"$PERL" != x)
1290 AC_PATH_PROG(CSOUND, csound)
1291 AM_CONDITIONAL(HAVE_CSOUND, test x"$CSOUND" != x)
1293 AC_PATH_PROG(GIT, git)
1294 AC_SUBST(GIT)
1296 dnl --------------------------------------------------------
1297 dnl Extension selection
1298 dnl --------------------------------------------------------
1299 ext_dejagnu=no
1300 ext_mysql=no
1301 ext_fileio=no
1302 ext_gtk=no
1303 ext_lirc=no
1304 ext_dbus=no
1305 ext_all=no
1306 extensions_list=
1307 extensions_support=yes
1308 nextensions=0
1309 AC_ARG_ENABLE(extensions,
1310   AC_HELP_STRING([--enable-extensions=], [Specify which extensions to build (default: none)])
1311   AC_HELP_STRING([--disable-extensions], [Disable support for extensions entirely]),
1312   if test -n ${enableval}; then
1313     if test "x${enableval}" != "xno"; then
1314       extlist="${enableval}"
1315       enableval=`echo ${enableval} | tr '\054' ' ' `
1316       AC_DEFINE([USE_EXTENSIONS], [1], [Specify that extension support is enabled.])
1317     else
1318       extlist=""
1319       enableval=""
1320       extensions_support=no
1321     fi
1322   fi
1323   nextensions=0
1324   while test -n "${enableval}" ; do
1325     val=`echo ${enableval} | cut -d ' ' -f 1`
1326     extensions_list="${extensions_list} ${val}"
1327     [case "${val}" in
1328       dejagnu|DEJAGNU|dj|DJ)
1329         AC_DEFINE(USE_DEJAGNU_EXT, [1], [Build the DejaGnu extension])
1330         AC_MSG_NOTICE([Adding DejaGnu extension])
1331         ext_dejagnu=yes
1332         nextensions=$((nextensions+1))
1333         ;;
1334       mysql|MYSQL|sql|SQL)
1335         AC_DEFINE(USE_MYSQL_EXT, [1], [Build the MySQL extension])
1336         AC_MSG_NOTICE([Adding MySql extension])
1337         ext_mysql=yes
1338         nextensions=$((nextensions+1))
1339         ;;
1340       fileio|FILEIO|io|IO)
1341         AC_DEFINE(USE_FILEIO_EXT, [1], [Build the FileIO extension])
1342         AC_MSG_NOTICE([Adding FileIO extension])
1343         ext_fileio=yes
1344         nextensions=$((nextensions+1))
1345         ;;
1346       gtk|GTK|gtk2|GTK2)
1347         AC_DEFINE(USE_GTK_EXT, [1], [Build the GTK extension])
1348         ext_gtk=yes
1349         nextensions=$((nextensions+1))
1350         ;;
1351       lirc|LIRC)
1352         AC_DEFINE(USE_LIRC_EXT, [1], [Build the LIRC extension])
1353         ext_lirc=yes
1354         nextensions=$((nextensions+1))
1355         ;;
1356       dbus|DBUS)
1357         AC_DEFINE(USE_DBUS_EXT, [1], [Build the DBUS extension])
1358         ext_dbus=yes
1359         nextensions=$((nextensions+1))
1360         ;;
1361       all|ALL)
1362         AC_DEFINE(USE_GTK_EXT, [1], [Build all the extensions])
1363         ext_dejagnu=yes
1364         ext_mysql=yes
1365         ext_fileio=yes
1366         ext_gtk=yes
1367         ext_lirc=yes
1368         ext_dbus=yes
1369         ext_all=yes
1370         nextensions=9
1371         ;;
1372       *) AC_MSG_ERROR([invalid extension specified: ${enableval} given (accept: MYSQL|DEJAGNU|FILEIO|GTK|LIRC|DBUS|METOME|ALL)])
1373          ;;
1374       esac]
1375     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1376     if test "x$val" = "x$enableval"; then
1377       break;
1378     fi
1379   done
1380   EXTENSIONS_LIST="$extensions_list"
1381   AC_SUBST(EXTENSIONS_LIST)
1384 if test x$ext_dbus = xyes; then
1385   GNASH_PATH_DBUS
1388 if test x$ext_mysql = xyes; then
1389   GNASH_PATH_MYSQL
1392 AM_CONDITIONAL(BUILD_DEJAGNU_EXT, [ test x$ext_dejagnu = xyes ])
1393 AM_CONDITIONAL(BUILD_FILEIO_EXT, [ test x$ext_fileio = xyes ])
1394 AM_CONDITIONAL(BUILD_MYSQL_EXT, [ test x$ext_mysql = xyes ])
1395 AM_CONDITIONAL(BUILD_GTK_EXT, [ test x$ext_gtk = xyes ])
1396 AM_CONDITIONAL(BUILD_LIRC_EXT, [ test x$ext_lirc = xyes ])
1397 AM_CONDITIONAL(BUILD_DBUS_EXT, [ test x$ext_dbus = xyes ])
1398 AM_CONDITIONAL(BUILD_EXTENSIONS, [ test -n "$extensions_list"])
1400 AM_CONDITIONAL(ENABLE_EXTENSIONS, [ test "x${extensions_support}" != "xno" ])
1402 dnl --------------------------------------------------------
1403 dnl Libtool
1404 dnl --------------------------------------------------------
1406 AC_LIBTOOL_DLOPEN
1407 AC_LIBTOOL_WIN32_DLL
1408 AC_DISABLE_STATIC
1409 AC_PROG_LIBTOOL
1410 AC_SUBST(LIBTOOL_DEPS)
1411 DLOPEN="-dlopen"
1412 DLPREOPEN="-dlpreopen"
1413 AC_SUBST(DLOPEN)
1414 AC_SUBST(DLPREOPEN)
1416 GNASH_PKG_FIND([ltdl], [ltdl.h], [libltdl library], [lt_dlinit])
1418 if test x"$has_ltdl" = x"yes";then
1419   AC_DEFINE(HAVE_LTDL, [1], [Libtool 2.x defines this, but libtool 1.5 does not])
1422 dnl --------------------------------------------------------
1423 dnl SOL dir
1424 dnl --------------------------------------------------------
1425 soldir=/tmp
1426 AC_ARG_WITH(soldir,
1427  AC_HELP_STRING([--with-soldir],
1428  [directory for .sol files]),
1429  with_soldir=${withval})
1430 if test x${with_soldir} != x; then
1431   soldir=${with_soldir}
1433 SOLDIR=${soldir}
1434 AC_SUBST(SOLDIR)
1436 dnl --------------------------------------------------------
1437 dnl AVM2
1438 dnl --------------------------------------------------------
1439 dnl AC_ARG_ENABLE(avm2,
1440 dnl   AC_HELP_STRING([--enable-avm2], [Enable support for AS3]),
1441 dnl   [case "${enableval}" in
1442 dnl     yes) avm2=yes ;;
1443 dnl     no)  avm2=no ;;
1444 dnl     *)   AC_MSG_ERROR([bad value ${enableval} for enable-avm2 option]) ;;
1445 dnl   esac], avm2=no
1446 dnl )
1447 dnl AM_CONDITIONAL(ENABLE_AVM2, [test x"$avm2" = xyes])
1448 dnl if test x$avm2 = xyes; then
1449 dnl     AC_DEFINE(ENABLE_AVM2, [1], [Enable AVM2 code])
1450 dnl fi
1451 AM_CONDITIONAL(ENABLE_AVM2, false)
1453 dnl This option is only used if you want Gnash to interwork with 
1454 dnl the Adobe player using the LocalConnection class.
1455 dnl lckey=0xdd3adabd
1456 AC_ARG_WITH(lckey,
1457  AC_HELP_STRING([--with-lckey],
1458  [shared memory key for your system]),
1459  with_lckey=${withval})
1461 if test x${with_lckey} != x; then
1462   lckey=${with_lckey}
1463 else
1464   lckey=0xcbc384f8
1466 LC_KEY=${lckey}
1467 AC_SUBST(LC_KEY)
1469 AC_ARG_ENABLE(python,
1470   AC_HELP_STRING([--enable-python],[Enable python for the python wrapper]),
1471 [case "${enableval}" in
1472   yes) python=yes ;;
1473   no)  python=no ;;
1474   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-python option]) ;;
1475 esac],python=no)
1477 dnl Look for python, which is optional. If enabled, a python loadable
1478 dnl module of Gnash is created.
1479 GNASH_PATH_PYTHON
1480 AM_CONDITIONAL([USE_PYTHON], test x"$python" = xyes)
1481 AM_CONDITIONAL([HAS_PYTHON], test x"$has_python" = xyes)
1483 dnl By default debug logging is enabled. For better performance, it can
1484 dnl be disabled, as when running as a plugin, nobody sees the debug messages
1485 dnl anyway. Debug logging is primarily for developers, so we can turn it off
1486 dnl for package builds.
1487 AC_ARG_ENABLE(log,
1488   AC_HELP_STRING([--enable-log],[Enable debug logging]),
1489 [case "${enableval}" in
1490   yes) debuglog=yes ;;
1491   no)  debuglog=no ;;
1492   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-log option]) ;;
1493 esac],debuglog=yes)
1495 if test x"${debuglog}" = x"yes"; then
1496   AC_DEFINE([DEBUG_LOGGING], [1], [Enable debug logging])
1499 # Maybe use jemalloc, which handles memory fragmentation for
1500 # ECAMscript languages better than the regular system malloc.
1501 # This seems like a good idea, as both the other player and
1502 # Mozilla/Firefox both recently switched to using jemalloc.
1503 AC_ARG_ENABLE(jemalloc,
1504   AC_HELP_STRING([--enable-jemalloc],[Enable jemalloc instead of system malloc]),
1505 [case "${enableval}" in
1506   yes) jemalloc=yes ;;
1507   no)  jemalloc=no ;;
1508   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-jemalloc option]) ;;
1509 esac],jemalloc=yes)
1511 AC_CHECK_SIZEOF([void *], [4])
1513 if test "x${ac_cv_sizeof_void_p}" != x4 -a x"${ac_cv_sizeof_void_p}" != x8; then
1514   dnl jemalloc doesn't support unusual pointer sizes
1515   jemalloc=no
1518 dnl There is some weird stuff going on with NetBSD and jemalloc, so don't 
1519 dnl build it for now.
1520 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
1521   jemalloc=no
1523 dnl If the compiler doesn't have local thread storage enabled, don't try to
1524 dnl use jemalloc.
1525 if test x"${jemalloc}" = x"yes"; then
1526   AC_TRY_COMPILE([], [
1527     extern __thread int global_i; ],
1528     has_local_thread_storage=yes
1529   )
1530   if test x"${has_local_thread_storage}" = x"yes"; then
1531     AC_DEFINE([HAVE_LOCAL_THREAD_STORAGE], [1], [Has __thread (local thread storage) support])
1532     AC_DEFINE([USE_JEMALLOC], [], [Use jemalloc instead of system malloc])
1533   else
1534     jemalloc=no
1535   fi
1538 dnl We can search libs for mallinfo to decide whether we have it or not.
1539 dnl This is added to the linker flags when it's found. Usually it's -lc, but
1540 dnl on OpenSolaris it's -lmalloc, so this fixes the build.
1541 AC_SEARCH_LIBS([mallinfo], [c malloc],
1542                AC_DEFINE(HAVE_MALLINFO, [1], [Has mallinfo()])
1543                mallinfo=yes
1544                )
1546 AM_CONDITIONAL([HAVE_MALLINFO], test x$mallinfo = xyes)
1547 AM_CONDITIONAL(JEMALLOC, test x$jemalloc = xyes)
1549 AC_ARG_ENABLE(fps-debug,
1550   AC_HELP_STRING([--enable-fps-debug],[Enable FPS debugging code]),
1551 [case "${enableval}" in
1552   yes) AC_DEFINE([GNASH_FPS_DEBUG], [1], [Enable FPS debugging code])
1553 esac])
1555 dnl IPC_INFO isn't portable, and doesn't exist on BSD
1556 AC_TRY_COMPILE([#include <sys/ipc.h> #include <sys/shm.h>], [
1557   int flag = IPC_INFO; ],
1558   AC_DEFINE([HAVE_IPC_INFO], [1], [Use ipc_info])
1561 dnl --------------------------------------------------------
1562 dnl Disable menus
1563 dnl --------------------------------------------------------
1564 dnl Don't add the GUI menu. Some educational systems think this adds
1565 dnl clutter and confusion, like on the OLPC.
1566 AC_ARG_ENABLE(menus,
1567   AC_HELP_STRING([--disable-menus],[Disable the GUI menus]),
1568 [case "${enableval}" in
1569   yes) menus=yes ;;
1570   no)  menus=no ;;
1571   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-menus option]) ;;
1572 esac],menus=yes)
1574 if test x"$menus" = x"yes"; then
1575   AC_DEFINE([USE_MENUS], [], [GUI Menu support])
1577 AM_CONDITIONAL(MENUS, test x$menus = xyes)
1579 dnl --------------------------------------------------------
1580 dnl Disable SWF information
1581 dnl --------------------------------------------------------
1582 dnl Don't gather SWF information in tree form. This takes
1583 dnl resources and memory that can be saved if there's no
1584 dnl need to examine SWF internals.
1585 AC_ARG_ENABLE(swftree,
1586   AC_HELP_STRING([--disable-swftree],[Disable showing SWF properties]),
1587 [case "${enableval}" in
1588   yes) swftree=yes ;;
1589   no)  swftree=no ;;
1590   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-swf-properties option]) ;;
1591 esac],swftree=yes)
1593 if test x"$swftree" = x"yes"; then
1594   AC_DEFINE([USE_SWFTREE], [], [View SWF information])
1596 AM_CONDITIONAL(SWFTREE, test x$swftree = xyes)
1598 dnl --------------------------------------------------------
1599 dnl Disable testsuite
1600 dnl --------------------------------------------------------
1601 dnl Disable running any tests for "make check". This may sound stupid, but
1602 dnl this option is designed to solely be used by maintainers in the 
1603 dnl DISTCHECK_CONFIGURE_FLAGS when building packages. Gnash's testing infrastructure
1604 dnl is complex, and often the the testsuites will work, but due to some obscure reason,
1605 dnl make distcheck fails.
1606 AC_ARG_ENABLE(testsuite,
1607   AC_HELP_STRING([--disable-testsuite],[Disable the testsuite, maintainers option only]),
1608 [case "${enableval}" in
1609   yes) testsuite=yes ;;
1610   no)  testsuite=no ;;
1611   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-testsuite option]) ;;
1612 esac],testsuite=yes)
1614 if test x"$testsuite" = x"yes"; then
1615   AC_DEFINE([USE_TESTSUITE], [], [Testsuite support, maintainers option only])
1617 AM_CONDITIONAL(TESTSUITE, test x$testsuite = xyes)
1619 dnl --------------------------------------------------------
1620 dnl Write the file to disk in the plugin
1621 dnl --------------------------------------------------------
1622 AC_ARG_ENABLE(write,
1623   AC_HELP_STRING([--enable-write], [Makes the Mozilla plugin write the currently playing SWF movie to /tmp.]),
1624 [case "${enableval}" in
1625   yes) write=yes ;;
1626   no)  write=no ;;
1627   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-write option]) ;;
1628 esac],write=no)
1630 if test x"$write" = x"yes"; then
1631   AC_DEFINE([WRITE_FILE], [], [Write files while streaming])
1634 dnl --------------------------------------------------------
1635 dnl Write a standalone gnash launcher to disk from the plugin
1636 dnl --------------------------------------------------------
1637 AC_ARG_ENABLE(sa-launcher,
1638   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.]),
1639 [case "${enableval}" in
1640   yes) sa_launcher=yes ;;
1641   no)  sa_launcher=no ;;
1642   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-sa-launcher option]) ;;
1643 esac],sa_launcher=yes)
1645 if test x"$sa_launcher" = x"yes"; then
1646   AC_DEFINE([CREATE_STANDALONE_GNASH_LAUNCHER], [], [Add support for writing a standalone executable launcher for movies embedded in web pages])
1649 dnl --------------------------------------------------------
1650 dnl Build the cygnal server if specified.
1651 dnl --------------------------------------------------------
1652 AC_ARG_ENABLE(cygnal,
1653   AC_HELP_STRING([--enable-cygnal], [Enable building of the Cygnal server]),
1654 [case "${enableval}" in
1655   yes) cygnal=yes ;;
1656   no)  cygnal=no ;;
1657   *)   AC_MSG_ERROR([bad value ${enableval} for enable-cygnal option]) ;;
1658 esac],cygnal=no)
1659 AM_CONDITIONAL(CYGNAL, test x$cygnal = xyes)
1661 dnl --------------------------------------------------------
1662 dnl Build the cgibins server if specified.
1663 dnl --------------------------------------------------------
1664 AC_ARG_ENABLE(cgibins,
1665   AC_HELP_STRING([--enable-cgibins], [Enable building of the CGIs for Cygnal]),
1666 [case "${enableval}" in
1667   yes) cgibin=yes ;;
1668   no)  cgibin=no ;;
1669   *)   AC_MSG_ERROR([bad value ${enableval} for enable-cgibins option]) ;;
1670 esac],cgibin=yes)
1671 AM_CONDITIONAL(USE_CGI, test x$cgibin = xyes)
1672 if test x"${cgibin}" = x"yes"; then
1673   AC_DEFINE([USE_CGIBIN], [1], [Enable cgi-bin processes for Cygnal])
1676 dnl --------------------------------------------------------
1677 dnl  Double buffer
1678 dnl --------------------------------------------------------
1679 dnl Add an option for double buffering when rendering, currently only used by
1680 dnl the frmaebuffer GUI.
1681 dnl If defined, an internal software-buffer is used for rendering and is then
1682 dnl copied to the video RAM. This avoids flicker and is faster for complex 
1683 dnl graphics, as video RAM access is usually slower. (strongly suggested)
1684 AC_ARG_ENABLE(doublebuf,
1685   AC_HELP_STRING([--disable-doublebuf], [Disble support for double buffering when rendering with AGG]),
1686   [case "${enableval}" in
1687     yes) doublebuf=yes ;;
1688     no)  doublebuf=no ;;
1689     *)   AC_MSG_ERROR([bad value ${enableval} for enable-doublebuf option]) ;;
1690   esac], doublebuf=yes
1692 AM_CONDITIONAL(ENABLE_DBUF, [test x"$doublebuf" = xyes])
1693 if test x$doublebuf = xyes; then
1694     AC_DEFINE(ENABLE_DOUBLE_BUFFERING, [1], [Disable double buffering for AGG])
1697 dnl --------------------------------------------------------
1698 dnl  Offscreen buffer
1699 dnl --------------------------------------------------------
1700 dnl This enables rendering to an offscreen buffer, instead of directly to window
1701 AC_ARG_ENABLE(offscreen,
1702   AC_HELP_STRING([--enable-offscreen], [Enable support for rendering offscreen]),
1703   [case "${enableval}" in
1704     yes) offscreen=yes ;;
1705     no)  offscreen=no ;;
1706     *)   AC_MSG_ERROR([bad value ${enableval} for enable-offscreen option]) ;;
1707   esac], offscreen=no
1711 dnl --------------------------------------------------------
1712 dnl  SSH support selection
1713 dnl --------------------------------------------------------
1714 dnl Enable using libssh with libnet
1715 AC_ARG_ENABLE(ssh,
1716   AC_HELP_STRING([--enable-ssh], [Enable using SSH for network authentication]),
1717 [case "${enableval}" in
1718   yes) build_ssh=yes ;;
1719   no)  build_ssh=no ;;
1720   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-ssh option]) ;;
1721 esac], build_ssh=no)
1723 AM_CONDITIONAL(BUILD_SSH, test x"${build_ssh}" = xyes)
1724 if test x"${build_ssh}" = xyes; then
1725   GNASH_PKG_FIND(ssh, [libssh/libssh.h], [libssh library], ssh_socket_init)
1726 dnl  GNASH_PKG_FIND(poppler, [popt.h], [Poppler library], poppler_init)
1728 if test x"${has_ssh}" = x"yes"; then
1729   AC_DEFINE([USE_SSH], [1], [Use SSH for authentication])
1732 dnl --------------------------------------------------------
1733 dnl  SSL support selection
1734 dnl --------------------------------------------------------
1736 dnl Enable using OpenSSL with libnet.
1737 AC_ARG_ENABLE(ssl,
1738   AC_HELP_STRING([--enable-ssl], [Enable using OpenSSL directly]),
1739 [case "${enableval}" in
1740   yes) build_ssl=yes ;;
1741   no)  build_ssl=no ;;
1742   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-ssl option]) ;;
1743 esac], build_ssl=no)
1745 with_cert=
1746 with_pem=
1747 AM_CONDITIONAL(BUILD_SSL, test x"${build_ssl}" = xyes)
1748 AC_ARG_WITH(cert,
1749   AC_HELP_STRING([--with-cert],
1750   [cert file for SSL]),
1751   with_cert=${withval})
1752 AC_ARG_WITH(pem,
1753   AC_HELP_STRING([--with-pe],
1754   [pem file for SSL]),
1755   with_pem=${withval})
1757 if test x"${build_ssl}" = xyes; then
1758   GNASH_PKG_FIND(ssl, [openssl/ssl.h], [OpenSSL library], SSL_library_init)
1760 if test x"${has_ssl}" = x"yes"; then
1761   AC_DEFINE([USE_SSL], [1], [Use SSL for authentication])
1764 dnl -----------------------------------------------------------
1765 dnl Set the general plugins install policy here
1766 dnl (NOTE: before GNASH_PATH_FIREFOX and GNASH_PATH_KDE*)
1767 dnl -----------------------------------------------------------
1769 AC_ARG_WITH(plugins-install,
1770   AC_HELP_STRING([--with-plugins-install=system|user|prefix], [Policy for plugins install. Default: user.]),
1771         [case "${withval}" in
1772           user) PLUGINS_INSTALL_POLICY=user ;;
1773           system) PLUGINS_INSTALL_POLICY=system ;;
1774           prefix) PLUGINS_INSTALL_POLICY=prefix ;;
1775           *)  AC_MSG_ERROR([bad value ${withval} for --with-plugins-install]) ;;
1776          esac 
1777         ], PLUGINS_INSTALL_POLICY=user) 
1779 dnl -----------------------------------------------------------
1780 dnl   Verify dependencies for requested GUIs are met, and
1781 dnl   disable build of the GUIS for which deps are NOT met
1782 dnl ------------------------------------------------------------
1784 if test x$build_gtk = xyes; then
1785    GNASH_PATH_GTK2
1786    GNASH_PATH_PANGO
1787    GNASH_PKG_FIND(atk, [atk/atk.h], [atk library], atk_focus_tracker_init, [1.0])
1788    if test x"${build_ogl}" = xyes; then
1789       GNASH_PATH_GLEXT
1790    fi
1791    if test x"${build_cairo}" = xyes; then
1792       GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
1793    fi
1796 if test x"${build_qt4}" != xno; then
1797  GNASH_PATH_QT4
1800 if test x"${build_qt4}" = xauto; then
1801   if test x"${has_qt4}" = xyes; then
1802      build_qt4=yes
1803   else
1804      build_qt4=no
1805   fi
1808 if test x"${build_kde3}" != xno -o x"${build_qtopia3}" != xno; then
1809  GNASH_PATH_QT3
1812 if test x"${build_kde3}" != xno; then
1813   GNASH_PATH_KDE3
1817 if test x"${build_kde3}" = xauto; then
1818   if test x"${has_qt3}" = xyes -a x"${has_kde3}" = xyes; then
1819      build_kde3=yes
1820   else
1821      build_kde3=no
1822   fi
1825 dnl Check possibility to build DUMP gui, if requested
1826 if test x"${build_dump}" != xno; then
1827   if test x"${build_agg}" = xyes; then
1828     build_dump=yes
1829   else
1830     if test x"${build_dump}" = xyes; then
1831       dnl SHOULD we just check at the end of file instead ?
1832       AC_MSG_ERROR(dump GUI cannot be built without AGG renderer);
1833     fi
1834     build_dump=no
1835   fi
1838 dnl Check possibility to build FB gui, if requested
1839 dnl FB dependency is a linux system (linux/fb.h)
1840 if test x"${build_fb}" != xno; then
1841   if test x"${linux}" = xyes; then
1842       build_fb=yes
1843   else
1844     if test x"${build_fb}" = xyes; then
1845       dnl SHOULD we just check at the end of file instead ?
1846       AC_MSG_ERROR(fb GUI cannot be built on non-linux platforms);
1847     fi
1848     AC_MSG_NOTICE([fb GUI won't be built (non-linux platform)])
1849     build_fb=no
1850   fi
1853 dnl TODO: add checks for all other GUIs
1855 dnl -------------------------------
1856 dnl Input Device selection
1857 dnl -------------------------------
1859 dnl Multiple input devices are supported. These can all work in
1860 dnl varying combinations, so several may be listed. These are only
1861 dnl required when using the Framebuffer, as without the X11 desktop,
1862 dnl Gnash has to handle all these internally. This can get
1863 dnl messy, as one might want to use a touchscreen with a normal mouse
1864 dnl or keyboard attached. 
1865 dnl By default, don't build any of these, as they are only for the Framebuffer
1866 dnl running without X11.
1867 if test x"${build_fb}" = xyes; then
1868   build_ps2mouse=no
1869   build_ps2keyboard=yes
1870   build_input_events=yes
1871   build_tslib=yes
1872   input_events="Input Devices, Touchscreen via Tslib"
1873 else
1874   build_ps2mouse=no
1875   build_ps2keyboard=no
1876   build_input_events=no
1877   build_tslib=no
1878   input_events=
1880 AC_ARG_ENABLE(input,
1881   AC_HELP_STRING([--enable-input=], [Enable support for the specified input devices for the framebuffer GUI (default=ps2mouse|ps2keyboard|events|touchscreen)]),
1882   [if test -n ${enableval}; then
1883     enableval=`echo ${enableval} | tr '\054' ' ' `
1884   fi
1885   while test -n "${enableval}" ; do
1886     val=`echo ${enableval} | cut -d ' ' -f 1`
1887     case "${val}" in
1888       ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
1889         build_ps2mouse=yes
1890         input_events="${input_events}, PS/2 Mouse"
1891         ;;
1892       ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
1893         build_ps2keyboard=yes
1894         input_events="${input_events}, PS/2 Keyboard"
1895         ;;
1896       i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
1897         input_events="${input_events}, Input Event Device"
1898         build_input_events=yes
1899         ;;
1900       t*|T*) dnl use a touchscreen with tslib, which works like a mouse
1901         build_tslib=yes
1902         input_events="${input_events}, Touchscreen"
1903         ;;
1904       *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: ps2mouse|keyboard|events,touchscreen)])
1905          ;;
1906       esac
1907     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1908     if test "x$val" = "x$enableval"; then
1909       break;
1910     fi
1911   done],
1914 if test x"${build_tslib}" = xyes; then
1915   AC_DEFINE(USE_TSLIB, [1], [Use a tslib supported touchscreen])
1916   GNASH_PKG_FIND(ts, [tslib.h], [Touchscreen library], ts_config)
1918 AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} != xno])
1920 if test x"${build_ps2mouse}" = xyes; then
1921   AC_DEFINE(USE_MOUSE_PS2, [1], [Add support for a directly using a PS/2 Mouse])
1923 AM_CONDITIONAL(ENABLE_MOUSE, [test x"${build_ps2mouse}" = xyes])
1925 if test x"${build_ps2keyboard}" = xyes; then
1926   AC_DEFINE(USE_KEYBOARD_PS2, [1], [Add support for directly using a PS/2 Keyboard])
1928 if test x"${build_input_events}" = xyes; then
1929   AC_DEFINE(USE_INPUT_EVENTS, [1], [Add support for a directly using Linux Input Event Devices])
1931 AM_CONDITIONAL(ENABLE_INPUT_EVENTS, [test x"${build_input_events}" = xyes])
1932 dnl this is enabled if we have any input devices at all
1933 AM_CONDITIONAL(ENABLE_INPUT_DEVICES, [test x"${input_events}" != x])
1936 dnl -----------------------------------------------------------
1937 dnl Try to ignore stupid dependencies
1938 dnl -----------------------------------------------------------
1940 AC_MSG_CHECKING(linker --as-needed support)
1941 gcc_cv_ld_as_needed=no
1942 # Check if linker supports --as-needed and --no-as-needed options
1943 if $LD --help 2>/dev/null | grep as-needed > /dev/null; then
1944   gcc_cv_ld_as_needed=yes
1946 if test x"$gcc_cv_ld_as_needed" = xyes; then
1947   LDFLAGS="$LDFLAGS -Wl,--as-needed"
1949 AC_MSG_RESULT($gcc_cv_ld_as_needed)
1951 AC_DEFINE(USE_GIF, [1], [Use the GIF library])
1952 AC_DEFINE(USE_PNG, [1], [Use the PNG library])
1953 AM_CONDITIONAL(USE_GIF, true)
1954 AM_CONDITIONAL(USE_PNG, true)
1956 AC_PATH_TOOL([AUTOTRACE], [autotrace])
1957 AC_HEADER_DIRENT
1959 dnl -----------------------------------------------------------------
1960 dnl PLUGIN RELATED STUFF
1961 dnl -----------------------------------------------------------------
1963 dnl !! This has been moved here to make --enable-npapi work
1964 dnl !! All of plugin-related macro calls could be moved into
1965 dnl !! a specialized macros/plugin.m4
1967 dnl ----------------------------------------------------
1968 dnl Add KPARTS support, if specified or KDE gui is built
1969 dnl ----------------------------------------------------
1971 AC_ARG_ENABLE(kparts3,
1972   AC_HELP_STRING([--disable-kparts3], [Disable support for Konqueror 3.x plugin (default: enabled if kde3 gui is)]),
1973 [case "${enableval}" in
1974   yes) build_kparts3=yes ;;
1975   no)  build_kparts3=no ;;
1976   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-kparts3 option]) ;;
1977 esac],build_kparts3=$build_kde3)
1979 dnl --------------------------------------------------------
1980 dnl Add KPARTS 4.x support, if specified or KDE gui is built
1981 dnl --------------------------------------------------------
1983 AC_ARG_ENABLE(kparts4,
1984   AC_HELP_STRING([--disable-kparts4], [Disable support for Konqueror 4.x plugin (default: enabled if Qt4 gui is)]),
1985 [case "${enableval}" in
1986   yes) build_kparts4=yes ;;
1987   no)  build_kparts4=no ;;
1988   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-kparts4 option]) ;;
1989 esac],build_kparts4=$build_qt4)
1991 if test x"${build_kparts4}" != xno; then
1992   GNASH_PATH_KDE4
1995 dnl -----------------------------------------------------------
1996 dnl Add NPAPI support, if specified or GTK or Qt4 gui is built
1997 dnl -----------------------------------------------------------
1999 AC_ARG_ENABLE(npapi,
2000   AC_HELP_STRING([--disable-npapi], [Disable NPAPI plugin build (default: enabled if gtk or Qt4 gui is)]),
2001   [case "${enableval}" in
2002     yes) npapi=yes ;;
2003     no)  npapi=no ;;
2004     *)   AC_MSG_ERROR([bad value ${enableval} for disable-npapi option]) ;;
2005   esac],
2006   if test x$build_gtk = xyes -o x$build_qt4 = xyes; then
2007     npapi=yes
2008   fi
2011 if test x"$npapi" = x"yes"; then
2012   GNASH_PATH_NPAPI
2015 dnl -----------------------------------------------------------------
2016 dnl Enable us to disable building all browser plugins in one command.
2017 dnl -----------------------------------------------------------------
2019 AC_ARG_ENABLE(plugins,
2020   AC_HELP_STRING([--disable-plugins], [Disable all browser plugins from building (default=no)]),
2021   [case "${enableval}" in
2022     yes) plugins=yes ;;
2023     no)  plugins=no ;;
2024     *)   AC_MSG_ERROR([bad value ${enableval} for disable-plugins option]) ;;
2025   esac],
2026   plugins=yes
2028 if test x$plugins = xno; then
2029   npapi=no
2030   build_kparts3=no
2031   build_kparts4=no
2035 GNASH_PATH_FIREFOX
2037 dnl 
2038 dnl New versions of the NPAPI require const for this prototype, which currently
2039 dnl seems to only be wit Ubuntu Oneiric.
2040 AC_MSG_CHECKING([for const needed for NPP_GetMIMEDescription() prototype])
2041 npapi_flags="`echo "${NPAPI_CFLAGS}" | sed -e 's/-I//' -e 's/-DXP_UNIX//' | tr -d ' '`/npapi.h"
2042 const_test="`grep NPP_GetMIMEDescription ${npapi_flags} | grep -c const`"
2043 if test ${const_test} -eq 1; then
2044   AC_DEFINE(NPAPI_CONST, [1], [Newer versions use const in prototypes])
2045   AC_MSG_RESULT([yes])
2046 else
2047   AC_MSG_RESULT([no])
2050 AC_TRY_COMPILE([#include <linux/input.h>], [
2051   struct input_absinfo abs;
2052   abs.resolution = 0;; ],
2053  AC_DEFINE([ABSINFO_RESOLUTION], [1], [ABS Resolution field])
2056 dnl -----------------------------------------------------------------
2057 dnl END OF PLUGIN RELATED STUFF
2058 dnl -----------------------------------------------------------------
2060 AM_CONDITIONAL(LIRC, [test x$lirc_ext = xyes])
2062 AC_CHECK_HEADERS(getopt.h)
2063 AC_CHECK_HEADERS(libgen.h)
2064 AC_CHECK_HEADERS(pwd.h)
2065 AC_CHECK_HEADERS(sys/utsname.h)
2066 AC_CHECK_HEADERS(signal.h)
2067 AC_CHECK_HEADERS(unistd.h)
2068 AC_CHECK_HEADERS(sys/time.h)
2069 AC_CHECK_LIB(bz2, BZ2_bzopen, [AC_SUBST(BZ2_LIBS, -lbz2)])
2070 AC_CHECK_LIB(c, getpwnam, AC_DEFINE(HAVE_GETPWNAM, 1, [Has getpwnam] ))
2072 dnl X11 is needed for fltk (at least),
2073 dnl and probably for many other guis too ...
2074 dnl if ! test x$build_fb = xyes; then # <--- this is wrong as build_x is non-exclusive
2075 dnl AC_PATH_XTRA
2076 dnl AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation)
2077 dnl AC_CHECK_LIB(gmp, _gmp_get_memory_functions)
2078 GNASH_PATH_X11
2079 AC_CHECK_LIB(Xi, XInput_find_display)
2080 AC_CHECK_LIB(X11, XDisableAccessControl)
2081 dnl fi
2082 AM_CONDITIONAL(HAVE_X11, [test x${has_x11} = xyes])
2083 if test x${build_x11_device} = xyes -a  x${has_x11} = xyes; then
2084   AC_DEFINE(BUILD_X11_DEVICE, [1], [Build the X11 device])
2087 dnl See if ipc_perm structure has the ipc_perm.key field, and if so,
2088 dnl which variant of the name is used.
2089 ipc_key=no
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  ipc_key=yes
2096  AC_DEFINE(IPC_PERM_KEY, [key], [Has the key field in ipc_perm])
2099 if test x$ipc_key = xno; then
2100   AC_TRY_COMPILE([
2101     #include <sys/ipc.h>
2102     #include <sys/shm.h>], [
2103     struct shmid_ds shmseg;      
2104     key_t x = shmseg.shm_perm.__key;],
2105     AC_DEFINE(IPC_PERM_KEY, [__key], [Has the key field in ipc_perm])
2106     ipc_key=yes
2107   )
2110 AC_CACHE_CHECK([for finite], ac_cv_finite,
2111  [AC_TRY_COMPILE([
2112    #include <math.h>
2113    #ifdef HAVE_IEEEFP_H
2114    #include <ieeefp.h>
2115    #endif],
2116  [double x; int y; y = finite(x);],
2117  ac_cv_finite=yes,
2118  ac_cv_finite=no
2120 if test x"$ac_cv_finite" = x"yes"; then
2121   AC_SEARCH_LIBS(finite, m,
2122     [AC_DEFINE(HAVE_FINITE, [1], [Has finite])]
2123   )
2126 AC_LANG_PUSH(C++)
2127 AC_CACHE_CHECK([for isfinite], ac_cv_isfinite,
2128  [AC_TRY_COMPILE([#include <cmath>],
2129  [using namespace std; double x; int y; y = isfinite(x);],
2130  ac_cv_isfinite=yes,
2131  ac_cv_isfinite=no
2133 AC_LANG_POP(C++)
2134 if test x"$ac_cv_isfinite" = x"yes"; then
2135   dnl Don't give up if isfinite is not found in -lm
2136   dnl isfinite is defined as a macro in C99.
2137   AC_SEARCH_LIBS(isfinite, m)
2138   AC_DEFINE(HAVE_ISFINITE, [1], [Has isfinite])
2141 AC_LANG_PUSH(C++)
2142 AC_CACHE_CHECK([whether $CXX implements __PRETTY_FUNCTION__], ac_cv_implements___PRETTY_FUNCTION__, [
2143   AC_TRY_LINK([#include <cstdio>
2144 ], 
2145     [ std::printf("%s", __PRETTY_FUNCTION__); ], 
2146     [ ac_cv_implements___PRETTY_FUNCTION__="yes" ],
2147     [ ac_cv_implements___PRETTY_FUNCTION__="no" ]
2148   )
2150 if test "x$ac_cv_implements___PRETTY_FUNCTION__" = "xyes" ; then
2151   AC_DEFINE(HAVE_PRETTY_FUNCTION, [1], [__PRETTY_FUNCTION__ is defined])
2154 AC_CACHE_CHECK([whether $CXX implements __FUNCTION__], ac_cv_implements___FUNCTION__, [
2155   AC_TRY_LINK([#include <cstdio>
2156 ], 
2157     [ std::printf("%s", __FUNCTION__); ], 
2158     [ ac_cv_implements___FUNCTION__="yes" ],
2159     [ ac_cv_implements___FUNCTION__="no" ]
2160   )
2162 if test "x$ac_cv_implements___FUNCTION__" = "xyes" ; then
2163   AC_DEFINE(HAVE_FUNCTION, [1], [__FUNCTION__ is defined])
2166 AC_CACHE_CHECK([whether $CXX implements __func__], ac_cv_implements___func__, [
2167   AC_TRY_LINK([#include <cstdio>
2168 ], 
2169     [ std::printf("%s", __func__); ], 
2170     [ ac_cv_implements___func__="yes" ],
2171     [ ac_cv_implements___func__="no" ]
2172   )
2174 if test "x$ac_cv_implements___func__" = "xyes" ; then
2175   AC_DEFINE(HAVE_func, [1], [__func__ is defined])
2177 AC_LANG_POP(C++)
2178 AC_REPLACE_FUNCS(getopt)
2180 dnl Date portability stuff, used in server/asobj/Date.cpp
2181 AC_CHECK_FUNCS(gettimeofday)
2182 AC_CHECK_FUNCS(ftime)
2183 AC_CHECK_FUNCS(tzset)
2184 AC_CHECK_FUNCS(localtime_r)
2186 AC_CACHE_CHECK([whether struct tm has tm_gmtoff], ac_cv_tm_gmtoff, [
2187         AC_TRY_LINK([
2188 /* ctime(1) says "The glibc version of struct tm has additional fields
2189  * defined  when _BSD_SOURCE was set before including <time.h>"
2190  * In practice, you do not need to define it yourself (tested on glibc-2.2.1 
2191  * and 2.3.6) but if you *do* define it yourself, it makes *all* functions
2192  * favour BSD-like behaviour over of GNU/POSIX, which seems dangerous.
2193  */
2194 // #define _BSD_SOURCE 1
2195 #include <time.h>
2196 ], 
2197                 [ struct tm tm; long l = tm.tm_gmtoff; ], 
2198                 [ ac_cv_tm_gmtoff="yes" ],
2199                 [ ac_cv_tm_gmtoff="no" ]
2200         )
2202 if test "x$ac_cv_tm_gmtoff" = "xyes" ; then
2203         AC_DEFINE(HAVE_TM_GMTOFF, [1], [struct tm has member tm_gmtoff])
2206 AC_CACHE_CHECK([whether timezone is a long], ac_cv_long_timezone, [
2207         AC_TRY_LINK([
2208 /* On Linux/glibc, tzset(3) says "extern long timezone;" (seconds West of GMT)
2209  * but on BSD char *timezone(int,int) is a function returning a string name.
2210  * The BSD function timegm() may be the equivalent, but this should
2211  * not be necessary because on BSD the code should use tm.tm_gmtoff instead
2212  * (use of long timezone is a fallback strategy for when tm_gmtoff exists not).
2213  */
2214 #include <stdio.h>
2215 #include <time.h>
2216 extern long timezone;
2217   ], 
2218     [ printf("%ld", timezone); ], 
2219     [ ac_cv_long_timezone="yes" ],
2220     [ ac_cv_long_timezone="no" ]
2221    )
2223 if test "x$ac_cv_long_timezone" = "xyes" ; then
2224   AC_DEFINE(HAVE_LONG_TIMEZONE, [1], [extern timezone is a long integer, not a function])
2227 AC_CHECK_FUNCS(mkstemps)
2228 AC_CHECK_FUNCS(sysconf)
2229 AC_CHECK_FUNCS(shmget shmat shmdt mmap)
2230 AC_CHECK_FUNCS(scandir)         dnl supported by BSD and Linux, but you never know...
2231 AC_CHECK_LIB(rt, clock_gettime)
2232 AC_CHECK_FUNC(clock_gettime, AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Has clock_gettime()] ))
2233 dnl Look for Win32 networking stuff
2234 AC_CHECK_HEADERS(winsock.h)
2235 AC_CHECK_HEADERS(winsock2.h)
2237 GNASH_PKG_FIND(nspr, [nspr.h], [Netscape Portable Runtime (NSPR)], PR_Init)
2239 AC_PATH_TOOL(WINDRES, [windres])
2240 AC_SUBST(WINDRES)
2242 GNASH_PKG_FIND(z, [zlib.h], [zlib compression library], compress)
2243 GNASH_PKG_FIND(jpeg, [jpeglib.h], [jpeg images], jpeg_mem_init)
2244 GNASH_PKG_FIND(png, [png.h], [png images], png_info_init)
2245 GNASH_PKG_FIND(gif, [gif_lib.h], [gif images], DGifOpen)
2246 if test x"${GIF_LIBS}" = x ; then
2247  GNASH_PKG_FIND(ungif, [gif_lib.h], [gif images], DGifOpen)
2248  GIF_LIBS=${UNGIF_LIBS}
2249  GIF_CFLAGS=${UNGIF_CFLAGS}
2251 if test x"$testsuite" = x"yes"; then
2252   GNASH_PKG_INCLUDES([dejagnu], [dejagnu.h])
2255 GNASH_PKG_FIND(speex, [speex.h], [speex audio codec], speex_decode_int)
2256 AM_CONDITIONAL(HAVE_SPEEX, [ test x$has_speex = xyes ])
2257 if test x$has_speex = xyes ; then
2258   AC_DEFINE([DECODING_SPEEX], [1], [Speex codec available])
2261 GNASH_PKG_FIND(speexdsp, [speex_resampler.h], [speex DSP utilities], speex_resampler_process_int)
2262 if test x$has_speexdsp = xyes ; then
2263   AC_DEFINE([RESAMPLING_SPEEX], [1], [Speex resampler available])
2266 dnl Find freetype and fontconfig
2267 GNASH_PATH_FREETYPE2
2268 GNASH_PKG_FIND(fontconfig, [fontconfig/fontconfig.h], [fontconfig library], FcFontMatch)
2270 if test x$cross_compiling = xno; then
2271   AC_PATH_MING
2274 if test x"$MING_VERSION_CODE" = x; then
2275  MING_VERSION_CODE=00000000
2278 AM_CONDITIONAL(ENABLE_MING,
2279         [ test x"$MAKESWF" != x -a $MING_VERSION_CODE -gt 00040000 ])
2281 AM_CONDITIONAL(MING_VERSION_0_4,
2282         [ test $MING_VERSION_CODE -ge 00040000  ])
2283 AM_CONDITIONAL(MAKESWF_SUPPORTS_PREBUILT_CLIPS,
2284         [ test $MING_VERSION_CODE -ge 00040002  ])
2285 AM_CONDITIONAL(MING_SUPPORTS_INIT_ACTIONS,
2286         [ test $MING_VERSION_CODE -ge 00040004  ])
2287 AM_CONDITIONAL(MING_SUPPORTS_REPLACE_TAG,
2288         [ test $MING_VERSION_CODE -ge 00040005 ])
2289 AM_CONDITIONAL(MING_SUPPORTS_SWFBUTTON_ADD_CHARACTER,
2290         [ test $MING_VERSION_CODE -ge 00040005 ])
2291 AM_CONDITIONAL(MING_SUPPORTS_STREAMING_SOUND,
2292         [ test $MING_VERSION_CODE -ge 00040006 ])
2293 AM_CONDITIONAL(MING_SUPPORTS_SWFBUTTON_SET_DEPTH,
2294         [ test $MING_VERSION_CODE -ge 00040006 ])
2295 AM_CONDITIONAL(MING_VERSION_0_4_3,
2296         [ test $MING_VERSION_CODE -ge 00040300 ])
2297 AM_CONDITIONAL(MING_VERSION_0_4_4,
2298         [ test $MING_VERSION_CODE -ge 00040400 ])
2300 if test x$cross_compiling = xno; then
2301     AC_ARG_WITH([swfdec_testsuite],
2302         AC_HELP_STRING([--with-swfdec-testsuite],
2303             [directory where swfdec testsuite (the 'test' dir) is]),
2304         if test x"${withval}" = xyes; then
2305             dir=`dirname $0`
2306             dir=`cd ${dir} && pwd`
2307             withval="${dir}/testsuite/swfdec/src/test"
2308         fi
2309         SWFDEC_TESTSUITE=${withval}
2310     )
2311     AC_SUBST(SWFDEC_TESTSUITE)
2313 AM_CONDITIONAL(ENABLE_SWFDEC_TESTSUITE, [ test x"$SWFDEC_TESTSUITE" != x ])
2315 if test x$cross_compiling = xno; then
2316   AC_ARG_ENABLE([http_testsuite],
2317       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2318           AC_HELP_STRING([--enable-http-testsuite=<baseurl>],
2319                   [Enable http based testsuite (default url is http://www.gnashdev.org/testcases)]),
2320               [case "${enableval}" in
2321              no) HTTP_TESTSUITE="" ;;
2322             yes) HTTP_TESTSUITE="http://www.gnashdev.org/testcases" ;;
2323               *) HTTP_TESTSUITE="${enableval}";;
2324            esac])
2325   AC_SUBST(HTTP_TESTSUITE)
2327 AM_CONDITIONAL(ENABLE_HTTP_TESTSUITE, [ test x"$HTTP_TESTSUITE" != x ])
2329 if test x$cross_compiling = xno; then
2330   AC_ARG_ENABLE([red5_testing],
2331       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2332           AC_HELP_STRING([--enable-red5-testing=<host>],
2333                   [Enable red5 based testing (default host is www.gnashdev.org)]),
2334               [case "${enableval}" in
2335              no) RED5_HOST="" ;;
2336             yes) RED5_HOST="www.gnashdev.org" ;;
2337               *) RED5_HOST="${enableval}";;
2338            esac])
2339   AC_SUBST(RED5_HOST)
2341 AM_CONDITIONAL(ENABLE_RED5_TESTING, [ test x"$RED5_HOST" != x ])
2343 if test x$cross_compiling = xno; then
2344   AC_ARG_ENABLE([rtmpy_testing],
2345       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2346           AC_HELP_STRING([--enable-rtmpy-testing=<host>],
2347                   [Enable rtmpy based testing (default host is www.gnashdev.org)]),
2348               [case "${enableval}" in
2349              no) RTMPY_HOST="" ;;
2350             yes) RTMPY_HOST="www.gnashdev.org" ;;
2351               *) RTMPY_HOST="${enableval}";;
2352            esac])
2353   AC_SUBST(RTMPY_HOST)
2355 AM_CONDITIONAL(ENABLE_RTMPY_TESTING, [ test x"$RTMPY_HOST" != x ])
2357 dnl The name might differ between systems.
2358 if test x"$testsuite" = x"yes"; then
2359 AC_PATH_PROGS(NETCAT, [nc netcat])
2360 AC_PATH_PROG(WGET, wget)
2362 AM_CONDITIONAL(HAS_NETCAT, [ test x"$NETCAT" != x ])
2363 AM_CONDITIONAL(HAS_WGET, [ test x"$WGET" != x ])
2366 dnl See if we can use the swfmill, mtasc, swfc and haxe based testsuites 
2368 if test x"$testsuite" = x"yes" -a x$cross_compiling = xno; then
2369   AC_PATH_PROG(AS3COMPILE, as3compile)
2370   AC_PATH_PROG(SWFC, swfc)
2371   AC_PATH_SWFMILL
2372   AC_PATH_MTASC
2373   AC_PATH_HAXE
2376 AM_CONDITIONAL(ENABLE_SWFMILL, [ test x"$SWFMILL" != x ])
2377 AM_CONDITIONAL(SWFMILL_AS3_SUPPORT,
2378         [ test x"$SWFMILL" != x && test $SWFMILL_VERSION -ge 00021206 ])
2380 dnl SWFMILL versions older than 0.3 didn't get function2 flags order correctly
2381 AM_CONDITIONAL(SWFMILL_FUNCTION2_FLAGS_ORDER_CORRECT,
2382         [ test x"$SWFMILL" != x && test $SWFMILL_VERSION -ge 00021206 ])
2384 AM_CONDITIONAL(ENABLE_AS3COMPILE, [ test x"$AS3COMPILE" != x ])
2385 AM_CONDITIONAL(ENABLE_MTASC, [ test x"$MTASC" != x ])
2386 AM_CONDITIONAL(ENABLE_HAXE, [ test x"$HAXE" != x ])
2387 AM_CONDITIONAL(ENABLE_SWFC, [ test x"$SWFC" != x ])
2388 AM_CONDITIONAL(ENABLE_HAXE, [ test x"$HAXE" != x ])
2390 AC_PATH_PROG(DOXYGEN, doxygen)
2391 AM_CONDITIONAL(ENABLE_DOXYGEN, [ test x"$DOXYGEN" != x ])
2393 AM_CONDITIONAL(HAVE_KDE3,    [test x$has_kde3 = xyes])
2394 AM_CONDITIONAL(HAVE_KDE4,    [test x$has_kde4 = xyes])
2395 AM_CONDITIONAL(HAVE_QT3,     [test x$has_qt3 = xyes])
2396 AM_CONDITIONAL(HAVE_QT4,     [test x$has_qt4 = xyes])
2398 AM_CONDITIONAL([QT_X11],     [test "$platform" = "X11"])
2399 AM_CONDITIONAL([QTOPIA],     [test "$platform" = "Qtopia"])
2400 AM_CONDITIONAL([QT_OSX],     [test "$platform" = "OSX"])
2401 AM_CONDITIONAL([QT_OS9],     [test "$platform" = "OS9"])
2402 AM_CONDITIONAL([QT_WIN32],   [test "$platform" = "Win32"])
2404 dnl Need GLIB for both GTK and GST
2405 if test x"${build_gtk}" = xyes -o x"${build_media_gst}" = xyes; then
2406   GNASH_PATH_GLIB
2409 AM_CONDITIONAL(HAVE_GLIB, [ test x"${has_glib}" = xyes ])
2411 if test x$npapi = xyes; then
2412   if ! test x$build_gtk = xyes -o x$build_qt4 = xyes; then
2413     AC_MSG_WARN(["Enabled NPAPI plugin, but it's not supported by the selected GUI"])
2414   fi
2417 if test x$windows = xyes -a x$npapi = xyes; then
2418   if test "x$NSPR_CFLAGS" = x -a "x$NSPR_LIBS" = x; then
2419     AC_MSG_ERROR(["On Win32, NPAPI plugin requires NSPR."])
2420   fi
2421   if test "x$WINDRES" = x; then
2422     AC_MSG_ERROR(["On Win32, NPAPI plugin requires windres."])
2423   fi
2426 dnl Need GLIB for NPAPI plugin
2427 if test x$npapi = xyes; then
2428   GNASH_PATH_GLIB
2431 dnl if kde isn't installed, even if it's specified, don't try to build
2432 dnl the KPARTS plugin, which is KDE based.
2433 if test x$has_kde3 = xno -a x$build_kparts3 = xyes; then
2434   build_kparts3=no
2435   AC_MSG_WARN(["Disabling KPARTS 3.x plugin, no KDE development found"])
2438 if test x$build_kde3 = xno -a x$build_kparts3 = xyes; then
2439   AC_MSG_WARN(["Enabled KPARTS 3.x plugin, but you aren't building a KDE based GUI!"])
2441 if test x$has_kde4 = xno -a x$build_kparts4 = xyes; then
2442   build_kparts4=no
2443   AC_MSG_WARN(["Disabling KPARTS 4.x plugin, no KDE 4.x development found"])
2446 if test x$build_qt4 = xno -a x$kparts4 = xyes; then
2447   AC_MSG_WARN(["Enabled KPARTS 4.x plugin, but you aren't building a KDE 4.x based GUI!"])
2450 AM_CONDITIONAL(BUILD_QTOPIA3_GUI,  [ test x$build_qtopia3 = xyes ])
2451 AM_CONDITIONAL(BUILD_QTOPIA4_GUI,  [ test x$build_qtopia4 = xyes ])
2453 AM_CONDITIONAL(BUILD_KDE3_GUI,     [ test x$build_kde3 = xyes ])
2454 AM_CONDITIONAL(BUILD_QT4_GUI,     [ test x$build_qt4 = xyes ])
2456 AM_CONDITIONAL(BUILD_GTK_GUI,      [ test x$build_gtk = xyes ])
2457 AM_CONDITIONAL(BUILD_FLTK_GUI,     [ test x$build_fltk = xyes ])
2458 AM_CONDITIONAL(BUILD_SDL_GUI,      [ test x$build_sdl = xyes ])
2459 AM_CONDITIONAL(BUILD_FB_GUI,       [ test x$build_fb = xyes ])
2460 AM_CONDITIONAL(BUILD_AQUA_GUI,     [ test x$build_aqua = xyes ])
2461 AM_CONDITIONAL(BUILD_DUMP_GUI,     [ test x$build_dump = xyes ])
2462 AM_CONDITIONAL(BUILD_AMIGAOS4_GUI, [ test x$build_aos4 = xyes ])
2463 AM_CONDITIONAL(BUILD_HAIKU_GUI,    [ test x$build_haiku = xyes ])
2465 # plugin building flags
2466 AM_CONDITIONAL(NPAPI,   [test x"${npapi}" = xyes])
2467 AM_CONDITIONAL(KPARTS3, [test x"${build_kparts3}" = xyes])
2468 AM_CONDITIONAL(KPARTS4, [test x"${build_kparts4}" = xyes])
2470 if test x"${build_gles1}"; then
2471   GNASH_PATH_GLES
2474 dnl only Linux supports /dev/fb0
2475 if test x"${build_rawfb_device}" = xyes -a x"${linux}" = xyes; then
2476    AC_DEFINE([BUILD_RAWFB_DEVICE], [1], [Use raw Framebuffer device support])
2479 if test x"${build_directfb_device}" = xyes; then
2480    GNASH_PKG_FIND(directfb, [directfb.h], [DirectFB render library], DirectFBCreate)
2481    AC_DEFINE([BUILD_DIRECTFB_DEVICE], [1], [Use DirectFB device support])
2484 AM_CONDITIONAL(BUILD_VAAPI_DEVICE, [test x"${use_libva}" = xyes])
2485 AM_CONDITIONAL(BUILD_EGL_DEVICE, [test x"${build_egl_device}" = xyes])
2486 AM_CONDITIONAL(BUILD_DIRECTFB_DEVICE, [ test x${build_directfb_device} = xyes])
2487 AM_CONDITIONAL(BUILD_RAWFB_DEVICE, [ test x${build_rawfb_device} = xyes])
2488 AM_CONDITIONAL(BUILD_X11_DEVICE, [test x${build_x11_device} = xyes])
2490 if test x"${build_gtk}" = xyes; then
2491   AC_ARG_ENABLE(ghelp,
2492     AC_HELP_STRING([--enable-ghelp], [Enable support for the GNOME help system]),
2493     [case "${enableval}" in
2494       yes) ghelp=yes ;;
2495       no)  ghelp=no ;;
2496       *)   AC_MSG_ERROR([bad value ${enableval} for enable-ghelp option]) ;;
2497     esac], ghelp=no
2498   )
2500   if test x"${ghelp}" = x"yes" ; then
2501     AC_PATH_PROG(SCROLLKEEPER, scrollkeeper-config, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2502     AC_PATH_PROG(SCROLLUPDATE, scrollkeeper-update, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2503     AC_PATH_PROG(SCROLLINSTALL, scrollkeeper-preinstall, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2505     if test x"$SCROLLKEEPER" = x -o x"$SCROLLUPDATE" = x -o x"$SCROLLINSTALL" = x ; then
2506       ghelp=no
2507       AC_MSG_WARN([You need to install scrollkeeper for gnome help])
2508     fi
2509   fi
2511 AM_CONDITIONAL(GHELP, [test x${ghelp} = xyes])
2513 if test x${build_fltk} = xyes; then
2514   GNASH_PKG_FIND(Xft, [Xft.h], [xft library], XftGlyphRender)
2517 dnl Some systems have a pervered set of dependencies.
2518 dnl Fedora Core 6 appears to have a dependency on expat for fontconfig.
2519 dnl We only need the library, but this is the easy wind to find it.
2520 GNASH_PKG_FIND(expat, [expat.h], [Expat library], XML_ErrorString)
2522 dnl these conditionals were moved out of kde.m4
2523 AM_CONDITIONAL(HAS_KDE3, [test x$has_kde3 = xyes])
2524 # used to disable x11-specific stuff on special platforms
2525 AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
2526 AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
2527 AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
2529 AM_CONDITIONAL(HAVE_GLEXT, [test x$glext = xyes])
2531 dnl We don't have GTKGLExt, so default to SDL, and don't build the Firefox plugin
2532 if test x$glext = xno -a x$build_ogl = xyes; then
2533   if test x$gtk2 = xyes -a x$build_gtk = xyes; then
2534     AC_ERROR([You have GTK installed, but not GtkGLExt. You need GtkGLExt to use the OpenGL renderer. Attempting to build SDL version])
2535   fi
2536   gui=sdl
2537   npapi=no
2538   AC_MSG_WARN([GTK2 specified for the GUI, but GtkGlExt is not present. Trying SDL instead.])
2541 missing_codecs=""
2542 if test x"$build_media_gst" = "xyes"; then
2543   AC_PATH_PROG(GST_INSPECT, gst-inspect, ,[${pathlist}])
2544   if test "x$GST_INSPECT" != "x" -a x"${darwin}" = xno ; then
2545     AC_PATH_PROG(GST_INSPECT, gst-inspect-0.10, ,[${pathlist}])
2546   fi
2547   if test "x$GST_INSPECT" != "x" -a x"${darwin}" = xno ; then
2548     dnl FIXME: there may be multiple acceptable plugins that are acceptable for
2549     dnl our use. For example, mad or FFmpeg will play mp3.
2550     codecs="ffdec_flv ffdec_flashsv ffdec_vp6f ffdec_flashsv mad vorbisdec ffdec_vp6"
2551     for i in $codecs; do
2552        hits="`$GST_INSPECT $i | grep -c 'Long name'`"
2553        if test $hits -eq 0; then
2554          missing_codecs="$missing_codecs $i"
2555          AC_MSG_WARN([Missing codec: $i])
2556        fi
2557     done
2558   fi
2559   GNASH_PKG_FIND(gstreamer_plugins_base, [gst/interfaces/probeprobe.h], [gstreamer interfaces library], gst_property_probe_probe_and_get_values_name, [0.10])
2560   GNASH_PKG_FIND(gstreamer_app, [gst/app/gstappsink.h], [gstreamer app library], call_gmon_start, [0.10])
2561   GNASH_PKG_FIND(gstreamer, [gst/gst.h], [gstreamer library], gst_init, [0.10])
2562   dnl if cross compiling, we're usually not going to be able to pop up
2563   dnl the codec installer to download the package to install, so disable
2564   dnl it if cross compiling with gstreamer support.
2565   if test x$cross_compiling = xno; then
2566     GNASH_PKG_FIND(gstreamer_pbutils, [gst/pbutils/install-plugins.h], [gstreamer PB Utils library], gst_install_plugins_supported, [0.10])
2567   fi
2568   dnl when cross compiling Gstreamer, not all supplied SDKs include all the
2569   dnl development libraries since most devices don't need to support plugin
2570   dnl development, only the runtime. In these caes we often have the header
2571   dnl files but not the libraries.
2572   if test x"${has_gstreamer_plugins_base}" = xyes; then
2573     GSTREAMER_LIBS="-lgstinterfaces-0.10 $GSTREAMER_LIBS"
2574     AC_DEFINE(HAS_GSTREAMER_PLUGINS_BASE, [1], [Has the Gstreamer Plugin Dev package installed])
2575   fi
2578 AM_CONDITIONAL(HAVE_CAIRO, [true])
2579 AM_CONDITIONAL(HAVE_OPENGL, [true])
2581 AM_CONDITIONAL(USE_SOUND_SDL, test x$build_sound_sdl = xyes)
2582 AM_CONDITIONAL(USE_SOUND_AHI, test x$build_sound_ahi = xyes)
2583 AM_CONDITIONAL(USE_SOUND_MKIT, test x$build_sound_mkit = xyes)
2584 AM_CONDITIONAL(USE_FFMPEG_ENGINE, test x"${build_media_ffmpeg}" = x"yes")
2585 AM_CONDITIONAL(USE_GST_ENGINE, test x"${build_media_gst}" = x"yes")
2586 AM_CONDITIONAL(HAVE_OPENGL, test x"${OPENGL_LIBS}" != x)
2587 dnl for now the Haiku media handler is experimental
2588 AM_CONDITIONAL(USE_HAIKU_ENGINE, test x"$build_media_haiku" = xyes)
2590 if test x"${build_media_ffmpeg}" = x"yes"; then
2591   AC_DEFINE([ENABLE_FFMPEG_MEDIA],  [1], [Use FFmpeg for media decoding])
2594 if test x"${build_media_gst}" = x"yes"; then
2595   AC_DEFINE([ENABLE_GST_MEDIA],  [1], [Use gstreamer for media decoding])
2598 if test x"${build_media_haiku}" = x"yes"; then
2599   AC_DEFINE([ENABLE_HAIKU_MEDIA],  [1], [Use haiku for media decoding])
2602 if test x$build_sound_mkit = xyes; then
2603   if test x"${haiku}" != xyes; then
2604     AC_MSG_ERROR([Media Kit sound handling is supported only under Haiku]);
2605   else
2606     AC_DEFINE([SOUND_MKIT],  [1], [Use Haiku Media Kit for sound handling])
2607   fi
2610 if test x"${build_sound_sdl}" = xyes; then
2611   AC_DEFINE([SOUND_SDL],  [1], [Use SDL for sound handling])
2614 if test x"${build_sound_ahi}" = xyes; then
2615   if test x"$amigaos4" != xyes; then
2616     AC_MSG_ERROR([AHI sound handling is supported only under AmigaOS]);
2617   else
2618     AC_DEFINE([SOUND_AHI],  [1], [Use AmigaOS AHI for sound handling])
2619   fi
2622 if test x$build_fltk = xyes; then
2623   GNASH_PKG_FIND(fltk2, [fltk/FL_API.h], [Fast Light Toolkit], fl_window_flush)
2624   if test x"${has_fltk2}" = xyes; then
2625     AC_CHECK_LIB(Xi, XInput_find_display,
2626       [AC_SUBST(FLTK2_LIBS, "$FLTK2_LIBS -lXi")])
2627   fi
2630 AM_CONDITIONAL(HAVE_FLTK2, [ test x$has_fltk2 = xyes ])
2631 AM_CONDITIONAL(HAS_XFT, [ test x$has_xft = xyes ])
2633 GNASH_DOCBOOK
2634 AM_CONDITIONAL(ENABLE_INFO, test x${INSTALL_INFO} != x)
2635 AM_CONDITIONAL(DOCBOOK, test x$docbook = xyes)
2636 AM_CONDITIONAL(ENABLE_TEXI, [ test x"$DB2X_TEXI" != x -o x"$DB2X_TEXIXML" != x ])
2637 AM_CONDITIONAL(ENABLE_PDF, [ test x"$DB2X_PDF" ])
2638 AM_CONDITIONAL(ENABLE_HTML, [ test x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
2639 AM_CONDITIONAL(ENABLE_FOP, [ test x"$FOP" != x -a x"$docbook_styles" != x ])
2640 AM_CONDITIONAL(ENABLE_XMLTEX, [ test x"$PDFXMLTEX" != x -a x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
2641 AM_CONDITIONAL(ENABLE_MAN, [ test x"$DB2X_MAN" != x -o x"$DB2X_MANXML" != x ])
2642 AM_CONDITIONAL(HAVE_AGG, [test x"${AGG_LIBS}" != x])
2644 GNASH_PATH_CURL
2646 dnl Define winsock if we're on windows. We could do something complicated,
2647 dnl but since AC_EXEEXT does it for us, we'll do this the easy way.
2648 if test x"$EXEEXT" = "exe"; then
2649   AC_DEFINE(HAVE_WINSOCK,1,[This is defined is we are on Win32])
2652 dnl ****************************************
2653 dnl *** Check for ELF visibility support ***
2654 dnl ****************************************
2656 AC_ARG_ENABLE([visibility],
2657   AC_HELP_STRING([--enable-visibility], [Use ELF visibility attributes]), [], [enable_visibility=no])
2659 if test x"$enable_visibility" != x"no"; then
2660   dnl Check whether the compiler supports the visibility attribute
2661   save_CFLAGS="$CFLAGS"
2662   CFLAGS="$CFLAGS -Wall -Werror"
2663   AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute])
2664   AC_COMPILE_IFELSE([AC_LANG_SOURCE(
2665     [
2666       void __attribute__ ((visibility("default"))) test_default (void) {}
2667       void __attribute__ ((visibility("hidden"))) test_hidden (void) {}
2668       int main (int argc, char **argv) { test_default (); test_hidden (); return 0; }
2669     ])],
2670     [
2671       AC_DEFINE([HAVE_GNUC_VISIBILITY], [1], [Define this for GCC-visibility.])
2672       AC_MSG_RESULT([yes])
2673     ],
2674     [
2675       AC_MSG_RESULT([no])
2676     ]
2677   )
2678   CFLAGS="$save_CFLAGS"
2681 AC_ARG_ENABLE([pch],
2682   AC_HELP_STRING([--enable-pch], [Enable precompiled header support]), [], [enable_pch=no])
2684 AM_CONDITIONAL([ENABLE_PCH], [test x"$enable_pch" != x"no"])
2686 PCH_FLAGS="-include all-includes.h -Winvalid-pch"
2687 AC_SUBST(PCH_FLAGS)
2689 GNASH_PATH_PTHREADS
2691 GNASH_PATH_BOOST
2693 AC_ARG_ENABLE([strict],
2694   AC_HELP_STRING([--enable-strict],[Accept only standards compliant code (GCC only)]),
2695   [case "${enableval}" in
2696     yes) strict=yes ;;
2697     no) strict=no ;;
2698     *) AC_MSG_ERROR([bad value ${enableval} for --enable-strict option]) ;;
2699   esac],
2700   [strict=no]
2703 if test x"$strict" = x"yes" -a x$build_agg = xyes; then
2704    AC_MSG_ERROR([agg renderer will fail with --enable-strict.]);        
2707 # We want warnings, lots of warnings  :-)
2708 # It should be possible to build with -ansi, not with
2709 # -pedantic because of agg.
2711 # -ansi was actually dropped because it hides 'fileno', which
2712 # is used in a few places
2714 if test x"$GCC" = x"yes"; then
2715   CXXFLAGS="$CXXFLAGS \
2716     $CROSS_CXXFLAGS \
2717     -W \
2718     -Wall \
2719     -Wcast-align \
2720     -Wcast-qual \
2721     -Wpointer-arith \
2722     -Wreturn-type \
2723     -Wnon-virtual-dtor \
2724     -Wunused \
2725     "
2726   CFLAGS="$CFLAGS \
2727     $CROSS_CXXFLAGS \
2728     -W \
2729     -Wall \
2730     -Wcast-align \
2731     -Wcast-qual \
2732     -Wpointer-arith \
2733     -Wreturn-type \
2734     -Wmissing-declarations \
2735     -Wmissing-prototypes \
2736     -Wstrict-prototypes \
2737     "
2738   if test x"$strict" = x"yes"; then
2739     CXXFLAGS="$CXXFLAGS \
2740       -Wextra \   
2741       -pedantic \
2742       -Wno-long-long \
2743       "
2745     CFLAGS="$CFLAGS \
2746       -pedantic \
2747       -Wno-long-long \
2748       -ansi \
2749       "
2750   fi
2753 AC_ARG_ENABLE([cassert],
2754   AC_HELP_STRING([--disable-cassert],[Disable assertion checking]),
2755   [case "${enableval}" in
2756     yes) cassert=yes ;;
2757     no) cassert=no ;;
2758     *) AC_MSG_ERROR([bad value ${enableval} for --enable-cassert option]) ;;
2759   esac],
2760   [cassert=yes]
2763 if test x"$cassert" = x"no"; then
2764     CXXFLAGS="$CXXFLAGS \
2765       -DNDEBUG \
2766       "
2767     CFLAGS="$CFLAGS \
2768       -DNDEBUG \
2769       "
2772 dnl /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
2773 AC_DEFUN([CHECK_VISIBILITY_GCC_BUG],
2774   [
2775     AC_CACHE_CHECK([if -fvisibility-inlines-hidden is broken], ac_cv_gcc_visibility_bug, [
2776         AC_LANG_PUSH(C++)
2777         save_CXXFLAGS=$CXXFLAGS
2778         save_LDFLAGS=$LDFLAGS
2779         CXXFLAGS="-fPIC -fvisibility-inlines-hidden -O0"
2780         LDFLAGS="$LDFLAGS -shared -fPIC"
2782         AC_TRY_LINK(
2783         [          
2784           template<typename CharT>
2785           struct VisTest
2786           {
2787             inline VisTest ();
2788           };
2789           template<typename CharT>
2790           inline VisTest<CharT>::VisTest()
2791         {}
2792         extern template class VisTest<char>;  // It works if we drop that line
2793         int some_function( int do_something ) __attribute__((visibility("default")));
2794         int some_function( int )
2795           {
2796             VisTest<char> a;
2797             return 0;
2798           }
2799         ], [],
2800         ac_cv_gcc_visibility_bug=no, ac_cv_gcc_visibility_bug=yes)
2802         CXXFLAGS=$save_CXXFLAGS
2803         LDFLAGS=$save_LDFLAGS
2804         AC_LANG_POP(C++)
2805       ]
2806     )
2807     if test x$ac_cv_gcc_visibility_bug = xno; then
2808       CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
2809     fi
2810   ]
2813 CHECK_VISIBILITY_GCC_BUG
2815 if test x$ac_cv_gcc_visibility_bug = xno; then
2816   AC_LANG_PUSH(C++)
2817   AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
2818   save_CXXFLAGS=$CXXFLAGS
2819   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
2820   AC_LINK_IFELSE([AC_LANG_PROGRAM()], 
2821                  [ac_cv_gcc_visibility=yes;
2822                   AC_MSG_RESULT([yes])],
2823                  [ac_cv_gcc_visibility=no;
2824                   AC_MSG_RESULT([no])]);
2825   CXXFLAGS="$save_CXXFLAGS"
2826   AC_LANG_POP(C++)
2830 AM_CONDITIONAL(VISIBILITY_WORKS, test x"$ac_cv_gcc_visibility" = xyes)
2832 if test x"$ac_cv_gcc_visibility" = xyes -a x"$enable_visibility" != xno; then
2833   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
2836 dnl Define convenience constants so Gnash can print out the
2837 dnl default configuration of the build.
2838 RENDERER_CONFIG="${renderer_list}"
2839 RENDERER_LIBS=
2840 for rend in `echo "${add_renderer}" | tr ',' ' '`; do
2841         RENDERER_LIBS="${RENDERER_LIBS} \$(top_builddir)/librender/libgnash${rend}.la"
2842 done
2843 AC_SUBST(RENDERER_LIBS)
2844 AC_SUBST(RENDERER_CONFIG)
2846 HWACCEL_CONFIG="${device_list}"
2847 AC_SUBST(HWACCEL_CONFIG)
2849 dnl check for missing libraries and disable them.
2850 if test x"$BOOST_LIBS" != x; then
2851   if test x"${cygnal_missing_libs}" != x; then
2852     for i in ${cygnal_missing_libs}; do
2853       if test $i = serialization; then
2854         AC_DEFINE([BOOST_MULTI_INDEX_DISABLE_SERIALIZATION], ["1"], [if the library is missing, don't use it.])
2855       fi
2856     done
2857   fi
2860 dnl ========= Check for GConf
2862 AC_MSG_CHECKING([whether GConf support is requested])
2863 AC_ARG_WITH([gconf],
2864   [AS_HELP_STRING([--without-gconf],
2865           [Disable the use of gconf])],
2866   [],
2867   [case "${host}" in
2868     *-cygwin* | *-mingw* | *-pw32*) with_gconf=no ;;
2869     *) with_gconf=yes ;;
2870    esac])
2871 AC_MSG_RESULT([$with_gconf])
2873 AM_CONDITIONAL([WITH_GCONF],[test "$with_gconf" = "yes"])
2875 if test "$with_gconf" = "yes"; then
2876    PKG_CHECK_MODULES([GCONF],[gconf-2.0])
2877    AC_DEFINE([WITH_GCONF],[1],[Define if GConf support is enabled])
2879    AM_GCONF_SOURCE_2
2881    AC_PATH_PROG([GCONFTOOL], [gconftool-2], [false])
2882    if test "$GCONFTOOL" = "false"; then
2883       AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
2884    fi
2885 else
2886    AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL],false)
2890 CYGNAL_PATHS
2892 SUPPORTED_GUIS=
2893 if test x$build_qtopia3 = xyes; then
2894   SUPPORTED_GUIS="${SUPPORTED_GUIS},qtopia3"
2896 if test x$build_qtopia4 = xyes; then
2897   SUPPORTED_GUIS="${SUPPORTED_GUIS},qtopia4"
2899 if test x$build_fb = xyes; then
2900   SUPPORTED_GUIS="${SUPPORTED_GUIS},fb"
2902 if test x$build_fltk = xyes; then
2903   SUPPORTED_GUIS="${SUPPORTED_GUIS},fltk"
2905 if test x$build_kde3 = xyes; then
2906   SUPPORTED_GUIS="${SUPPORTED_GUIS},kde3"
2908 if test x$build_qt4 = xyes; then
2909   SUPPORTED_GUIS="${SUPPORTED_GUIS},qt4"
2911 if test x$build_gtk = xyes; then
2912   SUPPORTED_GUIS="${SUPPORTED_GUIS},gtk"
2914 if test x$build_sdl = xyes; then
2915   SUPPORTED_GUIS="${SUPPORTED_GUIS},sdl"
2917 if test x$build_aqua = xyes; then
2918   SUPPORTED_GUIS="${SUPPORTED_GUIS},aqua"
2920 if test x$build_dump = xyes; then
2921   SUPPORTED_GUIS="${SUPPORTED_GUIS},dump"
2923 if test x$build_aos4 = xyes; then
2924   SUPPORTED_GUIS="${SUPPORTED_GUIS},aos4"
2926 if test x$build_haiku = xyes; then
2927   SUPPORTED_GUIS="${SUPPORTED_GUIS},haiku"
2929 SUPPORTED_GUIS="`echo ${SUPPORTED_GUIS} | sed 's/,//'`" # Strip leading comma
2930 AC_SUBST(SUPPORTED_GUIS)
2932 AC_CONFIG_LINKS(cygnal/testsuite/cygnal.all/cygnalrc:cygnal/testsuite/cygnal.all/cygnalrc.in)
2933 AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc:testsuite/libbase.all/gnashrc.in)
2934 AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc-local:testsuite/libbase.all/gnashrc-local.in)
2936 AC_CONFIG_FILES(
2937 gnash.pc:gnash.pc.in
2938 desktop/gnash-gtk-launcher:desktop/gnash-gtk-launcher.in
2939 desktop/gnash-qt-launcher:desktop/gnash-qt-launcher.in
2942 AC_OUTPUT(Makefile
2943 desktop/Makefile
2944 po/Makefile
2945 libmedia/Makefile
2946 libsound/Makefile
2947 libbase/Makefile
2948 libcore/Makefile
2949 libcore/vm/Makefile
2950 libcore/parser/Makefile
2951 librender/Makefile
2952 utilities/Makefile
2953 doc/Makefile
2954 doc/C/Makefile
2955 doc/Doxyfile
2956 testsuite/Makefile
2957 testsuite/media/Makefile
2958 testsuite/libbase.all/Makefile
2959 testsuite/as3compile.all/Makefile
2960 testsuite/actionscript.all/Makefile
2961 testsuite/samples/Makefile
2962 testsuite/swfdec/Makefile
2963 testsuite/misc-ming.all/Makefile
2964 testsuite/misc-ming.all/action_order/Makefile
2965 testsuite/misc-ming.all/sound/Makefile
2966 testsuite/misc-ming.all/displaylist_depths/Makefile
2967 testsuite/misc-ming.all/init_action/Makefile
2968 testsuite/misc-ming.all/loop/Makefile
2969 testsuite/misc-ming.all/loading/Makefile
2970 testsuite/misc-ming.all/register_class/Makefile
2971 testsuite/misc-mtasc.all/Makefile
2972 testsuite/misc-haxe.all/Makefile
2973 testsuite/misc-haxe.all/classes.all/Makefile
2974 testsuite/misc-swfmill.all/Makefile
2975 testsuite/misc-swfmill.all/trace-as2/Makefile
2976 testsuite/misc-swfmill.all/trace-as3/Makefile
2977 testsuite/misc-swfc.all/Makefile
2978 testsuite/network.all/Makefile
2979 testsuite/movies.all/Makefile
2980 testsuite/libcore.all/Makefile
2981 testsuite/libmedia.all/Makefile
2982 gui/Makefile
2983 gui/Info.plist
2984 gui/pythonmod/Makefile
2985 extensions/Makefile
2986 extensions/dejagnu/Makefile
2987 extensions/mysql/Makefile
2988 extensions/fileio/Makefile
2989 extensions/gtk2/Makefile
2990 extensions/lirc/Makefile
2991 extensions/dbus/Makefile
2992 plugin/Makefile
2993 plugin/npapi/Makefile
2994 plugin/klash/Makefile
2995 plugin/klash4/Makefile
2996 plugin/win32/Makefile
2997 plugin/aos4/Makefile
2998 libdevice/Makefile
2999 cygnal/Makefile
3000 cygnal/libnet/Makefile
3001 cygnal/libamf/Makefile
3002 cygnal/cgi-bin/Makefile
3003 cygnal/cgi-bin/echo/Makefile
3004 cygnal/cgi-bin/oflaDemo/Makefile
3005 cygnal/cgi-bin/fitcDemo/Makefile
3006 cygnal/testsuite/Makefile
3007 cygnal/testsuite/libamf.all/Makefile
3008 cygnal/testsuite/libnet.all/Makefile
3009 cygnal/testsuite/cygnal.all/Makefile
3013 ########################## Final report begins... ############################
3016 dnl Create temporary directory in a secure way
3017 tmp=`mktemp -d ${TMPDIR=/tmp}/gnash-configure-XXXXXX`
3018 if test \! -n "$tmp" || test \! -d "$tmp"; then
3019   tmp=`(umask 077 && mkdir -d ${TMPDIR=/tmp}/gnash-configure-${RANDOM}-$$) 2>/dev/null`
3021 cerr="${tmp}/errors"
3022 cwarn="${tmp}/warnings"
3023 crec="${tmp}/recommended"
3024 deb_err="${tmp}/deb_err"
3025 deb_war="${tmp}/deb_war"
3026 deb_rec="${tmp}/deb_rec"
3027 rpm_err="${tmp}/rpm_err"
3028 rpm_war="${tmp}/rpm_war"
3029 rpm_rec="${tmp}/rpm_rec"
3030 yast_err="${tmp}/yast_err"
3031 yast_war="${tmp}/yast_war"
3032 yast_rec="${tmp}/yast_rec"
3033 echo ""
3035 #trap 'rm cerr' 0 # trap isn't a good idea, might override other traps
3036 exec 3> $cerr 
3037 exec 4> $cwarn
3038 exec 5> $crec
3040 for F in "$deb_err" "$deb_war" "$deb_rec" "$rpm_err" "$rpm_war" "$rpm_rec" "$yast_err" "$yast_war" "$yast_rec"; do
3041   touch "$F";
3042 done
3044 pkg_out_fd=
3045 deb_dest=
3046 rpm_dest=
3047 yast_dest=
3049 dnl These macros should be portable as I checked most things used are in
3050 dnl POSIX-2008, GNU CoreUtils, and shipped in MinGW. Old unices? No clue.
3051 dnl In any case, they are hardly relevant on non-GNU systems.
3053 dnl Beware, here comes some long scary shell commands.
3055 AC_DEFUN([PKG_ERR],
3057   pkg_out_fd=3
3058   echo "          ERROR: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3059   deb_dest="$deb_err"
3060   rpm_dest="$rpm_err"
3061   yast_dest="$yast_err"
3064 AC_DEFUN([PKG_WAR],
3066   pkg_out_fd=4
3067   echo "        WARNING: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3068   deb_dest="$deb_war"
3069   rpm_dest="$rpm_war"
3070   yast_dest="$yast_war"
3073 AC_DEFUN([PKG_REC],
3075   pkg_out_fd=5
3076   echo "    RECOMMENDED: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3077   deb_dest="$deb_rec"
3078   rpm_dest="$rpm_rec"
3079   yast_dest="$yast_rec"
3082 AC_DEFUN([PKG_SUGGEST],
3084   echo "`echo "$1" | fold -s -w 62 | sed 's/^/                 /'`" >&$pkg_out_fd
3087 AC_DEFUN([DEB_INSTALL],
3089   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
3090   echo -n " $1" >> "$deb_dest"
3093 AC_DEFUN([DEB_ALTERNATIVE],
3095   echo "                 or maybe     : `echo "apt-get install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3096   echo -n "/$1" >> "$deb_dest"
3099 AC_DEFUN([RPM_INSTALL],
3101   echo "                 or .rpm users: `echo "yum install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3102   echo -n " $1" >> "$rpm_dest"
3105 AC_DEFUN([RPM_ALTERNATIVE],
3107   echo "                 or maybe     : `echo "yum install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3108   echo -n "/$1" >> "$rpm_dest"
3111 AC_DEFUN([YAST_INSTALL],
3113   echo "                 or yast users: `echo "yast install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3114   echo -n " $1" >> "$yast_dest"
3117 AC_DEFUN([YAST_ALTERNATIVE],
3119   echo "                 or maybe     : `echo "yast install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3120   echo -n "/$1" >> "$yast_dest"
3123 AC_DEFUN([PKG_ALTERNATIVE],
3125   echo "`echo "$1" | fold -s -w 62 | sed 's/^/                 /'`" >&$pkg_out_fd
3128 echo "Configurable options are:"
3130 if test x"${pthreads}" = x"yes"; then
3131   echo "        POSIX Threads support enabled (default)"
3132 else
3133   if test x"${build_haiku}" = x"yes"; then
3134      echo "        POSIX Thread support built into C library."
3135   else
3136      echo "        POSIX Thread support disabled."
3137   fi
3140 if test x"${npapi}" = x"yes"; then
3141   echo "        NPAPI plugin enabled (default). Use --disable-npapi to disable."
3142   echo "        NPAPI plugin will be installed in ${FIREFOX_PLUGINS}"
3143 else
3144   echo "        NPAPI plugin disabled."
3147 if test x"${build_kparts3}" = x"yes"; then
3148   echo "        KPARTS 3.x plugin enabled (default). Use --disable-kparts3 to disable"
3149   echo "            KPARTS 3.x plugin will be installed in ${KDE3_PLUGINDIR}"
3150   echo "            KPARTS 3.x service will be installed in ${KDE3_SERVICESDIR}"
3151   echo "            KPARTS 3.x config dir will be in ${KDE3_CONFIGDIR}"
3152   echo "            KPARTS 3.x appsdata will be installed in ${KDE3_APPSDATADIR}"
3153 else
3154   echo "        KPARTS 3.x plugin disabled."
3157 if test x"${build_kparts4}" = x"yes"; then
3158   echo "        KPARTS 4.x plugin enabled (default). Use --disable-kparts4 to disable"
3159   echo "            KPARTS 4.x plugin will be installed in ${KDE4_PLUGINDIR}"
3160   echo "            KPARTS 4.x service will be installed in ${KDE4_SERVICESDIR}"
3161   echo "            KPARTS 4.x config dir will be in ${KDE4_CONFIGDIR}"
3162   echo "            KPARTS 4.x appsdata will be installed in ${KDE4_APPSDATADIR}"
3163 else
3164   echo "        KPARTS 4.x plugin disabled."
3167 # set a variable if we shouldn't continue. This way we can print
3168 # out everything that is missing in one pass, hopefully making it
3169 # easy for new developers to get everything they need installed.
3171 echo ""
3172 echo "Configured paths for ${build} are:"
3174 dnl Dump QT3 options is the user specified a QTOPIA3 or KDE3 GUI
3175 if test x"${build_kde3}" = xyes -o x"${build_qtopia3}" = xyes; then
3176   if test x"${has_qt3}" = xyes; then
3177     echo "        QT3 flags are: ${QT3_CFLAGS}"
3178     echo "        QT3 libs are: ${QT3_LIBS}"
3179   else
3180     PKG_ERR([No QT 3.x development package installed!])
3181     PKG_SUGGEST([Install a QT 3.x development environment from http://qt.nokia.com/])
3182     DEB_INSTALL([libqt3-mt-dev])
3183     RPM_INSTALL([qt3-devel])
3184     RPM_ALTERNATIVE([qt-devel])
3185     PKG_ALTERNATIVE([or change to a different gui with --enable-gui=...])
3186   fi
3189 dnl Dump QT4 options is the user specified a QTOPIA4 or Qt4 GUI
3190 if test x"${build_qt4}" = xyes -o x"${build_qtopia4}" = xyes; then
3191   if test x"${has_qt4}" = xyes; then
3192     echo "        QT4 flags are: ${QT4_CFLAGS}"
3193     echo "        QT4 libs are: ${QT4_LIBS}"
3194   else
3195     PKG_ERR([No QT 4.x development package installed!])
3196     PKG_SUGGEST([Install a QT 4.x development environment from http://qt.nokia.com/])
3197     DEB_INSTALL([libqt4-dev])
3198     DEB_ALTERNATIVE([qt4-dev-tools]) dnl TODO: Is this required?
3199     RPM_INSTALL([qt4-devel])
3200     RPM_ALTERNATIVE([qt-devel])
3201     PKG_ALTERNATIVE([or change to a different gui with --enable-gui=...])
3202   fi
3205 if test x"${build_kparts4}" = xyes; then
3206   if test x"${has_kde4}" = xyes; then
3207     echo "        KDE4 flags are: ${KDE4_CFLAGS}"
3208     echo "        KDE4 libs are: ${KDE4_LIBS}"
3209   else
3210     PKG_WAR([kparts4 plugin is disabled!])
3211     PKG_SUGGEST([Install version 4.x of the KDE development environment from http://kde.org])
3212     DEB_INSTALL([kdelibs5-dev])
3213     RPM_INSTALL([kdelibs-devel])
3214   fi
3217 if test x"$build_qtopia3" = xyes; then
3218   if test x"${QTOPIA3_LIBS}" != x ; then
3219     if test x"${QTOPIA3_CFLAGS}" != x ; then
3220       echo "        QTOPIA 3.x flags are: $QTOPIA3_CFLAGS"
3221     else
3222       echo "        QTOPIA 3.x flags are: default include path"
3223     fi
3224     echo "        QTOPIA 3.x libs are: $QTOPIA3_LIBS"
3225   else
3226     PKG_ERR([No QTOPIA 3.x library development package installed!])
3227     PKG_SUGGEST([Install it from http://trolltech.com/downloads/ as binary packages are not available.]) dnl TODO: This link is no longer valid.
3228   fi
3231 if test x"$build_qtopia4" = xyes; then
3232   if test x"${QTOPIA4_LIBS}" != x ; then
3233     if test x"${QTOPIA4_CFLAGS}" != x ; then
3234       echo "        QTOPIA 4.x flags are: $QTOPIA4_CFLAGS"
3235     else
3236       echo "        QTOPIA 4.x flags are: default include path"
3237     fi
3238     echo "        QTOPIA 4.x libs are: $QTOPIA4_LIBS"
3239   else
3240     PKG_ERR([No QTOPIA 4.x library development package installed!])
3241     PKG_SUGGEST([Install it from http://trolltech.com/downloads/ as binary packages are not available.]) dnl TODO: This link is no longer valid.
3242   fi
3246 # -o x$build_kparts3 = xyes
3247 if test x$build_kde3 = xyes; then
3248   if test x"$has_kde3" = xyes; then
3249     echo "        KDE 3.x flags are: $KDE3_CFLAGS"
3250     echo "        KDE 3.x libs are: $KDE3_LIBS"
3251   else
3252     PKG_ERR([No KDE 3.x development package installed!])
3253     PKG_SUGGEST([Install version 3.x of the KDE development environment from http://kde.org])
3254     DEB_INSTALL([kdelibs4-dev])
3255     RPM_INSTALL([kdelibs3-devel])
3256     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.])
3257   fi
3260 if test x"${JPEG_LIBS}" != x ; then
3261   if test x"${JPEG_CFLAGS}" != x ; then
3262     echo "        JPEG flags are: $JPEG_CFLAGS"
3263   else
3264     echo "        JPEG flags are: default include path"
3265   fi
3266   echo "        JPEG libs are: $JPEG_LIBS"
3267 else
3268   PKG_ERR([No JPEG library development package installed!])
3269   PKG_SUGGEST([Install it from http://ijg.org])
3270   DEB_INSTALL([libjpeg-dev])
3271   RPM_INSTALL([libjpeg-devel])
3274 if test x"${GIF_LIBS}" != x ; then
3275   if test x"${GIF_CFLAGS}" != x ; then
3276     echo "        GIF flags are: $GIF_CFLAGS"
3277   else
3278     echo "        GIF flags are: default include path"
3279   fi
3280   echo "        GIF libs are: $GIF_LIBS"
3281 else
3282   PKG_ERR([No GIF library development package installed!])
3283   PKG_SUGGEST([Install it from http://sourceforge.net/projects/giflib/])
3284   DEB_INSTALL([libungif-dev])
3285   DEB_ALTERNATIVE([libgif-dev])
3286   RPM_INSTALL([libgif-devel])
3287   RPM_ALTERNATIVE([giflib-devel])
3288   RPM_ALTERNATIVE([libungif-devel])
3291 if test x"${PNG_LIBS}" != x ; then
3292   if test x"${PNG_CFLAGS}" != x ; then
3293     echo "        PNG flags are: $PNG_CFLAGS"
3294   else
3295     echo "        PNG flags are: default include path"
3296   fi
3297   echo "        PNG libs are: $PNG_LIBS"
3298 else
3299   PKG_REC([No PNG library development package installed!])
3300   PKG_SUGGEST([Gnash will be built without support for dynamic loading of PNG files.])
3301   PKG_SUGGEST([Install it from http://www.libpng.org])
3302   DEB_INSTALL([libpng12-dev])
3303   RPM_INSTALL([libpng-devel])
3306 if test x"${build_ovg}" = x"yes"; then
3307   if test x"${has_openvg}" = xyes; then
3308     echo "        OpenVG flags are: $OPENVG_CFLAGS"
3309     echo "        OpenVG libs are: $OPENVG_LIBS"
3310     else
3311       echo "        ERROR: No OpenVG development package installed!" >&3
3312       echo "               You need to install the libmesa development package" >&3
3313       echo "               or .deb users: apt-get install libopenvg1-mesa-dev" >&3
3314       echo "               or .rpm users: yum install mesa-libOpenVG-devel-7.8.1-7.fc13.i686" >&3
3315       echo "               or use a different renderer with --enable-renderer=" >&3
3316   fi
3319 if test x"${build_ogl}" = x"yes"; then
3320   if test x"$OPENGL_LIBS" != x; then
3321     if test x"$OPENGL_CFLAGS" != x; then
3322       echo "        OpenGL flags are: $OPENGL_CFLAGS"
3323     else
3324       echo "        OpenGL flags are: default include path"
3325     fi
3326     echo "        OpenGL libs are: $OPENGL_LIBS"
3327     else
3328       PKG_ERR([No OpenGL development package installed!])
3329       PKG_SUGGEST([You need to install the libmesa development package])
3330       DEB_INSTALL([libgl1-mesa-dev])
3331       RPM_INSTALL([mesa-libGL-devel])
3332       RPM_ALTERNATIVE([xorg-x11-Mesa-libGL])
3333       PKG_ALTERNATIVE([or use a different renderer with --enable-renderer=])
3334   fi
3337 if test x"${build_gles1}" = x"yes"; then
3338   if test x"${has_gles1}" = xyes; then
3339     if test x"${GLES1_CFLAGS}" != x; then
3340       echo "        OpenGLES1 flags are: ${GLES1_CFLAGS}"
3341     else
3342       echo "        OpenGLES1 flags are: default include path"
3343     fi
3344     echo "        OpenGLES1 libs are: ${GLES1_LIBS}"
3345   else
3346       PKG_ERR([No OpenGL-ES development package installed!])
3347       PKG_SUGGEST([You need to install the this from source probably])
3348       PKG_ALTERNATIVE([or use a different renderer with --enable-renderer=])
3349   fi
3352 dnl GLEXT is only needed for GTK/OpenGL
3353 if test x$build_gtk = xyes -a x$build_ogl = xyes ; then
3354   if test x"$GLEXT_LIBS" != x; then
3355     if test x"$GLEXT_CFLAGS" != x; then
3356       echo "        GtkGLExt flags are: $GLEXT_CFLAGS"
3357     else
3358       echo "        GtkGLExt flags are: default include path"
3359     fi
3360       echo "        GtkGLExt libs are: $GLEXT_LIBS"
3361   else
3362     PKG_ERR([No GtkGLExt development package installed!])
3363     PKG_SUGGEST([It is needed to build the GTK/OpenGL GUI/renderer combination.])
3364     PKG_SUGGEST([Install it from http://gtkglext.sourceforge.net])
3365     DEB_INSTALL([libgtkglext1-dev])
3366     RPM_INSTALL([gtkglext-devel])
3367     PKG_ALTERNATIVE([or --enable-gui=sdl or --enable-renderer=agg])
3368   fi
3371 if test x$build_gtk = xyes; then #{
3372   if test x"$GTK2_LIBS" != x; then
3373     if test x"$GTK2_CFLAGS" != x; then
3374       echo "        GTK2 flags are: $GTK2_CFLAGS"
3375     else
3376       echo "        GTK2 flags are: default include path"
3377     fi
3378       echo "        GTK2 libs are: $GTK2_LIBS"
3379   else
3380     PKG_ERR([No GTK2 development package installed!])
3381     PKG_SUGGEST([Install it from http://gtk.org])
3382     DEB_INSTALL([libgtk2.0-dev])
3383     RPM_INSTALL([gtk2-devel])
3384   fi
3386   if test x"$PANGO_LIBS" != x; then
3387     if test x"$PANGO_CFLAGS" != x; then
3388       echo "        Pango flags are: $PANGO_CFLAGS"
3389     else
3390       echo "        Pango flags are: default include path"
3391     fi
3392     echo "        Pango libs are: $PANGO_LIBS"
3393   else
3394     PKG_ERR([No Pango development package installed!])
3395     PKG_SUGGEST([Install it from http://pango.org])
3396     DEB_INSTALL([libpango1.0-dev])
3397     RPM_INSTALL([pango-devel])
3398   fi
3400   if test x"$GLIB_LIBS" != x; then
3401     if test x"$GLIB_CFLAGS" != x; then
3402       echo "        GLib flags are: $GLIB_CFLAGS"
3403     else
3404       echo "        GLib flags are: default include path"
3405     fi
3406     echo "        GLib libs are: $GLIB_LIBS"
3407   else
3408     PKG_ERR([No GLib development package installed!])
3409     PKG_SUGGEST([Install it from http://gtk.org])
3410     DEB_INSTALL([libglib2.0-dev])
3411     RPM_INSTALL([glib2-devel])
3412   fi
3414   if test x"$ATK_LIBS" != x; then
3415     if test x"$ATK_CFLAGS" != x; then
3416       echo "        ATK flags are: $ATK_CFLAGS"
3417     else
3418       echo "        ATK flags are: default include path"
3419     fi
3420       echo "        ATK libs are: $ATK_LIBS"
3421   else
3422     PKG_ERR([No ATK development package installed!])
3423     PKG_SUGGEST([Install it from http://atk.org])
3424     DEB_INSTALL([libatk1.0-dev])
3425     RPM_INSTALL([atk-devel])
3426   fi
3430 if test x"$build_media_gst" = x"yes"; then
3431   if test x"$missing_codecs" != x; then   
3432       echo "        Your Gstreamer installation is missing these codecs: $missing_codecs"
3433       echo "        Please install the gstreamer-ffmpeg for Gstreamer"
3434   fi  
3435   if test x"$GSTREAMER_LIBS" != x; then
3436     if test x"$GSTREAMER_CFLAGS" != x; then
3437       echo "        Gstreamer flags are: $GSTREAMER_CFLAGS"
3438     else
3439       echo "        Gstreamer flags are: default include path"
3440     fi
3441     echo "        Gstreamer libs are: $GSTREAMER_LIBS"
3442   else
3443     PKG_ERR([GST media handling requested but gstreamer-0.10+ not found])
3444     PKG_SUGGEST([Install it from http://www.gstreamer.net])
3445     DEB_INSTALL([libgstreamer0.10-dev])
3446     RPM_INSTALL([gstreamer-devel])
3447     YAST_INSTALL([gstreamer010-devel])
3448   fi
3449   if test x"$has_gstreamer_pbutils" != "xyes"; then
3450     PKG_REC([If the user has not installed the necessary Gstreamer plugins, Gstreamer can pop up a message prompting them to.])
3451     PKG_SUGGEST([Install gstpbutils (>= 0.10.15) from http://www.gstreamer.net for that to be enabled])
3452     DEB_INSTALL([libgstreamer-plugins-base0.10-dev])
3453     PKG_SUGGEST([or .rpm users: simply install the below package]) dnl TODO: Can/should this notice be done cleaner?
3454     PKG_SUGGEST([Also see --with-gstpbutils-incl and --with-gstpbutils-lib])
3455   fi
3456   if test x"$has_gstreamer_plugins_base" = "xno"; then
3457     dnl TODO: Check if this is really a mandatory asset!
3458     PKG_ERR([Base plugins are required for gstreamer media!])
3459     PKG_SUGGEST([Install gstreamer-plugins-base from http://www.gstreamer.net])
3460     DEB_INSTALL([libgstreamer-plugins-base0.10-dev])
3461     RPM_INSTALL([gstreamer-plugins-base-devel])
3462   fi
3465 dnl TODO: figure out some RPM package names.
3466 dnl TODO: The following tests is probably incorrect for any/older/exotic systems! Could someone experienced look at it?
3467 if test x"${build_media_ffmpeg}" = x"yes"; then
3468   if test x"$FFMPEG_LIBS" != x; then
3469     echo "        MP3 and video support enabled through FFmpeg"
3470     if test x"$FFMPEG_CFLAGS" != x; then
3471       echo "        FFmpeg flags are: $FFMPEG_CFLAGS"
3472     else
3473       echo "        FFmpeg flags are: default include path"
3474     fi
3475     echo "        FFmpeg libs are: $FFMPEG_LIBS"
3476   else
3477     PKG_ERR([No FFmpeg development package installed!])
3478     PKG_SUGGEST([You can install FFmpeg from http://ffmpeg.org])
3479     DEB_INSTALL([libavcodec-dev])
3480     RPM_INSTALL([ffmpeg-devel])
3481     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3482   fi
3484   if test x"${avformat_h}" = x; then
3485     PKG_ERR([FFmpeg's avformat header is installed but not libavformat!])
3486     PKG_SUGGEST([You can install FFmpeg from http://ffmpeg.org])
3487     DEB_INSTALL([libavformat-dev])
3488     YAST_INSTALL([libavformat-api]) dnl (but currently installs into /usr/lib64)
3489     PKG_ALTERNATIVE(or explicitly set the path using --with-ffmpeg-incl=)
3490     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3491   fi
3493   if test x"${have_ffmpeg_swscale}" = "xno"; then
3494     PKG_ERR([No libswscale development package installed!])
3495     PKG_SUGGEST([You can install libswscale from http://ffmpeg.org])
3496     DEB_INSTALL([libswscale-dev])
3497     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3498   fi
3501 if test x$build_cairo = xyes; then
3502   if test x"$CAIRO_LIBS" != x; then
3503     if test x"$CAIRO_CFLAGS" != x; then
3504       echo "        Cairo flags are: $CAIRO_CFLAGS"
3505     else
3506       echo "        Cairo flags are: default include path"
3507     fi
3508     echo "        Cairo libs are: $CAIRO_LIBS"
3509   else
3510     PKG_ERR([No Cairo development package installed!])
3511     PKG_SUGGEST([You need to have the Cairo development package installed if you have used --enable-render=cairo to configure.])
3512     PKG_SUGGEST([Install it from http://cairographics.org])
3513     DEB_INSTALL([libcairo-dev])
3514     RPM_INSTALL([cairo-devel])
3515   fi
3518 if test x$build_fltk = xyes; then
3519   if test x"$FLTK2_LIBS" != x; then
3520     if test x"$FLTK2_CFLAGS" != x; then
3521       echo "        FLTK flags are: $FLTK2_CFLAGS"
3522     else
3523       echo "        FLTK flags are: default include path"
3524     fi
3525       echo "        FLTK libs are: $FLTK2_LIBS"
3526   else
3527     PKG_ERR([No FLTK2 development package installed!])
3528     PKG_SUGGEST([Install it from http://fltk.org])
3529     PKG_ALTERNATIVE(or change to a different gui with --enable-gui=...)
3530   fi
3533 if test x$build_fltk = xyes; then
3534   if test x"$XFT_LIBS" != x; then
3535     if test x"$XFT_CFLAGS" != x; then
3536       echo "        Xft flags are: $XFT_CFLAGS"
3537     else
3538       echo "        Xft flags are: default include path"
3539     fi
3540     echo "        Xft libs are: $XFT_LIBS"
3541   fi
3544 # See whether SDL is required
3545 need_sdl=false
3546 test x$build_sdl = xyes                 && need_sdl=true
3547 test x$build_sound_sdl = xyes   && need_sdl=true
3549 if $need_sdl; then
3550   if test x"$SDL_LIBS" != x; then
3551     echo "        SDL flags are: $SDL_CFLAGS"
3552     echo "        SDL libs are: $SDL_LIBS"
3553   else
3554     PKG_ERR([No SDL development package installed!])
3555     PKG_SUGGEST([Install it from http://www.libsdl.org/download-1.2.php])
3556     DEB_INSTALL([libsdl1.2-dev])
3557     RPM_INSTALL([SDL-devel])
3558     PKG_ALTERNATIVE(or change to a different gui with --enable-gui=...)
3559   fi
3561 unset need_sdl
3563 if test x"$nsapi" = x"yes"; then
3564     echo "        Plugin will be installed in ${FIREFOX_PLUGINS}"
3567 if test x"${pthreads}" = x"yes"; then
3568   if test x"$PTHREAD_CFLAGS" != x; then
3569     echo "        POSIX Threads flags are: $PTHREAD_CFLAGS"
3570   fi
3571   if test x"${PTHREAD_LIBS}" != x; then
3572     echo "        POSIX Threads lib is: $PTHREAD_LIBS"
3573   else
3574     if test x"${cross_compiling}" = xno; then
3575       echo "ERROR: No pthread development package installed!" >&3
3576     fi
3577   fi
3580 if test x"${docbook}" = x"yes"; then
3581   if test x"$MAKEINFO" = x; then
3582     PKG_ERR([No makeinfo tools installed!])
3583     PKG_SUGGEST([Install it from http://www.gnu.org/software/texinfo/])
3584     DEB_INSTALL([texinfo])
3585     RPM_INSTALL([texinfo])
3586     RPM_ALTERNATIVE([texinfo-tex])
3587   fi
3588   dnl low-level tools
3589   if test x"$DB2X_TEXIXML" = x -o x"$DB2X_MANXML" = x -o x"$DB2X_XSLTPROC" = x; then
3590     dnl high-level tools
3591     if test x"${DB2X_TEXI}" = x -o x"${DB2X_MAN}" = x; then
3592       PKG_ERR([No DocBook2X tools installed!])
3593       PKG_SUGGEST([Install it from http://docbook2x.sourceforge.net])
3594       dnl TODO: Could someone look at this and confirm the needed software is installed?
3595       dnl FIXME: I removed the texidocbook and docbook-utilsnfo packages as they are not on my system.
3596       DEB_INSTALL([docbook2x docbook-xml docbook-xsl texinfo xsltproc])
3597       PKG_ALTERNATIVE([or configure without --enable-docbook])
3598     fi
3599   else
3600     echo "        You have version $db2x_version of the DocBook2X tools."
3601   fi
3602 else
3603   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.])
3606 if test x"$CURL_LIBS" != x; then
3607   if test x"$CURL_CFLAGS" != x; then
3608     echo "        CURL flags are: $CURL_CFLAGS"
3609   else
3610     echo "        CURL flags are: default include path"
3611   fi
3612     echo "        CURL libs are: $CURL_LIBS"
3613 else
3614   PKG_REC([If you install the CURL library, Gnash will be able to display remote content (streaming from URLs) using CURL.])
3615   PKG_SUGGEST([Install libcurl from http://curl.haxx.se/libcurl])
3616   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?
3617   DEB_ALTERNATIVE([libcurl-dev])
3618   RPM_INSTALL([curl-devel])
3621 if test x"$SPEEX_LIBS" != x; then
3622   if test x"$SPEEX_CFLAGS" != x; then
3623     echo "        Speex flags are: $SPEEX_CFLAGS"
3624   else
3625     echo "        Speex flags are: default include path"
3626   fi
3627     echo "        Speex libs are: $SPEEX_LIBS"
3628 else
3629   PKG_REC([If you install the Speex library, Gnash will be able to decoded Speex encoded audio in FLV files.])
3630   PKG_SUGGEST([Install libspeex from http://speex.org])
3631   DEB_INSTALL([libspeex-dev])
3632   RPM_INSTALL([speex-devel])
3635 if test x"$SPEEXDSP_LIBS" != x; then
3636   if test x"$SPEEXDSP_CFLAGS" != x; then
3637     echo "        Speex DSP flags are: $SPEEXDSP_CFLAGS"
3638   else
3639     echo "        Speex DSP flags are: default include path"
3640   fi
3641     echo "        Speex DSP libs are: $SPEEXDSP_LIBS"
3642 else
3643   PKG_REC([If you install the Speex DSP library, Gnash will be able to resample Speex encoded audio in FLV files.])
3644   PKG_SUGGEST([Install libspeexdsp from http://speex.org])
3645   DEB_INSTALL([libspeexdsp-dev])
3646   RPM_INSTALL([speex-devel])
3649 if test x"$ext_dbus" = xyes; then
3650   if test x"$DBUS_LIBS" != x; then
3651     if test x"$DBUS_CFLAGS" != x; then
3652       echo "        DBUS flags are: $DBUS_CFLAGS"
3653     else
3654       echo "        DBUS flags are: default include path"
3655     fi
3656       echo "        DBUS libs are: $DBUS_LIBS"
3657   else
3658     PKG_WAR([No DBUS development package was found! Gnash will be built without support for remote controls.])
3659     PKG_SUGGEST([Install libdbus from http://www.dbus.org])
3660     DEB_INSTALL([dbus-dev])
3661     DEB_ALTERNATIVE([libdbus-1-dev])
3662     RPM_INSTALL([dbus-devel])
3663   fi
3666 if test x$build_agg = xyes; then # {
3667   echo "        AGG Pixel format is: $pixelformat"
3668   if test x"$AGG_LIBS" != x -a x"${agg25}" == xyes; then # {
3669     if test x"$AGG_CFLAGS" != x; then # {
3670       echo "        AGG flags are: $AGG_CFLAGS"
3671     else # }{
3672       echo "        AGG flags are: default include path"
3673     fi # }
3674     echo "        AGG libs are: $AGG_LIBS"
3675   else # }{
3676     if test x"$AGG_LIBS" != x -a x"${agg25}" != xyes; then
3677       PKG_ERR([Your installation of AGG appears to be version 2.4 or older. Please upgrade to AGG 2.5 or greater.])
3678     else
3679       PKG_ERR([No AGG development package installed!])
3680     fi
3681     PKG_SUGGEST([Install it from http://www.antigrain.com])
3682     DEB_INSTALL([libagg-dev])
3683     RPM_INSTALL([agg-devel])
3684   fi # }
3685 fi # }
3687 dnl TODO: This package is handled a bit stupidly in regard to the package
3688 dnl suggestion system. It would be better to check for each package
3689 dnl separately, instead of passing the missing ones in variables..
3690 if test x"$BOOST_LIBS" != x; then
3691   echo "        BOOST flags are: $BOOST_CFLAGS"
3692   echo "        BOOST libs are: $BOOST_LIBS"
3693   echo "        BOOST libs for cygnal are: $BOOST_CYGNAL_LIBS"
3695   if test x"${missing_headers}" != x; then
3696     for i in ${missing_headers}; do
3697       PKG_ERR([The Boost $i header is not installed])
3698       PKG_SUGGEST([Install it from http://www.boost.org])
3699     done
3700   fi
3702   if test x"${cygnal}" = x"yes"; then
3703     if test x"${cygnal_missing_libs}" != x; then
3704       for i in ${cygnal_missing_libs}; do
3705         PKG_ERR([No Boost $i package installed])
3706         PKG_SUGGEST([Install it from http://www.boost.org])
3707         debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
3708         DEB_INSTALL([$debtmppkg])
3709         PKG_ALTERNATIVE([or configure with --disable-cygnal])
3710       done
3711     fi
3712   fi
3714   if test x"${missing_libs}" != x; then
3715     for i in ${missing_libs}; do
3716       PKG_ERR([No Boost $i package installed])
3717       PKG_SUGGEST([Install it from http://www.boost.org])
3718       debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
3719       DEB_INSTALL([$debtmppkg])
3720     done
3721   fi
3722 else
3723   PKG_ERR([No Boost development package installed])
3724   PKG_SUGGEST([Install it from http://www.boost.org])
3725   dnl I am not sure that libboost-program-options-dev should be passed here, but
3726   dnl it seems like the cleanest way to get it.
3727   if test x"$cygnal" = xyes; then
3728     DEB_INSTALL([libboost-dev libboost-thread-dev libboost-program-options-dev libboost-date-time-dev])
3729   else
3730     DEB_INSTALL([libboost-dev libboost-thread-dev libboost-program-options-dev])
3731   fi
3732   RPM_INSTALL([boost-devel])
3735 dnl don't look for the flash compilers when cross compiling.
3736 if test x"$testsuite" = x"yes"; then
3737   if test x$cross_compiling = xno; then
3738     if test x"$MING_LIBS" != x; then
3739       echo "        MING flags are $MING_CFLAGS"
3740       echo "        MING libs are $MING_LIBS"
3741     else
3742       PKG_WAR([You need to have the Ming development package installed to run most of the tests in Gnash testsuite.])
3743       PKG_SUGGEST([Install it from http://www.libming.org/])
3744       DEB_INSTALL([libming-dev])
3745       RPM_INSTALL([libming-devel])
3746     fi
3748     if test x"$MAKESWF" != x; then
3749       echo "        MING version code is $MING_VERSION_CODE"
3750       echo "        MAKESWF is $MAKESWF"
3751     else
3752       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.])
3753       PKG_SUGGEST([Install it from http://www.libming.org/])
3754       DEB_INSTALL([libming-util])
3755       RPM_INSTALL([ming-util])
3756       RPM_ALTERNATIVE([ming-utils])
3757     fi
3759     if test x"$MAKESWF" != x && test $MING_VERSION_CODE -lt 00040006; then
3760       echo "        WARNING: You have an older version of Ming installed and will not" >&4
3761       echo "                 be able to run all of the tests in Gnash testsuite." >&4
3762       echo "                 Install the latest version from http://www.libming.org" >&4
3763     fi
3765     if test x"$SWFDEC_TESTSUITE" != x; then
3766       echo "        SWFDEC testsuite dir is $SWFDEC_TESTSUITE"
3767     fi
3769     if test x"$MTASC" != x; then
3770       echo "        MTASC is $MTASC"
3771       echo "        MTASC CLASSPATH is $MTASC_CLASSPATH"
3772     else
3773       PKG_WAR([You need to have the MTASC compiler packages installed to run some of the tests in Gnash testsuite.])
3774       PKG_SUGGEST([Install it from http://mtasc.org])
3775       DEB_INSTALL([mtasc])
3776       RPM_INSTALL([mtasc])
3777     fi
3779     if test x"$HAXE" != x; then
3780       echo "        HAXE is $HAXE"
3781       echo "        HAXE CLASSPATH is $HAXE_CLASSPATH"
3782     else
3783       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.])
3784       PKG_SUGGEST([Install it from http://haxe.org])
3785       DEB_INSTALL([haxe])
3786       RPM_INSTALL([haxe])
3787     fi
3789     if test x"$SWFMILL" != x; then
3790       echo "        SWFMILL is $SWFMILL"
3791       if test x"$ENABLE_AVM2" != x -a "$SWFMILL_VERSION" -lt 00021206; then
3792         PKG_WAR([You are building Gnash with AVM2 support but your swfmill version is too old to run AS3 tests.])
3793       fi
3794     else
3795       PKG_WAR([You need to have the swfmill tool installed to run some of the tests in Gnash testsuite.])
3796       PKG_SUGGEST([Install it from http://swfmill.org])
3797       DEB_INSTALL([swfmill])
3798       RPM_INSTALL([swfmill])
3799     fi
3801     if test x"$SWFC" != x; then
3802       echo "        SWFC is $SWFC"
3803     else
3804       PKG_WAR([You need to have swfc from SWFTools installed to run some of the tests in Gnash testsuite.])
3805       PKG_SUGGEST([Install it from http://swftools.org])
3806       DEB_INSTALL([swftools])
3807       RPM_INSTALL([swftools])
3808     fi
3810     if test x"$AS3COMPILE" != x; then
3811       echo "        AS3COMPILE is $AS3COMPILE"
3812     else
3813       PKG_WAR([You need to have as3compile from SWFTools installed to run some of the tests in Gnash testsuite.])
3814       PKG_SUGGEST([Install it from http://swftools.org])
3815     fi
3817     if test x"$HTTP_TESTSUITE" != x; then
3818       echo "        HTTP testsuite dir is $HTTP_TESTSUITE"
3819     fi
3821     if test x"$RED5_HOST" != x; then
3822       echo "        RED5 testing host is $RED5_HOST"
3823     fi
3824   fi
3827   if test x"$PERL" != x; then
3828     echo "        PERL is $PERL"
3829   else
3830     PKG_WAR([You need to have perl installed to run some of the tests in Gnash testsuite.])
3831     PKG_SUGGEST([Install it from http://perl.org])
3832     DEB_INSTALL([perl])
3833     RPM_INSTALL([perl])
3834   fi
3836 if test x"$testsuite" = x"yes"; then
3837   if test x"$CSOUND" != x; then
3838     echo "        CSOUND is $CSOUND"
3839   else
3840     echo "        WARNING: You need to have csound installed" >&4
3841     echo "                 to have real fun." >&4
3842     echo "                 Install it from http://www.csounds.com/" >&4
3843     echo "                 or .deb users: apt-get install csound" >&4
3844     echo "                 or .rpm users: yum install csound" >&4
3845   fi
3848 if test x"$Z_LIBS" != x; then
3849   if test x"$Z_CFLAGS" != x; then
3850     echo "        Z flags are: $Z_CFLAGS"
3851   else
3852     echo "        Z flags are: default include path"
3853   fi
3854   echo "        Z libs are: $Z_LIBS"
3855 else
3856   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.])
3857   PKG_SUGGEST([Install it from http://zlib.net])
3858   DEB_INSTALL([zlib1g-dev])
3859   RPM_INSTALL([zlib-devel])
3860   PKG_ALTERNATIVE([It may still be possible to configure without zlib.])
3863 if test x"$FREETYPE2_LIBS" != x; then
3864   if test x"$FREETYPE2_CFLAGS" != x; then
3865     echo "        FreeType flags are: $FREETYPE2_CFLAGS"
3866   else
3867     echo "        FreeType flags are: default include path"
3868   fi
3869   echo "        FreeType libs are: $FREETYPE2_LIBS"
3870 else
3871   PKG_REC([You need to have the freetype development packages installed to use device fonts.])
3872   PKG_SUGGEST([Install it from http://freetype.org])
3873   DEB_INSTALL([libfreetype6-dev])
3874   RPM_INSTALL([freetype-devel])
3875   PKG_ALTERNATIVE([It may still be possible to configure without freetype.])
3878 if test x"$FONTCONFIG_LIBS" != x; then
3879   if test x"$FONTCONFIG_CFLAGS" != x; then
3880     echo "        Fontconfig flags are: $FONTCONFIG_CFLAGS"
3881   else
3882     echo "        Fontconfig flags are: default include path"
3883   fi
3884   echo "        Fontconfig libs are: $FONTCONFIG_LIBS"
3885 else
3886   PKG_REC([You need to have the fontconfig development packages installed to use device fonts.])
3887   PKG_SUGGEST([Install it from http://fontconfig.org])
3888   DEB_INSTALL([libfontconfig1-dev])
3889   RPM_INSTALL([fontconfig-devel])
3890   PKG_ALTERNATIVE([It may still be possible to configure without fontconfig.])
3893 if test x$ext_mysql = xyes; then
3894   if test x$mysql != xno; then
3895     if test x"$MYSQL_LIBS" != x; then
3896       echo "        MYSQL flags are: $MYSQL_CFLAGS"
3897       echo "        MYSQL libs are: $MYSQL_LIBS"
3898     else
3899       PKG_ERR([No MySQL development package is installed.])
3900       PKG_SUGGEST([Install it from http://mysql.org])
3901       DEB_INSTALL([libmysqlclient-dev])
3902       RPM_INSTALL([mysql-devel])
3903       PKG_ALTERNATIVE([or reconfigure without --enable-extensions=mysql])
3904     fi
3905   fi
3908 if test "$GMSGFMT" = ":"; then
3909   PKG_WAR([You need the gettext package installed to use translations. Required for building a package or 'make distcheck'])
3910   PKG_SUGGEST([Install it from http://www.gnu.org/software/gettext/])
3911   DEB_INSTALL([gettext])
3912   RPM_INSTALL([gettext])
3915 if test x"${build_vaapi}" = x"yes"; then
3916   if test x"${LIBVA_CFLAGS}" = xyes; then
3917       echo "        LIBVA flags are: default"
3918     else
3919       echo "        LIBVA flags are: $LIBVA_CFLAGS"
3920       echo "        LIBVA libraries are: $LIBVA_LIBS"
3921   fi
3922   if test x$use_libva_x11 = xyes; then
3923     if test x"${LIBVA_X11_CFLAGS}" = xyes; then
3924       echo "        LIBVA X11 flags are: default"
3925     else
3926       echo "        LIBVA X11 flags are: $LIBVA_X11_CFLAGS"
3927       echo "        LIBVA X11 libraries are: $LIBVA_X11_LIBS"
3928     fi
3929   fi
3930   if test x$use_libva_glx = xyes; then
3931     if test x"${LIBVA_GLX_CFLAGS}" = xyes; then
3932       echo "        LIBVA GLXflags are: default"
3933     else
3934       echo "        LIBVA GLX flags are: $LIBVA_GLX_CFLAGS"
3935     fi
3936     echo "        LIBVA GLX libraries are: $LIBVA_GLX_LIBS"
3937   fi
3940 if test x"$ac_cv_gcc_visibility" != xyes; then
3941   if test x"$npapi" = xyes; then
3942     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!])
3943   fi
3946 if test x"$npapi" = xyes; then
3947   if test x"$has_npapi" = xyes; then
3948     echo "        NPAPI flags are: $NPAPI_CFLAGS"
3949   else
3950     PKG_ERR([No xulrunner development package is installed!])
3951     PKG_SUGGEST([Install it from http://releases.mozilla.org/pub/mozilla.org/xulrunner])
3952     DEB_INSTALL([xulrunner-dev]) or 
3953     DEB_INSTALL([firefox-dev])
3954     RPM_INSTALL([xulrunner-devel])
3955   fi
3956 else
3957   echo "        NPAPI plugin is disabled"
3960 if test x"${DEJAGNU}" != x""; then
3961   echo "        DEJAGNU's runtest is $DEJAGNU"
3962 else
3963   PKG_WAR([You need the dejagnu package installed to get a summary after running 'make check'.])
3964   PKG_SUGGEST([Install it from http://www.gnu.org/software/dejagnu/])
3965   DEB_INSTALL([dejagnu])
3966   RPM_INSTALL([dejagnu])
3969 dnl Haiku
3970 if test x"${build_haiku}" = xyes -o x"${build_sound_mkit}" = xyes -o x"${build_media_haiku}" = x"yes"; then
3971     echo "        Haiku libs are: $HAIKU_LIBS"
3974 if test x"$has_ltdl" = x"yes";then
3975   echo "        LIBLTDL flags are: $LTDL_CFLAGS"
3976   echo "        LIBLTDL libs are: $LTDL_LIBS"
3977 else
3978   if test x"${extensions_support}" != xno; then
3979     PKG_ERR([No libltdl development package is installed, yet --disable-extensions was not specified.])
3980     PKG_SUGGEST([Install it from ftp://ftp.gnu.org/gnu/libtool/])
3981     DEB_INSTALL([libltdl-dev])
3982     RPM_INSTALL([libtool-ltdl-devel])
3983   fi
3986 if test x"$python" = x"yes"; then
3987   if test x"$has_python" = x"yes"; then
3988     echo "        PYTHON flags are: $PYTHON_CFLAGS"
3989     echo "        PYTHON libs are: $PYTHON_LIBS"
3990     echo "        PYTHON executable is: $PYTHON"
3991   else
3992     PKG_ERR([No Python development package is installed, but it's enabled.])
3993   fi
3995 if test x${build_ssl} = xyes; then
3996   if test x"${has_ssl}" = xyes; then
3997     if test x"${SSL_CFLAGS}" = xyes; then
3998       echo "        SSL flags are: default"
3999     else
4000       echo "        SSL flags are: $SSL_CFLAGS"
4001     fi
4002     echo "        SSL libs are: $SSL_LIBS"
4003   else
4004     PKG_ERR([No SSL development package is installed, but it's enabled."])
4005   fi
4008 if test x${build_ssh} = xyes; then
4009   if test x"${has_ssh}" = xyes; then
4010     if test x"${SSH_CFLAGS}" = xyes; then
4011       echo "        SSH flags are: default"
4012     else
4013       echo "        SSH flags are: $SSH_CFLAGS"
4014     fi
4015     echo "        SSH libs are: $SSH_LIBS"
4016   else
4017     PKG_ERR([No SSH development package is installed, but it's enabled."])
4018   fi
4021 if test x"${build_all_as3}" = x"yes"; then
4022   echo "        Building the entire ActionScript class libary"
4023 else
4024   echo "        Only building these ActionScript classes into the library:"
4025   echo "     ${classlist}"
4028 if test x"$testsuite" = x"yes"; then
4029   if test x"$NETCAT" != x; then
4030     echo "        You have netcat installed, which is only used for testing"
4031   else
4032     echo "        Install netcat for networking test support"
4033   fi
4034   if test x"$WGET" != x; then
4035     echo "        You have wget installed, which is only used for testing"
4036   else
4037     echo "        Install wget for networking test support"
4038   fi
4041 if test x$cross_compiling = xyes; then
4042    if test x"${android_ndk}" != xno; then
4043       AC_MSG_NOTICE([This build is setup for cross compiling for Android])
4044    else
4045       AC_MSG_NOTICE([This build is setup for cross compiling])
4046    fi
4049 echo "--------"
4051 if test x"${cygnal}" = x"yes"; then
4052   echo "        Building Cygnal media server enabled (default). Use --disable-cygnal to disable."
4053 else
4054   echo "        Building Cygnal media server disabled."
4057 if test x"${with_top_level}" != x; then
4058   echo "        Top level for cross compiling support files is: $with_top_level"
4061 if test x"${build_gtk}" = xyes -a x"${pixelformat}" = xrgb565; then
4062   echo "        WARNING: Pixel format RGB565 selected in combination with the" >&4
4063   echo "                 GTK GUI. Only a hacked GTK will work (e.g. on the OLPC)." >&4
4066 if test x"${extensions_list}" != x; then
4067   echo "        Building extensions: ${extensions_list}"
4070 if test x"${extensions_support}" = xno; then
4071   echo "        Extension support disabled."
4074 if test x"${security_list}" != x; then
4075   echo "        Enabling security features: ${security_list}"
4078 if test x"${statistics_list}" != x; then
4079   echo "        Enabling statistics collecting for: ${statistics_list}"
4082 if test x"${SUPPORTED_GUIS}" = x; then
4083   AC_MSG_ERROR(no supported GUIs found);
4086 echo "        GUI toolkits supported: ${SUPPORTED_GUIS}"
4087 echo "        Renderers supported: ${renderer_list}"
4088 echo "        Hardware Acceleration: ${device_list}"
4089 echo "        Media handlers: ${media_list}"
4090 echo "        Using ${add_sound} for sound handling"
4092 if test x"$docbook" = x"yes"; then
4093   echo '        DocBook document processing enabled (for "make html" and "make pdf")'
4094   if test x"$docbook_styles" != x; then
4095     echo "        Docbook styles sheets in $docbook_styles"
4096   fi
4097 else
4098   echo "        DocBook document processing disabled (default)"
4101 dnl The Framebuffer GUI has several other settings. As it doesn't have X11,
4102 dnl we have to handle input devics ourselves.
4103 if test x"${build_fb}" = xyes; then
4104 echo "        Using ${input_events} for Input"
4105   if test x"${fakefb}" != x; then
4106     echo "        Using shared memory as a fake framebuffer"
4107   fi
4108   if test x"${offscreen}" = xyes; then
4109     echo "        Using offscreen rendering"
4110   fi
4111   if test x"${doublebuf}" = xyes; then
4112     echo "        Using double buffering when rendering"
4113   fi
4116 if test -s $cwarn; then
4117   echo ""
4118   cat $cwarn
4119   rm $cwarn
4120   echo ""
4121   echo "Gnash should still compile even with these warnings."
4122   echo "If it doesn't, report the warnings as a bug."
4123 else
4124   rm $cwarn
4127 if test -s $crec; then
4128   echo ""
4129   cat $crec
4130   rm $crec
4131   echo ""
4132   echo "Gnash should still compile, but you'll miss important support"
4133 else
4134   rm $crec
4137 if test -s $cerr; then
4138   echo ""
4139   cat $cerr >&2
4142 deb_err="`cat $deb_err`"
4143 deb_war="`cat $deb_war`"
4144 deb_rec="`cat $deb_rec`"
4145 rpm_err="`cat $rpm_err`"
4146 rpm_war="`cat $rpm_war`"
4147 rpm_rec="`cat $rpm_rec`"
4148 yast_err="`cat $yast_err`"
4149 yast_war="`cat $yast_war`"
4150 yast_rec="`cat $yast_rec`"
4152 # Pipe stderr to /dev/null since Fedora complains when target isn't there.
4153 if test x`which apt-get 2>/dev/null` != x; then
4154   if test x"$deb_err" != x -o x"$deb_war" != x -o x"$deb_rec" != x; then
4155     echo "#!/bin/sh" > deb-attempt-install-dependencies.sh
4156     echo "packages=\"$deb_err $deb_war $deb_rec\"" >> deb-attempt-install-dependencies.sh
4157     echo "PKGCOMMAND=\"apt-get install -y -q\"" >> deb-attempt-install-dependencies.sh
4158     cat ${srcdir}/base-attempter.sh >> deb-attempt-install-dependencies.sh
4159     chmod +x deb-attempt-install-dependencies.sh
4160     echo ""
4161     echo ".deb users might be able to install most dependencies by executing:"
4162     echo "sudo ./deb-attempt-install-dependencies.sh"
4163   fi
4166 if test x`which yum 2>/dev/null` != x; then
4167   if test x"$rpm_err" != x -o x"$rpm_war" != x -o x"$deb_rec" != x; then
4168     echo "#!/bin/sh" > rpm-attempt-install-dependencies.sh
4169     echo "packages=\"$rpm_err $rpm_war  $rpm_rec\"" >> rpm-attempt-install-dependencies.sh
4170     echo "PKGCOMMAND=\"yum install -y \""    >> rpm-attempt-install-dependencies.sh
4171     cat ${srcdir}/base-attempter.sh >> rpm-attempt-install-dependencies.sh
4172     chmod +x rpm-attempt-install-dependencies.sh
4173     echo ""
4174     echo ".rpm users might be able to install most dependencies by executing:"
4175     echo "sudo ./rpm-attempt-install-dependencies.sh"
4176   fi
4179 dnl TODO: Add support for yast here, which AFAIK is used on OpenSuse.
4181 dnl If anything critical is missing, don't bother to continue
4182 if test -s $cerr; then
4183   echo ""
4184   rm $cerr
4185   AC_MSG_ERROR([Please install required packages])
4186 else
4187   rm $cerr
4190 rm -rf $tmp
4192 if test x"$fork" = x"no"; then
4193   echo ""
4194   AC_MSG_ERROR([Currently only forking the standalone player works!])
4196 echo ""
4198 # Local Variables:
4199 # c-basic-offset: 2
4200 # tab-width: 2
4201 # indent-tabs-mode: nil
4202 # End: