Sat Nov 22 16:32:13 2014 UTC ()
Do not use gcc-specific compiler flags on Mac OS versions that come with
clang. Update version for bootstrap-mk-files.

Patch provided by Todd Kover in PR pkg/48966.


(bsiegert)
diff -r1.63 -r1.64 pkgsrc/mk/platform/Darwin.mk
diff -r1.43 -r1.44 pkgsrc/pkgtools/bootstrap-mk-files/Makefile
diff -r1.4 -r1.5 pkgsrc/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.lib.mk

cvs diff -r1.63 -r1.64 pkgsrc/mk/platform/Darwin.mk (expand / switch to unified diff)

--- pkgsrc/mk/platform/Darwin.mk 2014/08/17 08:32:32 1.63
+++ pkgsrc/mk/platform/Darwin.mk 2014/11/22 16:32:13 1.64
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Darwin.mk,v 1.63 2014/08/17 08:32:32 tron Exp $ 1# $NetBSD: Darwin.mk,v 1.64 2014/11/22 16:32:13 bsiegert Exp $
2# 2#
3# Variable definitions for the Darwin operating system. 3# Variable definitions for the Darwin operating system.
4 4
5# OS, Kernel, Xcode Version 5# OS, Kernel, Xcode Version
6# 6#
7# Codename OS Kernel Xcode 7# Codename OS Kernel Xcode
8# Cheetah 10.0.x 1.3.1 8# Cheetah 10.0.x 1.3.1
9# Puma 10.1 1.4.1 9# Puma 10.1 1.4.1
10# 10.1.x 5.x.y 10# 10.1.x 5.x.y
11# Jaguar 10.2.x 6.x.y 11# Jaguar 10.2.x 6.x.y
12# Panther 10.3.x 7.x.y 12# Panther 10.3.x 7.x.y
13# Tiger 10.4.x 8.x.y 2.x (gcc 4.0, 4.0.1 from 2.2) 13# Tiger 10.4.x 8.x.y 2.x (gcc 4.0, 4.0.1 from 2.2)
14# Leopard 10.5.x 9.x.y 3.x (gcc 4.0.1, 4.0.1 and 4.2.1 from 3.1) 14# Leopard 10.5.x 9.x.y 3.x (gcc 4.0.1, 4.0.1 and 4.2.1 from 3.1)
@@ -112,28 +112,33 @@ KRB5_DEFAULT?= mit-krb5 @@ -112,28 +112,33 @@ KRB5_DEFAULT?= mit-krb5
112# 112#
113# Builtin overrides. 113# Builtin overrides.
114# 114#
115.if !empty(OS_VERSION:M[56].*) 115.if !empty(OS_VERSION:M[56].*)
116USE_BUILTIN.dl= no # Darwin-[56].* uses devel/dlcompat 116USE_BUILTIN.dl= no # Darwin-[56].* uses devel/dlcompat
117.endif 117.endif
118 118
119# Builtin defaults which make sense for this platform. 119# Builtin defaults which make sense for this platform.
120_OPSYS_PREFER.linux-pam?= native 120_OPSYS_PREFER.linux-pam?= native
121_OPSYS_PREFER.mit-krb5?= native 121_OPSYS_PREFER.mit-krb5?= native
122 122
123# flags passed to the linker to extract all symbols from static archives. 123# flags passed to the linker to extract all symbols from static archives.
124# this is GNU ld. 124# this is GNU ld.
 125.if empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*)
 126_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,-force-load
 127_OPSYS_NO_WHOLE_ARCHIVE_FLAG=
 128.else
125_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive 129_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
126_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive 130_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
 131.endif
127 132
128_OPSYS_CAN_CHECK_SHLIBS= no # can't use readelf in check/bsd.check-vars.mk 133_OPSYS_CAN_CHECK_SHLIBS= no # can't use readelf in check/bsd.check-vars.mk
129 134
130_STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U-Wl,-x} # cc(1) option to strip 135_STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U-Wl,-x} # cc(1) option to strip
131_STRIPFLAG_INSTALL?= ${_INSTALL_UNSTRIPPED:D:U-s} # install(1) option to strip 136_STRIPFLAG_INSTALL?= ${_INSTALL_UNSTRIPPED:D:U-s} # install(1) option to strip
132 137
133# check for maximum command line length and set it in configure's environment, 138# check for maximum command line length and set it in configure's environment,
134# to avoid a test required by the libtool script that takes forever. 139# to avoid a test required by the libtool script that takes forever.
135_OPSYS_MAX_CMDLEN_CMD= /usr/sbin/sysctl -n kern.argmax 140_OPSYS_MAX_CMDLEN_CMD= /usr/sbin/sysctl -n kern.argmax
136 141
137# Darwin 7.7.x has poll() in libc, but no poll.h. Try to help GNU 142# Darwin 7.7.x has poll() in libc, but no poll.h. Try to help GNU
138# configure packages that break because of this by pretending that 143# configure packages that break because of this by pretending that
139# there is no poll(). 144# there is no poll().

cvs diff -r1.43 -r1.44 pkgsrc/pkgtools/bootstrap-mk-files/Makefile (expand / switch to unified diff)

