| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: bsd.buildlink3.mk,v 1.218 2013/02/02 01:04:59 hans Exp $ | | 1 | # $NetBSD: bsd.buildlink3.mk,v 1.219 2013/04/28 13:37:34 obache Exp $ |
2 | # | | 2 | # |
3 | # Copyright (c) 2004 The NetBSD Foundation, Inc. | | 3 | # Copyright (c) 2004 The NetBSD Foundation, Inc. |
4 | # All rights reserved. | | 4 | # All rights reserved. |
5 | # | | 5 | # |
6 | # This code is derived from software contributed to The NetBSD Foundation | | 6 | # This code is derived from software contributed to The NetBSD Foundation |
7 | # by Johnny C. Lam. | | 7 | # by Johnny C. Lam. |
8 | # | | 8 | # |
9 | # Redistribution and use in source and binary forms, with or without | | 9 | # Redistribution and use in source and binary forms, with or without |
10 | # modification, are permitted provided that the following conditions | | 10 | # modification, are permitted provided that the following conditions |
11 | # are met: | | 11 | # are met: |
12 | # 1. Redistributions of source code must retain the above copyright | | 12 | # 1. Redistributions of source code must retain the above copyright |
13 | # notice, this list of conditions and the following disclaimer. | | 13 | # notice, this list of conditions and the following disclaimer. |
14 | # 2. Redistributions in binary form must reproduce the above copyright | | 14 | # 2. Redistributions in binary form must reproduce the above copyright |
| @@ -285,27 +285,27 @@ USE_BUILTIN.${_pkg_}?= no | | | @@ -285,27 +285,27 @@ USE_BUILTIN.${_pkg_}?= no |
285 | . if !empty(USE_BUILTIN.${_pkg_}:M[yY][eE][sS]) | | 285 | . if !empty(USE_BUILTIN.${_pkg_}:M[yY][eE][sS]) |
286 | _BLNK_PKG_DBDIR.${_pkg_}?= _BLNK_PKG_DBDIR.${_pkg_}_not_found | | 286 | _BLNK_PKG_DBDIR.${_pkg_}?= _BLNK_PKG_DBDIR.${_pkg_}_not_found |
287 | _BLNK_PKG_INFO.${_pkg_}?= ${TRUE} | | 287 | _BLNK_PKG_INFO.${_pkg_}?= ${TRUE} |
288 | BUILDLINK_PKGNAME.${_pkg_}?= ${_pkg_} | | 288 | BUILDLINK_PKGNAME.${_pkg_}?= ${_pkg_} |
289 | BUILDLINK_IS_DEPOT.${_pkg_}?= no | | 289 | BUILDLINK_IS_DEPOT.${_pkg_}?= no |
290 | # Usual systems has builtin packages in /usr | | 290 | # Usual systems has builtin packages in /usr |
291 | . if exists(/usr) | | 291 | . if exists(/usr) |
292 | BUILDLINK_PREFIX.${_pkg_}?= /usr | | 292 | BUILDLINK_PREFIX.${_pkg_}?= /usr |
293 | # Haiku OS has posix packages in /boot/common | | 293 | # Haiku OS has posix packages in /boot/common |
294 | . elif exists(/boot/common) | | 294 | . elif exists(/boot/common) |
295 | BUILDLINK_PREFIX.${_pkg_}?= /boot/common | | 295 | BUILDLINK_PREFIX.${_pkg_}?= /boot/common |
296 | . else | | 296 | . else |
297 | # XXX: elsewhere? | | 297 | # XXX: elsewhere? |
298 | BUILDLINK_PREFIX.${_pkg_}?= / | | 298 | BUILDLINK_PREFIX.${_pkg_}?= # empty |
299 | . endif | | 299 | . endif |
300 | . if !empty(LIBABISUFFIX) | | 300 | . if !empty(LIBABISUFFIX) |
301 | BUILDLINK_LIBDIRS.${_pkg_}?= lib${LIBABISUFFIX} | | 301 | BUILDLINK_LIBDIRS.${_pkg_}?= lib${LIBABISUFFIX} |
302 | . endif | | 302 | . endif |
303 | . endif | | 303 | . endif |
304 | # | | 304 | # |
305 | # Set a default for _BLNK_PKG_DBDIR.<pkg>, which is the directory | | 305 | # Set a default for _BLNK_PKG_DBDIR.<pkg>, which is the directory |
306 | # containing the package metadata. | | 306 | # containing the package metadata. |
307 | # | | 307 | # |
308 | . if !defined(_BLNK_PKG_DBDIR.${_pkg_}) | | 308 | . if !defined(_BLNK_PKG_DBDIR.${_pkg_}) |
309 | _BLNK_PKG_DBDIR.${_pkg_}?= # empty | | 309 | _BLNK_PKG_DBDIR.${_pkg_}?= # empty |
310 | . for _depend_ in ${BUILDLINK_API_DEPENDS.${_pkg_}} | | 310 | . for _depend_ in ${BUILDLINK_API_DEPENDS.${_pkg_}} |
311 | . if empty(_BLNK_PKG_DBDIR.${_pkg_}:M*not_found) | | 311 | . if empty(_BLNK_PKG_DBDIR.${_pkg_}:M*not_found) |
| @@ -613,38 +613,38 @@ BUILDLINK_FILES_CMD.${_pkg_}?= \ | | | @@ -613,38 +613,38 @@ BUILDLINK_FILES_CMD.${_pkg_}?= \ |
613 | # BUILDLINK_FILES.<pkg> into one command that outputs all of the files | | 613 | # BUILDLINK_FILES.<pkg> into one command that outputs all of the files |
614 | # for <pkg> relative to ${BUILDLINK_PREFIX.<pkg>}. | | 614 | # for <pkg> relative to ${BUILDLINK_PREFIX.<pkg>}. |
615 | # | | 615 | # |
616 | _BLNK_FILES_CMD.${_pkg_}= ( | | 616 | _BLNK_FILES_CMD.${_pkg_}= ( |
617 | _BLNK_FILES_CMD.${_pkg_}+= ${BUILDLINK_FILES_CMD.${_pkg_}}; | | 617 | _BLNK_FILES_CMD.${_pkg_}+= ${BUILDLINK_FILES_CMD.${_pkg_}}; |
618 | .for _filepattern_ in ${BUILDLINK_FILES.${_pkg_}} | | 618 | .for _filepattern_ in ${BUILDLINK_FILES.${_pkg_}} |
619 | _BLNK_FILES_CMD.${_pkg_}+= ${LS} -1 ${_filepattern_} 2>/dev/null || ${TRUE}; | | 619 | _BLNK_FILES_CMD.${_pkg_}+= ${LS} -1 ${_filepattern_} 2>/dev/null || ${TRUE}; |
620 | .endfor | | 620 | .endfor |
621 | _BLNK_FILES_CMD.${_pkg_}+= ) | | 621 | _BLNK_FILES_CMD.${_pkg_}+= ) |
622 | _BLNK_FILES_CMD.${_pkg_}+= | ${SORT} -u | | 622 | _BLNK_FILES_CMD.${_pkg_}+= | ${SORT} -u |
623 | | | 623 | |
624 | ${_BLNK_COOKIE.${_pkg_}}: | | 624 | ${_BLNK_COOKIE.${_pkg_}}: |
625 | ${RUN} \ | | 625 | ${RUN} \ |
626 | case ${BUILDLINK_PREFIX.${_pkg_}} in \ | | 626 | case "${BUILDLINK_PREFIX.${_pkg_}}" in \ |
627 | *not_found) \ | | 627 | *not_found) \ |
628 | ${ERROR_MSG} "${BUILDLINK_API_DEPENDS.${_pkg_}} is not installed; can't buildlink files."; \ | | 628 | ${ERROR_MSG} "${BUILDLINK_API_DEPENDS.${_pkg_}} is not installed; can't buildlink files."; \ |
629 | exit 1; \ | | 629 | exit 1; \ |
630 | ;; \ | | 630 | ;; \ |
631 | esac | | 631 | esac |
632 | ${RUN} [ ${X11BASE:Q}"" ] || { \ | | 632 | ${RUN} [ ${X11BASE:Q}"" ] || { \ |
633 | ${ERROR_MSG} "[bsd.buildlink3.mk] X11BASE is not set correctly."; \ | | 633 | ${ERROR_MSG} "[bsd.buildlink3.mk] X11BASE is not set correctly."; \ |
634 | exit 1; \ | | 634 | exit 1; \ |
635 | } | | 635 | } |
636 | ${RUN} \ | | 636 | ${RUN} \ |
637 | case ${BUILDLINK_PREFIX.${_pkg_}} in \ | | 637 | case "${BUILDLINK_PREFIX.${_pkg_}}" in \ |
638 | ${LOCALBASE}) buildlink_dir="${BUILDLINK_DIR}" ;; \ | | 638 | ${LOCALBASE}) buildlink_dir="${BUILDLINK_DIR}" ;; \ |
639 | ${X11BASE}) buildlink_dir="${BUILDLINK_X11_DIR}" ;; \ | | 639 | ${X11BASE}) buildlink_dir="${BUILDLINK_X11_DIR}" ;; \ |
640 | *) buildlink_dir="${BUILDLINK_DIR}" ;; \ | | 640 | *) buildlink_dir="${BUILDLINK_DIR}" ;; \ |
641 | esac; \ | | 641 | esac; \ |
642 | cd ${BUILDLINK_PREFIX.${_pkg_}}; \ | | 642 | cd ${BUILDLINK_PREFIX.${_pkg_}}; \ |
643 | ${_BLNK_FILES_CMD.${_pkg_}} | \ | | 643 | ${_BLNK_FILES_CMD.${_pkg_}} | \ |
644 | while read file; do \ | | 644 | while read file; do \ |
645 | src="${_CROSS_DESTDIR}${BUILDLINK_PREFIX.${_pkg_}}/$$file"; \ | | 645 | src="${_CROSS_DESTDIR}${BUILDLINK_PREFIX.${_pkg_}}/$$file"; \ |
646 | if [ ! -f "$$src" ]; then \ | | 646 | if [ ! -f "$$src" ]; then \ |
647 | msg="$$src: not found"; \ | | 647 | msg="$$src: not found"; \ |
648 | else \ | | 648 | else \ |
649 | if [ -z "${BUILDLINK_FNAME_TRANSFORM.${_pkg_}:Q}" ]; then \ | | 649 | if [ -z "${BUILDLINK_FNAME_TRANSFORM.${_pkg_}:Q}" ]; then \ |
650 | dest="$$buildlink_dir/$$file"; \ | | 650 | dest="$$buildlink_dir/$$file"; \ |
| @@ -697,31 +697,33 @@ _BLNK_LT_ARCHIVE_FILTER_SED_SCRIPT.${_pk | | | @@ -697,31 +697,33 @@ _BLNK_LT_ARCHIVE_FILTER_SED_SCRIPT.${_pk |
697 | .if ${X11_TYPE} != "modular" | | 697 | .if ${X11_TYPE} != "modular" |
698 | _BLNK_LT_ARCHIVE_FILTER_SED_SCRIPT.${_pkg_}+= \ | | 698 | _BLNK_LT_ARCHIVE_FILTER_SED_SCRIPT.${_pkg_}+= \ |
699 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)${X11BASE}\(/[^${_BLNK_SEP}]*lib[^/${_BLNK_SEP}]*\.la[${_BLNK_SEP}]\),\\1${_BLNK_MANGLE_DIR.${BUILDLINK_X11_DIR}}\\2,g" \ | | 699 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)${X11BASE}\(/[^${_BLNK_SEP}]*lib[^/${_BLNK_SEP}]*\.la[${_BLNK_SEP}]\),\\1${_BLNK_MANGLE_DIR.${BUILDLINK_X11_DIR}}\\2,g" \ |
700 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)${X11BASE}\(/[^${_BLNK_SEP}]*lib[^/${_BLNK_SEP}]*\.la[${_BLNK_SEP}]\),\\1${_BLNK_MANGLE_DIR.${BUILDLINK_X11_DIR}}\\2,g" | | 700 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)${X11BASE}\(/[^${_BLNK_SEP}]*lib[^/${_BLNK_SEP}]*\.la[${_BLNK_SEP}]\),\\1${_BLNK_MANGLE_DIR.${BUILDLINK_X11_DIR}}\\2,g" |
701 | .endif | | 701 | .endif |
702 | | | 702 | |
703 | _BLNK_LT_ARCHIVE_FILTER_SED_SCRIPT.${_pkg_}+= \ | | 703 | _BLNK_LT_ARCHIVE_FILTER_SED_SCRIPT.${_pkg_}+= \ |
704 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)${LOCALBASE}\(/[^${_BLNK_SEP}]*lib[^/${_BLNK_SEP}]*\.la[${_BLNK_SEP}]\),\\1${_BLNK_MANGLE_DIR.${BUILDLINK_DIR}}\\2,g" \ | | 704 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)${LOCALBASE}\(/[^${_BLNK_SEP}]*lib[^/${_BLNK_SEP}]*\.la[${_BLNK_SEP}]\),\\1${_BLNK_MANGLE_DIR.${BUILDLINK_DIR}}\\2,g" \ |
705 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)${LOCALBASE}\(/[^${_BLNK_SEP}]*lib[^/${_BLNK_SEP}]*\.la[${_BLNK_SEP}]\),\\1${_BLNK_MANGLE_DIR.${BUILDLINK_DIR}}\\2,g" | | 705 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)${LOCALBASE}\(/[^${_BLNK_SEP}]*lib[^/${_BLNK_SEP}]*\.la[${_BLNK_SEP}]\),\\1${_BLNK_MANGLE_DIR.${BUILDLINK_DIR}}\\2,g" |
706 | | | 706 | |
707 | # | | 707 | # |
708 | # Modify the dependency_libs line by removing -L/usr/lib, which is implied. | | 708 | # Modify the dependency_libs line by removing -L/usr/lib, which is implied. |
709 | # | | 709 | # |
| | | 710 | .for _dir_ in ${COMPILER_LIB_DIRS} |
710 | _BLNK_LT_ARCHIVE_FILTER_SED_SCRIPT.${_pkg_}+= \ | | 711 | _BLNK_LT_ARCHIVE_FILTER_SED_SCRIPT.${_pkg_}+= \ |
711 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L/usr/lib\([${_BLNK_SEP}]\),\\1\\2,g" \ | | 712 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${_dir_}\([${_BLNK_SEP}]\),\\1\\2,g" \ |
712 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L/usr/lib\([${_BLNK_SEP}]\),\\1\\2,g" \ | | 713 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${_dir_}\([${_BLNK_SEP}]\),\\1\\2,g" \ |
713 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L/usr/lib/\.\([${_BLNK_SEP}]\),\\1\\2,g" \ | | 714 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${_dir_}/\.\([${_BLNK_SEP}]\),\\1\\2,g" \ |
714 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L/usr/lib/\.\([${_BLNK_SEP}]\),\\1\\2,g" | | 715 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${_dir_}/\.\([${_BLNK_SEP}]\),\\1\\2,g" |
| | | 716 | .endfor |
715 | # | | 717 | # |
716 | # Modify the dependency_libs line by removing -L${LOCALBASE}/* and | | 718 | # Modify the dependency_libs line by removing -L${LOCALBASE}/* and |
717 | # -L${X11BASE}/*, since those are automatically added by the buildlink3.mk | | 719 | # -L${X11BASE}/*, since those are automatically added by the buildlink3.mk |
718 | # files. | | 720 | # files. |
719 | # | | 721 | # |
720 | _BLNK_LT_ARCHIVE_FILTER_SED_SCRIPT.${_pkg_}+= \ | | 722 | _BLNK_LT_ARCHIVE_FILTER_SED_SCRIPT.${_pkg_}+= \ |
721 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${X11BASE}/[^${_BLNK_SEP}]*\([${_BLNK_SEP}]\),\\1\\2,g" \ | | 723 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${X11BASE}/[^${_BLNK_SEP}]*\([${_BLNK_SEP}]\),\\1\\2,g" \ |
722 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${X11BASE}/[^${_BLNK_SEP}]*\([${_BLNK_SEP}]\),\\1\\2,g" \ | | 724 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${X11BASE}/[^${_BLNK_SEP}]*\([${_BLNK_SEP}]\),\\1\\2,g" \ |
723 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${LOCALBASE}/[^${_BLNK_SEP}]*\([${_BLNK_SEP}]\),\\1\\2,g" \ | | 725 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${LOCALBASE}/[^${_BLNK_SEP}]*\([${_BLNK_SEP}]\),\\1\\2,g" \ |
724 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${LOCALBASE}/[^${_BLNK_SEP}]*\([${_BLNK_SEP}]\),\\1\\2,g" | | 726 | -e "/^dependency_libs=/s,\([${_BLNK_SEP}]\)-L${LOCALBASE}/[^${_BLNK_SEP}]*\([${_BLNK_SEP}]\),\\1\\2,g" |
725 | # | | 727 | # |
726 | # Unmangle. | | 728 | # Unmangle. |
727 | # | | 729 | # |
| @@ -795,31 +797,33 @@ _BLNK_PASSTHRU_DIRS+= ${BUILDLINK_PREFIX | | | @@ -795,31 +797,33 @@ _BLNK_PASSTHRU_DIRS+= ${BUILDLINK_PREFIX |
795 | . endif | | 797 | . endif |
796 | .endfor | | 798 | .endfor |
797 | # | | 799 | # |
798 | # Allow the depot directory for the package we're building. | | 800 | # Allow the depot directory for the package we're building. |
799 | # | | 801 | # |
800 | .if ${PKG_INSTALLATION_TYPE} == "pkgviews" | | 802 | .if ${PKG_INSTALLATION_TYPE} == "pkgviews" |
801 | _BLNK_PASSTHRU_DIRS+= ${PREFIX} | | 803 | _BLNK_PASSTHRU_DIRS+= ${PREFIX} |
802 | .endif | | 804 | .endif |
803 | # | | 805 | # |
804 | # Allow any directories specified by the package or user. | | 806 | # Allow any directories specified by the package or user. |
805 | # | | 807 | # |
806 | _BLNK_PASSTHRU_DIRS+= ${BUILDLINK_PASSTHRU_DIRS} | | 808 | _BLNK_PASSTHRU_DIRS+= ${BUILDLINK_PASSTHRU_DIRS} |
807 | # | | 809 | # |
808 | # Strip out /usr, /usr/include, and /usr/lib as they're always | | 810 | # Strip out ${COMPILER_LIB_DIRS}, and ${COMPILER_INCLUDE_DIRS} as they're always |
809 | # automatically added to all of the search paths. Also strip out | | 811 | # automatically added to all of the search paths. Also strip out |
810 | # ${LOCALBASE} and ${X11BASE} to prevent silly mistakes. | | 812 | # ${LOCALBASE} and ${X11BASE} to prevent silly mistakes. |
811 | # | | 813 | # |
812 | _BLNK_PASSTHRU_DIRS:= ${_BLNK_PASSTHRU_DIRS:N/usr:N/usr/lib:N/usr/include:N${LOCALBASE}:N${X11BASE}} | | 814 | .for _dir_ in ${COMPILER_LIB_DIRS} ${COMPILER_INCLUDE_DIRS} ${LOCALBASE} ${X11BASE} |
| | | 815 | _BLNK_PASSTHRU_DIRS:= ${_BLNK_PASSTHRU_DIRS:N${_dir_}} |
| | | 816 | .endfor |
813 | # | | 817 | # |
814 | # Allow all directories in the library subdirectories listed for each | | 818 | # Allow all directories in the library subdirectories listed for each |
815 | # package to be in the runtime library search path. | | 819 | # package to be in the runtime library search path. |
816 | # | | 820 | # |
817 | .for _pkg_ in ${_BLNK_PACKAGES} | | 821 | .for _pkg_ in ${_BLNK_PACKAGES} |
818 | . if !empty(BUILDLINK_IS_DEPOT.${_pkg_}:M[nN][oO]) | | 822 | . if !empty(BUILDLINK_IS_DEPOT.${_pkg_}:M[nN][oO]) |
819 | . if !empty(BUILDLINK_LIBDIRS.${_pkg_}) | | 823 | . if !empty(BUILDLINK_LIBDIRS.${_pkg_}) |
820 | . for _dir_ in ${BUILDLINK_LIBDIRS.${_pkg_}} | | 824 | . for _dir_ in ${BUILDLINK_LIBDIRS.${_pkg_}} |
821 | . if exists(${BUILDLINK_PREFIX.${_pkg_}}/${_dir_}) | | 825 | . if exists(${BUILDLINK_PREFIX.${_pkg_}}/${_dir_}) |
822 | _BLNK_PASSTHRU_RPATHDIRS+= ${BUILDLINK_PREFIX.${_pkg_}}/${_dir_} | | 826 | _BLNK_PASSTHRU_RPATHDIRS+= ${BUILDLINK_PREFIX.${_pkg_}}/${_dir_} |
823 | . endif | | 827 | . endif |
824 | . endfor | | 828 | . endfor |
825 | . endif | | 829 | . endif |
| @@ -836,38 +840,40 @@ _BLNK_PASSTHRU_RPATHDIRS+= ${LOCALBASE}/ | | | @@ -836,38 +840,40 @@ _BLNK_PASSTHRU_RPATHDIRS+= ${LOCALBASE}/ |
836 | # packages so that X11 libraries can be found. | | 840 | # packages so that X11 libraries can be found. |
837 | # | | 841 | # |
838 | .if defined(USE_X11) && ${X11_TYPE} != "modular" | | 842 | .if defined(USE_X11) && ${X11_TYPE} != "modular" |
839 | _BLNK_PASSTHRU_RPATHDIRS+= ${X11BASE}/lib | | 843 | _BLNK_PASSTHRU_RPATHDIRS+= ${X11BASE}/lib |
840 | .endif | | 844 | .endif |
841 | # | | 845 | # |
842 | # Allow any directories specified by the package or user. | | 846 | # Allow any directories specified by the package or user. |
843 | # | | 847 | # |
844 | _BLNK_PASSTHRU_RPATHDIRS+= ${BUILDLINK_PASSTHRU_RPATHDIRS} | | 848 | _BLNK_PASSTHRU_RPATHDIRS+= ${BUILDLINK_PASSTHRU_RPATHDIRS} |
845 | # | | 849 | # |
846 | # Strip out /usr/lib (and /usr/lib${LIBABISUFFIX}}) as it's always | | 850 | # Strip out /usr/lib (and /usr/lib${LIBABISUFFIX}}) as it's always |
847 | # automatically in the runtime library search path. | | 851 | # automatically in the runtime library search path. |
848 | # | | 852 | # |
849 | _BLNK_PASSTHRU_RPATHDIRS:= ${_BLNK_PASSTHRU_RPATHDIRS:N/usr/lib:N/usr/lib${LIBABISUFFIX}} | | 853 | .for _dir_ in ${SYSTEM_DEFAULT_RPATH:ts:} |
| | | 854 | _BLNK_PASSTHRU_RPATHDIRS:= ${_BLNK_PASSTHRU_RPATHDIRS:N${_dir_}} |
| | | 855 | .endfor |
850 | | | 856 | |
851 | _BLNK_MANGLE_DIRS= # empty | | 857 | _BLNK_MANGLE_DIRS= # empty |
852 | _BLNK_MANGLE_DIRS+= ${BUILDLINK_DIR} | | 858 | _BLNK_MANGLE_DIRS+= ${BUILDLINK_DIR} |
853 | .if ${X11_TYPE} != "modular" | | 859 | .if ${X11_TYPE} != "modular" |
854 | _BLNK_MANGLE_DIRS+= ${BUILDLINK_X11_DIR} | | 860 | _BLNK_MANGLE_DIRS+= ${BUILDLINK_X11_DIR} |
855 | .endif | | 861 | .endif |
856 | _BLNK_MANGLE_DIRS+= ${WRKDIR} | | 862 | _BLNK_MANGLE_DIRS+= ${WRKDIR} |
857 | _BLNK_MANGLE_DIRS+= ${_BLNK_PASSTHRU_DIRS} | | 863 | _BLNK_MANGLE_DIRS+= ${_BLNK_PASSTHRU_DIRS} |
858 | _BLNK_MANGLE_DIRS+= ${_BLNK_PASSTHRU_RPATHDIRS} | | 864 | _BLNK_MANGLE_DIRS+= ${_BLNK_PASSTHRU_RPATHDIRS} |
859 | _BLNK_MANGLE_DIRS+= /usr/include | | 865 | _BLNK_MANGLE_DIRS+= ${COMPILER_INCLUDE_DIRS} |
860 | _BLNK_MANGLE_DIRS+= /usr/lib${LIBABISUFFIX} | | 866 | _BLNK_MANGLE_DIRS+= ${COMPILER_LIB_DIRS} |
861 | .if ${PKG_INSTALLATION_TYPE} == "pkgviews" | | 867 | .if ${PKG_INSTALLATION_TYPE} == "pkgviews" |
862 | _BLNK_MANGLE_DIRS+= ${PREFIX} | | 868 | _BLNK_MANGLE_DIRS+= ${PREFIX} |
863 | .endif | | 869 | .endif |
864 | _BLNK_MANGLE_DIRS+= ${LOCALBASE} | | 870 | _BLNK_MANGLE_DIRS+= ${LOCALBASE} |
865 | .if defined(USE_X11) && ${X11_TYPE} != "modular" | | 871 | .if defined(USE_X11) && ${X11_TYPE} != "modular" |
866 | _BLNK_MANGLE_DIRS+= ${X11BASE} | | 872 | _BLNK_MANGLE_DIRS+= ${X11BASE} |
867 | .endif | | 873 | .endif |
868 | | | 874 | |
869 | _BLNK_MANGLE_START= _bUiLdLiNk_ | | 875 | _BLNK_MANGLE_START= _bUiLdLiNk_ |
870 | _BLNK_MANGLE_END= \# | | 876 | _BLNK_MANGLE_END= \# |
871 | .for _dir_ in ${_BLNK_MANGLE_DIRS} | | 877 | .for _dir_ in ${_BLNK_MANGLE_DIRS} |
872 | _BLNK_MANGLE_DIR.${_dir_}= \ | | 878 | _BLNK_MANGLE_DIR.${_dir_}= \ |
873 | ${_BLNK_MANGLE_START}${_dir_:S/\//_/g}${_BLNK_MANGLE_END} | | 879 | ${_BLNK_MANGLE_START}${_dir_:S/\//_/g}${_BLNK_MANGLE_END} |
| @@ -875,28 +881,28 @@ _BLNK_MANGLE_DIR.${_dir_}= \ | | | @@ -875,28 +881,28 @@ _BLNK_MANGLE_DIR.${_dir_}= \ |
875 | _BLNK_MANGLE_SED_PATTERN= \ | | 881 | _BLNK_MANGLE_SED_PATTERN= \ |
876 | ${_BLNK_MANGLE_START}[^/ ${_BLNK_MANGLE_END}]*${_BLNK_MANGLE_END} | | 882 | ${_BLNK_MANGLE_START}[^/ ${_BLNK_MANGLE_END}]*${_BLNK_MANGLE_END} |
877 | | | 883 | |
878 | _BLNK_PROTECT_DIRS= # empty | | 884 | _BLNK_PROTECT_DIRS= # empty |
879 | _BLNK_UNPROTECT_DIRS= # empty | | 885 | _BLNK_UNPROTECT_DIRS= # empty |
880 | | | 886 | |
881 | _BLNK_PROTECT_DIRS+= ${BUILDLINK_DIR} | | 887 | _BLNK_PROTECT_DIRS+= ${BUILDLINK_DIR} |
882 | .if ${X11_TYPE} != "modular" | | 888 | .if ${X11_TYPE} != "modular" |
883 | _BLNK_PROTECT_DIRS+= ${BUILDLINK_X11_DIR} | | 889 | _BLNK_PROTECT_DIRS+= ${BUILDLINK_X11_DIR} |
884 | .endif | | 890 | .endif |
885 | _BLNK_PROTECT_DIRS+= ${WRKDIR} | | 891 | _BLNK_PROTECT_DIRS+= ${WRKDIR} |
886 | _BLNK_PROTECT_DIRS+= ${_BLNK_PASSTHRU_DIRS} | | 892 | _BLNK_PROTECT_DIRS+= ${_BLNK_PASSTHRU_DIRS} |
887 | | | 893 | |
888 | _BLNK_UNPROTECT_DIRS+= /usr/include | | 894 | _BLNK_UNPROTECT_DIRS+= ${COMPILER_INCLUDE_DIRS} |
889 | _BLNK_UNPROTECT_DIRS+= /usr/lib${LIBABISUFFIX} | | 895 | _BLNK_UNPROTECT_DIRS+= ${COMPILER_LIB_DIRS} |
890 | .if ${PKG_INSTALLATION_TYPE} == "pkgviews" | | 896 | .if ${PKG_INSTALLATION_TYPE} == "pkgviews" |
891 | _BLNK_UNPROTECT_DIRS+= ${PREFIX} | | 897 | _BLNK_UNPROTECT_DIRS+= ${PREFIX} |
892 | .endif | | 898 | .endif |
893 | _BLNK_UNPROTECT_DIRS+= ${LOCALBASE} | | 899 | _BLNK_UNPROTECT_DIRS+= ${LOCALBASE} |
894 | .if defined(USE_X11) && ${X11_TYPE} != "modular" | | 900 | .if defined(USE_X11) && ${X11_TYPE} != "modular" |
895 | _BLNK_UNPROTECT_DIRS+= ${X11BASE} | | 901 | _BLNK_UNPROTECT_DIRS+= ${X11BASE} |
896 | .endif | | 902 | .endif |
897 | _BLNK_UNPROTECT_DIRS+= ${_BLNK_PASSTHRU_DIRS} | | 903 | _BLNK_UNPROTECT_DIRS+= ${_BLNK_PASSTHRU_DIRS} |
898 | _BLNK_UNPROTECT_DIRS+= ${WRKDIR} | | 904 | _BLNK_UNPROTECT_DIRS+= ${WRKDIR} |
899 | .if ${X11_TYPE} != "modular" | | 905 | .if ${X11_TYPE} != "modular" |
900 | _BLNK_UNPROTECT_DIRS+= ${BUILDLINK_X11_DIR} | | 906 | _BLNK_UNPROTECT_DIRS+= ${BUILDLINK_X11_DIR} |
901 | .endif | | 907 | .endif |
902 | _BLNK_UNPROTECT_DIRS+= ${BUILDLINK_DIR} | | 908 | _BLNK_UNPROTECT_DIRS+= ${BUILDLINK_DIR} |
| @@ -945,48 +951,54 @@ _BLNK_TRANSFORM+= mangle:${_dir_}:${_BLN | | | @@ -945,48 +951,54 @@ _BLNK_TRANSFORM+= mangle:${_dir_}:${_BLN |
945 | # Transform /usr/lib/../lib* to /usr/lib* so the following transformation | | 951 | # Transform /usr/lib/../lib* to /usr/lib* so the following transformation |
946 | # work. (added by libtool on multlib Linux systems). | | 952 | # work. (added by libtool on multlib Linux systems). |
947 | # | | 953 | # |
948 | .if !empty(MACHINE_PLATFORM:MLinux-*-x86_64) | | 954 | .if !empty(MACHINE_PLATFORM:MLinux-*-x86_64) |
949 | _BLNK_TRANSFORM+= mangle:/usr/lib/../lib64:/usr/lib64 | | 955 | _BLNK_TRANSFORM+= mangle:/usr/lib/../lib64:/usr/lib64 |
950 | _BLNK_TRANSFORM+= mangle:/usr/lib/../lib:/usr/lib | | 956 | _BLNK_TRANSFORM+= mangle:/usr/lib/../lib:/usr/lib |
951 | _BLNK_TRANSFORM+= mangle:/usr/lib/../lib32:/usr/lib32 | | 957 | _BLNK_TRANSFORM+= mangle:/usr/lib/../lib32:/usr/lib32 |
952 | _BLNK_TRANSFORM+= mangle:/usr/lib/../libx32:/usr/libx32 | | 958 | _BLNK_TRANSFORM+= mangle:/usr/lib/../libx32:/usr/libx32 |
953 | .endif | | 959 | .endif |
954 | # | | 960 | # |
955 | # Protect -I/usr/include/* and -L/usr/lib/* from transformations (these | | 961 | # Protect -I/usr/include/* and -L/usr/lib/* from transformations (these |
956 | # aren't part of the normal header or library search paths). | | 962 | # aren't part of the normal header or library search paths). |
957 | # | | 963 | # |
958 | _BLNK_TRANSFORM+= opt-sub:-I/usr/include:-I${_BLNK_MANGLE_DIR./usr/include} | | 964 | .for _dir_ in ${COMPILER_INCLUDE_DIRS} |
959 | _BLNK_TRANSFORM+= opt-sub:-L/usr/lib:-L${_BLNK_MANGLE_DIR./usr/lib} | | 965 | _BLNK_TRANSFORM+= opt-sub:-I${_dir_}:-I${_BLNK_MANGLE_DIR.${_dir_}} |
| | | 966 | .endfor |
| | | 967 | .for _dir_ in ${COMPILER_LIB_DIRS} |
| | | 968 | _BLNK_TRANSFORM+= opt-sub:-L${_dir_}:-L${_BLNK_MANGLE_DIR.${_dir_}} |
| | | 969 | .endfor |
960 | # | | 970 | # |
961 | # Change any buildlink directories in runtime library search paths into | | 971 | # Change any buildlink directories in runtime library search paths into |
962 | # the canonical actual installed paths. | | 972 | # the canonical actual installed paths. |
963 | # | | 973 | # |
964 | _BLNK_TRANSFORM+= rpath:${_BLNK_MANGLE_DIR.${BUILDLINK_DIR}}:${LOCALBASE} | | 974 | _BLNK_TRANSFORM+= rpath:${_BLNK_MANGLE_DIR.${BUILDLINK_DIR}}:${LOCALBASE} |
965 | .if defined(USE_X11) && ${X11_TYPE} != "modular" | | 975 | .if defined(USE_X11) && ${X11_TYPE} != "modular" |
966 | _BLNK_TRANSFORM+= rpath:${_BLNK_MANGLE_DIR.${BUILDLINK_X11_DIR}}:${X11BASE} | | 976 | _BLNK_TRANSFORM+= rpath:${_BLNK_MANGLE_DIR.${BUILDLINK_X11_DIR}}:${X11BASE} |
967 | .endif | | 977 | .endif |
968 | # | | 978 | # |
969 | # Protect some directories that we allow to be specified for the runtime | | 979 | # Protect some directories that we allow to be specified for the runtime |
970 | # library search path. | | 980 | # library search path. |
971 | # | | 981 | # |
972 | .for _dir_ in ${_BLNK_PASSTHRU_DIRS} ${_BLNK_PASSTHRU_RPATHDIRS} | | 982 | .for _dir_ in ${_BLNK_PASSTHRU_DIRS} ${_BLNK_PASSTHRU_RPATHDIRS} |
973 | _BLNK_TRANSFORM+= rpath:${_dir_}:${_BLNK_MANGLE_DIR.${_dir_}} | | 983 | _BLNK_TRANSFORM+= rpath:${_dir_}:${_BLNK_MANGLE_DIR.${_dir_}} |
974 | .endfor | | 984 | .endfor |
975 | # | | 985 | # |
976 | # Protect /usr/lib/* as they're all allowed to be specified for the | | 986 | # Protect /usr/lib/* as they're all allowed to be specified for the |
977 | # runtime library search path. | | 987 | # runtime library search path. |
978 | # | | 988 | # |
979 | _BLNK_TRANSFORM+= sub-rpath:/usr/lib:${_BLNK_MANGLE_DIR./usr/lib} | | 989 | .for _dir_ in ${SYSTEM_DEFAULT_RPATH:ts:} |
| | | 990 | _BLNK_TRANSFORM+= sub-rpath:${_dir_}:${_BLNK_MANGLE_DIR.${_dir}} |
| | | 991 | .endfor |
980 | # | | 992 | # |
981 | # Change references to ${DEPOTBASE}/<pkg> into ${LOCALBASE} so that | | 993 | # Change references to ${DEPOTBASE}/<pkg> into ${LOCALBASE} so that |
982 | # "overwrite" packages think headers and libraries for "pkgviews" packages | | 994 | # "overwrite" packages think headers and libraries for "pkgviews" packages |
983 | # are just found in the default view. | | 995 | # are just found in the default view. |
984 | # | | 996 | # |
985 | .if ${PKG_INSTALLATION_TYPE} == "overwrite" | | 997 | .if ${PKG_INSTALLATION_TYPE} == "overwrite" |
986 | _BLNK_TRANSFORM+= depot:${DEPOTBASE}:${LOCALBASE} | | 998 | _BLNK_TRANSFORM+= depot:${DEPOTBASE}:${LOCALBASE} |
987 | .endif | | 999 | .endif |
988 | # | | 1000 | # |
989 | # Convert direct paths to static libraries and libtool archives in | | 1001 | # Convert direct paths to static libraries and libtool archives in |
990 | # ${LOCALBASE} or ${X11BASE} into references into ${BUILDLINK_DIR}. | | 1002 | # ${LOCALBASE} or ${X11BASE} into references into ${BUILDLINK_DIR}. |
991 | # | | 1003 | # |
992 | .if ${PKG_INSTALLATION_TYPE} == "overwrite" | | 1004 | .if ${PKG_INSTALLATION_TYPE} == "overwrite" |