Annotation of pkgsrc/lang/gcc6/Makefile, revision 1.35

1.35    ! nia         1: # $NetBSD: Makefile,v 1.34 2021/10/12 13:46:14 tnn Exp $
1.1       maya        2: 
                      3: GCC_PKGNAME=           gcc6
                      4: .include               "version.mk"
                      5: 
                      6: DISTNAME=      gcc-${GCC6_DIST_VERSION}
                      7: PKGNAME=       ${GCC_PKGNAME}-${GCC6_DIST_VERSION}
                      8: ## When bumping the PKGREVISION of this package the PKGREVISION of
1.28      gutterid    9: ## lang/gcc6-libs needs to be bumped to be at least 1 more than the
1.1       maya       10: ## PKGREVISION of this package!
1.31      wiz        11: PKGREVISION=   7
1.1       maya       12: CATEGORIES=    lang
                     13: MASTER_SITES=  ${MASTER_SITE_GNU:=gcc/gcc-${GCC6_DIST_VERSION}/}
1.7       maya       14: EXTRACT_SUFX=  .tar.xz
1.1       maya       15: 
1.11      maya       16: MAINTAINER=    [email protected]
1.22      rillig     17: HOMEPAGE=      https://gcc.gnu.org/
1.1       maya       18: COMMENT=       The GNU Compiler Collection (GCC) - 6 Release Series
                     19: LICENSE=       gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3
                     20: 
                     21: DISTFILES=             ${DEFAULT_DISTFILES}
                     22: EXTRACT_ONLY=          ${DEFAULT_DISTFILES}
                     23: 
1.33      nia        24: # Relocations result in a linker error on AArch64, but not x86.
                     25: MKPIE_SUPPORTED=       no
