Source-Changes-HG archive

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

[src/trunk]: src For USETOOLS=yes, use the --sysroot support of the compiler ...



details:   https://anonhg.NetBSD.org/src/rev/afe8b64628a6
branches:  trunk
changeset: 764033:afe8b64628a6
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Apr 10 16:52:36 2011 +0000

description:
For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.

diffstat:

 share/mk/bsd.dep.mk  |   4 +---
 share/mk/bsd.lib.mk  |  32 ++++++--------------------------
 share/mk/bsd.own.mk  |  13 +++----------
 share/mk/bsd.prog.mk |  29 ++++++-----------------------
 share/mk/bsd.x11.mk  |   8 +++-----
 tools/Makefile.host  |   4 ++--
 6 files changed, 21 insertions(+), 69 deletions(-)

diffs (229 lines):

diff -r f39e5acfda06 -r afe8b64628a6 share/mk/bsd.dep.mk
--- a/share/mk/bsd.dep.mk       Sun Apr 10 16:50:18 2011 +0000
+++ b/share/mk/bsd.dep.mk       Sun Apr 10 16:52:36 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.dep.mk,v 1.71 2011/02/06 00:52:49 joerg Exp $
+#      $NetBSD: bsd.dep.mk,v 1.72 2011/04/10 16:52:36 joerg Exp $
 
 ##### Basic targets
 cleandir:      cleandepend
@@ -57,8 +57,6 @@
        ${_MKTARGET_CREATE}
        ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
            ${CXXFLAGS:C/-([IDU])[  ]*/-\1/Wg:M-[IDU]*} \
-           ${HOSTLIB:U${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} \
-                       ${DESTDIR}/usr/include/g++}} \
            ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
 
 .endif # defined(SRCS)                                                 # }
diff -r f39e5acfda06 -r afe8b64628a6 share/mk/bsd.lib.mk
--- a/share/mk/bsd.lib.mk       Sun Apr 10 16:50:18 2011 +0000
+++ b/share/mk/bsd.lib.mk       Sun Apr 10 16:52:36 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.lib.mk,v 1.312 2011/02/10 21:55:33 matt Exp $
+#      $NetBSD: bsd.lib.mk,v 1.313 2011/04/10 16:52:36 joerg Exp $
 #      @(#)bsd.lib.mk  8.3 (Berkeley) 4/22/94
 
 .include <bsd.init.mk>
@@ -63,17 +63,6 @@
 ##### Build and install rules
 MKDEP_SUFFIXES?=       .o .po .pico .go .ln
 
-# Use purely kernel private headers in rump builds
-# Skip NetBSD headers for the toolchain builds
-.if !defined(RUMPKERNEL) && !defined(HOSTLIB)
-.if empty(CPPFLAGS:M-nostdinc)
-CPPFLAGS+=     ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
-.endif
-.if empty(CXXFLAGS:M-nostdinc++)
-CXXFLAGS+=     ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
-.endif
-.endif
-
 .if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE})             # {
 SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
 SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
@@ -522,12 +511,12 @@
 
 _LIBLDOPTS=
 .if ${SHLIBDIR} != "/usr/lib"
-_LIBLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \
-               -Wl,-rpath,${SHLIBDIR} \
-               -L${DESTDIR}${SHLIBDIR}
+_LIBLDOPTS+=   -Wl,-rpath-link,=${SHLIBDIR} \
+               -Wl,-rpath,=${SHLIBDIR} \
+               -L=${SHLIBDIR}
 .elif ${SHLIBINSTALLDIR} != "/usr/lib"
-_LIBLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \
-               -L${DESTDIR}${SHLIBINSTALLDIR}
+_LIBLDOPTS+=   -Wl,-rpath-link,=${SHLIBINSTALLDIR} \
+               -L=${SHLIBINSTALLDIR}
 .endif
 
 # gcc -shared now adds -lc automatically. For libraries other than libc and
@@ -565,18 +554,9 @@
     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
        ${_MKTARGET_BUILD}
        rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
