xref: /netbsd-src/tools/gmp/Makefile (revision 9eb62ec2d7a2301694a703ad204f98d792a01b03)
1#	$NetBSD: Makefile,v 1.6 2024/09/28 21:18:55 bad Exp $
2#
3
4GNUHOSTDIST=   ${.CURDIR}/../../external/lgpl3/gmp/dist
5
6CONFIGURE_ARGS+=--disable-shared
7
8CPPFLAGS+=	${HOST_CPPFLAGS}
9
10.include "${.CURDIR}/../Makefile.gnuhost"
11
12# GMP uses 8-byte alignment for 16-byte align-requiring things that break
13# the build on modern macOS targets, turn off assembly on x86-64 for now.
14# https://trac.macports.org/ticket/70859
15.if ${BUILD_OSTYPE} == "Darwin"
16BUILD_MACHINE!=	uname -m
17. if ${BUILD_MACHINE} == "x86_64"
18CONFIGURE_ARGS+=	--disable-assembly
19. endif
20.endif
21
22# Don't override CFLAGS and CXXFLAGS, it breaks ABI detection.
23# PATH needs special treating since "make" tries to expand $PATH
24# when variable is used.
25CONFIGURE_ENV:=	${CONFIGURE_ENV:NPATH=*:NCFLAGS=*:NCXXFLAGS=*} \
26		PATH="${TOOLDIR:Q}/bin:$$PATH"
27
28# Force avoiding possibly non-executable install-sh.
29CONFIGURE_ENV+=	ac_cv_path_mkdir="${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install -d"
30
31# mknative-gmp support
32#
33# XXX early version; does not use mknative.common yet.
34
35native-gmp: .native/.configure_done
36	@echo 'Extracting GNU GMP configury for a native toolchain.'
37	(cd ${.OBJDIR}/.native && \
38	 ${MAKE} -f ${.CURDIR}/../../external/lgpl3/gmp/Makefile.netbsd-gmp copy-files)
39	@echo 'HA HA, only joking. Manual fixes maybe needed now.'
40
41.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
42	mkdir .native 2>/dev/null || true
43	(cd ${.OBJDIR}/.native && \
44	 ${MAKE} -f ${.CURDIR}/../../external/lgpl3/gmp/Makefile.netbsd-gmp all)
45