1.35    ! nia        26: CHECK_RELRO_SKIP+=     ${GCC_PKGNAME}/lib/*
1.33      nia        27: 
1.1       maya       28: NOT_FOR_PLATFORM=      Interix-*-*
                     29: 
1.6       maya       30: USE_LANGUAGES=         c c++
                     31: USE_TOOLS+=            gmake makeinfo sed:run tar:build
                     32: USE_TOOLS.NetBSD+=     gsed
1.1       maya       33: 
                     34: GNU_CONFIGURE=         yes
1.25      rillig     35: GNU_CONFIGURE_STRICT=  no # has sub-configures
1.1       maya       36: ## Build outside ${WRKSRC}
                     37: OBJDIR=                        ../build
                     38: CONFIGURE_DIRS=                ${OBJDIR}
                     39: CONFIGURE_SCRIPT=      ../${DISTNAME}/configure
                     40: GCC_SUBPREFIX=         ${GCC_PKGNAME}
                     41: GCC_PREFIX=            ${PREFIX}/${GCC_SUBPREFIX}
                     42: GNU_CONFIGURE_PREFIX=  ${GCC_PREFIX}
                     43: INFO_FILES=            yes
                     44: CONFIGURE_ARGS+=       --disable-libstdcxx-pch
1.19      abs        45: GCC_TARGET_MACHINE=    ${MACHINE_GNU_PLATFORM}
1.1       maya       46: 
                     47: UNLIMIT_RESOURCES+=    datasize
                     48: UNLIMIT_RESOURCES+=    stacksize
                     49: 
                     50: SUBST_CLASSES+=                vars
                     51: SUBST_MESSAGE.vars=    Setting target machine name path in ${SUBST_FILES.vars}
                     52: SUBST_STAGE.vars=      pre-configure
                     53: SUBST_FILES.vars=      gcc/Makefile.in
                     54: SUBST_VARS.vars=       GCC_TARGET_MACHINE
                     55: 
1.23      rillig     56: # These programs use [[ ... ]] and are not needed for the build.
1.24      rillig     57: CHECK_PORTABILITY_SKIP+= \
1.23      rillig     58:        contrib/prepare_patch.sh \
                     59:        contrib/patch_tester.sh
                     60: 
1.1       maya       61: .include "../../mk/bsd.prefs.mk"
                     62: 
                     63: LANGS=                 c
                     64: 
                     65: # In some cases LINKER_RPATH_FLAG needs a trailing space.
                     66: LINKER_RPATH_FLAG:=    ${LINKER_RPATH_FLAG:S/-rpath/& /}
                     67: 
                     68: ## The Library rpath to use in end programs.
                     69: LDFLAGS_FOR_TARGET=    ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*}
                     70: 
                     71: # The "-static-libstdc++ -static-libgcc" flags are normally added to the
                     72: # boot-ldflags by configure but because we are supply the boot-ldflags
                     73: # we mash supply them.
                     74: BOOT_LDFLAGS=          -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET}
                     75: # Needed on Darwin when LDFLAGS point to a SDK
                     76: BOOT_LDFLAGS+=         ${LDFLAGS:M-Wl,-syslibroot*}
                     77: # GCC does not understand this option; remove it, or stage build will fail
                     78: BUILDLINK_TRANSFORM+=  rm:-stdlib=libc++
                     79: 
1.12      jperkin    80: # Disable fixincludes on SmartOS, header changes result in broken includes
                     81: # being generated, see https://github.com/joyent/pkgsrc-legacy/issues/270
                     82: .if ${OS_VARIANT} == "SmartOS"
                     83: SUBST_CLASSES+=                fixinc
                     84: SUBST_STAGE.fixinc=    pre-configure
                     85: SUBST_FILES.fixinc=    gcc/Makefile.in
                     86: SUBST_SED.fixinc=      -e "s,\./fixinc.sh,-c true,"
                     87: .endif
                     88: 
1.1       maya       89: .include "options.mk"
                     90: 
                     91: ## For graphite support.
                     92: .if !empty(PKG_OPTIONS:Mgcc-graphite)
                     93: 
                     94: post-extract:
                     95:        ${TAR} -jxf ${DISTDIR}/${ISL14}.tar.bz2 -C ${WRKSRC}
                     96:        ${MV} ${WRKSRC}/${ISL14} ${WRKSRC}/isl
                     97: .endif
                     98: 
                     99: ## For target librarys and libjava programs.
                    100: CONFIGURE_ENV+=                LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q}
                    101: 
                    102: CONFIGURE_ARGS+=       --enable-languages=${LANGS:Q}
                    103: CONFIGURE_ARGS+=       --enable-shared
                    104: CONFIGURE_ARGS+=       --enable-long-long
                    105: CONFIGURE_ARGS+=       --with-local-prefix=${GCC_PREFIX:Q}
1.20      abs       106: CONFIGURE_ARGS+=       --enable-threads=posix
                    107: CONFIGURE_ARGS+=       --with-boot-ldflags=${BOOT_LDFLAGS:Q}
                    108: 
1.1       maya      109: .if !empty(MACHINE_PLATFORM:MNetBSD-*-*)
1.10      maya      110: # native SSP conflicts with gcc's libssp
1.1       maya      111: CONFIGURE_ARGS+=       --disable-libssp
1.9       maya      112: # Match base libstdc++ major
                    113: SUBST_CLASSES+=                libstdc
                    114: SUBST_STAGE.libstdc=   pre-configure
                    115: SUBST_FILES.libstdc=   libstdc++-v3/configure
                    116: SUBST_MESSAGE.libstdc= Bumping libstdc++ major to 7
                    117: SUBST_SED.libstdc=     -e 's,libtool_VERSION=6:,libtool_VERSION=7:,g'
1.1       maya      118: .else
                    119: CONFIGURE_ARGS+=       --enable-libssp
                    120: .endif
                    121: 
1.2       adam      122: # multilib on Darwin requires fat-binaries
                    123: CONFIGURE_ARGS.Darwin+=        --disable-multilib
                    124: .if !empty(OSX_SDK_PATH)
                    125: CONFIGURE_ARGS.Darwin+=        --with-sysroot=${OSX_SDK_PATH}
                    126: .endif
1.1       maya      127: CONFIGURE_ARGS.NetBSD+=        --with-gnu-ld --with-ld=/usr/bin/ld
                    128: CONFIGURE_ARGS.NetBSD+=        --with-gnu-as --with-as=/usr/bin/as
                    129: MAKE_ENV.NetBSD+=      ac_cv_func_clock_gettime=yes
                    130: MAKE_ENV.NetBSD+=      ac_cv_func_gethostbyname_r=no
                    131: MAKE_ENV.NetBSD+=      ac_cv_func_freelocale=no
                    132: MAKE_ENV.NetBSD+=      ac_cv_func_newlocale=no
                    133: MAKE_ENV.NetBSD+=      ac_cv_func_uselocale=no
1.8       jperkin   134: MAKE_ENV.SunOS+=       ac_cv_func_mkostemp=no
1.1       maya      135: 
1.34      tnn       136: .if !empty(PKGSRC_COMPILER:Mclang) || ${OPSYS} == "DragonFly"
                    137: CONFIGURE_ARGS+=       --disable-bootstrap
1.32      tnn       138: .endif
1.1       maya      139: 
                    140: .if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || !empty(MACHINE_PLATFORM:MLinux-*-i386)
                    141: CONFIGURE_ARGS+=       --with-arch=i486 --with-tune=i486
                    142: .endif
                    143: 
                    144: .if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64) || !empty(MACHINE_PLATFORM:MLinux-*-x86_64)
                    145: CONFIGURE_ARGS+=       --with-arch=nocona --with-tune=nocona --with-fpmath=sse
                    146: .endif
                    147: 
                    148: .if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*)
                    149: CONFIGURE_ARGS+=       --with-dwarf2
                    150: .endif
                    151: 
                    152: # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into
                    153: # a binary so we need to make sure we give it the installed sed and not
                    154: # the tool wrapped one.
                    155: MAKE_ENV+=             ac_cv_path_SED=${TOOLS_SED}
                    156: MAKE_ENV+=             lt_cv_path_SED=${TOOLS_SED}
                    157: 
                    158: # Determine whether to use binutils
                    159: .if ${OPSYS} == "SunOS"
                    160: .  if exists(/usr/sfw/bin/gobjdump)
                    161: CONFIGURE_ENV+=                OBJDUMP=/usr/sfw/bin/gobjdump
                    162: .  endif
                    163: .  if exists(/usr/bin/ld)
                    164: CONFIGURE_ARGS+=       --without-gnu-ld --with-ld=/usr/bin/ld
                    165: .  else
                    166: CONFIGURE_ARGS+=       --without-gnu-ld --with-ld=/usr/ccs/bin/ld
                    167: .  endif
                    168: .  if exists(/usr/sfw/bin/gas)
                    169: CONFIGURE_ARGS+=       --with-gnu-as --with-as=/usr/sfw/bin/gas
                    170: .  elif exists(/usr/ccs/bin/as)
                    171: CONFIGURE_ARGS+=       --without-gnu-as --with-as=/usr/ccs/bin/as
                    172: .  else
                    173: BUILDLINK_DEPMETHOD.binutils=  full
                    174: .    include "../../devel/binutils/buildlink3.mk"
                    175: CONFIGURE_ARGS+=       --with-gnu-as --with-as=${PREFIX}/bin/gas
                    176: .  endif
                    177: .endif
                    178: 
                    179: .if ${OS_VARIANT} == "SmartOS"
                    180: SUBST_CLASSES+=                ccs
                    181: SUBST_STAGE.ccs=       pre-configure
                    182: SUBST_FILES.ccs=       contrib/make_sunver.pl
                    183: SUBST_SED.ccs=         -e 's,/usr/ccs/bin,/usr/bin,g'
                    184: .endif
                    185: 
1.27      jperkin   186: CTF_FILES_SKIP+=       */gengtype      # CPU limit exceeded
                    187: 
