aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/Uses/imake.mk
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2013-06-28 19:51:05 +0800
committerbapt <bapt@FreeBSD.org>2013-06-28 19:51:05 +0800
commitba5181b4c873c984e4559cfddf3b6ce79362a9a2 (patch)
tree5182ef394eeef9bff78abf27f4a3a05f7fb8ff43 /Mk/Uses/imake.mk
parent39c24b55b95207275ceec7228fd4470225c94152 (diff)
downloadfreebsd-ports-gnome-ba5181b4c873c984e4559cfddf3b6ce79362a9a2.tar.gz
freebsd-ports-gnome-ba5181b4c873c984e4559cfddf3b6ce79362a9a2.tar.zst
freebsd-ports-gnome-ba5181b4c873c984e4559cfddf3b6ce79362a9a2.zip
New USES imake to handle the dependency on imake.
This uses accept 'env' as an argument for ports that do use their own or a different do-configure target. Modify xmkmf so it accept IMAKECPPFLAGS as default flags for imake and pass it to the called imake. Modify xorg-cf-files (the FreeBSD.cf configuration file) to allow CppCmd to be overwritten. Pass CppCmd CcCmd and CplusplusCmd via command line to each call of imake via IMAKECPPFLAGS Pass IMAKE_DEFINE with the above arguments to MAKE_ARGS so that imake spawned from Makefile generated by a previous imake also inherit the defined CppCmd CcCmd and CplusplusCmd. Make imake use devel/tradcpp all the time, so that when buidling with clang we do not depend on gcc's cpp. Make imake respect CC and CXX Make imake respect USE_GCC (if set imake will use gcc's cpp). While here: - Remove a couple of indefinite articles from comments - Trim headers - Fix a couple of ports to build with clang or use: USE_GCC=any - Fix a now useless redefinition of the extraction chain - Fix a typo in japanese/Wnn7-lib bundled imake template definitions - Fix some XMKMF execution with no env specified - Use options helper in x11/xautolock to simplify the port
Diffstat (limited to 'Mk/Uses/imake.mk')
-rw-r--r--Mk/Uses/imake.mk52
1 files changed, 52 insertions, 0 deletions
diff --git a/Mk/Uses/imake.mk b/Mk/Uses/imake.mk
new file mode 100644
index 000000000000..f4db9beb2814
--- /dev/null
+++ b/Mk/Uses/imake.mk
@@ -0,0 +1,52 @@
+# $FreeBSD$
+#
+# Provide support for imake based projects
+#
+# MAINTAINER: x11@FreeBSD.org
+#
+# Feature: imake
+# Usage: USES=imake
+# Valid ARGS: env: do not define any target
+#
+
+.if !defined(_INCLUDE_USES_IMAKE_MK)
+_INCLUDE_USES_IMAKE_MK= yes
+
+.if defined(imake_ARGS)
+.if ${imake_ARGS} == env
+IMAKE_ENV_ONLY= 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}"
+MAKE_ARGS+= IMAKE_DEFINES="${IMAKECPPFLAGS}"
+
+.if !defined(IMAKE_ENV_ONLY)
+.if !target(do-configure)
+do-configure:
+ @(cd ${CONFIGURE_WRKSRC}; ${SETENV} ${MAKE_ENV} ${XMKMF})
+.endif
+
+.if !defined(NO_INSTALL_MANPAGES)
+LATE_INSTALL_ARGS= install.man
+.endif
+.endif
+
+.endif