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

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

CVSweb <[email protected]>