need dependency on bash for REPLACE_BASH to work properly.
[pkgsrcv2.git] / devel / xulrunner / mozilla-common.mk
1 # $NetBSD: mozilla-common.mk,v 1.20 2011/04/26 14:16:36 tnn Exp $
2 #
3 # common Makefile fragment for mozilla packages based on gecko 2.0.
4
5 # used by devel/xulrunner/Makefile
6 # used by mail/thunderbird/Makefile
7 # used by www/firefox/Makefile
8 # used by www/seamonkey/Makefile
9
10 GNU_CONFIGURE=          yes
11 USE_TOOLS+=             pkg-config perl gmake autoconf213
12 USE_LANGUAGES+=         c99 c++
13 UNLIMIT_RESOURCES+=     datasize
14
15 BUILD_DEPENDS+=         zip>=2.3:../../archivers/zip
16
17 PKG_DESTDIR_SUPPORT=    user-destdir
18 CHECK_PORTABILITY_SKIP+=${MOZILLA_DIR}security/nss/tests/libpkix/libpkix.sh
19 CHECK_PORTABILITY_SKIP+=${MOZILLA_DIR}security/nss/tests/multinit/multinit.sh
20 PRIVILEGED_STAGES+=     clean
21
22 CONFIGURE_ARGS+=        --disable-tests --disable-pedantic
23 CONFIGURE_ARGS+=        --enable-crypto
24 CONFIGURE_ARGS+=        --enable-optimize=-O2 --with-pthreads
25 CONFIGURE_ARGS+=        --disable-javaxpcom
26 CONFIGURE_ARGS+=        --enable-default-toolkit=cairo-gtk2
27 CONFIGURE_ARGS+=        --enable-svg --enable-mathml
28 # Needs tee and subpixel functions which are not shipped in stable cairo (yet?)
29 CONFIGURE_ARGS+=        --disable-system-cairo
30 CONFIGURE_ARGS+=        --disable-system-pixman
31 CONFIGURE_ARGS+=        --with-system-jpeg
32 CONFIGURE_ARGS+=        --with-system-zlib --with-system-bz2
33 CONFIGURE_ARGS+=        --enable-system-sqlite
34 CONFIGURE_ARGS+=        --disable-crashreporter
35 CONFIGURE_ARGS+=        --disable-libnotify
36 CONFIGURE_ARGS+=        --disable-necko-wifi
37 CONFIGURE_ARGS+=        --disable-ipc   # no chromium platform support on BSD
38
39 SUBST_CLASSES+=                 fix-paths
40 SUBST_STAGE.fix-paths=          pre-configure
41 SUBST_MESSAGE.fix-paths=        Fixing absolute paths.
42 SUBST_FILES.fix-paths=          ${MOZILLA_DIR}xpcom/build/nsXPCOMPrivate.h
43 SUBST_FILES.fix-paths+=         ${MOZILLA_DIR}xulrunner/app/nsRegisterGREUnix.cpp
44 SUBST_FILES.fix-paths+=         ${MOZILLA_DIR}xulrunner/installer/Makefile.in
45 SUBST_FILES.fix-paths+=         ${MOZILLA_DIR}extensions/java/xpcom/interfaces/org/mozilla/xpcom/Mozilla.java
46 SUBST_FILES.fix-paths+=         ${MOZILLA_DIR}xpcom/io/nsAppFileLocationProvider.cpp
47 SUBST_SED.fix-paths=            -e 's,/etc/gre.d,${PREFIX}/lib/xulrunner/gre.d,g'
48 SUBST_SED.fix-paths+=           -e 's,/usr/lib/mozilla/plugins,${PREFIX}/lib/netscape/plugins,g'
49
50 CONFIG_GUESS_OVERRIDE+=         ${MOZILLA_DIR}build/autoconf/config.guess
51 CONFIG_GUESS_OVERRIDE+=         ${MOZILLA_DIR}js/src/build/autoconf/config.guess
52 CONFIG_GUESS_OVERRIDE+=         ${MOZILLA_DIR}nsprpub/build/autoconf/config.guess
53 CONFIG_GUESS_OVERRIDE+=         ${MOZILLA_DIR}/js/ctypes/libffi/config.guess
54 CONFIG_SUB_OVERRIDE+=           ${MOZILLA_DIR}build/autoconf/config.sub
55 CONFIG_SUB_OVERRIDE+=           ${MOZILLA_DIR}js/src/build/autoconf/config.sub
56 CONFIG_SUB_OVERRIDE+=           ${MOZILLA_DIR}nsprpub/build/autoconf/config.sub
57 CONFIG_SUB_OVERRIDE+=           ${MOZILLA_DIR}/js/ctypes/libffi/config.sub
58
59 PYTHON_FOR_BUILD_ONLY=          yes
60 .include "../../lang/python/application.mk"
61 CONFIGURE_ENV+=         PYTHON=${PYTHONBIN:Q}
62
63 # Makefiles sometimes call "rm -f" without more arguments. Kludge around ...
64 .PHONY: create-rm-wrapper
65 pre-configure: create-rm-wrapper
66 create-rm-wrapper:
67         printf '#!/bin/sh\n[ "$$*" = "-f" ] && exit 0\nexec /bin/rm $$@\n' > \
68           ${WRAPPER_DIR}/bin/rm
69         chmod +x ${WRAPPER_DIR}/bin/rm
70
71 .include "../../mk/bsd.prefs.mk"
72
73 .if ${OPSYS} == "NetBSD"
74 # The configure test for __thread succeeds, but later we end up with:
75 # dist/bin/libxul.so: undefined reference to `__tls_get_addr'
76 CONFIGURE_ENV+= ac_cv_thread_keyword=no
77 .endif
78
79 .if ${OPSYS} == "SunOS"
80 # native libbz2.so hides BZ2_crc32Table
81 PREFER.bzip2?=  pkgsrc
82 .endif
83
84 .if ${OPSYS} == "Linux"
85 .include "../../audio/alsa-lib/buildlink3.mk"
86 .endif
87 .include "../../archivers/bzip2/buildlink3.mk"
88 BUILDLINK_API_DEPENDS.sqlite3+= sqlite3>=3.7.4
89 CONFIGURE_ENV+= ac_cv_sqlite_secure_delete=yes  # c.f. patches/patch-al
90 .include "../../databases/sqlite3/buildlink3.mk"
91 .include "../../devel/zlib/buildlink3.mk"
92 .include "../../mk/jpeg.buildlink3.mk"
93 .include "../../graphics/MesaLib/buildlink3.mk"
94 .include "../../net/libIDL/buildlink3.mk"
95 BUILDLINK_API_DEPENDS.gtk2+=    gtk2+>=2.18.3nb1
96 .include "../../x11/gtk2/buildlink3.mk"
97 .include "../../x11/libXt/buildlink3.mk"