Add automated tests on function-type FSCommand parameter passing.
[gnash.git] / configure.ac
blobffd5deee5a4d360a034a44ec7bdbdfa39e8a6deb
1 dnl  
2 dnl  Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014, 2015,
3 dnl  2017 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.11dev)
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 AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
34 AC_PROG_CC
35 AM_PROG_CC_C_O
36 AC_EXEEXT
37 AC_PROG_INSTALL
39 dnl Set the default values for Flash Version. These are converted into
40 dnl various strings to make JavaScript or ActionScript detectors
41 dnl recognize Gnash as a SWF Player.
42 DEFAULT_FLASH_MAJOR_VERSION="10"
43 DEFAULT_FLASH_MINOR_VERSION="1"
44 DEFAULT_FLASH_REV_NUMBER="999"
45 AC_SUBST(DEFAULT_FLASH_MAJOR_VERSION)
46 AC_SUBST(DEFAULT_FLASH_MINOR_VERSION)
47 AC_SUBST(DEFAULT_FLASH_REV_NUMBER)
49 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_MAJOR_VERSION], ["${DEFAULT_FLASH_MAJOR_VERSION}"], [Default Flash major version])
50 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_MINOR_VERSION], ["${DEFAULT_FLASH_MINOR_VERSION}"], [Default Flash minor version])
51 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_REV_NUMBER], ["${DEFAULT_FLASH_REV_NUMBER}"], [Default Flash revision number])
53 dnl TODO: use host/build/target -- whatever is more appropriate
54 case "${host}" in
55   *-apple-*)
56     DEFAULT_FLASH_PLATFORM_ID="MAC"
57     DEFAULT_FLASH_SYSTEM_OS="MacOS"
58     ;;
59   *-openbsd*)
60     DEFAULT_FLASH_PLATFORM_ID="BSD"
61     DEFAULT_FLASH_SYSTEM_OS="OpenBSD"
62     ;;
63   *-freebsd* | *-kfreebsd*)
64     DEFAULT_FLASH_PLATFORM_ID="BSD"
65     DEFAULT_FLASH_SYSTEM_OS="FreeBSD"
66     ;;
67   *-netbsd*)
68     DEFAULT_FLASH_PLATFORM_ID="BSD"
69     DEFAULT_FLASH_SYSTEM_OS="NetBSD"
70     ;;
71   *-android*)
72     DEFAULT_FLASH_PLATFORM_ID="AND"
73     DEFAULT_FLASH_SYSTEM_OS="Linux"
74     ;;
75   *-linux-gnu)
76     DEFAULT_FLASH_PLATFORM_ID="LNX"
77     DEFAULT_FLASH_SYSTEM_OS="GNU/Linux"
78     ;;
79   *-linux*)
80     DEFAULT_FLASH_PLATFORM_ID="LNX"
81     DEFAULT_FLASH_SYSTEM_OS="Linux"
82     ;;
83   *-cygwin* | *-mingw* | *-pw32*)
84     DEFAULT_FLASH_PLATFORM_ID="WIN"
85     DEFAULT_FLASH_SYSTEM_OS="Windows"
86     ;;
87   *-*solaris*)
88     DEFAULT_FLASH_PLATFORM_ID="SUN"
89     DEFAULT_FLASH_SYSTEM_OS="Solaris"
90     ;;
91   *-os2*)
92     DEFAULT_FLASH_PLATFORM_ID="OS2"
93     DEFAULT_FLASH_SYSTEM_OS="OS/2"
94     ;;
95   *-sco*)
96     DEFAULT_FLASH_PLATFORM_ID="SCO"
97     DEFAULT_FLASH_SYSTEM_OS="SCO/Unix"
98     ;;
99   *-irix*)
100     DEFAULT_FLASH_PLATFORM_ID="IRX"
101     DEFAULT_FLASH_SYSTEM_OS="IRIX"
102     ;;
103   *-hpux*)
104     DEFAULT_FLASH_PLATFORM_ID="HPX"
105     DEFAULT_FLASH_SYSTEM_OS="HPUX"
106     ;;    
107   *-amigaos*)
108     DEFAULT_FLASH_PLATFORM_ID="OS4"
109     DEFAULT_FLASH_SYSTEM_OS="AmigaOS4"
110     ;;    
111   *-haiku*)
112     DEFAULT_FLASH_PLATFORM_ID="HAIKU"
113     DEFAULT_FLASH_SYSTEM_OS="Haiku"
114     ;;    
115   *-gnu*)
116     DEFAULT_FLASH_PLATFORM_ID="GNU"
117     DEFAULT_FLASH_SYSTEM_OS="GNU/HURD"
118     ;;    
119   *)
120     DEFAULT_FLASH_PLATFORM_ID="UNK"
121     DEFAULT_FLASH_SYSTEM_OS="Unknown"
122     ;;
123 esac
125 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_PLATFORM_ID], ["${DEFAULT_FLASH_PLATFORM_ID}"], [Default 3-letter platform identifier for version string])
126 AC_DEFINE_UNQUOTED([DEFAULT_FLASH_SYSTEM_OS], ["${DEFAULT_FLASH_SYSTEM_OS}"], [Default value for System.capabilities.os])
128 AC_SUBST(DEFAULT_FLASH_PLATFORM_ID)
129 AC_SUBST(DEFAULT_FLASH_SYSTEM_OS)
131 DEFAULT_STREAMS_TIMEOUT=60
132 AC_SUBST(DEFAULT_STREAMS_TIMEOUT)
133 AC_DEFINE_UNQUOTED([DEFAULT_STREAMS_TIMEOUT], [${DEFAULT_STREAMS_TIMEOUT}], [Default streams timeout in seconds])
135 DEFAULT_SOL_SAFEDIR="~/.gnash/SharedObjects"
136 AC_SUBST(DEFAULT_SOL_SAFEDIR)
137 AC_DEFINE_UNQUOTED([DEFAULT_SOL_SAFEDIR], ["${DEFAULT_SOL_SAFEDIR}"], [Default SharedObject base directory])
140 dnl Some things you can only do by looking at the platform name.
141 case "${host}" in
142   powerpc-apple-darwin*)
143     AC_DEFINE([__powerpc64__], [1], [this is a 64 bit powerpc])
144     darwin=yes
145     AC_DEFINE([DARWIN_HOST], [1], [this is a Darwin platform])
146     ;;
147   *-apple-darwin*)
148     darwin=yes
149     AC_DEFINE([DARWIN_HOST], [1], [this is a Darwin platform])
150     ;;
151     dnl Unfortunately, all BSD distributions are not identical, so 
152     dnl as tacky as it is to look for the distribution name, we don't
153     dnl have much choice. The use of these should be avoid as much as possible.
154   *-openbsd*)
155     bsd=yes
156     openbsd=yes
157     AC_DEFINE([OPENBSD_HOST], [1], [this is an OpenBSD platform])
158     ;;
159   *-freebsd* | *-kfreebsd*)
160     bsd=yes
161     freebsd=yes
162     AC_DEFINE([FREEBSD_HOST], [1], [this is a FreeBSD platform])
163     ;;
164   *-netbsd*)
165     bsd=yes
166     netbsd=yes
167     AC_DEFINE([NETBSD_HOST], [1], [this is a NetBSD platform])
168     ;;
169   *-*solaris*)
170     solaris=yes
171     AC_DEFINE([SOLARIS_HOST], [1], [this is a Solaris platform])
172     ;;
173   *-android*)
174     android=yes
175     AC_DEFINE([ANDROID_HOST], [1], [this is an Android platform])
176     ;;
177   *-*linux*)
178     linux=yes
179     AC_DEFINE([LINUX_HOST], [1], [this is a Linux platform])
180     ;;
181   *-cygwin* | *-mingw* | *-pw32*)
182     windows=yes
183     AC_DEFINE([WIN32_HOST], [1], [this is a Win32 platform])
184     ;;
185   *64-*-*bsd*)
186     bsd_os=bsd 
187     AC_DEFINE([WORDSIZE], [64], [this is a 64 platform])
188     ;;
189   *-*amigaos*)
190     amigaos4=yes
191     AC_DEFINE([AMIGAOS4_HOST], [1], [this is an AmigaOS4 platform])
192     ;;
193   *-*haiku*)
194     haiku=yes
195     AC_DEFINE([HAIKU_HOST], [1], [this is a Haiku platform])
196     ;;
197   *-gnu*)
198     gnu=yes
199     AC_DEFINE([GNU_HOST], [1], [this is a GNU platform])
200     ;;
201   *-*wince)
202     wince=yes
203     AC_DEFINE([WINCE_HOST], [1], [this is a WINCE platform])
204     ;;
205   *-*winmo)
206     wince=yes
207     AC_DEFINE([WINCE_HOST], [1], [this is a WINCE platform])
208     AC_DEFINE([WINCE6_HOST], [1], [this is a WINCE6 platform])
209     ;;
210 esac
213 AM_CONDITIONAL(LINUX, test x$linux = xyes)
214 AM_CONDITIONAL(WIN32, test x$windows = xyes)
215 AM_CONDITIONAL(HAIKU, test x$haiku = xyes)
216 AM_CONDITIONAL(AMIGAOS4, test x$amigaos4 = xyes)
218 dnl Get build date for helping us debugging
219 BUILDDATE="`date +%Y%m%d`"
220 AC_SUBST(BUILDDATE)
222 dnl These are required by automake
223 AM_INIT_AUTOMAKE
224 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
225 AM_MAINTAINER_MODE
226 AC_PROG_MAKE_SET
228 AM_GNU_GETTEXT([external])
229 AM_CONDITIONAL(HAS_GETTEXT, test x$ac_cv_path_XGETTEXT != x)
231 dnl Many of the Gnash macros depend on gettext macros defining shlibext; recent
232 dnl gettext however does not.
233 if test x"${shlibext}" = x; then
234   if test x"${acl_cv_shlibext}" = x; then
235     echo "Gettext macros were supposed to define shared library extensions"
236     exit 1;
237   else
238     shlibext="${acl_cv_shlibext}"
239   fi
242 dnl This is primarily used when compiling for a similar architecture,
243 dnl like pentium->geode, which can use the same compiler, but have
244 dnl different development libraries.
246 AC_ARG_WITH(sysroot,
247   AC_HELP_STRING([--with-sysroot], [system root directory for cross compiling]),
248   with_top_level=${withval};
249   cross_compiling=yes)
251 if test x"${cross_compiling}" = xyes; then
252   dnl Check if /usr isn't part of the specified path
253   if test -d ${with_top_level}/usr; then
254     with_top_level=${withval}/usr
255   else 
256     dnl Check if the specified path supplies /usr
257     if test -d ${with_top_level}/include; then
258       with_top_level=${withval}
259     else
260       AC_MSG_ERROR([Specified sysroot \"${with_top_level}/include\" doesn't exist!])
261     fi
262   fi
265 dnl Android is a little different when using a standard cross toolchain,
266 dnl so we have to configure especially for it for now. Usually it's
267 dnl something like this:
269 dnl arm-linux-eabi-gcc -Wl,--dynamic-linker -Wl,/system/bin/linker
270 dnl -nostdlib -Wl,-rpath -Wl,/system/lib -Wl,-rpath
271 dnl -Wl,/opt/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib
272 dnl -L/opt/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib
273 dnl -lc -o hello
274 dnl  /opt/android-ndk-r3/build/platforms/android-3/arch-arm/usr/lib/crtbegin_dynamic.o
275 dnl Recent versions of G++ (I'm using 4.5 from source
276 android_ndk=no
277 AC_ARG_WITH([android],
278   AC_HELP_STRING([--with-android], [directory where android NDK is installed]),
279         android_ndk=${withval}
280         if test x"${withval}" != x; then
281           android_ndk=${withval}
282         fi
284 CROSS_CXXFLAGS=
285 if test x"${android}" = xyes; then
286   CROSS_CXXFLAGS='-fexceptions -frtti -I${prefix}/include'
287   CROSS_LDFLAGS='-all-static -L${prefix}/lib'
288   if test x"${with_top_level}" = x; then
289     with_top_level=/usr/local/android-arm/sysroot/usr
290     cross_compiling=yes
291   fi
292   ANDROID_NDK=${android_ndk}
293   AC_DEFINE(ANDROID, [1], [This is an Android build])
294   CXXFLAGS="${CXXFLAGS} ${CROSS_CXXFLAGS}"
295 else
296   CROSS_CXXFLAGS=
297   ANDROID_NDK=
299 AC_SUBST(ANDROID_NDK)
300 AM_CONDITIONAL(ANDROID, [ test x"${android}" = xyes ])
301 AC_SUBST(CROSS_LDFLAGS)
302 AC_SUBST(CROSS_CXXFLAGS)
304 AC_C_BIGENDIAN
305 AC_C_CONST
306 AC_C_INLINE
308 AC_PATH_PROG(DEJAGNU, runtest)
310 dnl These options are for Cygnal, which collects optional statistics
311 dnl on all the network traffic By default, we turn on statistics
312 dnl collecting for the incoming and outgoing queues, since those are
313 dnl required to be compatiable with FMS 3, and the ActionScript server
314 dnl management API. buffers are the lowest level data storage, this
315 dnl data is the time spent in the queue, and is primarily only used
316 dnl for tuning the queueing API in Gnash. Memoryis the same, it's only
317 dnl used by developers for tuning performance of memory allocations in
318 dnl Gnash.
319 buffers=no
320 que=no
321 memory=no
322 cache=yes
323 stat_proplookup=no
324 AC_ARG_WITH(statistics,
325   AC_HELP_STRING([--with-statistics], [Specify which statistics features to enable]),
326   if test -n ${withval}; then
327     if test "x${withval}" != "xno"; then
328       extlist="${withval}"
329       withval=`echo ${withval} | tr '\054' ' ' `
330     else
331       extlist=""
332       withval=""
333     fi
334   fi
335   statistics_list=""
336   nstatistics=0
337   while test -n "${withval}" ; do
338     val=`echo ${withval} | cut -d ' ' -f 1`
339     [case "${val}" in
340       buffers)
341         buffers=yes
342         nstatistics=$((nstatistics+1))
343         ;;
344       que)
345         que=yes
346         nstatistics=$((nstatistics+1))
347         ;;
348       memory)
349         memory=yes
350         nstatistics=$((nstatistics+1))
351         ;;
352       cache)
353         cache=yes
354         nstatistics=$((nstatistics+1))
355         ;;
356       proplookup)
357         stat_proplookup=yes
358         nstatistics=$((nstatistics+1))
359         ;;
360       all|ALL)
361         buffers=yes
362         memory=yes
363         queu=yes
364         cache=yes
365         stat_proplookup=yes
366         nstatistics=5           dnl this must be incremented if you add anything
367         ;;
368       *) AC_MSG_ERROR([invalid statistics feature specified: ${withval} given (accept: buffers|que|memory|cache|proplookup|all)])
369         ;;
370       esac]
371     withval=`echo ${withval} | cut -d ' ' -f 2-6`
372     if test "x$val" = "x$withval"; then
373       break;
374     fi
375   done
377 if test x${buffers} = xyes; then
378   statistics_list="${statistics_list} buffers"
379   AC_DEFINE(USE_STATS_BUFFERS, [1], [Support statistics collecting for the queue buffers])
380   AC_MSG_WARN([This option will effect your performance])
383 if test x${memory} = xyes; then
384   statistics_list="${statistics_list} memory"
385   AC_DEFINE(USE_STATS_MEMORY, [1], [Support statistics collecting for all memory profiling])
386   AC_MSG_WARN([This option will effect your performance])
389 if test x${que} = xyes; then
390   statistics_list="${statistics_list} queues"
391   AC_DEFINE(USE_STATS_QUEUE, [1], [Support statistics collecting for the queues])
394 if test x${cache} = xyes; then
395   statistics_list="${statistics_list} cache"
396   AC_DEFINE(USE_STATS_CACHE, [1], [Support statistics collecting for the cache])
399 if test x${stat_proplookup} = xyes; then
400   statistics_list="${statistics_list} proplookup"
401   AC_DEFINE(GNASH_STATS_OBJECT_URI_NOCASE, [1], [Collecting and report stats about ObjectURI case lookups])
402   AC_DEFINE(GNASH_STATS_PROPERTY_LOOKUPS, [1], [Collecting and report stats about property lookups])
403   AC_DEFINE(GNASH_STATS_STRING_TABLE_NOCASE, [1], [Collecting and report stats about string_table::key case lookups])
406 dnl this is just so Makefile can print the same list
407 STATISTICS_LIST="$statistics_list"
408 AC_SUBST(STATISTICS_LIST)
411 # These settings are compile time options for the security
412 # setting for anything that lets gnash exchange data with
413 # other applications. Currently this only supports Shared
414 # Objects and Local Connections. Shared Objects are like
415 # your web browsers cookies, and Local Connections use
416 # shared memory to execute methods remotely, and to
417 # exchange data.
419 # The default is to enable everything, and these can
420 # also be controlled dynamically by the $HOME/.gnashrc
421 # file.
423 solreadonly=no
424 localconnection=yes
426 AC_ARG_WITH(security,
427   AC_HELP_STRING([--with-security], [Specify which security features to enable]),
428   if test -n ${withval}; then
429     if test "x${withval}" != "xno"; then
430       extlist="${withval}"
431       withval=`echo ${withval} | tr '\054' ' ' `
432     else
433       extlist=""
434       withval=""
435     fi
436   fi
437   security_list=""
438   nsecurity=0
439   while test -n "${withval}" ; do
440     val=`echo ${withval} | cut -d ' ' -f 1`
441     [case "${val}" in
442       solreadonly)
443         solreadonly=yes
444         nsecurity=$((nsecurity+1))
445         ;;
446       lc)
447         localconnection=yes
448         nsecurity=$((nsecurity+1))
449         ;;
450       all|ALL)
451         solreadonly=yes
452         lc=yes
453         nsecurity=3
454         ;;
455       *) AC_MSG_ERROR([invalid security feature specified: ${withval} given (accept: solreadonly|lc)])
456         ;;
457       esac]
458     withval=`echo ${withval} | cut -d ' ' -f 2-6`
459     if test "x$val" = "x$withval"; then
460       break;
461     fi
462   done
465 if test x$localconnection = xyes; then
466   security_list="${security_list} localconnection"
467   AC_DEFINE(USE_LC, [1],
468                  [Support LocalConnection])
469   AC_MSG_NOTICE([This build supports LocalConnection])
471 if test x$solreadonly = xyes; then
472   security_list="${security_list} solreadonly"
473   AC_DEFINE(USE_SOL_READONLY, [1],
474                  [Shared Objects are read-only])
475   AC_MSG_NOTICE([Shared Objects are read-only])
477 SECURITY_LIST="$security_list"
478 AC_SUBST(SECURITY_LIST)
480 dnl For Haiku, we know the sysroot is in a non-standard place
481 dnl it is important that -lagg comes before -lbe
482 if test x"${haiku}" = xyes; then
483   HAIKU_LIBS=-lbe
484   AC_SUBST(HAIKU_LIBS)
487 dnl Darwin uses libtool instead of ar to produce libraries. We determine which one
488 dnl we have here now. For some reason on Darwin, we don't get the
489 dnl count from grep via stdin correctly. Writing a temp file does the
490 dnl trick, so although it's ugly, that's what we gotta do...
491 AC_MSG_CHECKING([which type of library archiver we have])
492 rm -f .tmp
493 libtool > .tmp 2>&1
494 archiver=`grep -c dynamic .tmp 2>&1`
495 rm -f .tmp
496 dnl is there any good way to report what we found here?
497 AC_MSG_RESULT()
498 if test x"${archiver}" != x && test "${archiver}" -eq 1; then
499    export MACOSX_DEPLOYMENT_TARGET="10.3"
500    darwin=yes
501 else
502    darwin=no
505 dnl When cross compiling, limit the search directories cause otherwise
506 dnl we may get the host headers or libraries by accident. These values
507 dnl are exported, so all the other configure tests in macros/*.m4 use
508 dnl these same settings rather than duplicating them like we used to.
509 dnl To override thise, use the --with-*-incl= and --with-*-libs=
510 dnl options to configure.
511 if test x$cross_compiling = xyes; then
512   AC_MSG_NOTICE([Configuring Gnash for cross compilation])
513   export pkgroot="`$CXX -print-search-dirs | grep "install:" | sed -e 's/install: //' -e 's:/lib/gcc/.*::'`"
514   dnl pkgroot only works correctly with builds of cross tools not in
515   dnl /usr, ie... installed from the distribution packages, or just
516   dnl plain installed in the system tools. This contaminates configure
517   dnl when building for variations of the same basic architecture,
518   dnl like i686-linux -> i586-mingw32.
519   if test x"${pkgroot}" = x"/usr"; then
520     export pkgroot=""
521   fi
522   export incllist="`eval echo ${with_top_level}/include ${pkgroot}/${host_alias}/include ${pkgroot}/include`"
523   export libslist="`eval echo ${with_top_level}/lib ${pkgroot}/${host_alias}/lib ${pkgroot}/lib64 ${pkgroot}/lib32 ${pkgroot}/lib`"
524   export pathlist="`eval echo ${pkgroot}/${host_alias}/bin:${pkgroot}/bin`"
525   npapi=no
526 else
527   AC_MSG_NOTICE([Configuring Gnash for native compilation])
528   export incllist="`eval cat ${srcdir}/macros/incllist`"
529   libslist="`cat ${srcdir}/macros/libslist`"
530   if test -f /usr/bin/dpkg-architecture; then
531     export DEB_HOST_MULTIARCH="`eval dpkg-architecture -qDEB_HOST_MULTIARCH`"
532     export libslist="${libslist} /lib/${DEB_HOST_MULTIARCH} /usr/lib/${DEB_HOST_MULTIARCH}"
533   fi
534   export pathlist=$PATH
537 if test x"${android_ndk}" != xno; then
538    incllist="${android_ndk}/include ${incllist}"
541 AM_CONDITIONAL(CROSS_COMPILING, [ test x$cross_compiling = xyes ])
543 for dir in ${incllist}; do
544   test -d ${dir} && pruned_incllist="${pruned_incllist} ${dir}";
545 done
547 for dir in ${libslist}; do
548   test -d ${dir} && pruned_libslist="${pruned_libslist} ${dir}";
549 done
551 libslist="${pruned_libslist}";
552 incllist="${pruned_incllist}";
554 dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
555 dnl !! 
556 dnl !! IMPORTANT NOTICE 
557 dnl !!
558 dnl !!  Any call to GNASH_PATH_XXX must be be given *after* this snippet.
559 dnl !!  This is to ensure that PKG_CONFIG, cross_compiling and incllist are
560 dnl !!  properly set at the time of call.
561 dnl !!
562 dnl !!  Also GNASH_PKG_FIND has to be called later. Not sure
563 dnl !!  why but calling before breaks detection of CPP (see
564 dnl !!  gnash-dev mailing archives for June 12 2009
565 dnl !!  http://lists.gnu.org/archive/html/gnash-dev/2009-06/index.html
566 dnl !! 
567 dnl !! 
568 dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
570 dnl Check for PKG_CONFIG before any GNASH_PATH call
571 PKG_PROG_PKG_CONFIG
573 dnl --------------------------------------------------------
574 dnl  GUI selection
575 dnl --------------------------------------------------------
577 build_haiku=no
578 build_aos4=no      dnl AmigaOS4 GUI
579 build_kde3=no      dnl WARNING: doesn't work (see https://savannah.gnu.org/bugs/index.php?31782)
580 build_qt4=no
581 build_qtopia3=no
582 build_qtopia4=no
583 build_gtk=no
584 build_fb=no                     dnl Raw framebuffer
585 build_fltk=no
586 build_sdl=no
587 build_aqua=no                   dnl Native MacOSX
588 build_dump=no
589 AC_ARG_ENABLE(gui,
590   AC_HELP_STRING([--enable-gui], [Enable support for the specified GUI toolkits (default=gtk,qt4)]),
591   [if test -n ${enableval}; then
592     enableval=`echo ${enableval} | tr '\054' ' ' `
593   fi
594   while test -n "${enableval}" ; do
595     val=`echo ${enableval} | cut -d ' ' -f 1`
596     case "${val}" in
597       gtk|GTK|gtk2|GTK2)
598         build_gtk=yes
599         ;;
600       kde3|KDE3)
601         build_kde3=yes
602         ;;
603       qt4|QT4|kde4|KDE4)
604         build_qt4=yes
605         ;;
606       qtopia3|QTOPIA3)
607         build_qtopia3=yes
608         ;;
609       qtopia4|QTOPIA4)
610         build_qtopia4=yes
611         ;;
612       sdl|SDL)
613         build_sdl=yes
614         ;;
615       aqua|AQUA|Aqua)
616         build_aqua=yes
617         ;;
618       fltk|FLTK|fltk2|FLTK2)
619         build_fltk=yes
620         ;;
621       fb|FB)
622         build_fb=yes
623         ;;
624       aos4|AOS4)
625         build_aos4=yes
626         ;;
627       haiku|HAIKU)
628         build_haiku=yes
629         ;;
630       dump|DUMP)
631         build_dump=yes
632         ;;
633       all|ALL)
634         build_dump=yes
635         dnl BSD doesn't have a framebuffer interface
636         if test x${linux} = xyes; then
637           build_fb=yes
638         fi
639         if test x${openbsd} != xyes; then
640           build_qt4=yes
641         fi
642         build_sdl=yes
643         build_gtk=yes
644         ;;
645       *) AC_MSG_ERROR([invalid gui ${enableval} given (accept: gtk|kde3|qt4|fltk|sdl|aqua|fb|qtopia3|qtopia4|dump|aos4|haiku)])
646          ;;
647       esac
648     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
649     if test "x$val" = "x$enableval"; then
650       break;
651     fi
652   done],
653   [ dnl Run the following code if no --enable-gui is given
654   build_fb=auto
655   build_sdl=auto
656   if test x"${openbsd}" = xyes; then
657     build_gtk=yes
658     build_dump=auto
659   else if test x"${haiku}" = xyes; then
660     build_haiku=yes;
661   else
662     build_qt4=auto
663     build_gtk=yes
664     build_dump=auto
665   fi
666   fi
667   ]
670 if test x"${build_haiku}" = xyes; then
671   if test x"$haiku" != xyes; then
672     echo "        ERROR: Can not build Haiku gui outside of Haiku
673 operating system." >&3
674   fi
677 dnl We can use Xephyr or fbe to create a fake framebuffer instead of real
678 dnl video memory. This lets us test on a desktop machine.
679 AC_ARG_WITH(fakefb,
680 AC_HELP_STRING([--with-fakefb],
681  [specify a file to be mapped instead of a real framebuffer]),
682  with_fakefb=${withval})
684 fakefb=
685 if test x"${with_fakefb}" = xyes; then
686   dnl This is the default file name fbe uses.
687   fakefb=/tmp/fbe_buffer
688 else
689   if test x"${with_fakefb}" != x; then
690     fakefb=${with_fakefb}
691   fi
693 FAKEFB=${fakefb}
694 AC_SUBST(FAKEFB)
696 if test x"${fakefb}" != x; then
697     AC_DEFINE(ENABLE_FAKE_FRAMEBUFFER, [1], [Enable using a file instead of a real framebuffer])
700 dnl This enable a small handful of tests that aren't designed to be
701 dnl run as part of "make check", as they are either incomplete, or
702 dnl can only be run interactively. These are all primarily oriented
703 dnl towards code development and debugging, instead of regression
704 dnl or unit testing.
705 AC_ARG_ENABLE(devtests, AC_HELP_STRING([--enable-devtests],
706   [Developer only tests, not to be included in make check]),
707 [case "${enableval}" in
708   yes) devtests=yes ;;
709   no)  devtests=no ;;
710   *)   AC_MSG_ERROR([bad value ${enableval} for enable-devtests option]) ;;
711 esac], devtests=no)
712 AM_CONDITIONAL(ENABLE_DEVELOPER_TESTS, [test x${devtests} = xyes])
714 dnl --------------------------------------------------------
715 dnl  Sound handler selection
716 dnl --------------------------------------------------------
717 add_sound=
718 build_sound_none=no
719 build_sound_sdl=no
720 build_sound_ahi=no
721 build_sound_mkit=no
722 AC_ARG_ENABLE(sound,
723   AC_HELP_STRING([--enable-sound=[[sdl|ahi|mkit]]], [Use the specified sound handler (default=sdl)]),
724      [case "${enableval}" in
725       sdl|SDL|Sdl)
726         build_sound_sdl=yes
727         add_sound="sdl"
728         ;;
729       none|NONE|None)
730         build_sound_none=yes
731         add_sound="none"
732         ;;
733       ahi|AHI|Ahi)
734         build_sound_ahi=yes
735         add_sound="ahi"
736         ;;
737       mkit|MKIT|Mkit)
738         build_sound_mkit=yes
739         add_sound="mkit"
740         ;;
741      esac],
742   [if test x"${haiku}" = xyes; then
743      build_sound_mkit=yes
744      add_sound="mkit"
745    else
746      if test x${build_sound_none} = xno; then
747        build_sound_sdl=yes
748        add_sound=sdl
749      fi
750    fi]
753 AM_CONDITIONAL(BUILD_LIBSOUND, test x${build_sound_none} != xyes)
754 if test x${build_sound_none} != xyes; then
755   AC_DEFINE(USE_SOUND, [1], [Build any sound code])
758 dnl --------------------------------------------------------
759 dnl  Media handler selection
760 dnl --------------------------------------------------------
761 build_media_gst=no
762 build_media_ffmpeg=auto
763 build_media_none=no
764 AC_ARG_ENABLE(media,
765   AC_HELP_STRING([--enable-media=handler],
766     [Enable media handling support using the specified handlers: ffmpeg gst none(no sound) (default=auto) ]),
767   
768     if test -n ${enableval}; then
769       enableval=`echo ${enableval} | tr '\054' ' ' `
770     fi
771     dnl When --enable-media is given, all media defaults to off
772     dnl except the explicitly enabled ones
773     build_media_ffmpeg=no
774     build_media_gst=no
775     while test -n "${enableval}"; do
776       val=`echo ${enableval} | cut -d ' ' -f 1`
777       [case "${val}" in
778         GST|gst)
779           build_media_gst=yes
780           media_list="${media_list}gst "
781           ;;
782         FFMPEG|ffmpeg)
783           build_media_ffmpeg=yes
784           media_list="${media_list}ffmpeg "
785           ;;
786         no|NO|none)
787           build_media_none=yes
788           media_list="none"
789           ;;
790         *)
791           AC_MSG_ERROR([bad value ${enableval} for --enable-media option])
792           ;;
793      
794       esac]
795       enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
796       if test "x$val" = "x$enableval"; then
797         break;
798       fi
799     done,
800     [if test x"${build_haiku}" = xyes; then
801         build_media_ffmpeg=yes
802         build_media_haiku=yes
803         media_list="ffmpeg haiku"
804      else
805         build_media_gst=yes
806         media_list="gst"
807     fi]
810 AM_CONDITIONAL(BUILD_LIBMEDIA, test x${build_media_none} != xyes)
811 if test x${build_media_none} != xyes; then
812   AC_DEFINE(USE_MEDIA, [1], [Build any media code])
815 dnl If no media is selected, and media handling isn't disabled, then enable gst
816 if test x${build_media_none} = xno -a x${build_media_gst} = xno -a x${build_media_ffmpeg} = xno; then
817   build_media_gst=yes
820 if test x"$build_media_ffmpeg" != x"no"; then # yes or auto
821   GNASH_PATH_FFMPEG
822   if test x"${build_media_ffmpeg}" = xauto; then
823     dnl TODO: have GNASH_PATH_FFMPEG set ${has_ffmpeg}
824     if test x"$FFMPEG_LIBS" != x; then
825       build_media_ffmpeg=yes
826       media_list="${media_list} ffmpeg"
827     else
828       build_ogl=no
829     fi
830   fi
833 MEDIA_CONFIG="${media_list}"
834 AC_SUBST(MEDIA_CONFIG)
836 dnl Multiple input devices are supported. These can all work in
837 dnl varying combinations, so several may be listed. These are only
838 dnl required when using the Framebuffer, as without the X11 desktop,
839 dnl Gnash has to handle all these internally. This can get
840 dnl messy, as one might want to use a touchscreen with a normal mouse
841 dnl or keyboard attached. 
842 dnl By default, don't build any of these, as they are only for the 
843 dnl Framebuffer running without X11.
844 if test x"${build_fb}" = xyes -a x"${linux}" = xyes; then
845   build_ps2mouse=no
846   build_ps2keyboard=yes
847   build_input_events=yes
848   build_tslib=yes
849   input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via Tslib"
850 else
851   build_ps2mouse=no
852   build_ps2keyboard=no
853   build_input_events=no
854   build_tslib=no
855   input_events=
857 AC_ARG_ENABLE(input,
858   AC_HELP_STRING([--enable-input], [Enable support for the specified input devices for the framebuffer GUI (default=ps2mouse|ps2keyboard|events|touchscreen)]),
859   [if test -n ${enableval}; then
860     enableval=`echo ${enableval} | tr '\054' ' ' `
861   fi
862   build_ps2mouse=no
863   build_ps2keyboard=no
864   build_input_events=no
865   build_tslib=no
866   while test -n "${enableval}" ; do
867     val=`echo ${enableval} | cut -d ' ' -f 1`
868     case "${val}" in
869       ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
870         build_ps2mouse=yes
871         input_events="${input_events}, PS/2 Mouse"
872         ;;
873       ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
874         build_ps2keyboard=yes
875         input_events="${input_events}, PS/2 Keyboard"
876         ;;
877       i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
878         input_events="${input_events}, Input Event Device"
879         build_input_events=yes
880         ;;
881       t*|T*) dnl use a touchscreen with tslib, which works like a mouse
882         build_tslib=yes
883         input_events="${input_events}, Touchscreen"
884         ;;
885       a*) dnl all
886         build_ps2mouse=yes
887         build_ps2keyboard=yes
888         build_tslib=yes
889         if test x"${linux}" = xyes; then
890           build_input_events=yes
891           input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via Tslib"                
892         else
893           build_input_events=no
894           input_events="PS/2 Mouse, PS/2 Keyboard, Touchscreen via Tslib"                
895         fi
896         ;;
897       *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: ps2mouse|keyboard|events,touchscreen)])
898          ;;
899       esac
900     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
901     if test "x$val" = "x$enableval"; then
902       break;
903     fi
904   done],
907 if test x$build_sdl != xno -o x$build_sound_sdl = xyes; then
908   GNASH_PATH_SDL
910 AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} = xyes])
913 dnl -----------------------------------------------------
914 dnl Check for SDL and decide about auto gui accordingly.
915 dnl Need be done after build_sound_sdl and build_sdl are
916 dnl initialized and before they are checked for yes/no
917 dnl -----------------------------------------------------
918 if test x"${build_sdl}" = xauto; then
919   if test xyes = x"${has_sdl}"; then
920     build_sdl=yes
921   else
922     AC_MSG_NOTICE([sdl GUI will not be built (no sdl development files found)])
923     build_sdl=no
924   fi
927 dnl -------------------------------
928 dnl Renderer Selection
929 dnl -------------------------------
930 input_events=
931 dnl By default, we want to to build all renderers
932 dnl DirectFB has both a device layer and a rendering layer, although
933 dnl currently the rendering part is incomplete. Configure support is
934 dnl included for development purposes.
935 build_directfb=no
936 dnl The OpenVG support works on both the desktop and embedded devices
937 dnl that don't run X11. It is supported by iPhone/iPad/Android
938 dnl devices, and the nouveau driver on the desktop.
939 build_ovg=no
940 dnl The OpenGLES1 renderer is a work in progress. It is originally
941 dnl based on a patch to Gnash 0.8.5, which of course not only didn't
942 dnl compile anymore, it was all hardcoded into the framebuffer
943 dnl code. This version compiles with the latest internal rendering
944 dnl API, and works properly with the glue code for the Gnash GUIs.
945 build_gles1=no
946 dnl OpenGL works, but suffers from performance and rendering quality
947 dnl problems. This should eventually be replacd by the OpenGLES1 and
948 dnl OpenVG renders.
949 build_ogl=no
950 dnl AGG is a software only renderer
951 build_agg=yes
952 build_cairo=yes
953 renderer_list="agg cairo"
954 AC_ARG_ENABLE(renderer,
955   AC_HELP_STRING([--enable-renderer], [Enable support for the specified renderers (agg|cairo|opengl|openvg|all, default=all)]),
956   if test -n ${enableval}; then
957     if test "x${enableval}" != "xno" -o "x${enableval}" != "xnone" ; then
958       renderer_list="none"
959       enableval=`echo ${enableval} | tr '\054' ' ' `
960     else
961       renderer_list=""
962       enableval=""
963     fi
964   fi
965   renderer_list=""
966   build_ovg=no
967   build_ogl=no
968   build_gles1=no
969   build_gles2=no
970   build_agg=no
971   build_cairo=no
972   while test -n "${enableval}" ; do
973     val=`echo ${enableval} | cut -d ' ' -f 1`
974     [case "${val}" in
975       no*|NO*)
976         renderer_list="none"
977         build_ovg=no
978         build_ogl=no
979         build_gles1=no
980         build_gles2=no
981         build_agg=no
982         build_cairo=no
983         ;;
984       all|ALL)
985         renderer_list="agg cairo opengl openvg, opengles1"
986         build_ogl=yes
987         build_agg=yes
988         build_cairo=yes
989         build_ovg=no
990         nrender=3
991         ;;
992       ogl|OGL|OpenGL|opengl)
993         renderer_list="${renderer_list} opengl"
994         build_ogl=yes
995         ;;
996       gles|GLES|gles1|GLES1)
997         renderer_list="${renderer_list} opengles1"
998         build_gles1=yes
999         build_ogl=no
1000         nrender=$((nrender+1))
1001         ;;
1002       ovg|OVG|OpenVG|openvg)
1003         renderer_list="${renderer_list} openvg"
1004         build_ovg=yes
1005         nrender=$((nrender+1))
1006         ;;
1007       directfb|dfb)
1008         renderer_list="${renderer_list} DirectFB"
1009         build_directfb=yes
1010         nrender=$((nrender+1))
1011         ;;
1012       agg|AGG)
1013         renderer_list="${renderer_list} agg"
1014         build_agg=yes
1015         ;;
1016       cairo|CAIRO|Cairo*)
1017         renderer_list="${renderer_list} cairo"
1018         build_cairo=yes
1019         ;;
1020       *) AC_MSG_ERROR([invalid renderer specified: ${enableval} given (accept:  (opengl|openvg|cairo|agg|all)])
1021         ;;
1022       esac]
1023     enableval=`echo ${enableval} | cut -d ' ' -f 2-`
1024     if test "x$val" = "x$enableval"; then
1025       break;
1026     fi
1027   done
1030 if test x"${build_ovg}" = xyes; then
1031   GNASH_PATH_OPENVG
1032   dnl If OpenVG isn't installed, disable it
1033   if test x"${has_openvg}" = xno; then
1034     AC_MSG_WARN([OpenVG specified but no development files found!])
1035     renderer_list=`echo ${renderer_list} | sed -e 's/ openvg//' `
1036     nrender=$((nrender-1))
1037   fi
1040 dnl VA API is used by default for all H.264 videos. HW requirements:
1041 dnl     * AMD GPUs with UVD2 and xvba-video VA driver
1042 dnl     * NVIDIA GPUs with vdpau-video VA driver
1043 dnl     * All HW with a VA driver supporting the VA/GLX extensions or
1044 dnl     vaPutSurface(Pixmap,...). This may include the Intel
1045 dnl     Moorestown platform and future G45 VA driver.
1046 dnl NOTE: it is possible to use Gnash/VAAPI on platforms with an Intel
1047 dnl GMA500 but you currently will have to build the AGG renderer
1048 dnl instead of the OGL (OpenGL) one. 
1049 build_vaapi_device=no
1050 build_openmax_device=no
1051 dnl These renders always require EGL support
1052 if test x${build_gles1} = xyes -o x${build_ovg} = xyes; then
1053   build_egl_device=yes
1054 else
1055   build_egl_device=no
1057 build_x11_device=no
1058 build_directfb_device=no
1059 if test x"${build_fb}" = xyes -o x"${build_fb}" = xauto; then
1060   build_fb_agg=yes
1062 dnl AGG support for the framebuffer requires the rawfb device
1063 if test x"${build_fb_agg}" = xyes -a x"${build_agg}" = xyes; then
1064   build_rawfb_device=yes
1065   device_list="RawFB"
1066   ndevice=1
1067 else
1068   build_rawfb_device=no
1069   device_list=""
1070   ndevice=0
1072 AC_ARG_ENABLE(device,
1073   AC_HELP_STRING([--enable-device], [Specify which hardware abstraction to use to support to enable (none,egl,directfb,rawfb,x11,vaapi)]),
1074   enableval=`echo ${enableval} | tr '\054' ' ' `
1075   build_egl_device=no
1076   build_rawfb_device=no
1077   device_list=""
1078   ndevice=0
1079   while test -n "${enableval}" ; do
1080     val=`echo ${enableval} | cut -d ' ' -f 1`
1081     [case "${val}" in
1082       no*|NO*)
1083         device_list="none"
1084         build_vaapi_device=no
1085         build_openmax_device=no
1086         build_egl_device=no
1087         build_directfb_device=no
1088         build_x11_device=no
1089         ndevice=0
1090         ;;
1091       va*|VA*)
1092         device_list="${device_list} VAAPI"
1093         build_vaapi_device=yes
1094         ndevice=$((ndevice+1))
1095         ;;
1096       eg*|EG*)
1097         device_list="${device_list} EGL"
1098         build_egl_device=yes
1099         ndevice=$((ndevice+1))
1100         ;;
1101       x1*|X1*)
1102         device_list="${device_list} X11"
1103         build_x11_device=yes
1104         ndevice=$((ndevice+1))
1105         ;;
1106       di*|Di*|DI*|dfb)
1107         device_list="${device_list} DirectFB"
1108         build_directfb_device=yes
1109         ndevice=$((ndevice+1))
1110         ;;
1111       ra*|RAW*)
1112         device_list="${device_list} RawFB"
1113         build_rawfb_device=yes
1114         ndevice=$((ndevice+1))
1115         ;;
1116       all|ALL)
1117         device_list="EGL RawFB X11"
1118         build_openmax_device=no
1119         build_vaapi_device=no
1120         build_egl_device=yes
1121         build_rawfb_device=yes
1122         build_directfb_device=no
1123         build_x11_device=yes
1124         ndevice=3
1125         ;;
1126       op*|Op*|OP*)
1127         device_list="${device_list} OpenMAX"
1128         build_openmax_device=yes
1129         ndevice=$((ndevice+1))
1130         ;;
1131       *) AC_MSG_ERROR([invalid device feature specified: ${enableval} given (accept: none,vaapi)])
1132         ;;
1133       esac]
1134     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1135     if test "x$val" = "x$enableval"; then
1136       break;
1137     fi
1138   done
1141 if test x"${have_ffmpeg_vaapi}" = x"yes" -a x"${build_vaapi_device}" = x"yes"; then
1142   use_libva=no
1143   use_libva_x11=no
1144   use_libva_glx=no
1145   dnl if the version of FFmpeg is recent enough, (r20957, 52.45.0), then
1146   dnl look for VAAPI support so we can use use the VAAPI enabled FFmpeg.
1147   if test x"${have_ffmpeg_vaapi}" = xyes; then
1148     use_libva=yes
1149     GNASH_PKG_FIND([libva],
1150       [va/va.h],
1151       [Video Acceleration API],
1152       vaInitialize
1153     )
1154     use_libva_x11=yes
1155     GNASH_PKG_FIND([libva_x11],
1156       [va/va_x11.h],
1157       [VA API (X11 display)],
1158       vaGetDisplay,
1159       [], [-lva-x11]
1160     )
1162     if test x$build_ogl = xyes; then
1163       use_libva_glx=yes
1164       GNASH_PKG_FIND([libva_glx],
1165         [va/va_glx.h],
1166         [VA API (GLX display)],
1167         vaGetDisplayGLX,
1168         [], [-lva-glx]
1169       )
1170     fi
1171   fi
1174 if test x"${build_fb_agg}" = xyes -a x"${build_rawfb_device}" = xno; then
1175   AC_MSG_ERROR([Framebuffer GUI requires the rawfb device.])
1178 dnl libVA drivers. We declare conditional for both the option being
1179 dnl selected, as well as whether or not it's found. This we can
1180 dnl generate better error handling if it's not found.
1181 AM_CONDITIONAL(USE_VAAPI, test x"${use_libva}" = xyes)
1183 dnl Until the hwaccel patches in FFmpeg wind up in the ffmpeg-plugin,
1184 dnl restrict using HW Accel to using FFmpeg directly.
1185 dnl test xyes = xyes -a ( x != xyes -o x != xyes )
1186 if test x"${build_vaapi}" = x"yes" -a x"${have_ffmpeg}" != x"yes"; then
1187   AC_MSG_ERROR(["Hardware acceleration currently not supported unless using FFmpeg."])
1190 AM_CONDITIONAL(HAVE_VAAPI, test x"${found_libva_incl}" = xyes)
1191 AM_CONDITIONAL(HAVE_VAAPI_GLX, test x"${found_libva_glx_incl}" = xyes)
1192 AM_CONDITIONAL(HAVE_VAAPI_X11, test x"${found_libva_x11_incl}" = xyes)
1194 if test x"${build_egl_device}" = xyes; then
1195   GNASH_PKG_FIND(EGL, [EGL/egl.h], [EGL library], eglGetDisplay)
1196   if test xyes = x"${has_EGL}"; then
1197     AC_DEFINE(BUILD_EGL_DEVICE, [ 1 ],
1198           [Build the EGL device for OpenVG, OpenGLES1&2, and X11/Mesa])
1199   else
1200     AC_MSG_WARN(["EGL requested but development package not found!"])
1201     build_egl_device=no
1202   fi
1203   save_CFLAGS="$CFLAGS"
1204   CFLAGS="$CFLAGS -Wall -Werror"
1205   native_window_type=none
1206   AC_MSG_CHECKING([For EGLNativeWindowType type])
1207   AC_TRY_COMPILE([#include <EGL/eglplatform.h>], [
1208     EGLNativeWindowType foo = 1;
1209     int bar = foo;
1210     bar++; ],
1211     native_window_type=int,
1212     native_window_type=void
1213   )
1214   CFLAGS="$save_CFLAGS"
1215   AC_MSG_RESULT([${native_window_type}])
1216   if test x"${native_window_type}" = x"int"; then
1217     AC_DEFINE([EGL_NATIVE_WINDOW_INT], [1], [EGLNativeWindowType type])
1218   fi
1221 if test ${ndevice} -eq 0; then
1222       device_list="none"
1223       ndevice=1
1226 AM_CONDITIONAL(BUILD_DEVICES, test ${ndevice} -gt 0)
1228 dnl 16 bit: RGB555, RGB565
1229 dnl 24 bit: RGB24, BGR24
1230 dnl 32 bit: RGBA32, BGRA32
1231 pixelformat=all
1232 AC_ARG_WITH(pixelformat,
1233   AC_HELP_STRING([--with-pixelformat=], [Use the specified pixel format for AGG (default=all)]),
1234   [if test -n ${withval}; then
1235     pixelformat="${withval}"
1236     withval=`echo ${withval} | tr '\054' ' ' `
1237   fi
1238   while test -n "${withval}" ; do
1239     val=`echo ${withval} | cut -d ' ' -f 1`
1240     case "${val}" in
1241       all)
1242         # allow special value "all" set by user (handled below)
1243         ;; 
1244       argb32|ARGB32)
1245         AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32])
1246         ;;
1247       abgr32|ABGR32)
1248         AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32])
1249         ;;
1250       bgra32|BGRA32)
1251         AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
1252         ;;
1253       bgr24|BGR24)
1254         AC_DEFINE(PIXELFORMAT_BGR24, [1], [BGR24])
1255         ;;
1256       rgba32|RGBA32)
1257         AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32])
1258         ;;
1259       rgb24|RGB24)
1260         AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24])
1261         ;;
1262       rgb555|RGB555)
1263         AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555])
1264         ;;
1265       rgb565|RGB565)
1266         AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565])
1267         ;;
1268       *) AC_MSG_ERROR([invalid pixel format ${withval} given (accept: all|RGB555|RGB565|RGB24|BGR24|BGRA32|RGBA32|ARGB32|ABGR32)])
1269          ;;
1270       esac
1271     withval=`echo ${withval} | cut -d ' ' -f 2-6`
1272     if test "x$val" = "x$withval"; then
1273       break;
1274     fi
1275   done],
1276   [if test x$build_haiku = xyes -a x$build_sdl != xyes; then
1277         AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
1278         pixelformat=BGRA32
1279    fi]
1282 if test x$pixelformat = xall; then
1283   if test x$build_agg = xyes; then
1284     ### The fact that we're building GTK doesn't mean we're not also
1285     ### building KDE or SDL, each needing its own pixel format !
1286     #if test x$build_gtk = xyes; then
1287     #  AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24 pixel format])
1288     #  pixelformat="RGB24"
1289     #else
1290       AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555 pixel format])
1291       AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565 pixel format])
1292       AC_DEFINE(PIXELFORMAT_RGB24,  [1], [RGB24 pixel format])
1293       AC_DEFINE(PIXELFORMAT_BGR24,  [1], [BGR24 pixel format])
1294       AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32 pixel format])
1295       AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32 pixel format])
1296       AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32 pixel format])
1297       AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32 pixel format])
1298     #fi
1299   fi
1302 if test x"${build_ogl}" != xno; then # yes or auto
1303   GNASH_PATH_OPENGL
1304   if test x"${build_ogl}" = xauto; then
1305     if test xyes = x"${has_opengl}"; then
1306       build_ogl=yes
1307       renderer_list="${renderer_list} opengl"
1308     else
1309       build_ogl=no
1310     fi
1311   fi
1314 AM_CONDITIONAL(BUILD_OVG_RENDERER,   [ test x${build_ovg} = xyes ])
1315 AM_CONDITIONAL(BUILD_GLES1_RENDERER, [ test x${build_gles1} = xyes ])
1316 AM_CONDITIONAL(BUILD_GLES2_RENDERER, [ test x${build_gles2} = xyes ])
1317 AM_CONDITIONAL(BUILD_OGL_RENDERER,   [ test x${build_ogl} = xyes])
1318 AM_CONDITIONAL(BUILD_AGG_RENDERER,   [ test x${build_agg} = xyes ])
1319 AM_CONDITIONAL(BUILD_CAIRO_RENDERER, [ test x${build_cairo} = xyes ])
1321 if test x"${has_openvg}" = xyes; then
1322    AC_DEFINE([RENDERER_OPENVG], [1], [Use OpenVG renderer])
1325 if test x"${build_ogl}" = xyes; then
1326    AC_DEFINE([RENDERER_OPENGL], [1], [Use OpenGL renderer])
1329 if test x"${build_agg}" = xyes; then
1330   AC_DEFINE([RENDERER_AGG], [1], [Use AntiGrain renderer])
1333 if test x"${build_cairo}" = xyes; then
1334   GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
1335   AC_DEFINE([RENDERER_CAIRO], [1], [Use cairo renderer])
1338 if test x"${build_agg}" = xyes; then
1339    GNASH_PATH_AGG
1342 AC_PATH_PROG(PERL, perl)
1343 AM_CONDITIONAL(HAVE_PERL, test x"$PERL" != x)
1345 AC_PATH_PROG(CSOUND, csound)
1346 AM_CONDITIONAL(HAVE_CSOUND, test x"$CSOUND" != x)
1348 AC_PATH_PROG(GIT, git)
1349 AC_SUBST(GIT)
1351 dnl --------------------------------------------------------
1352 dnl Extension selection
1353 dnl --------------------------------------------------------
1354 ext_dejagnu=no
1355 ext_mysql=no
1356 ext_fileio=no
1357 ext_gtk=no
1358 ext_lirc=no
1359 ext_dbus=no
1360 ext_all=no
1361 extensions_list=
1362 extensions_support=no
1363 nextensions=0
1364 AC_ARG_ENABLE(extensions,
1365   AC_HELP_STRING([--enable-extensions=], [Specify which extensions to build (default: none)])
1366 AC_HELP_STRING([--disable-extensions], [Disable support for extensions entirely]),
1367   if test -n ${enableval}; then
1368     if test "x${enableval}" != "xno"; then
1369       extlist="${enableval}"
1370       enableval=`echo ${enableval} | tr '\054' ' ' `
1371       extensions_support=yes
1372     else
1373       extlist=""
1374       enableval=""
1375     fi
1376   fi
1377   nextensions=0
1378   while test -n "${enableval}" ; do
1379     val=`echo ${enableval} | cut -d ' ' -f 1`
1380     extensions_list="${extensions_list} ${val}"
1381     [case "${val}" in
1382       dejagnu|DEJAGNU|dj|DJ)
1383         AC_DEFINE(USE_DEJAGNU_EXT, [1], [Build the DejaGnu extension])
1384         AC_MSG_NOTICE([Adding DejaGnu extension])
1385         ext_dejagnu=yes
1386         nextensions=$((nextensions+1))
1387         ;;
1388       mysql|MYSQL|sql|SQL)
1389         AC_DEFINE(USE_MYSQL_EXT, [1], [Build the MySQL extension])
1390         AC_MSG_NOTICE([Adding MySql extension])
1391         ext_mysql=yes
1392         nextensions=$((nextensions+1))
1393         ;;
1394       fileio|FILEIO|io|IO)
1395         AC_DEFINE(USE_FILEIO_EXT, [1], [Build the FileIO extension])
1396         AC_MSG_NOTICE([Adding FileIO extension])
1397         ext_fileio=yes
1398         nextensions=$((nextensions+1))
1399         ;;
1400       gtk|GTK|gtk2|GTK2)
1401         AC_DEFINE(USE_GTK_EXT, [1], [Build the GTK extension])
1402         ext_gtk=yes
1403         nextensions=$((nextensions+1))
1404         ;;
1405       lirc|LIRC)
1406         AC_DEFINE(USE_LIRC_EXT, [1], [Build the LIRC extension])
1407         ext_lirc=yes
1408         nextensions=$((nextensions+1))
1409         ;;
1410       dbus|DBUS)
1411         AC_DEFINE(USE_DBUS_EXT, [1], [Build the DBUS extension])
1412         ext_dbus=yes
1413         nextensions=$((nextensions+1))
1414         ;;
1415       all|ALL)
1416         AC_DEFINE(USE_GTK_EXT, [1], [Build all the extensions])
1417         ext_dejagnu=yes
1418         ext_mysql=yes
1419         ext_fileio=yes
1420         ext_gtk=yes
1421         ext_lirc=yes
1422         ext_dbus=yes
1423         ext_all=yes
1424         nextensions=9
1425         ;;
1426       *) AC_MSG_ERROR([invalid extension specified: ${enableval} given (accept: MYSQL|DEJAGNU|FILEIO|GTK|LIRC|DBUS|METOME|ALL)])
1427          ;;
1428       esac]
1429     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1430     if test "x$val" = "x$enableval"; then
1431       break;
1432     fi
1433   done
1434   EXTENSIONS_LIST="$extensions_list"
1435   AC_SUBST(EXTENSIONS_LIST)
1438 if test x$ext_dbus = xyes; then
1439   GNASH_PATH_DBUS
1442 if test x$ext_mysql = xyes; then
1443   GNASH_PATH_MYSQL
1446 AM_CONDITIONAL(BUILD_DEJAGNU_EXT, [ test x$ext_dejagnu = xyes ])
1447 AM_CONDITIONAL(BUILD_FILEIO_EXT, [ test x$ext_fileio = xyes ])
1448 AM_CONDITIONAL(BUILD_MYSQL_EXT, [ test x$ext_mysql = xyes ])
1449 AM_CONDITIONAL(BUILD_GTK_EXT, [ test x$ext_gtk = xyes ])
1450 AM_CONDITIONAL(BUILD_LIRC_EXT, [ test x$ext_lirc = xyes ])
1451 AM_CONDITIONAL(BUILD_DBUS_EXT, [ test x$ext_dbus = xyes ])
1452 AM_CONDITIONAL(BUILD_EXTENSIONS, [ test -n "$extensions_list"])
1454 dnl --------------------------------------------------------
1455 dnl Libtool
1456 dnl --------------------------------------------------------
1458 AC_LIBTOOL_DLOPEN
1459 AC_LIBTOOL_WIN32_DLL
1460 AC_DISABLE_STATIC
1461 AC_PROG_LIBTOOL
1462 AC_SUBST(LIBTOOL_DEPS)
1463 DLOPEN="-dlopen"
1464 DLPREOPEN="-dlpreopen"
1465 AC_SUBST(DLOPEN)
1466 AC_SUBST(DLPREOPEN)
1468 GNASH_PKG_FIND([ltdl], [ltdl.h], [libltdl library], [lt_dlinit])
1470 if test x"$has_ltdl" = x"yes";then
1471   AC_DEFINE(HAVE_LTDL, [1], [Libtool 2.x defines this, but libtool 1.5 does not])
1474 dnl --------------------------------------------------------
1475 dnl SOL dir
1476 dnl --------------------------------------------------------
1477 soldir=/tmp
1478 AC_ARG_WITH(soldir,
1479  AC_HELP_STRING([--with-soldir],
1480  [directory for .sol files]),
1481  with_soldir=${withval})
1482 if test x${with_soldir} != x; then
1483   soldir=${with_soldir}
1485 SOLDIR=${soldir}
1486 AC_SUBST(SOLDIR)
1488 dnl --------------------------------------------------------
1489 dnl AVM2
1490 dnl --------------------------------------------------------
1491 dnl AC_ARG_ENABLE(avm2,
1492 dnl   AC_HELP_STRING([--enable-avm2], [Enable support for AS3]),
1493 dnl   [case "${enableval}" in
1494 dnl     yes) avm2=yes ;;
1495 dnl     no)  avm2=no ;;
1496 dnl     *)   AC_MSG_ERROR([bad value ${enableval} for enable-avm2 option]) ;;
1497 dnl   esac], avm2=no
1498 dnl )
1499 dnl AM_CONDITIONAL(ENABLE_AVM2, [test x"$avm2" = xyes])
1500 dnl if test x$avm2 = xyes; then
1501 dnl     AC_DEFINE(ENABLE_AVM2, [1], [Enable AVM2 code])
1502 dnl fi
1503 AM_CONDITIONAL(ENABLE_AVM2, false)
1505 dnl This option is only used if you want Gnash to interwork with 
1506 dnl the Adobe player using the LocalConnection class.
1507 dnl lckey=0xdd3adabd
1508 AC_ARG_WITH(lckey,
1509  AC_HELP_STRING([--with-lckey],
1510  [shared memory key for your system]),
1511  with_lckey=${withval})
1513 if test x${with_lckey} != x; then
1514   lckey=${with_lckey}
1515 else
1516   lckey=0xcbc384f8
1518 LC_KEY=${lckey}
1519 AC_SUBST(LC_KEY)
1521 AC_ARG_ENABLE(python,
1522   AC_HELP_STRING([--enable-python],[Enable python for the python wrapper]),
1523 [case "${enableval}" in
1524   yes) python=yes ;;
1525   no)  python=no ;;
1526   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-python option]) ;;
1527 esac],python=no)
1529 dnl Look for python, which is optional. If enabled, a python loadable
1530 dnl module of Gnash is created.
1531 GNASH_PATH_PYTHON
1532 AM_CONDITIONAL([USE_PYTHON], test x"$python" = xyes)
1533 AM_CONDITIONAL([HAS_PYTHON], test x"$has_python" = xyes)
1535 dnl By default debug logging is enabled. For better performance, it can
1536 dnl be disabled, as when running as a plugin, nobody sees the debug messages
1537 dnl anyway. Debug logging is primarily for developers, so we can turn it off
1538 dnl for package builds.
1539 AC_ARG_ENABLE(log,
1540   AC_HELP_STRING([--enable-log],[Enable debug logging]),
1541 [case "${enableval}" in
1542   yes) debuglog=yes ;;
1543   no)  debuglog=no ;;
1544   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-log option]) ;;
1545 esac],debuglog=yes)
1547 if test x"${debuglog}" = x"yes"; then
1548   AC_DEFINE([DEBUG_LOGGING], [1], [Enable debug logging])
1551 # Maybe use jemalloc, which handles memory fragmentation for
1552 # ECAMscript languages better than the regular system malloc.
1553 # This seems like a good idea, as both the other player and
1554 # Mozilla/Firefox both recently switched to using jemalloc.
1555 AC_ARG_ENABLE(jemalloc,
1556   AC_HELP_STRING([--enable-jemalloc],[Enable jemalloc instead of system malloc])
1557 AC_HELP_STRING([--disable-jemalloc],[Disable jemalloc]),
1558 [case "${enableval}" in
1559   yes) jemalloc=yes ;;
1560   no)  jemalloc=no ;;
1561   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-jemalloc option]) ;;
1562 esac],jemalloc=yes)
1564 dnl We can search libs for mallinfo to decide whether we have it or not.
1565 dnl This is added to the linker flags when it's found. Usually it's -lc, but
1566 dnl on OpenSolaris it's -lmalloc, so this fixes the build.
1567 AC_SEARCH_LIBS([mallinfo], [c malloc],
1568                AC_DEFINE(HAVE_MALLINFO, [1], [Has mallinfo()])
1569                mallinfo=yes
1570                )
1572 AM_CONDITIONAL([HAVE_MALLINFO], test x$mallinfo = xyes)
1574 if test x"${jemalloc}" = x"yes"; then
1575   GNASH_PKG_FIND(jemalloc, [jemalloc.h], [jemalloc memory management], mallctl)
1578 AM_CONDITIONAL(JEMALLOC, test x"${has_jemalloc}" = xyes)
1580 AC_SEARCH_LIBS([getaddrinfo], [c])
1582 AC_ARG_ENABLE(fps-debug,
1583   AC_HELP_STRING([--enable-fps-debug],[Enable FPS debugging code]),
1584 [case "${enableval}" in
1585   yes) AC_DEFINE([GNASH_FPS_DEBUG], [1], [Enable FPS debugging code])
1586 esac])
1588 dnl IPC_INFO isn't portable, and doesn't exist on BSD
1589 AC_TRY_COMPILE([#include <sys/ipc.h> #include <sys/shm.h>], [
1590   int flag = IPC_INFO; ],
1591   AC_DEFINE([HAVE_IPC_INFO], [1], [Use ipc_info])
1594 dnl --------------------------------------------------------
1595 dnl Disable menus
1596 dnl --------------------------------------------------------
1597 dnl Don't add the GUI menu. Some educational systems think this adds
1598 dnl clutter and confusion, like on the OLPC.
1599 AC_ARG_ENABLE(menus,
1600   AC_HELP_STRING([--disable-menus],[Disable the GUI menus]),
1601 [case "${enableval}" in
1602   yes) menus=yes ;;
1603   no)  menus=no ;;
1604   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-menus option]) ;;
1605 esac],menus=yes)
1607 if test x"$menus" = x"yes"; then
1608   AC_DEFINE([USE_MENUS], [], [GUI Menu support])
1610 AM_CONDITIONAL(MENUS, test x$menus = xyes)
1612 dnl --------------------------------------------------------
1613 dnl Disable SWF information
1614 dnl --------------------------------------------------------
1615 dnl Don't gather SWF information in tree form. This takes
1616 dnl resources and memory that can be saved if there's no
1617 dnl need to examine SWF internals.
1618 AC_ARG_ENABLE(swftree,
1619   AC_HELP_STRING([--disable-swftree],[Disable showing SWF properties]),
1620 [case "${enableval}" in
1621   yes) swftree=yes ;;
1622   no)  swftree=no ;;
1623   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-swf-properties option]) ;;
1624 esac],swftree=yes)
1626 if test x"$swftree" = x"yes"; then
1627   AC_DEFINE([USE_SWFTREE], [], [View SWF information])
1629 AM_CONDITIONAL(SWFTREE, test x$swftree = xyes)
1631 dnl --------------------------------------------------------
1632 dnl Disable testsuite
1633 dnl --------------------------------------------------------
1634 dnl Disable running any tests for "make check". This may sound stupid, but
1635 dnl this option is designed to solely be used by maintainers in the 
1636 dnl DISTCHECK_CONFIGURE_FLAGS when building packages. Gnash's testing infrastructure
1637 dnl is complex, and often the the testsuites will work, but due to some obscure reason,
1638 dnl make distcheck fails.
1639 AC_ARG_ENABLE(testsuite,
1640   AC_HELP_STRING([--disable-testsuite],[Disable the testsuite, maintainers option only]),
1641 [case "${enableval}" in
1642   yes) testsuite=yes ;;
1643   no)  testsuite=no ;;
1644   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-testsuite option]) ;;
1645 esac],testsuite=yes)
1647 if test x"$testsuite" = x"yes"; then
1648   AC_DEFINE([USE_TESTSUITE], [], [Testsuite support, maintainers option only])
1650 AM_CONDITIONAL(TESTSUITE, test x$testsuite = xyes)
1652 dnl --------------------------------------------------------
1653 dnl Write the file to disk in the plugin
1654 dnl --------------------------------------------------------
1655 AC_ARG_ENABLE(write,
1656   AC_HELP_STRING([--enable-write], [Makes the Mozilla plugin write the currently playing SWF movie to /tmp.]),
1657 [case "${enableval}" in
1658   yes) write=yes ;;
1659   no)  write=no ;;
1660   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-write option]) ;;
1661 esac],write=no)
1663 if test x"$write" = x"yes"; then
1664   AC_DEFINE([WRITE_FILE], [], [Write files while streaming])
1667 dnl --------------------------------------------------------
1668 dnl Write a standalone gnash launcher to disk from the plugin
1669 dnl --------------------------------------------------------
1670 AC_ARG_ENABLE(sa-launcher,
1671   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.]),
1672 [case "${enableval}" in
1673   yes) sa_launcher=yes ;;
1674   no)  sa_launcher=no ;;
1675   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-sa-launcher option]) ;;
1676 esac],sa_launcher=yes)
1678 if test x"$sa_launcher" = x"yes"; then
1679   AC_DEFINE([CREATE_STANDALONE_GNASH_LAUNCHER], [], [Add support for writing a standalone executable launcher for movies embedded in web pages])
1682 dnl --------------------------------------------------------
1683 dnl Build the cygnal server if specified.
1684 dnl --------------------------------------------------------
1685 AC_ARG_ENABLE(cygnal,
1686   AC_HELP_STRING([--enable-cygnal], [Enable building of the Cygnal server]),
1687 [case "${enableval}" in
1688   yes) cygnal=yes
1689        extensions_support=yes ;;
1690   no)  cygnal=no ;;
1691   *)   AC_MSG_ERROR([bad value ${enableval} for enable-cygnal option]) ;;
1692 esac],cygnal=no)
1693 AM_CONDITIONAL(CYGNAL, test x$cygnal = xyes)
1695 if test x$extensions_support = xyes; then
1696     AC_DEFINE([USE_EXTENSIONS], [1], [Specify that extension support is enabled.])
1698 AM_CONDITIONAL(ENABLE_EXTENSIONS, [ test "x${extensions_support}" != "xno" ])
1700 dnl --------------------------------------------------------
1701 dnl Build the cgibins server if specified.
1702 dnl --------------------------------------------------------
1703 AC_ARG_ENABLE(cgibins,
1704   AC_HELP_STRING([--enable-cgibins], [Enable building of the CGIs for Cygnal]),
1705 [case "${enableval}" in
1706   yes) cgibin=yes ;;
1707   no)  cgibin=no ;;
1708   *)   AC_MSG_ERROR([bad value ${enableval} for enable-cgibins option]) ;;
1709 esac],cgibin=yes)
1710 AM_CONDITIONAL(USE_CGI, test x$cgibin = xyes)
1711 if test x"${cgibin}" = x"yes"; then
1712   AC_DEFINE([USE_CGIBIN], [1], [Enable cgi-bin processes for Cygnal])
1715 dnl --------------------------------------------------------
1716 dnl  Double buffer
1717 dnl --------------------------------------------------------
1718 dnl Add an option for double buffering when rendering, currently only used by
1719 dnl the frmaebuffer GUI.
1720 dnl If defined, an internal software-buffer is used for rendering and is then
1721 dnl copied to the video RAM. This avoids flicker and is faster for complex 
1722 dnl graphics, as video RAM access is usually slower. (strongly suggested)
1723 AC_ARG_ENABLE(doublebuf,
1724   AC_HELP_STRING([--disable-doublebuf], [Disble support for double buffering when rendering with AGG]),
1725   [case "${enableval}" in
1726     yes) doublebuf=yes ;;
1727     no)  doublebuf=no ;;
1728     *)   AC_MSG_ERROR([bad value ${enableval} for enable-doublebuf option]) ;;
1729   esac], doublebuf=yes
1731 AM_CONDITIONAL(ENABLE_DBUF, [test x"$doublebuf" = xyes])
1732 if test x$doublebuf = xyes; then
1733     AC_DEFINE(ENABLE_DOUBLE_BUFFERING, [1], [Disable double buffering for AGG])
1736 dnl --------------------------------------------------------
1737 dnl  Offscreen buffer
1738 dnl --------------------------------------------------------
1739 dnl This enables rendering to an offscreen buffer, instead of directly to window
1740 AC_ARG_ENABLE(offscreen,
1741   AC_HELP_STRING([--enable-offscreen], [Enable support for rendering offscreen]),
1742   [case "${enableval}" in
1743     yes) offscreen=yes ;;
1744     no)  offscreen=no ;;
1745     *)   AC_MSG_ERROR([bad value ${enableval} for enable-offscreen option]) ;;
1746   esac], offscreen=no
1750 dnl --------------------------------------------------------
1751 dnl  SSH support selection
1752 dnl --------------------------------------------------------
1753 dnl Enable using libssh with libnet
1754 AC_ARG_ENABLE(ssh,
1755   AC_HELP_STRING([--enable-ssh], [Enable using SSH for network authentication]),
1756 [case "${enableval}" in
1757   yes) build_ssh=yes ;;
1758   no)  build_ssh=no ;;
1759   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-ssh option]) ;;
1760 esac], build_ssh=no)
1762 AM_CONDITIONAL(BUILD_SSH, test x"${build_ssh}" = xyes)
1763 if test x"${build_ssh}" = xyes; then
1764   GNASH_PKG_FIND(ssh, [libssh/libssh.h], [libssh library], ssh_socket_init)
1765 dnl  GNASH_PKG_FIND(poppler, [popt.h], [Poppler library], poppler_init)
1767 if test x"${has_ssh}" = x"yes"; then
1768   AC_DEFINE([USE_SSH], [1], [Use SSH for authentication])
1771 dnl --------------------------------------------------------
1772 dnl  SSL support selection
1773 dnl --------------------------------------------------------
1775 dnl Enable using OpenSSL with libnet.
1776 AC_ARG_ENABLE(ssl,
1777   AC_HELP_STRING([--enable-ssl], [Enable using OpenSSL directly]),
1778 [case "${enableval}" in
1779   yes) build_ssl=yes ;;
1780   no)  build_ssl=no ;;
1781   *)   AC_MSG_ERROR([bad value ${enableval} for --enable-ssl option]) ;;
1782 esac], build_ssl=no)
1784 with_cert=
1785 with_pem=
1786 AM_CONDITIONAL(BUILD_SSL, test x"${build_ssl}" = xyes)
1787 AC_ARG_WITH(cert,
1788   AC_HELP_STRING([--with-cert],
1789   [cert file for SSL]),
1790   with_cert=${withval})
1791 AC_ARG_WITH(pem,
1792   AC_HELP_STRING([--with-pe],
1793   [pem file for SSL]),
1794   with_pem=${withval})
1796 if test x"${build_ssl}" = xyes; then
1797   GNASH_PKG_FIND(ssl, [openssl/ssl.h], [OpenSSL library], SSL_library_init)
1799 if test x"${has_ssl}" = x"yes"; then
1800   AC_DEFINE([USE_SSL], [1], [Use SSL for authentication])
1803 dnl -----------------------------------------------------------
1804 dnl Set the general plugins install policy here
1805 dnl (NOTE: before GNASH_PATH_FIREFOX and GNASH_PATH_KDE*)
1806 dnl -----------------------------------------------------------
1808 AC_ARG_WITH(plugins-install,
1809   AC_HELP_STRING([--with-plugins-install=system|user|prefix], [Policy for plugins install. Default: user.]),
1810         [case "${withval}" in
1811           user) PLUGINS_INSTALL_POLICY=user ;;
1812           system) PLUGINS_INSTALL_POLICY=system ;;
1813           prefix) PLUGINS_INSTALL_POLICY=prefix ;;
1814           *)  AC_MSG_ERROR([bad value ${withval} for --with-plugins-install]) ;;
1815          esac 
1816         ], PLUGINS_INSTALL_POLICY=user) 
1818 dnl -----------------------------------------------------------
1819 dnl   Verify dependencies for requested GUIs are met, and
1820 dnl   disable build of the GUIS for which deps are NOT met
1821 dnl ------------------------------------------------------------
1823 if test x$build_gtk = xyes; then
1824    GNASH_PATH_GTK2
1825    GNASH_PATH_PANGO
1826    GNASH_PKG_FIND(atk, [atk/atk.h], [atk library], atk_focus_tracker_init, [1.0])
1827    if test x"${build_ogl}" = xyes; then
1828       GNASH_PATH_GLEXT
1829    fi
1830    if test x"${build_cairo}" = xyes; then
1831       GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
1832    fi
1835 if test x"${build_qt4}" != xno; then
1836  GNASH_PATH_QT4
1839 if test x"${build_qt4}" = xauto; then
1840   if test x"${has_qt4}" = xyes; then
1841      build_qt4=yes
1842   else
1843      build_qt4=no
1844   fi
1847 if test x"${build_kde3}" != xno -o x"${build_qtopia3}" != xno; then
1848  GNASH_PATH_QT3
1851 if test x"${build_kde3}" != xno; then
1852   GNASH_PATH_KDE3
1856 if test x"${build_kde3}" = xauto; then
1857   if test x"${has_qt3}" = xyes -a x"${has_kde3}" = xyes; then
1858      build_kde3=yes
1859   else
1860      build_kde3=no
1861   fi
1864 dnl Check possibility to build DUMP gui, if requested
1865 if test x"${build_dump}" != xno; then
1866   if test x"${build_agg}" = xyes; then
1867     build_dump=yes
1868   else
1869     if test x"${build_dump}" = xyes; then
1870       dnl SHOULD we just check at the end of file instead ?
1871       AC_MSG_ERROR(dump GUI cannot be built without AGG renderer);
1872     fi
1873     build_dump=no
1874   fi
1877 dnl Check possibility to build FB gui, if requested
1878 dnl FB dependency is a linux system (linux/fb.h)
1879 if test x"${build_fb}" != xno; then
1880   if test x"${linux}" = xyes -o x"${android}" = xyes; then
1881       build_fb=yes
1882   else
1883     if test x"${build_fb}" = xyes; then
1884       dnl SHOULD we just check at the end of file instead ?
1885       AC_MSG_ERROR(framebuffer GUI cannot be built on non-linux platforms);
1886     fi
1887     AC_MSG_NOTICE([framebuffer GUI won't be built (non-linux platform)])
1888     build_fb=no
1889   fi
1892 dnl TODO: add checks for all other GUIs
1894 dnl -------------------------------
1895 dnl Input Device selection
1896 dnl -------------------------------
1898 dnl Multiple input devices are supported. These can all work in
1899 dnl varying combinations, so several may be listed. These are only
1900 dnl required when using the Framebuffer, as without the X11 desktop,
1901 dnl Gnash has to handle all these internally. This can get
1902 dnl messy, as one might want to use a touchscreen with a normal mouse
1903 dnl or keyboard attached. 
1904 dnl By default, don't build any of these, as they are only for the Framebuffer
1905 dnl running without X11.
1906 if test x"${build_fb}" = xyes; then
1907   build_ps2mouse=no
1908   build_ps2keyboard=yes
1909   build_input_events=yes
1910   build_tslib=yes
1911   input_events="Input Devices, Touchscreen via Tslib"
1912 else
1913   build_ps2mouse=no
1914   build_ps2keyboard=no
1915   build_input_events=no
1916   build_tslib=no
1917   input_events=
1919 AC_ARG_ENABLE(input,
1920   AC_HELP_STRING([--enable-input], [Enable support for the specified input devices for the framebuffer GUI (default=ps2mouse|ps2keyboard|events|touchscreen)]),
1921   [if test -n ${enableval}; then
1922     enableval=`echo ${enableval} | tr '\054' ' ' `
1923   fi
1924   while test -n "${enableval}" ; do
1925     val=`echo ${enableval} | cut -d ' ' -f 1`
1926     case "${val}" in
1927       ps2m*|PS2m*|m*|M*)        dnl a PS/2 style mouse
1928         build_ps2mouse=yes
1929         input_events="${input_events}, PS/2 Mouse"
1930         ;;
1931       ps2k*|PS2K*|k*|K*)        dnl a PS/2 style keyboard
1932         build_ps2keyboard=yes
1933         input_events="${input_events}, PS/2 Keyboard"
1934         ;;
1935       i*|I*|ev*|Ev*)    dnl use the new Input Event, which supports both
1936         input_events="${input_events}, Input Event Device"
1937         build_input_events=yes
1938         ;;
1939       t*|T*) dnl use a touchscreen with tslib, which works like a mouse
1940         build_tslib=yes
1941         input_events="${input_events}, Touchscreen"
1942         ;;
1943       *) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: ps2mouse|keyboard|events,touchscreen)])
1944          ;;
1945       esac
1946     enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
1947     if test "x$val" = "x$enableval"; then
1948       break;
1949     fi
1950   done],
1953 if test x"${build_tslib}" = xyes; then
1954   AC_DEFINE(USE_TSLIB, [1], [Use a tslib supported touchscreen])
1955   GNASH_PKG_FIND(ts, [tslib.h], [Touchscreen library], ts_config)
1957 AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} != xno])
1959 if test x"${build_ps2mouse}" = xyes; then
1960   AC_DEFINE(USE_MOUSE_PS2, [1], [Add support for a directly using a PS/2 Mouse])
1962 AM_CONDITIONAL(ENABLE_MOUSE, [test x"${build_ps2mouse}" = xyes])
1964 if test x"${build_ps2keyboard}" = xyes; then
1965   AC_DEFINE(USE_KEYBOARD_PS2, [1], [Add support for directly using a PS/2 Keyboard])
1967 if test x"${build_input_events}" = xyes; then
1968   AC_DEFINE(USE_INPUT_EVENTS, [1], [Add support for a directly using Linux Input Event Devices])
1970 AM_CONDITIONAL(ENABLE_INPUT_EVENTS, [test x"${build_input_events}" = xyes])
1971 dnl this is enabled if we have any input devices at all
1972 AM_CONDITIONAL(ENABLE_INPUT_DEVICES, [test x"${input_events}" != x])
1975 dnl -----------------------------------------------------------
1976 dnl Try to ignore stupid dependencies
1977 dnl -----------------------------------------------------------
1979 AC_MSG_CHECKING(linker --as-needed support)
1980 gcc_cv_ld_as_needed=no
1981 # Check if linker supports --as-needed and --no-as-needed options
1982 if $LD --help 2>/dev/null | grep as-needed > /dev/null; then
1983   gcc_cv_ld_as_needed=yes
1985 if test x"$gcc_cv_ld_as_needed" = xyes; then
1986   LDFLAGS="$LDFLAGS -Wl,--as-needed"
1988 AC_MSG_RESULT($gcc_cv_ld_as_needed)
1990 AC_DEFINE(USE_GIF, [1], [Use the GIF library])
1991 AC_DEFINE(USE_PNG, [1], [Use the PNG library])
1992 AM_CONDITIONAL(USE_GIF, true)
1993 AM_CONDITIONAL(USE_PNG, true)
1995 AC_PATH_TOOL([AUTOTRACE], [autotrace])
1996 AC_HEADER_DIRENT
1998 dnl -----------------------------------------------------------------
1999 dnl PLUGIN RELATED STUFF
2000 dnl -----------------------------------------------------------------
2002 dnl !! This has been moved here to make --enable-npapi work
2003 dnl !! All of plugin-related macro calls could be moved into
2004 dnl !! a specialized macros/plugin.m4
2006 dnl ----------------------------------------------------
2007 dnl Add KPARTS support, if specified or KDE gui is built
2008 dnl ----------------------------------------------------
2010 AC_ARG_ENABLE(kparts3,
2011   AC_HELP_STRING([--disable-kparts3], [Disable support for Konqueror 3.x plugin (default: enabled if kde3 gui is)]),
2012 [case "${enableval}" in
2013   yes) build_kparts3=yes ;;
2014   no)  build_kparts3=no ;;
2015   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-kparts3 option]) ;;
2016 esac],build_kparts3=$build_kde3)
2018 dnl --------------------------------------------------------
2019 dnl Add KPARTS 4.x support, if specified or KDE gui is built
2020 dnl --------------------------------------------------------
2022 AC_ARG_ENABLE(kparts4,
2023   AC_HELP_STRING([--disable-kparts4], [Disable support for Konqueror 4.x plugin (default: enabled if Qt4 gui is)]),
2024 [case "${enableval}" in
2025   yes) build_kparts4=yes ;;
2026   no)  build_kparts4=no ;;
2027   *)   AC_MSG_ERROR([bad value ${enableval} for --disable-kparts4 option]) ;;
2028 esac],build_kparts4=$build_qt4)
2030 if test x"${build_kparts4}" != xno; then
2031   GNASH_PATH_KDE4
2034 dnl -----------------------------------------------------------
2035 dnl Add NPAPI support, if specified or GTK or Qt4 gui is built
2036 dnl -----------------------------------------------------------
2038 AC_ARG_ENABLE(npapi,
2039   AC_HELP_STRING([--disable-npapi], [Disable NPAPI plugin build (default: enabled if gtk or Qt4 gui is)]),
2040   [case "${enableval}" in
2041     yes) npapi=yes ;;
2042     no)  npapi=no ;;
2043     *)   AC_MSG_ERROR([bad value ${enableval} for disable-npapi option]) ;;
2044   esac],
2045   if test x$build_gtk = xyes -o x$build_qt4 = xyes; then
2046     npapi=yes
2047   fi
2050 if test x"$npapi" = x"yes"; then
2051   GNASH_PATH_NPAPI
2054 dnl -----------------------------------------------------------------
2055 dnl Enable us to disable building all browser plugins in one command.
2056 dnl -----------------------------------------------------------------
2058 AC_ARG_ENABLE(plugins,
2059   AC_HELP_STRING([--disable-plugins], [Disable all browser plugins from building (default=no)]),
2060   [case "${enableval}" in
2061     yes) plugins=yes ;;
2062     no)  plugins=no ;;
2063     *)   AC_MSG_ERROR([bad value ${enableval} for disable-plugins option]) ;;
2064   esac],
2065   plugins=yes
2067 if test x$plugins = xno; then
2068   npapi=no
2069   build_kparts3=no
2070   build_kparts4=no
2074 GNASH_PATH_FIREFOX
2076 dnl 
2077 dnl New versions of the NPAPI require const for this prototype, which currently
2078 dnl seems to only be wit Ubuntu Oneiric.
2079 AC_MSG_CHECKING([for const needed for NPP_GetMIMEDescription() prototype])
2080 npapi_flags="`echo "${NPAPI_CFLAGS}" | sed -e 's/-I//' -e 's/-DXP_UNIX//' | tr -d ' '`/npapi.h"
2081 const_test="`grep NPP_GetMIMEDescription ${npapi_flags} | grep -c const`"
2082 if test ${const_test} -eq 1; then
2083   AC_DEFINE(NPAPI_CONST, [1], [Newer versions use const in prototypes])
2084   AC_MSG_RESULT([yes])
2085 else
2086   AC_MSG_RESULT([no])
2089 AC_TRY_COMPILE([#include <linux/input.h>], [
2090   struct input_absinfo abs;
2091   abs.resolution = 0;; ],
2092  AC_DEFINE([ABSINFO_RESOLUTION], [1], [ABS Resolution field])
2095 dnl -----------------------------------------------------------------
2096 dnl END OF PLUGIN RELATED STUFF
2097 dnl -----------------------------------------------------------------
2099 AM_CONDITIONAL(LIRC, [test x$lirc_ext = xyes])
2101 AC_CHECK_HEADERS(getopt.h)
2102 AC_CHECK_HEADERS(libgen.h)
2103 AC_CHECK_HEADERS(pwd.h)
2104 AC_CHECK_HEADERS(sys/utsname.h)
2105 AC_CHECK_HEADERS(signal.h)
2106 AC_CHECK_HEADERS(unistd.h)
2107 AC_CHECK_HEADERS(sys/time.h)
2108 AC_CHECK_HEADERS(linux/uinput.h, [uinput=yes], [uinput=no])
2109 AC_CHECK_LIB(bz2, BZ2_bzopen, [AC_SUBST(BZ2_LIBS, -lbz2)])
2110 AC_CHECK_LIB(c, getpwnam, AC_DEFINE(HAVE_GETPWNAM, 1, [Has getpwnam] ))
2112 AM_CONDITIONAL(HAS_UINPUT, [test x$uinput = xyes])
2114 dnl X11 is needed for fltk (at least),
2115 dnl and probably for many other guis too ...
2116 dnl if ! test x$build_fb = xyes; then # <--- this is wrong as build_x is non-exclusive
2117 dnl AC_PATH_XTRA
2118 dnl AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation)
2119 dnl AC_CHECK_LIB(gmp, _gmp_get_memory_functions)
2120 GNASH_PATH_X11
2121 dnl fi
2122 AM_CONDITIONAL(HAVE_X11, [test x${has_x11} = xyes])
2123 if test x${build_x11_device} = xyes -a  x${has_x11} = xyes; then
2124   AC_DEFINE(BUILD_X11_DEVICE, [1], [Build the X11 device])
2127 dnl See if ipc_perm structure has the ipc_perm.key field, and if so,
2128 dnl which variant of the name is used.
2129 ipc_key=no
2130 AC_TRY_COMPILE([
2131   #include <sys/ipc.h>
2132   #include <sys/shm.h>], [
2133  struct shmid_ds shmseg;      
2134  key_t x = shmseg.shm_perm.key;],
2135  ipc_key=yes
2136  AC_DEFINE(IPC_PERM_KEY, [key], [Has the key field in ipc_perm])
2139 if test x$ipc_key = xno; then
2140   AC_TRY_COMPILE([
2141     #include <sys/ipc.h>
2142     #include <sys/shm.h>], [
2143     struct shmid_ds shmseg;      
2144     key_t x = shmseg.shm_perm.__key;],
2145     AC_DEFINE(IPC_PERM_KEY, [__key], [Has the key field in ipc_perm])
2146     ipc_key=yes
2147   )
2150 dnl If sysv semaphores functs are stubs (e.g. on Hurd),
2151 dnl disable LocalConnection tests
2152 AC_CHECK_FUNCS(semget, semget=yes)
2153 AM_CONDITIONAL(HAVE_SEMGET, test x${semget} = xyes)
2155 AC_CACHE_CHECK([for finite], ac_cv_finite,
2156  [AC_TRY_COMPILE([
2157    #include <math.h>
2158    #ifdef HAVE_IEEEFP_H
2159    #include <ieeefp.h>
2160    #endif],
2161  [double x; int y; y = finite(x);],
2162  ac_cv_finite=yes,
2163  ac_cv_finite=no
2165 if test x"$ac_cv_finite" = x"yes"; then
2166   AC_SEARCH_LIBS(finite, m,
2167     [AC_DEFINE(HAVE_FINITE, [1], [Has finite])]
2168   )
2171 AC_LANG_PUSH(C++)
2172 AC_CACHE_CHECK([for isfinite], ac_cv_isfinite,
2173  [AC_TRY_COMPILE([#include <cmath>],
2174  [using namespace std; double x; int y; y = isfinite(x);],
2175  ac_cv_isfinite=yes,
2176  ac_cv_isfinite=no
2178 AC_LANG_POP(C++)
2179 if test x"$ac_cv_isfinite" = x"yes"; then
2180   dnl Don't give up if isfinite is not found in -lm
2181   dnl isfinite is defined as a macro in C99.
2182   AC_SEARCH_LIBS(isfinite, m)
2183   AC_DEFINE(HAVE_ISFINITE, [1], [Has isfinite])
2186 AC_LANG_PUSH(C++)
2187 AC_CACHE_CHECK([whether $CXX implements __PRETTY_FUNCTION__], ac_cv_implements___PRETTY_FUNCTION__, [
2188   AC_TRY_LINK([#include <cstdio>
2189 ], 
2190     [ std::printf("%s", __PRETTY_FUNCTION__); ], 
2191     [ ac_cv_implements___PRETTY_FUNCTION__="yes" ],
2192     [ ac_cv_implements___PRETTY_FUNCTION__="no" ]
2193   )
2195 if test "x$ac_cv_implements___PRETTY_FUNCTION__" = "xyes" ; then
2196   AC_DEFINE(HAVE_PRETTY_FUNCTION, [1], [__PRETTY_FUNCTION__ is defined])
2199 AC_CACHE_CHECK([whether $CXX implements __FUNCTION__], ac_cv_implements___FUNCTION__, [
2200   AC_TRY_LINK([#include <cstdio>
2201 ], 
2202     [ std::printf("%s", __FUNCTION__); ], 
2203     [ ac_cv_implements___FUNCTION__="yes" ],
2204     [ ac_cv_implements___FUNCTION__="no" ]
2205   )
2207 if test "x$ac_cv_implements___FUNCTION__" = "xyes" ; then
2208   AC_DEFINE(HAVE_FUNCTION, [1], [__FUNCTION__ is defined])
2211 AC_CACHE_CHECK([whether $CXX implements __func__], ac_cv_implements___func__, [
2212   AC_TRY_LINK([#include <cstdio>
2213 ], 
2214     [ std::printf("%s", __func__); ], 
2215     [ ac_cv_implements___func__="yes" ],
2216     [ ac_cv_implements___func__="no" ]
2217   )
2219 if test "x$ac_cv_implements___func__" = "xyes" ; then
2220   AC_DEFINE(HAVE_func, [1], [__func__ is defined])
2222 AC_LANG_POP(C++)
2223 AC_REPLACE_FUNCS(getopt)
2225 dnl Date portability stuff, used in server/asobj/Date.cpp
2226 AC_CHECK_FUNCS(gettimeofday)
2227 AC_CHECK_FUNCS(ftime)
2228 AC_CHECK_FUNCS(tzset)
2229 AC_CHECK_FUNCS(localtime_r)
2231 AC_CACHE_CHECK([whether struct tm has tm_gmtoff], ac_cv_tm_gmtoff, [
2232         AC_TRY_LINK([
2233 /* ctime(1) says "The glibc version of struct tm has additional fields
2234  * defined  when _BSD_SOURCE was set before including <time.h>"
2235  * In practice, you do not need to define it yourself (tested on glibc-2.2.1 
2236  * and 2.3.6) but if you *do* define it yourself, it makes *all* functions
2237  * favour BSD-like behaviour over of GNU/POSIX, which seems dangerous.
2238  */
2239 // #define _BSD_SOURCE 1
2240 #include <time.h>
2241 ], 
2242                 [ struct tm tm; long l = tm.tm_gmtoff; ], 
2243                 [ ac_cv_tm_gmtoff="yes" ],
2244                 [ ac_cv_tm_gmtoff="no" ]
2245         )
2247 if test "x$ac_cv_tm_gmtoff" = "xyes" ; then
2248         AC_DEFINE(HAVE_TM_GMTOFF, [1], [struct tm has member tm_gmtoff])
2251 AC_CACHE_CHECK([whether timezone is a long], ac_cv_long_timezone, [
2252         AC_TRY_LINK([
2253 /* On Linux/glibc, tzset(3) says "extern long timezone;" (seconds West of GMT)
2254  * but on BSD char *timezone(int,int) is a function returning a string name.
2255  * The BSD function timegm() may be the equivalent, but this should
2256  * not be necessary because on BSD the code should use tm.tm_gmtoff instead
2257  * (use of long timezone is a fallback strategy for when tm_gmtoff exists not).
2258  */
2259 #include <stdio.h>
2260 #include <time.h>
2261 extern long timezone;
2262   ], 
2263     [ printf("%ld", timezone); ], 
2264     [ ac_cv_long_timezone="yes" ],
2265     [ ac_cv_long_timezone="no" ]
2266    )
2268 if test "x$ac_cv_long_timezone" = "xyes" ; then
2269   AC_DEFINE(HAVE_LONG_TIMEZONE, [1], [extern timezone is a long integer, not a function])
2272 AC_CHECK_FUNCS(mkstemps)
2273 AC_CHECK_FUNCS(sysconf)
2274 AC_CHECK_FUNCS(shmget shmat shmdt mmap)
2275 AC_CHECK_FUNCS(scandir)         dnl supported by BSD and Linux, but you never know...
2276 AC_CHECK_LIB(rt, clock_gettime)
2277 AC_CHECK_FUNC(clock_gettime, AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Has clock_gettime()] ))
2278 dnl Look for Win32 networking stuff
2279 AC_CHECK_HEADERS(winsock.h)
2280 AC_CHECK_HEADERS(winsock2.h)
2282 GNASH_PKG_FIND(nspr, [nspr.h], [Netscape Portable Runtime (NSPR)], PR_Init)
2284 AC_PATH_TOOL(WINDRES, [windres])
2285 AC_SUBST(WINDRES)
2287 GNASH_PKG_FIND(z, [zlib.h], [zlib compression library], compress)
2288 GNASH_PKG_FIND(jpeg, [jpeglib.h], [jpeg images], jpeg_mem_init)
2289 GNASH_PKG_FIND(png, [png.h], [png images], png_info_init)
2290 GNASH_PKG_FIND(gif, [gif_lib.h], [gif images], DGifOpen)
2291 if test x"${GIF_LIBS}" = x ; then
2292  GNASH_PKG_FIND(ungif, [gif_lib.h], [gif images], DGifOpen)
2293  GIF_LIBS=${UNGIF_LIBS}
2294  GIF_CFLAGS=${UNGIF_CFLAGS}
2296 if test x"$testsuite" = x"yes"; then
2297   GNASH_PKG_INCLUDES([dejagnu], [dejagnu.h])
2300 GNASH_PKG_FIND(speex, [speex/speex.h], [speex audio codec], speex_decode_int)
2301 AM_CONDITIONAL(HAVE_SPEEX, [ test x$has_speex = xyes ])
2302 if test x$has_speex = xyes ; then
2303   AC_DEFINE([DECODING_SPEEX], [1], [Speex codec available])
2306 GNASH_PKG_FIND(speexdsp, [speex/speex_resampler.h], [speex DSP utilities], speex_resampler_process_int)
2307 if test x$has_speexdsp = xyes ; then
2308   AC_DEFINE([RESAMPLING_SPEEX], [1], [Speex resampler available])
2311 dnl Find freetype and fontconfig
2312 GNASH_PATH_FREETYPE2
2313 GNASH_PKG_FIND(fontconfig, [fontconfig/fontconfig.h], [fontconfig library], FcFontMatch)
2315 GNASH_PATH_CURL
2317 if test x$cross_compiling = xno; then
2318   AC_PATH_MING
2321 if test x"$MING_VERSION_CODE" = x; then
2322  MING_VERSION_CODE=0
2325 AM_CONDITIONAL(ENABLE_MING,
2326         [ test x"$MAKESWF" != x -a $MING_VERSION_CODE -gt 40000 ])
2328 AM_CONDITIONAL(MING_VERSION_0_4,
2329         [ test $MING_VERSION_CODE -ge 40000  ])
2330 AM_CONDITIONAL(MAKESWF_SUPPORTS_PREBUILT_CLIPS,
2331         [ test $MING_VERSION_CODE -ge 40002  ])
2332 AM_CONDITIONAL(MING_SUPPORTS_INIT_ACTIONS,
2333         [ test $MING_VERSION_CODE -ge 40004  ])
2334 AM_CONDITIONAL(MING_SUPPORTS_REPLACE_TAG,
2335         [ test $MING_VERSION_CODE -ge 40005 ])
2336 AM_CONDITIONAL(MING_SUPPORTS_SWFBUTTON_ADD_CHARACTER,
2337         [ test $MING_VERSION_CODE -ge 40005 ])
2338 AM_CONDITIONAL(MING_SUPPORTS_STREAMING_SOUND,
2339         [ test $MING_VERSION_CODE -ge 40006 ])
2340 AM_CONDITIONAL(MING_SUPPORTS_SWFBUTTON_SET_DEPTH,
2341         [ test $MING_VERSION_CODE -ge 40006 ])
2342 AM_CONDITIONAL(MING_VERSION_0_4_3,
2343         [ test $MING_VERSION_CODE -ge 40300 ])
2344 AM_CONDITIONAL(MING_VERSION_0_4_4,
2345         [ test $MING_VERSION_CODE -ge 40400 ])
2347 if test x$cross_compiling = xno; then
2348     AC_ARG_WITH([swfdec_testsuite],
2349         AC_HELP_STRING([--with-swfdec-testsuite],
2350             [directory where swfdec testsuite (the 'test' dir) is]),
2351         if test x"${withval}" = xyes; then
2352             dir=`dirname $0`
2353             dir=`cd ${dir} && pwd`
2354             withval="${dir}/testsuite/swfdec/src/test"
2355         fi
2356         SWFDEC_TESTSUITE=${withval}
2357     )
2358     AC_SUBST(SWFDEC_TESTSUITE)
2360 AM_CONDITIONAL(ENABLE_SWFDEC_TESTSUITE, [ test x"$SWFDEC_TESTSUITE" != x ])
2362 if test x$cross_compiling = xno; then
2363   AC_ARG_ENABLE([http_testsuite],
2364       AC_HELP_STRING([--enable-http-testsuite@<:@=URL@:>@],
2365           [Enable http based testsuite (default url is http://www.gnashdev.org/testcases)]),
2366           [case "${enableval}" in
2367              no) HTTP_TESTSUITE="" ;;
2368             yes) HTTP_TESTSUITE="http://www.gnashdev.org/testcases" ;;
2369               *) HTTP_TESTSUITE="${enableval}";;
2370            esac])
2371   AC_SUBST(HTTP_TESTSUITE)
2373 AM_CONDITIONAL(ENABLE_HTTP_TESTSUITE, [ test x"$HTTP_TESTSUITE" != x ])
2375 if test x$cross_compiling = xno; then
2376   AC_ARG_ENABLE([red5_testing],
2377       AC_HELP_STRING([--enable-red5-testing@<:@=HOST@:>@],
2378           [Enable red5 based testing (default host is www.gnashdev.org)]),
2379           [case "${enableval}" in
2380              no) RED5_HOST="" ;;
2381             yes) RED5_HOST="www.gnashdev.org" ;;
2382               *) RED5_HOST="${enableval}";;
2383            esac
2384                if test x"$RED5_HOST" != x -a x"$curl_rtmp_support" != x; then
2385                  RED5_TESTING=yes
2386              fi])
2387   AC_SUBST(RED5_HOST)
2389 AM_CONDITIONAL(ENABLE_RED5_TESTING, [ test x"$RED5_TESTING" != x ])
2391 if test x$cross_compiling = xno; then
2392   AC_ARG_ENABLE([rtmpy_testing],
2393       AC_HELP_STRING([--enable-rtmpy-testing@<:@=HOST@:>@],
2394           [Enable rtmpy based testing (default host is www.gnashdev.org)]),
2395           [case "${enableval}" in
2396              no) RTMPY_HOST="" ;;
2397             yes) RTMPY_HOST="www.gnashdev.org" ;;
2398               *) RTMPY_HOST="${enableval}";;
2399            esac])
2400   AC_SUBST(RTMPY_HOST)
2402 AM_CONDITIONAL(ENABLE_RTMPY_TESTING, [ test x"$RTMPY_HOST" != x ])
2404 dnl The name might differ between systems.
2405 if test x"$testsuite" = x"yes"; then
2406 AC_PATH_PROGS(NETCAT, [nc netcat])
2407 AC_PATH_PROG(WGET, wget)
2409 AM_CONDITIONAL(HAS_NETCAT, [ test x"$NETCAT" != x ])
2410 AM_CONDITIONAL(HAS_WGET, [ test x"$WGET" != x ])
2413 dnl See if we can use the swfmill, mtasc, swfc and haxe based testsuites 
2415 if test x"$testsuite" = x"yes" -a x$cross_compiling = xno; then
2416   AC_PATH_PROG(AS3COMPILE, as3compile)
2417   AC_PATH_PROG(SWFC, swfc)
2418   AC_PATH_SWFMILL
2419   AC_PATH_MTASC
2420   AC_PATH_HAXE
2423 AM_CONDITIONAL(ENABLE_SWFMILL, [ test x"$SWFMILL" != x ])
2424 AM_CONDITIONAL(SWFMILL_AS3_SUPPORT,
2425         [ test x"$SWFMILL" != x && test $SWFMILL_VERSION -ge 00021206 ])
2427 dnl SWFMILL versions older than 0.3 didn't get function2 flags order correctly
2428 AM_CONDITIONAL(SWFMILL_FUNCTION2_FLAGS_ORDER_CORRECT,
2429         [ test x"$SWFMILL" != x && test $SWFMILL_VERSION -ge 00021206 ])
2431 AM_CONDITIONAL(ENABLE_AS3COMPILE, [ test x"$AS3COMPILE" != x ])
2432 AM_CONDITIONAL(ENABLE_MTASC, [ test x"$MTASC" != x ])
2433 AM_CONDITIONAL(ENABLE_HAXE, [ test x"$HAXE" != x ])
2434 AM_CONDITIONAL(ENABLE_SWFC, [ test x"$SWFC" != x ])
2435 AM_CONDITIONAL(ENABLE_HAXE, [ test x"$HAXE" != x ])
2437 AC_PATH_PROG(DOXYGEN, doxygen)
2438 AM_CONDITIONAL(ENABLE_DOXYGEN, [ test x"$DOXYGEN" != x ])
2440 AM_CONDITIONAL(HAVE_KDE3,    [test x$has_kde3 = xyes])
2441 AM_CONDITIONAL(HAVE_KDE4,    [test x$has_kde4 = xyes])
2442 AM_CONDITIONAL(HAVE_QT3,     [test x$has_qt3 = xyes])
2443 AM_CONDITIONAL(HAVE_QT4,     [test x$has_qt4 = xyes])
2445 AM_CONDITIONAL([QT_X11],     [test "$platform" = "X11"])
2446 AM_CONDITIONAL([QTOPIA],     [test "$platform" = "Qtopia"])
2447 AM_CONDITIONAL([QT_OSX],     [test "$platform" = "OSX"])
2448 AM_CONDITIONAL([QT_OS9],     [test "$platform" = "OS9"])
2449 AM_CONDITIONAL([QT_WIN32],   [test "$platform" = "Win32"])
2451 dnl Need GLIB for both GTK and GST
2452 if test x"${build_gtk}" = xyes -o x"${build_media_gst}" = xyes; then
2453   GNASH_PATH_GLIB
2456 AM_CONDITIONAL(HAVE_GLIB, [ test x"${has_glib}" = xyes ])
2458 if test x$npapi = xyes; then
2459   if ! test x$build_gtk = xyes -o x$build_qt4 = xyes; then
2460     AC_MSG_WARN(["Enabled NPAPI plugin, but it's not supported by the selected GUI"])
2461   fi
2464 if test x$windows = xyes -a x$npapi = xyes; then
2465   if test "x$NSPR_CFLAGS" = x -a "x$NSPR_LIBS" = x; then
2466     AC_MSG_ERROR(["On Win32, NPAPI plugin requires NSPR."])
2467   fi
2468   if test "x$WINDRES" = x; then
2469     AC_MSG_ERROR(["On Win32, NPAPI plugin requires windres."])
2470   fi
2473 dnl Need GLIB for NPAPI plugin
2474 if test x$npapi = xyes; then
2475   GNASH_PATH_GLIB
2478 dnl if kde isn't installed, even if it's specified, don't try to build
2479 dnl the KPARTS plugin, which is KDE based.
2480 if test x$has_kde3 = xno -a x$build_kparts3 = xyes; then
2481   build_kparts3=no
2482   AC_MSG_WARN(["Disabling KPARTS 3.x plugin, no KDE development found"])
2485 if test x$build_kde3 = xno -a x$build_kparts3 = xyes; then
2486   AC_MSG_WARN(["Enabled KPARTS 3.x plugin, but you aren't building a KDE based GUI!"])
2488 if test x$has_kde4 = xno -a x$build_kparts4 = xyes; then
2489   build_kparts4=no
2490   AC_MSG_WARN(["Disabling KPARTS 4.x plugin, no KDE 4.x development found"])
2493 if test x$build_qt4 = xno -a x$kparts4 = xyes; then
2494   AC_MSG_WARN(["Enabled KPARTS 4.x plugin, but you aren't building a KDE 4.x based GUI!"])
2497 AM_CONDITIONAL(BUILD_QTOPIA3_GUI,  [ test x$build_qtopia3 = xyes ])
2498 AM_CONDITIONAL(BUILD_QTOPIA4_GUI,  [ test x$build_qtopia4 = xyes ])
2500 AM_CONDITIONAL(BUILD_KDE3_GUI,     [ test x$build_kde3 = xyes ])
2501 AM_CONDITIONAL(BUILD_QT4_GUI,     [ test x$build_qt4 = xyes ])
2503 AM_CONDITIONAL(BUILD_GTK_GUI,      [ test x$build_gtk = xyes ])
2504 AM_CONDITIONAL(BUILD_FLTK_GUI,     [ test x$build_fltk = xyes ])
2505 AM_CONDITIONAL(BUILD_SDL_GUI,      [ test x$build_sdl = xyes ])
2506 AM_CONDITIONAL(BUILD_FB_GUI,       [ test x$build_fb = xyes ])
2507 AM_CONDITIONAL(BUILD_AQUA_GUI,     [ test x$build_aqua = xyes ])
2508 AM_CONDITIONAL(BUILD_DUMP_GUI,     [ test x$build_dump = xyes ])
2509 AM_CONDITIONAL(BUILD_AMIGAOS4_GUI, [ test x$build_aos4 = xyes ])
2510 AM_CONDITIONAL(BUILD_HAIKU_GUI,    [ test x$build_haiku = xyes ])
2512 # plugin building flags
2513 AM_CONDITIONAL(NPAPI,   [test x"${npapi}" = xyes])
2514 AM_CONDITIONAL(KPARTS3, [test x"${build_kparts3}" = xyes])
2515 AM_CONDITIONAL(KPARTS4, [test x"${build_kparts4}" = xyes])
2517 if test x"${build_gles1}"; then
2518   GNASH_PATH_GLES
2521 dnl only Linux supports /dev/fb0
2522 if test x"${build_rawfb_device}" = xyes; then
2523    AC_DEFINE([BUILD_RAWFB_DEVICE], [1], [Use raw Framebuffer device support])
2526 if test x"${build_directfb_device}" = xyes; then
2527    GNASH_PKG_FIND(directfb, [directfb.h], [DirectFB render library], DirectFBCreate)
2528    AC_DEFINE([BUILD_DIRECTFB_DEVICE], [1], [Use DirectFB device support])
2531 AM_CONDITIONAL(BUILD_VAAPI_DEVICE, [test x"${use_libva}" = xyes])
2532 AM_CONDITIONAL(BUILD_EGL_DEVICE, [test x"${build_egl_device}" = xyes])
2533 AM_CONDITIONAL(BUILD_DIRECTFB_DEVICE, [ test x${build_directfb_device} = xyes])
2534 AM_CONDITIONAL(BUILD_RAWFB_DEVICE, [ test x${build_rawfb_device} = xyes])
2535 AM_CONDITIONAL(BUILD_X11_DEVICE, [test x${build_x11_device} = xyes])
2537 if test x"${build_gtk}" = xyes; then
2538   AC_ARG_ENABLE(ghelp,
2539     AC_HELP_STRING([--enable-ghelp], [Enable support for the GNOME help system]),
2540     [case "${enableval}" in
2541       yes) ghelp=yes ;;
2542       no)  ghelp=no ;;
2543       *)   AC_MSG_ERROR([bad value ${enableval} for enable-ghelp option]) ;;
2544     esac], ghelp=no
2545   )
2547   if test x"${ghelp}" = x"yes" ; then
2548     AC_PATH_PROG(SCROLLKEEPER, scrollkeeper-config, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2549     AC_PATH_PROG(SCROLLUPDATE, scrollkeeper-update, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2550     AC_PATH_PROG(SCROLLINSTALL, scrollkeeper-preinstall, [], [$PATH:/usr/bin/X11:/usr/local/bin/X11:/opt/X11])
2552     if test x"$SCROLLKEEPER" = x -o x"$SCROLLUPDATE" = x -o x"$SCROLLINSTALL" = x ; then
2553       ghelp=no
2554       AC_MSG_WARN([You need to install scrollkeeper for gnome help])
2555     fi
2556   fi
2558 AM_CONDITIONAL(GHELP, [test x${ghelp} = xyes])
2560 if test x${build_fltk} = xyes; then
2561   GNASH_PKG_FIND(Xft, [Xft.h], [xft library], XftGlyphRender)
2564 dnl Some systems have a pervered set of dependencies.
2565 dnl Fedora Core 6 appears to have a dependency on expat for fontconfig.
2566 dnl We only need the library, but this is the easy wind to find it.
2567 GNASH_PKG_FIND(expat, [expat.h], [Expat library], XML_ErrorString)
2569 dnl these conditionals were moved out of kde.m4
2570 AM_CONDITIONAL(HAS_KDE3, [test x$has_kde3 = xyes])
2571 # used to disable x11-specific stuff on special platforms
2572 AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
2573 AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
2574 AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
2576 AM_CONDITIONAL(HAVE_GLEXT, [test x$glext = xyes])
2578 dnl We don't have GTKGLExt, so default to SDL, and don't build the Firefox plugin
2579 if test x$glext = xno -a x$build_ogl = xyes; then
2580   if test x$gtk2 = xyes -a x$build_gtk = xyes; then
2581     AC_ERROR([You have GTK installed, but not GtkGLExt. You need GtkGLExt to use the OpenGL renderer. Attempting to build SDL version])
2582   fi
2583   gui=sdl
2584   npapi=no
2585   AC_MSG_WARN([GTK2 specified for the GUI, but GtkGlExt is not present. Trying SDL instead.])
2588 missing_codecs=""
2589 if test x"$build_media_gst" = "xyes"; then
2590   AC_PATH_PROG(GST_INSPECT, gst-inspect, ,[${pathlist}])
2591   if test "x$GST_INSPECT" != "x" -a x"${darwin}" = xno ; then
2592     AC_PATH_PROG(GST_INSPECT, gst-inspect-0.10, ,[${pathlist}])
2593   fi
2594   if test "x$GST_INSPECT" != "x" -a x"${darwin}" = xno ; then
2595     dnl FIXME: there may be multiple acceptable plugins that are acceptable for
2596     dnl our use. For example, mad or FFmpeg will play mp3.
2597     codecs="ffdec_flv ffdec_flashsv ffdec_vp6f ffdec_flashsv mad vorbisdec ffdec_vp6"
2598     for i in $codecs; do
2599        hits="`$GST_INSPECT $i | grep -c 'Long name'`"
2600        if test $hits -eq 0; then
2601          missing_codecs="$missing_codecs $i"
2602          AC_MSG_WARN([Missing codec: $i])
2603        fi
2604     done
2605   fi
2606   GNASH_PKG_FIND(gstreamer_plugins_base, [gst/interfaces/probeprobe.h], [gstreamer interfaces library], gst_property_probe_probe_and_get_values_name, [0.10])
2607   GNASH_PKG_FIND(gstreamer_app, [gst/app/gstappsink.h], [gstreamer app library], call_gmon_start, [0.10])
2608   GNASH_PKG_FIND(gstreamer, [gst/gst.h], [gstreamer library], gst_init, [0.10])
2609   dnl if cross compiling, we're usually not going to be able to pop up
2610   dnl the codec installer to download the package to install, so disable
2611   dnl it if cross compiling with gstreamer support.
2612   if test x$cross_compiling = xno; then
2613     GNASH_PKG_FIND(gstreamer_pbutils, [gst/pbutils/install-plugins.h], [gstreamer PB Utils library], gst_install_plugins_supported, [0.10])
2614   fi
2615   dnl when cross compiling Gstreamer, not all supplied SDKs include all the
2616   dnl development libraries since most devices don't need to support plugin
2617   dnl development, only the runtime. In these caes we often have the header
2618   dnl files but not the libraries.
2619   if test x"${has_gstreamer_plugins_base}" = xyes; then
2620     GSTREAMER_LIBS="-lgstinterfaces-0.10 $GSTREAMER_LIBS"
2621     AC_DEFINE(HAS_GSTREAMER_PLUGINS_BASE, [1], [Has the Gstreamer Plugin Dev package installed])
2622   fi
2625 AM_CONDITIONAL(HAVE_CAIRO, [true])
2626 AM_CONDITIONAL(HAVE_OPENGL, [true])
2628 AM_CONDITIONAL(USE_SOUND_SDL, test x$build_sound_sdl = xyes)
2629 AM_CONDITIONAL(USE_SOUND_AHI, test x$build_sound_ahi = xyes)
2630 AM_CONDITIONAL(USE_SOUND_MKIT, test x$build_sound_mkit = xyes)
2631 AM_CONDITIONAL(USE_FFMPEG_ENGINE, test x"${build_media_ffmpeg}" = x"yes")
2632 AM_CONDITIONAL(USE_GST_ENGINE, test x"${build_media_gst}" = x"yes")
2633 AM_CONDITIONAL(HAVE_OPENGL, test x"${OPENGL_LIBS}" != x)
2634 dnl for now the Haiku media handler is experimental
2635 AM_CONDITIONAL(USE_HAIKU_ENGINE, test x"$build_media_haiku" = xyes)
2637 if test x"${build_media_ffmpeg}" = x"yes"; then
2638   AC_DEFINE([ENABLE_FFMPEG_MEDIA],  [1], [Use FFmpeg for media decoding])
2641 if test x"${build_media_gst}" = x"yes"; then
2642   AC_DEFINE([ENABLE_GST_MEDIA],  [1], [Use gstreamer for media decoding])
2645 if test x"${build_media_haiku}" = x"yes"; then
2646   AC_DEFINE([ENABLE_HAIKU_MEDIA],  [1], [Use haiku for media decoding])
2649 if test x$build_sound_mkit = xyes; then
2650   if test x"${haiku}" != xyes; then
2651     AC_MSG_ERROR([Media Kit sound handling is supported only under Haiku]);
2652   else
2653     AC_DEFINE([SOUND_MKIT],  [1], [Use Haiku Media Kit for sound handling])
2654   fi
2657 if test x"${build_sound_sdl}" = xyes; then
2658   AC_DEFINE([SOUND_SDL],  [1], [Use SDL for sound handling])
2661 if test x"${build_sound_ahi}" = xyes; then
2662   if test x"$amigaos4" != xyes; then
2663     AC_MSG_ERROR([AHI sound handling is supported only under AmigaOS]);
2664   else
2665     AC_DEFINE([SOUND_AHI],  [1], [Use AmigaOS AHI for sound handling])
2666   fi
2669 if test x$build_fltk = xyes; then
2670   GNASH_PKG_FIND(fltk2, [fltk/FL_API.h], [Fast Light Toolkit], fl_window_flush)
2671   if test x"${has_fltk2}" = xyes; then
2672     AC_CHECK_LIB(Xi, XInput_find_display,
2673       [AC_SUBST(FLTK2_LIBS, "$FLTK2_LIBS -lXi")])
2674   fi
2677 AM_CONDITIONAL(HAVE_FLTK2, [ test x$has_fltk2 = xyes ])
2678 AM_CONDITIONAL(HAS_XFT, [ test x$has_xft = xyes ])
2680 GNASH_DOCBOOK
2681 AM_CONDITIONAL(ENABLE_INFO, test x${INSTALL_INFO} != x)
2682 AM_CONDITIONAL(DOCBOOK, test x$docbook = xyes)
2683 AM_CONDITIONAL(ENABLE_TEXI, [ test x"$DB2X_TEXI" != x -o x"$DB2X_TEXIXML" != x ])
2684 AM_CONDITIONAL(ENABLE_PDF, [ test x"$DB2X_PDF" ])
2685 AM_CONDITIONAL(ENABLE_HTML, [ test x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
2686 AM_CONDITIONAL(ENABLE_FOP, [ test x"$FOP" != x -a x"$docbook_styles" != x ])
2687 AM_CONDITIONAL(ENABLE_XMLTEX, [ test x"$PDFXMLTEX" != x -a x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
2688 AM_CONDITIONAL(ENABLE_MAN, [ test x"$DB2X_MAN" != x -o x"$DB2X_MANXML" != x ])
2689 AM_CONDITIONAL(HAVE_AGG, [test x"${AGG_LIBS}" != x])
2691 dnl Define winsock if we're on windows. We could do something complicated,
2692 dnl but since AC_EXEEXT does it for us, we'll do this the easy way.
2693 if test x"$EXEEXT" = "exe"; then
2694   AC_DEFINE(HAVE_WINSOCK,1,[This is defined is we are on Win32])
2697 dnl ****************************************
2698 dnl *** Check for ELF visibility support ***
2699 dnl ****************************************
2701 dnl Enable visibility by default, disabled if extensions are enabled
2702 AC_ARG_ENABLE([visibility],
2703   AC_HELP_STRING([--enable-visibility], [Use ELF visibility attributes])
2704 AC_HELP_STRING([--disable-visibility], [Disable ELF visibility]), [], [
2705     if test x"$extensions_support" != x"no"; then
2706       enable_visibility=no
2707     else
2708       enable_visibility=yes
2709     fi])
2711 if test x"$enable_visibility" != x"no"; then
2712   dnl Check whether the compiler supports the visibility attribute
2713   save_CFLAGS="$CFLAGS"
2714   CFLAGS="$CFLAGS -Wall -Werror"
2715   AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute])
2716   AC_COMPILE_IFELSE([AC_LANG_SOURCE(
2717     [
2718       void __attribute__ ((visibility("default"))) test_default (void) {}
2719       void __attribute__ ((visibility("hidden"))) test_hidden (void) {}
2720       int main (int argc, char **argv) { test_default (); test_hidden (); return 0; }
2721     ])],
2722     [
2723       AC_DEFINE([HAVE_GNUC_VISIBILITY], [1], [Define this for GCC-visibility.])
2724       AC_MSG_RESULT([yes])
2725     ],
2726     [
2727       AC_MSG_RESULT([no])
2728     ]
2729   )
2730   CFLAGS="$save_CFLAGS"
2733 AC_ARG_ENABLE([pch],
2734   AC_HELP_STRING([--enable-pch], [Enable precompiled header support]), [], [enable_pch=no])
2736 AM_CONDITIONAL([ENABLE_PCH], [test x"$enable_pch" != x"no"])
2738 PCH_FLAGS="-include all-includes.h -Winvalid-pch"
2739 AC_SUBST(PCH_FLAGS)
2741 GNASH_PATH_PTHREADS
2743 GNASH_PATH_BOOST
2745 AC_ARG_ENABLE([strict],
2746   AC_HELP_STRING([--enable-strict],[Accept only standards compliant code (GCC only)]),
2747   [case "${enableval}" in
2748     yes) strict=yes ;;
2749     no) strict=no ;;
2750     *) AC_MSG_ERROR([bad value ${enableval} for --enable-strict option]) ;;
2751   esac],
2752   [strict=no]
2755 if test x"$strict" = x"yes" -a x$build_agg = xyes; then
2756    AC_MSG_ERROR([agg renderer will fail with --enable-strict.]);        
2759 # We want warnings, lots of warnings  :-)
2760 # It should be possible to build with -ansi, not with
2761 # -pedantic because of agg.
2763 # -ansi was actually dropped because it hides 'fileno', which
2764 # is used in a few places
2766 if test x"$GCC" = x"yes"; then
2767   CXXFLAGS="$CXXFLAGS \
2768     $CROSS_CXXFLAGS \
2769     -W \
2770     -Wall \
2771     -Wcast-qual \
2772     -Wpointer-arith \
2773     -Wreturn-type \
2774     -Wnon-virtual-dtor \
2775     -Wunused \
2776     "
2777   CFLAGS="$CFLAGS \
2778     $CROSS_CXXFLAGS \
2779     -W \
2780     -Wall \
2781     -Wcast-align \
2782     -Wcast-qual \
2783     -Wpointer-arith \
2784     -Wreturn-type \
2785     -Wmissing-declarations \
2786     -Wmissing-prototypes \
2787     -Wstrict-prototypes \
2788     "
2789   if test x"$strict" = x"yes"; then
2790     CXXFLAGS="$CXXFLAGS \
2791       -Wextra \   
2792       -pedantic \
2793       -Wno-long-long \
2794       "
2796     CFLAGS="$CFLAGS \
2797       -pedantic \
2798       -Wno-long-long \
2799       -ansi \
2800       "
2801   fi
2804 AC_ARG_ENABLE([cassert],
2805   AC_HELP_STRING([--disable-cassert],[Disable assertion checking]),
2806   [case "${enableval}" in
2807     yes) cassert=yes ;;
2808     no) cassert=no ;;
2809     *) AC_MSG_ERROR([bad value ${enableval} for --enable-cassert option]) ;;
2810   esac],
2811   [cassert=yes]
2814 if test x"$cassert" = x"no"; then
2815     CXXFLAGS="$CXXFLAGS \
2816       -DNDEBUG \
2817       "
2818     CFLAGS="$CFLAGS \
2819       -DNDEBUG \
2820       "
2823 dnl /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
2824 AC_DEFUN([CHECK_VISIBILITY_GCC_BUG],
2825   [
2826     AC_CACHE_CHECK([if -fvisibility-inlines-hidden is broken], ac_cv_gcc_visibility_bug, [
2827         AC_LANG_PUSH(C++)
2828         save_CFLAGS=$CFLAGS
2829         save_CXXFLAGS=$CXXFLAGS
2830         save_LDFLAGS=$LDFLAGS
2831         CFLAGS="-fPIC -O0"
2832         CXXFLAGS="-fPIC -fvisibility-inlines-hidden -O0"
2833         LDFLAGS="$LDFLAGS -shared -fPIC"
2835         AC_TRY_LINK(
2836         [          
2837           template<typename CharT>
2838           struct VisTest
2839           {
2840             inline VisTest ();
2841           };
2842           template<typename CharT>
2843           inline VisTest<CharT>::VisTest()
2844         {}
2845         extern template class VisTest<char>;  // It works if we drop that line
2846         int some_function( int do_something ) __attribute__((visibility("default")));
2847         int some_function( int )
2848           {
2849             VisTest<char> a;
2850             return 0;
2851           }
2852         ], [],
2853         ac_cv_gcc_visibility_bug=no, ac_cv_gcc_visibility_bug=yes)
2855         CFLAGS=$save_CFLAGS
2856         CXXFLAGS=$save_CXXFLAGS
2857         LDFLAGS=$save_LDFLAGS
2858         AC_LANG_POP(C++)
2859       ]
2860     )
2861     if test x$ac_cv_gcc_visibility_bug = xno; then
2862       CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
2863     fi
2864   ]
2867 CHECK_VISIBILITY_GCC_BUG
2869 if test x$ac_cv_gcc_visibility_bug = xno; then
2870   AC_LANG_PUSH(C++)
2871   AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
2872   save_CXXFLAGS=$CXXFLAGS
2873   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
2874   AC_LINK_IFELSE([AC_LANG_PROGRAM()], 
2875                  [ac_cv_gcc_visibility=yes;
2876                   AC_MSG_RESULT([yes])],
2877                  [ac_cv_gcc_visibility=no;
2878                   AC_MSG_RESULT([no])]);
2879   CXXFLAGS="$save_CXXFLAGS"
2880   AC_LANG_POP(C++)
2884 AM_CONDITIONAL(VISIBILITY_WORKS, test x"$ac_cv_gcc_visibility" = xyes)
2886 if test x"$ac_cv_gcc_visibility" = xyes -a x"$enable_visibility" != xno; then
2887   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
2890 AC_ARG_ENABLE([harden],
2891   AC_HELP_STRING([--disable-harden],[Disable hardening]),
2892   [case "${enableval}" in
2893     yes) harden=yes ;;
2894     no)  harden=no ;;
2895     *) AC_MSG_ERROR([bad value ${enableval} for --enable-harden option]) ;;
2896   esac],
2897   [harden=yes]
2900 AC_DEFUN([ADD_HARDENING_FLAGS],[
2901    AX_APPEND_COMPILE_FLAGS([-fpie -fPIE -Wformat -Werror=format-security])
2903    AX_CHECK_COMPILE_FLAG([-fstack-protector-strong],
2904      [AX_APPEND_FLAG([-fstack-protector-strong])],
2905      [AX_APPEND_COMPILE_FLAGS(["-fstack-protector --param ssp-buffer-size=4"])])
2908 if test x"$harden" = x"yes"; then
2909   CPPFLAGS="${CPPFLAGS} -D_FORTIFY_SOURCE=2"
2911   ADD_HARDENING_FLAGS
2912   AC_LANG_PUSH(C++)
2913   ADD_HARDENING_FLAGS
2914   AC_LANG_POP(C++)
2916   AX_APPEND_LINK_FLAGS([-fPIE -pie -Wl,-z,relro -Wl,-z,now])
2919 dnl Define convenience constants so Gnash can print out the
2920 dnl default configuration of the build.
2921 RENDERER_CONFIG="${renderer_list}"
2922 RENDERER_LIBS=
2923 for rend in `echo "${add_renderer}" | tr ',' ' '`; do
2924         RENDERER_LIBS="${RENDERER_LIBS} \$(top_builddir)/librender/libgnash${rend}.la"
2925 done
2926 AC_SUBST(RENDERER_LIBS)
2927 AC_SUBST(RENDERER_CONFIG)
2929 HWACCEL_CONFIG="${device_list}"
2930 AC_SUBST(HWACCEL_CONFIG)
2932 dnl check for missing libraries and disable them.
2933 if test x"$BOOST_LIBS" != x; then
2934   if test x"${missing_cygnal_libs}" != x; then
2935     for i in ${missing_cygnal_libs}; do
2936       if test $i = serialization; then
2937         AC_DEFINE([BOOST_MULTI_INDEX_DISABLE_SERIALIZATION], ["1"], [if the library is missing, don't use it.])
2938       fi
2939     done
2940   fi
2943 dnl ========= Check for GConf
2945 AC_MSG_CHECKING([whether GConf support is requested])
2946 AC_ARG_WITH([gconf],
2947   [AS_HELP_STRING([--without-gconf],
2948           [Disable the use of gconf])],
2949   [],
2950   [case "${host}" in
2951     *-cygwin* | *-mingw* | *-pw32*) with_gconf=no ;;
2952     *) with_gconf=yes ;;
2953    esac])
2954 AC_MSG_RESULT([$with_gconf])
2956 AM_CONDITIONAL([WITH_GCONF],[test "$with_gconf" = "yes"])
2958 if test "$with_gconf" = "yes"; then
2959    PKG_CHECK_MODULES([GCONF],[gconf-2.0])
2960    AC_DEFINE([WITH_GCONF],[1],[Define if GConf support is enabled])
2962    AM_GCONF_SOURCE_2
2964    AC_PATH_PROG([GCONFTOOL], [gconftool-2], [false])
2965    if test "$GCONFTOOL" = "false"; then
2966       AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
2967    fi
2968 else
2969    AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL],false)
2973 CYGNAL_PATHS
2975 SUPPORTED_GUIS=
2976 if test x$build_qtopia3 = xyes; then
2977   SUPPORTED_GUIS="${SUPPORTED_GUIS},qtopia3"
2979 if test x$build_qtopia4 = xyes; then
2980   SUPPORTED_GUIS="${SUPPORTED_GUIS},qtopia4"
2982 if test x$build_fb = xyes; then
2983   SUPPORTED_GUIS="${SUPPORTED_GUIS},fb"
2985 if test x$build_fltk = xyes; then
2986   SUPPORTED_GUIS="${SUPPORTED_GUIS},fltk"
2988 if test x$build_kde3 = xyes; then
2989   SUPPORTED_GUIS="${SUPPORTED_GUIS},kde3"
2991 if test x$build_qt4 = xyes; then
2992   SUPPORTED_GUIS="${SUPPORTED_GUIS},qt4"
2994 if test x$build_gtk = xyes; then
2995   SUPPORTED_GUIS="${SUPPORTED_GUIS},gtk"
2997 if test x$build_sdl = xyes; then
2998   SUPPORTED_GUIS="${SUPPORTED_GUIS},sdl"
3000 if test x$build_aqua = xyes; then
3001   SUPPORTED_GUIS="${SUPPORTED_GUIS},aqua"
3003 if test x$build_dump = xyes; then
3004   SUPPORTED_GUIS="${SUPPORTED_GUIS},dump"
3006 if test x$build_aos4 = xyes; then
3007   SUPPORTED_GUIS="${SUPPORTED_GUIS},aos4"
3009 if test x$build_haiku = xyes; then
3010   SUPPORTED_GUIS="${SUPPORTED_GUIS},haiku"
3012 SUPPORTED_GUIS="`echo ${SUPPORTED_GUIS} | sed 's/,//'`" # Strip leading comma
3013 AC_SUBST(SUPPORTED_GUIS)
3015 AC_CONFIG_LINKS(cygnal/testsuite/cygnal.all/cygnalrc:cygnal/testsuite/cygnal.all/cygnalrc.in)
3016 AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc:testsuite/libbase.all/gnashrc.in)
3017 AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc-local:testsuite/libbase.all/gnashrc-local.in)
3019 AC_CONFIG_FILES(
3020 gnash.pc:gnash.pc.in
3021 desktop/gnash-gtk-launcher:desktop/gnash-gtk-launcher.in
3022 desktop/gnash-qt-launcher:desktop/gnash-qt-launcher.in
3025 AC_OUTPUT(Makefile
3026 desktop/Makefile
3027 po/Makefile
3028 libmedia/Makefile
3029 libsound/Makefile
3030 libbase/Makefile
3031 libcore/Makefile
3032 libcore/vm/Makefile
3033 libcore/parser/Makefile
3034 librender/Makefile
3035 utilities/Makefile
3036 doc/Makefile
3037 doc/C/Makefile
3038 doc/Doxyfile
3039 testsuite/Makefile
3040 testsuite/media/Makefile
3041 testsuite/libbase.all/Makefile
3042 testsuite/as3compile.all/Makefile
3043 testsuite/actionscript.all/Makefile
3044 testsuite/samples/Makefile
3045 testsuite/swfdec/Makefile
3046 testsuite/misc-ming.all/Makefile
3047 testsuite/misc-ming.all/action_order/Makefile
3048 testsuite/misc-ming.all/sound/Makefile
3049 testsuite/misc-ming.all/displaylist_depths/Makefile
3050 testsuite/misc-ming.all/init_action/Makefile
3051 testsuite/misc-ming.all/loop/Makefile
3052 testsuite/misc-ming.all/loading/Makefile
3053 testsuite/misc-ming.all/register_class/Makefile
3054 testsuite/misc-mtasc.all/Makefile
3055 testsuite/misc-haxe.all/Makefile
3056 testsuite/misc-haxe.all/classes.all/Makefile
3057 testsuite/misc-swfmill.all/Makefile
3058 testsuite/misc-swfmill.all/trace-as2/Makefile
3059 testsuite/misc-swfmill.all/trace-as3/Makefile
3060 testsuite/misc-swfc.all/Makefile
3061 testsuite/network.all/Makefile
3062 testsuite/movies.all/Makefile
3063 testsuite/libcore.all/Makefile
3064 testsuite/libmedia.all/Makefile
3065 gui/Makefile
3066 gui/Info.plist
3067 gui/pythonmod/Makefile
3068 extensions/Makefile
3069 extensions/dejagnu/Makefile
3070 extensions/mysql/Makefile
3071 extensions/fileio/Makefile
3072 extensions/gtk2/Makefile
3073 extensions/lirc/Makefile
3074 extensions/dbus/Makefile
3075 plugin/Makefile
3076 plugin/npapi/Makefile
3077 plugin/klash/Makefile
3078 plugin/klash4/Makefile
3079 plugin/win32/Makefile
3080 plugin/aos4/Makefile
3081 libdevice/Makefile
3082 cygnal/Makefile
3083 cygnal/libnet/Makefile
3084 cygnal/libamf/Makefile
3085 cygnal/cgi-bin/Makefile
3086 cygnal/cgi-bin/echo/Makefile
3087 cygnal/cgi-bin/oflaDemo/Makefile
3088 cygnal/cgi-bin/fitcDemo/Makefile
3089 cygnal/testsuite/Makefile
3090 cygnal/testsuite/libamf.all/Makefile
3091 cygnal/testsuite/libnet.all/Makefile
3092 cygnal/testsuite/cygnal.all/Makefile
3096 ########################## Final report begins... ############################
3099 dnl Create temporary directory in a secure way
3100 tmp=`mktemp -d ${TMPDIR=/tmp}/gnash-configure-XXXXXX`
3101 if test \! -n "$tmp" || test \! -d "$tmp"; then
3102   tmp=`(umask 077 && mkdir -d ${TMPDIR=/tmp}/gnash-configure-${RANDOM}-$$) 2>/dev/null`
3104 cerr="${tmp}/errors"
3105 cwarn="${tmp}/warnings"
3106 crec="${tmp}/recommended"
3107 deb_err="${tmp}/deb_err"
3108 deb_war="${tmp}/deb_war"
3109 deb_rec="${tmp}/deb_rec"
3110 rpm_err="${tmp}/rpm_err"
3111 rpm_war="${tmp}/rpm_war"
3112 rpm_rec="${tmp}/rpm_rec"
3113 yast_err="${tmp}/yast_err"
3114 yast_war="${tmp}/yast_war"
3115 yast_rec="${tmp}/yast_rec"
3116 echo ""
3118 #trap 'rm cerr' 0 # trap isn't a good idea, might override other traps
3119 exec 3> $cerr 
3120 exec 4> $cwarn
3121 exec 5> $crec
3123 for F in "$deb_err" "$deb_war" "$deb_rec" "$rpm_err" "$rpm_war" "$rpm_rec" "$yast_err" "$yast_war" "$yast_rec"; do
3124   touch "$F";
3125 done
3127 pkg_out_fd=
3128 deb_dest=
3129 rpm_dest=
3130 yast_dest=
3132 dnl These macros should be portable as I checked most things used are in
3133 dnl POSIX-2008, GNU CoreUtils, and shipped in MinGW. Old unices? No clue.
3134 dnl In any case, they are hardly relevant on non-GNU systems.
3136 dnl Beware, here comes some long scary shell commands.
3138 AC_DEFUN([PKG_ERR],
3140   pkg_out_fd=3
3141   echo "          ERROR: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3142   deb_dest="$deb_err"
3143   rpm_dest="$rpm_err"
3144   yast_dest="$yast_err"
3147 AC_DEFUN([PKG_WAR],
3149   pkg_out_fd=4
3150   echo "        WARNING: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3151   deb_dest="$deb_war"
3152   rpm_dest="$rpm_war"
3153   yast_dest="$yast_war"
3156 AC_DEFUN([PKG_REC],
3158   pkg_out_fd=5
3159   echo "    RECOMMENDED: `echo "$1" | fold -s -w 62 | sed 's/^/                 /' | tr '\n' '#' | cut -b 18- | tr '#' '\n'`" >&$pkg_out_fd
3160   deb_dest="$deb_rec"
3161   rpm_dest="$rpm_rec"
3162   yast_dest="$yast_rec"
3165 AC_DEFUN([PKG_SUGGEST],
3167   echo "`echo "$1" | fold -s -w 62 | sed 's/^/                 /'`" >&$pkg_out_fd
3170 AC_DEFUN([DEB_INSTALL],
3172   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
3173   echo -n " $1" >> "$deb_dest"
3176 AC_DEFUN([DEB_ALTERNATIVE],
3178   echo "                 or maybe     : `echo "apt-get install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3179   echo -n "/$1" >> "$deb_dest"
3182 AC_DEFUN([RPM_INSTALL],
3184   echo "                 or .rpm users: `echo "yum install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3185   echo -n " $1" >> "$rpm_dest"
3188 AC_DEFUN([RPM_ALTERNATIVE],
3190   echo "                 or maybe     : `echo "yum install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3191   echo -n "/$1" >> "$rpm_dest"
3194 AC_DEFUN([YAST_INSTALL],
3196   echo "                 or yast users: `echo "yast install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3197   echo -n " $1" >> "$yast_dest"
3200 AC_DEFUN([YAST_ALTERNATIVE],
3202   echo "                 or maybe     : `echo "yast install $1" | fold -s -w 48 | sed 's/^/                                /' | tr '\n' '#' | cut -b 33- | tr '#' '\n'`" >&$pkg_out_fd
3203   echo -n "/$1" >> "$yast_dest"
3206 AC_DEFUN([PKG_ALTERNATIVE],
3208   echo "`echo "$1" | fold -s -w 62 | sed 's/^/                 /'`" >&$pkg_out_fd
3211 echo "Configurable options are:"
3213 if test x"${jemalloc}" = x"yes"; then
3214   echo "        JEMALLOC Memory management enabled (default)."
3215 else
3216   echo "        JEMALLOC Memory management disabled."
3219 if test x"${pthreads}" = x"yes"; then
3220   echo "        POSIX Threads support enabled (default)."
3221 else
3222   if test x"${build_haiku}" = x"yes"; then
3223      echo "        POSIX Thread support built into C library."
3224   else
3225      echo "        POSIX Thread support disabled."
3226   fi
3229 if test x"${npapi}" = x"yes"; then
3230   echo "        NPAPI plugin enabled (default). Use --disable-npapi to disable."
3231   echo "        NPAPI plugin will be installed in ${FIREFOX_PLUGINS}"
3232 else
3233   echo "        NPAPI plugin disabled."
3236 if test x"${build_kparts3}" = x"yes"; then
3237   echo "        KPARTS 3.x plugin enabled (default). Use --disable-kparts3 to disable"
3238   echo "            KPARTS 3.x plugin will be installed in ${KDE3_PLUGINDIR}"
3239   echo "            KPARTS 3.x service will be installed in ${KDE3_SERVICESDIR}"
3240   echo "            KPARTS 3.x config dir will be in ${KDE3_CONFIGDIR}"
3241   echo "            KPARTS 3.x appsdata will be installed in ${KDE3_APPSDATADIR}"
3242 else
3243   echo "        KPARTS 3.x plugin disabled."
3246 if test x"${build_kparts4}" = x"yes"; then
3247   echo "        KPARTS 4.x plugin enabled (default). Use --disable-kparts4 to disable"
3248   echo "            KPARTS 4.x plugin will be installed in ${KDE4_PLUGINDIR}"
3249   echo "            KPARTS 4.x service will be installed in ${KDE4_SERVICESDIR}"
3250   echo "            KPARTS 4.x config dir will be in ${KDE4_CONFIGDIR}"
3251   echo "            KPARTS 4.x appsdata will be installed in ${KDE4_APPSDATADIR}"
3252 else
3253   echo "        KPARTS 4.x plugin disabled."
3256 # set a variable if we shouldn't continue. This way we can print
3257 # out everything that is missing in one pass, hopefully making it
3258 # easy for new developers to get everything they need installed.
3260 echo ""
3261 echo "Configured paths for ${build} are:"
3263 if test x"${jemalloc}" = x"yes"; then
3264   if test x"${has_jemalloc}" = xyes; then
3265     echo "        JEMALLOC flags are: ${JEMALLOC_CFLAGS}"
3266     echo "        JEMALLOC libs are: ${JEMALLOC_LIBS}"
3267   else
3268     PKG_ERR([No jemalloc development package installed!])
3269     PKG_SUGGEST([Install a jemalloc development environment from
3270     http://www.canonware.com/jemalloc/])
3271     DEB_INSTALL([libjemalloc-dev])
3272     RPM_INSTALL([jemalloc-devel])
3273     PKG_ALTERNATIVE([or specify --disable-jemalloc])
3274   fi
3277 dnl Dump QT3 options is the user specified a QTOPIA3 or KDE3 GUI
3278 if test x"${build_kde3}" = xyes -o x"${build_qtopia3}" = xyes; then
3279   if test x"${has_qt3}" = xyes; then
3280     echo "        QT3 flags are: ${QT3_CFLAGS}"
3281     echo "        QT3 libs are: ${QT3_LIBS}"
3282   else
3283     PKG_ERR([No QT 3.x development package installed!])
3284     PKG_SUGGEST([Install a QT 3.x development environment from http://qt.nokia.com/])
3285     DEB_INSTALL([libqt3-mt-dev])
3286     RPM_INSTALL([qt3-devel])
3287     RPM_ALTERNATIVE([qt-devel])
3288     PKG_ALTERNATIVE([or change to a different gui with --enable-gui=...])
3289   fi
3292 dnl Dump QT4 options is the user specified a QTOPIA4 or Qt4 GUI
3293 if test x"${build_qt4}" = xyes -o x"${build_qtopia4}" = xyes; then
3294   if test x"${has_qt4}" = xyes; then
3295     echo "        QT4 flags are: ${QT4_CFLAGS}"
3296     echo "        QT4 libs are: ${QT4_LIBS}"
3297   else
3298     PKG_ERR([No QT 4.x development package installed!])
3299     PKG_SUGGEST([Install a QT 4.x development environment from http://qt.nokia.com/])
3300     DEB_INSTALL([libqt4-dev])
3301     DEB_ALTERNATIVE([qt4-dev-tools]) dnl TODO: Is this required?
3302     RPM_INSTALL([qt4-devel])
3303     RPM_ALTERNATIVE([qt-devel])
3304     PKG_ALTERNATIVE([or change to a different gui with --enable-gui=...])
3305   fi
3308 if test x"${build_kparts4}" = xyes; then
3309   if test x"${has_kde4}" = xyes; then
3310     echo "        KDE4 flags are: ${KDE4_CFLAGS}"
3311     echo "        KDE4 libs are: ${KDE4_LIBS}"
3312   else
3313     PKG_WAR([kparts4 plugin is disabled!])
3314     PKG_SUGGEST([Install version 4.x of the KDE development environment from http://kde.org])
3315     DEB_INSTALL([kdelibs5-dev])
3316     RPM_INSTALL([kdelibs-devel])
3317   fi
3320 if test x"$build_qtopia3" = xyes; then
3321   if test x"${QTOPIA3_LIBS}" != x ; then
3322     if test x"${QTOPIA3_CFLAGS}" != x ; then
3323       echo "        QTOPIA 3.x flags are: $QTOPIA3_CFLAGS"
3324     else
3325       echo "        QTOPIA 3.x flags are: default include path"
3326     fi
3327     echo "        QTOPIA 3.x libs are: $QTOPIA3_LIBS"
3328   else
3329     PKG_ERR([No QTOPIA 3.x library development package installed!])
3330     PKG_SUGGEST([Install it from http://trolltech.com/downloads/ as binary packages are not available.]) dnl TODO: This link is no longer valid.
3331   fi
3334 if test x"$build_qtopia4" = xyes; then
3335   if test x"${QTOPIA4_LIBS}" != x ; then
3336     if test x"${QTOPIA4_CFLAGS}" != x ; then
3337       echo "        QTOPIA 4.x flags are: $QTOPIA4_CFLAGS"
3338     else
3339       echo "        QTOPIA 4.x flags are: default include path"
3340     fi
3341     echo "        QTOPIA 4.x libs are: $QTOPIA4_LIBS"
3342   else
3343     PKG_ERR([No QTOPIA 4.x library development package installed!])
3344     PKG_SUGGEST([Install it from http://trolltech.com/downloads/ as binary packages are not available.]) dnl TODO: This link is no longer valid.
3345   fi
3349 # -o x$build_kparts3 = xyes
3350 if test x$build_kde3 = xyes; then
3351   if test x"$has_kde3" = xyes; then
3352     echo "        KDE 3.x flags are: $KDE3_CFLAGS"
3353     echo "        KDE 3.x libs are: $KDE3_LIBS"
3354   else
3355     PKG_ERR([No KDE 3.x development package installed!])
3356     PKG_SUGGEST([Install version 3.x of the KDE development environment from http://kde.org])
3357     DEB_INSTALL([kdelibs4-dev])
3358     RPM_INSTALL([kdelibs3-devel])
3359     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.])
3360   fi
3363 if test x"${JPEG_LIBS}" != x ; then
3364   if test x"${JPEG_CFLAGS}" != x ; then
3365     echo "        JPEG flags are: $JPEG_CFLAGS"
3366   else
3367     echo "        JPEG flags are: default include path"
3368   fi
3369   echo "        JPEG libs are: $JPEG_LIBS"
3370 else
3371   PKG_ERR([No JPEG library development package installed!])
3372   PKG_SUGGEST([Install it from http://ijg.org])
3373   DEB_INSTALL([libjpeg-dev])
3374   RPM_INSTALL([libjpeg-devel])
3377 if test x"${GIF_LIBS}" != x ; then
3378   if test x"${GIF_CFLAGS}" != x ; then
3379     echo "        GIF flags are: $GIF_CFLAGS"
3380   else
3381     echo "        GIF flags are: default include path"
3382   fi
3383   echo "        GIF libs are: $GIF_LIBS"
3384 else
3385   PKG_ERR([No GIF library development package installed!])
3386   PKG_SUGGEST([Install it from http://sourceforge.net/projects/giflib/])
3387   DEB_INSTALL([libungif-dev])
3388   DEB_ALTERNATIVE([libgif-dev])
3389   RPM_INSTALL([libgif-devel])
3390   RPM_ALTERNATIVE([giflib-devel])
3391   RPM_ALTERNATIVE([libungif-devel])
3394 if test x"${PNG_LIBS}" != x ; then
3395   if test x"${PNG_CFLAGS}" != x ; then
3396     echo "        PNG flags are: $PNG_CFLAGS"
3397   else
3398     echo "        PNG flags are: default include path"
3399   fi
3400   echo "        PNG libs are: $PNG_LIBS"
3401 else
3402   PKG_REC([No PNG library development package installed!])
3403   PKG_SUGGEST([Gnash will be built without support for dynamic loading of PNG files.])
3404   PKG_SUGGEST([Install it from http://www.libpng.org])
3405   DEB_INSTALL([libpng12-dev])
3406   RPM_INSTALL([libpng-devel])
3409 if test x"${build_ovg}" = x"yes"; then
3410   if test x"${has_openvg}" = xyes; then
3411     echo "        OpenVG flags are: $OPENVG_CFLAGS"
3412     echo "        OpenVG libs are: $OPENVG_LIBS"
3413     else
3414       echo "        ERROR: No OpenVG development package installed!" >&3
3415       echo "               You need to install the libmesa development package" >&3
3416       echo "               or .deb users: apt-get install libopenvg1-mesa-dev" >&3
3417       echo "               or .rpm users: yum install mesa-libOpenVG-devel-7.8.1-7.fc13.i686" >&3
3418       echo "               or use a different renderer with --enable-renderer=" >&3
3419   fi
3422 if test x"${build_ogl}" = x"yes"; then
3423   if test x"$OPENGL_LIBS" != x; then
3424     if test x"$OPENGL_CFLAGS" != x; then
3425       echo "        OpenGL flags are: $OPENGL_CFLAGS"
3426     else
3427       echo "        OpenGL flags are: default include path"
3428     fi
3429     echo "        OpenGL libs are: $OPENGL_LIBS"
3430     else
3431       PKG_ERR([No OpenGL development package installed!])
3432       PKG_SUGGEST([You need to install the libmesa development package])
3433       DEB_INSTALL([libgl1-mesa-dev])
3434       RPM_INSTALL([mesa-libGL-devel])
3435       RPM_ALTERNATIVE([xorg-x11-Mesa-libGL])
3436       PKG_ALTERNATIVE([or use a different renderer with --enable-renderer=])
3437   fi
3440 if test x"${build_gles1}" = x"yes"; then
3441   if test x"${has_gles1}" = xyes; then
3442     if test x"${GLES1_CFLAGS}" != x; then
3443       echo "        OpenGLES1 flags are: ${GLES1_CFLAGS}"
3444     else
3445       echo "        OpenGLES1 flags are: default include path"
3446     fi
3447     echo "        OpenGLES1 libs are: ${GLES1_LIBS}"
3448   else
3449       PKG_ERR([No OpenGL-ES development package installed!])
3450       PKG_SUGGEST([You need to install the this from source probably])
3451       PKG_ALTERNATIVE([or use a different renderer with --enable-renderer=])
3452   fi
3455 dnl GLEXT is only needed for GTK/OpenGL
3456 if test x$build_gtk = xyes -a x$build_ogl = xyes ; then
3457   if test x"$GLEXT_LIBS" != x; then
3458     if test x"$GLEXT_CFLAGS" != x; then
3459       echo "        GtkGLExt flags are: $GLEXT_CFLAGS"
3460     else
3461       echo "        GtkGLExt flags are: default include path"
3462     fi
3463       echo "        GtkGLExt libs are: $GLEXT_LIBS"
3464   else
3465     PKG_ERR([No GtkGLExt development package installed!])
3466     PKG_SUGGEST([It is needed to build the GTK/OpenGL GUI/renderer combination.])
3467     PKG_SUGGEST([Install it from http://gtkglext.sourceforge.net])
3468     DEB_INSTALL([libgtkglext1-dev])
3469     RPM_INSTALL([gtkglext-devel])
3470     PKG_ALTERNATIVE([or --enable-gui=sdl or --enable-renderer=agg])
3471   fi
3474 if test x$build_gtk = xyes; then #{
3475   if test x"$GTK2_LIBS" != x; then
3476     if test x"$GTK2_CFLAGS" != x; then
3477       echo "        GTK2 flags are: $GTK2_CFLAGS"
3478     else
3479       echo "        GTK2 flags are: default include path"
3480     fi
3481       echo "        GTK2 libs are: $GTK2_LIBS"
3482   else
3483     PKG_ERR([No GTK2 development package installed!])
3484     PKG_SUGGEST([Install it from http://gtk.org])
3485     DEB_INSTALL([libgtk2.0-dev])
3486     RPM_INSTALL([gtk2-devel])
3487   fi
3489   if test x"$PANGO_LIBS" != x; then
3490     if test x"$PANGO_CFLAGS" != x; then
3491       echo "        Pango flags are: $PANGO_CFLAGS"
3492     else
3493       echo "        Pango flags are: default include path"
3494     fi
3495     echo "        Pango libs are: $PANGO_LIBS"
3496   else
3497     PKG_ERR([No Pango development package installed!])
3498     PKG_SUGGEST([Install it from http://pango.org])
3499     DEB_INSTALL([libpango1.0-dev])
3500     RPM_INSTALL([pango-devel])
3501   fi
3503   if test x"$GLIB_LIBS" != x; then
3504     if test x"$GLIB_CFLAGS" != x; then
3505       echo "        GLib flags are: $GLIB_CFLAGS"
3506     else
3507       echo "        GLib flags are: default include path"
3508     fi
3509     echo "        GLib libs are: $GLIB_LIBS"
3510   else
3511     PKG_ERR([No GLib development package installed!])
3512     PKG_SUGGEST([Install it from http://gtk.org])
3513     DEB_INSTALL([libglib2.0-dev])
3514     RPM_INSTALL([glib2-devel])
3515   fi
3517   if test x"$ATK_LIBS" != x; then
3518     if test x"$ATK_CFLAGS" != x; then
3519       echo "        ATK flags are: $ATK_CFLAGS"
3520     else
3521       echo "        ATK flags are: default include path"
3522     fi
3523       echo "        ATK libs are: $ATK_LIBS"
3524   else
3525     PKG_ERR([No ATK development package installed!])
3526     PKG_SUGGEST([Install it from http://atk.org])
3527     DEB_INSTALL([libatk1.0-dev])
3528     RPM_INSTALL([atk-devel])
3529   fi
3533 if test x"$build_media_gst" = x"yes"; then
3534   if test x"$missing_codecs" != x; then   
3535       echo "        Your Gstreamer installation is missing these codecs: $missing_codecs"
3536       echo "        Please install the gstreamer-ffmpeg for Gstreamer"
3537   fi  
3538   if test x"$GSTREAMER_LIBS" != x; then
3539     if test x"$GSTREAMER_CFLAGS" != x; then
3540       echo "        Gstreamer flags are: $GSTREAMER_CFLAGS"
3541     else
3542       echo "        Gstreamer flags are: default include path"
3543     fi
3544     echo "        Gstreamer libs are: $GSTREAMER_LIBS"
3545   else
3546     PKG_ERR([GST media handling requested but gstreamer-0.10+ not found])
3547     PKG_SUGGEST([Install it from http://www.gstreamer.net])
3548     DEB_INSTALL([libgstreamer0.10-dev])
3549     RPM_INSTALL([gstreamer-devel])
3550     YAST_INSTALL([gstreamer010-devel])
3551   fi
3552   if test x"$has_gstreamer_pbutils" != "xyes"; then
3553     PKG_REC([If the user has not installed the necessary Gstreamer plugins, Gstreamer can pop up a message prompting them to.])
3554     PKG_SUGGEST([Install gstpbutils (>= 0.10.15) from http://www.gstreamer.net for that to be enabled])
3555     DEB_INSTALL([libgstreamer-plugins-base0.10-dev])
3556     PKG_SUGGEST([or .rpm users: simply install the below package]) dnl TODO: Can/should this notice be done cleaner?
3557     PKG_SUGGEST([Also see --with-gstpbutils-incl and --with-gstpbutils-lib])
3558   fi
3559   if test x"$has_gstreamer_plugins_base" = "xno"; then
3560     dnl TODO: Check if this is really a mandatory asset!
3561     PKG_ERR([Base plugins are required for gstreamer media!])
3562     PKG_SUGGEST([Install gstreamer-plugins-base from http://www.gstreamer.net])
3563     DEB_INSTALL([libgstreamer-plugins-base0.10-dev])
3564     RPM_INSTALL([gstreamer-plugins-base-devel])
3565   fi
3568 dnl TODO: figure out some RPM package names.
3569 dnl TODO: The following tests is probably incorrect for any/older/exotic systems! Could someone experienced look at it?
3570 if test x"${build_media_ffmpeg}" = x"yes"; then
3571   if test x"$FFMPEG_LIBS" != x; then
3572     echo "        MP3 and video support enabled through FFmpeg"
3573     if test x"$FFMPEG_CFLAGS" != x; then
3574       echo "        FFmpeg flags are: $FFMPEG_CFLAGS"
3575     else
3576       echo "        FFmpeg flags are: default include path"
3577     fi
3578     echo "        FFmpeg libs are: $FFMPEG_LIBS"
3579   else
3580     PKG_ERR([No FFmpeg development package installed!])
3581     PKG_SUGGEST([You can install FFmpeg from http://ffmpeg.org])
3582     DEB_INSTALL([libavcodec-dev])
3583     RPM_INSTALL([ffmpeg-devel])
3584     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3585   fi
3587   if test x"${avformat_h}" = x; then
3588     PKG_ERR([FFmpeg's avformat header is installed but not libavformat!])
3589     PKG_SUGGEST([You can install FFmpeg from http://ffmpeg.org])
3590     DEB_INSTALL([libavformat-dev])
3591     YAST_INSTALL([libavformat-api]) dnl (but currently installs into /usr/lib64)
3592     PKG_ALTERNATIVE(or explicitly set the path using --with-ffmpeg-incl=)
3593     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3594   fi
3596   if test x"${have_ffmpeg_swscale}" = "xno"; then
3597     PKG_ERR([No libswscale development package installed!])
3598     PKG_SUGGEST([You can install libswscale from http://ffmpeg.org])
3599     DEB_INSTALL([libswscale-dev])
3600     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3601   fi
3603   if test x"${have_ffmpeg_libavutil}" = "xno"; then
3604     PKG_ERR([No libavutil development package installed!])
3605     PKG_SUGGEST([You can install libavutil from http://ffmpeg.org])
3606     DEB_INSTALL([libavutil-dev])
3607     PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3608   fi
3610   if test x"${ffmpeg_aac_float_planar}" = "xyes" -a \
3611     x"${have_ffmpeg_swresample}" = "xno" -a \
3612     x"${have_libav_avresample}" = "xno"; then
3613       PKG_REC([Please install libswresample/libavresample development package. If you don't, Gnash will be unable to resample some formats (e.g. AAC on youtube)])
3614       PKG_SUGGEST([You can install libavresample from http://libav.org])
3615       PKG_SUGGEST([You can install libswresample from http://ffmpeg.org])
3616       DEB_INSTALL([libavresample-dev])
3617       PKG_ALTERNATIVE(or reconfigure with --enable-media=gst)
3618   fi
3621 if test x$build_cairo = xyes; then
3622   if test x"$CAIRO_LIBS" != x; then
3623     if test x"$CAIRO_CFLAGS" != x; then
3624       echo "        Cairo flags are: $CAIRO_CFLAGS"
3625     else
3626       echo "        Cairo flags are: default include path"
3627     fi
3628     echo "        Cairo libs are: $CAIRO_LIBS"
3629   else
3630     PKG_ERR([No Cairo development package installed!])
3631     PKG_SUGGEST([You need to have the Cairo development package installed if you have used --enable-render=cairo to configure.])
3632     PKG_SUGGEST([Install it from http://cairographics.org])
3633     DEB_INSTALL([libcairo-dev])
3634     RPM_INSTALL([cairo-devel])
3635   fi
3638 if test x$build_fltk = xyes; then
3639   if test x"$FLTK2_LIBS" != x; then
3640     if test x"$FLTK2_CFLAGS" != x; then
3641       echo "        FLTK flags are: $FLTK2_CFLAGS"
3642     else
3643       echo "        FLTK flags are: default include path"
3644     fi
3645       echo "        FLTK libs are: $FLTK2_LIBS"
3646   else
3647     PKG_ERR([No FLTK2 development package installed!])
3648     PKG_SUGGEST([Install it from http://fltk.org])
3649     PKG_ALTERNATIVE(or change to a different gui with --enable-gui=...)
3650   fi
3653 if test x$build_fltk = xyes; then
3654   if test x"$XFT_LIBS" != x; then
3655     if test x"$XFT_CFLAGS" != x; then
3656       echo "        Xft flags are: $XFT_CFLAGS"
3657     else
3658       echo "        Xft flags are: default include path"
3659     fi
3660     echo "        Xft libs are: $XFT_LIBS"
3661   fi
3664 # See whether SDL is required
3665 need_sdl=false
3666 test x$build_sdl = xyes                 && need_sdl=true
3667 test x$build_sound_sdl = xyes   && need_sdl=true
3669 if $need_sdl; then
3670   if test x"$SDL_LIBS" != x; then
3671     echo "        SDL flags are: $SDL_CFLAGS"
3672     echo "        SDL libs are: $SDL_LIBS"
3673   else
3674     PKG_ERR([No SDL development package installed!])
3675     PKG_SUGGEST([Install it from http://www.libsdl.org/download-1.2.php])
3676     DEB_INSTALL([libsdl1.2-dev])
3677     RPM_INSTALL([SDL-devel])
3678     PKG_ALTERNATIVE(or change to a different gui with --enable-gui=...)
3679   fi
3681 unset need_sdl
3683 if test x"$nsapi" = x"yes"; then
3684     echo "        Plugin will be installed in ${FIREFOX_PLUGINS}"
3687 if test x"${pthreads}" = x"yes"; then
3688   if test x"$PTHREAD_CFLAGS" != x; then
3689     echo "        POSIX Threads flags are: $PTHREAD_CFLAGS"
3690   fi
3691   if test x"${PTHREAD_LIBS}" != x; then
3692     echo "        POSIX Threads lib is: $PTHREAD_LIBS"
3693   else
3694     if test x"${cross_compiling}" = xno; then
3695       echo "ERROR: No pthread development package installed!" >&3
3696     fi
3697   fi
3700 if test x"${docbook}" = x"yes"; then
3701   if test x"$MAKEINFO" = x; then
3702     PKG_ERR([No makeinfo tools installed!])
3703     PKG_SUGGEST([Install it from http://www.gnu.org/software/texinfo/])
3704     DEB_INSTALL([texinfo])
3705     RPM_INSTALL([texinfo])
3706     RPM_ALTERNATIVE([texinfo-tex])
3707   fi
3708   dnl low-level tools
3709   if test x"$DB2X_TEXIXML" = x -o x"$DB2X_MANXML" = x -o x"$DB2X_XSLTPROC" = x; then
3710     dnl high-level tools
3711     if test x"${DB2X_TEXI}" = x -o x"${DB2X_MAN}" = x; then
3712       PKG_ERR([No DocBook2X tools installed!])
3713       PKG_SUGGEST([Install it from http://docbook2x.sourceforge.net])
3714       dnl TODO: Could someone look at this and confirm the needed software is installed?
3715       dnl FIXME: I removed the texidocbook and docbook-utilsnfo packages as they are not on my system.
3716       DEB_INSTALL([docbook2x docbook-xml docbook-xsl texinfo xsltproc])
3717       PKG_ALTERNATIVE([or configure without --enable-docbook])
3718     fi
3719   else
3720     echo "        You have version $db2x_version of the DocBook2X tools."
3721   fi
3722 else
3723   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.])
3726 if test x"$CURL_LIBS" != x; then
3727   if test x"$CURL_CFLAGS" != x; then
3728     echo "        CURL flags are: $CURL_CFLAGS"
3729   else
3730     echo "        CURL flags are: default include path"
3731   fi
3732   echo "        CURL libs are: $CURL_LIBS"
3733   if test -z "$curl_rtmp_support"; then
3734     PKG_REC([CURL library present but built without RTMP protocol support.])
3735     PKG_SUGGEST([If you install it with RTMP protocol support, Gnash will be able to play RTMP streaming.])
3736   fi
3737 else
3738   PKG_REC([If you install the CURL library, Gnash will be able to display remote content (streaming from URLs) using CURL.])
3739   PKG_SUGGEST([Install libcurl from http://curl.haxx.se/libcurl])
3740   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?
3741   DEB_ALTERNATIVE([libcurl-dev])
3742   RPM_INSTALL([curl-devel])
3745 if test x"$SPEEX_LIBS" != x; then
3746   if test x"$SPEEX_CFLAGS" != x; then
3747     echo "        Speex flags are: $SPEEX_CFLAGS"
3748   else
3749     echo "        Speex flags are: default include path"
3750   fi
3751     echo "        Speex libs are: $SPEEX_LIBS"
3752 else
3753   PKG_REC([If you install the Speex library, Gnash will be able to decoded Speex encoded audio in FLV files.])
3754   PKG_SUGGEST([Install libspeex from http://speex.org])
3755   DEB_INSTALL([libspeex-dev])
3756   RPM_INSTALL([speex-devel])
3759 if test x"$SPEEXDSP_LIBS" != x; then
3760   if test x"$SPEEXDSP_CFLAGS" != x; then
3761     echo "        Speex DSP flags are: $SPEEXDSP_CFLAGS"
3762   else
3763     echo "        Speex DSP flags are: default include path"
3764   fi
3765     echo "        Speex DSP libs are: $SPEEXDSP_LIBS"
3766 else
3767   PKG_REC([If you install the Speex DSP library, Gnash will be able to resample Speex encoded audio in FLV files.])
3768   PKG_SUGGEST([Install libspeexdsp from http://speex.org])
3769   DEB_INSTALL([libspeexdsp-dev])
3770   RPM_INSTALL([speexdsp-devel])
3773 if test x"$ext_dbus" = xyes; then
3774   if test x"$DBUS_LIBS" != x; then
3775     if test x"$DBUS_CFLAGS" != x; then
3776       echo "        DBUS flags are: $DBUS_CFLAGS"
3777     else
3778       echo "        DBUS flags are: default include path"
3779     fi
3780       echo "        DBUS libs are: $DBUS_LIBS"
3781   else
3782     PKG_WAR([No DBUS development package was found! Gnash will be built without support for remote controls.])
3783     PKG_SUGGEST([Install libdbus from http://www.dbus.org])
3784     DEB_INSTALL([dbus-dev])
3785     DEB_ALTERNATIVE([libdbus-1-dev])
3786     RPM_INSTALL([dbus-devel])
3787   fi
3790 if test x$build_agg = xyes; then # {
3791   echo "        AGG Pixel format is: $pixelformat"
3792   if test x"$AGG_LIBS" != x -a x"${agg25}" == xyes; then # {
3793     if test x"$AGG_CFLAGS" != x; then # {
3794       echo "        AGG flags are: $AGG_CFLAGS"
3795     else # }{
3796       echo "        AGG flags are: default include path"
3797     fi # }
3798     echo "        AGG libs are: $AGG_LIBS"
3799   else # }{
3800     if test x"$AGG_LIBS" != x -a x"${agg25}" != xyes; then
3801       PKG_ERR([Your installation of AGG appears to be version 2.4 or older. Please upgrade to AGG 2.5 or greater.])
3802     else
3803       PKG_ERR([No AGG development package installed!])
3804     fi
3805     PKG_SUGGEST([Install it from http://www.antigrain.com])
3806     DEB_INSTALL([libagg-dev])
3807     RPM_INSTALL([agg-devel])
3808   fi # }
3809 fi # }
3811 dnl TODO: This package is handled a bit stupidly in regard to the package
3812 dnl suggestion system. It would be better to check for each package
3813 dnl separately, instead of passing the missing ones in variables..
3814 if test x"$BOOST_LIBS" != x; then
3815   echo "        BOOST flags are: $BOOST_CFLAGS"
3816   echo "        BOOST libs are: $BOOST_LIBS"
3817   echo "        BOOST libs for cygnal are: $BOOST_CYGNAL_LIBS"
3819   if test x"${missing_headers}" != x; then
3820     for i in ${missing_headers}; do
3821       PKG_ERR([The Boost $i header is not installed])
3822       PKG_SUGGEST([Install it from http://www.boost.org])
3823     done
3824   fi
3826   if test x"${cygnal}" = x"yes"; then
3827     if test x"${missing_cygnal_libs}" != x; then
3828       for i in ${missing_cygnal_libs}; do
3829         PKG_ERR([No Boost $i package installed])
3830         PKG_SUGGEST([Install it from http://www.boost.org])
3831         debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
3832         DEB_INSTALL([$debtmppkg])
3833         PKG_ALTERNATIVE([or configure with --disable-cygnal])
3834       done
3835     fi
3836   fi
3838   if test x"${npapi}" = x"yes"; then
3839     if test x"${missing_plugin_libs}" != x; then
3840       for i in ${missing_plugin_libs}; do
3841         PKG_ERR([No Boost $i package installed])
3842         PKG_SUGGEST([Install it from http://www.boost.org])
3843         debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
3844         DEB_INSTALL([$debtmppkg])
3845         PKG_ALTERNATIVE([or configure with --disable-npapi])
3846       done
3847     fi
3848   fi
3850   if test x"${missing_libs}" != x; then
3851     for i in ${missing_libs}; do
3852       PKG_ERR([No Boost $i package installed])
3853       PKG_SUGGEST([Install it from http://www.boost.org])
3854       debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
3855       DEB_INSTALL([$debtmppkg])
3856     done
3857   fi
3858 else
3859   PKG_ERR([No Boost development package installed])
3860   PKG_SUGGEST([Install it from http://www.boost.org])
3861   dnl I am not sure that libboost-program-options-dev should be passed here, but
3862   dnl it seems like the cleanest way to get it.
3863   if test x"$cygnal" = xyes; then
3864     DEB_INSTALL([libboost-dev libboost-thread-dev libboost-program-options-dev libboost-date-time-dev])
3865   else
3866     DEB_INSTALL([libboost-dev libboost-thread-dev libboost-program-options-dev])
3867   fi
3868   RPM_INSTALL([boost-devel])
3871 dnl don't look for the flash compilers when cross compiling.
3872 if test x"$testsuite" = x"yes"; then
3873   if test x$cross_compiling = xno; then
3874     if test x"$MING_LIBS" != x; then
3875       echo "        MING flags are $MING_CFLAGS"
3876       echo "        MING libs are $MING_LIBS"
3877     else
3878       PKG_WAR([You need to have the Ming development package installed to run most of the tests in Gnash testsuite.])
3879       PKG_SUGGEST([Install it from http://www.libming.org/])
3880       DEB_INSTALL([libming-dev])
3881       RPM_INSTALL([libming-devel])
3882     fi
3884     if test x"$MAKESWF" != x; then
3885       echo "        MING version code is $MING_VERSION_CODE"
3886       echo "        MAKESWF is $MAKESWF"
3887     else
3888       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.])
3889       PKG_SUGGEST([Install it from http://www.libming.org/])
3890       DEB_INSTALL([libming-util])
3891       RPM_INSTALL([ming-util])
3892       RPM_ALTERNATIVE([ming-utils])
3893     fi
3895     if test x"$MAKESWF" != x && test $MING_VERSION_CODE -lt 40006; then
3896       echo "        WARNING: You have an older version of Ming installed and will not" >&4
3897       echo "                 be able to run all of the tests in Gnash testsuite." >&4
3898       echo "                 Install the latest version from http://www.libming.org" >&4
3899     fi
3901     if test x"$SWFDEC_TESTSUITE" != x; then
3902       echo "        SWFDEC testsuite dir is $SWFDEC_TESTSUITE"
3903     fi
3905     if test x"$MTASC" != x; then
3906       echo "        MTASC is $MTASC"
3907       echo "        MTASC CLASSPATH is $MTASC_CLASSPATH"
3908     else
3909       PKG_WAR([You need to have the MTASC compiler packages installed to run some of the tests in Gnash testsuite.])
3910       PKG_SUGGEST([Install it from http://mtasc.org])
3911       DEB_INSTALL([mtasc])
3912       RPM_INSTALL([mtasc])
3913     fi
3915     if test x"$HAXE" != x; then
3916       echo "        HAXE is $HAXE"
3917       echo "        HAXE CLASSPATH is $HAXE_CLASSPATH"
3918     else
3919       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.])
3920       PKG_SUGGEST([Install it from http://haxe.org])
3921       DEB_INSTALL([haxe])
3922       RPM_INSTALL([haxe])
3923     fi
3925     if test x"$SWFMILL" != x; then
3926       echo "        SWFMILL is $SWFMILL"
3927       if test x"$ENABLE_AVM2" != x -a "$SWFMILL_VERSION" -lt 00021206; then
3928         PKG_WAR([You are building Gnash with AVM2 support but your swfmill version is too old to run AS3 tests.])
3929       fi
3930     else
3931       PKG_WAR([You need to have the swfmill tool installed to run some of the tests in Gnash testsuite.])
3932       PKG_SUGGEST([Install it from http://swfmill.org])
3933       DEB_INSTALL([swfmill])
3934       RPM_INSTALL([swfmill])
3935     fi
3937     if test x"$SWFC" != x; then
3938       echo "        SWFC is $SWFC"
3939     else
3940       PKG_WAR([You need to have swfc from SWFTools installed to run some of the tests in Gnash testsuite.])
3941       PKG_SUGGEST([Install it from http://swftools.org])
3942       DEB_INSTALL([swftools])
3943       RPM_INSTALL([swftools])
3944     fi
3946     if test x"$AS3COMPILE" != x; then
3947       echo "        AS3COMPILE is $AS3COMPILE"
3948     else
3949       PKG_WAR([You need to have as3compile from SWFTools installed to run some of the tests in Gnash testsuite.])
3950       PKG_SUGGEST([Install it from http://swftools.org])
3951     fi
3953     if test x"$HTTP_TESTSUITE" != x; then
3954       echo "        HTTP testsuite dir is $HTTP_TESTSUITE"
3955     fi
3957     if test x"$RED5_TESTING" != x; then
3958       echo "        RED5 testing host is $RED5_HOST"
3959     fi
3960   fi
3963   if test x"$PERL" != x; then
3964     echo "        PERL is $PERL"
3965   else
3966     PKG_WAR([You need to have perl installed to run some of the tests in Gnash testsuite.])
3967     PKG_SUGGEST([Install it from http://perl.org])
3968     DEB_INSTALL([perl])
3969     RPM_INSTALL([perl])
3970   fi
3972 if test x"$testsuite" = x"yes"; then
3973   if test x"$CSOUND" != x; then
3974     echo "        CSOUND is $CSOUND"
3975   else
3976     PKG_WAR([You need to have csound installed to (re)generate some sound-related test files in Gnash testsuite.])
3977     PKG_SUGGEST([Install it from http://www.csounds.com/])
3978     DEB_INSTALL([csound])
3979     RPM_INSTALL([csound])
3980   fi
3983 if test x"$Z_LIBS" != x; then
3984   if test x"$Z_CFLAGS" != x; then
3985     echo "        Z flags are: $Z_CFLAGS"
3986   else
3987     echo "        Z flags are: default include path"
3988   fi
3989   echo "        Z libs are: $Z_LIBS"
3990 else
3991   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.])
3992   PKG_SUGGEST([Install it from http://zlib.net])
3993   DEB_INSTALL([zlib1g-dev])
3994   RPM_INSTALL([zlib-devel])
3995   PKG_ALTERNATIVE([It may still be possible to configure without zlib.])
3998 if test x"$FREETYPE2_LIBS" != x; then
3999   if test x"$FREETYPE2_CFLAGS" != x; then
4000     echo "        FreeType flags are: $FREETYPE2_CFLAGS"
4001   else
4002     echo "        FreeType flags are: default include path"
4003   fi
4004   echo "        FreeType libs are: $FREETYPE2_LIBS"
4005 else
4006   PKG_REC([You need to have the freetype development packages installed to use device fonts.])
4007   PKG_SUGGEST([Install it from http://freetype.org])
4008   DEB_INSTALL([libfreetype6-dev])
4009   RPM_INSTALL([freetype-devel])
4010   PKG_ALTERNATIVE([It may still be possible to configure without freetype.])
4013 if test x"$FONTCONFIG_LIBS" != x; then
4014   if test x"$FONTCONFIG_CFLAGS" != x; then
4015     echo "        Fontconfig flags are: $FONTCONFIG_CFLAGS"
4016   else
4017     echo "        Fontconfig flags are: default include path"
4018   fi
4019   echo "        Fontconfig libs are: $FONTCONFIG_LIBS"
4020 else
4021   PKG_REC([You need to have the fontconfig development packages installed to use device fonts.])
4022   PKG_SUGGEST([Install it from http://fontconfig.org])
4023   DEB_INSTALL([libfontconfig1-dev])
4024   RPM_INSTALL([fontconfig-devel])
4025   PKG_ALTERNATIVE([It may still be possible to configure without fontconfig.])
4028 if test x$ext_mysql = xyes; then
4029   if test x$mysql != xno; then
4030     if test x"$MYSQL_LIBS" != x; then
4031       echo "        MYSQL flags are: $MYSQL_CFLAGS"
4032       echo "        MYSQL libs are: $MYSQL_LIBS"
4033     else
4034       PKG_ERR([No MySQL development package is installed.])
4035       PKG_SUGGEST([Install it from http://mysql.org])
4036       DEB_INSTALL([libmysqlclient-dev])
4037       RPM_INSTALL([mysql-devel])
4038       PKG_ALTERNATIVE([or reconfigure without --enable-extensions=mysql])
4039     fi
4040   fi
4043 if test "$GMSGFMT" = ":"; then
4044   PKG_WAR([You need the gettext package installed to use translations. Required for building a package or 'make distcheck'])
4045   PKG_SUGGEST([Install it from http://www.gnu.org/software/gettext/])
4046   DEB_INSTALL([gettext])
4047   RPM_INSTALL([gettext])
4050 if test x"${build_vaapi}" = x"yes"; then
4051   if test x"${LIBVA_CFLAGS}" = xyes; then
4052       echo "        LIBVA flags are: default"
4053     else
4054       echo "        LIBVA flags are: $LIBVA_CFLAGS"
4055       echo "        LIBVA libraries are: $LIBVA_LIBS"
4056   fi
4057   if test x$use_libva_x11 = xyes; then
4058     if test x"${LIBVA_X11_CFLAGS}" = xyes; then
4059       echo "        LIBVA X11 flags are: default"
4060     else
4061       echo "        LIBVA X11 flags are: $LIBVA_X11_CFLAGS"
4062       echo "        LIBVA X11 libraries are: $LIBVA_X11_LIBS"
4063     fi
4064   fi
4065   if test x$use_libva_glx = xyes; then
4066     if test x"${LIBVA_GLX_CFLAGS}" = xyes; then
4067       echo "        LIBVA GLXflags are: default"
4068     else
4069       echo "        LIBVA GLX flags are: $LIBVA_GLX_CFLAGS"
4070     fi
4071     echo "        LIBVA GLX libraries are: $LIBVA_GLX_LIBS"
4072   fi
4075 if test x"$ac_cv_gcc_visibility" != xyes; then
4076   if test x"$npapi" = xyes; then
4077     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!])
4078   fi
4081 if test x"$npapi" = xyes; then
4082   if test x"$has_npapi" = xyes; then
4083     echo "        NPAPI flags are: $NPAPI_CFLAGS"
4084   else
4085     PKG_ERR([No xulrunner development package is installed!])
4086     PKG_SUGGEST([Install it from http://releases.mozilla.org/pub/mozilla.org/xulrunner])
4087     DEB_INSTALL([xulrunner-dev])
4088     DEB_ALTERNATIVE([firefox-dev])
4089     RPM_INSTALL([xulrunner-devel])
4090     PKG_ALTERNATIVE([or specify --disable-npapi])
4091   fi
4092 else
4093   echo "        NPAPI plugin is disabled"
4096 if test x"${DEJAGNU}" != x""; then
4097   echo "        DEJAGNU's runtest is $DEJAGNU"
4098 else
4099   PKG_WAR([You need the dejagnu package installed to get a summary after running 'make check'.])
4100   PKG_SUGGEST([Install it from http://www.gnu.org/software/dejagnu/])
4101   DEB_INSTALL([dejagnu])
4102   RPM_INSTALL([dejagnu])
4105 dnl Haiku
4106 if test x"${build_haiku}" = xyes -o x"${build_sound_mkit}" = xyes -o x"${build_media_haiku}" = x"yes"; then
4107     echo "        Haiku libs are: $HAIKU_LIBS"
4110 if test x"$has_ltdl" = x"yes";then
4111   echo "        LIBLTDL flags are: $LTDL_CFLAGS"
4112   echo "        LIBLTDL libs are: $LTDL_LIBS"
4113 else
4114   if test x"${extensions_support}" != xno; then
4115     PKG_ERR([No libltdl development package is installed, yet --disable-extensions was not specified.])
4116     PKG_SUGGEST([Install it from ftp://ftp.gnu.org/gnu/libtool/])
4117     DEB_INSTALL([libltdl-dev])
4118     RPM_INSTALL([libtool-ltdl-devel])
4119   fi
4122 if test x"$enable_visibility" != xno; then
4123   if test x"${extensions_support}" != xno; then
4124     PKG_ERR([Extensions not supported with ELF visibility activated.])
4125     PKG_SUGGEST([Use --disable-extensions or --disable-visibility.])
4126   fi
4129 if test x"$python" = x"yes"; then
4130   if test x"$has_python" = x"yes"; then
4131     echo "        PYTHON flags are: $PYTHON_CFLAGS"
4132     echo "        PYTHON libs are: $PYTHON_LIBS"
4133     echo "        PYTHON executable is: $PYTHON"
4134   else
4135     PKG_ERR([No Python development package is installed, but it's enabled.])
4136   fi
4138 if test x${build_ssl} = xyes; then
4139   if test x"${has_ssl}" = xyes; then
4140     if test x"${SSL_CFLAGS}" = xyes; then
4141       echo "        SSL flags are: default"
4142     else
4143       echo "        SSL flags are: $SSL_CFLAGS"
4144     fi
4145     echo "        SSL libs are: $SSL_LIBS"
4146   else
4147     PKG_ERR([No SSL development package is installed, but it's enabled."])
4148   fi
4151 if test x${build_ssh} = xyes; then
4152   if test x"${has_ssh}" = xyes; then
4153     if test x"${SSH_CFLAGS}" = xyes; then
4154       echo "        SSH flags are: default"
4155     else
4156       echo "        SSH flags are: $SSH_CFLAGS"
4157     fi
4158     echo "        SSH libs are: $SSH_LIBS"
4159   else
4160     PKG_ERR([No SSH development package is installed, but it's enabled."])
4161   fi
4164 if test x"${build_all_as3}" = x"yes"; then
4165   echo "        Building the entire ActionScript class libary"
4166 else
4167   echo "        Only building these ActionScript classes into the library:"
4168   echo "     ${classlist}"
4171 if test x"$testsuite" = x"yes"; then
4172   if test x"$NETCAT" != x; then
4173     echo "        You have netcat installed, which is only used for testing"
4174   else
4175     echo "        Install netcat for networking test support"
4176   fi
4177   if test x"$WGET" != x; then
4178     echo "        You have wget installed, which is only used for testing"
4179   else
4180     echo "        Install wget for networking test support"
4181   fi
4184 if test x$cross_compiling = xyes; then
4185    if test x"${android_ndk}" != xno; then
4186       AC_MSG_NOTICE([This build is setup for cross compiling for Android])
4187    else
4188       AC_MSG_NOTICE([This build is setup for cross compiling])
4189    fi
4192 echo "--------"
4194 if test x"${cygnal}" = x"yes"; then
4195   echo "        Building Cygnal media server enabled (default). Use --disable-cygnal to disable."
4196 else
4197   echo "        Building Cygnal media server disabled."
4200 if test x"${with_top_level}" != x; then
4201   echo "        Top level for cross compiling support files is: $with_top_level"
4204 if test x"${build_gtk}" = xyes -a x"${pixelformat}" = xrgb565; then
4205   echo "        WARNING: Pixel format RGB565 selected in combination with the" >&4
4206   echo "                 GTK GUI. Only a hacked GTK will work (e.g. on the OLPC)." >&4
4209 if test x"${extensions_list}" != x; then
4210   echo "        Building extensions: ${extensions_list}"
4213 if test x"${extensions_support}" = xno; then
4214   echo "        Extension support disabled."
4217 if test x"${security_list}" != x; then
4218   echo "        Enabling security features: ${security_list}"
4221 if test x"${statistics_list}" != x; then
4222   echo "        Enabling statistics collecting for: ${statistics_list}"
4225 if test x"${SUPPORTED_GUIS}" = x; then
4226   AC_MSG_ERROR(no supported GUIs found);
4229 echo "        GUI toolkits supported: ${SUPPORTED_GUIS}"
4230 echo "        Renderers supported: ${renderer_list}"
4231 echo "        Hardware Acceleration: ${device_list}"
4232 echo "        Media handlers: ${media_list}"
4233 echo "        Using ${add_sound} for sound handling"
4235 if test x"$docbook" = x"yes"; then
4236   echo '        DocBook document processing enabled (for "make html" and "make pdf")'
4237   if test x"$docbook_styles" != x; then
4238     echo "        Docbook styles sheets in $docbook_styles"
4239   fi
4240 else
4241   echo "        DocBook document processing disabled (default)"
4244 dnl The Framebuffer GUI has several other settings. As it doesn't have X11,
4245 dnl we have to handle input devics ourselves.
4246 if test x"${build_fb}" = xyes; then
4247 echo "        Using ${input_events} for Input"
4248   if test x"${fakefb}" != x; then
4249     echo "        Using shared memory as a fake framebuffer"
4250   fi
4251   if test x"${offscreen}" = xyes; then
4252     echo "        Using offscreen rendering"
4253   fi
4254   if test x"${doublebuf}" = xyes; then
4255     echo "        Using double buffering when rendering"
4256   fi
4259 if test -s $cwarn; then
4260   echo ""
4261   cat $cwarn
4262   rm $cwarn
4263   echo ""
4264   echo "Gnash should still compile even with these warnings."
4265   echo "If it doesn't, report the warnings as a bug."
4266 else
4267   rm $cwarn
4270 if test -s $crec; then
4271   echo ""
4272   cat $crec
4273   rm $crec
4274   echo ""
4275   echo "Gnash should still compile, but you'll miss important support"
4276 else
4277   rm $crec
4280 if test -s $cerr; then
4281   echo ""
4282   cat $cerr >&2
4285 deb_err="`cat $deb_err`"
4286 deb_war="`cat $deb_war`"
4287 deb_rec="`cat $deb_rec`"
4288 rpm_err="`cat $rpm_err`"
4289 rpm_war="`cat $rpm_war`"
4290 rpm_rec="`cat $rpm_rec`"
4291 yast_err="`cat $yast_err`"
4292 yast_war="`cat $yast_war`"
4293 yast_rec="`cat $yast_rec`"
4295 if test x"${android}" != xyes; then
4296   # Pipe stderr to /dev/null since Fedora complains when target isn't there.
4297   if test x`which apt-get 2>/dev/null` != x; then
4298     if test x"$deb_err" != x -o x"$deb_war" != x -o x"$deb_rec" != x; then
4299       echo "#!/bin/sh" > deb-attempt-install-dependencies.sh
4300       echo "packages=\"$deb_err $deb_war $deb_rec\"" >> deb-attempt-install-dependencies.sh
4301       echo "PKGCOMMAND=\"apt-get install -y -q\"" >> deb-attempt-install-dependencies.sh
4302       cat ${srcdir}/base-attempter.sh >> deb-attempt-install-dependencies.sh
4303       chmod +x deb-attempt-install-dependencies.sh
4304       echo ""
4305       echo ".deb users might be able to install most dependencies by executing:"
4306       echo "sudo ./deb-attempt-install-dependencies.sh"
4307     fi
4308   fi
4310   if test x`which yum 2>/dev/null` != x; then
4311     if test x"$rpm_err" != x -o x"$rpm_war" != x -o x"$deb_rec" != x; then
4312       echo "#!/bin/sh" > rpm-attempt-install-dependencies.sh
4313       echo "packages=\"$rpm_err $rpm_war  $rpm_rec\"" >> rpm-attempt-install-dependencies.sh
4314       echo "PKGCOMMAND=\"yum install -y \""    >> rpm-attempt-install-dependencies.sh
4315       cat ${srcdir}/base-attempter.sh >> rpm-attempt-install-dependencies.sh
4316       chmod +x rpm-attempt-install-dependencies.sh
4317       echo ""
4318       echo ".rpm users might be able to install most dependencies by executing:"
4319       echo "sudo ./rpm-attempt-install-dependencies.sh"
4320     fi
4321   fi
4324 dnl TODO: Add support for yast here, which AFAIK is used on OpenSuse.
4326 dnl If anything critical is missing, don't bother to continue
4327 if test -s $cerr; then
4328   echo ""
4329   rm $cerr
4330   AC_MSG_ERROR([Please install required packages])
4331 else
4332   rm $cerr
4335 rm -rf $tmp
4337 if test x"$fork" = x"no"; then
4338   echo ""
4339   AC_MSG_ERROR([Currently only forking the standalone player works!])
4341 echo ""
4343 # Local Variables:
4344 # c-basic-offset: 2
4345 # tab-width: 2
4346 # indent-tabs-mode: nil
4347 # End: