git: initrd: Handle ${DESTDIR} when building rescue tools

Aaron LI aly at
Wed Jul 4 02:50:49 PDT 2018

commit 4e60e668e7ed5a59f1bb342d7c6dd2d678a4b93f
Author: Aaron LI <aly at>
Date:   Wed Jun 27 09:36:05 2018 +0800

    initrd: Handle ${DESTDIR} when building rescue tools
    When building rescue tools for a target system (e.g., create release
    build), use tools (e.g., crunchide, crunchgen, cc), headers and libraries
    from the target root (${DESTDIR}).
    GCC is more tolerant (e.g., doesn't warn about unused variables) to
    system headers than user headers, so we have to use "-isystem <inc_dir>"
    instead of "-I<dir>", but the former (option syntax) causes difficulty
    for <> to filter the options to call mkdep(1).  Therefore, we
    use "--sysroot=${DESTDIR}" and it's simpler than specifying headers paths
    with "-I<dir>" and library paths with "-L<dir>".
    Meanwhile, improve the commands logic in Makefile, and set LC_ALL=C.

Summary of changes:
 initrd/Makefile                  | 19 +++++++++----------
 initrd/              | 15 ++++++++++++---
 initrd/rescue.libcrypto/Makefile |  2 +-
 initrd/rescue/Makefile           |  2 +-
 share/mk/        | 16 +++++++++++++---
 share/mk/              |  2 ++
 6 files changed, 38 insertions(+), 18 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list