tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

transform for compiler flags on Darwin



Hello,
I'd like to propose the addition of a new transform for Darwin,
transform so far converts -shared flags to "-dynamiclib -undefined
dynamic_lookup" which fixes build issue with packages which use
-shared on old version of Apple's version of GCC with legacy OS X. On
these versions an error is generated as -shared is an unrecognised
option.
It also converts -fpic on -fPIC which reduces noise from warnings.

Any objections to this change?


Sevan
Index: mk/wrapper/bsd.wrapper.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/wrapper/bsd.wrapper.mk,v
retrieving revision 1.97
diff -u -p -r1.97 bsd.wrapper.mk
--- mk/wrapper/bsd.wrapper.mk	11 Mar 2016 23:03:31 -0000	1.97
+++ mk/wrapper/bsd.wrapper.mk	20 Aug 2016 20:57:38 -0000
@@ -333,6 +333,8 @@ _WRAP_CMD_SINK.LD=	${WRAPPER_TMPDIR}/cmd
 _WRAP_ARG_PP.CC=	${WRAPPER_TMPDIR}/arg-pp-darwin-gcc
 _WRAP_ARG_PP.CXX=	${_WRAP_ARG_PP.CC}
 _WRAP_ARG_PP.LD=	${_WRAP_ARG_PP.CC}
+_WRAP_TRANSFORM.CC=	${WRAPPER_TMPDIR}/transform-darwin-cc
+_WRAP_TRANSFORM.CXX=	${_WRAP_TRANSFORM.CC}
 .elif ${OPSYS} == "UnixWare"
 _WRAP_CMD_SINK.CC=	${WRAPPER_TMPDIR}/cmd-sink-unixware-gcc
 _WRAP_CMD_SINK.CXX=	${_WRAP_CMD_SINK.CC}
@@ -527,6 +529,7 @@ generate-wrappers: ${_target_}
 	cmd-sink-unixware-gcc \
 	transform-aix-cc \
 	transform-ccc-cc \
+	transform-darwin-cc \
 	transform-gcc \
 	transform-icc-cc \
 	transform-ido-cc \
Index: mk/wrapper/transform-darwin-cc
===================================================================
RCS file: mk/wrapper/transform-darwin-cc
diff -N mk/wrapper/transform-darwin-cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mk/wrapper/transform-darwin-cc	20 Aug 2016 20:57:38 -0000
@@ -0,0 +1,13 @@
+transform_setname "transform-darwin-cc"
+
+
+case $arg in
+
+
+-shared 	) transform_to_and_split "-dynamiclib -undefined dynamic_lookup" ;;
+-fpic		) transform_to "-fPIC" ;;
+
+# Unknow options.
+-* 		) transform_pass_with_warning ;;
+
+esac


Home | Main Index | Thread Index | Old Index