summaryrefslogtreecommitdiff
path: root/www/firefox/patches/patch-aa
blob: a4e9c2931f92abc81d95886d86f37e9b4c730844 (plain)
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
$NetBSD: patch-aa,v 1.51 2017/04/27 01:49:47 ryoon Exp $

* MOZ_ENABLE_PROFILER_SPS is not for users, Disable it
* Disable libjpeg-turbo check
* Add system libraries option
* Add OSS audio support

--- old-configure.in.orig	2017-04-23 15:21:06.933492440 +0000
+++ old-configure.in
@@ -2084,11 +2084,7 @@ if test "$MOZ_SYSTEM_JPEG" = 1; then
                      #include <jpeglib.h> ],
                    [ #if JPEG_LIB_VERSION < $MOZJPEG
                      #error "Insufficient JPEG library version ($MOZJPEG required)."
-                     #endif
-                     #ifndef JCS_EXTENSIONS
-                     #error "libjpeg-turbo JCS_EXTENSIONS required"
-                     #endif
-                     ],
+                     #endif ],
                    MOZ_SYSTEM_JPEG=1,
                    AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
 fi
@@ -2818,6 +2814,9 @@ if test -n "$MOZ_WEBRTC"; then
     AC_DEFINE(MOZ_WEBRTC_ASSERT_ALWAYS)
     MOZ_RAW=1
 
+    dnl with libv4l2 we can support more cameras
+    PKG_CHECK_MODULES(MOZ_LIBV4L2, libv4l2)
+
 dnl enable once Signaling lands
     MOZ_WEBRTC_SIGNALING=1
     AC_DEFINE(MOZ_WEBRTC_SIGNALING)
