$NetBSD: patch-ad,v 1.23 2018/01/28 16:04:11 wiz Exp $ *BSD and qnx are identified as linux. Add another SDK path on Mac OS X. All sparc cpus can not do unaligned access. Detect NetBSD ARMv7 hardfloat toolchain. Recognize powerpc as a target ISA, so we don't end up with generic-gnu and possibly no libm reference... --- build/make/configure.sh.orig 2018-01-24 22:25:44.000000000 +0000 +++ build/make/configure.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/pkg/bin/bash ## ## configure.sh ## @@ -696,7 +696,7 @@ process_common_toolchain() { aarch64*) tgt_isa=arm64 ;; - armv7*-hardfloat* | armv7*-gnueabihf | arm-*-gnueabihf) + armv7*-hardfloat* | armv7*-gnueabihf | arm-*-gnueabihf | armv7*-netbsd*-*hf) tgt_isa=armv7 float_abi=hard ;; @@ -725,6 +725,9 @@ process_common_toolchain() { *mips32el*) tgt_isa=mips32 ;; + *powerpc*) + tgt_isa=powerpc + ;; esac # detect tgt_os @@ -767,7 +770,7 @@ process_common_toolchain() { [ -z "$tgt_isa" ] && tgt_isa=x86 tgt_os=win32 ;; - *linux*|*bsd*) + *linux*|*bsd*|*qnx6*) tgt_os=linux ;; *solaris2.10) @@ -813,6 +816,9 @@ process_common_toolchain() { ppc*) enable_feature ppc ;; + sparc*) + disable_feature fast_unaligned + ;; esac # PIC is probably what we want when building shared libs @@ -1449,7 +1455,7 @@ EOF check_cc </dev/null 2>&1 && enable_feature big_endian # Try to find which inline keywords are supported @@ -1466,11 +1472,33 @@ EOF # bionic includes basic pthread functionality, obviating -lpthread. ;; *) - check_header pthread.h && add_extralibs -lpthread + check_header pthread.h && add_extralibs ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} ;; esac fi + case ${tgt_os} in + darwin*) + add_extralibs -lm + ;; + solaris*) + add_extralibs -lm -lrt + ;; + linux*) + case ${gcctarget} in + *qnx6*) + add_extralibs -lm + ;; + *openbsd*) + add_extralibs -lm + ;; + *) + add_extralibs -lm -lrt + ;; + esac + ;; + esac + # only for MIPS platforms case ${toolchain} in mips*)