1.1       maya      188: pre-configure:
                    189:        ${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR}
                    190: 
                    191: TEST_TARGET=   -k check || ${TRUE}
                    192: pre-test:
                    193:        ${RUN}                                                  \
                    194:        if runtest --version >/dev/null 2>/dev/null ; then      \
                    195:                : ;                                             \
                    196:        else                                                    \
                    197:          ${ECHO} "ERROR: Please install devel/dejagnu in order to run the test suite." ; \
                    198:          exit 1 ;                                              \
                    199:        fi
                    200: post-test:
                    201:        ${RUN} cd ${WRKSRC} && cd ${OBJDIR} &&          \
                    202:        ${SHELL} ${WRKSRC}/contrib/test_summary >${WRKDIR}/test_summary.log
                    203:        ${INFO_MSG} "Test summary are available in ${WRKDIR}/test_summary.log"
                    204: 
                    205: post-install:
                    206:        ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || \
                    207:                ( cd ${DESTDIR}${GCC_PREFIX}/bin ; ${LN} -f gcc cc )
                    208: .if !empty(PKG_OPTIONS:Mgcc-java)
                    209:        ${RM} -f ${DESTDIR}${JAVA_HOME}/bin/javadoc
                    210:        ${RM} -f ${DESTDIR}${JAVA_HOME}/jre/lib/${JAVA_ARCH}/libjawt.so
                    211: .endif
                    212: .if !empty(MACHINE_PLATFORM:MSunOS-*-*86*) && ${OS_VERSION} != "5.11"
                    213:        ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 || ${TRUE}
                    214:        ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 || ${TRUE}
                    215: .endif
                    216: 
                    217: GENERATE_PLIST+= \
                    218:        cd ${DESTDIR}${PREFIX} &&                                       \
                    219:        ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print | ${SORT} ;
                    220: 
                    221: .include "../../mk/dlopen.buildlink3.mk"
                    222: .include "../../mk/pthread.buildlink3.mk"
                    223: .include "../../mk/bsd.pkg.mk"

CVSweb <[email protected]>