1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00
freebsd-ports/Mk/Uses/imake.mk
Tijl Coosemans f86cad0ce3 Two imake related changes:
1) Move -a from XMKMF command variable to a new XMKMF_ARGS variable.
   For ports that don't need -a introduce USES=imake:notall.
   This way ports no longer have to redefine XMKMF.

2) xmkmf -a runs imake with the flags in IMAKECPPFLAGS as extra arguments
   to set CPP, CC and CXX.  This creates the top Makefile, and then xmkmf
   runs make Makefiles.  This Makefiles target runs imake for each
   subdirectory but these imake invocations did not have the flags from
   IMAKECPPFLAGS so the resulting makefiles used the wrong C preprocessor
   when clang is used (/usr/bin/cpp instead of /usr/local/bin/tradcpp).
   Instead of letting xmkmf pass IMAKECPPFLAGS from the environment to
   imake let imake handle IMAKECPPFLAGS itself just like it handles
   IMAKEINCLUDE.

   This exposed configure errors in x11-clocks/mouseclock and x11-wm/fvwm.

Approved by:	portmgr (bapt)
2013-09-02 13:26:34 +00:00

60 lines
1.2 KiB
Makefile

# $FreeBSD$
#
# Provide support for imake based projects
#
# MAINTAINER: x11@FreeBSD.org
#
# Feature: imake
# Usage: USES=imake
# Valid ARGS: env: do not define any target
# notall: do not pass -a to xmkmf
#
.if !defined(_INCLUDE_USES_IMAKE_MK)
_INCLUDE_USES_IMAKE_MK= yes
.if defined(imake_ARGS)
.if ${imake_ARGS} == env
IMAKE_ENV_ONLY= yes
.elif ${imake_ARGS} == notall
IMAKE_NOTALL= yes
.else
IGNORE= USES=imake ${imake_ARGS} is not a valid argument
.endif
.endif
.if !defined(NO_INSTALL_MANPAGES)
MANCOMPRESSED?= yes
.endif
BUILD_DEPENDS+= imake:${PORTSDIR}/devel/imake
.if defined(USE_GCC)
IMAKECPP= ${CPP}
IMAKECPPFLAGS= -DCppCmd=${CPP} -DCcCmd=${CC} -DCplusplusCmd=${CXX}
.else
IMAKECPP= tradcpp
IMAKECPPFLAGS= -DCppCmd=tradcpp -DCcCmd=${CC} -DCplusplusCmd=${CXX}
BUILD_DEPENDS+= tradcpp:${PORTSDIR}/devel/tradcpp
.endif
MAKE_ENV+= IMAKECPP=${IMAKECPP} IMAKECPPFLAGS="${IMAKECPPFLAGS}"
CONFIGURE_ENV+= IMAKECPP=${IMAKECPP} IMAKECPPFLAGS="${IMAKECPPFLAGS}"
.if !defined(IMAKE_NOTALL)
XMKMF_ARGS+= -a
.endif
.if !defined(IMAKE_ENV_ONLY)
.if !target(do-configure)
do-configure:
@(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${MAKE_ENV} ${XMKMF} ${XMKMF_ARGS})
.endif
.if !defined(NO_INSTALL_MANPAGES)
LATE_INSTALL_ARGS= install.man
.endif
.endif
.endif