[Midnightbsd-cvs] mports [15673] trunk/Mk: add ssp and kmod modules
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Wed Dec 18 21:02:38 EST 2013
Revision: 15673
http://svnweb.midnightbsd.org/mports/?rev=15673
Author: laffer1
Date: 2013-12-18 21:02:37 -0500 (Wed, 18 Dec 2013)
Log Message:
-----------
add ssp and kmod modules
Modified Paths:
--------------
trunk/Mk/bsd.mport.mk
trunk/Mk/extensions/xfce.mk
Added Paths:
-----------
trunk/Mk/components/ssp.mk
trunk/Mk/extensions/kmod.mk
Modified: trunk/Mk/bsd.mport.mk
===================================================================
--- trunk/Mk/bsd.mport.mk 2013-12-19 01:07:39 UTC (rev 15672)
+++ trunk/Mk/bsd.mport.mk 2013-12-19 02:02:37 UTC (rev 15673)
@@ -333,7 +333,8 @@
# This is the order that we used before the extensions where refactored.
# in the future if things could be fixed to work when loaded alphabetacally, then
# we could go back to the above approach.
-_ALL_EXT= charsetfix pathfix pkgconfig compiler linux_rpm linux_apps xorg fortran \
+_ALL_EXT= charsetfix pathfix pkgconfig compiler kmod \
+ linux_rpm linux_apps xorg fortran \
gcc fmake gmake bison local perl5 openssl \
emacs gnustep php python java ruby tcl apache kde qt \
autotools gnome lua wx gstreamer sdl xfce kde4 cmake mysql \
@@ -540,10 +541,8 @@
.endif
.endif
-.if defined(USE_SSP) && ${USE_SSP} != "no"
-CFLAGS+= -fstack-protector
-.else
-CFLAGS+= -fno-stack-protector
+.if defined(WITH_SSP) || defined(WITH_SSP_PORTS)
+.include "${PORTSDIR}/Mk/components/ssp.mk"
.endif
.if defined(WITH_DEBUG) && ${WITH_DEBUG} != "no"
Added: trunk/Mk/components/ssp.mk
===================================================================
--- trunk/Mk/components/ssp.mk (rev 0)
+++ trunk/Mk/components/ssp.mk 2013-12-19 02:02:37 UTC (rev 15673)
@@ -0,0 +1,29 @@
+# $MidnightBSD$
+# SSP Support
+
+SSP_Include_MAINTAINER= ports at MidnightBSD.org
+
+.if ${ARCH} == i386
+
+# Disabled on i386 for now on releases without the ldscript as too many ports
+# do not respect LDFLAGS and fail to build due to not adding in -lssp_nonshared when needed
+# despite dependencies working fine, which breaks a lot. Can enable once LDFLAGS is more
+# supported. XXX
+SSP_UNSAFE= yes
+
+# i386 needs -lssp_nonshared, see svn link above for more information
+SSP_NEED_NONSHARED= yes
+.endif
+
+.if !defined(WITHOUT_SSP) && !defined(SSP_UNSAFE) && \
+ (${ARCH} == i386 || ${ARCH} == amd64)
+# Overridable as a user may want to use -fstack-protector-all
+SSP_CFLAGS?= -fstack-protector
+CFLAGS:= ${CFLAGS} ${SSP_CFLAGS}
+LDFLAGS:= ${LDFLAGS} -fstack-protector
+# -lssp_nonshared is needed on i386 where /usr/lib/libc.so is not an ldscript
+# This is currently unused XXX
+. if defined(SSP_NEED_NONSHARED)
+LDFLAGS:= ${LDFLAGS} -lssp_nonshared
+. endif
+.endif
Added: trunk/Mk/extensions/kmod.mk
===================================================================
--- trunk/Mk/extensions/kmod.mk (rev 0)
+++ trunk/Mk/extensions/kmod.mk 2013-12-19 02:02:37 UTC (rev 15673)
@@ -0,0 +1,59 @@
+# $MidnightBSD$
+#
+# Handles common items for kernel module ports.
+#
+# MAINTAINER: ports at MidnightBSD.org
+#
+# Feature: kmod
+# Usage: USES=kmod
+# Valid ARGS: none
+#
+.if !defined(_INCLUDE_USES_KMOD_MK)
+_INCLUDE_USES_KMOD_MK= yes
+
+_USES_POST= kmod
+
+.if defined(kmod_ARGS)
+IGNORE= USES=kmod takes no arguments
+.endif
+
+.if !exists(${SRC_BASE}/sys/Makefile)
+IGNORE= requires kernel source files in ${SRC_BASE}
+.endif
+
+CATEGORIES+= kld
+
+SSP_UNSAFE= kernel module does not support SSP
+
+KMODDIR?= /boot/modules
+.if ${KMODDIR} == /boot/kernel
+KMODDIR= /boot/modules
+.endif
+PLIST_SUB+= KMODDIR="${KMODDIR:C,^/,,}"
+MAKE_ENV+= KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys"
+.if !defined(NO_STAGE)
+MAKE_ENV+= NO_XREF=yes
+.endif
+
+.endif
+
+.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_KMOD_POST_MK)
+_INCLUDE_USES_KMOD_POST_MK= yes
+
+.PHONY: kmod-post-install
+pre-install: ${KMODDIR}
+${STAGEDIR}${KMODDIR}:
+ ${MKDIR} ${.TARGET}
+
+post-install: kmod-post-install
+kmod-post-install:
+ ${ECHO_CMD} "@exec /usr/sbin/kldxref ${KMODDIR}" >> ${TMPPLIST}
+ ${ECHO_CMD} "@unexec /usr/sbin/kldxref ${KMODDIR}" >> ${TMPPLIST}
+.if defined(NO_STAGE)
+ /usr/sbin/kldxref ${KMODDIR}
+.endif
+.if ${KMODDIR} != /boot/modules
+ ${ECHO_CMD} "@unexec rmdir ${KMODDIR} 2>/dev/null || true" >> ${TMPPLIST}
+.endif
+
+.endif
Modified: trunk/Mk/extensions/xfce.mk
===================================================================
--- trunk/Mk/extensions/xfce.mk 2013-12-19 01:07:39 UTC (rev 15672)
+++ trunk/Mk/extensions/xfce.mk 2013-12-19 02:02:37 UTC (rev 15673)
@@ -45,7 +45,8 @@
xfconf_BUILD_DEPENDS= xfce4-conf>=4.10.0:${PORTSDIR}/x11/xfce4-conf
xfconf_RUN_DEPENDS= xfce4-conf>=4.10.0:${PORTSDIR}/x11/xfce4-conf
-xfdev_RUN_DEPENDS= xfce4-dev-tools:${PORTSDIR}/devel/xfce4-dev-tools
+xfdev_BUILD_DEPENDS= xdt-csource:${PORTSDIR}/devel/xfce4-dev-tools
+xfdev_RUN_DEPENDS= xdt-csource:${PORTSDIR}/devel/xfce4-dev-tools
.endif
More information about the Midnightbsd-cvs
mailing list