4 # Date created: 12 Nov 2005
5 # Whom: Michael Johnson <ahze@FreeBSD.org>
9 # 4 column tabs prevent hair loss and tooth decay!
11 # bsd.gecko.mk abstracts the selection of gecko-based backends. It allows users
12 # and porters to support any available gecko backend without needing to build
13 # many conditional tests. ${USE_GECKO} is the list of backends that your port
14 # can handle, and ${GECKO} is set by bsd.gecko.mk to be the chosen backend.
15 # Users set ${WITH_GECKO} to the list of gecko backends they want on their
18 .if defined(USE_GECKO)
19 .if !defined(_POSTMKINCLUDED) && !defined(Gecko_Pre_Include)
20 Gecko_Pre_Include= bsd.gecko.mk
22 # This file contains some reusable components for mozilla ports. It's of
23 # use primarily to apps from the mozilla project itself (such as Firefox,
24 # Thunderbird, etc.), and probably won't be of use for gecko-based ports
25 # like epiphany, galeon, etc.
27 # You need to make sure to add USE_GECKO=gecko to for your port can uses
28 # one of these options below.
30 # Ports can use the following:
32 # USE_MOZILLA By default, it enables every system dependency
33 # listed in '_ALL_DEPENDS'. If your port doesn't
34 # need one of those then you can use '-' like
35 # 'USE_MOZILLA= -png -vpx' to subtract the
36 # dependencies. Experimental deps use '+' like
37 # 'USE_MOZILLA= +speex +theora'.
39 # MOZILLA_PLIST_DIRS List of directories to descend into when installing
40 # and creating the plist
42 # MOZ_PIS_SCRIPTS List of scripts residing in ${FILESDIR} to be
43 # filtered through MOZCONFIG_SED and installed along
44 # with our Pluggable Init Scripts (PIS)
46 # MOZ_SED_ARGS sed(1) commands through which MOZ_PIS_SCRIPTS are
47 # filtered. There is a default set defined here, so
48 # you probably want to add to MOZ_SED_ARGS rather
51 # MOZ_OPTIONS configure arguments (added to .mozconfig). If
52 # NOMOZCONFIG is defined, you probably want to set
53 # CONFIGURE_ARGS+=${MOZ_OPTIONS}
55 # MOZ_MK_OPTIONS The make(1) arguments (added to .mozconfig). If
56 # NOMOZCONFIG is defined, you probably want to set
57 # MAKE_ARGS+=${MOZ_MK_OPTIONS}
59 # MOZ_EXPORT Environment variables for the build process (added
60 # to .mozconfig). If NOMOZCONFIG is defined, you
61 # probably want to set MAKE_ENV+=${MOZ_EXPORT}
63 # MOZ_CHROME A variable for the --enable-chrome-format= in
64 # CONFIGURE_ARGS. The default is omni.
66 # MOZ_TOOLKIT A variable for the --enable-default-toolkit= in
67 # CONFIGURE_ARGS. The default is cairo-gtk2.
69 # MOZ_EXTENSIONS A list of extensions to build
71 # PORT_MOZCONFIG Defaults to ${FILESDIR}/mozconfig.in, but can be
72 # set to a generic mozconfig included with the port
74 # NOMOZCONFIG Don't drop a customized .mozconfig into the build
75 # directory. Options will have to be specified in
76 # CONFIGURE_ARGS instead
79 MAINTAINER?= gecko@FreeBSD.org
82 MOZILLA_VER?= ${PORTVERSION}
83 MOZILLA_BIN?= ${PORTNAME}-bin
84 MOZILLA_EXEC_NAME?=${MOZILLA}
85 MOZ_RPATH?= ${MOZILLA}
86 USES+= cpe gmake iconv localbase perl5 pkgconfig \
87 python:2.7,build desktop-file-utils
90 USE_XORG= x11 xcomposite xdamage xext xfixes xrender xt
92 .if ${MOZILLA} != "libxul"
96 .if ${MOZILLA_VER:R:R} >= 49
97 USES+= compiler:c++14-lang
98 CPPFLAGS+= -D_GLIBCXX_USE_C99 -D_GLIBCXX_USE_C99_MATH_TR1 \
99 -D_DECLARE_C99_LDBL_MATH # XXX ports/193528
101 USES+= compiler:c++11-lang
104 .if ${MOZILLA_VER:R:R} >= 50
108 .if ${OPSYS} == FreeBSD && ${OSREL} == 11.1
114 WRKSRC?= ${WRKDIR}/mozilla
115 PLISTF?= ${WRKDIR}/plist_files
117 MOZ_OBJDIR?= ${WRKSRC}/obj-${ARCH:C/amd64/x86_64/}-unknown-${OPSYS:tl}${OSREL}
119 MOZ_PIS_DIR?= lib/${MOZILLA}/init.d
121 PORT_MOZCONFIG?= ${FILESDIR}/mozconfig.in
122 MOZCONFIG?= ${WRKSRC}/.mozconfig
123 # XXX Not ?= because fmake uses MAKEFILE internally
124 MAKEFILE= ${WRKSRC}/client.mk
125 MOZILLA_PLIST_DIRS?= bin lib share/pixmaps share/applications
126 PKGINSTALL?= ${WRKDIR}/pkg-install
127 PKGDEINSTALL?= ${WRKDIR}/pkg-deinstall
128 PKGINSTALL_INC?= ${.CURDIR}/../../www/firefox/files/pkg-install.in
129 PKGDEINSTALL_INC?= ${.CURDIR}/../../www/firefox/files/pkg-deinstall.in
131 MOZ_PKGCONFIG_FILES?= ${MOZILLA}-gtkmozembed ${MOZILLA}-js \
132 ${MOZILLA}-xpcom ${MOZILLA}-plugin
136 MOZ_EXPORT+= ${CONFIGURE_ENV} \
138 MOZ_OPTIONS+= --prefix="${PREFIX}"
139 MOZ_MK_OPTIONS+=MOZ_OBJDIR="${MOZ_OBJDIR}"
141 LDFLAGS+= -Wl,--as-needed
143 .if ${MOZILLA_VER:R:R} < 55 && ${OPSYS} == FreeBSD && ${OSVERSION} < 1200032
144 # use jemalloc 3.0.0 (4.0 for firefox 43+) API for stats/tuning
145 MOZ_EXPORT+= MOZ_JEMALLOC4=1
146 .if ${MOZILLA_VER:R:R} >= 48
147 MOZ_OPTIONS+= --enable-jemalloc=4
148 .elif ${OSVERSION} < 1100079
149 MOZ_OPTIONS+= --enable-jemalloc
150 .endif # Mozilla >= 48
151 .endif # Mozilla < 55
154 _ALL_DEPENDS= cairo event ffi graphite harfbuzz hunspell icu jpeg nspr nss png pixman soundtouch sqlite vpx
156 .if ${PORT_OPTIONS:MINTEGER_SAMPLES}
157 MOZ_EXPORT+= MOZ_INTEGER_SAMPLES=1
158 _ALL_DEPENDS+= tremor
160 _ALL_DEPENDS+= vorbis
163 .if ! ${PORT_OPTIONS:MBUNDLED_CAIRO}
164 cairo_BUILD_DEPENDS=cairo>=1.12.16_1,2:graphics/cairo
165 cairo_LIB_DEPENDS= libcairo.so:graphics/cairo
166 cairo_MOZ_OPTIONS= --enable-system-cairo
169 event_LIB_DEPENDS= libevent.so:devel/libevent
170 event_MOZ_OPTIONS= --with-system-libevent
172 ffi_LIB_DEPENDS= libffi.so:devel/libffi
173 ffi_MOZ_OPTIONS= --enable-system-ffi
175 .if exists(${FILESDIR}/patch-bug847568)
176 graphite_LIB_DEPENDS= libgraphite2.so:graphics/graphite2
177 graphite_MOZ_OPTIONS= --with-system-graphite2
179 harfbuzz_LIB_DEPENDS= libharfbuzz.so:print/harfbuzz
180 harfbuzz_MOZ_OPTIONS= --with-system-harfbuzz
183 hunspell_LIB_DEPENDS= libhunspell-1.6.so:textproc/hunspell
184 hunspell_MOZ_OPTIONS= --enable-system-hunspell
186 icu_LIB_DEPENDS= libicui18n.so:devel/icu
187 icu_MOZ_OPTIONS= --with-system-icu --with-intl-api
189 -jpeg_BUILD_DEPENDS=yasm:devel/yasm
190 # XXX Remove files/patch-ijg-libjpeg once -turbo is default
192 jpeg_MOZ_OPTIONS= --with-system-jpeg=${LOCALBASE}
194 nspr_LIB_DEPENDS= libnspr4.so:devel/nspr
195 nspr_MOZ_OPTIONS= --with-system-nspr
197 nss_LIB_DEPENDS= libnss3.so:security/nss
198 nss_MOZ_OPTIONS= --with-system-nss
200 pixman_LIB_DEPENDS= libpixman-1.so:x11/pixman
201 pixman_MOZ_OPTIONS= --enable-system-pixman
203 png_LIB_DEPENDS= libpng.so:graphics/png
204 png_MOZ_OPTIONS= --with-system-png=${LOCALBASE}
206 .if exists(${FILESDIR}/patch-z-bug517422)
207 soundtouch_LIB_DEPENDS= libSoundTouch.so:audio/soundtouch
208 soundtouch_MOZ_OPTIONS= --with-system-soundtouch
211 sqlite_LIB_DEPENDS= libsqlite3.so:databases/sqlite3
212 sqlite_MOZ_OPTIONS= --enable-system-sqlite
214 .if exists(${FILESDIR}/patch-z-bug517422)
215 # XXX disabled: update to 1.2.x or review backported fixes
216 theora_LIB_DEPENDS= libtheora.so:multimedia/libtheora
217 theora_MOZ_OPTIONS= --with-system-theora
219 tremor_LIB_DEPENDS= libogg.so:audio/libogg libvorbisidec.so:audio/libtremor
220 tremor_MOZ_OPTIONS= --with-system-tremor --with-system-ogg
222 vorbis_LIB_DEPENDS= libogg.so:audio/libogg libvorbis.so:audio/libvorbis
223 vorbis_MOZ_OPTIONS= --with-system-vorbis --with-system-ogg
226 -vpx_BUILD_DEPENDS= yasm:devel/yasm
227 vpx_LIB_DEPENDS= libvpx.so:multimedia/libvpx
228 vpx_MOZ_OPTIONS= --with-system-libvpx
230 .for use in ${USE_MOZILLA}
231 ${use:S/-/_WITHOUT_/}= ${TRUE}
234 LIB_DEPENDS+= libfontconfig.so:x11-fonts/fontconfig \
235 libfreetype.so:print/freetype2
237 .for dep in ${_ALL_DEPENDS} ${USE_MOZILLA:M+*:S/+//}
238 .if !defined(_WITHOUT_${dep})
239 BUILD_DEPENDS+= ${${dep}_BUILD_DEPENDS}
240 LIB_DEPENDS+= ${${dep}_LIB_DEPENDS}
241 RUN_DEPENDS+= ${${dep}_RUN_DEPENDS}
242 USES+= ${${dep}_USES}
243 MOZ_OPTIONS+= ${${dep}_MOZ_OPTIONS}
245 BUILD_DEPENDS+= ${-${dep}_BUILD_DEPENDS}
251 MOZ_TOOLKIT?= cairo-gtk3
252 MOZ_CHANNEL?= ${PKGNAMESUFFIX:Urelease:S/^-//}
254 --enable-chrome-format=${MOZ_CHROME} \
255 --enable-default-toolkit=${MOZ_TOOLKIT} \
256 --enable-update-channel=${MOZ_CHANNEL} \
260 # Configure options for install
261 .if !defined(MOZ_EXTENSIONS)
262 MOZ_OPTIONS+= --enable-extensions=default
264 MOZ_OPTIONS+= --enable-extensions=${MOZ_EXTENSIONS}
267 MOZ_OPTIONS+= --with-system-zlib \
270 # API keys from www/chromium
271 # http://www.chromium.org/developers/how-tos/api-keys
272 # Note: these are for FreeBSD use ONLY. For your own distribution,
273 # please get your own set of keys.
274 MOZ_EXPORT+= MOZ_GOOGLE_API_KEY=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8
276 .if ${PORT_OPTIONS:MGTK2}
277 MOZ_TOOLKIT= cairo-gtk2
280 .if ${MOZ_TOOLKIT:Mcairo-gtk3}
281 BUILD_DEPENDS+= gtk3>=3.14.6:x11-toolkits/gtk30
282 USE_GNOME+= gdkpixbuf2 gtk20 gtk30
283 .else # gtk2, cairo-gtk2
284 USE_GNOME+= gdkpixbuf2 gtk20
287 .if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
289 MOZ_EXPORT+= MOZ_OPTIMIZE_FLAGS="${CFLAGS:M-O*}"
290 MOZ_OPTIONS+= --enable-optimize
292 MOZ_OPTIONS+= --disable-optimize
295 .if ${PORT_OPTIONS:MCANBERRA}
296 RUN_DEPENDS+= libcanberra>0:audio/libcanberra
299 .if ${PORT_OPTIONS:MDBUS}
300 BUILD_DEPENDS+= libnotify>0:devel/libnotify
301 LIB_DEPENDS+= libdbus-1.so:devel/dbus \
302 libdbus-glib-1.so:devel/dbus-glib \
303 libstartup-notification-1.so:x11/startup-notification
304 MOZ_OPTIONS+= --enable-startup-notification
306 MOZ_OPTIONS+= --disable-dbus
309 .if ${PORT_OPTIONS:MFFMPEG}
310 # dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
311 RUN_DEPENDS+= ffmpeg>=0.8,1:multimedia/ffmpeg
314 .if ${MOZILLA_VER:R:R} < 46
315 MOZ_OPTIONS+= --disable-gstreamer
318 .if ${PORT_OPTIONS:MGCONF}
319 BUILD_DEPENDS+= ${gconf2_DETECT}:${gconf2_LIB_DEPENDS:C/.*://}
320 USE_GNOME+= gconf2:build
321 MOZ_OPTIONS+= --enable-gconf
323 MOZ_OPTIONS+= --disable-gconf
326 .if ${MOZILLA_VER:R:R} < 55
327 .if ${PORT_OPTIONS:MGNOMEUI}
328 BUILD_DEPENDS+= ${libgnomeui_DETECT}:${libgnomeui_LIB_DEPENDS:C/.*://}
329 USE_GNOME+= libgnomeui:build
330 MOZ_OPTIONS+= --enable-gnomeui
332 MOZ_OPTIONS+= --disable-gnomeui
334 .endif # Mozilla < 55
336 .if ${PORT_OPTIONS:MLIBPROXY}
337 LIB_DEPENDS+= libproxy.so:net/libproxy
338 MOZ_OPTIONS+= --enable-libproxy
340 MOZ_OPTIONS+= --disable-libproxy
343 .if ${PORT_OPTIONS:MPGO}
344 USES:= compiler:gcc-c++11-lib ${USES:Ncompiler*c++11*}
347 ALL_TARGET= profiledbuild
348 MOZ_EXPORT+=MOZ_OPTIMIZE_FLAGS="-Os" MOZ_PGO_OPTIMIZE_FLAGS="${CFLAGS:M-O*}"
351 .if ${PORT_OPTIONS:MALSA}
352 LIB_DEPENDS+= libasound.so:audio/alsa-lib
353 RUN_DEPENDS+= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins
354 RUN_DEPENDS+= alsa-lib>=1.1.1_1:audio/alsa-lib
355 MOZ_OPTIONS+= --enable-alsa
358 .if ${PORT_OPTIONS:MJACK}
359 BUILD_DEPENDS+= ${LOCALBASE}/include/jack/jack.h:audio/jack
360 MOZ_OPTIONS+= --enable-jack
363 .if ${PORT_OPTIONS:MPULSEAUDIO}
364 BUILD_DEPENDS+= ${LOCALBASE}/include/pulse/pulseaudio.h:audio/pulseaudio
365 MOZ_OPTIONS+= --enable-pulseaudio
367 MOZ_OPTIONS+= --disable-pulseaudio
370 .if ${PORT_OPTIONS:MSNDIO}
371 LIB_DEPENDS+= libsndio.so:audio/sndio
373 @${REINPLACE_CMD} -e 's|OpenBSD|${OPSYS}|g' \
374 ${MOZSRC}/media/libcubeb/src/moz.build \
375 ${MOZSRC}/toolkit/library/moz.build
376 . for tests in tests gtest
377 @if [ -f "${MOZSRC}/media/libcubeb/${tests}/moz.build" ]; then \
378 ${REINPLACE_CMD} -e 's|OpenBSD|${OPSYS}|g' \
379 ${MOZSRC}/media/libcubeb/${tests}/moz.build \
382 @${REINPLACE_CMD} -e 's|OS==\"openbsd\"|OS==\"${OPSYS:tl}\"|g' \
383 ${MOZSRC}/media/webrtc/trunk/webrtc/build/common.gypi
384 @${ECHO} "OS_LIBS += ['sndio']" >> \
385 ${MOZSRC}/media/webrtc/signaling/test/common.build
388 .if ${PORT_OPTIONS:MRUST} || ${MOZILLA_VER:R:R} >= 54
389 BUILD_DEPENDS+= rust>=1.19.0_2:${RUST_PORT}
390 RUST_PORT?= lang/rust
391 . if ${MOZILLA_VER:R:R} < 54
392 MOZ_OPTIONS+= --enable-rust
395 MOZ_OPTIONS+= --disable-rust
398 .if ${PORT_OPTIONS:MDEBUG}
399 MOZ_OPTIONS+= --enable-debug --disable-release
400 STRIP= # ports/184285
402 MOZ_OPTIONS+= --disable-debug --disable-debug-symbols --enable-release
403 . if ${MOZILLA_VER:R:R} >= 56
404 MOZ_OPTIONS+= --enable-rust-simd
408 .if ${PORT_OPTIONS:MDTRACE}
409 MOZ_OPTIONS+= --enable-dtrace \
411 . if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100061
417 MOZ_OPTIONS+= --disable-dtrace
420 .if ${PORT_OPTIONS:MPROFILE}
421 MOZ_OPTIONS+= --enable-profiling
424 MOZ_OPTIONS+= --disable-profiling
427 .if ${PORT_OPTIONS:MTEST}
428 USE_XORG+= xscrnsaver
429 MOZ_OPTIONS+= --enable-tests
431 MOZ_OPTIONS+= --disable-tests
434 .if !defined(STRIP) || ${STRIP} == ""
435 MOZ_OPTIONS+= --disable-strip --disable-install-strip
437 MOZ_OPTIONS+= --enable-strip --enable-install-strip
440 # _MAKE_JOBS is only available after bsd.port.post.mk, thus cannot be
441 # used in .mozconfig. And client.mk automatically uses -jN where N
442 # is what multiprocessing.cpu_count() returns.
443 .if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
446 .if defined(MAKE_JOBS_NUMBER)
447 MOZ_MAKE_FLAGS+=-j${MAKE_JOBS_NUMBER}
450 .if defined(MOZ_MAKE_FLAGS)
451 MOZ_MK_OPTIONS+=MOZ_MAKE_FLAGS="${MOZ_MAKE_FLAGS}"
454 MOZ_SED_ARGS+= -e's|@CPPFLAGS@|${CPPFLAGS}|g' \
455 -e 's|@CFLAGS@|${CFLAGS}|g' \
456 -e 's|@LDFLAGS@|${LDFLAGS}|g' \
457 -e 's|@LIBS@|${LIBS}|g' \
458 -e 's|@LOCALBASE@|${LOCALBASE}|g' \
459 -e 's|@PERL@|${PERL}|g' \
460 -e 's|@MOZDIR@|${PREFIX}/lib/${MOZILLA}|g' \
461 -e 's|%%PREFIX%%|${PREFIX}|g' \
462 -e 's|%%CFLAGS%%|${CFLAGS}|g' \
463 -e 's|%%LDFLAGS%%|${LDFLAGS}|g' \
464 -e 's|%%LIBS%%|${LIBS}|g' \
465 -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
466 -e 's|%%PERL%%|${PERL}|g' \
467 -e 's|%%MOZILLA%%|${MOZILLA}|g' \
468 -e 's|%%MOZILLA_BIN%%|${MOZILLA_BIN}|g' \
469 -e 's|%%MOZDIR%%|${PREFIX}/lib/${MOZILLA}|g'
470 MOZCONFIG_SED?= ${SED} ${MOZ_SED_ARGS}
473 . if ${USE_MOZILLA:M-nss}
474 USE_BINUTILS= # intel-gcm.s
475 CFLAGS+= -B${LOCALBASE}/bin
476 LDFLAGS+= -B${LOCALBASE}/bin
478 .elif ${ARCH:Mpowerpc*}
479 . if ${ARCH} == "powerpc64"
480 MOZ_EXPORT+= UNAME_m="${ARCH}"
481 CFLAGS+= -mminimal-toc
483 .elif ${ARCH} == "sparc64"
484 # Work around miscompilation/mislinkage of the sCanonicalVTable hacks.
485 MOZ_OPTIONS+= --disable-v1-string-abi
488 .else # bsd.port.post.mk
490 pre-extract: gecko-pre-extract
493 .if ${PORT_OPTIONS:MPGO}
494 @${ECHO} "*****************************************************************"
495 @${ECHO} "**************************** attention **************************"
496 @${ECHO} "*****************************************************************"
497 @${ECHO} "To build ${MOZILLA} with PGO support you need a running X server and"
498 @${ECHO} " build this port with an user who could access the X server! "
500 @${ECHO} "During the build a ${MOZILLA} instance will start and run some test."
501 @${ECHO} " Do not interrupt or close ${MOZILLA} during these tests! "
502 @${ECHO} "*****************************************************************"
506 post-patch: gecko-post-patch gecko-moz-pis-patch
509 .if exists(${PKGINSTALL_INC})
510 @${MOZCONFIG_SED} < ${PKGINSTALL_INC} > ${PKGINSTALL}
512 .if exists(${PKGDEINSTALL_INC})
513 @${MOZCONFIG_SED} < ${PKGDEINSTALL_INC} > ${PKGDEINSTALL}
516 .if !defined(NOMOZCONFIG)
517 @if [ -e ${PORT_MOZCONFIG} ] ; then \
518 ${MOZCONFIG_SED} < ${PORT_MOZCONFIG} >> ${MOZCONFIG} ; \
520 .for arg in ${MOZ_OPTIONS}
521 @${ECHO_CMD} ac_add_options ${arg:Q} >> ${MOZCONFIG}
523 .for arg in ${MOZ_MK_OPTIONS}
524 @${ECHO_CMD} mk_add_options ${arg:Q} >> ${MOZCONFIG}
526 .for var in ${MOZ_EXPORT}
527 @${ECHO_CMD} export ${var:Q} >> ${MOZCONFIG}
529 .endif # .if !defined(NOMOZCONFIG)
530 .if exists(${MOZSRC}/build/unix/mozilla-config.in)
531 @${REINPLACE_CMD} -e 's/%{idldir}/%idldir%/g ; \
532 s|"%FULL_NSPR_CFLAGS%"|`nspr-config --cflags`|g ; \
533 s|"%FULL_NSPR_LIBS%"|`nspr-config --libs`|g' \
534 ${MOZSRC}/build/unix/mozilla-config.in
536 .if ${USE_MOZILLA:M-nspr}
537 @${ECHO_MSG} "===> Applying NSPR patches"
538 @for i in ${.CURDIR}/../../devel/nspr/files/patch-*; do \
539 ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/nsprpub < $$i; \
542 .if ${USE_MOZILLA:M-nss}
543 @${ECHO_MSG} "===> Applying NSS patches"
544 @for i in ${.CURDIR}/../../security/nss/files/patch-*; do \
545 ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/security/nss < $$i; \
549 ${WRKSRC}/directory/c-sdk/config/FreeBSD.mk \
550 ${WRKSRC}/directory/c-sdk/configure \
551 ${MOZSRC}/security/coreconf/FreeBSD.mk \
552 ${MOZSRC}/js/src/Makefile.in \
553 ${MOZSRC}/js/src/configure \
554 ${MOZSRC}/configure \
555 ${WRKSRC}/configure; do \
556 if [ -f $$f ] ; then \
557 ${REINPLACE_CMD} -Ee 's|-lc_r|-pthread|g ; \
558 s|-l?pthread|-pthread|g ; \
559 s|echo aout|echo elf|g ; \
560 s|/usr/X11R6|${LOCALBASE}|g' \
564 @if [ -f ${WRKSRC}/config/baseconfig.mk ] ; then \
565 ${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \
566 ${WRKSRC}/config/baseconfig.mk; \
568 @${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \
569 ${MOZSRC}/config/baseconfig.mk
570 @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g ; \
571 s|%%LOCALBASE%%|${LOCALBASE}|g' \
572 ${MOZSRC}/build/unix/run-mozilla.sh
573 @${REINPLACE_CMD} -e 's|/usr/local/netscape|${LOCALBASE}|g ; \
574 s|/usr/local/lib/netscape|${LOCALBASE}/lib|g' \
575 ${MOZSRC}/xpcom/io/SpecialSystemDirectory.cpp
576 @${REINPLACE_CMD} -e 's|/etc|${PREFIX}&|g' \
577 ${MOZSRC}/xpcom/build/nsXPCOMPrivate.h
578 @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
579 -e 's|mozilla/plugins|browser_plugins|g' \
580 -e 's|share/mozilla/extensions|lib/xpi|g' \
581 ${MOZSRC}/xpcom/io/nsAppFileLocationProvider.cpp \
582 ${MOZSRC}/toolkit/xre/nsXREDirProvider.cpp
583 @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
584 ${MOZSRC}/extensions/spellcheck/hunspell/*/mozHunspell.cpp
586 # handles mozilla pis scripts.
588 .for moz in ${MOZ_PIS_SCRIPTS}
589 @${MOZCONFIG_SED} < ${FILESDIR}/${moz} > ${WRKDIR}/${moz}
592 do-configure: gecko-do-configure
595 @(if ! ${CONFIGURE_ENV} ${DO_MAKE_BUILD} configure; then \
596 ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \
597 (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT_80} ; \
601 pre-install: gecko-moz-pis-pre-install
602 post-install-script: gecko-create-plist
607 .for dir in ${MOZILLA_PLIST_DIRS}
608 @cd ${STAGEDIR}${PREFIX}/${dir} && ${FIND} -H -s * ! -type d | \
609 ${SED} -e 's|^|${dir}/|' >> ${PLISTF}
611 ${CAT} ${PLISTF} | ${SORT} >> ${TMPPLIST}
613 gecko-moz-pis-pre-install:
614 .if defined(MOZ_PIS_SCRIPTS)
615 ${MKDIR} ${STAGEDIR}${PREFIX}/${MOZ_PIS_DIR}
616 .for moz in ${MOZ_PIS_SCRIPTS}
617 ${INSTALL_SCRIPT} ${WRKDIR}/${moz} ${STAGEDIR}${PREFIX}/${MOZ_PIS_DIR}
623 # HERE THERE BE TACOS -- adamw