summaryrefslogtreecommitdiffstats
path: root/www/mozilla/Makefile.common
blob: 99e5a56ac219817c3c01619670669f3a44f135ea (plain) (blame)
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
# $FreeBSD$
#    $MCom: ports/www/mozilla/Makefile.common,v 1.4 2005/11/14 04:12:09 ahze Exp $

BUILD_DEPENDS+= zip:${PORTSDIR}/archivers/zip
LIB_DEPENDS+=   jpeg.9:${PORTSDIR}/graphics/jpeg \
        png.5:${PORTSDIR}/graphics/png \
        nspr4:${PORTSDIR}/devel/nspr \
        nss3:${PORTSDIR}/security/nss \
        Xft.2:${PORTSDIR}/x11-fonts/libXft

OPTIONS+=   DEBUG "Build a debugging image" off \
        LOGGING "Enable additional log messages" off \
        OPTIMIZED_CFLAGS "Enable some additional optimizations" off

MAINTAINER?=    gnome@FreeBSD.org

MOZILLA?=   ${PORTNAME}
MOZILLA_VER?=   ${PORTVERSION}
USE_GNOME+= gtk20 libidl desktopfileutils
USE_ICONV=  yes
USE_PERL5_BUILD=yes
USE_X_PREFIX=   yes
USE_REINPLACE=  yes

WRKSRC?=    ${WRKDIR}/mozilla
FAKEDIR?=   ${WRKDIR}/fake
PLIST?=     ${WRKDIR}/plist

KRB5_HOME?= /usr
ESD_LIB?=   libesd.so.2
FREETYPE_LIB?=  libfreetype.so.9

GENERIC_MOZCONFIG?= ${.CURDIR}/../../www/mozilla/files/mozconfig-generic.in
PORT_MOZCONFIG?=    ${FILESDIR}/mozconfig.in
MOZCONFIG?=     ${WRKSRC}/.mozconfig

PKGINSTALL?=    ${WRKDIR}/pkg-install
PKGDEINSTALL?=  ${WRKDIR}/pkg-deinstall

EXTRACT_AFTER_ARGS?=    | ${TAR} -xf - --exclude */CVS/*    \
            --exclude */macbuild/*          \
            --exclude */package/*           \
            --exclude .cvsignore            \
            --exclude makefile.win          \
            --exclude MANIFEST          \
            --exclude */nsprpub/*           \
            --exclude mozilla/modules/libimg/png    \
            --exclude mozilla/jpeg          \
            --exclude mozilla/dbm           \
            --exclude mozilla/js/src/fdlibm     \
            --exclude mozilla/security/nss      \
            --exclude mozilla/gc/boehm      \
            --exclude mozilla/gfx/cairo

JPI_LIST?=\
    ${LOCALBASE}/jdk1.5.0/jre/plugin/${ARCH}/ns7/libjavaplugin_oji.so \
    ${LOCALBASE}/jdk1.4.2/jre/plugin/${ARCH}/ns610/libjavaplugin_oji.so

PKGCONFIG_FILES?=   ${MOZILLA}-gtkmozembed ${MOZILLA}-js \
            ${MOZILLA}-xpcom ${MOZILLA}-plugin

CPPFLAGS+=      -I${X11BASE}/include -I${LOCALBASE}/include
CFLAGS+=        ${PTHREAD_CFLAGS}
LDFLAGS+=       -L${X11BASE}/lib
LIBS+=          ${PTHREAD_LIBS}

.if defined(WITH_SMB)
USE_GNOME+= gnomevfs2
CONFIGURE_ENV+= WITH_SMB=yes
.endif

.if defined(WITH_DEBUG)
CONFIGURE_ENV+= WITH_DEBUG=yes
WITH_LOGGING=   yes
.endif

.if defined(WITH_LOGGING)
CONFIGURE_ENV+= WITH_LOGGING=yes
.endif

.if defined(WITH_OPTIMIZED_CFLAGS)
CFLAGS:=    -O2 -fno-strict-aliasing ${CFLAGS:N-O*}
.else
CFLAGS:=    ${CFLAGS:N-O*:N-m*} -O
CONFIGURE_ENV+= WITH_OPTIMIZE=-O
.endif

.if exists(${LOCALBASE}/include/freetype/freetype.h)
BROKEN= "You must upgrade your freetype port to 1.3.1_2 or higher before \
    installing ${PORTNAME}.  If you have 1.3.1_2 installed, please remove \
    ${LOCALBASE}/include/freetype, then build ${PORTNAME}"
.endif

# Makefile.common defines
MOZCONFIG_SED=  ${SED} -e 's|@CPPFLAGS@|${CPPFLAGS}|'   \
        -e 's|@CFLAGS@|${CFLAGS}|'      \
        -e 's|@LDFLAGS@|${LDFLAGS}|'        \
        -e 's|@LIBS@|${LIBS}|'          \
        -e 's|@X11BASE@|${X11BASE}|'        \
        -e 's|@LOCALBASE@|${LOCALBASE}|'    \
        -e 's|@FAKEDIR@|${FAKEDIR}|'        \
        -e 's|@PERL@|${PERL5}|'         \
        -e 's|@KRB5_HOME@|${KRB5_HOME}|'    \
        -e 's|@MOZDIR@|${PREFIX}/lib/${MOZILLA}|'   \
        -e 's|%%CFLAGS%%|${CFLAGS}|'        \
        -e 's|%%LDFLAGS%%|${LDFLAGS}|'      \
        -e 's|%%LIBS%%|${LIBS}|'        \
        -e 's|%%X11BASE%%|${X11BASE}|'      \
        -e 's|%%LOCALBASE%%|${LOCALBASE}|'  \
        -e 's|%%FAKEDIR%%|${FAKEDIR}|'      \
        -e 's|%%PERL%%|${PERL5}|'       \
        -e 's|%%KRB5_HOME%%|${KRB5_HOME}|'  \
        -e 's|%%MOZDIR%%|${PREFIX}/lib/${MOZILLA}|'

pre-configure:  
.if exists(${.CURDIR}/pkg-install.in)
    @${MOZCONFIG_SED} < ${.CURDIR}/pkg-install.in > ${PKGINSTALL}
.endif
.if exists(${.CURDIR}/pkg-deinstall.in)
    @${MOZCONFIG_SED} < ${.CURDIR}/pkg-deinstall.in > ${PKGDEINSTALL}
.endif
    @${RM} -f ${MOZCONFIG}
.if exists(${GENERIC_MOZCONFIG})
    @${MOZCONFIG_SED} < ${GENERIC_MOZCONFIG} >> ${MOZCONFIG}
.endif
.if exists(${PORT_MOZCONFIG})
    @${MOZCONFIG_SED} < ${PORT_MOZCONFIG} >> ${MOZCONFIG}
.endif
    @${REINPLACE_CMD} -e  's/%{idldir}/%idldir%/g ; \
        s|"%FULL_NSPR_CFLAGS%"|`nspr-config --cflags`|g ; \
        s|"%FULL_NSPR_LIBS%"|`nspr-config --libs`|g' \
            ${WRKSRC}/build/unix/mozilla-config.in
    @${REINPLACE_CMD} -e 's|-lc_r|${PTHREAD_LIBS}|g ; \
        s|-lpthread|${PTHREAD_LIBS}|g' \
            ${WRKSRC}/configure
    @${REINPLACE_CMD} -E -e 's|libesd\.so\.[0-9]+|libesd.so|g' \
        ${WRKSRC}/widget/src/gtk2/nsSound.cpp
    @${REINPLACE_CMD} -E -e 's|libcups\.so\.[0-9]+|libcups.so|g' \
        ${WRKSRC}/gfx/src/gtk/nsDeviceContextSpecG.cpp
    @if [ -n "`${PKG_INFO} -xI '^bind[0-9]*-base-[0-9]'`" ]; then \
        ${ECHO_CMD} "${PKGNAME}: bind installed with PORT_REPLACES_BASE_BIND causes build problems."; \
        ${FALSE}; \
    fi