--- pkgsrc/pkgtools/bootstrap-mk-files/Makefile 2014/05/16 13:13:21 1.43
+++ pkgsrc/pkgtools/bootstrap-mk-files/Makefile 2014/11/22 16:32:13 1.44
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1# $NetBSD: Makefile,v 1.43 2014/05/16 13:13:21 ryoon Exp $ 1# $NetBSD: Makefile,v 1.44 2014/11/22 16:32:13 bsiegert Exp $
2 2
3PKGNAME= bootstrap-mk-files-20140516 3PKGNAME= bootstrap-mk-files-20141122
4CATEGORIES= pkgtools 4CATEGORIES= pkgtools
5 5
6CONFLICTS+= mk-files-[0-9]* 6CONFLICTS+= mk-files-[0-9]*
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= http://www.pkgsrc.org/ 9HOMEPAGE= http://www.pkgsrc.org/
10COMMENT= *.mk files for the bootstrap bmake utility 10COMMENT= *.mk files for the bootstrap bmake utility
11 11
12NO_PKGTOOLS_REQD_CHECK= # defined 12NO_PKGTOOLS_REQD_CHECK= # defined
13BOOTSTRAP_PKG= yes 13BOOTSTRAP_PKG= yes
14 14
15NO_BUILD= yes 15NO_BUILD= yes
16 16

cvs diff -r1.4 -r1.5 pkgsrc/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.lib.mk (expand / switch to unified diff)

--- pkgsrc/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.lib.mk 2013/10/25 13:53:03 1.4
+++ pkgsrc/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.lib.mk 2014/11/22 16:32:13 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Darwin.bsd.lib.mk,v 1.4 2013/10/25 13:53:03 jperkin Exp $ 1# $NetBSD: Darwin.bsd.lib.mk,v 1.5 2014/11/22 16:32:13 bsiegert Exp $
2# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94 2# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
3 3
4.if !target(__initialized__) 4.if !target(__initialized__)
5__initialized__: 5__initialized__:
6.if exists(${.CURDIR}/../Makefile.inc) 6.if exists(${.CURDIR}/../Makefile.inc)
7.include "${.CURDIR}/../Makefile.inc" 7.include "${.CURDIR}/../Makefile.inc"
8.endif 8.endif
9.include <bsd.own.mk> 9.include <bsd.own.mk>
10.include <bsd.obj.mk> 10.include <bsd.obj.mk>
11.include <bsd.depall.mk> 11.include <bsd.depall.mk>
12.MAIN: all 12.MAIN: all
13.endif 13.endif
14 14
@@ -360,41 +360,50 @@ CLEANFILES+= ${DPSRCS} @@ -360,41 +360,50 @@ CLEANFILES+= ${DPSRCS}
360.if defined(YHEADER) 360.if defined(YHEADER)
361CLEANFILES+= ${SRCS:M*.y:.y=.h} 361CLEANFILES+= ${SRCS:M*.y:.y=.h}
362.endif 362.endif
363 363
364lib${LIB}.a:: ${OBJS} __archivebuild 364lib${LIB}.a:: ${OBJS} __archivebuild
365 @echo building standard ${LIB} library 365 @echo building standard ${LIB} library
366 366
367lib${LIB}_p.a:: ${POBJS} __archivebuild 367lib${LIB}_p.a:: ${POBJS} __archivebuild
368 @echo building profiled ${LIB} library 368 @echo building profiled ${LIB} library
369 369
370lib${LIB}_pic.a:: ${SOBJS} __archivebuild 370lib${LIB}_pic.a:: ${SOBJS} __archivebuild
371 @echo building shared object ${LIB} library 371 @echo building shared object ${LIB} library
372 372
 373.if empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*)
 374_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,-force_load
 375_OPSYS_NO_WHOLE_ARCHIVE_FLAG=
 376.else
 377_OPSYS_WHOLE_ARCHIVE_FLAG= --whole-archive
 378_OPSYS_NO_WHOLE_ARCHIVE_FLAG= --no-whole-archive
 379.endif
 380
373lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \ 381lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
374 ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE} 382 ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
375 @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\) 383 @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
376 @rm -f lib${LIB}.so.${SHLIB_FULLVERSION} 384 @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
377.if defined(DESTDIR) 385.if defined(DESTDIR)
378 $(CC) -nostdlib -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \ 386 $(CC) -nostdlib -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
379 ${SHLIB_LDSTARTFILE} \ 387 ${SHLIB_LDSTARTFILE} \
380 --whole-archive ${SOLIB} \ 388 ${_OPSYS_WHOLE_ARCHIVE_FLAG} ${SOLIB} \
381 --no-whole-archive ${LDADD} \ 389 ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG) ${LDADD} \
382 -L${DESTDIR}${LIBDIR} -R${LIBDIR} \ 390 -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
383 ${SHLIB_LDENDFILE} 391 ${SHLIB_LDENDFILE}
384.else 392.else
385 $(CC) -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \ 393 $(CC) -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
386 ${SHLIB_LDSTARTFILE} \ 394 ${SHLIB_LDSTARTFILE} \
387 --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \ 395 ${_OPSYS_WHOLE_ARCHIVE_FLAG} ${SOLIB} \
 396 ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG} ${LDADD} \
388 ${SHLIB_LDENDFILE} 397 ${SHLIB_LDENDFILE}
389.endif 398.endif
390.if ${OBJECT_FMT} == "ELF" 399.if ${OBJECT_FMT} == "ELF"
391 ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp 400 ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
392 mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR} 401 mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
393 ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp 402 ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
394 mv -f lib${LIB}.so.tmp lib${LIB}.so 403 mv -f lib${LIB}.so.tmp lib${LIB}.so
395.endif 404.endif
396 405
397.if !empty(LOBJS) 406.if !empty(LOBJS)
398LLIBS?= -lc 407LLIBS?= -lc
399llib-l${LIB}.ln: ${LOBJS} 408llib-l${LIB}.ln: ${LOBJS}
400 @echo building llib-l${LIB}.ln 409 @echo building llib-l${LIB}.ln