-.if defined(DESTDIR)
-       ${LIBCC} ${LDLIBC} -Wl,-nostdlib -B${_GCC_CRTDIR}/ -B${DESTDIR}${SHLIBDIR}/ \
-           -Wl,-x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
-           -Wl,--whole-archive ${SOLIB} \
-           -Wl,--no-whole-archive ${_LDADD.lib${LIB}} \
-           ${_LIBLDOPTS} ${_LDFLAGS.lib${LIB}} \
-           -L${_GCC_LIBGCCDIR}
-.else
        ${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${_LDFLAGS.lib${LIB}} \
            -o ${.TARGET} ${_LIBLDOPTS} \
            -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${_LDADD.lib${LIB}}
-.endif
 #  We don't use INSTALL_SYMLINK here because this is just
 #  happening inside the build directory/objdir. XXX Why does
 #  this spend so much effort on libraries that aren't live??? XXX
diff -r f39e5acfda06 -r afe8b64628a6 share/mk/bsd.own.mk
--- a/share/mk/bsd.own.mk       Sun Apr 10 16:50:18 2011 +0000
+++ b/share/mk/bsd.own.mk       Sun Apr 10 16:52:36 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.own.mk,v 1.653 2011/03/08 12:20:17 njoly Exp $
+#      $NetBSD: bsd.own.mk,v 1.654 2011/04/10 16:52:36 joerg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -64,15 +64,6 @@
 # default to binutils 2.19
 HAVE_BINUTILS?=        219
 
-CPPFLAG_ISYSTEM=       -isystem
-.if defined(HAVE_GCC)
-.if ${HAVE_GCC} == 3
-CPPFLAG_ISYSTEMXX=     -isystem-cxx
-.else  # GCC 4
-CPPFLAG_ISYSTEMXX=     -cxx-isystem
-.endif
-.endif
-
 .if empty(.MAKEFLAGS:M-V*)
 .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
 PRINTOBJDIR=   ${MAKE} -r -V .OBJDIR -f /dev/null xxx
@@ -216,6 +207,8 @@
 OBJC=          false
 .endif
 
+CPPFLAGS+=     ${HOSTPROG:U${HOSTLIB:U${DESTDIR:D--sysroot=${DESTDIR}}}}
+LDFLAGS+=      ${HOSTPROG:U${HOSTLIB:U${DESTDIR:D--sysroot=${DESTDIR}}}}
 .endif # EXTERNAL_TOOLCHAIN                                            # }
 
 HOST_MKDEP=    ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
diff -r f39e5acfda06 -r afe8b64628a6 share/mk/bsd.prog.mk
--- a/share/mk/bsd.prog.mk      Sun Apr 10 16:50:18 2011 +0000
+++ b/share/mk/bsd.prog.mk      Sun Apr 10 16:52:36 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.prog.mk,v 1.262 2011/03/08 07:53:43 jmmv Exp $
+#      $NetBSD: bsd.prog.mk,v 1.263 2011/04/10 16:52:36 joerg Exp $
 #      @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -52,16 +52,6 @@
 LDFLAGS+=      ${PIE_LDFLAGS}
 .endif
 
-##### Default values
-.if !defined(HOSTLIB)
-.if empty(CPPFLAGS:M-nostdinc)
-CPPFLAGS+=     ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
-.endif
-.if empty(CXXFLAGS:M-nostdinc++)
-CXXFLAGS+=     ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
-.endif
-.endif
-
 CFLAGS+=       ${COPTS}
 OBJCFLAGS+=    ${OBJCOPTS}
 MKDEP_SUFFIXES?=       .o .ln
@@ -172,15 +162,13 @@
 _PROGLDOPTS+=  -Wl,-dynamic-linker=${_SHLINKER}
 .endif
 .if ${SHLIBDIR} != "/usr/lib"
-_PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBDIR} \
-               -Wl,-rpath,${SHLIBDIR} \
-               -L${DESTDIR}${SHLIBDIR}
+_PROGLDOPTS+=  -Wl,-rpath-link,=${SHLIBDIR} \
+               -Wl,-rpath,=${SHLIBDIR} \
+               -L=${SHLIBDIR}
 .elif ${SHLIBINSTALLDIR} != "/usr/lib"