@@ -2860,7 +2859,7 @@ dnl Use integers over floats for audio o
 dnl (regarless of the CPU architecture, because audio
 dnl backends for those platforms don't support floats. We also
 dnl use integers on ARM with other OS, because it's more efficient.
-if test "$OS_TARGET" = "Android" -o "$CPU_ARCH" = "arm"; then
+if test -n "$MOZ_INTEGER_SAMPLES"; then
     MOZ_SAMPLE_TYPE_S16=1
     AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
     AC_SUBST(MOZ_SAMPLE_TYPE_S16)
@@ -2968,6 +2967,111 @@ if test -n "$MOZ_OMX_PLUGIN"; then
     fi
 fi
 
+dnl ========================================================
+dnl Check for libogg
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-ogg,
+[  --with-system-ogg       Use system libogg (located with pkgconfig)],
+MOZ_SYSTEM_OGG=1,
+MOZ_SYSTEM_OGG=)
+
+if test -n "$MOZ_SYSTEM_OGG"; then
+    PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.3.0)
+
+    _SAVE_LIBS=$LIBS
+    LIBS="$LIBS $MOZ_OGG_LIBS"
+    AC_CHECK_FUNC(ogg_set_mem_functions, [],
+      [AC_DEFINE(MOZ_OGG_NO_MEM_REPORTING)])
+    LIBS=$_SAVE_LIBS
+fi
+
+AC_SUBST(MOZ_SYSTEM_OGG)
+
+dnl ========================================================
+dnl Check for libvorbis
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-vorbis,
+[  --with-system-vorbis    Use system libvorbis (located with pkgconfig)],
+MOZ_SYSTEM_VORBIS=1,
+MOZ_SYSTEM_VORBIS=)
+
+if test -n "$MOZ_SYSTEM_VORBIS"; then
+    PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.5)
+fi
+
+AC_SUBST(MOZ_SYSTEM_VORBIS)
+
+dnl ========================================================
+dnl Check for integer-only libvorbis aka tremor
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-tremor,
+[  --with-system-tremor    Use system libtremor (located with pkgconfig)],
+MOZ_SYSTEM_TREMOR=1,
+MOZ_SYSTEM_TREMOR=)
+
+if test -n "$MOZ_SYSTEM_TREMOR"; then
+    PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
+fi
+
+AC_SUBST(MOZ_SYSTEM_TREMOR)
+
+dnl ========================================================
+dnl Check for libtheora
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-theora,
+[  --with-system-theora    Use system libtheora (located with pkgconfig)],
+MOZ_SYSTEM_THEORA=1,
+MOZ_SYSTEM_THEORA=)
+
+if test -n "$MOZ_SYSTEM_THEORA"; then
+    PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
+fi
+
+AC_SUBST(MOZ_SYSTEM_THEORA)
+
+dnl ========================================================
+dnl Check for libSoundTouch
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-soundtouch,
+[  --with-system-soundtouch Use system libSoundTouch (located with pkgconfig)],
+MOZ_SYSTEM_SOUNDTOUCH=1,
+MOZ_SYSTEM_SOUNDTOUCH=)
+
+if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then
+    PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.9.0)
+
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    _SAVE_CXXFLAGS=$CXXFLAGS
+    CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS"
+    AC_CACHE_CHECK(for soundtouch sample type,
+                   ac_cv_soundtouch_sample_type,
+                   [AC_TRY_COMPILE([#include <SoundTouch.h>
+                                    #ifndef SOUNDTOUCH_INTEGER_SAMPLES
+                                    #error soundtouch expects float samples
+                                    #endif],
+                                   [],
+                                   [ac_cv_soundtouch_sample_type=short],
+                                   [ac_cv_soundtouch_sample_type=float])])
+    CXXFLAGS=$_SAVE_CXXFLAGS
+    AC_LANG_RESTORE
+
+    if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \
+         -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then
+        AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.])
+    fi
+fi
+
+if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then
+    AC_DEFINE(MOZ_SYSTEM_SOUNDTOUCH)
+fi
+AC_SUBST(MOZ_SYSTEM_SOUNDTOUCH)
+
 dnl system libvpx Support
 dnl ========================================================
 MOZ_ARG_WITH_BOOL(system-libvpx,
@@ -3128,6 +3232,67 @@ AC_DEFINE(MOZ_WEBM_ENCODER)
 AC_SUBST(MOZ_WEBM_ENCODER)
 
 dnl ==================================
+dnl = Check OSS availability
+dnl ==================================
+
+dnl If using Linux, Solaris or BSDs, ensure that OSS is available
+case "$OS_TARGET" in
+Linux|SunOS|DragonFly|FreeBSD|NetBSD|GNU/kFreeBSD)
+    MOZ_OSS=1
+    ;;
+esac
+
+MOZ_ARG_WITH_STRING(oss,
+[  --with-oss[=PFX]        Enable OpenSoundSystem support [installed at prefix PFX]],
+   OSSPREFIX=$withval)
+
+if test -n "$OSSPREFIX"; then
+    if test "$OSSPREFIX" != "no"; then
+        MOZ_OSS=1
+    else
+        MOZ_OSS=
+    fi
+fi
+
+_SAVE_CFLAGS=$CFLAGS
+_SAVE_LIBS=$LIBS
+if test -n "$MOZ_OSS"; then
+    dnl Prefer 4Front implementation
+    AC_MSG_CHECKING([MOZ_OSS_CFLAGS])
+    if test "$OSSPREFIX" != "yes"; then
+        oss_conf=${OSSPREFIX%/usr}/etc/oss.conf
+        if test -f "$oss_conf"; then
+            . "$oss_conf"
+        else
+            OSSLIBDIR=$OSSPREFIX/lib/oss
+        fi
+        if test -d "$OSSLIBDIR"; then
+            MOZ_OSS_CFLAGS="$MOZ_OSS_CFLAGS -I$OSSLIBDIR/include"
+        fi
+    fi
+    AC_MSG_RESULT([$MOZ_OSS_CFLAGS])
+
+    CFLAGS="$CFLAGS $MOZ_OSS_CFLAGS"
+    MOZ_CHECK_HEADERS(sys/soundcard.h soundcard.h)
+
+    if test "$ac_cv_header_sys_soundcard_h" != "yes" -a \
+            "$ac_cv_header_soundcard_h" != "yes"; then
+        AC_MSG_ERROR([Need OSS for Ogg, Wave or WebM decoding on $OS_TARGET.  Disable with --without-oss.])
+    fi
+
+    dnl Assume NetBSD implementation over SunAudio
+    AC_CHECK_LIB(ossaudio, _oss_ioctl,
+        [AC_DEFINE_UNQUOTED(CUBEB_OSS_DEFAULT_OUTPUT, "/dev/sound")
+         MOZ_OSS_LIBS="$MOZ_OSS_LIBS -lossaudio"])
+fi
+CFLAGS=$_SAVE_CFLAGS
+LIBS=$_SAVE_LIBS
+
+AC_SUBST(MOZ_OSS)
+AC_SUBST_LIST(MOZ_OSS_CFLAGS)
+AC_SUBST_LIST(MOZ_OSS_LIBS)
+
+dnl ==================================
 dnl = Check alsa availability on Linux
 dnl ==================================
 
@@ -4860,6 +5025,27 @@ dnl ====================================
 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
 
 dnl ========================================================
+dnl Check for graphite2
+dnl ========================================================
+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
+    dnl graphite2.pc has bogus version, check manually
+    _SAVE_CFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
+    AC_TRY_COMPILE([ #include <graphite2/Font.h>
+                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
+                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
+                               * 100 + GR2_VERSION_BUGFIX >= \
+                               (major) * 10000 + (minor) * 100 + (bugfix) )
+                   ], [
+                     #if !GR2_VERSION_REQUIRE(1,3,8)
+                     #error "Insufficient graphite2 version."
+                     #endif
+                   ], [],
+                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
+    CFLAGS=$_SAVE_CFLAGS
+fi
+
+dnl ========================================================
 dnl Check for pixman and cairo
 dnl ========================================================