-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
4348 lines (3932 loc) · 141 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl
dnl Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014, 2015,
dnl 2017 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
dnl
AC_PREREQ(2.59c)
AC_INIT(gnash, 0.8.11dev)
AC_CONFIG_SRCDIR([libcore/as_object.h])
AC_CONFIG_HEADERS([gnashconfig.h])
AC_CONFIG_MACRO_DIR([macros])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
dnl --------------------------------------------------------
dnl Figure out development tool stuff
dnl --------------------------------------------------------
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
AC_PROG_CC
AM_PROG_CC_C_O
AC_EXEEXT
AC_PROG_INSTALL
dnl Set the default values for Flash Version. These are converted into
dnl various strings to make JavaScript or ActionScript detectors
dnl recognize Gnash as a SWF Player.
DEFAULT_FLASH_MAJOR_VERSION="10"
DEFAULT_FLASH_MINOR_VERSION="1"
DEFAULT_FLASH_REV_NUMBER="999"
AC_SUBST(DEFAULT_FLASH_MAJOR_VERSION)
AC_SUBST(DEFAULT_FLASH_MINOR_VERSION)
AC_SUBST(DEFAULT_FLASH_REV_NUMBER)
AC_DEFINE_UNQUOTED([DEFAULT_FLASH_MAJOR_VERSION], ["${DEFAULT_FLASH_MAJOR_VERSION}"], [Default Flash major version])
AC_DEFINE_UNQUOTED([DEFAULT_FLASH_MINOR_VERSION], ["${DEFAULT_FLASH_MINOR_VERSION}"], [Default Flash minor version])
AC_DEFINE_UNQUOTED([DEFAULT_FLASH_REV_NUMBER], ["${DEFAULT_FLASH_REV_NUMBER}"], [Default Flash revision number])
dnl TODO: use host/build/target -- whatever is more appropriate
case "${host}" in
*-apple-*)
DEFAULT_FLASH_PLATFORM_ID="MAC"
DEFAULT_FLASH_SYSTEM_OS="MacOS"
;;
*-openbsd*)
DEFAULT_FLASH_PLATFORM_ID="BSD"
DEFAULT_FLASH_SYSTEM_OS="OpenBSD"
;;
*-freebsd* | *-kfreebsd*)
DEFAULT_FLASH_PLATFORM_ID="BSD"
DEFAULT_FLASH_SYSTEM_OS="FreeBSD"
;;
*-netbsd*)
DEFAULT_FLASH_PLATFORM_ID="BSD"
DEFAULT_FLASH_SYSTEM_OS="NetBSD"
;;
*-android*)
DEFAULT_FLASH_PLATFORM_ID="AND"
DEFAULT_FLASH_SYSTEM_OS="Linux"
;;
*-linux-gnu)
DEFAULT_FLASH_PLATFORM_ID="LNX"
DEFAULT_FLASH_SYSTEM_OS="GNU/Linux"
;;
*-linux*)
DEFAULT_FLASH_PLATFORM_ID="LNX"
DEFAULT_FLASH_SYSTEM_OS="Linux"
;;
*-cygwin* | *-mingw* | *-pw32*)
DEFAULT_FLASH_PLATFORM_ID="WIN"
DEFAULT_FLASH_SYSTEM_OS="Windows"
;;
*-*solaris*)
DEFAULT_FLASH_PLATFORM_ID="SUN"
DEFAULT_FLASH_SYSTEM_OS="Solaris"
;;
*-os2*)
DEFAULT_FLASH_PLATFORM_ID="OS2"
DEFAULT_FLASH_SYSTEM_OS="OS/2"
;;
*-sco*)
DEFAULT_FLASH_PLATFORM_ID="SCO"
DEFAULT_FLASH_SYSTEM_OS="SCO/Unix"
;;
*-irix*)
DEFAULT_FLASH_PLATFORM_ID="IRX"
DEFAULT_FLASH_SYSTEM_OS="IRIX"
;;
*-hpux*)
DEFAULT_FLASH_PLATFORM_ID="HPX"
DEFAULT_FLASH_SYSTEM_OS="HPUX"
;;
*-amigaos*)
DEFAULT_FLASH_PLATFORM_ID="OS4"
DEFAULT_FLASH_SYSTEM_OS="AmigaOS4"
;;
*-haiku*)
DEFAULT_FLASH_PLATFORM_ID="HAIKU"
DEFAULT_FLASH_SYSTEM_OS="Haiku"
;;
*-gnu*)
DEFAULT_FLASH_PLATFORM_ID="GNU"
DEFAULT_FLASH_SYSTEM_OS="GNU/HURD"
;;
*)
DEFAULT_FLASH_PLATFORM_ID="UNK"
DEFAULT_FLASH_SYSTEM_OS="Unknown"
;;
esac
AC_DEFINE_UNQUOTED([DEFAULT_FLASH_PLATFORM_ID], ["${DEFAULT_FLASH_PLATFORM_ID}"], [Default 3-letter platform identifier for version string])
AC_DEFINE_UNQUOTED([DEFAULT_FLASH_SYSTEM_OS], ["${DEFAULT_FLASH_SYSTEM_OS}"], [Default value for System.capabilities.os])
AC_SUBST(DEFAULT_FLASH_PLATFORM_ID)
AC_SUBST(DEFAULT_FLASH_SYSTEM_OS)
DEFAULT_STREAMS_TIMEOUT=60
AC_SUBST(DEFAULT_STREAMS_TIMEOUT)
AC_DEFINE_UNQUOTED([DEFAULT_STREAMS_TIMEOUT], [${DEFAULT_STREAMS_TIMEOUT}], [Default streams timeout in seconds])
DEFAULT_SOL_SAFEDIR="~/.gnash/SharedObjects"
AC_SUBST(DEFAULT_SOL_SAFEDIR)
AC_DEFINE_UNQUOTED([DEFAULT_SOL_SAFEDIR], ["${DEFAULT_SOL_SAFEDIR}"], [Default SharedObject base directory])
dnl Some things you can only do by looking at the platform name.
case "${host}" in
powerpc-apple-darwin*)
AC_DEFINE([__powerpc64__], [1], [this is a 64 bit powerpc])
darwin=yes
AC_DEFINE([DARWIN_HOST], [1], [this is a Darwin platform])
;;
*-apple-darwin*)
darwin=yes
AC_DEFINE([DARWIN_HOST], [1], [this is a Darwin platform])
;;
dnl Unfortunately, all BSD distributions are not identical, so
dnl as tacky as it is to look for the distribution name, we don't
dnl have much choice. The use of these should be avoid as much as possible.
*-openbsd*)
bsd=yes
openbsd=yes
AC_DEFINE([OPENBSD_HOST], [1], [this is an OpenBSD platform])
;;
*-freebsd* | *-kfreebsd*)
bsd=yes
freebsd=yes
AC_DEFINE([FREEBSD_HOST], [1], [this is a FreeBSD platform])
;;
*-netbsd*)
bsd=yes
netbsd=yes
AC_DEFINE([NETBSD_HOST], [1], [this is a NetBSD platform])
;;
*-*solaris*)
solaris=yes
AC_DEFINE([SOLARIS_HOST], [1], [this is a Solaris platform])
;;
*-android*)
android=yes
AC_DEFINE([ANDROID_HOST], [1], [this is an Android platform])
;;
*-*linux*)
linux=yes
AC_DEFINE([LINUX_HOST], [1], [this is a Linux platform])
;;
*-cygwin* | *-mingw* | *-pw32*)
windows=yes
AC_DEFINE([WIN32_HOST], [1], [this is a Win32 platform])
;;
*64-*-*bsd*)
bsd_os=bsd
AC_DEFINE([WORDSIZE], [64], [this is a 64 platform])
;;
*-*amigaos*)
amigaos4=yes
AC_DEFINE([AMIGAOS4_HOST], [1], [this is an AmigaOS4 platform])
;;
*-*haiku*)
haiku=yes
AC_DEFINE([HAIKU_HOST], [1], [this is a Haiku platform])
;;
*-gnu*)
gnu=yes
AC_DEFINE([GNU_HOST], [1], [this is a GNU platform])
;;
*-*wince)
wince=yes
AC_DEFINE([WINCE_HOST], [1], [this is a WINCE platform])
;;
*-*winmo)
wince=yes
AC_DEFINE([WINCE_HOST], [1], [this is a WINCE platform])
AC_DEFINE([WINCE6_HOST], [1], [this is a WINCE6 platform])
;;
esac
AM_CONDITIONAL(LINUX, test x$linux = xyes)
AM_CONDITIONAL(WIN32, test x$windows = xyes)
AM_CONDITIONAL(HAIKU, test x$haiku = xyes)
AM_CONDITIONAL(AMIGAOS4, test x$amigaos4 = xyes)
dnl Get build date for helping us debugging
BUILDDATE="`date +%Y%m%d`"
AC_SUBST(BUILDDATE)
dnl These are required by automake
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE
AC_PROG_MAKE_SET
AM_GNU_GETTEXT([external])
AM_CONDITIONAL(HAS_GETTEXT, test x$ac_cv_path_XGETTEXT != x)
dnl Many of the Gnash macros depend on gettext macros defining shlibext; recent
dnl gettext however does not.
if test x"${shlibext}" = x; then
if test x"${acl_cv_shlibext}" = x; then
echo "Gettext macros were supposed to define shared library extensions"
exit 1;
else
shlibext="${acl_cv_shlibext}"
fi
fi
dnl This is primarily used when compiling for a similar architecture,
dnl like pentium->geode, which can use the same compiler, but have
dnl different development libraries.
AC_ARG_WITH(sysroot,
AC_HELP_STRING([--with-sysroot], [system root directory for cross compiling]),
with_top_level=${withval};
cross_compiling=yes)
if test x"${cross_compiling}" = xyes; then
dnl Check if /usr isn't part of the specified path
if test -d ${with_top_level}/usr; then
with_top_level=${withval}/usr
else
dnl Check if the specified path supplies /usr
if test -d ${with_top_level}/include; then
with_top_level=${withval}
else
AC_MSG_ERROR([Specified sysroot \"${with_top_level}/include\" doesn't exist!])
fi
fi
fi
dnl Android is a little different when using a standard cross toolchain,
dnl so we have to configure especially for it for now. Usually it's
dnl something like this:
dnl
dnl arm-linux-eabi-gcc -Wl,--dynamic-linker -Wl,/system/bin/linker
dnl -nostdlib -Wl,-rpath -Wl,/system/lib -Wl,-rpath
dnl -Wl,/opt/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib
dnl -L/opt/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib
dnl -lc -o hello
dnl /opt/android-ndk-r3/build/platforms/android-3/arch-arm/usr/lib/crtbegin_dynamic.o
dnl Recent versions of G++ (I'm using 4.5 from source
android_ndk=no
AC_ARG_WITH([android],
AC_HELP_STRING([--with-android], [directory where android NDK is installed]),
android_ndk=${withval}
if test x"${withval}" != x; then
android_ndk=${withval}
fi
)
CROSS_CXXFLAGS=
if test x"${android}" = xyes; then
CROSS_CXXFLAGS='-fexceptions -frtti -I${prefix}/include'
CROSS_LDFLAGS='-all-static -L${prefix}/lib'
if test x"${with_top_level}" = x; then
with_top_level=/usr/local/android-arm/sysroot/usr
cross_compiling=yes
fi
ANDROID_NDK=${android_ndk}
AC_DEFINE(ANDROID, [1], [This is an Android build])
CXXFLAGS="${CXXFLAGS} ${CROSS_CXXFLAGS}"
else
CROSS_CXXFLAGS=
ANDROID_NDK=
fi
AC_SUBST(ANDROID_NDK)
AM_CONDITIONAL(ANDROID, [ test x"${android}" = xyes ])
AC_SUBST(CROSS_LDFLAGS)
AC_SUBST(CROSS_CXXFLAGS)
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_PATH_PROG(DEJAGNU, runtest)
dnl These options are for Cygnal, which collects optional statistics
dnl on all the network traffic By default, we turn on statistics
dnl collecting for the incoming and outgoing queues, since those are
dnl required to be compatiable with FMS 3, and the ActionScript server
dnl management API. buffers are the lowest level data storage, this
dnl data is the time spent in the queue, and is primarily only used
dnl for tuning the queueing API in Gnash. Memoryis the same, it's only
dnl used by developers for tuning performance of memory allocations in
dnl Gnash.
buffers=no
que=no
memory=no
cache=yes
stat_proplookup=no
AC_ARG_WITH(statistics,
AC_HELP_STRING([--with-statistics], [Specify which statistics features to enable]),
if test -n ${withval}; then
if test "x${withval}" != "xno"; then
extlist="${withval}"
withval=`echo ${withval} | tr '\054' ' ' `
else
extlist=""
withval=""
fi
fi
statistics_list=""
nstatistics=0
while test -n "${withval}" ; do
val=`echo ${withval} | cut -d ' ' -f 1`
[case "${val}" in
buffers)
buffers=yes
nstatistics=$((nstatistics+1))
;;
que)
que=yes
nstatistics=$((nstatistics+1))
;;
memory)
memory=yes
nstatistics=$((nstatistics+1))
;;
cache)
cache=yes
nstatistics=$((nstatistics+1))
;;
proplookup)
stat_proplookup=yes
nstatistics=$((nstatistics+1))
;;
all|ALL)
buffers=yes
memory=yes
queu=yes
cache=yes
stat_proplookup=yes
nstatistics=5 dnl this must be incremented if you add anything
;;
*) AC_MSG_ERROR([invalid statistics feature specified: ${withval} given (accept: buffers|que|memory|cache|proplookup|all)])
;;
esac]
withval=`echo ${withval} | cut -d ' ' -f 2-6`
if test "x$val" = "x$withval"; then
break;
fi
done
)
if test x${buffers} = xyes; then
statistics_list="${statistics_list} buffers"
AC_DEFINE(USE_STATS_BUFFERS, [1], [Support statistics collecting for the queue buffers])
AC_MSG_WARN([This option will effect your performance])
fi
if test x${memory} = xyes; then
statistics_list="${statistics_list} memory"
AC_DEFINE(USE_STATS_MEMORY, [1], [Support statistics collecting for all memory profiling])
AC_MSG_WARN([This option will effect your performance])
fi
if test x${que} = xyes; then
statistics_list="${statistics_list} queues"
AC_DEFINE(USE_STATS_QUEUE, [1], [Support statistics collecting for the queues])
fi
if test x${cache} = xyes; then
statistics_list="${statistics_list} cache"
AC_DEFINE(USE_STATS_CACHE, [1], [Support statistics collecting for the cache])
fi
if test x${stat_proplookup} = xyes; then
statistics_list="${statistics_list} proplookup"
AC_DEFINE(GNASH_STATS_OBJECT_URI_NOCASE, [1], [Collecting and report stats about ObjectURI case lookups])
AC_DEFINE(GNASH_STATS_PROPERTY_LOOKUPS, [1], [Collecting and report stats about property lookups])
AC_DEFINE(GNASH_STATS_STRING_TABLE_NOCASE, [1], [Collecting and report stats about string_table::key case lookups])
fi
dnl this is just so Makefile can print the same list
STATISTICS_LIST="$statistics_list"
AC_SUBST(STATISTICS_LIST)
#
# These settings are compile time options for the security
# setting for anything that lets gnash exchange data with
# other applications. Currently this only supports Shared
# Objects and Local Connections. Shared Objects are like
# your web browsers cookies, and Local Connections use
# shared memory to execute methods remotely, and to
# exchange data.
#
# The default is to enable everything, and these can
# also be controlled dynamically by the $HOME/.gnashrc
# file.
#
solreadonly=no
localconnection=yes
AC_ARG_WITH(security,
AC_HELP_STRING([--with-security], [Specify which security features to enable]),
if test -n ${withval}; then
if test "x${withval}" != "xno"; then
extlist="${withval}"
withval=`echo ${withval} | tr '\054' ' ' `
else
extlist=""
withval=""
fi
fi
security_list=""
nsecurity=0
while test -n "${withval}" ; do
val=`echo ${withval} | cut -d ' ' -f 1`
[case "${val}" in
solreadonly)
solreadonly=yes
nsecurity=$((nsecurity+1))
;;
lc)
localconnection=yes
nsecurity=$((nsecurity+1))
;;
all|ALL)
solreadonly=yes
lc=yes
nsecurity=3
;;
*) AC_MSG_ERROR([invalid security feature specified: ${withval} given (accept: solreadonly|lc)])
;;
esac]
withval=`echo ${withval} | cut -d ' ' -f 2-6`
if test "x$val" = "x$withval"; then
break;
fi
done
)
if test x$localconnection = xyes; then
security_list="${security_list} localconnection"
AC_DEFINE(USE_LC, [1],
[Support LocalConnection])
AC_MSG_NOTICE([This build supports LocalConnection])
fi
if test x$solreadonly = xyes; then
security_list="${security_list} solreadonly"
AC_DEFINE(USE_SOL_READONLY, [1],
[Shared Objects are read-only])
AC_MSG_NOTICE([Shared Objects are read-only])
fi
SECURITY_LIST="$security_list"
AC_SUBST(SECURITY_LIST)
dnl For Haiku, we know the sysroot is in a non-standard place
dnl it is important that -lagg comes before -lbe
if test x"${haiku}" = xyes; then
HAIKU_LIBS=-lbe
AC_SUBST(HAIKU_LIBS)
fi
dnl Darwin uses libtool instead of ar to produce libraries. We determine which one
dnl we have here now. For some reason on Darwin, we don't get the
dnl count from grep via stdin correctly. Writing a temp file does the
dnl trick, so although it's ugly, that's what we gotta do...
AC_MSG_CHECKING([which type of library archiver we have])
rm -f .tmp
libtool > .tmp 2>&1
archiver=`grep -c dynamic .tmp 2>&1`
rm -f .tmp
dnl is there any good way to report what we found here?
AC_MSG_RESULT()
if test x"${archiver}" != x && test "${archiver}" -eq 1; then
export MACOSX_DEPLOYMENT_TARGET="10.3"
darwin=yes
else
darwin=no
fi
dnl When cross compiling, limit the search directories cause otherwise
dnl we may get the host headers or libraries by accident. These values
dnl are exported, so all the other configure tests in macros/*.m4 use
dnl these same settings rather than duplicating them like we used to.
dnl To override thise, use the --with-*-incl= and --with-*-libs=
dnl options to configure.
if test x$cross_compiling = xyes; then
AC_MSG_NOTICE([Configuring Gnash for cross compilation])
export pkgroot="`$CXX -print-search-dirs | grep "install:" | sed -e 's/install: //' -e 's:/lib/gcc/.*::'`"
dnl pkgroot only works correctly with builds of cross tools not in
dnl /usr, ie... installed from the distribution packages, or just
dnl plain installed in the system tools. This contaminates configure
dnl when building for variations of the same basic architecture,
dnl like i686-linux -> i586-mingw32.
if test x"${pkgroot}" = x"/usr"; then
export pkgroot=""
fi
export incllist="`eval echo ${with_top_level}/include ${pkgroot}/${host_alias}/include ${pkgroot}/include`"
export libslist="`eval echo ${with_top_level}/lib ${pkgroot}/${host_alias}/lib ${pkgroot}/lib64 ${pkgroot}/lib32 ${pkgroot}/lib`"
export pathlist="`eval echo ${pkgroot}/${host_alias}/bin:${pkgroot}/bin`"
npapi=no
else
AC_MSG_NOTICE([Configuring Gnash for native compilation])
export incllist="`eval cat ${srcdir}/macros/incllist`"
libslist="`cat ${srcdir}/macros/libslist`"
if test -f /usr/bin/dpkg-architecture; then
export DEB_HOST_MULTIARCH="`eval dpkg-architecture -qDEB_HOST_MULTIARCH`"
export libslist="${libslist} /lib/${DEB_HOST_MULTIARCH} /usr/lib/${DEB_HOST_MULTIARCH}"
fi
export pathlist=$PATH
fi
if test x"${android_ndk}" != xno; then
incllist="${android_ndk}/include ${incllist}"
fi
AM_CONDITIONAL(CROSS_COMPILING, [ test x$cross_compiling = xyes ])
for dir in ${incllist}; do
test -d ${dir} && pruned_incllist="${pruned_incllist} ${dir}";
done
for dir in ${libslist}; do
test -d ${dir} && pruned_libslist="${pruned_libslist} ${dir}";
done
libslist="${pruned_libslist}";
incllist="${pruned_incllist}";
dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
dnl !!
dnl !! IMPORTANT NOTICE
dnl !!
dnl !! Any call to GNASH_PATH_XXX must be be given *after* this snippet.
dnl !! This is to ensure that PKG_CONFIG, cross_compiling and incllist are
dnl !! properly set at the time of call.
dnl !!
dnl !! Also GNASH_PKG_FIND has to be called later. Not sure
dnl !! why but calling before breaks detection of CPP (see
dnl !! gnash-dev mailing archives for June 12 2009
dnl !! http://lists.gnu.org/archive/html/gnash-dev/2009-06/index.html
dnl !!
dnl !!
dnl !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
dnl Check for PKG_CONFIG before any GNASH_PATH call
PKG_PROG_PKG_CONFIG
dnl --------------------------------------------------------
dnl GUI selection
dnl --------------------------------------------------------
build_haiku=no
build_aos4=no dnl AmigaOS4 GUI
build_kde3=no dnl WARNING: doesn't work (see https://savannah.gnu.org/bugs/index.php?31782)
build_qt4=no
build_qtopia3=no
build_qtopia4=no
build_gtk=no
build_fb=no dnl Raw framebuffer
build_fltk=no
build_sdl=no
build_aqua=no dnl Native MacOSX
build_dump=no
AC_ARG_ENABLE(gui,
AC_HELP_STRING([--enable-gui], [Enable support for the specified GUI toolkits (default=gtk,qt4)]),
[if test -n ${enableval}; then
enableval=`echo ${enableval} | tr '\054' ' ' `
fi
while test -n "${enableval}" ; do
val=`echo ${enableval} | cut -d ' ' -f 1`
case "${val}" in
gtk|GTK|gtk2|GTK2)
build_gtk=yes
;;
kde3|KDE3)
build_kde3=yes
;;
qt4|QT4|kde4|KDE4)
build_qt4=yes
;;
qtopia3|QTOPIA3)
build_qtopia3=yes
;;
qtopia4|QTOPIA4)
build_qtopia4=yes
;;
sdl|SDL)
build_sdl=yes
;;
aqua|AQUA|Aqua)
build_aqua=yes
;;
fltk|FLTK|fltk2|FLTK2)
build_fltk=yes
;;
fb|FB)
build_fb=yes
;;
aos4|AOS4)
build_aos4=yes
;;
haiku|HAIKU)
build_haiku=yes
;;
dump|DUMP)
build_dump=yes
;;
all|ALL)
build_dump=yes
dnl BSD doesn't have a framebuffer interface
if test x${linux} = xyes; then
build_fb=yes
fi
if test x${openbsd} != xyes; then
build_qt4=yes
fi
build_sdl=yes
build_gtk=yes
;;
*) AC_MSG_ERROR([invalid gui ${enableval} given (accept: gtk|kde3|qt4|fltk|sdl|aqua|fb|qtopia3|qtopia4|dump|aos4|haiku)])
;;
esac
enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
if test "x$val" = "x$enableval"; then
break;
fi
done],
[ dnl Run the following code if no --enable-gui is given
build_fb=auto
build_sdl=auto
if test x"${openbsd}" = xyes; then
build_gtk=yes
build_dump=auto
else if test x"${haiku}" = xyes; then
build_haiku=yes;
else
build_qt4=auto
build_gtk=yes
build_dump=auto
fi
fi
]
)
if test x"${build_haiku}" = xyes; then
if test x"$haiku" != xyes; then
echo " ERROR: Can not build Haiku gui outside of Haiku
operating system." >&3
fi
fi
dnl We can use Xephyr or fbe to create a fake framebuffer instead of real
dnl video memory. This lets us test on a desktop machine.
AC_ARG_WITH(fakefb,
AC_HELP_STRING([--with-fakefb],
[specify a file to be mapped instead of a real framebuffer]),
with_fakefb=${withval})
fakefb=
if test x"${with_fakefb}" = xyes; then
dnl This is the default file name fbe uses.
fakefb=/tmp/fbe_buffer
else
if test x"${with_fakefb}" != x; then
fakefb=${with_fakefb}
fi
fi
FAKEFB=${fakefb}
AC_SUBST(FAKEFB)
if test x"${fakefb}" != x; then
AC_DEFINE(ENABLE_FAKE_FRAMEBUFFER, [1], [Enable using a file instead of a real framebuffer])
fi
dnl This enable a small handful of tests that aren't designed to be
dnl run as part of "make check", as they are either incomplete, or
dnl can only be run interactively. These are all primarily oriented
dnl towards code development and debugging, instead of regression
dnl or unit testing.
AC_ARG_ENABLE(devtests, AC_HELP_STRING([--enable-devtests],
[Developer only tests, not to be included in make check]),
[case "${enableval}" in
yes) devtests=yes ;;
no) devtests=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for enable-devtests option]) ;;
esac], devtests=no)
AM_CONDITIONAL(ENABLE_DEVELOPER_TESTS, [test x${devtests} = xyes])
dnl --------------------------------------------------------
dnl Sound handler selection
dnl --------------------------------------------------------
add_sound=
build_sound_none=no
build_sound_sdl=no
build_sound_ahi=no
build_sound_mkit=no
AC_ARG_ENABLE(sound,
AC_HELP_STRING([--enable-sound=[[sdl|ahi|mkit]]], [Use the specified sound handler (default=sdl)]),
[case "${enableval}" in
sdl|SDL|Sdl)
build_sound_sdl=yes
add_sound="sdl"
;;
none|NONE|None)
build_sound_none=yes
add_sound="none"
;;
ahi|AHI|Ahi)
build_sound_ahi=yes
add_sound="ahi"
;;
mkit|MKIT|Mkit)
build_sound_mkit=yes
add_sound="mkit"
;;
esac],
[if test x"${haiku}" = xyes; then
build_sound_mkit=yes
add_sound="mkit"
else
if test x${build_sound_none} = xno; then
build_sound_sdl=yes
add_sound=sdl
fi
fi]
)
AM_CONDITIONAL(BUILD_LIBSOUND, test x${build_sound_none} != xyes)
if test x${build_sound_none} != xyes; then
AC_DEFINE(USE_SOUND, [1], [Build any sound code])
fi
dnl --------------------------------------------------------
dnl Media handler selection
dnl --------------------------------------------------------
build_media_gst=no
build_media_ffmpeg=auto
build_media_none=no
AC_ARG_ENABLE(media,
AC_HELP_STRING([--enable-media=handler],
[Enable media handling support using the specified handlers: ffmpeg gst none(no sound) (default=auto) ]),
if test -n ${enableval}; then
enableval=`echo ${enableval} | tr '\054' ' ' `
fi
dnl When --enable-media is given, all media defaults to off
dnl except the explicitly enabled ones
build_media_ffmpeg=no
build_media_gst=no
while test -n "${enableval}"; do
val=`echo ${enableval} | cut -d ' ' -f 1`
[case "${val}" in
GST|gst)
build_media_gst=yes
media_list="${media_list}gst "
;;
FFMPEG|ffmpeg)
build_media_ffmpeg=yes
media_list="${media_list}ffmpeg "
;;
no|NO|none)
build_media_none=yes
media_list="none"
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-media option])
;;
esac]
enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
if test "x$val" = "x$enableval"; then
break;
fi
done,
[if test x"${build_haiku}" = xyes; then
build_media_ffmpeg=yes
build_media_haiku=yes
media_list="ffmpeg haiku"
else
build_media_gst=yes
media_list="gst"
fi]
)
AM_CONDITIONAL(BUILD_LIBMEDIA, test x${build_media_none} != xyes)
if test x${build_media_none} != xyes; then
AC_DEFINE(USE_MEDIA, [1], [Build any media code])
fi
dnl If no media is selected, and media handling isn't disabled, then enable gst
if test x${build_media_none} = xno -a x${build_media_gst} = xno -a x${build_media_ffmpeg} = xno; then
build_media_gst=yes
fi
if test x"$build_media_ffmpeg" != x"no"; then # yes or auto
GNASH_PATH_FFMPEG
if test x"${build_media_ffmpeg}" = xauto; then
dnl TODO: have GNASH_PATH_FFMPEG set ${has_ffmpeg}
if test x"$FFMPEG_LIBS" != x; then
build_media_ffmpeg=yes
media_list="${media_list} ffmpeg"
else
build_ogl=no
fi
fi
fi
MEDIA_CONFIG="${media_list}"
AC_SUBST(MEDIA_CONFIG)
dnl Multiple input devices are supported. These can all work in
dnl varying combinations, so several may be listed. These are only
dnl required when using the Framebuffer, as without the X11 desktop,
dnl Gnash has to handle all these internally. This can get
dnl messy, as one might want to use a touchscreen with a normal mouse
dnl or keyboard attached.
dnl By default, don't build any of these, as they are only for the
dnl Framebuffer running without X11.
if test x"${build_fb}" = xyes -a x"${linux}" = xyes; then
build_ps2mouse=no
build_ps2keyboard=yes
build_input_events=yes
build_tslib=yes
input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via Tslib"
else
build_ps2mouse=no
build_ps2keyboard=no
build_input_events=no
build_tslib=no
input_events=
fi
AC_ARG_ENABLE(input,
AC_HELP_STRING([--enable-input], [Enable support for the specified input devices for the framebuffer GUI (default=ps2mouse|ps2keyboard|events|touchscreen)]),
[if test -n ${enableval}; then
enableval=`echo ${enableval} | tr '\054' ' ' `
fi
build_ps2mouse=no
build_ps2keyboard=no
build_input_events=no
build_tslib=no
while test -n "${enableval}" ; do
val=`echo ${enableval} | cut -d ' ' -f 1`
case "${val}" in
ps2m*|PS2m*|m*|M*) dnl a PS/2 style mouse
build_ps2mouse=yes
input_events="${input_events}, PS/2 Mouse"
;;
ps2k*|PS2K*|k*|K*) dnl a PS/2 style keyboard
build_ps2keyboard=yes
input_events="${input_events}, PS/2 Keyboard"
;;
i*|I*|ev*|Ev*) dnl use the new Input Event, which supports both
input_events="${input_events}, Input Event Device"
build_input_events=yes
;;
t*|T*) dnl use a touchscreen with tslib, which works like a mouse
build_tslib=yes
input_events="${input_events}, Touchscreen"
;;
a*) dnl all
build_ps2mouse=yes
build_ps2keyboard=yes
build_tslib=yes
if test x"${linux}" = xyes; then
build_input_events=yes
input_events="PS/2 Mouse, PS/2 Keyboard, Input Devices, Touchscreen via Tslib"
else
build_input_events=no
input_events="PS/2 Mouse, PS/2 Keyboard, Touchscreen via Tslib"
fi
;;
*) AC_MSG_ERROR([invalid input device list! ${enableval} given (accept: ps2mouse|keyboard|events,touchscreen)])
;;
esac
enableval=`echo ${enableval} | cut -d ' ' -f 2-6`
if test "x$val" = "x$enableval"; then
break;
fi
done],
)
if test x$build_sdl != xno -o x$build_sound_sdl = xyes; then
GNASH_PATH_SDL
fi
AM_CONDITIONAL(ENABLE_TSLIB, [test x${ac_cv_header_tslib_h} = xyes])
dnl -----------------------------------------------------
dnl Check for SDL and decide about auto gui accordingly.
dnl Need be done after build_sound_sdl and build_sdl are
dnl initialized and before they are checked for yes/no
dnl -----------------------------------------------------
if test x"${build_sdl}" = xauto; then
if test xyes = x"${has_sdl}"; then
build_sdl=yes
else
AC_MSG_NOTICE([sdl GUI will not be built (no sdl development files found)])
build_sdl=no
fi
fi
dnl -------------------------------
dnl Renderer Selection
dnl -------------------------------
input_events=
dnl By default, we want to to build all renderers
dnl DirectFB has both a device layer and a rendering layer, although
dnl currently the rendering part is incomplete. Configure support is
dnl included for development purposes.
build_directfb=no
dnl The OpenVG support works on both the desktop and embedded devices
dnl that don't run X11. It is supported by iPhone/iPad/Android
dnl devices, and the nouveau driver on the desktop.
build_ovg=no
dnl The OpenGLES1 renderer is a work in progress. It is originally
dnl based on a patch to Gnash 0.8.5, which of course not only didn't
dnl compile anymore, it was all hardcoded into the framebuffer
dnl code. This version compiles with the latest internal rendering
dnl API, and works properly with the glue code for the Gnash GUIs.
build_gles1=no
dnl OpenGL works, but suffers from performance and rendering quality
dnl problems. This should eventually be replacd by the OpenGLES1 and
dnl OpenVG renders.
build_ogl=no
dnl AGG is a software only renderer
build_agg=yes
build_cairo=yes
renderer_list="agg cairo"
AC_ARG_ENABLE(renderer,
AC_HELP_STRING([--enable-renderer], [Enable support for the specified renderers (agg|cairo|opengl|openvg|all, default=all)]),
if test -n ${enableval}; then
if test "x${enableval}" != "xno" -o "x${enableval}" != "xnone" ; then
renderer_list="none"
enableval=`echo ${enableval} | tr '\054' ' ' `
else
renderer_list=""
enableval=""
fi
fi
renderer_list=""
build_ovg=no
build_ogl=no
build_gles1=no
build_gles2=no
build_agg=no
build_cairo=no
while test -n "${enableval}" ; do
val=`echo ${enableval} | cut -d ' ' -f 1`
[case "${val}" in
no*|NO*)
renderer_list="none"
build_ovg=no
build_ogl=no
build_gles1=no
build_gles2=no
build_agg=no
build_cairo=no
;;
all|ALL)
renderer_list="agg cairo opengl openvg, opengles1"
build_ogl=yes
build_agg=yes
build_cairo=yes
build_ovg=no
nrender=3
;;
ogl|OGL|OpenGL|opengl)
renderer_list="${renderer_list} opengl"
build_ogl=yes
;;
gles|GLES|gles1|GLES1)
renderer_list="${renderer_list} opengles1"
build_gles1=yes
build_ogl=no
nrender=$((nrender+1))