-_PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
-               -L${DESTDIR}${SHLIBINSTALLDIR}
+_PROGLDOPTS+=  -Wl,-rpath-link,=${SHLIBINSTALLDIR} \
+               -L=${SHLIBINSTALLDIR}
 .endif
-_PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}/usr/lib \
-               -L${DESTDIR}/usr/lib
 
 __proginstall: .USE
        ${_MKTARGET_INSTALL}
@@ -208,9 +196,6 @@
 _APPEND_SRCS=yes
 
 _CCLINKFLAGS=
-.if defined(DESTDIR)
-_CCLINKFLAGS+= -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/
-.endif
 
 .if defined(PROG_CXX)
 PROG=          ${PROG_CXX}
@@ -327,10 +312,8 @@
 .if !commands(${_P})
        ${_MKTARGET_LINK}
        ${_CCLINK.${_P}} \
-           ${DESTDIR:D-Wl,-nostdlib} \
            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
            ${OBJS.${_P}} ${_LDADD.${_P}} \
-           ${DESTDIR:D-L${_GCC_LIBGCCDIR}} \
            ${_PROGLDOPTS}
 .if defined(CTFMERGE)
        ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
diff -r f39e5acfda06 -r afe8b64628a6 share/mk/bsd.x11.mk
--- a/share/mk/bsd.x11.mk       Sun Apr 10 16:50:18 2011 +0000
+++ b/share/mk/bsd.x11.mk       Sun Apr 10 16:52:36 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.x11.mk,v 1.94 2011/03/12 13:22:03 plunky Exp $
+#      $NetBSD: bsd.x11.mk,v 1.95 2011/04/10 16:52:36 joerg Exp $
 
 .include <bsd.init.mk>
 
@@ -166,15 +166,13 @@
 
 
 CPPFLAGS+=             -DCSRG_BASED -DFUNCPROTO=15 -DNARROWPROTO
-CPPFLAGS+=             -I${DESTDIR}${X11INCDIR}
+CPPFLAGS+=             -I=${X11INCDIR}
 
 .if ${MACHINE_ARCH} == "x86_64"
 CPPFLAGS+=             -D__AMD64__
 .endif
 
-LDFLAGS+=              -Wl,-rpath-link,${DESTDIR}${X11USRLIBDIR} \
-                       -Wl,-rpath,${X11USRLIBDIR} \
-                       -L${DESTDIR}${X11USRLIBDIR}
+LDFLAGS+=              -Wl,-rpath,=${X11USRLIBDIR} -L=${X11USRLIBDIR}
 
 
 #
diff -r f39e5acfda06 -r afe8b64628a6 tools/Makefile.host
--- a/tools/Makefile.host       Sun Apr 10 16:50:18 2011 +0000
+++ b/tools/Makefile.host       Sun Apr 10 16:52:36 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.host,v 1.27 2010/12/25 18:56:44 joerg Exp $
+#      $NetBSD: Makefile.host,v 1.28 2011/04/10 16:52:36 joerg Exp $
 
 NOINFO=                # defined
 NOLINT=                # defined
@@ -42,7 +42,7 @@
 HOSTPROGNAME?= ${HOSTPROG}
 HOST_BINDIR?=  ${TOOLDIR}/bin
 HOST_CPPFLAGS:=        ${HOST_CPPFLAGS} ${CPPFLAGS}
-HOST_CPPFLAGS:=        ${HOST_CPPFLAGS:N-Wp,-iremap,*}
+HOST_CPPFLAGS:=        ${HOST_CPPFLAGS:N-Wp,-iremap,*:N--sysroot=*}
 .undef LINKS
 
 SRCS?=         ${HOSTPROG}.c



Home | Main Index | Thread Index | Old Index