free the answer from, getaddrinfo
[gnash.git] / configure.ac
bloba2df5d26a8a118b6aefbe02bea59738e5be45dd2
1 dnl  
2 dnl  Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3 dnl  Free Software Foundation, Inc.
4 dnl  
5 dnl  This program is free software; you can redistribute it and/or modify
6 dnl  it under the terms of the GNU General Public License as published by
7 dnl  the Free Software Foundation; either version 3 of the License, or
8 dnl  (at your option) any later version.
9 dnl  
10 dnl  This program is distributed in the hope that it will be useful,
11 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 dnl  GNU General Public License for more details.
14 dnl  You should have received a copy of the GNU General Public License
15 dnl  along with this program; if not, write to the Free Software
16 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17 dnl  
19 AC_PREREQ(2.59c)
20 AC_INIT(gnash, 0.8.10dev)
21 AC_CONFIG_SRCDIR([libcore/as_object.h])
22 AC_CONFIG_HEADERS([gnashconfig.h])
23 AC_CONFIG_MACRO_DIR([macros])
25 AC_CANONICAL_BUILD
26 AC_CANONICAL_HOST
28 dnl --------------------------------------------------------
29 dnl Figure out development tool stuff
30 dnl --------------------------------------------------------
32 AC_PROG_CXX
33 AC_PROG_CC
34 AM_PROG_CC_C_O
35 AC_EXEEXT
36 AC_PROG_INSTALL
38 dnl Set the default values for Flash Version. These are converted into
39 dnl various strings to make JavaScript or ActionScript detectors
40 dnl recognize Gnash as a SWF Player.
41 DEFAULT_FLASH_MAJOR_VERSION="10"
42 DEFAULT_FLASH_MINOR_VERSION="1"
43 DEFAULT_FLASH_REV_NUMBER="999"
44 AC_SUBST(DEFAULT_FLASH_MAJOR_VERSION)
45 AC_SUBST(DEFAULT_FLASH_MINOR_VERSION)
46 AC_SUBST(DEFAULT_FLASH_REV_NUMBER)
48 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_MAJOR_VERSION], ["${DEFAULT_FLASH_MAJOR_VERSION}"], [Default Flash major version])
49 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_MINOR_VERSION], ["${DEFAULT_FLASH_MINOR_VERSION}"], [Default Flash minor version])
50 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_REV_NUMBER], ["${DEFAULT_FLASH_REV_NUMBER}"], [Default Flash revision number])
52 dnl TODO: use host/build/target -- whatever is more appropriate
53 case "${host}" in
54   *-apple-*)
55     DEFAULT_FLASH_PLATFORM_ID="MAC"
56     DEFAULT_FLASH_SYSTEM_OS="MacOS"
57     ;;
58   *-openbsd*)
59     DEFAULT_FLASH_PLATFORM_ID="BSD"
60     DEFAULT_FLASH_SYSTEM_OS="OpenBSD"
61     ;;
62   *-freebsd* | *-kfreebsd*)
63     DEFAULT_FLASH_PLATFORM_ID="BSD"
64     DEFAULT_FLASH_SYSTEM_OS="FreeBSD"
65     ;;
66   *-netbsd*)
67     DEFAULT_FLASH_PLATFORM_ID="BSD"
68     DEFAULT_FLASH_SYSTEM_OS="NetBSD"
69     ;;
70   *-linux-gnu)
71     DEFAULT_FLASH_PLATFORM_ID="LNX"
72     DEFAULT_FLASH_SYSTEM_OS="GNU/Linux"
73     ;;
74   *-linux*)
75     DEFAULT_FLASH_PLATFORM_ID="LNX"
76     DEFAULT_FLASH_SYSTEM_OS="Linux"
77     ;;
78   *-cygwin* | *-mingw* | *-pw32*)
79     DEFAULT_FLASH_PLATFORM_ID="WIN"
80     DEFAULT_FLASH_SYSTEM_OS="Windows"
81     ;;
82   *-*solaris*)
83     DEFAULT_FLASH_PLATFORM_ID="SUN"
84     DEFAULT_FLASH_SYSTEM_OS="Solaris"
85     ;;
86   *-os2*)
87     DEFAULT_FLASH_PLATFORM_ID="OS2"
88     DEFAULT_FLASH_SYSTEM_OS="OS/2"
89     ;;
90   *-sco*)
91     DEFAULT_FLASH_PLATFORM_ID="SCO"
92     DEFAULT_FLASH_SYSTEM_OS="SCO/Unix"
93     ;;
94   *-irix*)
95     DEFAULT_FLASH_PLATFORM_ID="IRX"
96     DEFAULT_FLASH_SYSTEM_OS="IRIX"
97     ;;
98   *-hpux*)
99     DEFAULT_FLASH_PLATFORM_ID="HPX"
100     DEFAULT_FLASH_SYSTEM_OS="HPUX"
101     ;;    
102   *-amigaos*)
103     DEFAULT_FLASH_PLATFORM_ID="OS4"
104     DEFAULT_FLASH_SYSTEM_OS="AmigaOS4"
105     ;;    
106   *-haiku*)
107     DEFAULT_FLASH_PLATFORM_ID="HAIKU"
108     DEFAULT_FLASH_SYSTEM_OS="Haiku"
109     ;;    
110   *-gnu*)
111     DEFAULT_FLASH_PLATFORM_ID="GNU"
112     DEFAULT_FLASH_SYSTEM_OS="GNU/HURD"
113     ;;    
114   *)
115     DEFAULT_FLASH_PLATFORM_ID="UNK"
116     DEFAULT_FLASH_SYSTEM_OS="Unknown"
117     ;;
118 esac
120 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_PLATFORM_ID], ["${DEFAULT_FLASH_PLATFORM_ID}"], [Default 3-letter platform identifier for version string])
121 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_SYSTEM_OS], ["${DEFAULT_FLASH_SYSTEM_OS}"], [Default value for System.capabilities.os])
123 AC_SUBST(DEFAULT_FLASH_PLATFORM_ID)
124 AC_SUBST(DEFAULT_FLASH_SYSTEM_OS)
126 DEFAULT_STREAMS_TIMEOUT=60
127 AC_SUBST(DEFAULT_STREAMS_TIMEOUT)
128 AC_DEFINE_UNQUOTED([DEFAULT_STREAMS_TIMEOUT], [${DEFAULT_STREAMS_TIMEOUT}], [Default streams timeout in seconds])
130 DEFAULT_SOL_SAFEDIR="~/.gnash/SharedObjects"
131 AC_SUBST(DEFAULT_SOL_SAFEDIR)
132 AC_DEFINE_UNQUOTED([DEFAULT_SOL_SAFEDIR], ["${DEFAULT_SOL_SAFEDIR}"], [Default SharedObject base directory])
135 dnl Some things you can only do by looking at the platform name.
136 case "${host}" in
137   powerpc-apple-darwin*)
138     AC_DEFINE([__powerpc64__], [1], [this is a 64 bit powerpc])
139     darwin=yes
140     AC_DEFINE([DARWIN_HOST], [1], [this is a Darwin platform])
141     ;;
142   *-apple-darwin*)
143     darwin=yes
144     AC_DEFINE([DARWIN_HOST], [1], [this is a Darwin platform])
145     ;;
146     dnl Unfortunately, all BSD distributions are not identical, so 
147     dnl as tacky as it is to look for the distribution name, we don't
148     dnl have much choice. The use of these should be avoid as much as possible.
149   *-openbsd*)
150     bsd=yes
151     openbsd=yes
152     AC_DEFINE([OPENBSD_HOST], [1], [this is an OpenBSD platform])
153     ;;
154   *-freebsd* | *-kfreebsd*)
155     bsd=yes
156     freebsd=yes
157     AC_DEFINE([FREEBSD_HOST], [1], [this is a FreeBSD platform])
158     ;;
159   *-netbsd*)
160     bsd=yes
161     netbsd=yes
162     AC_DEFINE([NETBSD_HOST], [1], [this is a NetBSD platform])
163     ;;
164   *-*solaris*)
165     solaris=yes
166     AC_DEFINE([SOLARIS_HOST], [1], [this is a Solaris platform])
167     ;;
168   *-*linux*)
169     linux=yes
170     AC_DEFINE([LINUX_HOST], [1], [this is a Linux platform])
171     ;;
172   *-cygwin* | *-mingw* | *-pw32*)
173     windows=yes
174     AC_DEFINE([WIN32_HOST], [1], [this is a Win32 platform])
175     ;;
176   *64-*-*bsd*)
177     bsd_os=bsd 
178     AC_DEFINE([WORDSIZE], [64], [this is a 64 platform])
179     ;;
180   *-*amigaos*)
181     amigaos4=yes
182     AC_DEFINE([AMIGAOS4_HOST], [1], [this is an AmigaOS4 platform])
183     ;;
184   *-*haiku*)
185     haiku=yes
186     AC_DEFINE([HAIKU_HOST], [1], [this is a Haiku platform])
187     ;;
188   *-gnu*)
189     gnu=yes
190     AC_DEFINE([GNU_HOST], [1], [this is a GNU platform])
191     ;;
192   *-*wince)
193     wince=yes
194     AC_DEFINE([WINCE_HOST], [1], [this is a WINCE platform])
195     ;;
196   *-*winmo)
197     wince=yes
198     AC_DEFINE([WINCE_HOST], [1], [this is a WINCE platform])
199     AC_DEFINE([WINCE6_HOST], [1], [this is a WINCE6 platform])
200     ;;
201   *-android*)
202     android=yes
203     AC_DEFINE([ANDROID_HOST], [1], [this is an Android platform])
204     ;;
205 esac
208 AM_CONDITIONAL(LINUX, test x$linux = xyes)
209 AM_CONDITIONAL(WIN32, test x$windows = xyes)
210 AM_CONDITIONAL(HAIKU, test x$haiku = xyes)
211 AM_CONDITIONAL(AMIGAOS4, test x$amigaos4 = xyes)
213 dnl Get build date for helping us debugging
214 BUILDDATE="`date +%Y%m%d`"
215 AC_SUBST(BUILDDATE)
217 dnl These are required by automake
218 AM_INIT_AUTOMAKE
219 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
220 AM_MAINTAINER_MODE
221 AC_PROG_MAKE_SET
223 AM_GNU_GETTEXT([external])
224 AM_CONDITIONAL(HAS_GETTEXT, test x$ac_cv_path_XGETTEXT != x)
226 dnl Many of the Gnash macros depend on gettext macros defining shlibext; recent
227 dnl gettext however does not.
228 if test x"${shlibext}" = x; then
229   if test x"${acl_cv_shlibext}" = x; then
230     echo "Gettext macros were supposed to define shared library extensions"
231     exit 1;
232   else
233     shlibext="${acl_cv_shlibext}"
234   fi
237 dnl This is primarily used when compiling for a similar architecture,
238 dnl like pentium->geode, which can use the same compiler, but have
239 dnl different development libraries.
241 AC_ARG_WITH(sysroot,
242   AC_HELP_STRING([--with-sysroot],
243   [system root directory for cross compiling]),
244   with_top_level=${withval} ;
245   cross_compiling=yes)
247 dnl Android is a little different when using a standard cross toolchain,
248 dnl so we have to configure especially for it for now. Usually it's
249 dnl something like this:
251 dnl arm-linux-eabi-gcc -Wl,--dynamic-linker -Wl,/system/bin/linker
252 dnl -nostdlib -Wl,-rpath -Wl,/system/lib -Wl,-rpath
253 dnl -Wl,/opt/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib
254 dnl -L/opt/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib
255 dnl -lc -o hello
256 dnl  /opt/android-ndk-r3/build/platforms/android-3/arch-arm/usr/lib/crtbegin_dynamic.o
257 dnl Recent versions of G++ (I'm using 4.5 from source
258 android_ndk=no
259 AC_ARG_WITH([android],
260   AC_HELP_STRING([--with-android], [directory where android NDK is installed]),
261         android_ndk=${withval}
262         if test x"${withval}" != x; then
263           android_ndk=${withval}
264         else
265           android_ndk=/opt/android-ndk-r3/build/platforms/android-5/arch-arm
266         fi
268 CROSS_CXXFLAGS=
269 if test x"${android_ndk}" != xno; then
270   CROSS_CXXFLAGS=-mandroid -fexceptions
271   if test x"${with_top_level}" = x; then
272     with_top_level=/usr/local/android-arm/sysroot/usr
273     cross_compiling=yes
274   fi
275   ANDROID_NDK=${android_ndk}
276   AC_DEFINE(ANDROID, [1], [This is an Android build])
277 else
278   ANDROID_NDK=
280 AC_SUBST(ANDROID_NDK)
281 AM_CONDITIONAL(ANDROID, [ test x"${android_ndk}" != xno ])
283 AC_C_BIGENDIAN
284 AC_C_CONST
285 AC_C_INLINE
287 AC_PATH_PROG(DEJAGNU, runtest)
289 dnl These options are for Cygnal, which collects optional statistics
290 dnl on all the network traffic By default, we turn on statistics
291 dnl collecting for the incoming and outgoing queues, since those are
292 dnl required to be compatiable with FMS 3, and the ActionScript server
293 dnl management API. buffers are the lowest level data storage, this
294 dnl data is the time spent in the queue, and is primarily only used
295 dnl for tuning the queueing API in Gnash. Memoryis the same, it's only
296 dnl used by developers for tuning performance of memory allocations in
297 dnl Gnash.
298 buffers=no
299 que=no
300 memory=no
301 cache=yes
302 stat_proplookup=no
303 AC_ARG_WITH(statistics,
304   AC_HELP_STRING([--with-statistics], [Specify which statistics features to enable]),
305   if test -n ${withval}; then
306     if test "x${withval}" != "xno"; then
307       extlist="${withval}"
308       withval=`echo ${withval} | tr '\054' ' ' `
309     else
310       extlist=""
311       withval=""
312     fi
313   fi
314   statistics_list=""
315   nstatistics=0
316   while test -n "${withval}" ; do
317     val=`echo ${withval} | cut -d ' ' -f 1`
318     [case "${val}" in
319       buffers)
320         buffers=yes
321         nstatistics=$((nstatistics+1))
322         ;;
323       que)
324         que=yes
325         nstatistics=$((nstatistics+1))
326         ;;
327       memory)
328         memory=yes
329         nstatistics=$((nstatistics+1))
330         ;;
331       cache)
332         cache=yes
333         nstatistics=$((nstatistics+1))
334         ;;
335       proplookup)
336         stat_proplookup=yes
337         nstatistics=$((nstatistics+1))
338         ;;
339       all|ALL)
340         buffers=yes
341         memory=yes
342         queu=yes
343         cache=yes
344         stat_proplookup=yes
345         nstatistics=5           dnl this must be incremented if you add anything
346         ;;
347       *) AC_MSG_ERROR([invalid statistics feature specified: ${withval} given (accept: buffers|que|memory|cache|proplookup|all)])
348         ;;
349       esac]
350     withval=`echo ${withval} | cut -d ' ' -f 2-6`
351     if test "x$val" = "x$withval"; then
352       break;
353     fi
354   done
356 if test x${buffers} = xyes; then
357   statistics_list="${statistics_list} buffers"
358   AC_DEFINE(USE_STATS_BUFFERS, [1], [Support statistics collecting for the queue buffers])
359   AC_MSG_WARN([This option will effect your performance])
362 if test x${memory} = xyes; then
363   statistics_list="${statistics_list} memory"
364   AC_DEFINE(USE_STATS_MEMORY, [1], [Support statistics collecting for all memory profiling])
365   AC_MSG_WARN([This option will effect your performance])
368 if test x${que} = xyes; then
369   statistics_list="${statistics_list} queues"
370   AC_DEFINE(USE_STATS_QUEUE, [1], [Support statistics collecting for the queues])
373 if test x${cache} = xyes; then
374   statistics_list="${statistics_list} cache"
375   AC_DEFINE(USE_STATS_CACHE, [1], [Support statistics collecting for the cache])
378 if test x${stat_proplookup} = xyes; then
379   statistics_list="${statistics_list} proplookup"
380   AC_DEFINE(GNASH_STATS_OBJECT_URI_NOCASE, [1], [Collecting and report stats about ObjectURI case lookups])
381   AC_DEFINE(GNASH_STATS_PROPERTY_LOOKUPS, [1], [Collecting and report stats about property lookups])
382   AC_DEFINE(GNASH_STATS_STRING_TABLE_NOCASE, [1], [Collecting and report stats about string_table::key case lookups])
385 dnl this is just so Makefile can print the same list
386 STATISTICS_LIST="$statistics_list"
387 AC_SUBST(STATISTICS_LIST)
390 # These settings are compile time options for the security
391 # setting for anything that lets gnash exchange data with
392 # other applications. Currently this only supports Shared
393 # Objects and Local Connections. Shared Objects are like
394 # your web browsers cookies, and Local Connections use
395 # shared memory to execute methods remotely, and to
396 # exchange data.
398 # The default is to enable everything, and these can
399 # also be controlled dynamically by the $HOME/.gnashrc
400 # file.
402 solreadonly=no
403 localconnection=yes
405 AC_ARG_WITH(security,
406   AC_HELP_STRING([--with-security], [Specify which security features to enable]),
407   if test -n ${withval}; then
408     if test "x${withval}" != "xno"; then
409       extlist="${withval}"
410       withval=`echo ${withval} | tr '\054' ' ' `
411     else
412       extlist=""
413       withval=""
414     fi
415   fi
416   security_list=""
417   nsecurity=0
418   while test -n "${withval}" ; do
419     val=`echo ${withval} | cut -d ' ' -f 1`
420     [case "${val}" in
421       solreadonly)
422         solreadonly=yes
423         nsecurity=$((nsecurity+1))
424         ;;
425       lc)
426         localconnection=yes
427         nsecurity=$((nsecurity+1))
428         ;;
429       all|ALL)
430         solreadonly=yes
431         lc=yes
432         nsecurity=3
433         ;;
434       *) AC_MSG_ERROR([invalid security feature specified: ${withval} given (accept: solreadonly|lc)])
435         ;;
436       esac]
437     withval=`echo ${withval} | cut -d ' ' -f 2-6`
438     if test "x$val" = "x$withval"; then
439       break;
440     fi
441   done
444 if test x$localconnection = xyes; then
445   security_list="${security_list} localconnection"
446   AC_DEFINE(USE_LC, [1],
447                  [Support LocalConnection])
448   AC_MSG_NOTICE([This build supports LocalConnection])
450 if test x$solreadonly = xyes; then
451   security_list="${security_list} solreadonly"
452   AC_DEFINE(USE_SOL_READONLY, [1],
453                  [Shared Objects are read-only])
454   AC_MSG_NOTICE([Shared Objects are read-only])
456 SECURITY_LIST="$security_list"
457 AC_SUBST(SECURITY_LIST)
459 dnl For Haiku, we know the sysroot is in a non-standard place
460 dnl it is important that -lagg comes before -lbe
461 if test x"${haiku}" = xyes; then
462   HAIKU_LIBS=-lbe
463   AC_SUBST(HAIKU_LIBS)
466 dnl Darwin uses libtool instead of ar to produce libraries. We determine which one
467 dnl we have here now. For some reason on Darwin, we don't get the
468 dnl count from grep via stdin correctly. Writing a temp file does the
469 dnl trick, so although it's ugly, that's what we gotta do...
470 AC_MSG_CHECKING([which type of library archiver we have])
471 rm -f .tmp
472 libtool > .tmp 2>&1
473 archiver=`grep -c dynamic .tmp 2>&1`
474 rm -f .tmp
475 dnl is there any good way to report what we found here?
476 AC_MSG_RESULT()
477 if test x"${archiver}" != x && test "${archiver}" -eq 1; then
478    export MACOSX_DEPLOYMENT_TARGET="10.3"
479    darwin=yes
480 else
481    darwin=no
484 dnl When cross compiling, limit the search directories cause otherwise
485 dnl we may get the host headers or libraries by accident. These values
486 dnl are exported, so all the other configure tests in macros/*.m4 use
487 dnl these same settings rather than duplicating them like we used to.
488 dnl To override thise, use the --with-*-incl= and --with-*-libs=
489 dnl options to configure.
490 if test x$cross_compiling = xyes; then
491   AC_MSG_NOTICE([Configuring Gnash for cross compilation])
492   export pkgroot="`$CXX -print-search-dirs | grep "install:" | sed -e 's/install: //' -e 's:/lib/gcc/.*::'`"
493   dnl pkgroot only works correctly with builds of cross tools not in
494   dnl /usr, ie... installed from the distribution packages, or just
495   dnl plain installed in the system tools. This contaminates configure
496   dnl when building for variations of the same basic architecture,
497   dnl like i686-linux -> i586-mingw32.
498   if test x"${pkgroot}" = x"/usr"; then
499     export pkgroot=""
500   fi
501   export incllist="`eval echo ${with_top_level}/include ${pkgroot}/${host_alias}/include ${pkgroot}/include`"
502   export libslist="`eval echo ${with_top_level}/lib ${pkgroot}/${host_alias}/lib ${pkgroot}/lib64 ${pkgroot}/lib32 ${pkgroot}/lib`"
503   export pathlist="`eval echo ${pkgroot}/${host_alias}/bin:${pkgroot}/bin`"
504   npapi=no
505 else
506   AC_MSG_NOTICE([Configuring Gnash for native compilation])
507   export incllist="`eval cat ${srcdir}/macros/incllist`"
508   libslist="`cat ${srcdir}/macros/libslist`"
509   if test -f /usr/bin/dpkg-architecture; then
510     export DEB_HOST_MULTIARCH="`eval dpkg-architecture -qDEB_HOST_MULTIARCH`"
511     export libslist="${libslist} /lib/${DEB_HOST_MULTIARCH} /usr/lib/${DEB_HOST_MULTIARCH}"
512   fi
513   export pathlist=$PATH
516 if test x"${android_ndk}" != xno; then
517    incllist="${android_ndk}/include ${incllist}"
520 AM_CONDITIONAL(CROSS_COMPILING, [ test x$cross_compiling = xyes ])
522 for dir in ${incllist}; do
523   test -d ${dir} && pruned_incllist="${pruned_incllist} ${dir}";
524 done
526 for dir in ${libslist}; do
527   test -d ${dir} && pruned_libslist="${pruned_libslist} ${dir}";
528 done
530 libslist="${pruned_libslist}";
531 incllist="${pruned_incllist}";
533 dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
534 dnl !! 
535 dnl !! IMPORTANT NOTICE 
536 dnl !!
537 dnl !!  Any call to GNASH_PATH_XXX must be be given *after* this snippet.
538 dnl !!  This is to ensure that PKG_CONFIG, cross_compiling and incllist are
539 dnl !!  properly set at the time of call.
540 dnl !!
541 dnl !!  Also GNASH_PKG_FIND has to be called later. Not sure
542 dnl !!  why but calling before breaks detection of CPP (see
543 dnl !!  gnash-dev mailing archives for June 12 2009
544 dnl !!  http://lists.gnu.org/archive/html/gnash-dev/2009-06/index.html
545 dnl !! 
546 dnl !! 
547 dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
549 dnl Check for PKG_CONFIG before any GNASH_PATH call
550 PKG_PROG_PKG_CONFIG
552 dnl --------------------------------------------------------
553 dnl  GUI selection
554 dnl --------------------------------------------------------
556 build_haiku=no
557 build_aos4=no      dnl AmigaOS4 GUI
558 build_kde3=no      dnl WARNING: doesn't work (see https://savannah.gnu.org/bugs/index.php?31782)
559 build_qt4=no
560 build_qtopia3=no
561 build_qtopia4=no
562 build_gtk=no
563 build_fb=no                     dnl Raw framebuffer
564 build_fltk=no
565 build_sdl=no
566 build_aqua=no                   dnl Native MacOSX
567 build_dump=no
568 AC_ARG_ENABLE(gui,
569   AC_HELP_STRING([--enable-gui], [Enable support for the specified GUI toolkits (default=gtk,qt4)]),
570   [if test -n ${enableval}; then
571     enableval=`echo ${enableval} | tr '\054' ' ' `
572   fi
573   while test -n "${enableval}" ; do
574     val=`echo ${enableval} | cut -d ' ' -f 1`
575     case "${val}" in
576       gtk|GTK|gtk2|GTK2)
577         build_gtk=yes
578         ;;
579       kde3|KDE3)
580         build_kde3=yes
581         ;;
582       qt4|QT4|kde4|KDE4)
583         build_qt4=yes
584         ;;
585       qtopia3|QTOPIA3)
586         build_qtopia3=yes
587         ;;
588       qtopia4|QTOPIA4)
589         build_qtopia4=yes
590         ;;
591       sdl|SDL)
592         build_sdl=yes
593         ;;
594       aqua|AQUA|Aqua)
595         build_aqua=yes
596         ;;
597       fltk|FLTK|fltk2|FLTK2)
598         build_fltk=yes
599         ;;
600       fb|FB)
601         build_fb=yes
602         ;;
603       aos4|AOS4)
604         build_aos4=yes
605         ;;
606       haiku|HAIKU)
607         build_haiku=yes
608         ;;
609       dump|DUMP)
610         build_dump=yes
611         ;;
612       all|ALL)
613         build_dump=yes
614         dnl BSD doesn't have a framebuffer interface
615         if test x${linux} = xyes; then
616           build_fb=yes
617         fi
618         if test x${openbsd} != xyes; then
619           build_qt4=yes
620         fi
621         build_sdl=yes
622         build_gtk=yes
623         ;;
624       *) AC_MSG_ERROR([invalid gui ${enableval} given (accept: gtk|kde3|qt4|fltk|sdl|aqua|fb|qtopia3|qtopia4|dump|aos4|haiku)])
625          ;;
626       esac
627     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
628     if test "x$val" = "x$enableval"; then
629       break;
630     fi
631   done],
632   [ dnl Run the following code if no --enable-gui is given
633   build_fb=auto
634   build_sdl=auto
635   if test x"${openbsd}" = xyes; then
636     build_gtk=yes
637     build_dump=auto
638   else if test x"${haiku}" = xyes; then
639     build_haiku=yes;
640   else
641     build_qt4=auto
642     build_gtk=yes
643     build_dump=auto
644   fi
645   fi
646   ]
649 if test x"${build_haiku}" = xyes; then
650   if test x"$haiku" != xyes; then
651     echo "        ERROR: Can not build Haiku gui outside of Haiku
652 operating system." >&3
653   fi
656 dnl We can use Xephyr or fbe to create a fake framebuffer instead of real
657 dnl video memory. This lets us test on a desktop machine.
658 AC_ARG_WITH(fakefb,
659 AC_HELP_STRING([--with-fakefb],
660  [specify a file to be mapped instead of a real framebuffer]),
661  with_fakefb=${withval})
663 fakefb=
664 if test x"${with_fakefb}" = xyes; then
665   dnl This is the default file name fbe uses.
666   fakefb=/tmp/fbe_buffer
667 else
668   if test x"${with_fakefb}" != x; then
669     fakefb=${with_fakefb}
670   fi
672 FAKEFB=${fakefb}
673 AC_SUBST(FAKEFB)
675 if test x"${fakefb}" != x; then
676     AC_DEFINE(ENABLE_FAKE_FRAMEBUFFER, [1], [Enable using a file instead of a real framebuffer])
679 dnl This enable a small handful of tests that aren't designed to be
680 dnl run as part of "make check", as they are either incomplete, or
681 dnl can only be run interactively. These are all primarily oriented
682 dnl towards code development and debugging, instead of regression
683 dnl or unit testing.
684 AC_ARG_ENABLE(devtests, AC_HELP_STRING([--enable-devtests],
685   [Developer only tests, not to be included in make check]),
686 [case "${enableval}" in
687   yes) devtests=yes ;;
688   no)  devtests=no ;;
689   *)   AC_MSG_ERROR([bad value ${enableval} for enable-devtests option]) ;;
690 esac], devtests=no)
691 AM_CONDITIONAL(ENABLE_DEVELOPER_TESTS, [test x${devtests} = xyes])
693 dnl --------------------------------------------------------
694 dnl  Sound handler selection
695 dnl --------------------------------------------------------
696 add_sound=
697 build_sound_none=no
698 build_sound_sdl=no
699 build_sound_ahi=no
700 build_sound_mkit=no
701 AC_ARG_ENABLE(sound,
702   AC_HELP_STRING([--enable-sound=[[sdl|ahi|mkit]]], [Use the specified sound handler (default=sdl)]),
703      [case "${enableval}" in
704       sdl|SDL|Sdl)
705         build_sound_sdl=yes
706         add_sound="sdl"
707         ;;
708       none|NONE|None)
709         build_sound_none=yes
710         add_sound="none"
711         ;;
712       ahi|AHI|Ahi)
713         build_sound_ahi=yes
714         add_sound="ahi"
715         ;;
716       mkit|MKIT|Mkit)
717         build_sound_mkit=yes
718         add_sound="mkit"
719         ;;
720      esac],
721   [if test x"${haiku}" = xyes; then
722      build_sound_mkit=yes
723      add_sound="mkit"
724    else
725      if test x${build_sound_none} = xno; then
726        build_sound_sdl=yes
727        add_sound=sdl
728      fi
729    fi]
732 dnl --------------------------------------------------------
733 dnl  Media handler selection
734 dnl --------------------------------------------------------
735 build_media_gst=no
736 build_media_ffmpeg=auto
737 build_media_none=no
738 AC_ARG_ENABLE(media,
739   AC_HELP_STRING([--enable-media=handler],
740     [Enable media handling support using the specified handler: gst, ffmpeg or none (no sound) [[gst]] ]),
741   
742     if test -n ${enableval}; then
743       enableval=`echo ${enableval} | tr '\054' ' ' `
744     fi
745     dnl When --enable-media is given, all media defaults to off
746     dnl except the explicitly enabled ones
747     build_media_ffmpeg=no
748     build_media_gst=no
749     while test -n "${enableval}"; do
750       val=`echo ${enableval} | cut -d ' ' -f 1`
751       [case "${val}" in
752         GST|gst)
753           build_media_gst=yes
754           media_list="${media_list}gst "
755           ;;
756         FFMPEG|ffmpeg)
757           build_media_ffmpeg=yes
758           media_list="${media_list}ffmpeg "
759           ;;
760         no|NO|none)
761           build_media_none=yes
762           media_list="none"
763           ;;
764         *)
765           AC_MSG_ERROR([bad value ${enableval} for --enable-media option])
766           ;;
767      
768       esac]
769       enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
770       if test "x$val" = "x$enableval"; then
771         break;
772       fi
773     done,
774     [if test x"${build_haiku}" = xyes; then
775         build_media_ffmpeg=yes
776         build_media_haiku=yes
777         media_list="ffmpeg haiku"
778      else
779         build_media_gst=yes
780         media_list="gst"
781     fi]
784 dnl If no render is selected, and media handling isn't disabled, them enable gst
785 if test x${build_media_none} = xno -a x${build_media_gst} = xno -a x${build_media_ffmpeg} = xno; then
786   build_media_gst=yes
789 if test x"$build_media_ffmpeg" != x"no"; then # yes or auto
790   GNASH_PATH_FFMPEG
791   if test x"${build_media_ffmpeg}" = xauto; then
792     dnl TODO: have GNASH_PATH_FFMPEG set ${has_ffmpeg}
793     if test x"$FFMPEG_LIBS" != x; then
794       build_media_ffmpeg=yes
795       media_list="${media_list} ffmpeg"
796     else
797       build_ogl=no
798     fi
799   fi
802 MEDIA_CONFIG="${media_list}"
803 AC_SUBST(MEDIA_CONFIG)
805 dnl Multiple input devices are supported. These can all work in
806 dnl varying combinations, so several may be listed. These are only
807 dnl required when using the Framebuffer, as without the X11 desktop,
808 dnl Gnash has to handle all these internally. This can get
809 dnl messy, as one might want to use a touchscreen with a normal mouse
810 dnl or keyboard attached. 
811 dnl By default, don't build any of these, as they are only for the 
812 dnl Framebuffer running without X11.
813 if test x"${build_fb}" = xyes -a x"${linux}" = xyes; then
814   build_ps2mouse=no
815   build_ps2keyboard=yes
816   build_input_events=yes
817   build_tslib=yes
818   input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via Tslib"
819 else
820   build_ps2mouse=no
821   build_ps2keyboard=no
822   build_input_events=no
823   build_tslib=no
824   input_events=
826 AC_ARG_ENABLE(input,
827   AC_HELP_STRING([--enable-input], [Enable support for the specified input devices for the framebuffer GUI (default=ps2mouse|ps2keyboard|events|touchscreen)]),
828   [if test -n ${enableval}; then
829     enableval=`echo ${enableval} | tr '\054' ' ' `
830   fi
831   build_ps2mouse=no
832   build_ps2keyboard=no
833   build_input_events=no
834   build_tslib=no
835   while test -n "${enableval}" ; do
836     val=`echo ${enableval} | cut -d ' ' -f 1`
837     case "${val}" in
838       ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
839         build_ps2mouse=yes
840         input_events="${input_events}, PS/2 Mouse"
841         ;;
842       ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
843         build_ps2keyboard=yes
844         input_events="${input_events}, PS/2 Keyboard"
845         ;;
846       i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
847         input_events="${input_events}, Input Event Device"
848         build_input_events=yes
849         ;;
850       t*|T*) dnl use a touchscreen with tslib, which works like a mouse
851         build_tslib=yes
852         input_events="${input_events}, Touchscreen"
853         ;;
854       a*) dnl all
855         build_ps2mouse=yes
856         build_ps2keyboard=yes
857         build_tslib=yes
858         if test x"${linux}" = xyes; then
859           build_input_events=yes
860           input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via Tslib"                
861         else
862           build_input_events=no
863           input_events="PS/2 Mouse, PS/2 Keyboard, Touchscreen via Tslib"                
864         fi
865         ;;
866       *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: ps2mouse|keyboard|events,touchscreen)])
867          ;;
868       esac
869     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
870     if test "x$val" = "x$enableval"; then
871       break;
872     fi
873   done],
876 if test x$build_sdl != xno -o x$build_sound_sdl = xyes; then
877   GNASH_PATH_SDL
879 AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} = xyes])
882 dnl -----------------------------------------------------
883 dnl Check for SDL and decide about auto gui accordingly.
884 dnl Need be done after build_sound_sdl and build_sdl are
885 dnl initialized and before they are checked for yes/no
886 dnl -----------------------------------------------------
887 if test x"${build_sdl}" = xauto; then
888   if test xyes = x"${has_sdl}"; then
889     build_sdl=yes
890   else
891     AC_MSG_NOTICE([sdl GUI will not be built (no sdl development files found)])
892     build_sdl=no
893   fi
896 dnl -------------------------------
897 dnl Renderer Selection
898 dnl -------------------------------
899 input_events=
900 dnl By default, we want to to build all renderers
901 dnl DirectFB has both a device layer and a rendering layer, although
902 dnl currently the rendering part is incomplete. Configure support is
903 dnl included for development purposes.
904 build_directfb=no
905 dnl The OpenVG support works on both the desktop and embedded devices
906 dnl that don't run X11. It is supported by iPhone/iPad/Android
907 dnl devices, and the nouveau driver on the desktop.
908 build_ovg=no
909 dnl The OpenGLES1 renderer is a work in progress. It is originally
910 dnl based on a patch to Gnash 0.8.5, which of course not only didn't
911 dnl compile anymore, it was all hardcoded into the framebuffer
912 dnl code. This version compiles with the latest internal rendering
913 dnl API, and works properly with the glue code for the Gnash GUIs.
914 build_gles1=no
915 dnl OpenGL works, but suffers from performance and rendering quality
916 dnl problems. This should eventually be replacd by the OpenGLES1 and
917 dnl OpenVG renders.
918 build_ogl=no
919 dnl AGG is a software only renderer
920 build_agg=yes
921 build_cairo=yes
922 renderer_list="agg cairo"
923 AC_ARG_ENABLE(renderer,
924   AC_HELP_STRING([--enable-renderer], [Enable support for the specified renderers (agg|cairo|opengl|openvg|all, default=all)]),
925   if test -n ${enableval}; then
926     if test "x${enableval}" != "xno" -o "x${enableval}" != "xnone" ; then
927       renderer_list="none"
928       enableval=`echo ${enableval} | tr '\054' ' ' `
929     else
930       renderer_list=""
931       enableval=""
932     fi
933   fi
934   renderer_list=""
935   build_ovg=no
936   build_ogl=no
937   build_gles1=no
938   build_gles2=no
939   build_agg=no
940   build_cairo=no
941   while test -n "${enableval}" ; do
942     val=`echo ${enableval} | cut -d ' ' -f 1`
943     [case "${val}" in
944       no*|NO*)
945         renderer_list="none"
946         build_ovg=no
947         build_ogl=no
948         build_gles1=no
949         build_gles2=no
950         build_agg=no
951         build_cairo=no
952         ;;
953       all|ALL)
954         renderer_list="agg cairo opengl openvg, opengles1"
955         build_ogl=yes
956         build_agg=yes
957         build_cairo=yes
958         build_ovg=no
959         nrender=3
960         ;;
961       ogl|OGL|OpenGL|opengl)
962         renderer_list="${renderer_list} opengl"
963         build_ogl=yes
964         ;;
965       gles|GLES|gles1|GLES1)
966         renderer_list="${renderer_list} opengles1"
967         build_gles1=yes
968         build_ogl=no
969         nrender=$((nrender+1))
970         ;;
971       ovg|OVG|OpenVG|openvg)
972         renderer_list="${renderer_list} openvg"
973         build_ovg=yes
974         nrender=$((nrender+1))
975         ;;
976       directfb|dfb)
977         renderer_list="${renderer_list} DirectFB"
978         build_directfb=yes
979         nrender=$((nrender+1))
980         ;;
981       agg|AGG)
982         renderer_list="${renderer_list} agg"
983         build_agg=yes
984         ;;
985       cairo|CAIRO|Cairo*)
986         renderer_list="${renderer_list} cairo"
987         build_cairo=yes
988         ;;
989       *) AC_MSG_ERROR([invalid renderer specified: ${enableval} given (accept:  (opengl|openvg|cairo|agg|all)])
990         ;;
991       esac]
992     enableval=`echo ${enableval} | cut -d ' ' -f 2-`
993     if test "x$val" = "x$enableval"; then
994       break;
995     fi
996   done
999 if test x"${build_ovg}" = xyes; then
1000   GNASH_PATH_OPENVG
1001   dnl If OpenVG isn't installed, disable it
1002   if test x"${has_openvg}" = xno; then
1003     AC_MSG_WARN([OpenVG specified but no development files found!])
1004     renderer_list=`echo ${renderer_list} | sed -e 's/ openvg//' `
1005     nrender=$((nrender-1))
1006   fi
1009 dnl VA API is used by default for all H.264 videos. HW requirements:
1010 dnl     * AMD GPUs with UVD2 and xvba-video VA driver
1011 dnl     * NVIDIA GPUs with vdpau-video VA driver
1012 dnl     * All HW with a VA driver supporting the VA/GLX extensions or
1013 dnl     vaPutSurface(Pixmap,...). This may include the Intel
1014 dnl     Moorestown platform and future G45 VA driver.
1015 dnl NOTE: it is possible to use Gnash/VAAPI on platforms with an Intel
1016 dnl GMA500 but you currently will have to build the AGG renderer
1017 dnl instead of the OGL (OpenGL) one. 
1018 build_vaapi_device=no
1019 build_openmax_device=no
1020 build_egl_device=no
1021 build_x11_device=no
1022 build_directfb_device=no
1023 if test x"${build_fb}" = xyes -o x"${build_fb}" = xauto; then
1024   build_fb_agg=yes
1026 dnl AGG support for the framebuffer requires the rawfb device
1027 if test x"${build_fb_agg}" = xyes -a x"${build_agg}" = xyes; then
1028   build_rawfb_device=yes
1029   device_list="RawFB"
1030   ndevice=1
1031 else
1032   build_rawfb_device=no
1033   device_list=""
1034   ndevice=0
1036 AC_ARG_ENABLE(device,
1037   AC_HELP_STRING([--enable-device], [Specify which hardware abstraction to use to support to enable (none,egl,directfb,rawfb,x11,vaapi)]),
1038   enableval=`echo ${enableval} | tr '\054' ' ' `
1039   build_egl_device=no
1040   build_rawfb_device=no
1041   device_list=""
1042   ndevice=0
1043   while test -n "${enableval}" ; do
1044     val=`echo ${enableval} | cut -d ' ' -f 1`
1045     [case "${val}" in
1046       no*|NO*)
1047         device_list="none"
1048         build_vaapi_device=no
1049         build_openmax_device=no
1050         build_egl_device=no
1051         build_directfb_device=no
1052         build_x11_device=no
1053         ndevice=0
1054         ;;
1055       va*|VA*)
1056         device_list="${device_list} VAAPI"
1057         build_vaapi_device=yes
1058         ndevice=$((ndevice+1))
1059         ;;
1060       eg*|EG*)
1061         device_list="${device_list} EGL"
1062         build_egl_device=yes
1063         ndevice=$((ndevice+1))
1064         ;;
1065       x1*|X1*)
1066         device_list="${device_list} X11"
1067         build_x11_device=yes
1068         ndevice=$((ndevice+1))
1069         ;;
1070       di*|Di*|DI*|dfb)
1071         device_list="${device_list} DirectFB"
1072         build_directfb_device=yes
1073         ndevice=$((ndevice+1))
1074         ;;
1075       ra*|RAW*)
1076         device_list="${device_list} RawFB"
1077         build_rawfb_device=yes
1078         ndevice=$((ndevice+1))
1079         ;;
1080       all|ALL)
1081         device_list="EGL RawFB X11"
1082         build_openmax_device=no
1083         build_vaapi_device=no
1084         build_egl_device=yes
1085         build_rawfb_device=yes
1086         build_directfb_device=no
1087         build_x11_device=yes
1088         ndevice=3
1089         ;;
1090       op*|Op*|OP*)
1091         device_list="${device_list} OpenMAX"
1092         build_openmax_device=yes
1093         ndevice=$((ndevice+1))
1094         ;;
1095       *) AC_MSG_ERROR([invalid device feature specified: ${enableval} given (accept: none,vaapi)])
1096         ;;
1097       esac]
1098     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1099     if test "x$val" = "x$enableval"; then
1100       break;
1101     fi
1102   done
1105 if test x"${have_ffmpeg_vaapi}" = x"yes" -a x"${build_vaapi_device}" = x"yes"; then
1106   use_libva=no
1107   use_libva_x11=no
1108   use_libva_glx=no
1109   dnl if the version of FFmpeg is recent enough, (r20957, 52.45.0), then
1110   dnl look for VAAPI support so we can use use the VAAPI enabled FFmpeg.
1111   if test x"${have_ffmpeg_vaapi}" = xyes; then
1112     use_libva=yes
1113     GNASH_PKG_FIND([libva],
1114       [va/va.h],
1115       [Video Acceleration API],
1116       vaInitialize
1117     )
1118     use_libva_x11=yes
1119     GNASH_PKG_FIND([libva_x11],
1120       [va/va_x11.h],
1121       [VA API (X11 display)],
1122       vaGetDisplay,
1123       [], [-lva-x11]
1124     )
1126     if test x$build_ogl = xyes; then
1127       use_libva_glx=yes
1128       GNASH_PKG_FIND([libva_glx],
1129         [va/va_glx.h],
1130         [VA API (GLX display)],
1131         vaGetDisplayGLX,
1132         [], [-lva-glx]
1133       )
1134     fi
1135   fi
1138 dnl libVA drivers. We declare conditional for both the option being
1139 dnl selected, as well as whether or not it's found. This we can
1140 dnl generate better error handling if it's not found.
1141 AM_CONDITIONAL(USE_VAAPI, test x"${use_libva}" = xyes)
1143 dnl Until the hwaccel patches in FFmpeg wind up in the ffmpeg-plugin,
1144 dnl restrict using HW Accel to using FFmpeg directly.
1145 dnl test xyes = xyes -a ( x != xyes -o x != xyes )
1146 if test x"${build_vaapi}" = x"yes" -a x"${have_ffmpeg}" != x"yes"; then
1147   AC_MSG_ERROR(["Hardware acceleration currently not supported unless using FFmpeg."])
1150 AM_CONDITIONAL(HAVE_VAAPI, test x"${found_libva_incl}" = xyes)
1151 AM_CONDITIONAL(HAVE_VAAPI_GLX, test x"${found_libva_glx_incl}" = xyes)
1152 AM_CONDITIONAL(HAVE_VAAPI_X11, test x"${found_libva_x11_incl}" = xyes)
1154 if test x"${build_egl_device}" = xyes; then
1155   GNASH_PKG_FIND(EGL, [EGL/egl.h], [EGL library], eglGetDisplay)
1156   if test xyes = x"${has_EGL}"; then
1157     AC_DEFINE(BUILD_EGL_DEVICE, [ 1 ],
1158           [Build the EGL device for OpenVG, OpenGLES1&2, and X11/Mesa])
1159       device_list="${device_list} EGL"
1160       ndevice=$((ndevice+1))
1161   else
1162     AC_MSG_WARN(["EGL requested but development package not found!"])
1163     build_egl_device=no
1164   fi
1167 if test ${ndevice} -eq 0; then
1168       device_list="none"
1169       ndevice=1
1172 AM_CONDITIONAL(BUILD_DEVICES, test ${ndevice} -gt 0)
1174 dnl 16 bit: RGB555, RGB565
1175 dnl 24 bit: RGB24, BGR24
1176 dnl 32 bit: RGBA32, BGRA32
1177 pixelformat=all
1178 AC_ARG_WITH(pixelformat,
1179   AC_HELP_STRING([--with-pixelformat=], [Use the specified pixel format for AGG (default=all)]),
1180   [if test -n ${withval}; then
1181     pixelformat="${withval}"
1182     withval=`echo ${withval} | tr '\054' ' ' `
1183   fi
1184   while test -n "${withval}" ; do
1185     val=`echo ${withval} | cut -d ' ' -f 1`
1186     case "${val}" in
1187       all)
1188         # allow special value "all" set by user (handled below)
1189         ;; 
1190       argb32|ARGB32)
1191         AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32])
1192         ;;
1193       abgr32|ABGR32)
1194         AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32])
1195         ;;
1196       bgra32|BGRA32)
1197         AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
1198         ;;
1199       bgr24|BGR24)
1200         AC_DEFINE(PIXELFORMAT_BGR24, [1], [BGR24])
1201         ;;
1202       rgba32|RGBA32)
1203         AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32])
1204         ;;
1205       rgb24|RGB24)
1206         AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24])
1207         ;;
1208       rgb555|RGB555)
1209         AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555])
1210         ;;
1211       rgb565|RGB565)
1212         AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565])
1213         ;;
1214       *) AC_MSG_ERROR([invalid pixel format ${withval} given (accept: all|RGB555|RGB565|RGB24|BGR24|BGRA32|RGBA32|ARGB32|ABGR32)])
1215          ;;
1216       esac
1217     withval=`echo ${withval} | cut -d ' ' -f 2-6`
1218     if test "x$val" = "x$withval"; then
1219       break;
1220     fi
1221   done],
1222   [if test x$build_haiku = xyes -a x$build_sdl != xyes; then
1223         AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
1224         pixelformat=BGRA32
1225    fi]
1228 if test x$pixelformat = xall; then
1229   if test x$build_agg = xyes; then
1230     ### The fact that we're building GTK doesn't mean we're not also
1231     ### building KDE or SDL, each needing its own pixel format !
1232     #if test x$build_gtk = xyes; then
1233     #  AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24 pixel format])
1234     #  pixelformat="RGB24"
1235     #else
1236       AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555 pixel format])
1237       AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565 pixel format])
1238       AC_DEFINE(PIXELFORMAT_RGB24,  [1], [RGB24 pixel format])
1239       AC_DEFINE(PIXELFORMAT_BGR24,  [1], [BGR24 pixel format])
1240       AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32 pixel format])
1241       AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32 pixel format])
1242       AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32 pixel format])
1243       AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32 pixel format])
1244     #fi
1245   fi
1248 if test x"${build_ogl}" != xno; then # yes or auto
1249   GNASH_PATH_OPENGL
1250   if test x"${build_ogl}" = xauto; then
1251     if test xyes = x"${has_opengl}"; then
1252       build_ogl=yes
1253       renderer_list="${renderer_list} opengl"
1254     else
1255       build_ogl=no
1256     fi
1257   fi
1260 AM_CONDITIONAL(BUILD_OVG_RENDERER,   [ test x${build_ovg} = xyes ])
1261 AM_CONDITIONAL(BUILD_GLES1_RENDERER, [ test x${build_gles1} = xyes ])
1262 AM_CONDITIONAL(BUILD_GLES2_RENDERER, [ test x${build_gles2} = xyes ])
1263 AM_CONDITIONAL(BUILD_OGL_RENDERER,   [ test x${build_ogl} = xyes])
1264 AM_CONDITIONAL(BUILD_AGG_RENDERER,   [ test x${build_agg} = xyes ])
1265 AM_CONDITIONAL(BUILD_CAIRO_RENDERER, [ test x${build_cairo} = xyes ])
1267 if test x"${has_openvg}" = xyes; then
1268    AC_DEFINE([RENDERER_OPENVG], [1], [Use OpenVG renderer])
1271 if test x"${build_ogl}" = xyes; then
1272    AC_DEFINE([RENDERER_OPENGL], [1], [Use OpenGL renderer])
1275 if test x"${build_agg}" = xyes; then
1276   AC_DEFINE([RENDERER_AGG], [1], [Use AntiGrain renderer])
1279 if test x"${build_cairo}" = xyes; then
1280   GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
1281   AC_DEFINE([RENDERER_CAIRO], [1], [Use cairo renderer])
1284 if test x"${build_agg}" = xyes; then
1285    GNASH_PATH_AGG
1288 AC_PATH_PROG(PERL, perl)
1289 AM_CONDITIONAL(HAVE_PERL, test x"$PERL" != x)
1291 AC_PATH_PROG(CSOUND, csound)
1292 AM_CONDITIONAL(HAVE_CSOUND, test x"$CSOUND" != x)
1294 AC_PATH_PROG(GIT, git)
1295 AC_SUBST(GIT)
1297 dnl --------------------------------------------------------
1298 dnl Extension selection
1299 dnl --------------------------------------------------------
1300 ext_dejagnu=no
1301 ext_mysql=no
1302 ext_fileio=no
1303 ext_gtk=no
1304 ext_lirc=no
1305 ext_dbus=no
1306 ext_all=no
1307 extensions_list=
1308 extensions_support=yes
1309 nextensions=0
1310 AC_ARG_ENABLE(extensions,
1311   AC_HELP_STRING([--enable-extensions=], [Specify which extensions to build (default: none)])
1312   AC_HELP_STRING([--disable-extensions], [Disable support for extensions entirely]),
1313   if test -n ${enableval}; then
1314     if test "x${enableval}" != "xno"; then
1315       extlist="${enableval}"
1316       enableval=`echo ${enableval} | tr '\054' ' ' `
1317       AC_DEFINE([USE_EXTENSIONS], [1], [Specify that extension support is enabled.])
1318     else
1319       extlist=""
1320       enableval=""
1321       extensions_support=no
1322     fi
1323   fi
1324   nextensions=0
1325   while test -n "${enableval}" ; do
1326     val=`echo ${enableval} | cut -d ' ' -f 1`
1327     extensions_list="${extensions_list} ${val}"
1328     [case "${val}" in
1329       dejagnu|DEJAGNU|dj|DJ)
1330         AC_DEFINE(USE_DEJAGNU_EXT, [1], [Build the DejaGnu extension])
1331         AC_MSG_NOTICE([Adding DejaGnu extension])
1332         ext_dejagnu=yes
1333         nextensions=$((nextensions+1))
1334         ;;
1335       mysql|MYSQL|sql|SQL)
1336         AC_DEFINE(USE_MYSQL_EXT, [1], [Build the MySQL extension])
1337         AC_MSG_NOTICE([Adding MySql extension])
1338         ext_mysql=yes
1339         nextensions=$((nextensions+1))
1340         ;;
1341       fileio|FILEIO|io|IO)
1342         AC_DEFINE(USE_FILEIO_EXT, [1], [Build the FileIO extension])
1343         AC_MSG_NOTICE([Adding FileIO extension])
1344         ext_fileio=yes
1345         nextensions=$((nextensions+1))
1346         ;;
1347       gtk|GTK|gtk2|GTK2)
1348         AC_DEFINE(USE_GTK_EXT, [1], [Build the GTK extension])
1349         ext_gtk=yes
1350         nextensions=$((nextensions+1))
1351         ;;
1352       lirc|LIRC)
1353         AC_DEFINE(USE_LIRC_EXT, [1], [Build the LIRC extension])
1354         ext_lirc=yes
1355         nextensions=$((nextensions+1))
1356         ;;
1357       dbus|DBUS)
1358         AC_DEFINE(USE_DBUS_EXT, [1], [Build the DBUS extension])
1359         ext_dbus=yes
1360         nextensions=$((nextensions+1))
1361         ;;
1362       all|ALL)
1363         AC_DEFINE(USE_GTK_EXT, [1], [Build all the extensions])
1364         ext_dejagnu=yes
1365         ext_mysql=yes
1366         ext_fileio=yes
1367         ext_gtk=yes
1368         ext_lirc=yes
1369         ext_dbus=yes
1370         ext_all=yes
1371         nextensions=9
1372         ;;
1373       *) AC_MSG_ERROR([invalid extension specified: ${enableval} given (accept: MYSQL|DEJAGNU|FILEIO|GTK|LIRC|DBUS|METOME|ALL)])
1374          ;;
1375       esac]
1376     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1377     if test "x$val" = "x$enableval"; then
1378       break;
1379     fi
1380   done
1381   EXTENSIONS_LIST="$extensions_list"
1382   AC_SUBST(EXTENSIONS_LIST)
1385 if test x$ext_dbus = xyes; then
1386   GNASH_PATH_DBUS
1389 if test x$ext_mysql = xyes; then
1390   GNASH_PATH_MYSQL
1393 AM_CONDITIONAL(BUILD_DEJAGNU_EXT, [ test x$ext_dejagnu = xyes ])
1394 AM_CONDITIONAL(BUILD_FILEIO_EXT, [ test x$ext_fileio = xyes ])
1395 AM_CONDITIONAL(BUILD_MYSQL_EXT, [ test x$ext_mysql = xyes ])
1396 AM_CONDITIONAL(BUILD_GTK_EXT, [ test x$ext_gtk = xyes ])
1397 AM_CONDITIONAL(BUILD_LIRC_EXT, [ test x$ext_lirc = xyes ])
1398 AM_CONDITIONAL(BUILD_DBUS_EXT, [ test x$ext_dbus = xyes ])
1399 AM_CONDITIONAL(BUILD_EXTENSIONS, [ test -n "$extensions_list"])
1401 AM_CONDITIONAL(ENABLE_EXTENSIONS, [ test "x${extensions_support}" != "xno" ])
1403 dnl --------------------------------------------------------
1404 dnl Libtool
1405 dnl --------------------------------------------------------
1407 AC_LIBTOOL_DLOPEN
1408 AC_LIBTOOL_WIN32_DLL
1409 AC_DISABLE_STATIC
1410 AC_PROG_LIBTOOL
1411 AC_SUBST(LIBTOOL_DEPS)
1412 DLOPEN="-dlopen"
1413 DLPREOPEN="-dlpreopen"
1414 AC_SUBST(DLOPEN)
1415 AC_SUBST(DLPREOPEN)
1417 GNASH_PKG_FIND([ltdl], [ltdl.h], [libltdl library], [lt_dlinit])
1419 if test x"$has_ltdl" = x"yes";then
1420   AC_DEFINE(HAVE_LTDL, [1], [Libtool 2.x defines this, but libtool 1.5 does not])
1423 dnl --------------------------------------------------------
1424 dnl SOL dir
1425 dnl --------------------------------------------------------
1426 soldir=/tmp
1427 AC_ARG_WITH(soldir,
1428  AC_HELP_STRING([--with-soldir],
1429  [directory for .sol files]),
1430  with_soldir=${withval})
1431 if test x${with_soldir} != x; then
1432   soldir=${with_soldir}
1434 SOLDIR=${soldir}
1435 AC_SUBST(SOLDIR)
1437 dnl --------------------------------------------------------
1438 dnl AVM2
1439 dnl --------------------------------------------------------
1440 dnl AC_ARG_ENABLE(avm2,
1441 dnl   AC_HELP_STRING([--enable-avm2], [Enable support for AS3]),
1442 dnl   [case "${enableval}" in
1443 dnl     yes) avm2=yes ;;
1444 dnl     no)  avm2=no ;;
1445 dnl     *)   AC_MSG_ERROR([bad value ${enableval} for enable-avm2 option]) ;;
1446 dnl   esac], avm2=no
1447 dnl )
1448 dnl AM_CONDITIONAL(ENABLE_AVM2, [test x"$avm2" = xyes])
1449 dnl if test x$avm2 = xyes; then
1450 dnl     AC_DEFINE(ENABLE_AVM2, [1], [Enable AVM2 code])
1451 dnl fi
1452 AM_CONDITIONAL(ENABLE_AVM2, false)
1454 dnl This option is only used if you want Gnash to interwork with 
1455 dnl the Adobe player using the LocalConnection class.
1456 dnl lckey=0xdd3adabd
1457 AC_ARG_WITH(lckey,
1458  AC_HELP_STRING([--with-lckey],
1459  [shared memory key for your system]),
1460  with_lckey=${withval})
1462 if test x${with_lckey} != x; then
1463   lckey=${with_lckey}
1464 else
1465   lckey=0xcbc384f8
1467 LC_KEY=${lckey}
1468 AC_SUBST(LC_KEY)
1470 AC_ARG_ENABLE(python,
1471   AC_HELP_STRING([--enable-python],[Enable python for the python wrapper]),
1472 [case "${enableval}" in
1473   yes) python=yes ;;
1474   no)  python=no ;;
1475   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-python option]) ;;
1476 esac],python=no)
1478 dnl Look for python, which is optional. If enabled, a python loadable
1479 dnl module of Gnash is created.
1480 GNASH_PATH_PYTHON
1481 AM_CONDITIONAL([USE_PYTHON], test x"$python" = xyes)
1482 AM_CONDITIONAL([HAS_PYTHON], test x"$has_python" = xyes)
1484 dnl By default debug logging is enabled. For better performance, it can
1485 dnl be disabled, as when running as a plugin, nobody sees the debug messages
1486 dnl anyway. Debug logging is primarily for developers, so we can turn it off
1487 dnl for package builds.
1488 AC_ARG_ENABLE(log,
1489   AC_HELP_STRING([--enable-log],[Enable debug logging]),
1490 [case "${enableval}" in
1491   yes) debuglog=yes ;;
1492   no)  debuglog=no ;;
1493   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-log option]) ;;
1494 esac],debuglog=yes)
1496 if test x"${debuglog}" = x"yes"; then
1497   AC_DEFINE([DEBUG_LOGGING], [1], [Enable debug logging])
1500 # Maybe use jemalloc, which handles memory fragmentation for
1501 # ECAMscript languages better than the regular system malloc.
1502 # This seems like a good idea, as both the other player and
1503 # Mozilla/Firefox both recently switched to using jemalloc.
1504 AC_ARG_ENABLE(jemalloc,
1505   AC_HELP_STRING([--enable-jemalloc],[Enable jemalloc instead of system malloc]),
1506 [case "${enableval}" in
1507   yes) jemalloc=yes ;;
1508   no)  jemalloc=no ;;
1509   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-jemalloc option]) ;;
1510 esac],jemalloc=yes)
1512 AC_CHECK_SIZEOF([void *], [4])
1514 if test "x${ac_cv_sizeof_void_p}" != x4 -a x"${ac_cv_sizeof_void_p}" != x8; then
1515   dnl jemalloc doesn't support unusual pointer sizes
1516   jemalloc=no
1519 dnl There is some weird stuff going on with NetBSD and jemalloc, so don't 
1520 dnl build it for now.
1521 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
1522   jemalloc=no
1524 dnl If the compiler doesn't have local thread storage enabled, don't try to
1525 dnl use jemalloc.
1526 if test x"${jemalloc}" = x"yes"; then
1527   AC_TRY_COMPILE([], [
1528     extern __thread int global_i; ],
1529     has_local_thread_storage=yes
1530   )
1531   if test x"${has_local_thread_storage}" = x"yes"; then
1532     AC_DEFINE([HAVE_LOCAL_THREAD_STORAGE], [1], [Has __thread (local thread storage) support])
1533     AC_DEFINE([USE_JEMALLOC], [], [Use jemalloc instead of system malloc])
1534   else
1535     jemalloc=no
1536   fi
1539 dnl We can search libs for mallinfo to decide whether we have it or not.
1540 dnl This is added to the linker flags when it's found. Usually it's -lc, but
1541 dnl on OpenSolaris it's -lmalloc, so this fixes the build.
1542 AC_SEARCH_LIBS([mallinfo], [c malloc],
1543                AC_DEFINE(HAVE_MALLINFO, [1], [Has mallinfo()])
1544                mallinfo=yes
1545                )
1547 AM_CONDITIONAL([HAVE_MALLINFO], test x$mallinfo = xyes)
1548 AM_CONDITIONAL(JEMALLOC, test x$jemalloc = xyes)
1550 AC_SEARCH_LIBS([getaddrinfo], [c],
1551                AC_DEFINE(HAVE_IPV6, [1], [Has IPV6 support])
1552                ipv6=yes
1553                )
1555 AC_ARG_ENABLE(fps-debug,
1556   AC_HELP_STRING([--enable-fps-debug],[Enable FPS debugging code]),
1557 [case "${enableval}" in
1558   yes) AC_DEFINE([GNASH_FPS_DEBUG], [1], [Enable FPS debugging code])
1559 esac])
1561 dnl IPC_INFO isn't portable, and doesn't exist on BSD
1562 AC_TRY_COMPILE([#include <sys/ipc.h> #include <sys/shm.h>], [
1563   int flag = IPC_INFO; ],
1564   AC_DEFINE([HAVE_IPC_INFO], [1], [Use ipc_info])
1567 dnl --------------------------------------------------------
1568 dnl Disable menus
1569 dnl --------------------------------------------------------
1570 dnl Don't add the GUI menu. Some educational systems think this adds
1571 dnl clutter and confusion, like on the OLPC.
1572 AC_ARG_ENABLE(menus,
1573   AC_HELP_STRING([--disable-menus],[Disable the GUI menus]),
1574 [case "${enableval}" in
1575   yes) menus=yes ;;
1576   no)  menus=no ;;
1577   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-menus option]) ;;
1578 esac],menus=yes)
1580 if test x"$menus" = x"yes"; then
1581   AC_DEFINE([USE_MENUS], [], [GUI Menu support])
1583 AM_CONDITIONAL(MENUS, test x$menus = xyes)
1585 dnl --------------------------------------------------------
1586 dnl Disable SWF information
1587 dnl --------------------------------------------------------
1588 dnl Don't gather SWF information in tree form. This takes
1589 dnl resources and memory that can be saved if there's no
1590 dnl need to examine SWF internals.
1591 AC_ARG_ENABLE(swftree,
1592   AC_HELP_STRING([--disable-swftree],[Disable showing SWF properties]),
1593 [case "${enableval}" in
1594   yes) swftree=yes ;;
1595   no)  swftree=no ;;
1596   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-swf-properties option]) ;;
1597 esac],swftree=yes)
1599 if test x"$swftree" = x"yes"; then
1600   AC_DEFINE([USE_SWFTREE], [], [View SWF information])
1602 AM_CONDITIONAL(SWFTREE, test x$swftree = xyes)
1604 dnl --------------------------------------------------------
1605 dnl Disable testsuite
1606 dnl --------------------------------------------------------
1607 dnl Disable running any tests for "make check". This may sound stupid, but
1608 dnl this option is designed to solely be used by maintainers in the 
1609 dnl DISTCHECK_CONFIGURE_FLAGS when building packages. Gnash's testing infrastructure
1610 dnl is complex, and often the the testsuites will work, but due to some obscure reason,
1611 dnl make distcheck fails.
1612 AC_ARG_ENABLE(testsuite,
1613   AC_HELP_STRING([--disable-testsuite],[Disable the testsuite, maintainers option only]),
1614 [case "${enableval}" in
1615   yes) testsuite=yes ;;
1616   no)  testsuite=no ;;
1617   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-testsuite option]) ;;
1618 esac],testsuite=yes)
1620 if test x"$testsuite" = x"yes"; then
1621   AC_DEFINE([USE_TESTSUITE], [], [Testsuite support, maintainers option only])
1623 AM_CONDITIONAL(TESTSUITE, test x$testsuite = xyes)
1625 dnl --------------------------------------------------------
1626 dnl Write the file to disk in the plugin
1627 dnl --------------------------------------------------------
1628 AC_ARG_ENABLE(write,
1629   AC_HELP_STRING([--enable-write], [Makes the Mozilla plugin write the currently playing SWF movie to /tmp.]),
1630 [case "${enableval}" in
1631   yes) write=yes ;;
1632   no)  write=no ;;
1633   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-write option]) ;;
1634 esac],write=no)
1636 if test x"$write" = x"yes"; then
1637   AC_DEFINE([WRITE_FILE], [], [Write files while streaming])
1640 dnl --------------------------------------------------------
1641 dnl Write a standalone gnash launcher to disk from the plugin
1642 dnl --------------------------------------------------------
1643 AC_ARG_ENABLE(sa-launcher,
1644   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.]),
1645 [case "${enableval}" in
1646   yes) sa_launcher=yes ;;
1647   no)  sa_launcher=no ;;
1648   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-sa-launcher option]) ;;
1649 esac],sa_launcher=yes)
1651 if test x"$sa_launcher" = x"yes"; then
1652   AC_DEFINE([CREATE_STANDALONE_GNASH_LAUNCHER], [], [Add support for writing a standalone executable launcher for movies embedded in web pages])
1655 dnl --------------------------------------------------------
1656 dnl Build the cygnal server if specified.
1657 dnl --------------------------------------------------------
1658 AC_ARG_ENABLE(cygnal,
1659   AC_HELP_STRING([--enable-cygnal], [Enable building of the Cygnal server]),
1660 [case "${enableval}" in
1661   yes) cygnal=yes ;;
1662   no)  cygnal=no ;;
1663   *)   AC_MSG_ERROR([bad value ${enableval} for enable-cygnal option]) ;;
1664 esac],cygnal=no)
1665 AM_CONDITIONAL(CYGNAL, test x$cygnal = xyes)
1667 dnl --------------------------------------------------------
1668 dnl Build the cgibins server if specified.
1669 dnl --------------------------------------------------------
1670 AC_ARG_ENABLE(cgibins,
1671   AC_HELP_STRING([--enable-cgibins], [Enable building of the CGIs for Cygnal]),
1672 [case "${enableval}" in
1673   yes) cgibin=yes ;;
1674   no)  cgibin=no ;;
1675   *)   AC_MSG_ERROR([bad value ${enableval} for enable-cgibins option]) ;;
1676 esac],cgibin=yes)
1677 AM_CONDITIONAL(USE_CGI, test x$cgibin = xyes)
1678 if test x"${cgibin}" = x"yes"; then
1679   AC_DEFINE([USE_CGIBIN], [1], [Enable cgi-bin processes for Cygnal])
1682 dnl --------------------------------------------------------
1683 dnl  Double buffer
1684 dnl --------------------------------------------------------
1685 dnl Add an option for double buffering when rendering, currently only used by
1686 dnl the frmaebuffer GUI.
1687 dnl If defined, an internal software-buffer is used for rendering and is then
1688 dnl copied to the video RAM. This avoids flicker and is faster for complex 
1689 dnl graphics, as video RAM access is usually slower. (strongly suggested)
1690 AC_ARG_ENABLE(doublebuf,
1691   AC_HELP_STRING([--disable-doublebuf], [Disble support for double buffering when rendering with AGG]),
1692   [case "${enableval}" in
1693     yes) doublebuf=yes ;;
1694     no)  doublebuf=no ;;
1695     *)   AC_MSG_ERROR([bad value ${enableval} for enable-doublebuf option]) ;;
1696   esac], doublebuf=yes
1698 AM_CONDITIONAL(ENABLE_DBUF, [test x"$doublebuf" = xyes])
1699 if test x$doublebuf = xyes; then
1700     AC_DEFINE(ENABLE_DOUBLE_BUFFERING, [1], [Disable double buffering for AGG])
1703 dnl --------------------------------------------------------
1704 dnl  Offscreen buffer
1705 dnl --------------------------------------------------------
1706 dnl This enables rendering to an offscreen buffer, instead of directly to window
1707 AC_ARG_ENABLE(offscreen,
1708   AC_HELP_STRING([--enable-offscreen], [Enable support for rendering offscreen]),
1709   [case "${enableval}" in
1710     yes) offscreen=yes ;;
1711     no)  offscreen=no ;;
1712     *)   AC_MSG_ERROR([bad value ${enableval} for enable-offscreen option]) ;;
1713   esac], offscreen=no
1717 dnl --------------------------------------------------------
1718 dnl  SSH support selection
1719 dnl --------------------------------------------------------
1720 dnl Enable using libssh with libnet
1721 AC_ARG_ENABLE(ssh,
1722   AC_HELP_STRING([--enable-ssh], [Enable using SSH for network authentication]),
1723 [case "${enableval}" in
1724   yes) build_ssh=yes ;;
1725   no)  build_ssh=no ;;
1726   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-ssh option]) ;;
1727 esac], build_ssh=no)
1729 AM_CONDITIONAL(BUILD_SSH, test x"${build_ssh}" = xyes)
1730 if test x"${build_ssh}" = xyes; then
1731   GNASH_PKG_FIND(ssh, [libssh/libssh.h], [libssh library], ssh_socket_init)
1732 dnl  GNASH_PKG_FIND(poppler, [popt.h], [Poppler library], poppler_init)
1734 if test x"${has_ssh}" = x"yes"; then
1735   AC_DEFINE([USE_SSH], [1], [Use SSH for authentication])
1738 dnl --------------------------------------------------------
1739 dnl  SSL support selection
1740 dnl --------------------------------------------------------
1742 dnl Enable using OpenSSL with libnet.
1743 AC_ARG_ENABLE(ssl,
1744   AC_HELP_STRING([--enable-ssl], [Enable using OpenSSL directly]),
1745 [case "${enableval}" in
1746   yes) build_ssl=yes ;;
1747   no)  build_ssl=no ;;
1748   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-ssl option]) ;;
1749 esac], build_ssl=no)
1751 with_cert=
1752 with_pem=
1753 AM_CONDITIONAL(BUILD_SSL, test x"${build_ssl}" = xyes)
1754 AC_ARG_WITH(cert,
1755   AC_HELP_STRING([--with-cert],
1756   [cert file for SSL]),
1757   with_cert=${withval})
1758 AC_ARG_WITH(pem,
1759   AC_HELP_STRING([--with-pe],
1760   [pem file for SSL]),
1761   with_pem=${withval})
1763 if test x"${build_ssl}" = xyes; then
1764   GNASH_PKG_FIND(ssl, [openssl/ssl.h], [OpenSSL library], SSL_library_init)
1766 if test x"${has_ssl}" = x"yes"; then
1767   AC_DEFINE([USE_SSL], [1], [Use SSL for authentication])
1770 dnl -----------------------------------------------------------
1771 dnl Set the general plugins install policy here
1772 dnl (NOTE: before GNASH_PATH_FIREFOX and GNASH_PATH_KDE*)
1773 dnl -----------------------------------------------------------
1775 AC_ARG_WITH(plugins-install,
1776   AC_HELP_STRING([--with-plugins-install=system|user|prefix], [Policy for plugins install. Default: user.]),
1777         [case "${withval}" in
1778           user) PLUGINS_INSTALL_POLICY=user ;;
1779           system) PLUGINS_INSTALL_POLICY=system ;;
1780           prefix) PLUGINS_INSTALL_POLICY=prefix ;;
1781           *)  AC_MSG_ERROR([bad value ${withval} for --with-plugins-install]) ;;
1782          esac 
1783         ], PLUGINS_INSTALL_POLICY=user) 
1785 dnl -----------------------------------------------------------
1786 dnl   Verify dependencies for requested GUIs are met, and
1787 dnl   disable build of the GUIS for which deps are NOT met
1788 dnl ------------------------------------------------------------
1790 if test x$build_gtk = xyes; then
1791    GNASH_PATH_GTK2
1792    GNASH_PATH_PANGO
1793    GNASH_PKG_FIND(atk, [atk/atk.h], [atk library], atk_focus_tracker_init, [1.0])
1794    if test x"${build_ogl}" = xyes; then
1795       GNASH_PATH_GLEXT
1796    fi
1797    if test x"${build_cairo}" = xyes; then
1798       GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
1799    fi
1802 if test x"${build_qt4}" != xno; then
1803  GNASH_PATH_QT4
1806 if test x"${build_qt4}" = xauto; then
1807   if test x"${has_qt4}" = xyes; then
1808      build_qt4=yes
1809   else
1810      build_qt4=no
1811   fi
1814 if test x"${build_kde3}" != xno -o x"${build_qtopia3}" != xno; then
1815  GNASH_PATH_QT3
1818 if test x"${build_kde3}" != xno; then
1819   GNASH_PATH_KDE3
1823 if test x"${build_kde3}" = xauto; then
1824   if test x"${has_qt3}" = xyes -a x"${has_kde3}" = xyes; then
1825      build_kde3=yes
1826   else
1827      build_kde3=no
1828   fi
1831 dnl Check possibility to build DUMP gui, if requested
1832 if test x"${build_dump}" != xno; then
1833   if test x"${build_agg}" = xyes; then
1834     build_dump=yes
1835   else
1836     if test x"${build_dump}" = xyes; then
1837       dnl SHOULD we just check at the end of file instead ?
1838       AC_MSG_ERROR(dump GUI cannot be built without AGG renderer);
1839     fi
1840     build_dump=no
1841   fi
1844 dnl Check possibility to build FB gui, if requested
1845 dnl FB dependency is a linux system (linux/fb.h)
1846 if test x"${build_fb}" != xno; then
1847   if test x"${linux}" = xyes; then
1848       build_fb=yes
1849   else
1850     if test x"${build_fb}" = xyes; then
1851       dnl SHOULD we just check at the end of file instead ?
1852       AC_MSG_ERROR(fb GUI cannot be built on non-linux platforms);
1853     fi
1854     AC_MSG_NOTICE([fb GUI won't be built (non-linux platform)])
1855     build_fb=no
1856   fi
1859 dnl TODO: add checks for all other GUIs
1861 dnl -------------------------------
1862 dnl Input Device selection
1863 dnl -------------------------------
1865 dnl Multiple input devices are supported. These can all work in
1866 dnl varying combinations, so several may be listed. These are only
1867 dnl required when using the Framebuffer, as without the X11 desktop,
1868 dnl Gnash has to handle all these internally. This can get
1869 dnl messy, as one might want to use a touchscreen with a normal mouse
1870 dnl or keyboard attached. 
1871 dnl By default, don't build any of these, as they are only for the Framebuffer
1872 dnl running without X11.
1873 if test x"${build_fb}" = xyes; then
1874   build_ps2mouse=no
1875   build_ps2keyboard=yes
1876   build_input_events=yes
1877   build_tslib=yes
1878   input_events="Input Devices, Touchscreen via Tslib"
1879 else
1880   build_ps2mouse=no
1881   build_ps2keyboard=no
1882   build_input_events=no
1883   build_tslib=no
1884   input_events=
1886 AC_ARG_ENABLE(input,
1887   AC_HELP_STRING([--enable-input], [Enable support for the specified input devices for the framebuffer GUI (default=ps2mouse|ps2keyboard|events|touchscreen)]),
1888   [if test -n ${enableval}; then
1889     enableval=`echo ${enableval} | tr '\054' ' ' `
1890   fi
1891   while test -n "${enableval}" ; do
1892     val=`echo ${enableval} | cut -d ' ' -f 1`
1893     case "${val}" in
1894       ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
1895         build_ps2mouse=yes
1896         input_events="${input_events}, PS/2 Mouse"
1897         ;;
1898       ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
1899         build_ps2keyboard=yes
1900         input_events="${input_events}, PS/2 Keyboard"
1901         ;;
1902       i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
1903         input_events="${input_events}, Input Event Device"
1904         build_input_events=yes
1905         ;;
1906       t*|T*) dnl use a touchscreen with tslib, which works like a mouse
1907         build_tslib=yes
1908         input_events="${input_events}, Touchscreen"
1909         ;;
1910       *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: ps2mouse|keyboard|events,touchscreen)])
1911          ;;
1912       esac
1913     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1914     if test "x$val" = "x$enableval"; then
1915       break;
1916     fi
1917   done],
1920 if test x"${build_tslib}" = xyes; then
1921   AC_DEFINE(USE_TSLIB, [1], [Use a tslib supported touchscreen])
1922   GNASH_PKG_FIND(ts, [tslib.h], [Touchscreen library], ts_config)
1924 AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} != xno])
1926 if test x"${build_ps2mouse}" = xyes; then
1927   AC_DEFINE(USE_MOUSE_PS2, [1], [Add support for a directly using a PS/2 Mouse])
1929 AM_CONDITIONAL(ENABLE_MOUSE, [test x"${build_ps2mouse}" = xyes])
1931 if test x"${build_ps2keyboard}" = xyes; then
1932   AC_DEFINE(USE_KEYBOARD_PS2, [1], [Add support for directly using a PS/2 Keyboard])
1934 if test x"${build_input_events}" = xyes; then
1935   AC_DEFINE(USE_INPUT_EVENTS, [1], [Add support for a directly using Linux Input Event Devices])
1937 AM_CONDITIONAL(ENABLE_INPUT_EVENTS, [test x"${build_input_events}" = xyes])
1938 dnl this is enabled if we have any input devices at all
1939 AM_CONDITIONAL(ENABLE_INPUT_DEVICES, [test x"${input_events}" != x])
1942 dnl -----------------------------------------------------------
1943 dnl Try to ignore stupid dependencies
1944 dnl -----------------------------------------------------------
1946 AC_MSG_CHECKING(linker --as-needed support)
1947 gcc_cv_ld_as_needed=no
1948 # Check if linker supports --as-needed and --no-as-needed options
1949 if $LD --help 2>/dev/null | grep as-needed > /dev/null; then
1950   gcc_cv_ld_as_needed=yes
1952 if test x"$gcc_cv_ld_as_needed" = xyes; then
1953   LDFLAGS="$LDFLAGS -Wl,--as-needed"
1955 AC_MSG_RESULT($gcc_cv_ld_as_needed)
1957 AC_DEFINE(USE_GIF, [1], [Use the GIF library])
1958 AC_DEFINE(USE_PNG, [1], [Use the PNG library])
1959 AM_CONDITIONAL(USE_GIF, true)
1960 AM_CONDITIONAL(USE_PNG, true)
1962 AC_PATH_TOOL([AUTOTRACE], [autotrace])
1963 AC_HEADER_DIRENT
1965 dnl -----------------------------------------------------------------
1966 dnl PLUGIN RELATED STUFF
1967 dnl -----------------------------------------------------------------
1969 dnl !! This has been moved here to make --enable-npapi work
1970 dnl !! All of plugin-related macro calls could be moved into
1971 dnl !! a specialized macros/plugin.m4
1973 dnl ----------------------------------------------------
1974 dnl Add KPARTS support, if specified or KDE gui is built
1975 dnl ----------------------------------------------------
1977 AC_ARG_ENABLE(kparts3,
1978   AC_HELP_STRING([--disable-kparts3], [Disable support for Konqueror 3.x plugin (default: enabled if kde3 gui is)]),
1979 [case "${enableval}" in
1980   yes) build_kparts3=yes ;;
1981   no)  build_kparts3=no ;;
1982   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-kparts3 option]) ;;
1983 esac],build_kparts3=$build_kde3)
1985 dnl --------------------------------------------------------
1986 dnl Add KPARTS 4.x support, if specified or KDE gui is built
1987 dnl --------------------------------------------------------
1989 AC_ARG_ENABLE(kparts4,
1990   AC_HELP_STRING([--disable-kparts4], [Disable support for Konqueror 4.x plugin (default: enabled if Qt4 gui is)]),
1991 [case "${enableval}" in
1992   yes) build_kparts4=yes ;;
1993   no)  build_kparts4=no ;;
1994   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-kparts4 option]) ;;
1995 esac],build_kparts4=$build_qt4)
1997 if test x"${build_kparts4}" != xno; then
1998   GNASH_PATH_KDE4
2001 dnl -----------------------------------------------------------
2002 dnl Add NPAPI support, if specified or GTK or Qt4 gui is built
2003 dnl -----------------------------------------------------------
2005 AC_ARG_ENABLE(npapi,
2006   AC_HELP_STRING([--disable-npapi], [Disable NPAPI plugin build (default: enabled if gtk or Qt4 gui is)]),
2007   [case "${enableval}" in
2008     yes) npapi=yes ;;
2009     no)  npapi=no ;;
2010     *)   AC_MSG_ERROR([bad value ${enableval} for disable-npapi option]) ;;
2011   esac],
2012   if test x$build_gtk = xyes -o x$build_qt4 = xyes; then
2013     npapi=yes
2014   fi
2017 if test x"$npapi" = x"yes"; then
2018   GNASH_PATH_NPAPI
2021 dnl -----------------------------------------------------------------
2022 dnl Enable us to disable building all browser plugins in one command.
2023 dnl -----------------------------------------------------------------
2025 AC_ARG_ENABLE(plugins,
2026   AC_HELP_STRING([--disable-plugins], [Disable all browser plugins from building (default=no)]),
2027   [case "${enableval}" in
2028     yes) plugins=yes ;;
2029     no)  plugins=no ;;
2030     *)   AC_MSG_ERROR([bad value ${enableval} for disable-plugins option]) ;;
2031   esac],
2032   plugins=yes
2034 if test x$plugins = xno; then
2035   npapi=no
2036   build_kparts3=no
2037   build_kparts4=no
2041 GNASH_PATH_FIREFOX
2043 dnl 
2044 dnl New versions of the NPAPI require const for this prototype, which currently
2045 dnl seems to only be wit Ubuntu Oneiric.
2046 AC_MSG_CHECKING([for const needed for NPP_GetMIMEDescription() prototype])
2047 npapi_flags="`echo "${NPAPI_CFLAGS}" | sed -e 's/-I//' -e 's/-DXP_UNIX//' | tr -d ' '`/npapi.h"
2048 const_test="`grep NPP_GetMIMEDescription ${npapi_flags} | grep -c const`"
2049 if test ${const_test} -eq 1; then
2050   AC_DEFINE(NPAPI_CONST, [1], [Newer versions use const in prototypes])
2051   AC_MSG_RESULT([yes])
2052 else
2053   AC_MSG_RESULT([no])
2056 AC_TRY_COMPILE([#include <linux/input.h>], [
2057   struct input_absinfo abs;
2058   abs.resolution = 0;; ],
2059  AC_DEFINE([ABSINFO_RESOLUTION], [1], [ABS Resolution field])
2062 dnl -----------------------------------------------------------------
2063 dnl END OF PLUGIN RELATED STUFF
2064 dnl -----------------------------------------------------------------
2066 AM_CONDITIONAL(LIRC, [test x$lirc_ext = xyes])
2068 AC_CHECK_HEADERS(getopt.h)
2069 AC_CHECK_HEADERS(libgen.h)
2070 AC_CHECK_HEADERS(pwd.h)
2071 AC_CHECK_HEADERS(sys/utsname.h)
2072 AC_CHECK_HEADERS(signal.h)
2073 AC_CHECK_HEADERS(unistd.h)
2074 AC_CHECK_HEADERS(sys/time.h)
2075 AC_CHECK_LIB(bz2, BZ2_bzopen, [AC_SUBST(BZ2_LIBS, -lbz2)])
2076 AC_CHECK_LIB(c, getpwnam, AC_DEFINE(HAVE_GETPWNAM, 1, [Has getpwnam] ))
2078 dnl X11 is needed for fltk (at least),
2079 dnl and probably for many other guis too ...
2080 dnl if ! test x$build_fb = xyes; then # <--- this is wrong as build_x is non-exclusive
2081 dnl AC_PATH_XTRA
2082 dnl AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation)
2083 dnl AC_CHECK_LIB(gmp, _gmp_get_memory_functions)
2084 GNASH_PATH_X11
2085 AC_CHECK_LIB(Xi, XInput_find_display)
2086 AC_CHECK_LIB(X11, XDisableAccessControl)
2087 dnl fi
2088 AM_CONDITIONAL(HAVE_X11, [test x${has_x11} = xyes])
2089 if test x${build_x11_device} = xyes -a  x${has_x11} = xyes; then
2090   AC_DEFINE(BUILD_X11_DEVICE, [1], [Build the X11 device])
2093 dnl See if ipc_perm structure has the ipc_perm.key field, and if so,
2094 dnl which variant of the name is used.
2095 ipc_key=no
2096 AC_TRY_COMPILE([
2097   #include <sys/ipc.h>
2098   #include <sys/shm.h>], [
2099  struct shmid_ds shmseg;      
2100  key_t x = shmseg.shm_perm.key;],
2101  ipc_key=yes
2102  AC_DEFINE(IPC_PERM_KEY, [key], [Has the key field in ipc_perm])
2105 if test x$ipc_key = xno; then
2106   AC_TRY_COMPILE([
2107     #include <sys/ipc.h>
2108     #include <sys/shm.h>], [
2109     struct shmid_ds shmseg;      
2110     key_t x = shmseg.shm_perm.__key;],
2111     AC_DEFINE(IPC_PERM_KEY, [__key], [Has the key field in ipc_perm])
2112     ipc_key=yes
2113   )
2116 AC_CACHE_CHECK([for finite], ac_cv_finite,
2117  [AC_TRY_COMPILE([
2118    #include <math.h>
2119    #ifdef HAVE_IEEEFP_H
2120    #include <ieeefp.h>
2121    #endif],
2122  [double x; int y; y = finite(x);],
2123  ac_cv_finite=yes,
2124  ac_cv_finite=no
2126 if test x"$ac_cv_finite" = x"yes"; then
2127   AC_SEARCH_LIBS(finite, m,
2128     [AC_DEFINE(HAVE_FINITE, [1], [Has finite])]
2129   )
2132 AC_LANG_PUSH(C++)
2133 AC_CACHE_CHECK([for isfinite], ac_cv_isfinite,
2134  [AC_TRY_COMPILE([#include <cmath>],
2135  [using namespace std; double x; int y; y = isfinite(x);],
2136  ac_cv_isfinite=yes,
2137  ac_cv_isfinite=no
2139 AC_LANG_POP(C++)
2140 if test x"$ac_cv_isfinite" = x"yes"; then
2141   dnl Don't give up if isfinite is not found in -lm
2142   dnl isfinite is defined as a macro in C99.
2143   AC_SEARCH_LIBS(isfinite, m)
2144   AC_DEFINE(HAVE_ISFINITE, [1], [Has isfinite])
2147 AC_LANG_PUSH(C++)
2148 AC_CACHE_CHECK([whether $CXX implements __PRETTY_FUNCTION__], ac_cv_implements___PRETTY_FUNCTION__, [
2149   AC_TRY_LINK([#include <cstdio>
2150 ], 
2151     [ std::printf("%s", __PRETTY_FUNCTION__); ], 
2152     [ ac_cv_implements___PRETTY_FUNCTION__="yes" ],
2153     [ ac_cv_implements___PRETTY_FUNCTION__="no" ]
2154   )
2156 if test "x$ac_cv_implements___PRETTY_FUNCTION__" = "xyes" ; then
2157   AC_DEFINE(HAVE_PRETTY_FUNCTION, [1], [__PRETTY_FUNCTION__ is defined])
2160 AC_CACHE_CHECK([whether $CXX implements __FUNCTION__], ac_cv_implements___FUNCTION__, [
2161   AC_TRY_LINK([#include <cstdio>
2162 ], 
2163     [ std::printf("%s", __FUNCTION__); ], 
2164     [ ac_cv_implements___FUNCTION__="yes" ],
2165     [ ac_cv_implements___FUNCTION__="no" ]
2166   )
2168 if test "x$ac_cv_implements___FUNCTION__" = "xyes" ; then
2169   AC_DEFINE(HAVE_FUNCTION, [1], [__FUNCTION__ is defined])
2172 AC_CACHE_CHECK([whether $CXX implements __func__], ac_cv_implements___func__, [
2173   AC_TRY_LINK([#include <cstdio>
2174 ], 
2175     [ std::printf("%s", __func__); ], 
2176     [ ac_cv_implements___func__="yes" ],
2177     [ ac_cv_implements___func__="no" ]
2178   )
2180 if test "x$ac_cv_implements___func__" = "xyes" ; then
2181   AC_DEFINE(HAVE_func, [1], [__func__ is defined])
2183 AC_LANG_POP(C++)
2184 AC_REPLACE_FUNCS(getopt)
2186 dnl Date portability stuff, used in server/asobj/Date.cpp
2187 AC_CHECK_FUNCS(gettimeofday)
2188 AC_CHECK_FUNCS(ftime)
2189 AC_CHECK_FUNCS(tzset)
2190 AC_CHECK_FUNCS(localtime_r)
2192 AC_CACHE_CHECK([whether struct tm has tm_gmtoff], ac_cv_tm_gmtoff, [
2193         AC_TRY_LINK([
2194 /* ctime(1) says "The glibc version of struct tm has additional fields
2195  * defined  when _BSD_SOURCE was set before including <time.h>"
2196  * In practice, you do not need to define it yourself (tested on glibc-2.2.1 
2197  * and 2.3.6) but if you *do* define it yourself, it makes *all* functions
2198  * favour BSD-like behaviour over of GNU/POSIX, which seems dangerous.
2199  */
2200 // #define _BSD_SOURCE 1
2201 #include <time.h>
2202 ], 
2203                 [ struct tm tm; long l = tm.tm_gmtoff; ], 
2204                 [ ac_cv_tm_gmtoff="yes" ],
2205                 [ ac_cv_tm_gmtoff="no" ]
2206         )
2208 if test "x$ac_cv_tm_gmtoff" = "xyes" ; then
2209         AC_DEFINE(HAVE_TM_GMTOFF, [1], [struct tm has member tm_gmtoff])
2212 AC_CACHE_CHECK([whether timezone is a long], ac_cv_long_timezone, [
2213         AC_TRY_LINK([
2214 /* On Linux/glibc, tzset(3) says "extern long timezone;" (seconds West of GMT)
2215  * but on BSD char *timezone(int,int) is a function returning a string name.
2216  * The BSD function timegm() may be the equivalent, but this should
2217  * not be necessary because on BSD the code should use tm.tm_gmtoff instead
2218  * (use of long timezone is a fallback strategy for when tm_gmtoff exists not).
2219  */
2220 #include <stdio.h>
2221 #include <time.h>
2222 extern long timezone;
2223   ], 
2224     [ printf("%ld", timezone); ], 
2225     [ ac_cv_long_timezone="yes" ],
2226     [ ac_cv_long_timezone="no" ]
2227    )
2229 if test "x$ac_cv_long_timezone" = "xyes" ; then
2230   AC_DEFINE(HAVE_LONG_TIMEZONE, [1], [extern timezone is a long integer, not a function])
2233 AC_CHECK_FUNCS(mkstemps)
2234 AC_CHECK_FUNCS(sysconf)
2235 AC_CHECK_FUNCS(shmget shmat shmdt mmap)
2236 AC_CHECK_FUNCS(scandir)         dnl supported by BSD and Linux, but you never know...
2237 AC_CHECK_LIB(rt, clock_gettime)
2238 AC_CHECK_FUNC(clock_gettime, AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Has clock_gettime()] ))
2239 dnl Look for Win32 networking stuff
2240 AC_CHECK_HEADERS(winsock.h)
2241 AC_CHECK_HEADERS(winsock2.h)
2243 GNASH_PKG_FIND(nspr, [nspr.h], [Netscape Portable Runtime (NSPR)], PR_Init)
2245 AC_PATH_TOOL(WINDRES, [windres])
2246 AC_SUBST(WINDRES)
2248 GNASH_PKG_FIND(z, [zlib.h], [zlib compression library], compress)
2249 GNASH_PKG_FIND(jpeg, [jpeglib.h], [jpeg images], jpeg_mem_init)
2250 GNASH_PKG_FIND(png, [png.h], [png images], png_info_init)
2251 GNASH_PKG_FIND(gif, [gif_lib.h], [gif images], DGifOpen)
2252 if test x"${GIF_LIBS}" = x ; then
2253  GNASH_PKG_FIND(ungif, [gif_lib.h], [gif images], DGifOpen)
2254  GIF_LIBS=${UNGIF_LIBS}
2255  GIF_CFLAGS=${UNGIF_CFLAGS}
2257 if test x"$testsuite" = x"yes"; then
2258   GNASH_PKG_INCLUDES([dejagnu], [dejagnu.h])
2261 GNASH_PKG_FIND(speex, [speex.h], [speex audio codec], speex_decode_int)
2262 AM_CONDITIONAL(HAVE_SPEEX, [ test x$has_speex = xyes ])
2263 if test x$has_speex = xyes ; then
2264   AC_DEFINE([DECODING_SPEEX], [1], [Speex codec available])
2267 GNASH_PKG_FIND(speexdsp, [speex_resampler.h], [speex DSP utilities], speex_resampler_process_int)
2268 if test x$has_speexdsp = xyes ; then
2269   AC_DEFINE([RESAMPLING_SPEEX], [1], [Speex resampler available])
2272 dnl Find freetype and fontconfig
2273 GNASH_PATH_FREETYPE2
2274 GNASH_PKG_FIND(fontconfig, [fontconfig/fontconfig.h], [fontconfig library], FcFontMatch)
2276 if test x$cross_compiling = xno; then
2277   AC_PATH_MING
2280 if test x"$MING_VERSION_CODE" = x; then
2281  MING_VERSION_CODE=00000000
2284 AM_CONDITIONAL(ENABLE_MING,
2285         [ test x"$MAKESWF" != x -a $MING_VERSION_CODE -gt 00040000 ])
2287 AM_CONDITIONAL(MING_VERSION_0_4,
2288         [ test $MING_VERSION_CODE -ge 00040000  ])
2289 AM_CONDITIONAL(MAKESWF_SUPPORTS_PREBUILT_CLIPS,
2290         [ test $MING_VERSION_CODE -ge 00040002  ])
2291 AM_CONDITIONAL(MING_SUPPORTS_INIT_ACTIONS,
2292         [ test $MING_VERSION_CODE -ge 00040004  ])
2293 AM_CONDITIONAL(MING_SUPPORTS_REPLACE_TAG,
2294         [ test $MING_VERSION_CODE -ge 00040005 ])
2295 AM_CONDITIONAL(MING_SUPPORTS_SWFBUTTON_ADD_CHARACTER,
2296         [ test $MING_VERSION_CODE -ge 00040005 ])
2297 AM_CONDITIONAL(MING_SUPPORTS_STREAMING_SOUND,
2298         [ test $MING_VERSION_CODE -ge 00040006 ])
2299 AM_CONDITIONAL(MING_SUPPORTS_SWFBUTTON_SET_DEPTH,
2300         [ test $MING_VERSION_CODE -ge 00040006 ])
2301 AM_CONDITIONAL(MING_VERSION_0_4_3,
2302         [ test $MING_VERSION_CODE -ge 00040300 ])
2303 AM_CONDITIONAL(MING_VERSION_0_4_4,
2304         [ test $MING_VERSION_CODE -ge 00040400 ])
2306 if test x$cross_compiling = xno; then
2307     AC_ARG_WITH([swfdec_testsuite],
2308         AC_HELP_STRING([--with-swfdec-testsuite],
2309             [directory where swfdec testsuite (the 'test' dir) is]),
2310         if test x"${withval}" = xyes; then
2311             dir=`dirname $0`
2312             dir=`cd ${dir} && pwd`
2313             withval="${dir}/testsuite/swfdec/src/test"
2314         fi
2315         SWFDEC_TESTSUITE=${withval}
2316     )
2317     AC_SUBST(SWFDEC_TESTSUITE)
2319 AM_CONDITIONAL(ENABLE_SWFDEC_TESTSUITE, [ test x"$SWFDEC_TESTSUITE" != x ])
2321 if test x$cross_compiling = xno; then
2322   AC_ARG_ENABLE([http_testsuite],
2323       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2324           AC_HELP_STRING([--enable-http-testsuite=<baseurl>],
2325                   [Enable http based testsuite (default url is http://www.gnashdev.org/testcases)]),
2326               [case "${enableval}" in
2327              no) HTTP_TESTSUITE="" ;;
2328             yes) HTTP_TESTSUITE="http://www.gnashdev.org/testcases" ;;
2329               *) HTTP_TESTSUITE="${enableval}";;
2330            esac])
2331   AC_SUBST(HTTP_TESTSUITE)
2333 AM_CONDITIONAL(ENABLE_HTTP_TESTSUITE, [ test x"$HTTP_TESTSUITE" != x ])
2335 if test x$cross_compiling = xno; then
2336   AC_ARG_ENABLE([red5_testing],
2337       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2338           AC_HELP_STRING([--enable-red5-testing=<host>],
2339                   [Enable red5 based testing (default host is www.gnashdev.org)]),
2340               [case "${enableval}" in
2341              no) RED5_HOST="" ;;
2342             yes) RED5_HOST="www.gnashdev.org" ;;
2343               *) RED5_HOST="${enableval}";;
2344            esac])
2345   AC_SUBST(RED5_HOST)
2347 AM_CONDITIONAL(ENABLE_RED5_TESTING, [ test x"$RED5_HOST" != x ])
2349 if test x$cross_compiling = xno; then
2350   AC_ARG_ENABLE([rtmpy_testing],
2351       dnl # TODO: find out how to add [quotes] around '=<baseurl>'
2352           AC_HELP_STRING([--enable-rtmpy-testing=<host>],
2353                   [Enable rtmpy based testing (default host is www.gnashdev.org)]),
2354               [case "${enableval}" in
2355              no) RTMPY_HOST="" ;;
2356             yes) RTMPY_HOST="www.gnashdev.org" ;;
2357               *) RTMPY_HOST="${enableval}";;
2358            esac])
2359   AC_SUBST(RTMPY_HOST)
2361 AM_CONDITIONAL(ENABLE_RTMPY_TESTING, [ test x"$RTMPY_HOST" != x ])
2363 dnl The name might differ between systems.
2364 if test x"$testsuite" = x"yes"; then
2365 AC_PATH_PROGS(NETCAT, [nc netcat])
2366 AC_PATH_PROG(WGET, wget)
2368 AM_CONDITIONAL(HAS_NETCAT, [ test x"$NETCAT" != x ])
2369 AM_CONDITIONAL(HAS_WGET, [ test x"$WGET" != x ])
2372 dnl See if we can use the swfmill, mtasc, swfc and haxe based testsuites 
2374 if test x"$testsuite" = x"yes" -a x$cross_compiling = xno; then
2375   AC_PATH_PROG(AS3COMPILE, as3compile)
2376   AC_PATH_PROG(SWFC, swfc)
2377   AC_PATH_SWFMILL
2378   AC_PATH_MTASC
2379   AC_PATH_HAXE
2382 AM_CONDITIONAL(ENABLE_SWFMILL, [ test x"$SWFMILL" != x ])
2383 AM_CONDITIONAL(SWFMILL_AS3_SUPPORT,
2384         [ test x"$SWFMILL" != x && test $SWFMILL_VERSION -ge 00021206 ])
2386 dnl SWFMILL versions older than 0.3 didn't get function2 flags order correctly
2387 AM_CONDITIONAL(SWFMILL_FUNCTION2_FLAGS_ORDER_CORRECT,
2388         [ test x"$SWFMILL" != x && test $SWFMILL_VERSION -ge 00021206 ])
2390 AM_CONDITIONAL(ENABLE_AS3COMPILE, [ test x"$AS3COMPILE" != x ])
2391 AM_CONDITIONAL(ENABLE_MTASC, [ test x"$MTASC" != x ])
2392 AM_CONDITIONAL(ENABLE_HAXE, [ test x"$HAXE" != x ])
2393 AM_CONDITIONAL(ENABLE_SWFC, [ test x"$SWFC" != x ])
2394 AM_CONDITIONAL(ENABLE_HAXE, [ test x"$HAXE" != x ])
2396 AC_PATH_PROG(DOXYGEN, doxygen)
2397 AM_CONDITIONAL(ENABLE_DOXYGEN, [ test x"$DOXYGEN" != x ])
2399 AM_CONDITIONAL(HAVE_KDE3,    [test x$has_kde3 = xyes])
2400 AM_CONDITIONAL(HAVE_KDE4,    [test x$has_kde4 = xyes])
2401 AM_CONDITIONAL(HAVE_QT3,     [test x$has_qt3 = xyes])
2402 AM_CONDITIONAL(HAVE_QT4,     [test x$has_qt4 = xyes])
2404 AM_CONDITIONAL([QT_X11],     [test "$platform" = "X11"])
2405 AM_CONDITIONAL([QTOPIA],     [test "$platform" = "Qtopia"])
2406 AM_CONDITIONAL([QT_OSX],     [test "$platform" = "OSX"])
2407 AM_CONDITIONAL([QT_OS9],     [test "$platform" = "OS9"])
2408 AM_CONDITIONAL([QT_WIN32],   [test "$platform" = "Win32"])
2410 dnl Need GLIB for both GTK and GST
2411 if test x"${build_gtk}" = xyes -o x"${build_media_gst}" = xyes; then
2412   GNASH_PATH_GLIB
2415 AM_CONDITIONAL(HAVE_GLIB, [ test x"${has_glib}" = xyes ])
2417 if test x$npapi = xyes; then
2418   if ! test x$build_gtk = xyes -o x$build_qt4 = xyes; then
2419     AC_MSG_WARN(["Enabled NPAPI plugin, but it's not supported by the selected GUI"])
2420   fi
2423 if test x$windows = xyes -a x$npapi = xyes; then
2424   if test "x$NSPR_CFLAGS" = x -a "x$NSPR_LIBS" = x; then
2425     AC_MSG_ERROR(["On Win32, NPAPI plugin requires NSPR."])
2426   fi
2427   if test "x$WINDRES" = x; then
2428     AC_MSG_ERROR(["On Win32, NPAPI plugin requires windres."])
2429   fi
2432 dnl Need GLIB for NPAPI plugin
2433 if test x$npapi = xyes; then
2434   GNASH_PATH_GLIB
2437 dnl if kde isn't installed, even if it's specified, don't try to build
2438 dnl the KPARTS plugin, which is KDE based.
2439 if test x$has_kde3 = xno -a x$build_kparts3 = xyes; then
2440   build_kparts3=no
2441   AC_MSG_WARN(["Disabling KPARTS 3.x plugin, no KDE development found"])
2444 if test x$build_kde3 = xno -a x$build_kparts3 = xyes; then
2445   AC_MSG_WARN(["Enabled KPARTS 3.x plugin, but you aren't building a KDE based GUI!"])
2447 if test x$has_kde4 = xno -a x$build_kparts4 = xyes; then
2448   build_kparts4=no
2449   AC_MSG_WARN(["Disabling KPARTS 4.x plugin, no KDE 4.x development found"])
2452 if test x$build_qt4 = xno -a x$kparts4 = xyes; then
2453   AC_MSG_WARN(["Enabled KPARTS 4.x plugin, but you aren't building a KDE 4.x based GUI!"])
2456 AM_CONDITIONAL(BUILD_QTOPIA3_GUI,  [ test x$build_qtopia3 = xyes ])
2457 AM_CONDITIONAL(BUILD_QTOPIA4_GUI,  [ test x$build_qtopia4 = xyes ])
2459 AM_CONDITIONAL(BUILD_KDE3_GUI,     [ test x$build_kde3 = xyes ])
2460 AM_CONDITIONAL(BUILD_QT4_GUI,     [ test x$build_qt4 = xyes ])
2462 AM_CONDITIONAL(BUILD_GTK_GUI,      [ test x$build_gtk = xyes ])
2463 AM_CONDITIONAL(BUILD_FLTK_GUI,     [ test x$build_fltk = xyes ])
2464 AM_CONDITIONAL(BUILD_SDL_GUI,      [ test x$build_sdl = xyes ])
2465 AM_CONDITIONAL(BUILD_FB_GUI,       [ test x$build_fb = xyes ])
2466 AM_CONDITIONAL(BUILD_AQUA_GUI,     [ test x$build_aqua = xyes ])
2467 AM_CONDITIONAL(BUILD_DUMP_GUI,     [ test x$build_dump = xyes ])
2468 AM_CONDITIONAL(BUILD_AMIGAOS4_GUI, [ test x$build_aos4 = xyes ])
2469 AM_CONDITIONAL(BUILD_HAIKU_GUI,    [ test x$build_haiku = xyes ])
2471 # plugin building flags
2472 AM_CONDITIONAL(NPAPI,   [test x"${npapi}" = xyes])
2473 AM_CONDITIONAL(KPARTS3, [test x"${build_kparts3}" = xyes])
2474 AM_CONDITIONAL(KPARTS4, [test x"${build_kparts4}" = xyes])
2476 if test x"${build_gles1}"; then
2477   GNASH_PATH_GLES
2480 dnl only Linux supports /dev/fb0
2481 if test x"${build_rawfb_device}" = xyes -a x"${linux}" = xyes; then
2482    AC_DEFINE([BUILD_RAWFB_DEVICE], [1], [Use raw Framebuffer device support])
2485 if test x"${build_directfb_device}" = xyes; then
2486    GNASH_PKG_FIND(directfb, [directfb.h], [DirectFB render library], DirectFBCreate)
2487    AC_DEFINE([BUILD_DIRECTFB_DEVICE], [1], [Use DirectFB device support])
2490 AM_CONDITIONAL(BUILD_VAAPI_DEVICE, [test x"${use_libva}" = xyes])
2491 AM_CONDITIONAL(BUILD_EGL_DEVICE, [test x"${build_egl_device}" = xyes])
2492 AM_CONDITIONAL(BUILD_DIRECTFB_DEVICE, [ test x${build_directfb_device} = xyes])
2493 AM_CONDITIONAL(BUILD_RAWFB_DEVICE, [ test x${build_rawfb_device} = xyes])
2494 AM_CONDITIONAL(BUILD_X11_DEVICE, [test x${build_x11_device} = xyes])
2496 if test x"${build_gtk}" = xyes; then
2497   AC_ARG_ENABLE(ghelp,
2498     AC_HELP_STRING([--enable-ghelp], [Enable support for the GNOME help system]),
2499     [case "${enableval}" in
2500       yes) ghelp=yes ;;
2501       no)  ghelp=no ;;
2502       *)   AC_MSG_ERROR([bad value ${enableval} for enable-ghelp option]) ;;
2503     esac], ghelp=no
2504   )
2506   if test x"${ghelp}" = x"yes" ; then
2507     AC_PATH_PROG(SCROLLKEEPER, scrollkeeper-config, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2508     AC_PATH_PROG(SCROLLUPDATE, scrollkeeper-update, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2509     AC_PATH_PROG(SCROLLINSTALL, scrollkeeper-preinstall, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2511     if test x"$SCROLLKEEPER" = x -o x"$SCROLLUPDATE" = x -o x"$SCROLLINSTALL" = x ; then
2512       ghelp=no
2513       AC_MSG_WARN([You need to install scrollkeeper for gnome help])
2514     fi
2515   fi
2517 AM_CONDITIONAL(GHELP, [test x${ghelp} = xyes])
2519 if test x${build_fltk} = xyes; then
2520   GNASH_PKG_FIND(Xft, [Xft.h], [xft library], XftGlyphRender)
2523 dnl Some systems have a pervered set of dependencies.
2524 dnl Fedora Core 6 appears to have a dependency on expat for fontconfig.
2525 dnl We only need the library, but this is the easy wind to find it.
2526 GNASH_PKG_FIND(expat, [expat.h], [Expat library], XML_ErrorString)
2528 dnl these conditionals were moved out of kde.m4
2529 AM_CONDITIONAL(HAS_KDE3, [test x$has_kde3 = xyes])
2530 # used to disable x11-specific stuff on special platforms
2531 AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
2532 AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
2533 AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
2535 AM_CONDITIONAL(HAVE_GLEXT, [test x$glext = xyes])
2537 dnl We don't have GTKGLExt, so default to SDL, and don't build the Firefox plugin
2538 if test x$glext = xno -a x$build_ogl = xyes; then
2539   if test x$gtk2 = xyes -a x$build_gtk = xyes; then
2540     AC_ERROR([You have GTK installed, but not GtkGLExt. You need GtkGLExt to use the OpenGL renderer. Attempting to build SDL version])
2541   fi
2542   gui=sdl
2543   npapi=no
2544   AC_MSG_WARN([GTK2 specified for the GUI, but GtkGlExt is not present. Trying SDL instead.])
2547 missing_codecs=""
2548 if test x"$build_media_gst" = "xyes"; then
2549   AC_PATH_PROG(GST_INSPECT, gst-inspect, ,[${pathlist}])
2550   if test "x$GST_INSPECT" != "x" -a x"${darwin}" = xno ; then
2551     AC_PATH_PROG(GST_INSPECT, gst-inspect-0.10, ,[${pathlist}])
2552   fi
2553   if test "x$GST_INSPECT" != "x" -a x"${darwin}" = xno ; then
2554     dnl FIXME: there may be multiple acceptable plugins that are acceptable for
2555     dnl our use. For example, mad or FFmpeg will play mp3.
2556     codecs="ffdec_flv ffdec_flashsv ffdec_vp6f ffdec_flashsv mad vorbisdec ffdec_vp6"
2557     for i in $codecs; do
2558        hits="`$GST_INSPECT $i | grep -c 'Long name'`"
2559        if test $hits -eq 0; then
2560          missing_codecs="$missing_codecs $i"
2561          AC_MSG_WARN([Missing codec: $i])
2562        fi
2563     done
2564   fi
2565   GNASH_PKG_FIND(gstreamer_plugins_base, [gst/interfaces/probeprobe.h], [gstreamer interfaces library], gst_property_probe_probe_and_get_values_name, [0.10])
2566   GNASH_PKG_FIND(gstreamer_app, [gst/app/gstappsink.h], [gstreamer app library], call_gmon_start, [0.10])
2567   GNASH_PKG_FIND(gstreamer, [gst/gst.h], [gstreamer library], gst_init, [0.10])
2568   dnl if cross compiling, we're usually not going to be able to pop up
2569   dnl the codec installer to download the package to install, so disable
2570   dnl it if cross compiling with gstreamer support.
2571   if test x$cross_compiling = xno; then
2572     GNASH_PKG_FIND(gstreamer_pbutils, [gst/pbutils/install-plugins.h], [gstreamer PB Utils library], gst_install_plugins_supported, [0.10])
2573   fi
2574   dnl when cross compiling Gstreamer, not all supplied SDKs include all the
2575   dnl development libraries since most devices don't need to support plugin
2576   dnl development, only the runtime. In these caes we often have the header
2577   dnl files but not the libraries.
2578   if test x"${has_gstreamer_plugins_base}" = xyes; then
2579     GSTREAMER_LIBS="-lgstinterfaces-0.10 $GSTREAMER_LIBS"
2580     AC_DEFINE(HAS_GSTREAMER_PLUGINS_BASE, [1], [Has the Gstreamer Plugin Dev package installed])
2581   fi
2584 AM_CONDITIONAL(HAVE_CAIRO, [true])
2585 AM_CONDITIONAL(HAVE_OPENGL, [true])
2587 AM_CONDITIONAL(USE_SOUND_SDL, test x$build_sound_sdl = xyes)
2588 AM_CONDITIONAL(USE_SOUND_AHI, test x$build_sound_ahi = xyes)
2589 AM_CONDITIONAL(USE_SOUND_MKIT, test x$build_sound_mkit = xyes)
2590 AM_CONDITIONAL(USE_FFMPEG_ENGINE, test x"${build_media_ffmpeg}" = x"yes")
2591 AM_CONDITIONAL(USE_GST_ENGINE, test x"${build_media_gst}" = x"yes")
2592 AM_CONDITIONAL(HAVE_OPENGL, test x"${OPENGL_LIBS}" != x)
2593 dnl for now the Haiku media handler is experimental
2594 AM_CONDITIONAL(USE_HAIKU_ENGINE, test x"$build_media_haiku" = xyes)
2596 if test x"${build_media_ffmpeg}" = x"yes"; then
2597   AC_DEFINE([ENABLE_FFMPEG_MEDIA],  [1], [Use FFmpeg for media decoding])
2600 if test x"${build_media_gst}" = x"yes"; then
2601   AC_DEFINE([ENABLE_GST_MEDIA],  [1], [Use gstreamer for media decoding])
2604 if test x"${build_media_haiku}" = x"yes"; then
2605   AC_DEFINE([ENABLE_HAIKU_MEDIA],  [1], [Use haiku for media decoding])
2608 if test x$build_sound_mkit = xyes; then
2609   if test x"${haiku}" != xyes; then
2610     AC_MSG_ERROR([Media Kit sound handling is supported only under Haiku]);
2611   else
2612     AC_DEFINE([SOUND_MKIT],  [1], [Use Haiku Media Kit for sound handling])
2613   fi
2616 if test x"${build_sound_sdl}" = xyes; then
2617   AC_DEFINE([SOUND_SDL],  [1], [Use SDL for sound handling])
2620 if test x"${build_sound_ahi}" = xyes; then
2621   if test x"$amigaos4" != xyes; then
2622     AC_MSG_ERROR([AHI sound handling is supported only under AmigaOS]);
2623   else
2624     AC_DEFINE([SOUND_AHI],  [1], [Use AmigaOS AHI for sound handling])
2625   fi
2628 if test x$build_fltk = xyes; then
2629   GNASH_PKG_FIND(fltk2, [fltk/FL_API.h], [Fast Light Toolkit], fl_window_flush)
2630   if test x"${has_fltk2}" = xyes; then
2631     AC_CHECK_LIB(Xi, XInput_find_display,
2632       [AC_SUBST(FLTK2_LIBS, "$FLTK2_LIBS -lXi")])
2633   fi
2636 AM_CONDITIONAL(HAVE_FLTK2, [ test x$has_fltk2 = xyes ])
2637 AM_CONDITIONAL(HAS_XFT, [ test x$has_xft = xyes ])
2639 GNASH_DOCBOOK
2640 AM_CONDITIONAL(ENABLE_INFO, test x${INSTALL_INFO} != x)
2641 AM_CONDITIONAL(DOCBOOK, test x$docbook = xyes)
2642 AM_CONDITIONAL(ENABLE_TEXI, [ test x"$DB2X_TEXI" != x -o x"$DB2X_TEXIXML" != x ])
2643 AM_CONDITIONAL(ENABLE_PDF, [ test x"$DB2X_PDF" ])
2644 AM_CONDITIONAL(ENABLE_HTML, [ test x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
2645 AM_CONDITIONAL(ENABLE_FOP, [ test x"$FOP" != x -a x"$docbook_styles" != x ])
2646 AM_CONDITIONAL(ENABLE_XMLTEX, [ test x"$PDFXMLTEX" != x -a x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
2647 AM_CONDITIONAL(ENABLE_MAN, [ test x"$DB2X_MAN" != x -o x"$DB2X_MANXML" != x ])
2648 AM_CONDITIONAL(HAVE_AGG, [test x"${AGG_LIBS}" != x])
2650 GNASH_PATH_CURL
2652 dnl Define winsock if we're on windows. We could do something complicated,
2653 dnl but since AC_EXEEXT does it for us, we'll do this the easy way.
2654 if test x"$EXEEXT" = "exe"; then
2655   AC_DEFINE(HAVE_WINSOCK,1,[This is defined is we are on Win32])
2658 dnl ****************************************
2659 dnl *** Check for ELF visibility support ***
2660 dnl ****************************************
2662 AC_ARG_ENABLE([visibility],
2663   AC_HELP_STRING([--enable-visibility], [Use ELF visibility attributes]), [], [enable_visibility=no])
2665 if test x"$enable_visibility" != x"no"; then
2666   dnl Check whether the compiler supports the visibility attribute
2667   save_CFLAGS="$CFLAGS"
2668   CFLAGS="$CFLAGS -Wall -Werror"
2669   AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute])
2670   AC_COMPILE_IFELSE([AC_LANG_SOURCE(
2671     [
2672       void __attribute__ ((visibility("default"))) test_default (void) {}
2673       void __attribute__ ((visibility("hidden"))) test_hidden (void) {}
2674       int main (int argc, char **argv) { test_default (); test_hidden (); return 0; }
2675     ])],
2676     [
2677       AC_DEFINE([HAVE_GNUC_VISIBILITY], [1], [Define this for GCC-visibility.])
2678       AC_MSG_RESULT([yes])
2679     ],
2680     [
2681       AC_MSG_RESULT([no])
2682     ]
2683   )
2684   CFLAGS="$save_CFLAGS"
2687 AC_ARG_ENABLE([pch],
2688   AC_HELP_STRING([--enable-pch], [Enable precompiled header support]), [], [enable_pch=no])
2690 AM_CONDITIONAL([ENABLE_PCH], [test x"$enable_pch" != x"no"])
2692 PCH_FLAGS="-include all-includes.h -Winvalid-pch"
2693 AC_SUBST(PCH_FLAGS)
2695 GNASH_PATH_PTHREADS
2697 GNASH_PATH_BOOST
2699 AC_ARG_ENABLE([strict],
2700   AC_HELP_STRING([--enable-strict],[Accept only standards compliant code (GCC only)]),
2701   [case "${enableval}" in
2702     yes) strict=yes ;;
2703     no) strict=no ;;
2704     *) AC_MSG_ERROR([bad value ${enableval} for --enable-strict option]) ;;
2705   esac],
2706   [strict=no]
2709 if test x"$strict" = x"yes" -a x$build_agg = xyes; then
2710    AC_MSG_ERROR([agg renderer will fail with --enable-strict.]);        
2713 # We want warnings, lots of warnings  :-)
2714 # It should be possible to build with -ansi, not with
2715 # -pedantic because of agg.
2717 # -ansi was actually dropped because it hides 'fileno', which
2718 # is used in a few places
2720 if test x"$GCC" = x"yes"; then
2721   CXXFLAGS="$CXXFLAGS \
2722     $CROSS_CXXFLAGS \
2723     -W \
2724     -Wall \
2725     -Wcast-align \
2726     -Wcast-qual \
2727     -Wpointer-arith \
2728     -Wreturn-type \
2729     -Wnon-virtual-dtor \
2730     -Wunused \
2731     "
2732   CFLAGS="$CFLAGS \
2733     $CROSS_CXXFLAGS \
2734     -W \
2735     -Wall \
2736     -Wcast-align \
2737     -Wcast-qual \
2738     -Wpointer-arith \
2739     -Wreturn-type \
2740     -Wmissing-declarations \
2741     -Wmissing-prototypes \
2742     -Wstrict-prototypes \
2743     "
2744   if test x"$strict" = x"yes"; then
2745     CXXFLAGS="$CXXFLAGS \
2746       -Wextra \   
2747       -pedantic \
2748       -Wno-long-long \
2749       "
2751     CFLAGS="$CFLAGS \
2752       -pedantic \
2753       -Wno-long-long \
2754       -ansi \
2755       "
2756   fi
2759 AC_ARG_ENABLE([cassert],
2760   AC_HELP_STRING([--disable-cassert],[Disable assertion checking]),
2761   [case "${enableval}" in
2762     yes) cassert=yes ;;
2763     no) cassert=no ;;
2764     *) AC_MSG_ERROR([bad value ${enableval} for --enable-cassert option]) ;;
2765   esac],
2766   [cassert=yes]
2769 if test x"$cassert" = x"no"; then
2770     CXXFLAGS="$CXXFLAGS \
2771       -DNDEBUG \
2772       "
2773     CFLAGS="$CFLAGS \
2774       -DNDEBUG \
2775       "
2778 dnl /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
2779 AC_DEFUN([CHECK_VISIBILITY_GCC_BUG],
2780   [
2781     AC_CACHE_CHECK([if -fvisibility-inlines-hidden is broken], ac_cv_gcc_visibility_bug, [
2782         AC_LANG_PUSH(C++)
2783         save_CXXFLAGS=$CXXFLAGS
2784         save_LDFLAGS=$LDFLAGS
2785         CXXFLAGS="-fPIC -fvisibility-inlines-hidden -O0"
2786         LDFLAGS="$LDFLAGS -shared -fPIC"
2788         AC_TRY_LINK(
2789         [          
2790           template<typename CharT>
2791           struct VisTest
2792           {
2793             inline VisTest ();
2794           };
2795           template<typename CharT>
2796           inline VisTest<CharT>::VisTest()
2797         {}
2798         extern template class VisTest<char>;  // It works if we drop that line
2799         int some_function( int do_something ) __attribute__((visibility("default")));
2800         int some_function( int )
2801           {
2802             VisTest<char> a;
2803             return 0;
2804           }
2805         ], [],
2806         ac_cv_gcc_visibility_bug=no, ac_cv_gcc_visibility_bug=yes)
2808         CXXFLAGS=$save_CXXFLAGS
2809         LDFLAGS=$save_LDFLAGS
2810         AC_LANG_POP(C++)
2811       ]
2812     )
2813     if test x$ac_cv_gcc_visibility_bug = xno; then
2814       CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
2815     fi
2816   ]
2819 CHECK_VISIBILITY_GCC_BUG
2821 if test x$ac_cv_gcc_visibility_bug = xno; then
2822   AC_LANG_PUSH(C++)
2823   AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
2824   save_CXXFLAGS=$CXXFLAGS
2825   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
2826   AC_LINK_IFELSE([AC_LANG_PROGRAM()], 
2827                  [ac_cv_gcc_visibility=yes;
2828                   AC_MSG_RESULT([yes])],
2829                  [ac_cv_gcc_visibility=no;
2830                   AC_MSG_RESULT([no])]);
2831   CXXFLAGS="$save_CXXFLAGS"
2832   AC_LANG_POP(C++)
2836 AM_CONDITIONAL(VISIBILITY_WORKS, test x"$ac_cv_gcc_visibility" = xyes)
2838 if test x"$ac_cv_gcc_visibility" = xyes -a x"$enable_visibility" != xno; then
2839   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
2842 dnl Define convenience constants so Gnash can print out the
2843 dnl default configuration of the build.
2844 RENDERER_CONFIG="${renderer_list}"
2845 RENDERER_LIBS=
2846 for rend in `echo "${add_renderer}" | tr ',' ' '`; do
2847         RENDERER_LIBS="${RENDERER_LIBS} \$(top_builddir)/librender/libgnash${rend}.la"
2848 done
2849 AC_SUBST(RENDERER_LIBS)
2850 AC_SUBST(RENDERER_CONFIG)
2852 HWACCEL_CONFIG="${device_list}"
2853 AC_SUBST(HWACCEL_CONFIG)
2855 dnl check for missing libraries and disable them.
2856 if test x"$BOOST_LIBS" != x; then
2857   if test x"${cygnal_missing_libs}" != x; then
2858     for i in ${cygnal_missing_libs}; do
2859       if test $i = serialization; then
2860         AC_DEFINE([BOOST_MULTI_INDEX_DISABLE_SERIALIZATION], ["1"], [if the library is missing, don't use it.])
2861       fi
2862     done
2863   fi
2866 dnl ========= Check for GConf
2868 AC_MSG_CHECKING([whether GConf support is requested])
2869 AC_ARG_WITH([gconf],
2870   [AS_HELP_STRING([--without-gconf],
2871           [Disable the use of gconf])],
2872   [],
2873   [case "${host}" in
2874     *-cygwin* | *-mingw* | *-pw32*) with_gconf=no ;;
2875     *) with_gconf=yes ;;
2876    esac])
2877 AC_MSG_RESULT([$with_gconf])
2879 AM_CONDITIONAL([WITH_GCONF],[test "$with_gconf" = "yes"])
2881 if test "$with_gconf" = "yes"; then
2882    PKG_CHECK_MODULES([GCONF],[gconf-2.0])
2883    AC_DEFINE([WITH_GCONF],[1],[Define if GConf support is enabled])
2885    AM_GCONF_SOURCE_2
2887    AC_PATH_PROG([GCONFTOOL], [gconftool-2], [false])
2888    if test "$GCONFTOOL" = "false"; then
2889       AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
2890    fi
2891 else
2892    AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL],false)
2896 CYGNAL_PATHS
2898 SUPPORTED_GUIS=
2899 if test x$build_qtopia3 = xyes; then
2900   SUPPORTED_GUIS="${SUPPORTED_GUIS},qtopia3"
2902 if test x$build_qtopia4 = xyes; then
2903   SUPPORTED_GUIS="${SUPPORTED_GUIS},qtopia4"
2905 if test x$build_fb = xyes; then
2906   SUPPORTED_GUIS="${SUPPORTED_GUIS},fb"
2908 if test x$build_fltk = xyes; then
2909   SUPPORTED_GUIS="${SUPPORTED_GUIS},fltk"
2911 if test x$build_kde3 = xyes; then
2912   SUPPORTED_GUIS="${SUPPORTED_GUIS},kde3"
2914 if test x$build_qt4 = xyes; then
2915   SUPPORTED_GUIS="${SUPPORTED_GUIS},qt4"
2917 if test x$build_gtk = xyes; then
2918   SUPPORTED_GUIS="${SUPPORTED_GUIS},gtk"
2920 if test x$build_sdl = xyes; then
2921   SUPPORTED_GUIS="${SUPPORTED_GUIS},sdl"
2923 if test x$build_aqua = xyes; then
2924   SUPPORTED_GUIS="${SUPPORTED_GUIS},aqua"
2926 if test x$build_dump = xyes; then
2927   SUPPORTED_GUIS="${SUPPORTED_GUIS},dump"
2929 if test x$build_aos4 = xyes; then
2930   SUPPORTED_GUIS="${SUPPORTED_GUIS},aos4"
2932 if test x$build_haiku = xyes; then
2933   SUPPORTED_GUIS="${SUPPORTED_GUIS},haiku"
2935 SUPPORTED_GUIS="`echo ${SUPPORTED_GUIS} | sed 's/,//'`" # Strip leading comma
2936 AC_SUBST(SUPPORTED_GUIS)
2938 AC_CONFIG_LINKS(cygnal/testsuite/cygnal.all/cygnalrc:cygnal/testsuite/cygnal.all/cygnalrc.in)
2939 AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc:testsuite/libbase.all/gnashrc.in)
2940 AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc-local:testsuite/libbase.all/gnashrc-local.in)
2942 AC_CONFIG_FILES(
2943 gnash.pc:gnash.pc.in
2944 desktop/gnash-gtk-launcher:desktop/gnash-gtk-launcher.in
2945 desktop/gnash-qt-launcher:desktop/gnash-qt-launcher.in
2948 AC_OUTPUT(Makefile
2949 desktop/Makefile
2950 po/Makefile
2951 libmedia/Makefile
2952 libsound/Makefile
2953 libbase/Makefile
2954 libcore/Makefile
2955 libcore/vm/Makefile
2956 libcore/parser/Makefile
2957 librender/Makefile
2958 utilities/Makefile
2959 doc/Makefile
2960 doc/C/Makefile
2961 doc/Doxyfile
2962 testsuite/Makefile
2963 testsuite/media/Makefile
2964 testsuite/libbase.all/Makefile
2965 testsuite/as3compile.all/Makefile
2966 testsuite/actionscript.all/Makefile
2967 testsuite/samples/Makefile
2968 testsuite/swfdec/Makefile
2969 testsuite/misc-ming.all/Makefile
2970 testsuite/misc-ming.all/action_order/Makefile
2971 testsuite/misc-ming.all/sound/Makefile
2972 testsuite/misc-ming.all/displaylist_depths/Makefile
2973 testsuite/misc-ming.all/init_action/Makefile
2974 testsuite/misc-ming.all/loop/Makefile
2975 testsuite/misc-ming.all/loading/Makefile
2976 testsuite/misc-ming.all/register_class/Makefile
2977 testsuite/misc-mtasc.all/Makefile
2978 testsuite/misc-haxe.all/Makefile
2979 testsuite/misc-haxe.all/classes.all/Makefile
2980 testsuite/misc-swfmill.all/Makefile
2981 testsuite/misc-swfmill.all/trace-as2/Makefile
2982 testsuite/misc-swfmill.all/trace-as3/Makefile
2983 testsuite/misc-swfc.all/Makefile
2984 testsuite/network.all/Makefile
2985 testsuite/movies.all/Makefile
2986 testsuite/libcore.all/Makefile
2987 testsuite/libmedia.all/Makefile
2988 gui/Makefile
2989 gui/Info.plist
2990 gui/pythonmod/Makefile
2991 extensions/Makefile
2992 extensions/dejagnu/Makefile
2993 extensions/mysql/Makefile
2994 extensions/fileio/Makefile
2995 extensions/gtk2/Makefile
2996 extensions/lirc/Makefile
2997 extensions/dbus/Makefile
2998 plugin/Makefile
2999 plugin/npapi/Makefile
3000 plugin/klash/Makefile
3001 plugin/klash4/Makefile
3002 plugin/win32/Makefile
3003 plugin/aos4/Makefile
3004 libdevice/Makefile
3005 cygnal/Makefile
3006 cygnal/libnet/Makefile
3007 cygnal/libamf/Makefile
3008 cygnal/cgi-bin/Makefile
3009 cygnal/cgi-bin/echo/Makefile
3010 cygnal/cgi-bin/oflaDemo/Makefile
3011 cygnal/cgi-bin/fitcDemo/Makefile
3012 cygnal/testsuite/Makefile
3013 cygnal/testsuite/libamf.all/Makefile
3014 cygnal/testsuite/libnet.all/Makefile
3015 cygnal/testsuite/cygnal.all/Makefile
3019 ########################## Final report begins... ############################
3022 dnl Create temporary directory in a secure way
3023 tmp=`mktemp -d ${TMPDIR=/tmp}/gnash-configure-XXXXXX`
3024 if test \! -n "$tmp" || test \! -d "$tmp"; then
3025   tmp=`(umask 077 && mkdir -d ${TMPDIR=/tmp}/gnash-configure-${RANDOM}-$$) 2>/dev/null`
3027 cerr="${tmp}/errors"
3028 cwarn="${tmp}/warnings"
3029 crec="${tmp}/recommended"
3030 deb_err="${tmp}/deb_err"
3031 deb_war="${tmp}/deb_war"
3032 deb_rec="${tmp}/deb_rec"
3033 rpm_err="${tmp}/rpm_err"
3034 rpm_war="${tmp}/rpm_war"
3035 rpm_rec="${tmp}/rpm_rec"
3036 yast_err="${tmp}/yast_err"
3037 yast_war="${tmp}/yast_war"
3038 yast_rec="${tmp}/yast_rec"
3039 echo ""
3041 #trap 'rm cerr' 0 # trap isn't a good idea, might override other traps
3042 exec 3> $cerr 
3043 exec 4> $cwarn
3044 exec 5> $crec
3046 for F in "$deb_err" "$deb_war" "$deb_rec" "$rpm_err" "$rpm_war" "$rpm_rec" "$yast_err" "$yast_war" "$yast_rec"; do
3047   touch "$F";
3048 done
3050 pkg_out_fd=
3051 deb_dest=
3052 rpm_dest=
3053 yast_dest=
3055 dnl These macros should be portable as I checked most things used are in
3056 dnl POSIX-2008, GNU CoreUtils, and shipped in MinGW. Old unices? No clue.
3057 dnl In any case, they are hardly relevant on non-GNU systems.
3059 dnl Beware, here comes some long scary shell commands.
3061 AC_DEFUN([PKG_ERR],
3063   pkg_out_fd=3
3064   echo "          ERROR: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3065   deb_dest="$deb_err"
3066   rpm_dest="$rpm_err"
3067   yast_dest="$yast_err"
3070 AC_DEFUN([PKG_WAR],
3072   pkg_out_fd=4
3073   echo "        WARNING: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3074   deb_dest="$deb_war"
3075   rpm_dest="$rpm_war"
3076   yast_dest="$yast_war"
3079 AC_DEFUN([PKG_REC],
3081   pkg_out_fd=5
3082   echo "    RECOMMENDED: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3083   deb_dest="$deb_rec"
3084   rpm_dest="$rpm_rec"
3085   yast_dest="$yast_rec"
3088 AC_DEFUN([PKG_SUGGEST],
3090   echo "`echo "$1" | fold -s -w 62 | sed 's/^/                 /'`" >&$pkg_out_fd
3093 AC_DEFUN([DEB_INSTALL],
3095   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
3096   echo -n " $1" >> "$deb_dest"
3099 AC_DEFUN([DEB_ALTERNATIVE],
3101   echo "                 or maybe     : `echo "apt-get install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3102   echo -n "/$1" >> "$deb_dest"
3105 AC_DEFUN([RPM_INSTALL],
3107   echo "                 or .rpm users: `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([RPM_ALTERNATIVE],
3113   echo "                 or maybe     : `echo "yum install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3114   echo -n "/$1" >> "$rpm_dest"
3117 AC_DEFUN([YAST_INSTALL],
3119   echo "                 or yast users: `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([YAST_ALTERNATIVE],
3125   echo "                 or maybe     : `echo "yast install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3126   echo -n "/$1" >> "$yast_dest"
3129 AC_DEFUN([PKG_ALTERNATIVE],
3131   echo "`echo "$1" | fold -s -w 62 | sed 's/^/                 /'`" >&$pkg_out_fd
3134 echo "Configurable options are:"
3136 if test x"${pthreads}" = x"yes"; then
3137   echo "        POSIX Threads support enabled (default)"
3138 else
3139   if test x"${build_haiku}" = x"yes"; then
3140      echo "        POSIX Thread support built into C library."
3141   else
3142      echo "        POSIX Thread support disabled."
3143   fi
3146 if test x"${npapi}" = x"yes"; then
3147   echo "        NPAPI plugin enabled (default). Use --disable-npapi to disable."
3148   echo "        NPAPI plugin will be installed in ${FIREFOX_PLUGINS}"
3149 else
3150   echo "        NPAPI plugin disabled."
3153 if test x"${build_kparts3}" = x"yes"; then
3154   echo "        KPARTS 3.x plugin enabled (default). Use --disable-kparts3 to disable"
3155   echo "            KPARTS 3.x plugin will be installed in ${KDE3_PLUGINDIR}"
3156   echo "            KPARTS 3.x service will be installed in ${KDE3_SERVICESDIR}"
3157   echo "            KPARTS 3.x config dir will be in ${KDE3_CONFIGDIR}"
3158   echo "            KPARTS 3.x appsdata will be installed in ${KDE3_APPSDATADIR}"
3159 else
3160   echo "        KPARTS 3.x plugin disabled."
3163 if test x"${build_kparts4}" = x"yes"; then
3164   echo "        KPARTS 4.x plugin enabled (default). Use --disable-kparts4 to disable"
3165   echo "            KPARTS 4.x plugin will be installed in ${KDE4_PLUGINDIR}"
3166   echo "            KPARTS 4.x service will be installed in ${KDE4_SERVICESDIR}"
3167   echo "            KPARTS 4.x config dir will be in ${KDE4_CONFIGDIR}"
3168   echo "            KPARTS 4.x appsdata will be installed in ${KDE4_APPSDATADIR}"
3169 else
3170   echo "        KPARTS 4.x plugin disabled."
3173 # set a variable if we shouldn't continue. This way we can print
3174 # out everything that is missing in one pass, hopefully making it
3175 # easy for new developers to get everything they need installed.
3177 echo ""
3178 echo "Configured paths for ${build} are:"
3180 dnl Dump QT3 options is the user specified a QTOPIA3 or KDE3 GUI
3181 if test x"${build_kde3}" = xyes -o x"${build_qtopia3}" = xyes; then
3182   if test x"${has_qt3}" = xyes; then
3183     echo "        QT3 flags are: ${QT3_CFLAGS}"
3184     echo "        QT3 libs are: ${QT3_LIBS}"
3185   else
3186     PKG_ERR([No QT 3.x development package installed!])
3187     PKG_SUGGEST([Install a QT 3.x development environment from http://qt.nokia.com/])
3188     DEB_INSTALL([libqt3-mt-dev])
3189     RPM_INSTALL([qt3-devel])
3190     RPM_ALTERNATIVE([qt-devel])
3191     PKG_ALTERNATIVE([or change to a different gui with --enable-gui=...])
3192   fi
3195 dnl Dump QT4 options is the user specified a QTOPIA4 or Qt4 GUI
3196 if test x"${build_qt4}" = xyes -o x"${build_qtopia4}" = xyes; then
3197   if test x"${has_qt4}" = xyes; then
3198     echo "        QT4 flags are: ${QT4_CFLAGS}"
3199     echo "        QT4 libs are: ${QT4_LIBS}"
3200   else
3201     PKG_ERR([No QT 4.x development package installed!])
3202     PKG_SUGGEST([Install a QT 4.x development environment from http://qt.nokia.com/])
3203     DEB_INSTALL([libqt4-dev])
3204     DEB_ALTERNATIVE([qt4-dev-tools]) dnl TODO: Is this required?
3205     RPM_INSTALL([qt4-devel])
3206     RPM_ALTERNATIVE([qt-devel])
3207     PKG_ALTERNATIVE([or change to a different gui with --enable-gui=...])
3208   fi
3211 if test x"${build_kparts4}" = xyes; then
3212   if test x"${has_kde4}" = xyes; then
3213     echo "        KDE4 flags are: ${KDE4_CFLAGS}"
3214     echo "        KDE4 libs are: ${KDE4_LIBS}"
3215   else
3216     PKG_WAR([kparts4 plugin is disabled!])
3217     PKG_SUGGEST([Install version 4.x of the KDE development environment from http://kde.org])
3218     DEB_INSTALL([kdelibs5-dev])
3219     RPM_INSTALL([kdelibs-devel])
3220   fi
3223 if test x"$build_qtopia3" = xyes; then
3224   if test x"${QTOPIA3_LIBS}" != x ; then
3225     if test x"${QTOPIA3_CFLAGS}" != x ; then
3226       echo "        QTOPIA 3.x flags are: $QTOPIA3_CFLAGS"
3227     else
3228       echo "        QTOPIA 3.x flags are: default include path"
3229     fi
3230     echo "        QTOPIA 3.x libs are: $QTOPIA3_LIBS"
3231   else
3232     PKG_ERR([No QTOPIA 3.x library development package installed!])
3233     PKG_SUGGEST([Install it from http://trolltech.com/downloads/ as binary packages are not available.]) dnl TODO: This link is no longer valid.
3234   fi
3237 if test x"$build_qtopia4" = xyes; then
3238   if test x"${QTOPIA4_LIBS}" != x ; then
3239     if test x"${QTOPIA4_CFLAGS}" != x ; then
3240       echo "        QTOPIA 4.x flags are: $QTOPIA4_CFLAGS"
3241     else
3242       echo "        QTOPIA 4.x flags are: default include path"
3243     fi
3244     echo "        QTOPIA 4.x libs are: $QTOPIA4_LIBS"
3245   else
3246     PKG_ERR([No QTOPIA 4.x library development package installed!])
3247     PKG_SUGGEST([Install it from http://trolltech.com/downloads/ as binary packages are not available.]) dnl TODO: This link is no longer valid.
3248   fi
3252 # -o x$build_kparts3 = xyes
3253 if test x$build_kde3 = xyes; then
3254   if test x"$has_kde3" = xyes; then
3255     echo "        KDE 3.x flags are: $KDE3_CFLAGS"
3256     echo "        KDE 3.x libs are: $KDE3_LIBS"
3257   else
3258     PKG_ERR([No KDE 3.x development package installed!])
3259     PKG_SUGGEST([Install version 3.x of the KDE development environment from http://kde.org])
3260     DEB_INSTALL([kdelibs4-dev])
3261     RPM_INSTALL([kdelibs3-devel])
3262     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.])
3263   fi
3266 if test x"${JPEG_LIBS}" != x ; then
3267   if test x"${JPEG_CFLAGS}" != x ; then
3268     echo "        JPEG flags are: $JPEG_CFLAGS"
3269   else
3270     echo "        JPEG flags are: default include path"
3271   fi
3272   echo "        JPEG libs are: $JPEG_LIBS"
3273 else
3274   PKG_ERR([No JPEG library development package installed!])
3275   PKG_SUGGEST([Install it from http://ijg.org])
3276   DEB_INSTALL([libjpeg-dev])
3277   RPM_INSTALL([libjpeg-devel])
3280 if test x"${GIF_LIBS}" != x ; then
3281   if test x"${GIF_CFLAGS}" != x ; then
3282     echo "        GIF flags are: $GIF_CFLAGS"
3283   else
3284     echo "        GIF flags are: default include path"
3285   fi
3286   echo "        GIF libs are: $GIF_LIBS"
3287 else
3288   PKG_ERR([No GIF library development package installed!])
3289   PKG_SUGGEST([Install it from http://sourceforge.net/projects/giflib/])
3290   DEB_INSTALL([libungif-dev])
3291   DEB_ALTERNATIVE([libgif-dev])
3292   RPM_INSTALL([libgif-devel])
3293   RPM_ALTERNATIVE([giflib-devel])
3294   RPM_ALTERNATIVE([libungif-devel])
3297 if test x"${PNG_LIBS}" != x ; then
3298   if test x"${PNG_CFLAGS}" != x ; then
3299     echo "        PNG flags are: $PNG_CFLAGS"
3300   else
3301     echo "        PNG flags are: default include path"
3302   fi
3303   echo "        PNG libs are: $PNG_LIBS"
3304 else
3305   PKG_REC([No PNG library development package installed!])
3306   PKG_SUGGEST([Gnash will be built without support for dynamic loading of PNG files.])
3307   PKG_SUGGEST([Install it from http://www.libpng.org])
3308   DEB_INSTALL([libpng12-dev])
3309   RPM_INSTALL([libpng-devel])
3312 if test x"${build_ovg}" = x"yes"; then
3313   if test x"${has_openvg}" = xyes; then
3314     echo "        OpenVG flags are: $OPENVG_CFLAGS"
3315     echo "        OpenVG libs are: $OPENVG_LIBS"
3316     else
3317       echo "        ERROR: No OpenVG development package installed!" >&3
3318       echo "               You need to install the libmesa development package" >&3
3319       echo "               or .deb users: apt-get install libopenvg1-mesa-dev" >&3
3320       echo "               or .rpm users: yum install mesa-libOpenVG-devel-7.8.1-7.fc13.i686" >&3
3321       echo "               or use a different renderer with --enable-renderer=" >&3
3322   fi
3325 if test x"${build_ogl}" = x"yes"; then
3326   if test x"$OPENGL_LIBS" != x; then
3327     if test x"$OPENGL_CFLAGS" != x; then
3328       echo "        OpenGL flags are: $OPENGL_CFLAGS"
3329     else
3330       echo "        OpenGL flags are: default include path"
3331     fi
3332     echo "        OpenGL libs are: $OPENGL_LIBS"
3333     else
3334       PKG_ERR([No OpenGL development package installed!])
3335       PKG_SUGGEST([You need to install the libmesa development package])
3336       DEB_INSTALL([libgl1-mesa-dev])
3337       RPM_INSTALL([mesa-libGL-devel])
3338       RPM_ALTERNATIVE([xorg-x11-Mesa-libGL])
3339       PKG_ALTERNATIVE([or use a different renderer with --enable-renderer=])
3340   fi
3343 if test x"${build_gles1}" = x"yes"; then
3344   if test x"${has_gles1}" = xyes; then
3345     if test x"${GLES1_CFLAGS}" != x; then
3346       echo "        OpenGLES1 flags are: ${GLES1_CFLAGS}"
3347     else
3348       echo "        OpenGLES1 flags are: default include path"
3349     fi
3350     echo "        OpenGLES1 libs are: ${GLES1_LIBS}"
3351   else
3352       PKG_ERR([No OpenGL-ES development package installed!])
3353       PKG_SUGGEST([You need to install the this from source probably])
3354       PKG_ALTERNATIVE([or use a different renderer with --enable-renderer=])
3355   fi
3358 dnl GLEXT is only needed for GTK/OpenGL
3359 if test x$build_gtk = xyes -a x$build_ogl = xyes ; then
3360   if test x"$GLEXT_LIBS" != x; then
3361     if test x"$GLEXT_CFLAGS" != x; then
3362       echo "        GtkGLExt flags are: $GLEXT_CFLAGS"
3363     else
3364       echo "        GtkGLExt flags are: default include path"
3365     fi
3366       echo "        GtkGLExt libs are: $GLEXT_LIBS"
3367   else
3368     PKG_ERR([No GtkGLExt development package installed!])
3369     PKG_SUGGEST([It is needed to build the GTK/OpenGL GUI/renderer combination.])
3370     PKG_SUGGEST([Install it from http://gtkglext.sourceforge.net])
3371     DEB_INSTALL([libgtkglext1-dev])
3372     RPM_INSTALL([gtkglext-devel])
3373     PKG_ALTERNATIVE([or --enable-gui=sdl or --enable-renderer=agg])
3374   fi
3377 if test x$build_gtk = xyes; then #{
3378   if test x"$GTK2_LIBS" != x; then
3379     if test x"$GTK2_CFLAGS" != x; then
3380       echo "        GTK2 flags are: $GTK2_CFLAGS"
3381     else
3382       echo "        GTK2 flags are: default include path"
3383     fi
3384       echo "        GTK2 libs are: $GTK2_LIBS"
3385   else
3386     PKG_ERR([No GTK2 development package installed!])
3387     PKG_SUGGEST([Install it from http://gtk.org])
3388     DEB_INSTALL([libgtk2.0-dev])
3389     RPM_INSTALL([gtk2-devel])
3390   fi
3392   if test x"$PANGO_LIBS" != x; then
3393     if test x"$PANGO_CFLAGS" != x; then
3394       echo "        Pango flags are: $PANGO_CFLAGS"
3395     else
3396       echo "        Pango flags are: default include path"
3397     fi
3398     echo "        Pango libs are: $PANGO_LIBS"
3399   else
3400     PKG_ERR([No Pango development package installed!])
3401     PKG_SUGGEST([Install it from http://pango.org])
3402     DEB_INSTALL([libpango1.0-dev])
3403     RPM_INSTALL([pango-devel])
3404   fi
3406   if test x"$GLIB_LIBS" != x; then
3407     if test x"$GLIB_CFLAGS" != x; then
3408       echo "        GLib flags are: $GLIB_CFLAGS"
3409     else
3410       echo "        GLib flags are: default include path"
3411     fi
3412     echo "        GLib libs are: $GLIB_LIBS"
3413   else
3414     PKG_ERR([No GLib development package installed!])
3415     PKG_SUGGEST([Install it from http://gtk.org])
3416     DEB_INSTALL([libglib2.0-dev])
3417     RPM_INSTALL([glib2-devel])
3418   fi
3420   if test x"$ATK_LIBS" != x; then
3421     if test x"$ATK_CFLAGS" != x; then
3422       echo "        ATK flags are: $ATK_CFLAGS"
3423     else
3424       echo "        ATK flags are: default include path"
3425     fi
3426       echo "        ATK libs are: $ATK_LIBS"
3427   else
3428     PKG_ERR([No ATK development package installed!])
3429     PKG_SUGGEST([Install it from http://atk.org])
3430     DEB_INSTALL([libatk1.0-dev])
3431     RPM_INSTALL([atk-devel])
3432   fi
3436 if test x"$build_media_gst" = x"yes"; then
3437   if test x"$missing_codecs" != x; then   
3438       echo "        Your Gstreamer installation is missing these codecs: $missing_codecs"
3439       echo "        Please install the gstreamer-ffmpeg for Gstreamer"
3440   fi  
3441   if test x"$GSTREAMER_LIBS" != x; then
3442     if test x"$GSTREAMER_CFLAGS" != x; then
3443       echo "        Gstreamer flags are: $GSTREAMER_CFLAGS"
3444     else
3445       echo "        Gstreamer flags are: default include path"
3446     fi
3447     echo "        Gstreamer libs are: $GSTREAMER_LIBS"
3448   else
3449     PKG_ERR([GST media handling requested but gstreamer-0.10+ not found])
3450     PKG_SUGGEST([Install it from http://www.gstreamer.net])
3451     DEB_INSTALL([libgstreamer0.10-dev])
3452     RPM_INSTALL([gstreamer-devel])
3453     YAST_INSTALL([gstreamer010-devel])
3454   fi
3455   if test x"$has_gstreamer_pbutils" != "xyes"; then
3456     PKG_REC([If the user has not installed the necessary Gstreamer plugins, Gstreamer can pop up a message prompting them to.])
3457     PKG_SUGGEST([Install gstpbutils (>= 0.10.15) from http://www.gstreamer.net for that to be enabled])
3458     DEB_INSTALL([libgstreamer-plugins-base0.10-dev])
3459     PKG_SUGGEST([or .rpm users: simply install the below package]) dnl TODO: Can/should this notice be done cleaner?
3460     PKG_SUGGEST([Also see --with-gstpbutils-incl and --with-gstpbutils-lib])
3461   fi
3462   if test x"$has_gstreamer_plugins_base" = "xno"; then
3463     dnl TODO: Check if this is really a mandatory asset!
3464     PKG_ERR([Base plugins are required for gstreamer media!])
3465     PKG_SUGGEST([Install gstreamer-plugins-base from http://www.gstreamer.net])
3466     DEB_INSTALL([libgstreamer-plugins-base0.10-dev])
3467     RPM_INSTALL([gstreamer-plugins-base-devel])
3468   fi
3471 dnl TODO: figure out some RPM package names.
3472 dnl TODO: The following tests is probably incorrect for any/older/exotic systems! Could someone experienced look at it?
3473 if test x"${build_media_ffmpeg}" = x"yes"; then
3474   if test x"$FFMPEG_LIBS" != x; then
3475     echo "        MP3 and video support enabled through FFmpeg"
3476     if test x"$FFMPEG_CFLAGS" != x; then
3477       echo "        FFmpeg flags are: $FFMPEG_CFLAGS"
3478     else
3479       echo "        FFmpeg flags are: default include path"
3480     fi
3481     echo "        FFmpeg libs are: $FFMPEG_LIBS"
3482   else
3483     PKG_ERR([No FFmpeg development package installed!])
3484     PKG_SUGGEST([You can install FFmpeg from http://ffmpeg.org])
3485     DEB_INSTALL([libavcodec-dev])
3486     RPM_INSTALL([ffmpeg-devel])
3487     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3488   fi
3490   if test x"${avformat_h}" = x; then
3491     PKG_ERR([FFmpeg's avformat header is installed but not libavformat!])
3492     PKG_SUGGEST([You can install FFmpeg from http://ffmpeg.org])
3493     DEB_INSTALL([libavformat-dev])
3494     YAST_INSTALL([libavformat-api]) dnl (but currently installs into /usr/lib64)
3495     PKG_ALTERNATIVE(or explicitly set the path using --with-ffmpeg-incl=)
3496     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3497   fi
3499   if test x"${have_ffmpeg_swscale}" = "xno"; then
3500     PKG_ERR([No libswscale development package installed!])
3501     PKG_SUGGEST([You can install libswscale from http://ffmpeg.org])
3502     DEB_INSTALL([libswscale-dev])
3503     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3504   fi
3507 if test x$build_cairo = xyes; then
3508   if test x"$CAIRO_LIBS" != x; then
3509     if test x"$CAIRO_CFLAGS" != x; then
3510       echo "        Cairo flags are: $CAIRO_CFLAGS"
3511     else
3512       echo "        Cairo flags are: default include path"
3513     fi
3514     echo "        Cairo libs are: $CAIRO_LIBS"
3515   else
3516     PKG_ERR([No Cairo development package installed!])
3517     PKG_SUGGEST([You need to have the Cairo development package installed if you have used --enable-render=cairo to configure.])
3518     PKG_SUGGEST([Install it from http://cairographics.org])
3519     DEB_INSTALL([libcairo-dev])
3520     RPM_INSTALL([cairo-devel])
3521   fi
3524 if test x$build_fltk = xyes; then
3525   if test x"$FLTK2_LIBS" != x; then
3526     if test x"$FLTK2_CFLAGS" != x; then
3527       echo "        FLTK flags are: $FLTK2_CFLAGS"
3528     else
3529       echo "        FLTK flags are: default include path"
3530     fi
3531       echo "        FLTK libs are: $FLTK2_LIBS"
3532   else
3533     PKG_ERR([No FLTK2 development package installed!])
3534     PKG_SUGGEST([Install it from http://fltk.org])
3535     PKG_ALTERNATIVE(or change to a different gui with --enable-gui=...)
3536   fi
3539 if test x$build_fltk = xyes; then
3540   if test x"$XFT_LIBS" != x; then
3541     if test x"$XFT_CFLAGS" != x; then
3542       echo "        Xft flags are: $XFT_CFLAGS"
3543     else
3544       echo "        Xft flags are: default include path"
3545     fi
3546     echo "        Xft libs are: $XFT_LIBS"
3547   fi
3550 # See whether SDL is required
3551 need_sdl=false
3552 test x$build_sdl = xyes                 && need_sdl=true
3553 test x$build_sound_sdl = xyes   && need_sdl=true
3555 if $need_sdl; then
3556   if test x"$SDL_LIBS" != x; then
3557     echo "        SDL flags are: $SDL_CFLAGS"
3558     echo "        SDL libs are: $SDL_LIBS"
3559   else
3560     PKG_ERR([No SDL development package installed!])
3561     PKG_SUGGEST([Install it from http://www.libsdl.org/download-1.2.php])
3562     DEB_INSTALL([libsdl1.2-dev])
3563     RPM_INSTALL([SDL-devel])
3564     PKG_ALTERNATIVE(or change to a different gui with --enable-gui=...)
3565   fi
3567 unset need_sdl
3569 if test x"$nsapi" = x"yes"; then
3570     echo "        Plugin will be installed in ${FIREFOX_PLUGINS}"
3573 if test x"${pthreads}" = x"yes"; then
3574   if test x"$PTHREAD_CFLAGS" != x; then
3575     echo "        POSIX Threads flags are: $PTHREAD_CFLAGS"
3576   fi
3577   if test x"${PTHREAD_LIBS}" != x; then
3578     echo "        POSIX Threads lib is: $PTHREAD_LIBS"
3579   else
3580     if test x"${cross_compiling}" = xno; then
3581       echo "ERROR: No pthread development package installed!" >&3
3582     fi
3583   fi
3586 if test x"${docbook}" = x"yes"; then
3587   if test x"$MAKEINFO" = x; then
3588     PKG_ERR([No makeinfo tools installed!])
3589     PKG_SUGGEST([Install it from http://www.gnu.org/software/texinfo/])
3590     DEB_INSTALL([texinfo])
3591     RPM_INSTALL([texinfo])
3592     RPM_ALTERNATIVE([texinfo-tex])
3593   fi
3594   dnl low-level tools
3595   if test x"$DB2X_TEXIXML" = x -o x"$DB2X_MANXML" = x -o x"$DB2X_XSLTPROC" = x; then
3596     dnl high-level tools
3597     if test x"${DB2X_TEXI}" = x -o x"${DB2X_MAN}" = x; then
3598       PKG_ERR([No DocBook2X tools installed!])
3599       PKG_SUGGEST([Install it from http://docbook2x.sourceforge.net])
3600       dnl TODO: Could someone look at this and confirm the needed software is installed?
3601       dnl FIXME: I removed the texidocbook and docbook-utilsnfo packages as they are not on my system.
3602       DEB_INSTALL([docbook2x docbook-xml docbook-xsl texinfo xsltproc])
3603       PKG_ALTERNATIVE([or configure without --enable-docbook])
3604     fi
3605   else
3606     echo "        You have version $db2x_version of the DocBook2X tools."
3607   fi
3608 else
3609   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.])
3612 if test x"$CURL_LIBS" != x; then
3613   if test x"$CURL_CFLAGS" != x; then
3614     echo "        CURL flags are: $CURL_CFLAGS"
3615   else
3616     echo "        CURL flags are: default include path"
3617   fi
3618     echo "        CURL libs are: $CURL_LIBS"
3619 else
3620   PKG_REC([If you install the CURL library, Gnash will be able to display remote content (streaming from URLs) using CURL.])
3621   PKG_SUGGEST([Install libcurl from http://curl.haxx.se/libcurl])
3622   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?
3623   DEB_ALTERNATIVE([libcurl-dev])
3624   RPM_INSTALL([curl-devel])
3627 if test x"$SPEEX_LIBS" != x; then
3628   if test x"$SPEEX_CFLAGS" != x; then
3629     echo "        Speex flags are: $SPEEX_CFLAGS"
3630   else
3631     echo "        Speex flags are: default include path"
3632   fi
3633     echo "        Speex libs are: $SPEEX_LIBS"
3634 else
3635   PKG_REC([If you install the Speex library, Gnash will be able to decoded Speex encoded audio in FLV files.])
3636   PKG_SUGGEST([Install libspeex from http://speex.org])
3637   DEB_INSTALL([libspeex-dev])
3638   RPM_INSTALL([speex-devel])
3641 if test x"$SPEEXDSP_LIBS" != x; then
3642   if test x"$SPEEXDSP_CFLAGS" != x; then
3643     echo "        Speex DSP flags are: $SPEEXDSP_CFLAGS"
3644   else
3645     echo "        Speex DSP flags are: default include path"
3646   fi
3647     echo "        Speex DSP libs are: $SPEEXDSP_LIBS"
3648 else
3649   PKG_REC([If you install the Speex DSP library, Gnash will be able to resample Speex encoded audio in FLV files.])
3650   PKG_SUGGEST([Install libspeexdsp from http://speex.org])
3651   DEB_INSTALL([libspeexdsp-dev])
3652   RPM_INSTALL([speex-devel])
3655 if test x"$ext_dbus" = xyes; then
3656   if test x"$DBUS_LIBS" != x; then
3657     if test x"$DBUS_CFLAGS" != x; then
3658       echo "        DBUS flags are: $DBUS_CFLAGS"
3659     else
3660       echo "        DBUS flags are: default include path"
3661     fi
3662       echo "        DBUS libs are: $DBUS_LIBS"
3663   else
3664     PKG_WAR([No DBUS development package was found! Gnash will be built without support for remote controls.])
3665     PKG_SUGGEST([Install libdbus from http://www.dbus.org])
3666     DEB_INSTALL([dbus-dev])
3667     DEB_ALTERNATIVE([libdbus-1-dev])
3668     RPM_INSTALL([dbus-devel])
3669   fi
3672 if test x$build_agg = xyes; then # {
3673   echo "        AGG Pixel format is: $pixelformat"
3674   if test x"$AGG_LIBS" != x -a x"${agg25}" == xyes; then # {
3675     if test x"$AGG_CFLAGS" != x; then # {
3676       echo "        AGG flags are: $AGG_CFLAGS"
3677     else # }{
3678       echo "        AGG flags are: default include path"
3679     fi # }
3680     echo "        AGG libs are: $AGG_LIBS"
3681   else # }{
3682     if test x"$AGG_LIBS" != x -a x"${agg25}" != xyes; then
3683       PKG_ERR([Your installation of AGG appears to be version 2.4 or older. Please upgrade to AGG 2.5 or greater.])
3684     else
3685       PKG_ERR([No AGG development package installed!])
3686     fi
3687     PKG_SUGGEST([Install it from http://www.antigrain.com])
3688     DEB_INSTALL([libagg-dev])
3689     RPM_INSTALL([agg-devel])
3690   fi # }
3691 fi # }
3693 dnl TODO: This package is handled a bit stupidly in regard to the package
3694 dnl suggestion system. It would be better to check for each package
3695 dnl separately, instead of passing the missing ones in variables..
3696 if test x"$BOOST_LIBS" != x; then
3697   echo "        BOOST flags are: $BOOST_CFLAGS"
3698   echo "        BOOST libs are: $BOOST_LIBS"
3699   echo "        BOOST libs for cygnal are: $BOOST_CYGNAL_LIBS"
3701   if test x"${missing_headers}" != x; then
3702     for i in ${missing_headers}; do
3703       PKG_ERR([The Boost $i header is not installed])
3704       PKG_SUGGEST([Install it from http://www.boost.org])
3705     done
3706   fi
3708   if test x"${cygnal}" = x"yes"; then
3709     if test x"${cygnal_missing_libs}" != x; then
3710       for i in ${cygnal_missing_libs}; do
3711         PKG_ERR([No Boost $i package installed])
3712         PKG_SUGGEST([Install it from http://www.boost.org])
3713         debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
3714         DEB_INSTALL([$debtmppkg])
3715         PKG_ALTERNATIVE([or configure with --disable-cygnal])
3716       done
3717     fi
3718   fi
3720   if test x"${missing_libs}" != x; then
3721     for i in ${missing_libs}; do
3722       PKG_ERR([No Boost $i package installed])
3723       PKG_SUGGEST([Install it from http://www.boost.org])
3724       debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
3725       DEB_INSTALL([$debtmppkg])
3726     done
3727   fi
3728 else
3729   PKG_ERR([No Boost development package installed])
3730   PKG_SUGGEST([Install it from http://www.boost.org])
3731   dnl I am not sure that libboost-program-options-dev should be passed here, but
3732   dnl it seems like the cleanest way to get it.
3733   if test x"$cygnal" = xyes; then
3734     DEB_INSTALL([libboost-dev libboost-thread-dev libboost-program-options-dev libboost-date-time-dev])
3735   else
3736     DEB_INSTALL([libboost-dev libboost-thread-dev libboost-program-options-dev])
3737   fi
3738   RPM_INSTALL([boost-devel])
3741 dnl don't look for the flash compilers when cross compiling.
3742 if test x"$testsuite" = x"yes"; then
3743   if test x$cross_compiling = xno; then
3744     if test x"$MING_LIBS" != x; then
3745       echo "        MING flags are $MING_CFLAGS"
3746       echo "        MING libs are $MING_LIBS"
3747     else
3748       PKG_WAR([You need to have the Ming development package installed to run most of the tests in Gnash testsuite.])
3749       PKG_SUGGEST([Install it from http://www.libming.org/])
3750       DEB_INSTALL([libming-dev])
3751       RPM_INSTALL([libming-devel])
3752     fi
3754     if test x"$MAKESWF" != x; then
3755       echo "        MING version code is $MING_VERSION_CODE"
3756       echo "        MAKESWF is $MAKESWF"
3757     else
3758       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.])
3759       PKG_SUGGEST([Install it from http://www.libming.org/])
3760       DEB_INSTALL([libming-util])
3761       RPM_INSTALL([ming-util])
3762       RPM_ALTERNATIVE([ming-utils])
3763     fi
3765     if test x"$MAKESWF" != x && test $MING_VERSION_CODE -lt 00040006; then
3766       echo "        WARNING: You have an older version of Ming installed and will not" >&4
3767       echo "                 be able to run all of the tests in Gnash testsuite." >&4
3768       echo "                 Install the latest version from http://www.libming.org" >&4
3769     fi
3771     if test x"$SWFDEC_TESTSUITE" != x; then
3772       echo "        SWFDEC testsuite dir is $SWFDEC_TESTSUITE"
3773     fi
3775     if test x"$MTASC" != x; then
3776       echo "        MTASC is $MTASC"
3777       echo "        MTASC CLASSPATH is $MTASC_CLASSPATH"
3778     else
3779       PKG_WAR([You need to have the MTASC compiler packages installed to run some of the tests in Gnash testsuite.])
3780       PKG_SUGGEST([Install it from http://mtasc.org])
3781       DEB_INSTALL([mtasc])
3782       RPM_INSTALL([mtasc])
3783     fi
3785     if test x"$HAXE" != x; then
3786       echo "        HAXE is $HAXE"
3787       echo "        HAXE CLASSPATH is $HAXE_CLASSPATH"
3788     else
3789       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.])
3790       PKG_SUGGEST([Install it from http://haxe.org])
3791       DEB_INSTALL([haxe])
3792       RPM_INSTALL([haxe])
3793     fi
3795     if test x"$SWFMILL" != x; then
3796       echo "        SWFMILL is $SWFMILL"
3797       if test x"$ENABLE_AVM2" != x -a "$SWFMILL_VERSION" -lt 00021206; then
3798         PKG_WAR([You are building Gnash with AVM2 support but your swfmill version is too old to run AS3 tests.])
3799       fi
3800     else
3801       PKG_WAR([You need to have the swfmill tool installed to run some of the tests in Gnash testsuite.])
3802       PKG_SUGGEST([Install it from http://swfmill.org])
3803       DEB_INSTALL([swfmill])
3804       RPM_INSTALL([swfmill])
3805     fi
3807     if test x"$SWFC" != x; then
3808       echo "        SWFC is $SWFC"
3809     else
3810       PKG_WAR([You need to have swfc from SWFTools installed to run some of the tests in Gnash testsuite.])
3811       PKG_SUGGEST([Install it from http://swftools.org])
3812       DEB_INSTALL([swftools])
3813       RPM_INSTALL([swftools])
3814     fi
3816     if test x"$AS3COMPILE" != x; then
3817       echo "        AS3COMPILE is $AS3COMPILE"
3818     else
3819       PKG_WAR([You need to have as3compile from SWFTools installed to run some of the tests in Gnash testsuite.])
3820       PKG_SUGGEST([Install it from http://swftools.org])
3821     fi
3823     if test x"$HTTP_TESTSUITE" != x; then
3824       echo "        HTTP testsuite dir is $HTTP_TESTSUITE"
3825     fi
3827     if test x"$RED5_HOST" != x; then
3828       echo "        RED5 testing host is $RED5_HOST"
3829     fi
3830   fi
3833   if test x"$PERL" != x; then
3834     echo "        PERL is $PERL"
3835   else
3836     PKG_WAR([You need to have perl installed to run some of the tests in Gnash testsuite.])
3837     PKG_SUGGEST([Install it from http://perl.org])
3838     DEB_INSTALL([perl])
3839     RPM_INSTALL([perl])
3840   fi
3842 if test x"$testsuite" = x"yes"; then
3843   if test x"$CSOUND" != x; then
3844     echo "        CSOUND is $CSOUND"
3845   else
3846     echo "        WARNING: You need to have csound installed" >&4
3847     echo "                 to have real fun." >&4
3848     echo "                 Install it from http://www.csounds.com/" >&4
3849     echo "                 or .deb users: apt-get install csound" >&4
3850     echo "                 or .rpm users: yum install csound" >&4
3851   fi
3854 if test x"$Z_LIBS" != x; then
3855   if test x"$Z_CFLAGS" != x; then
3856     echo "        Z flags are: $Z_CFLAGS"
3857   else
3858     echo "        Z flags are: default include path"
3859   fi
3860   echo "        Z libs are: $Z_LIBS"
3861 else
3862   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.])
3863   PKG_SUGGEST([Install it from http://zlib.net])
3864   DEB_INSTALL([zlib1g-dev])
3865   RPM_INSTALL([zlib-devel])
3866   PKG_ALTERNATIVE([It may still be possible to configure without zlib.])
3869 if test x"$FREETYPE2_LIBS" != x; then
3870   if test x"$FREETYPE2_CFLAGS" != x; then
3871     echo "        FreeType flags are: $FREETYPE2_CFLAGS"
3872   else
3873     echo "        FreeType flags are: default include path"
3874   fi
3875   echo "        FreeType libs are: $FREETYPE2_LIBS"
3876 else
3877   PKG_REC([You need to have the freetype development packages installed to use device fonts.])
3878   PKG_SUGGEST([Install it from http://freetype.org])
3879   DEB_INSTALL([libfreetype6-dev])
3880   RPM_INSTALL([freetype-devel])
3881   PKG_ALTERNATIVE([It may still be possible to configure without freetype.])
3884 if test x"$FONTCONFIG_LIBS" != x; then
3885   if test x"$FONTCONFIG_CFLAGS" != x; then
3886     echo "        Fontconfig flags are: $FONTCONFIG_CFLAGS"
3887   else
3888     echo "        Fontconfig flags are: default include path"
3889   fi
3890   echo "        Fontconfig libs are: $FONTCONFIG_LIBS"
3891 else
3892   PKG_REC([You need to have the fontconfig development packages installed to use device fonts.])
3893   PKG_SUGGEST([Install it from http://fontconfig.org])
3894   DEB_INSTALL([libfontconfig1-dev])
3895   RPM_INSTALL([fontconfig-devel])
3896   PKG_ALTERNATIVE([It may still be possible to configure without fontconfig.])
3899 if test x$ext_mysql = xyes; then
3900   if test x$mysql != xno; then
3901     if test x"$MYSQL_LIBS" != x; then
3902       echo "        MYSQL flags are: $MYSQL_CFLAGS"
3903       echo "        MYSQL libs are: $MYSQL_LIBS"
3904     else
3905       PKG_ERR([No MySQL development package is installed.])
3906       PKG_SUGGEST([Install it from http://mysql.org])
3907       DEB_INSTALL([libmysqlclient-dev])
3908       RPM_INSTALL([mysql-devel])
3909       PKG_ALTERNATIVE([or reconfigure without --enable-extensions=mysql])
3910     fi
3911   fi
3914 if test "$GMSGFMT" = ":"; then
3915   PKG_WAR([You need the gettext package installed to use translations. Required for building a package or 'make distcheck'])
3916   PKG_SUGGEST([Install it from http://www.gnu.org/software/gettext/])
3917   DEB_INSTALL([gettext])
3918   RPM_INSTALL([gettext])
3921 if test x"${build_vaapi}" = x"yes"; then
3922   if test x"${LIBVA_CFLAGS}" = xyes; then
3923       echo "        LIBVA flags are: default"
3924     else
3925       echo "        LIBVA flags are: $LIBVA_CFLAGS"
3926       echo "        LIBVA libraries are: $LIBVA_LIBS"
3927   fi
3928   if test x$use_libva_x11 = xyes; then
3929     if test x"${LIBVA_X11_CFLAGS}" = xyes; then
3930       echo "        LIBVA X11 flags are: default"
3931     else
3932       echo "        LIBVA X11 flags are: $LIBVA_X11_CFLAGS"
3933       echo "        LIBVA X11 libraries are: $LIBVA_X11_LIBS"
3934     fi
3935   fi
3936   if test x$use_libva_glx = xyes; then
3937     if test x"${LIBVA_GLX_CFLAGS}" = xyes; then
3938       echo "        LIBVA GLXflags are: default"
3939     else
3940       echo "        LIBVA GLX flags are: $LIBVA_GLX_CFLAGS"
3941     fi
3942     echo "        LIBVA GLX libraries are: $LIBVA_GLX_LIBS"
3943   fi
3946 if test x"$ac_cv_gcc_visibility" != xyes; then
3947   if test x"$npapi" = xyes; then
3948     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!])
3949   fi
3952 if test x"$npapi" = xyes; then
3953   if test x"$has_npapi" = xyes; then
3954     echo "        NPAPI flags are: $NPAPI_CFLAGS"
3955   else
3956     PKG_ERR([No xulrunner development package is installed!])
3957     PKG_SUGGEST([Install it from http://releases.mozilla.org/pub/mozilla.org/xulrunner])
3958     DEB_INSTALL([xulrunner-dev]) or 
3959     DEB_INSTALL([firefox-dev])
3960     RPM_INSTALL([xulrunner-devel])
3961   fi
3962 else
3963   echo "        NPAPI plugin is disabled"
3966 if test x"${DEJAGNU}" != x""; then
3967   echo "        DEJAGNU's runtest is $DEJAGNU"
3968 else
3969   PKG_WAR([You need the dejagnu package installed to get a summary after running 'make check'.])
3970   PKG_SUGGEST([Install it from http://www.gnu.org/software/dejagnu/])
3971   DEB_INSTALL([dejagnu])
3972   RPM_INSTALL([dejagnu])
3975 dnl Haiku
3976 if test x"${build_haiku}" = xyes -o x"${build_sound_mkit}" = xyes -o x"${build_media_haiku}" = x"yes"; then
3977     echo "        Haiku libs are: $HAIKU_LIBS"
3980 if test x"$has_ltdl" = x"yes";then
3981   echo "        LIBLTDL flags are: $LTDL_CFLAGS"
3982   echo "        LIBLTDL libs are: $LTDL_LIBS"
3983 else
3984   if test x"${extensions_support}" != xno; then
3985     PKG_ERR([No libltdl development package is installed, yet --disable-extensions was not specified.])
3986     PKG_SUGGEST([Install it from ftp://ftp.gnu.org/gnu/libtool/])
3987     DEB_INSTALL([libltdl-dev])
3988     RPM_INSTALL([libtool-ltdl-devel])
3989   fi
3992 if test x"$python" = x"yes"; then
3993   if test x"$has_python" = x"yes"; then
3994     echo "        PYTHON flags are: $PYTHON_CFLAGS"
3995     echo "        PYTHON libs are: $PYTHON_LIBS"
3996     echo "        PYTHON executable is: $PYTHON"
3997   else
3998     PKG_ERR([No Python development package is installed, but it's enabled.])
3999   fi
4001 if test x${build_ssl} = xyes; then
4002   if test x"${has_ssl}" = xyes; then
4003     if test x"${SSL_CFLAGS}" = xyes; then
4004       echo "        SSL flags are: default"
4005     else
4006       echo "        SSL flags are: $SSL_CFLAGS"
4007     fi
4008     echo "        SSL libs are: $SSL_LIBS"
4009   else
4010     PKG_ERR([No SSL development package is installed, but it's enabled."])
4011   fi
4014 if test x${build_ssh} = xyes; then
4015   if test x"${has_ssh}" = xyes; then
4016     if test x"${SSH_CFLAGS}" = xyes; then
4017       echo "        SSH flags are: default"
4018     else
4019       echo "        SSH flags are: $SSH_CFLAGS"
4020     fi
4021     echo "        SSH libs are: $SSH_LIBS"
4022   else
4023     PKG_ERR([No SSH development package is installed, but it's enabled."])
4024   fi
4027 if test x"${build_all_as3}" = x"yes"; then
4028   echo "        Building the entire ActionScript class libary"
4029 else
4030   echo "        Only building these ActionScript classes into the library:"
4031   echo "     ${classlist}"
4034 if test x"$testsuite" = x"yes"; then
4035   if test x"$NETCAT" != x; then
4036     echo "        You have netcat installed, which is only used for testing"
4037   else
4038     echo "        Install netcat for networking test support"
4039   fi
4040   if test x"$WGET" != x; then
4041     echo "        You have wget installed, which is only used for testing"
4042   else
4043     echo "        Install wget for networking test support"
4044   fi
4047 if test x$cross_compiling = xyes; then
4048    if test x"${android_ndk}" != xno; then
4049       AC_MSG_NOTICE([This build is setup for cross compiling for Android])
4050    else
4051       AC_MSG_NOTICE([This build is setup for cross compiling])
4052    fi
4055 echo "--------"
4057 if test x"${cygnal}" = x"yes"; then
4058   echo "        Building Cygnal media server enabled (default). Use --disable-cygnal to disable."
4059 else
4060   echo "        Building Cygnal media server disabled."
4063 if test x"${with_top_level}" != x; then
4064   echo "        Top level for cross compiling support files is: $with_top_level"
4067 if test x"${build_gtk}" = xyes -a x"${pixelformat}" = xrgb565; then
4068   echo "        WARNING: Pixel format RGB565 selected in combination with the" >&4
4069   echo "                 GTK GUI. Only a hacked GTK will work (e.g. on the OLPC)." >&4
4072 if test x"${extensions_list}" != x; then
4073   echo "        Building extensions: ${extensions_list}"
4076 if test x"${extensions_support}" = xno; then
4077   echo "        Extension support disabled."
4080 if test x"${security_list}" != x; then
4081   echo "        Enabling security features: ${security_list}"
4084 if test x"${statistics_list}" != x; then
4085   echo "        Enabling statistics collecting for: ${statistics_list}"
4088 if test x"${SUPPORTED_GUIS}" = x; then
4089   AC_MSG_ERROR(no supported GUIs found);
4092 echo "        GUI toolkits supported: ${SUPPORTED_GUIS}"
4093 echo "        Renderers supported: ${renderer_list}"
4094 echo "        Hardware Acceleration: ${device_list}"
4095 echo "        Media handlers: ${media_list}"
4096 echo "        Using ${add_sound} for sound handling"
4098 if test x"$docbook" = x"yes"; then
4099   echo '        DocBook document processing enabled (for "make html" and "make pdf")'
4100   if test x"$docbook_styles" != x; then
4101     echo "        Docbook styles sheets in $docbook_styles"
4102   fi
4103 else
4104   echo "        DocBook document processing disabled (default)"
4107 dnl The Framebuffer GUI has several other settings. As it doesn't have X11,
4108 dnl we have to handle input devics ourselves.
4109 if test x"${build_fb}" = xyes; then
4110 echo "        Using ${input_events} for Input"
4111   if test x"${fakefb}" != x; then
4112     echo "        Using shared memory as a fake framebuffer"
4113   fi
4114   if test x"${offscreen}" = xyes; then
4115     echo "        Using offscreen rendering"
4116   fi
4117   if test x"${doublebuf}" = xyes; then
4118     echo "        Using double buffering when rendering"
4119   fi
4122 if test -s $cwarn; then
4123   echo ""
4124   cat $cwarn
4125   rm $cwarn
4126   echo ""
4127   echo "Gnash should still compile even with these warnings."
4128   echo "If it doesn't, report the warnings as a bug."
4129 else
4130   rm $cwarn
4133 if test -s $crec; then
4134   echo ""
4135   cat $crec
4136   rm $crec
4137   echo ""
4138   echo "Gnash should still compile, but you'll miss important support"
4139 else
4140   rm $crec
4143 if test -s $cerr; then
4144   echo ""
4145   cat $cerr >&2
4148 deb_err="`cat $deb_err`"
4149 deb_war="`cat $deb_war`"
4150 deb_rec="`cat $deb_rec`"
4151 rpm_err="`cat $rpm_err`"
4152 rpm_war="`cat $rpm_war`"
4153 rpm_rec="`cat $rpm_rec`"
4154 yast_err="`cat $yast_err`"
4155 yast_war="`cat $yast_war`"
4156 yast_rec="`cat $yast_rec`"
4158 # Pipe stderr to /dev/null since Fedora complains when target isn't there.
4159 if test x`which apt-get 2>/dev/null` != x; then
4160   if test x"$deb_err" != x -o x"$deb_war" != x -o x"$deb_rec" != x; then
4161     echo "#!/bin/sh" > deb-attempt-install-dependencies.sh
4162     echo "packages=\"$deb_err $deb_war $deb_rec\"" >> deb-attempt-install-dependencies.sh
4163     echo "PKGCOMMAND=\"apt-get install -y -q\"" >> deb-attempt-install-dependencies.sh
4164     cat ${srcdir}/base-attempter.sh >> deb-attempt-install-dependencies.sh
4165     chmod +x deb-attempt-install-dependencies.sh
4166     echo ""
4167     echo ".deb users might be able to install most dependencies by executing:"
4168     echo "sudo ./deb-attempt-install-dependencies.sh"
4169   fi
4172 if test x`which yum 2>/dev/null` != x; then
4173   if test x"$rpm_err" != x -o x"$rpm_war" != x -o x"$deb_rec" != x; then
4174     echo "#!/bin/sh" > rpm-attempt-install-dependencies.sh
4175     echo "packages=\"$rpm_err $rpm_war  $rpm_rec\"" >> rpm-attempt-install-dependencies.sh
4176     echo "PKGCOMMAND=\"yum install -y \""    >> rpm-attempt-install-dependencies.sh
4177     cat ${srcdir}/base-attempter.sh >> rpm-attempt-install-dependencies.sh
4178     chmod +x rpm-attempt-install-dependencies.sh
4179     echo ""
4180     echo ".rpm users might be able to install most dependencies by executing:"
4181     echo "sudo ./rpm-attempt-install-dependencies.sh"
4182   fi
4185 dnl TODO: Add support for yast here, which AFAIK is used on OpenSuse.
4187 dnl If anything critical is missing, don't bother to continue
4188 if test -s $cerr; then
4189   echo ""
4190   rm $cerr
4191   AC_MSG_ERROR([Please install required packages])
4192 else
4193   rm $cerr
4196 rm -rf $tmp
4198 if test x"$fork" = x"no"; then
4199   echo ""
4200   AC_MSG_ERROR([Currently only forking the standalone player works!])
4202 echo ""
4204 # Local Variables:
4205 # c-basic-offset: 2
4206 # tab-width: 2
4207 # indent-tabs-mode: nil
4208 # End: