View | Details | Raw Unified | Return to bug 133356
Collapse All | Expand All

(-)Makefile (-3 / +37 lines)
Lines 27-34 Link Here
27
USE_GETTEXT=	yes
27
USE_GETTEXT=	yes
28
USE_ICONV=	yes
28
USE_ICONV=	yes
29
29
30
MAKE_ARGS=	CC="${CC}" CFLAGS="${CFLAGS}" prefix="${PREFIX}" \
30
MAKE_ARGS=	CC="${CC}" prefix="${PREFIX}" \
31
		LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
31
		LIBS="${LIBS}" \
32
		INSTALL_PROGRAM="${INSTALL_PROGRAM}"
32
		INSTALL_PROGRAM="${INSTALL_PROGRAM}"
33
33
34
CFLAGS+=	-I${LOCALBASE}/include
34
CFLAGS+=	-I${LOCALBASE}/include
Lines 43-53 Link Here
43
		blacklist.mfp.example whitelist.mfp.example crm114-mode.el \
43
		blacklist.mfp.example whitelist.mfp.example crm114-mode.el \
44
		procmailrc.recipe
44
		procmailrc.recipe
45
45
46
OPTIONS=	PGO "Enable Profile-Guided Optimization" off
47
48
.include <bsd.port.pre.mk>
49
50
.if defined(WITH_PGO)
51
MAKE_ARGS+=	CFLAGS="${CFLAGS} -fprofile-use" \
52
		LDFLAGS="${LDFLAGS} -fprofile-use"
53
.else
54
MAKE_ARGS+=	CFLAGS="${CFLAGS}" \
55
		LDFLAGS="${LDFLAGS}"
56
.endif
57
46
post-patch:
58
post-patch:
47
	@${REINPLACE_CMD} -Ee \
59
	@${REINPLACE_CMD} -Ee \
48
	  's,^((LD|C)FLAGS),#\1,;;s,^(prefix=),#\1,;;s,^(.*-install),#\1,' \
60
	  's,^((LD|C)FLAGS),#\1,;;s,^(prefix=),#\1,;;s,^(.*-install),#\1,' \
49
	  ${WRKSRC}/Makefile
61
	  ${WRKSRC}/Makefile
50
62
63
.if defined(WITH_PGO)
64
.if target(pre-build)
65
.error Makefile error since pre-build target has already been defined
66
.endif
67
pre-build: pgo
68
.endif
69
51
# Peter Jeremy recommended the use of b64decode and md5 20040302
70
# Peter Jeremy recommended the use of b64decode and md5 20040302
52
post-install:
71
post-install:
53
	@${REINPLACE_CMD} -Ee 's|^(.*/openssl base64 -d/)|#\1|' \
72
	@${REINPLACE_CMD} -Ee 's|^(.*/openssl base64 -d/)|#\1|' \
Lines 78-81 Link Here
78
	done
97
	done
79
.endif
98
.endif
80
99
81
.include <bsd.port.mk>
100
.if defined(WITH_PGO)
101
pgo: pgo-build pgo-run pgo-clean
102
103
pgo-build:
104
	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} CFLAGS="${CFLAGS} -fprofile-generate" LDFLAGS="${LDFLAGS} -fprofile-generate" ${ALL_TARGET})
105
106
pgo-run:
107
# Check everything to generate profiling information.
108
# We will ignore any errors.
109
	@-(cd ${BUILD_WRKSRC}; ${MAKE} megatest)
110
111
pgo-clean:
112
	@(cd ${BUILD_WRKSRC}; ${MAKE} clean)
113
.endif # if defined(WITH_PGO)
114
115
.include <bsd.port.post.mk>

Return to bug 133356