head	1.64;
access;
symbols
	netbsd-11-0-RC4:1.59
	netbsd-11-0-RC3:1.59
	netbsd-11-0-RC2:1.59
	netbsd-11-0-RC1:1.59
	perseant-exfatfs-base-20250801:1.59
	netbsd-11:1.59.0.2
	netbsd-11-base:1.59
	netbsd-10-1-RELEASE:1.48.2.2
	perseant-exfatfs-base-20240630:1.55
	perseant-exfatfs:1.55.0.2
	perseant-exfatfs-base:1.55
	netbsd-8-3-RELEASE:1.17
	netbsd-9-4-RELEASE:1.34
	netbsd-10-0-RELEASE:1.48.2.2
	netbsd-10-0-RC6:1.48.2.2
	netbsd-10-0-RC5:1.48.2.2
	netbsd-10-0-RC4:1.48.2.2
	netbsd-10-0-RC3:1.48.2.2
	netbsd-10-0-RC2:1.48.2.2
	netbsd-10-0-RC1:1.48.2.2
	netbsd-10:1.48.0.2
	netbsd-10-base:1.48
	netbsd-9-3-RELEASE:1.34
	cjep_sun2x-base1:1.47
	cjep_sun2x:1.47.0.2
	cjep_sun2x-base:1.47
	cjep_staticlib_x-base1:1.47
	netbsd-9-2-RELEASE:1.34
	cjep_staticlib_x:1.46.0.2
	cjep_staticlib_x-base:1.46
	netbsd-9-1-RELEASE:1.34
	phil-wifi-20200421:1.44
	phil-wifi-20200411:1.44
	is-mlppp:1.43.0.2
	is-mlppp-base:1.43
	phil-wifi-20200406:1.44
	netbsd-8-2-RELEASE:1.17
	netbsd-9-0-RELEASE:1.34
	netbsd-9-0-RC2:1.34
	netbsd-9-0-RC1:1.34
	phil-wifi-20191119:1.39
	netbsd-9:1.34.0.2
	netbsd-9-base:1.34
	phil-wifi-20190609:1.32
	netbsd-8-1-RELEASE:1.17
	netbsd-8-1-RC1:1.17
	pgoyette-compat-merge-20190127:1.17
	pgoyette-compat-20190127:1.17
	pgoyette-compat-20190118:1.17
	pgoyette-compat-1226:1.17
	pgoyette-compat-1126:1.17
	pgoyette-compat-1020:1.17
	pgoyette-compat-0930:1.17
	pgoyette-compat-0906:1.17
	netbsd-7-2-RELEASE:1.6.2.5
	pgoyette-compat-0728:1.17
	netbsd-8-0-RELEASE:1.17
	phil-wifi:1.17.0.14
	phil-wifi-base:1.17
	pgoyette-compat-0625:1.17
	netbsd-8-0-RC2:1.17
	pgoyette-compat-0521:1.17
	pgoyette-compat-0502:1.17
	pgoyette-compat-0422:1.17
	netbsd-8-0-RC1:1.17
	pgoyette-compat-0415:1.17
	pgoyette-compat-0407:1.17
	pgoyette-compat-0330:1.17
	pgoyette-compat-0322:1.17
	pgoyette-compat-0315:1.17
	netbsd-7-1-2-RELEASE:1.6.2.5
	pgoyette-compat:1.17.0.12
	pgoyette-compat-base:1.17
	netbsd-7-1-1-RELEASE:1.6.2.5
	matt-nb8-mediatek:1.17.0.10
	matt-nb8-mediatek-base:1.17
	perseant-stdc-iso10646:1.17.0.8
	perseant-stdc-iso10646-base:1.17
	netbsd-8:1.17.0.6
	netbsd-8-base:1.17
	prg-localcount2-base3:1.17
	prg-localcount2-base2:1.17
	prg-localcount2-base1:1.17
	prg-localcount2:1.17.0.4
	prg-localcount2-base:1.17
	pgoyette-localcount-20170426:1.17
	bouyer-socketcan-base1:1.17
	pgoyette-localcount-20170320:1.17
	netbsd-7-1:1.6.2.5.0.2
	netbsd-7-1-RELEASE:1.6.2.5
	netbsd-7-1-RC2:1.6.2.5
	netbsd-7-nhusb-base-20170116:1.6.2.5
	bouyer-socketcan:1.17.0.2
	bouyer-socketcan-base:1.17
	pgoyette-localcount-20170107:1.17
	netbsd-7-1-RC1:1.6.2.5
	pgoyette-localcount-20161104:1.16
	netbsd-7-0-2-RELEASE:1.6.2.3
	localcount-20160914:1.15
	netbsd-7-nhusb:1.6.2.3.0.4
	netbsd-7-nhusb-base:1.6.2.3
	pgoyette-localcount-20160806:1.14
	pgoyette-localcount-20160726:1.14
	pgoyette-localcount:1.14.0.2
	pgoyette-localcount-base:1.14
	netbsd-7-0-1-RELEASE:1.6.2.3
	netbsd-7-0:1.6.2.3.0.2
	netbsd-7-0-RELEASE:1.6.2.3
	netbsd-7-0-RC3:1.6.2.3
	netbsd-7-0-RC2:1.6.2.3
	netbsd-7-0-RC1:1.6.2.3
	netbsd-7:1.6.0.2;
locks; strict;
comment	@# @;


1.64
date	2025.11.15.06.53.16;	author mrg;	state Exp;
branches;
next	1.63;
commitid	ugDdYeVA0GyUjCiG;

1.63
date	2025.11.14.19.30.22;	author mrg;	state Exp;
branches;
next	1.62;
commitid	r0MJ7omQY0jPxyiG;

1.62
date	2025.10.27.10.29.41;	author jmcneill;	state Exp;
branches;
next	1.61;
commitid	OdSODZvqFRwO7cgG;

1.61
date	2025.09.25.05.11.25;	author mrg;	state Exp;
branches;
next	1.60;
commitid	APGpZCPk4a4fp3cG;

1.60
date	2025.09.24.01.25.00;	author mrg;	state Exp;
branches;
next	1.59;
commitid	RZxfPfOZOxrqbUbG;

1.59
date	2025.04.13.08.30.22;	author rin;	state Exp;
branches;
next	1.58;
commitid	WbI9bLE48vrjORQF;

1.58
date	2025.04.13.08.29.42;	author rin;	state Exp;
branches;
next	1.57;
commitid	sapy6qkc1pJVNRQF;

1.57
date	2024.09.30.02.55.44;	author kalvisd;	state Exp;
branches;
next	1.56;
commitid	3LnsfCHespZCdMrF;

1.56
date	2024.08.17.11.34.46;	author rin;	state Exp;
branches;
next	1.55;
commitid	uis725twABqOuamF;

1.55
date	2024.05.01.21.34.48;	author christos;	state Exp;
branches
	1.55.2.1;
next	1.54;
commitid	ysqF3hLBJSI0jl8F;

1.54
date	2024.04.26.16.34.17;	author rillig;	state Exp;
branches;
next	1.53;
commitid	Ynu8ubEV5qlVNF7F;

1.53
date	2023.11.25.20.00.25;	author rjs;	state Exp;
branches;
next	1.52;
commitid	r72GZawntsWXQ1OE;

1.52
date	2023.11.22.17.48.35;	author rjs;	state Exp;
branches;
next	1.51;
commitid	x9BrqGtxElCbeDNE;

1.51
date	2023.10.07.12.15.52;	author rin;	state Exp;
branches;
next	1.50;
commitid	vmlIp8dcEoVdRGHE;

1.50
date	2023.07.16.22.20.54;	author rjs;	state Exp;
branches;
next	1.49;
commitid	LwwVfBPl8CeDS4xE;

1.49
date	2023.02.07.06.19.03;	author mrg;	state Exp;
branches;
next	1.48;
commitid	oPvkEcoSH8vCFycE;

1.48
date	2021.07.11.20.52.06;	author mrg;	state Exp;
branches
	1.48.2.1;
next	1.47;
commitid	imHWyN1cvxi41C0D;

1.47
date	2021.05.30.01.57.00;	author joerg;	state Exp;
branches;
next	1.46;
commitid	3Zpdqzdbkf2q47VC;

1.46
date	2021.04.13.04.59.00;	author mrg;	state Exp;
branches
	1.46.2.1;
next	1.45;
commitid	GPm3Uyz2p2ylB5PC;

1.45
date	2021.02.23.15.16.43;	author joerg;	state Exp;
branches;
next	1.44;
commitid	IgeMLlQa9F64BQIC;

1.44
date	2020.04.04.03.04.58;	author christos;	state Exp;
branches;
next	1.43;
commitid	5SEqSfMqa9dGZ03C;

1.43
date	2020.01.31.21.13.40;	author jmcneill;	state Exp;
branches;
next	1.42;
commitid	ZPJiK2qmQ4PO4TUB;

1.42
date	2020.01.31.20.56.03;	author jmcneill;	state Exp;
branches;
next	1.41;
commitid	r8sPkx3KpTbKYSUB;

1.41
date	2020.01.19.00.58.14;	author jmcneill;	state Exp;
branches;
next	1.40;
commitid	rnaLnZIKTqeHJeTB;

1.40
date	2019.11.20.06.23.31;	author martin;	state Exp;
branches;
next	1.39;
commitid	dHRsOqFUpsgGsyLB;

1.39
date	2019.11.19.08.59.18;	author martin;	state Exp;
branches;
next	1.38;
commitid	PkYOK0CNEcjfmrLB;

1.38
date	2019.11.18.22.26.15;	author joerg;	state Exp;
branches;
next	1.37;
commitid	BYbsGWoDG4xYQnLB;

1.37
date	2019.11.11.22.45.26;	author joerg;	state Exp;
branches;
next	1.36;
commitid	IMynySmLyNzibuKB;

1.36
date	2019.10.28.18.38.54;	author christos;	state Exp;
branches;
next	1.35;
commitid	3WEAjAkDZdPYgFIB;

1.35
date	2019.09.24.19.29.41;	author maya;	state Exp;
branches;
next	1.34;
commitid	rMw7xnt9djCGDiEB;

1.34
date	2019.07.07.17.50.34;	author mrg;	state Exp;
branches;
next	1.33;
commitid	rLPasMl3r7SpD8uB;

1.33
date	2019.06.19.05.17.05;	author mrg;	state Exp;
branches;
next	1.32;
commitid	V8gEXF2npqhg2LrB;

1.32
date	2019.06.09.01.56.49;	author mrg;	state Exp;
branches;
next	1.31;
commitid	RoAPjIRLREXLfsqB;

1.31
date	2019.06.07.12.11.43;	author mrg;	state Exp;
branches;
next	1.30;
commitid	obAYbHz6bIc7JfqB;

1.30
date	2019.06.07.06.00.05;	author mrg;	state Exp;
branches;
next	1.29;
commitid	ACLGcarl0oLVsdqB;

1.29
date	2019.06.02.11.35.55;	author mrg;	state Exp;
branches;
next	1.28;
commitid	8RXb1hd5qbBOgBpB;

1.28
date	2019.05.30.23.15.46;	author maya;	state Exp;
branches;
next	1.27;
commitid	DryoWLZ1Ky2DEhpB;

1.27
date	2019.05.16.01.22.35;	author christos;	state Exp;
branches;
next	1.26;
commitid	shGFaxU6EdsgQmnB;

1.26
date	2019.05.11.17.44.16;	author christos;	state Exp;
branches;
next	1.25;
commitid	AthQ1JKfAr04rOmB;

1.25
date	2019.04.16.17.29.09;	author christos;	state Exp;
branches;
next	1.24;
commitid	98kHG9PVX3jt9BjB;

1.24
date	2019.04.12.17.43.25;	author christos;	state Exp;
branches;
next	1.23;
commitid	tOrf8mynlfezm5jB;

1.23
date	2019.04.10.20.32.56;	author joerg;	state Exp;
branches;
next	1.22;
commitid	pbHhGmA1VnmwmQiB;

1.22
date	2019.04.07.17.31.32;	author christos;	state Exp;
branches;
next	1.21;
commitid	l5BURANcnI7rsriB;

1.21
date	2019.04.07.05.28.09;	author rin;	state Exp;
branches;
next	1.20;
commitid	40v9xnVBPIpgsniB;

1.20
date	2019.04.03.15.26.34;	author joerg;	state Exp;
branches;
next	1.19;
commitid	sRIz4RuG9B2vTUhB;

1.19
date	2019.03.10.10.51.58;	author mrg;	state Exp;
branches;
next	1.18;
commitid	gGHPV4SpzxwU8OeB;

1.18
date	2019.03.10.02.29.52;	author mrg;	state Exp;
branches;
next	1.17;
commitid	v9cy21Je6lIUmLeB;

1.17
date	2016.11.29.23.17.22;	author dholland;	state Exp;
branches
	1.17.14.1;
next	1.16;
commitid	08NjIdefGSmNY4wz;

1.16
date	2016.09.27.19.18.42;	author joerg;	state Exp;
branches;
next	1.15;
commitid	WJUMHLGJ6DyCGXnz;

1.15
date	2016.08.16.21.05.14;	author mrg;	state Exp;
branches;
next	1.14;
commitid	F1IwR47f63gzCziz;

1.14
date	2016.02.28.22.55.21;	author joerg;	state Exp;
branches
	1.14.2.1;
next	1.13;
commitid	XRPmRDfCeuTkHJWy;

1.13
date	2016.02.26.18.29.55;	author riastradh;	state Exp;
branches;
next	1.12;
commitid	0ulRfy9R9RupisWy;

1.12
date	2015.11.03.10.43.31;	author szptvlfn;	state Exp;
branches;
next	1.11;
commitid	dpMSWa3XgVywpDHy;

1.11
date	2015.10.31.20.13.45;	author mrg;	state Exp;
branches;
next	1.10;
commitid	BjuFq95legObFiHy;

1.10
date	2015.10.29.10.10.09;	author jmcneill;	state Exp;
branches;
next	1.9;
commitid	H8uUlwFnd3K9oZGy;

1.9
date	2015.10.29.08.09.55;	author mrg;	state Exp;
branches;
next	1.8;
commitid	kfuyTOBFkEhIIYGy;

1.8
date	2015.10.26.07.15.36;	author mrg;	state Exp;
branches;
next	1.7;
commitid	x2seNmO7LWz5wAGy;

1.7
date	2015.09.23.05.28.14;	author mrg;	state Exp;
branches;
next	1.6;
commitid	NKfCe2dT5Hf9ZkCy;

1.6
date	2015.01.05.20.06.06;	author joerg;	state Exp;
branches
	1.6.2.1;
next	1.5;
commitid	H0ZYDpcHKKgteS4y;

1.5
date	2015.01.05.18.51.10;	author gson;	state Exp;
branches;
next	1.4;
commitid	GDIcEzTJj6ZrNR4y;

1.4
date	2015.01.05.01.34.42;	author joerg;	state Exp;
branches;
next	1.3;
commitid	iVCOzN0UxSx35M4y;

1.3
date	2015.01.04.01.26.31;	author christos;	state Exp;
branches;
next	1.2;
commitid	okS0EXQuxJLi4E4y;

1.2
date	2014.12.23.17.49.59;	author christos;	state Exp;
branches;
next	1.1;
commitid	1TwWpkEFRS7BTb3y;

1.1
date	2014.12.18.06.24.30;	author mrg;	state Exp;
branches;
next	;
commitid	piX5MfsAjDSmgu2y;

1.55.2.1
date	2025.08.02.05.50.41;	author perseant;	state Exp;
branches;
next	;
commitid	23j6GFaDws3O875G;

1.48.2.1
date	2023.02.14.15.47.01;	author martin;	state Exp;
branches;
next	1.48.2.2;
commitid	kz8yxOyK2RtDAvdE;

1.48.2.2
date	2023.10.08.14.35.21;	author martin;	state Exp;
branches;
next	;
commitid	u2OxnQINGCBFBPHE;

1.46.2.1
date	2021.05.31.22.15.03;	author cjep;	state Exp;
branches;
next	;
commitid	eWz9SBW0XqKjJlVC;

1.17.14.1
date	2019.06.10.22.02.38;	author christos;	state Exp;
branches;
next	1.17.14.2;
commitid	jtc8rnCzWiEEHGqB;

1.17.14.2
date	2020.04.13.08.02.31;	author martin;	state Exp;
branches;
next	;
commitid	X01YhRUPVUDaec4C;

1.14.2.1
date	2016.11.04.14.48.48;	author pgoyette;	state Exp;
branches;
next	1.14.2.2;
commitid	2m1JRwYmpwPkOOsz;

1.14.2.2
date	2017.01.07.08.55.59;	author pgoyette;	state Exp;
branches;
next	;
commitid	uEL0C1YuiJrlV0Bz;

1.6.2.1
date	2015.01.05.20.06.06;	author martin;	state dead;
branches;
next	1.6.2.2;
commitid	P7SGAjfX1jg9FS4y;

1.6.2.2
date	2015.01.05.21.23.51;	author martin;	state Exp;
branches;
next	1.6.2.3;
commitid	P7SGAjfX1jg9FS4y;

1.6.2.3
date	2015.01.06.11.00.40;	author martin;	state Exp;
branches
	1.6.2.3.4.1;
next	1.6.2.4;
commitid	OjmSfUfS05HnbX4y;

1.6.2.4
date	2016.12.12.09.32.35;	author msaitoh;	state Exp;
branches;
next	1.6.2.5;
commitid	pJReD1IA4pv00Gxz;

1.6.2.5
date	2016.12.14.10.50.52;	author martin;	state Exp;
branches;
next	;
commitid	EJbR639k3lJvmWxz;

1.6.2.3.4.1
date	2017.01.18.08.46.21;	author skrll;	state Exp;
branches;
next	;
commitid	M6f3RyDtiAR3wqCz;


desc
@@


1.64
log
@fix some m68k warnings

for xterm's charset.c, use -fno-jump-tables to avoid warnings.
for gallium, the format_utils.c and glsl_lexer.cpp parts for GCC 14 are
also needed here (-Os / -O1 -fno-jump-tables).  (glsl_parser.cpp does
not need -Os like GCC 14 does.)

tested with both GCC 12 and 14.
@
text
@# $NetBSD: Makefile,v 1.63 2025/11/14 19:30:22 mrg Exp $

# Link the gallium mega driver.

LIBISMODULE=	yes
LIBISCXX=     yes

NOLINT=		# Lots of "Unsupported platform" due to undefined __GNUC__

.include <bsd.own.mk>

.include "../mesa-which.mk"

SHLIB_MAJOR=    0

LIB=		gallium_dri
DRIDIR=		${X11USRLIBDIR}/modules/dri
DRIDEBUGDIR=	${DEBUGDIR}${X11USRLIBDIR}/modules/dri

LLVM_INCLUDE_OBJDIR!=	cd ${NETBSDSRCDIR}/external/apache2/llvm/include && ${PRINTOBJDIR}

CWARNFLAGS.clang += -Wno-atomic-alignment -Wno-unknown-warning-option -Wno-implicit-int-float-conversion -Wno-c99-designator

CXXFLAGS+=	-std=c++14
CFLAGS+=	-std=gnu11
CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/libdrm \
		-I${NETBSDSRCDIR}/external/apache2/llvm/dist/llvm/include \
		-I${LLVM_INCLUDE_OBJDIR} -I${NETBSDSRCDIR}/external/apache2/llvm/config

CFLAGS+=	-pthread
LDFLAGS+=	-pthread

LDFLAGS+=	-Wl,--build-id=sha1

# Reduce debugging for these extremely large objects.
.if ${MKDEBUG:Uno} != "no"
#CXXFLAGS+=	-g1
#CFLAGS+=	-g1
.endif

GALLIUM_SUBDIRS= \
	auxiliary \
	auxiliary/cso_cache \
	auxiliary/draw \
	auxiliary/driver_ddebug \
	auxiliary/driver_noop \
	auxiliary/driver_rbug \
	auxiliary/driver_trace \
	auxiliary/hud \
	auxiliary/indices \
	auxiliary/nir \
	auxiliary/os \
	auxiliary/pipebuffer \
	auxiliary/pipe-loader \
	auxiliary/postprocess \
	auxiliary/rbug \
	auxiliary/renderonly \
	auxiliary/rtasm \
	auxiliary/tessellator \
	auxiliary/tgsi \
	auxiliary/translate \
	auxiliary/util \
	auxiliary/vl \
	drivers/noop \
	drivers/rbug \
	drivers/softpipe \
	winsys/sw/dri \
	winsys/sw/kms-dri \
	winsys/sw/null \
	winsys/sw/wrapper \
	frontends/dri

GALLIUM_SUBDIRS_VDPAU=	\
	frontends/vdpau

GALLIUM_SUBDIRS_LLVMPIPE= \
	auxiliary/gallivm \
	drivers/llvmpipe

GALLIUM_SUBDIRS_ATI= \
	drivers/radeon \
	drivers/radeonsi \
	drivers/r300 \
	drivers/r300/compiler \
	drivers/r600 \
	drivers/r600/sb \
	drivers/r600/sfn \
	winsys/radeon/drm \
	winsys/amdgpu/drm

GALLIUM_SUBDIRS_I915= \
	drivers/i915 \
	winsys/i915/drm

GALLIUM_SUBDIRS_IRIS= \
	drivers/iris \
	winsys/iris/drm

GALLIUM_SUBDIRS_CROCUS= \
	drivers/crocus \
	winsys/crocus/drm

GALLIUM_SUBDIRS_NOUVEAU= \
	drivers/nouveau \
	drivers/nouveau/nv30 \
	drivers/nouveau/nv50 \
	drivers/nouveau/codegen \
	drivers/nouveau/nvc0 \
	winsys/nouveau/drm

BUILD_RADEON=0
BUILD_NOUVEAU=0
BUILD_VDPAU=0
BUILD_LLVMPIPE=0
BUILD_I915=0
BUILD_IRIS=0
BUILD_CROCUS=0
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
BUILD_I915=1
#BUILD_IRIS=1
#BUILD_CROCUS=1
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE} == "evbarm"
BUILD_NOUVEAU=1
. if ${MKLLVMRT} != "no"
BUILD_RADEON=1
. endif
BUILD_VDPAU=1
.endif

.if ${MACHINE_ARCH} == "i386" || \
    ${MACHINE_ARCH} == "x86_64" || \
    ${MACHINE_ARCH} == "powerpc" || \
    ${MACHINE_ARCH} == "powerpc64" || \
    !empty(MACHINE_ARCH:Maarch64*) || \
    !empty(MACHINE_ARCH:Mmips*) || \
    !empty(MACHINE_ARCH:Mearm*) || \
    !empty(MACHINE_ARCH:Marm*)
. if ${MKLLVMRT} != "no"
BUILD_LLVMPIPE=1
. endif
.endif

DRIVERS=		kms_swrast swrast
.if ${BUILD_RADEON} == 1
DRIVERS+=		r600 r300 radeonsi
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_ATI}
.endif
.if ${BUILD_NOUVEAU} == 1
DRIVERS+=		nouveau
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_NOUVEAU}
.endif
.if ${BUILD_VDPAU} == 1
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_VDPAU}
.endif
.if ${BUILD_I915} == 1
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_I915}
.endif
.if ${BUILD_IRIS} == 1
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_IRIS}
.endif
.if ${BUILD_CROCUS} == 1
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_CROCUS}
.endif
.if ${BUILD_LLVMPIPE} == 1
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_LLVMPIPE}
.endif

GALLIUM_SOURCES.auxiliary/cso_cache= \
	cso_cache.c \
	cso_context.c \
	cso_hash.c

GALLIUM_SOURCES.auxiliary/draw= \
	draw_context.c \
	draw_fs.c \
	draw_gs.c \
	draw_pipe_aaline.c \
	draw_pipe_aapoint.c \
	draw_pipe.c \
	draw_pipe_clip.c \
	draw_pipe_cull.c \
	draw_pipe_flatshade.c \
	draw_pipe_offset.c \
	draw_pipe_pstipple.c \
	draw_pipe_stipple.c \
	draw_pipe_twoside.c \
	draw_pipe_unfilled.c \
	draw_pipe_user_cull.c \
	draw_pipe_util.c \
	draw_pipe_validate.c \
	draw_pipe_vbuf.c \
	draw_pipe_wide_line.c \
	draw_pipe_wide_point.c \
	draw_prim_assembler.c \
	draw_pt.c \
	draw_pt_emit.c \
	draw_pt_fetch.c \
	draw_pt_fetch_shade_emit.c \
	draw_pt_fetch_shade_pipeline.c \
	draw_pt_post_vs.c \
	draw_pt_so_emit.c \
	draw_pt_util.c \
	draw_pt_vsplit.c \
	draw_tess.c \
	draw_vertex.c \
	draw_vs.c \
	draw_vs_exec.c \
	draw_vs_variant.c

.if ${MKLLVMRT} != "no"
GALLIUM_SOURCES.auxiliary/draw+= \
	draw_llvm.c \
	draw_llvm_sample.c \
	draw_pt_fetch_shade_pipeline_llvm.c \
	draw_vs_llvm.c
.endif

GALLIUM_SOURCES.auxiliary/hud= \
	font.c \
	hud_context.c \
	hud_cpu.c \
	hud_nic.c \
	hud_cpufreq.c \
	hud_diskstat.c \
	hud_sensors_temp.c \
	hud_fps.c \
	hud_driver_query.c
GALLIUM_SOURCES.auxiliary/indices= \
	u_primconvert.c
GALLIUM_SOURCES.auxiliary/os= \
	os_process.c
GALLIUM_SOURCES.auxiliary/pipe-loader= \
	pipe_loader.c \
	pipe_loader_drm.c \
	pipe_loader_sw.c

.for _f in ${GALLIUM_SOURCES.auxiliary/pipe-loader}
CPPFLAGS.${_f} +=	-DHAVE_PIPE_LOADER_KMS=1 \
			-DHAVE_PIPE_LOADER_DRI=1 \
			-DGALLIUM_STATIC_TARGETS=1 \
			-I${X11SRCDIR.Mesa}/src/gallium/winsys \
			-I${X11SRCDIR.Mesa}/src/loader \
			-I${X11SRCDIR.Mesa}/../src/util
.endfor

GALLIUM_SOURCES.auxiliary/pipebuffer= \
	pb_buffer_fenced.c \
	pb_bufmgr_cache.c \
	pb_bufmgr_debug.c \
	pb_bufmgr_mm.c \
	pb_bufmgr_slab.c \
	pb_cache.c \
	pb_slab.c \
	pb_validate.c
GALLIUM_SOURCES.auxiliary/postprocess= \
	pp_celshade.c \
	pp_colors.c \
	pp_init.c \
	pp_mlaa.c \
	pp_run.c \
	pp_program.c
GALLIUM_SOURCES.auxiliary/rbug= \
	rbug_connection.c \
	RBUGrbug_context.c \
	RBUGrbug_core.c \
	rbug_demarshal.c \
	rbug_texture.c \
	rbug_shader.c
GALLIUM_SOURCES.auxiliary/rtasm= \
	rtasm_cpu.c \
	rtasm_execmem.c \
	rtasm_x86sse.c
GALLIUM_SOURCES.auxiliary/tessellator= \
	p_tessellator.cpp \
	tessellator.cpp
GALLIUM_SOURCES.auxiliary/tgsi= \
	tgsi_aa_point.c \
	tgsi_build.c \
	tgsi_dump.c \
	tgsi_exec.c \
	tgsi_emulate.c \
	tgsi_from_mesa.c \
	tgsi_info.c \
	tgsi_iterate.c \
	tgsi_lowering.c \
	tgsi_parse.c \
	tgsi_point_sprite.c \
	tgsi_sanity.c \
	tgsi_scan.c \
	tgsi_strings.c \
	tgsi_text.c \
	tgsi_transform.c \
	tgsi_two_side.c \
	tgsi_ureg.c \
	tgsi_util.c
GALLIUM_SOURCES.auxiliary/translate= \
	translate.c \
	translate_cache.c \
	translate_generic.c \
	translate_sse.c
GALLIUM_SOURCES.auxiliary/util= \
	u_async_debug.c \
	u_bitmask.c \
	u_blitter.c \
	u_cache.c \
	u_compute.c \
	u_debug_flush.c \
	u_debug_image.c \
	u_dl.c \
	u_draw.c \
	u_draw_quad.c \
	u_driconf.c \
	u_dump_defines.c \
	u_dump_state.c \
	u_framebuffer.c \
	u_gen_mipmap.c \
	u_handle_table.c \
	u_helpers.c \
	u_index_modify.c \
	u_linear.c \
	u_live_shader_cache.c \
	u_log.c \
	u_network.c \
	u_prim.c \
	u_prim_restart.c \
	u_pstipple.c \
	u_resource.c \
	u_sampler.c \
	u_screen.c \
	u_simple_shaders.c \
	u_split_draw.c \
	u_suballoc.c \
	u_surface.c \
	u_tests.c \
	u_texture.c \
	u_tile.c \
	u_trace_gallium.c \
	u_transfer.c \
	u_transfer_helper.c \
	u_threaded_context.c \
	u_upload_mgr.c \
	u_vbuf.c \
	u_vertex_state_cache.c
GALLIUM_SOURCES.auxiliary/nir = \
	nir_draw_helpers.c \
	nir_to_tgsi.c \
	tgsi_to_nir.c

.if ${MKLLVMRT} != "no"
GALLIUM_SOURCES.auxiliary/nir+=	nir_to_tgsi_info.c
.endif

GALLIUM_SOURCES.auxiliary/vl= \
	vl_bicubic_filter.c \
	vl_compositor.c \
	vl_compositor_cs.c \
	vl_compositor_gfx.c \
	vl_csc.c \
	vl_decoder.c \
	vl_deint_filter.c \
	vl_idct.c \
	vl_matrix_filter.c \
	vl_mc.c \
	vl_median_filter.c \
	vl_mpeg12_bitstream.c \
	vl_mpeg12_decoder.c \
	vl_vertex_buffers.c \
	vl_video_buffer.c \
	vl_winsys_dri.c \
	vl_zscan.c

# Generated
.PATH: ${X11SRCDIR.Mesa}/../src/gallium/auxiliary
GALLIUM_SOURCES.auxiliary= \
	u_indices_gen.c \
	u_tracepoints.c \
	u_unfilled_gen.c
.for _f in ${GALLIUM_SOURCES.auxiliary/vl}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/loader
.endfor
.for _f in ${GALLIUM_SOURCES.auxiliary/util}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/../src/gallium/auxiliary
.endfor
.for _f in ${GALLIUM_SOURCES.auxiliary}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary/util
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/util
.endfor

GALLIUM_SOURCES.auxiliary/renderonly= \
	renderonly.c

.if ${MKLLVMRT} != "no"
GALLIUM_SOURCES.auxiliary/gallivm= \
	lp_bld_arit.c \
	lp_bld_arit_overflow.c \
	lp_bld_assert.c \
	lp_bld_bitarit.c \
	lp_bld_const.c \
	lp_bld_conv.c \
	lp_bld_coro.c \
	lp_bld_flow.c \
	lp_bld_format_aos_array.c \
	lp_bld_format_aos.c \
	lp_bld_format_float.c \
	lp_bld_format.c \
	lp_bld_format_soa.c \
	lp_bld_format_s3tc.c \
	lp_bld_format_srgb.c \
	lp_bld_format_yuv.c \
	lp_bld_gather.c \
	lp_bld_init.c \
	lp_bld_intr.c \
	lp_bld_ir_common.c \
	lp_bld_logic.c \
	lp_bld_misc.cpp \
	lp_bld_nir.c \
	lp_bld_nir_soa.c \
	lp_bld_pack.c \
	lp_bld_printf.c \
	lp_bld_quad.c \
	lp_bld_sample_aos.c \
	lp_bld_sample.c \
	lp_bld_sample_soa.c \
	lp_bld_struct.c \
	lp_bld_swizzle.c \
	lp_bld_tgsi_action.c \
	lp_bld_tgsi_aos.c \
	lp_bld_tgsi.c \
	lp_bld_tgsi_info.c \
	lp_bld_tgsi_soa.c \
	lp_bld_type.c \
	lp_bld_debug.cpp
.endif

.for _f in ${GALLIUM_SOURCES.auxiliary/gallivm}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary/util
.endfor

CPPFLAGS.lp_texture.c += -I${X11SRCDIR.Mesa}/../src

GALLIUM_SOURCES.auxiliary/driver_ddebug = \
        dd_context.c \
	dd_draw.c \
	dd_screen.c

GALLIUM_SOURCES.auxiliary/driver_noop = \
        noop_pipe.c \
        noop_state.c

GALLIUM_SOURCES.auxiliary/driver_trace = \
        tr_context.c \
        tr_dump.c \
        tr_dump_state.c \
        tr_screen.c \
        tr_texture.c

GALLIUM_SOURCES.auxiliary/driver_rbug = \
        DRIVERrbug_core.c \
        DRIVERrbug_context.c \
        rbug_objects.c \
        rbug_screen.c
# Conflicts with auxiliary/rbug/ files
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/auxiliary/rbug/rbug_core.c		RBUGrbug_core.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/auxiliary/rbug/rbug_context.c		RBUGrbug_context.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug/rbug_core.c	DRIVERrbug_core.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug/rbug_context.c	DRIVERrbug_context.c
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.Mesa}/src/gallium/drivers
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.Mesa}/src/gallium/drivers

GALLIUM_SOURCES.drivers/i915= \
	i915_blit.c \
	i915_clear.c \
	i915_context.c \
	i915_debug.c \
	i915_debug_fp.c \
	i915_flush.c \
	i915_fpc_emit.c \
	i915_fpc_optimize.c \
	i915_fpc_translate.c \
	i915_nir.c \
	i915_prim_emit.c \
	i915_prim_vbuf.c \
	i915_query.c \
	i915_resource_buffer.c \
	i915_resource.c \
	i915_resource_texture.c \
	i915_screen.c \
	i915_state.c \
	i915_state_derived.c \
	i915_state_dynamic.c \
	i915_state_emit.c \
	i915_state_fpc.c \
	i915_state_immediate.c \
	i915_state_sampler.c \
	i915_state_static.c \
	i915_surface.c

GALLIUM_SOURCES.winsys/i915/drm= \
	i915_drm_batchbuffer.c \
	i915_drm_buffer.c \
	i915_drm_fence.c \
	i915_drm_winsys.c

GALLIUM_SOURCES.drivers/iris= \
	iris_batch.c \
	iris_binder.c \
	iris_blit.c \
	iris_border_color.c \
	iris_bufmgr.c \
	iris_clear.c \
	iris_context.c \
	iris_disk_cache.c \
	iris_draw.c \
	iris_fence.c \
	iris_fine_fence.c \
	iris_formats.c \
	iris_measure.c \
	iris_monitor.c \
	iris_perf.c \
	iris_performance_query.c \
	iris_pipe_control.c \
	iris_program.c \
	iris_program_cache.c \
	iris_resolve.c \
	iris_resource.c \
	iris_screen.c

GALLIUM_SOURCES.winsys/iris/drm= \
	iris_drm_winsys.c

IRIS_GENS_BLORP=	80 90 110 120 125

.for _gen in ${IRIS_GENS_BLORP}
BUILDSYMLINKS+=		${X11SRCDIR.Mesa}/src/gallium/drivers/iris/iris_blorp.c ${_gen}_iris_blorp.c
BUILDSYMLINKS+=		${X11SRCDIR.Mesa}/src/gallium/drivers/iris/iris_query.c ${_gen}_iris_query.c
BUILDSYMLINKS+=		${X11SRCDIR.Mesa}/src/gallium/drivers/iris/iris_state.c ${_gen}_iris_state.c
GALLIIUM_SOURCES.drivers/iris+=	${_gen}_iris_blorp.c ${_gen}_iris_query.c ${_gen}_iris_state.c

CPPFLAGS.${_gen}_iris_blorp.c+=		-DGFX_VERx10=${_gen}
CPPFLAGS.${_gen}_iris_query.c+=		-DGFX_VERx10=${_gen}
CPPFLAGS.${_gen}_iris_state.c+=		-DGFX_VERx10=${_gen}
.endfor

.for _f in ${GALLIUM_SOURCES.drivers/iris}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/intel
.endfor

GALLIUM_SOURCES.drivers/crocus= \
	crocus_batch.c \
	crocus_blit.c \
	crocus_blorp.c \
	crocus_blt.c \
	crocus_bufmgr.c \
	crocus_clear.c \
	crocus_context.c \
	crocus_disk_cache.c \
	crocus_draw.c \
	crocus_fence.c \
	crocus_fine_fence.c \
	crocus_formats.c \
	crocus_monitor.c \
	crocus_pipe_control.c \
	crocus_program.c \
	crocus_program_cache.c \
	crocus_query.c \
	crocus_resolve.c \
	crocus_resource.c \
	crocus_screen.c \
	crocus_state.c

GALLIUM_SOURCES.winsys/crocus/drm= \
	crocus_drm_winsys.c

CROCUS_GENS_BLORP=	40 45 50 60 70 75 80

.for _gen in ${CROCUS_GENS_BLORP}
BUILDSYMLINKS+=		${X11SRCDIR.Mesa}/src/gallium/drivers/crocus/crocus_blorp.c ${_gen}_crocus_blorp.c
BUILDSYMLINKS+=		${X11SRCDIR.Mesa}/src/gallium/drivers/crocus/crocus_query.c ${_gen}_crocus_query.c
BUILDSYMLINKS+=		${X11SRCDIR.Mesa}/src/gallium/drivers/crocus/crocus_state.c ${_gen}_crocus_state.c
BUILDSYMLINKS+=		${X11SRCDIR.Mesa}/src/gallium/drivers/crocus/crocus_blt.c ${_gen}_crocus_bltec
GALLIIUM_SOURCES.drivers/iris+=	${_gen}_crocus_blorp.c ${_gen}_crocus_query.c ${_gen}_crocus_state.c ${_gen}_crocus_blt.c 

CPPFLAGS.${_gen}_crocus_blorp.c+=	-DGFX_VERx10=${_gen}
CPPFLAGS.${_gen}_crocus_query.c+=	-DGFX_VERx10=${_gen}
CPPFLAGS.${_gen}_crocus_state.c+=	-DGFX_VERx10=${_gen}
CPPFLAGS.${_gen}_crocus_blt.c+=		-DGFX_VERx10=${_gen}
.endfor

.for _f in ${GALLIUM_SOURCES.drivers/crocus}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/intel
.endfor

# Conflicts with r600/radeon_video.c and radeon/radeon_video.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_video.c r600_radeon_video.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_video.c radeon_radeon_video.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_vce.c r600_radeon_vce.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_vce.c radeon_radeon_vce.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_uvd.c r600_radeon_uvd.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_uvd.c radeon_radeon_uvd.c

GALLIUM_SOURCES.drivers/radeon = \
        cayman_msaa.c \
        r600_buffer_common.c \
        r600_pipe_common.c \
        r600_query.c \
        r600_streamout.c \
        r600_texture.c \
        radeon_radeon_uvd.c \
	radeon_uvd_enc.c \
	radeon_uvd_enc_1_1.c \
        radeon_vce_40_2_2.c \
	radeon_vce_50.c \
	radeon_vce_52.c \
	radeon_vcn_dec.c \
	radeon_vcn_dec_jpeg.c \
	radeon_vcn_enc.c \
	radeon_vcn_enc_1_2.c \
	radeon_vcn_enc_2_0.c \
	radeon_vcn_enc_3_0.c \
        radeon_radeon_vce.c \
        radeon_radeon_video.c \

GALLIUM_SOURCES.drivers/r600 = \
	eg_debug.c \
	r600_gpu_load.c \
	r600_perfcounter.c \
	r600_radeon_vce.c \
	r600_radeon_video.c \
        compute_memory_pool.c \
	r600_viewport.c \
        eg_asm.c \
        evergreen_compute.c \
        evergreen_hw_context.c \
        evergreen_state.c \
        r600_asm.c \
        r600_blit.c \
	r600_dump.c \
        r600_hw_context.c \
        r600_isa.c \
        r600_pipe.c \
        r600_shader.c \
        r600_state.c \
        r600_state_common.c \
        r600_uvd.c \
        r600_radeon_uvd.c \
	r600_test_dma.c \
        r700_asm.c
GALLIUM_SOURCES.drivers/r600/sb = \
        sb_bc_builder.cpp \
        sb_bc_decoder.cpp \
        sb_bc_dump.cpp \
        sb_bc_finalize.cpp \
        sb_bc_parser.cpp \
        sb_context.cpp \
        sb_core.cpp \
        sb_dce_cleanup.cpp \
        sb_def_use.cpp \
        sb_dump.cpp \
        sb_expr.cpp \
        sb_gcm.cpp \
        sb_gvn.cpp \
        sb_if_conversion.cpp \
        sb_ir.cpp \
        sb_liveness.cpp \
        sb_pass.cpp \
        sb_peephole.cpp \
        sb_psi_ops.cpp \
        sb_ra_checker.cpp \
        sb_ra_coalesce.cpp \
        sb_ra_init.cpp \
        sb_sched.cpp \
        sb_shader.cpp \
        sb_ssa_builder.cpp \
        sb_valtable.cpp
GALLIUM_SOURCES.drivers/r600/sfn = \
	sfn_nir_vectorize_vs_inputs.c \
	sfn_alu_defines.cpp \
	sfn_liverange.cpp \
	sfn_callstack.cpp \
	sfn_nir.cpp \
	sfn_conditionaljumptracker.cpp \
	sfn_nir_legalize_image_load_store.cpp \
	sfn_debug.cpp \
	sfn_nir_lower_64bit.cpp \
	sfn_emitaluinstruction.cpp \
	sfn_nir_lower_alu.cpp \
	sfn_emitinstruction.cpp \
	sfn_nir_lower_fs_out_to_vector.cpp \
	sfn_emitssboinstruction.cpp \
	sfn_nir_lower_tess_io.cpp \
	sfn_emittexinstruction.cpp \
	sfn_instruction_alu.cpp \
	sfn_shader_base.cpp \
	sfn_instruction_base.cpp \
	sfn_shader_compute.cpp \
	sfn_instruction_block.cpp \
	sfn_shader_fragment.cpp \
	sfn_instruction_cf.cpp \
	sfn_shader_geometry.cpp \
	sfn_instruction_export.cpp \
	sfn_shader_tcs.cpp \
	sfn_instruction_fetch.cpp \
	sfn_shader_tess_eval.cpp \
	sfn_instruction_gds.cpp \
	sfn_shader_vertex.cpp \
	sfn_instruction_lds.cpp \
	sfn_shaderio.cpp \
	sfn_instruction_misc.cpp \
	sfn_value.cpp \
	sfn_instruction_tex.cpp \
	sfn_value_gpr.cpp \
	sfn_instructionvisitor.cpp \
	sfn_valuepool.cpp \
	sfn_ir_to_assembly.cpp \
	sfn_vertexstageexport.cpp

GALLIUM_SOURCES.drivers/r300 = \
	r300_blit.c \
	r300_chipset.c \
	r300_context.c \
	r300_debug.c \
	r300_emit.c \
	r300_flush.c \
	r300_fs.c \
	r300_hyperz.c \
	r300_query.c \
	r300_render.c \
	r300_render_stencilref.c \
	r300_render_translate.c \
	r300_resource.c \
	r300_screen_buffer.c \
	r300_screen.c \
	r300_state.c \
	r300_state_derived.c \
	r300_texture.c \
	r300_texture_desc.c \
	r300_tgsi_to_rc.c \
	r300_transfer.c \
	r300_vs.c \
	r300_vs_draw.c

CPPFLAGS.r300_state_derived.c = ${CC_WNO_STRINGOP_OVERREAD}

GALLIUM_SOURCES.drivers/r300/compiler = \
	memory_pool.c \
	r300_fragprog.c \
	r300_fragprog_emit.c \
	r300_fragprog_swizzle.c \
	r3xx_fragprog.c \
	r3xx_vertprog.c \
	r3xx_vertprog_dump.c \
	r500_fragprog.c \
	r500_fragprog_emit.c \
	radeon_code.c \
	radeon_compiler.c \
	radeon_compiler_util.c \
	radeon_dataflow.c \
	radeon_dataflow_deadcode.c \
	radeon_dataflow_swizzles.c \
	radeon_emulate_branches.c \
	radeon_emulate_loops.c \
	radeon_inline_literals.c \
	radeon_list.c \
	radeon_opcodes.c \
	radeon_optimize.c \
	radeon_pair_dead_sources.c \
	radeon_pair_regalloc.c \
	radeon_pair_schedule.c \
	radeon_pair_translate.c \
	radeon_program_alu.c \
	radeon_program.c \
	radeon_program_pair.c \
	radeon_program_print.c \
	radeon_program_tex.c \
	radeon_remove_constants.c \
	radeon_rename_regs.c \
	radeon_variable.c \
	radeon_vert_fc.c

GALLIUM_SOURCES.drivers/radeonsi = \
	gfx10_query.c \
	gfx10_shader_ngg.c \
	si_blit.c \
	si_buffer.c \
	si_clear.c \
	si_compute.c \
	si_compute_blit.c \
	si_cp_dma.c \
	si_cp_reg_shadowing.c \
	si_debug.c \
	si_descriptors.c \
	si_fence.c \
	si_get.c \
	si_gfx_cs.c \
	si_gpu_load.c \
	si_pipe.c \
	si_pm4.c \
	si_perfcounter.c \
	si_query.c \
	si_nir_optim.c \
	si_shader.c \
	si_sdma_copy_image.c \
	si_shader_llvm.c \
	si_shader_llvm_gs.c \
	si_shader_llvm_ps.c \
	si_shader_llvm_resources.c \
	si_shader_llvm_tess.c \
	si_shader_llvm_vs.c \
	si_shader_nir.c \
	si_shaderlib_nir.c \
	si_shaderlib_tgsi.c \
	si_sqtt.c \
	si_state.c \
	si_state_binning.c \
	si_state_draw_gfx6.cpp \
	si_state_draw_gfx7.cpp \
	si_state_draw_gfx8.cpp \
	si_state_draw_gfx9.cpp \
	si_state_draw_gfx10.cpp \
	si_state_draw_gfx103.cpp \
	si_state_msaa.c \
	si_state_shaders.c \
	si_state_streamout.c \
	si_state_viewport.c \
	si_test_blit.c \
	si_test_dma_perf.c \
	si_texture.c \
	si_uvd.c

.PATH:		${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx6.cpp
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx7.cpp
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx8.cpp
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx9.cpp
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx10.cpp
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx103.cpp

CPPFLAGS.si_state_draw_gfx6.cpp += -DGFX_VER=6
CPPFLAGS.si_state_draw_gfx7.cpp += -DGFX_VER=7
CPPFLAGS.si_state_draw_gfx8.cpp += -DGFX_VER=8
CPPFLAGS.si_state_draw_gfx9.cpp += -DGFX_VER=9
CPPFLAGS.si_state_draw_gfx10.cpp += -DGFX_VER=10
CPPFLAGS.si_state_draw_gfx103.cpp += -DGFX_VER=103

.for _f in ${GALLIUM_SOURCES.drivers/radeon}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/radeon
.endfor

.for _f in ${GALLIUM_SOURCES.drivers/r300} ${GALLIUM_SOURCES.drivers/r300/compiler}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/r300 \
			-I${X11SRCDIR.Mesa}/src/gallium/drivers/r300/compiler
.endfor

.for _f in ${GALLIUM_SOURCES.drivers/r600} ${GALLIUM_SOURCES.drivers/r600/sb} ${GALLIUM_SOURCES.drivers/radeonsi} ${GALLIUM_SOURCES.drivers/r600/sfn}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/r600
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/../src/gallium/drivers/r600
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/amd/common
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/../src/amd/common
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/amd/llvm
.endfor

.for _f in ${GALLIUM_SOURCES.drivers/radeon}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/amd/common
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/amd/llvm
.endfor

GALLIUM_SOURCES.drivers/nouveau = \
	nouveau_buffer.c \
	nouveau_fence.c \
	nouveau_heap.c \
	nouveau_mm.c \
	nouveau_screen.c \
	nouveau_video.c \
	nouveau_vp3_video_bsp.c \
	nouveau_vp3_video.c \
	nouveau_vp3_video_vp.c

GALLIUM_SOURCES.drivers/nouveau/nv30 = \
	nv30_clear.c \
	nv30_context.c \
	nv30_draw.c \
	nv30_format.c \
	nv30_fragprog.c \
	nv30_fragtex.c \
	nv30_miptree.c \
	nv30_push.c \
	nv30_query.c \
	nv30_resource.c \
	nv30_screen.c \
	nv30_state.c \
	nv30_state_validate.c \
	nv30_texture.c \
	nv30_transfer.c \
	nv30_vbo.c \
	nv30_vertprog.c \
	nv40_verttex.c \
	nvfx_fragprog.c \
	nvfx_vertprog.c

GALLIUM_SOURCES.drivers/nouveau/nv50 = \
	nv50_compute.c \
	nv50_context.c \
	nv50_formats.c \
	nv50_miptree.c \
	nv50_program.c \
	nv50_push.c \
	nv50_query.c \
	nv50_query_hw.c \
	nv50_query_hw_metric.c \
	nv50_query_hw_sm.c \
	nv50_resource.c \
	nv50_screen.c \
	nv50_shader_state.c \
	nv50_state.c \
	nv50_state_validate.c \
	nv50_surface.c \
	nv50_tex.c \
	nv50_transfer.c \
	nv50_vbo.c \
	nv84_video_bsp.c \
	nv84_video.c \
	nv84_video_vp.c \
	nv98_video_bsp.c \
	nv98_video.c \
	nv98_video_ppp.c \
	nv98_video_vp.c

GALLIUM_SOURCES.drivers/nouveau/codegen = \
	nv50_ir.cpp \
	nv50_ir_bb.cpp \
	nv50_ir_build_util.cpp \
	nv50_ir_emit_gk110.cpp \
	nv50_ir_emit_gm107.cpp \
	nv50_ir_emit_gv100.cpp \
	nv50_ir_emit_nv50.cpp \
	nv50_ir_emit_nvc0.cpp \
	nv50_ir_from_common.cpp \
	nv50_ir_from_nir.cpp \
	nv50_ir_from_tgsi.cpp \
	nv50_ir_graph.cpp \
	nv50_ir_lowering_gm107.cpp \
	nv50_ir_lowering_gv100.cpp \
	nv50_ir_lowering_helper.cpp \
	nv50_ir_lowering_nv50.cpp \
	nv50_ir_lowering_nvc0.cpp \
	nv50_ir_peephole.cpp \
	nv50_ir_print.cpp \
	nv50_ir_ra.cpp \
	nv50_ir_serialize.cpp \
	nv50_ir_ssa.cpp \
	nv50_ir_target.cpp \
	nv50_ir_target_gv100.cpp \
	nv50_ir_target_nv50.cpp \
	nv50_ir_util.cpp \
	nv50_ir_target_gm107.cpp \
	nv50_ir_target_nvc0.cpp

GALLIUM_SOURCES.drivers/nouveau/nvc0 = \
	nvc0_compute.c \
	nvc0_context.c \
	nvc0_formats.c \
	nvc0_miptree.c \
	nvc0_resource.c \
	nvc0_screen.c \
	nvc0_state.c \
	nvc0_state_validate.c \
	nvc0_surface.c \
	nvc0_tex.c \
	nvc0_transfer.c \
	nvc0_vbo.c \
	nvc0_vbo_translate.c \
	nvc0_program.c \
	nvc0_shader_state.c \
	nvc0_query.c \
	nvc0_query_hw.c \
	nvc0_query_hw_metric.c \
	nvc0_query_hw_sm.c \
	nvc0_query_sw.c \
	nve4_compute.c \
	nvc0_video.c \
	nvc0_video_bsp.c \
	nvc0_video_vp.c \
	nvc0_video_ppp.c

GALLIUM_SOURCES.winsys/nouveau/drm = \
        nouveau_drm_winsys.c

.for _f in ${GALLIUM_SOURCES.drivers/nouveau} \
	   ${GALLIUM_SOURCES.drivers/nouveau/nv30} \
	   ${GALLIUM_SOURCES.drivers/nouveau/nv50} \
	   ${GALLIUM_SOURCES.drivers/nouveau/codegen} \
	   ${GALLIUM_SOURCES.drivers/nouveau/nvc0} \
	   ${GALLIUM_SOURCES.winsys/nouveau/drm}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/nouveau \
			-I${DESTDIR}${X11INCDIR}/libdrm/nouveau
.endfor

GALLIUM_SOURCES.winsys/radeon/drm = \
        radeon_drm_bo.c \
        radeon_drm_cs.c \
	radeon_drm_surface.c \
        radeon_drm_winsys.c

GALLIUM_SOURCES.winsys/amdgpu/drm = \
	amdgpu_bo.c \
	amdgpu_cs.c \
	amdgpu_surface.c \
	amdgpu_winsys.c

.for _f in ${GALLIUM_SOURCES.winsys/amdgpu/drm}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/amd
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/amd/common
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/../src/amd/common
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/amd/llvm
.endfor

GALLIUM_SOURCES.frontends/vdpau = \
	bitmap.c \
	decode.c \
	device.c \
	ftab.c \
	htab.c \
	mixer.c \
	output.c \
	preemption.c \
	presentation.c \
	query.c \
	surface.c

GALLIUM_SOURCES.drivers/llvmpipe = \
	lp_bld_alpha.c \
	lp_bld_blend_aos.c \
	lp_bld_blend.c \
	lp_bld_blend_logicop.c \
	lp_bld_depth.c \
	lp_bld_interp.c \
	lp_clear.c \
	lp_context.c \
	lp_cs_tpool.c \
	lp_draw_arrays.c \
	lp_fence.c \
	lp_flush.c \
	lp_jit.c \
	lp_linear.c \
	lp_linear_fastpath.c \
	lp_linear_interp.c \
	lp_linear_sampler.c \
	lp_memory.c \
	lp_perf.c \
	lp_query.c \
	lp_rast.c \
	lp_rast_debug.c \
	lp_rast_linear.c \
	lp_rast_linear_fallback.c \
	lp_rast_rect.c \
	lp_rast_tri.c \
	lp_scene.c \
	lp_scene_queue.c \
	lp_screen.c \
	lp_setup.c \
	lp_setup_analysis.c \
	lp_setup_line.c \
	lp_setup_point.c \
	lp_setup_rect.c \
	lp_setup_tri.c \
	lp_setup_vbuf.c \
	lp_state_blend.c \
	lp_state_clip.c \
	lp_state_cs.c \
	lp_state_derived.c \
	lp_state_fs.c \
	lp_state_fs_analysis.c \
	lp_state_fs_fastpath.c \
	lp_state_fs_linear.c \
	lp_state_fs_linear_llvm.c \
	lp_state_gs.c \
	lp_state_rasterizer.c \
	lp_state_sampler.c \
	lp_state_setup.c \
	lp_state_so.c \
	lp_state_surface.c \
	lp_state_tess.c \
	lp_state_vertex.c \
	lp_state_vs.c \
	lp_surface.c \
	lp_tex_sample.c \
	lp_texture.c

GALLIUM_SOURCES.drivers/softpipe = \
	sp_buffer.c \
	sp_clear.c \
	sp_context.c \
	sp_compute.c \
	sp_draw_arrays.c \
	sp_fence.c \
	sp_flush.c \
	sp_fs_exec.c \
	sp_image.c \
	sp_prim_vbuf.c \
	sp_quad_blend.c \
	sp_quad_depth_test.c \
	sp_quad_fs.c \
	sp_quad_pipe.c \
	sp_quad_stipple.c \
	sp_query.c \
	sp_screen.c \
	sp_setup.c \
	sp_state_blend.c \
	sp_state_clip.c \
	sp_state_derived.c \
	sp_state_image.c \
	sp_state_rasterizer.c \
	sp_state_sampler.c \
	sp_state_shader.c \
	sp_state_so.c \
	sp_state_surface.c \
	sp_state_vertex.c \
	sp_surface.c \
	sp_tex_sample.c \
	sp_tex_tile_cache.c \
	sp_texture.c \
	sp_tile_cache.c

GALLIUM_SOURCES.winsys/sw/null = \
	null_sw_winsys.c

GALLIUM_SOURCES.winsys/sw/wrapper = \
	wrapper_sw_winsys.c

GALLIUM_SOURCES.winsys/sw/dri = \
	dri_sw_winsys.c

GALLIUM_SOURCES.winsys/sw/kms-dri = \
	kms_dri_sw_winsys.c

GALLIUM_SOURCES.frontends/dri = \
        dri_context.c \
        dri_drawable.c \
	dri_helpers.c \
        dri_query_renderer.c \
        dri_screen.c \
	drisw.c \
	dri2.c

# missing
CPPFLAGS+=	\
	-DGALLIUM_SOFTPIPE \
	-DGALLIUM_STATIC_TARGETS=1 \
	-DMESA_EGL_NO_X11_HEADERS

.for _d in ${GALLIUM_SUBDIRS}
SRCS+=	${GALLIUM_SOURCES.${_d}}
.PATH: ${X11SRCDIR.Mesa}/src/gallium/${_d}
. for _s in ${GALLIUM_SOURCES.${_d}}
CPPFLAGS.${_s}+= -I${X11SRCDIR.Mesa}/src/gallium/${_d}
. endfor
.endfor

#. if defined(${GALLIUM_SOURCES.${_d}})
#SRCS+=	${GALLIUM_SOURCES.${_d}}
#. endif

.include "../libloader.mk"

.if ${BUILD_RADEON} == 1
CFLAGS+=	-pthread
LDFLAGS+=	-pthread
.endif

LIBDPLIBS+=	X11-xcb         ${.CURDIR}/../libX11/libX11-xcb
LIBDPLIBS+=	xcb-dri2        ${.CURDIR}/../libxcb/dri2
LIBDPLIBS+=	xcb		${.CURDIR}/../libxcb/libxcb
LIBDPLIBS+= 	drm		${.CURDIR}/../libdrm
.if ${BUILD_I915} == 1 || ${BUILD_IRIS} == 1 || ${BUILD_CROCUS} == 1
LIBDPLIBS+= 	drm_intel	${.CURDIR}/../libdrm_intel
.endif
.if ${BUILD_RADEON} == 1
LIBDPLIBS+= 	drm_radeon	${.CURDIR}/../libdrm_radeon
LIBDPLIBS+= 	drm_amdgpu	${.CURDIR}/../libdrm_amdgpu
.endif	# ${BUILD_RADEON} == 1
.if ${BUILD_NOUVEAU} == 1
LIBDPLIBS+= 	drm_nouveau	${.CURDIR}/../libdrm_nouveau
.endif	# ${BUILD_NOUVEAU} == 1
LIBDPLIBS+= 	glapi		${.CURDIR}/../libglapi${OLD_SUFFIX}
LIBDPLIBS+=	expat		${.CURDIR}/../../../../../external/mit/expat/lib/libexpat
LIBDPLIBS+=	terminfo	${.CURDIR}/../../../../../lib/libterminfo
LIBDPLIBS+=	execinfo	${.CURDIR}/../../../../../lib/libexecinfo

LIBDPLIBS+=	elf		${NETBSDSRCDIR}/external/bsd/elftoolchain/lib/libelf
LIBDPLIBS+=	z		${.CURDIR}/../../../../../lib/libz
LIBDPLIBS+=	m		${.CURDIR}/../../../../../lib/libm

# gallium drivers requiring LLVM
.if ${BUILD_LLVMPIPE} == 1 || ${BUILD_RADEON} == 1

LLVMRT_LIBS=	\
		MCJIT \
		ExecutionEngine \
		ExecutionEngineOrcTargetProcess \
		ExecutionEngineOrcShared \
		Orc \
		RuntimeDyld

.if ${BUILD_RADEON} == 1
LLVMRT_LIBS+=	\
		AMDGPUCodeGen \
		AMDGPUMCTargetDesc \
		AMDGPUTargetInfo \
		AMDGPUAsmParser \
		AMDGPUDisassembler \
		AMDGPUUtils
.endif

.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
# XXX duplicates
LLVMRT_LIBS+=	\
		X86Disassembler \
		X86CodeGen \
		X86MCTargetDesc \
		X86Disassembler \
		X86MCTargetDesc \
		X86TargetInfo
.endif

.if ${MACHINE_CPU} == "aarch64"
LLVMRT_LIBS+=	\
		AArch64AsmParser \
		AArch64CodeGen \
		AArch64MCTargetDesc \
		AArch64Utils \
		AArch64Disassembler \
		AArch64TargetInfo
.endif

.if ${MACHINE_CPU} == "arm"
LLVMRT_LIBS+=	\
		ARMCodeGen \
		ARMDisassembler \
		ARMTargetInfo \
		ARMMCTargetDesc \
		ARMAsmParser \
		ARMUtils
.endif

.if ${MACHINE_CPU} == "mips"
LLVMRT_LIBS+=	\
		MipsCodeGen \
		MipsDisassembler \
		MipsAsmParser \
		MipsMCTargetDesc \
		MipsTargetInfo
.endif

.if ${MACHINE_CPU} == "powerpc"
LLVMRT_LIBS+=	\
		PowerPCCodeGen \
		PowerPCDisassembler \
		PowerPCTargetInfo \
		PowerPCMCTargetDesc \
		PowerPCAsmParser
.endif

LLVMRT_LIBS+=	\
		Passes \
		TransformsCoroutines \
		ObjCARC \
		GlobalISel \
		MCDisassembler \
		SelectionDAG \
		AsmPrinter \
		CodeGen \
		TransformsCFGuard \
		Target \
		InstCombine \
		ScalarOpts \
		DebugInfoCodeView \
		DebugInfoDWARF \
		Object \
		BitReader \
		TextAPI \
		MIRParser \
		MCParser \
		MC \
		ipo \
		BitWriter \
		FrontendOpenMP \
		Instrumentation \
		IRReader \
		AsmParser \
		Vectorize \
		TransformsAggressiveInstCombine \
		ProfileData \
		TransformsUtils \
		Analysis \
		IR \
		Remarks \
		BitstreamReader \
		Linker \
		BinaryFormat \
		Support \
		Demangle

.include "${NETBSDSRCDIR}/external/apache2/llvm/link.mk"

.endif  # ${BUILD_LLVM_PIPE} == 1 || ${BUILD_RADEON} == 1

LDFLAGS+=	-Wl,--version-script=${X11SRCDIR.Mesa}/src/gallium/targets/dri/dri.sym
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE_CPU} == "aarch64"
LDFLAGS+=	-Wl,-z,defs
.endif

##  build mesagallium parts
MESA_SRC_MODULES=  main math vbo state_tracker program asm_s
.if ${BUILD_RADEON} == 1
MESA_SRC_MODULES+= amd
.endif

.include "../libmesa.mk"
.include "../libglsl.mk"

# Special addition for just gallium; it misses the rest of asm_c files.
.PATH: ${X11SRCDIR.Mesa}/src/mesa/x86
SRCS+=	common_x86.c

.if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
SRCS+=	streaming-load-memcpy.c
CPPFLAGS.streaming-load-memcpy.c+= -msse4.1
.endif

# Needs 64bit atomics
CPPFLAGS.i386+= -march=i586
CPPFLAGS+=	${CPPFLAGS.${XORG_MACHINE_ARCH:U${MACHINE_ARCH}}}

CPPFLAGS.r600_pipe_common.c+=	-DMESA_LLVM_VERSION_STRING=\"${LLVM_VERSION}\"
CPPFLAGS.si_get.c+=	-DMESA_LLVM_VERSION_STRING=\"${LLVM_VERSION}\"
CPPFLAGS.lp_screen.c+=	-DMESA_LLVM_VERSION_STRING=\"${LLVM_VERSION}\"
CPPFLAGS.lp_bld_intr.c+=	-DMESA_LLVM_VERSION_STRING=\"${LLVM_VERSION}\"
CPPFLAGS.lp_bld_type.c+=	-DMESA_LLVM_VERSION_STRING=\"${LLVM_VERSION}\"

.include "../driver.mk"


.PATH: ${X11SRCDIR.Mesa}/src/gallium/targets/dri
SRCS+=	target.c

CPPFLAGS+= \
	-I${X11SRCDIR.Mesa}/src/gallium/include \
	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary \
	-I${X11SRCDIR.Mesa}/src/gallium/drivers \
	-I${X11SRCDIR.Mesa}/../src/mesa/drivers/dri/common

CPPFLAGS.target.c += \
	-DDRI_TARGET \
	-DGALLIUM_NOOP \
	-DGALLIUM_RBUG \
	-DGALLIUM_TRACE \
	-DGALLIUM_SOFTPIPE \
	-I${X11SRCDIR.Mesa}/src/gallium/frontends/dri \
	-I${X11SRCDIR.Mesa}/src/loader \
	-I${X11SRCDIR.Mesa}/../src/util \
	-I${X11SRCDIR.Mesa}/../src/gallium/drivers \
	-I${X11SRCDIR.Mesa}/src/gallium/winsys

.if ${BUILD_LLVMPIPE} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_LLVMPIPE
.endif  #${BUILD_LLVMPIPE} == 1

.if ${BUILD_I915} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_I915 \
	-DGALLIUM_ILO
.endif

.if ${BUILD_IRIS} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_IRIS
.endif

.if ${BUILD_CROCUS} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_CROCUS
.endif

.if ${BUILD_RADEON} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_R200 \
	-DGALLIUM_R300 \
	-DGALLIUM_R600 \
	-DGALLIUM_RADEONSI
.endif	# ${BUILD_RADEON} == 1

.if ${BUILD_NOUVEAU} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_NOUVEAU
.endif	# ${BUILD_NOUVEAU} == 1

CWARNFLAGS.clang+=	-Wno-error=constant-conversion \
			-Wno-error=tautological-constant-out-of-range-compare \
			-Wno-error=pointer-sign \
			-Wno-error=switch \
			-Wno-error=absolute-value \
			-Wno-error=tautological-compare \
			-Wno-error=static-in-inline \
			-Wno-error=logical-not-parentheses \
			-Wno-error=constant-logical-operand \
			-Wno-error=unknown-warning-option \
			-Wno-error=typedef-redefinition \
			-Wno-error=enum-conversion # https://bugs.freedesktop.org/show_bug.cgi?id=109761

CWARNFLAGS+=		-Wno-error=stack-protector

.include <bsd.x11.mk>
LIBDIR=		${X11USRLIBDIR}/modules/dri

.for _d in ${DRIVERS}
SYMLINKS+= gallium_dri.so ${DRIDIR}/${_d}_dri.so
SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.${SHLIB_MAJOR} 
.if ${MKDEBUG} != "no"
SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHLIB_MAJOR}.debug
.endif
.endfor

.if ${MACHINE_ARCH} == "sparc" || ${COMMON_MACHINE_ARCH:U} == "sparc"
COPTS+=	${${ACTIVE_CC} == "clang":? -Wa,-Av8plus  :}
.endif

COPTS.u_atomic.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-builtin-declaration-mismatch :}

.if ${MACHINE} == "vax" && ${HAVE_GCC:U0} >= 12
# in extract_constrain_insn, at recog.cc:2698
COPTS.sp_quad_depth_test.c+=	-O0
# in find_reloads_toplev, at reload.cc:4815
COPTS.u_format_table.c+=	-O0
.endif

.if ${MACHINE} == "vax" && ${HAVE_GCC:U0} == 10
# in fixup_reorder_chain, at cfgrtl.c:3985
COPTS.nir_builtin_builder.c+=	-O0
# in fixup_reorder_chain, at cfgrtl.c:3985
COPTS.nir_lower_int64.c+=	-O0
.endif

.if ${MACHINE_CPU} == "m68k" && ${HAVE_GCC:U0} == 12
COPTS.vl_bicubic_filter.c+=	-O1
.endif

.if ${MACHINE_CPU} == "m68k" && ${HAVE_GCC:U0} >= 12
COPTS.format_utils.c+=	-Os
COPTS.glsl_lexer.cpp+=	-O1 -fno-jump-tables
.endif
.if ${MACHINE_CPU} == "m68k" && ${HAVE_GCC:U0} >= 14
COPTS.glsl_parser.cpp+=	-Os
.endif

.include <bsd.lib.mk>
# Don't regenerate c files
.y.c:
@


1.63
log
@make this build without warnings on m68k and GCC 14.

format_utils.c and glsl_parser.cpp get -Os, and glsl_lexer.cpp gets
-O1 -fno-jump-tables, to avoid eg:

{standard input}:60465: Warning: .word .L5289-.L5291+00000000 didn't fit

assembler warnings (that should really be an error?)
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.62 2025/10/27 10:29:41 jmcneill Exp $
d1454 1
a1454 1
.if ${MACHINE_CPU} == "m68k" && ${HAVE_GCC:U0} >= 14
d1457 2
@


1.62
log
@gallium: Unconditionally link to libdrm

Sources in GALLIUM_SUBDIRS (auxiliary/renderonly, winsys/sw/kms-dri)
still use drm* APIs, make sure we link to libdrm even when not building
the radeon or nouveau bits.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.61 2025/09/25 05:11:25 mrg Exp $
d1454 6
@


1.61
log
@remove the recently added -O0 for vax & gcc 14, the compiler bug is fixed.

thanks to Kalvis.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.60 2025/09/24 01:25:00 mrg Exp $
a1178 1
.if ${BUILD_RADEON} == 1 || ${BUILD_NOUVEAU} == 1
d1180 1
a1180 7
.if ${BUILD_I915} == 1
LIBDPLIBS+= 	drm_intel	${.CURDIR}/../libdrm_intel
.endif
.if ${BUILD_IRIS} == 1
LIBDPLIBS+= 	drm_intel	${.CURDIR}/../libdrm_intel
.endif
.if ${BUILD_CROCUS} == 1
a1189 1
.endif	# ${BUILD_RADEON} == 1 || ${BUILD_NOUVEAU} == 1
@


1.60
log
@vax-gcc14 needs 5 more files with -O0 applied.

all 5 seem to be the same problem, ending in "in extract_insn, at recog.cc:2818"
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.59 2025/04/13 08:30:22 rin Exp $
a1443 9
.if ${MACHINE} == "vax" && ${HAVE_GCC:U0} >= 14
# in extract_insn, at recog.cc:2818
COPTS.nir_to_tgsi.c+=	-O0
COPTS.st_glsl_to_tgsi.cpp+=	-O0
COPTS.texcompress_bptc.c+=	-O0
COPTS.texstate.c+=	-O0
COPTS.u_format_bptc.c+=	-O0
.endif

@


1.59
log
@gallium: Add -O0 hack also for GCC10/vax
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.57 2024/09/30 02:55:44 kalvisd Exp $
d1444 9
@


1.58
log
@gallium: Restrict vax hack for GCC12, add brief comments

For GCC10, we have another ICEs.
@
text
@d1451 7
@


1.57
log
@gallium: XXX: Sprinkle -O0 hacks for GCC/vax 12.4

XXX
Mesa codes use binary <--> float/double conversion, assuming IEE754.
Even if build passes, these will not work on vax...

    OK rin@@ (from rin@@)
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.56 2024/08/17 11:34:46 rin Exp $
d1444 2
a1445 1
.if ${MACHINE} == "vax"
d1447 1
@


1.56
log
@gallium: Sprinkle -O1 to vl_bicubic_filter.c for GCC12/m68k

as done for gallium.old. Other files can be built by GCC 12.4 somehow.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.55 2024/05/01 21:34:48 christos Exp $
d1444 5
@


1.55
log
@Allow c99 array designators
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.54 2024/04/26 16:34:17 rillig Exp $
d1444 4
@


1.55.2.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.59 2025/04/13 08:30:22 rin Exp $
a1443 18
.if ${MACHINE} == "vax" && ${HAVE_GCC:U0} >= 12
# in extract_constrain_insn, at recog.cc:2698
COPTS.sp_quad_depth_test.c+=	-O0
# in find_reloads_toplev, at reload.cc:4815
COPTS.u_format_table.c+=	-O0
.endif

.if ${MACHINE} == "vax" && ${HAVE_GCC:U0} == 10
# in fixup_reorder_chain, at cfgrtl.c:3985
COPTS.nir_builtin_builder.c+=	-O0
# in fixup_reorder_chain, at cfgrtl.c:3985
COPTS.nir_lower_int64.c+=	-O0
.endif

.if ${MACHINE_CPU} == "m68k" && ${HAVE_GCC:U0} == 12
COPTS.vl_bicubic_filter.c+=	-O1
.endif

@


1.54
log
@gallium: disable lint
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.53 2023/11/25 20:00:25 rjs Exp $
d22 1
a22 1
CWARNFLAGS.clang += -Wno-atomic-alignment -Wno-unknown-warning-option -Wno-implicit-int-float-conversion
@


1.53
log
@Make building of more files conditional on MKLLVMRT.

Make r300_state_derived.c compile with gcc 12.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.52 2023/11/22 17:48:35 rjs Exp $
d8 2
@


1.52
log
@Include some more files.

Add a build-id note to gallium.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.51 2023/10/07 12:15:52 rin Exp $
a345 1
	nir_to_tgsi_info.c \
d347 5
d391 1
d430 3
a432 2
	lp_bld_type.c
	#lp_bld_debug.cpp
d745 2
@


1.51
log
@Drop -O[01] hacks for vax; no longer necessary for patched GCC 10

PR port-vax/57646: Import major vax toolchain fix by Kalvis Duckmanton

XXXRO: GCC 12 may require hacks for a while, but it turned out that
GCC 12 should be treated differently from older versions; a lot of new
files need -O[01] flags, while some may no longer require it.

I will take a look later.

Note that these hacks are not required if Kalvis's patches for GCC 12
are applied.

Keep doc/HACKS entries for a while (will be sync with update for GCC 12).

diff --git a/crypto/external/bsd/openssh/lib/Makefile b/crypto/external/bsd/openssh/lib/Makefile
index 96a93f5e396..4e38be1b642 100644
--- a/crypto/external/bsd/openssh/lib/Makefile
+++ b/crypto/external/bsd/openssh/lib/Makefile
@@@@ -117,12 +117,6 @@@@ COPTS.${f}.c+=	-Wno-pointer-sign
 # XXX
 COPTS.channels.c+=	-fno-strict-aliasing

-# XXX
-.if ${MACHINE} == "vax"
-COPTS.poly1305.c+=	-O0
-COPTS.umac.c+=		-O0
-.endif
-
 COPTS.hostfile.c+=	${CC_WNO_FORMAT_TRUNCATION}
 COPTS.sshkey.c+=	${CC_WNO_FORMAT_TRUNCATION}
 COPTS.cipher.c+=	-Wno-error=deprecated-declarations
diff --git a/distrib/utils/x_ping/Makefile b/distrib/utils/x_ping/Makefile
index f1c452a0d60..8ee77580a3f 100644
--- a/distrib/utils/x_ping/Makefile
+++ b/distrib/utils/x_ping/Makefile
@@@@ -12,10 +12,6 @@@@ CPPFLAGS+=	-I${SRCDIR} -DCRUNCHOPS
 DPADD=		${LIBM}
 LDADD=		-lm

-.if ${MACHINE_ARCH} == "vax"
-COPTS.ping.c=-O0
-.endif
-
 .include <bsd.prog.mk>

 .PATH:		${SRCDIR}
diff --git a/external/apache2/argon2/lib/libargon2/Makefile.inc b/external/apache2/argon2/lib/libargon2/Makefile.inc
index d3f4470c6c7..6a1dd146d7d 100644
--- a/external/apache2/argon2/lib/libargon2/Makefile.inc
+++ b/external/apache2/argon2/lib/libargon2/Makefile.inc
@@@@ -16,7 +16,3 @@@@ CFLAGS+=	-pthread
 LDADD+=-lpthread
 DPADD+=${LIBPTHREAD}
 .endif
-
-.if ${MACHINE} == "vax"
-COPTS.blake2b.c+=	-O0
-.endif
diff --git a/external/bsd/jemalloc/lib/Makefile.inc b/external/bsd/jemalloc/lib/Makefile.inc
index 2f524358f46..d5da774f293 100644
--- a/external/bsd/jemalloc/lib/Makefile.inc
+++ b/external/bsd/jemalloc/lib/Makefile.inc
@@@@ -53,12 +53,6 @@@@ COPTS.ctl.c+=-Wno-error=stack-protector
 COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector

-.if ${MACHINE_ARCH} == "vax"
-# in merge_overlapping_regs, at regrename.c
-COPTS.arena.c+=-O0
-COPTS.extent.c+=-O0
-.endif
-
 SRCS+=${JEMALLOC_SRCS}

 jemalloc.d jemalloc.pico jemalloc.o jemalloc.ln jemalloc.po jemalloc.go: \
diff --git a/external/bsd/mdocml/lib/libmandoc/Makefile b/external/bsd/mdocml/lib/libmandoc/Makefile
index 40d7e29ae88..dfd3077a2c7 100644
--- a/external/bsd/mdocml/lib/libmandoc/Makefile
+++ b/external/bsd/mdocml/lib/libmandoc/Makefile
@@@@ -39,11 +39,6 @@@@ tbl_opts.c

 MAN=	mandoc.3

-# XXX
-.if ${MACHINE} == "vax"
-COPTS.mdoc_macro.c+=-O0
-.endif
-
 COPTS.man_validate.c+=-Wno-error=array-bounds

 .include <bsd.lib.mk>
diff --git a/external/gpl3/binutils.old/lib/libbfd/Makefile b/external/gpl3/binutils.old/lib/libbfd/Makefile
index 03477232b55..74a354532fa 100644
--- a/external/gpl3/binutils.old/lib/libbfd/Makefile
+++ b/external/gpl3/binutils.old/lib/libbfd/Makefile
@@@@ -41,10 +41,6 @@@@ CPPFLAGS+=	-I${.CURDIR}/arch/${BFD_MACHINE_ARCH} -I${DIST}/include -I. \
 		-DDEBUGDIR=\"${DEBUGDIR}\" -DLIBDIR=\"${LIBDIR}\" \
 		-DBINDIR=\"${BINDIR}\"

-.if (${BFD_MACHINE_ARCH} == "vax")
-CPPFLAGS.elf.c +=	-O0
-.endif
-
 COPTS.pei-x86_64.c+=	-Wno-stack-protector
 COPTS.elfxx-mips.c+=	-Wno-stack-protector
 COPTS.elf.c+=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-overflow :}
diff --git a/external/gpl3/binutils/lib/libbfd/Makefile b/external/gpl3/binutils/lib/libbfd/Makefile
index 00cb2b20081..a3f0c25fd35 100644
--- a/external/gpl3/binutils/lib/libbfd/Makefile
+++ b/external/gpl3/binutils/lib/libbfd/Makefile
@@@@ -41,10 +41,6 @@@@ CPPFLAGS+=	-I${.CURDIR}/arch/${BFD_MACHINE_ARCH} -I${DIST}/include -I. \
 		-DDEBUGDIR=\"${DEBUGDIR}\" -DLIBDIR=\"${LIBDIR}\" \
 		-DBINDIR=\"${BINDIR}\"

-.if (${BFD_MACHINE_ARCH} == "vax")
-CPPFLAGS.elf.c +=	-O0
-.endif
-
 COPTS.pei-x86_64.c+=	-Wno-stack-protector
 COPTS.elfxx-mips.c+=	-Wno-stack-protector
 COPTS.elf.c+=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-overflow :}
diff --git a/external/gpl3/gcc.old/lib/Makefile.sanitizer b/external/gpl3/gcc.old/lib/Makefile.sanitizer
index efd36ae4bee..5173a5109a0 100644
--- a/external/gpl3/gcc.old/lib/Makefile.sanitizer
+++ b/external/gpl3/gcc.old/lib/Makefile.sanitizer
@@@@ -88,22 +88,3 @@@@ COPTS+=-fno-builtin -fno-exceptions -fno-rtti -funwind-tables

 # Can't profile without it`
 #-fomit-frame-pointer
-
-.if ${MACHINE_ARCH} == "vax"
-COPTS.sanitizer_allocator.cc += -O1
-COPTS.sanitizer_common.cc += -O1
-COPTS.sanitizer_common_libcdep.cc += -O1
-COPTS.sanitizer_coverage_libcdep.cc += -O1
-COPTS.sanitizer_coverage_mapping_libcdep.cc += -O1
-COPTS.sanitizer_deadlock_detector1.cc += -O1
-COPTS.sanitizer_mac.cc += -O1
-COPTS.sanitizer_netbsd.cc += -O1
-COPTS.sanitizer_posix.cc += -O1
-COPTS.sanitizer_printf.cc += -O1
-COPTS.sanitizer_procmaps_common.cc += -O1
-COPTS.sanitizer_stackdepot.cc += -O1
-COPTS.sanitizer_symbolizer_libcdep.cc += -O1
-COPTS.sanitizer_symbolizer_report.cc += -O1
-COPTS.ubsan_diag.cc += -O1
-COPTS.ubsan_init.cc += -O1
-.endif
diff --git a/external/gpl3/gcc.old/lib/libasan/Makefile b/external/gpl3/gcc.old/lib/libasan/Makefile
index 1e6f9608abe..3da7bbf2f58 100644
--- a/external/gpl3/gcc.old/lib/libasan/Makefile
+++ b/external/gpl3/gcc.old/lib/libasan/Makefile
@@@@ -49,14 +49,6 @@@@ LIBDPLIBS+= m  ${NETBSDSRCDIR}/lib/libm
 LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
 CPPFLAGS+=-DCAN_SANITIZE_UB=0

-.if ${MACHINE_ARCH} == "vax"
-COPTS.asan_allocator.cc += -O1
-COPTS.asan_report.cc += -O1
-COPTS.sanitizer_file.cc += -O1
-COPTS.ubsan_diag.cc += -O1
-COPTS.ubsan_init.cc += -O1
-.endif
-
 .if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
 COPTS.asan_interceptors.cc += -O1
 .endif
diff --git a/external/gpl3/gcc.old/lib/liblsan/Makefile b/external/gpl3/gcc.old/lib/liblsan/Makefile
index 4578544a9a8..ddb7981077c 100644
--- a/external/gpl3/gcc.old/lib/liblsan/Makefile
+++ b/external/gpl3/gcc.old/lib/liblsan/Makefile
@@@@ -16,11 +16,6 @@@@ LSAN_SRCS+= \
 	lsan_linux.cc \
 	lsan_thread.cc

-.if ${MACHINE_ARCH} == "vax"
-COPTS.lsan_allocator.cc += -O1
-COPTS.sanitizer_file.cc += -O1
-.endif
-
 LIB=	lsan
 SRCS+=	${LSAN_SRCS}
 LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
diff --git a/external/gpl3/gcc.old/lib/libubsan/Makefile b/external/gpl3/gcc.old/lib/libubsan/Makefile
index 2e2faca7b1c..9de82550d14 100644
--- a/external/gpl3/gcc.old/lib/libubsan/Makefile
+++ b/external/gpl3/gcc.old/lib/libubsan/Makefile
@@@@ -26,10 +26,6 @@@@ UBSAN_SRCS= \
 COPTS.${_s}.cc+=-frtti
 .endfor

-.if ${MACHINE_ARCH} == "vax"
-COPTS.sanitizer_file.cc += -O1
-.endif
-
 LIB=	ubsan
 SRCS+=	${UBSAN_SRCS}
 LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
diff --git a/external/gpl3/gcc.old/usr.bin/cc1/Makefile b/external/gpl3/gcc.old/usr.bin/cc1/Makefile
index c55e292ee8e..ff12a5be524 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1/Makefile
@@@@ -46,17 +46,6 @@@@ CPPFLAGS.default-c.c+=	-I${BACKENDOBJ}
 BUILDSYMLINKS+= ${GNUHOSTDIST}/gcc/config/sh/sh-c.cc sh-c.c
 .endif

-.if ${MACHINE_CPU} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1-checksum.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
 .endif
diff --git a/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile b/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile
index 3123ee0d60b..aab82ad3448 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile
@@@@ -44,16 +44,8 @@@@ COPTS.objc-act.c+=			-Wno-stack-protector
 COPTS.objc-gnu-runtime-abi-01.c+=	-Wno-stack-protector
 COPTS.objc-next-runtime-abi-01.c+=	-Wno-stack-protector

-.if ${MACHINE_ARCH} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1obj-checksum.c+=-O0
-.endif
+COPTS.c-cppbuiltin.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error=format-overflow :}
+COPTS.c-typeck.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error=format-overflow :}

 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
diff --git a/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile b/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile
index b9c108251c5..e04e8fc7f53 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile
@@@@ -69,18 +69,6 @@@@ COPTS.objc-act.c+=			-Wno-stack-protector
 COPTS.objc-gnu-runtime-abi-01.c+=	-Wno-stack-protector
 COPTS.objc-next-runtime-abi-01.c+=	-Wno-stack-protector

-.if ${MACHINE_ARCH} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1obj-checksum.c+=-O0
-COPTS.decl.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
 .endif
diff --git a/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile b/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile
index 7936efd3a5e..7c54559e21a 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile
@@@@ -31,23 +31,6 @@@@ CHECKSUM_OBJS= ${LIBBACKTRACEOBJ}/libbacktrace.a \

 CFLAGS+=	-Wno-error=stack-protector

-.if ${MACHINE_ARCH} == "vax"
-COPTS.call.c+=-O0
-COPTS.decl.c+=-O0
-COPTS.typeck2.c+=-O0
-COPTS.class.c+=-O0
-COPTS.typeck.c+=-O0
-COPTS.init.c+=-O0
-COPTS.semantics.c+=-O0
-COPTS.mangle.c+=-O0
-COPTS.constexpr.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1plus-checksum.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
 .endif
diff --git a/external/gpl3/gcc.old/usr.bin/gcc/Makefile b/external/gpl3/gcc.old/usr.bin/gcc/Makefile
index 7a66d77ffc7..a5a4b1c3adf 100644
--- a/external/gpl3/gcc.old/usr.bin/gcc/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/gcc/Makefile
@@@@ -25,9 +25,6 @@@@ ${SRCS}: ${GCCARCH}/defs.mk
 .include <bsd.info.mk>

 COPTS.gcc.c=	-Wno-stack-protector
-.if ${MACHINE_ARCH} == "vax"
-COPTS.dse.c=	-O1
-.endif

 .PATH: ${DIST}/gcc ${DIST}/gcc/doc ${DIST}/gcc/c

diff --git a/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile b/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile
index 751d1513eec..33aeb1c9898 100644
--- a/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile
@@@@ -14,10 +14,6 @@@@ SRCS=		decNumber.c decContext.c decimal32.c decimal64.c decimal128.c
 CPPFLAGS+=	-I${.CURDIR}/arch/${GCC_MACHINE_ARCH} -I${DIST}/libdecnumber
 CPPFLAGS+=	-I${DIST}/libgcc

-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
 .include <bsd.lib.mk>

 # Force using C++ for this
diff --git a/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile b/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile
index 90f44a9fcf6..fd251464fb7 100644
--- a/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile
@@@@ -24,11 +24,6 @@@@ COPTS.lto-common.c+=	-Wno-stack-protector
 .include "../Makefile.backtrace"
 .include "../Makefile.libdecnumber"

-.if ${MACHINE_ARCH} == "vax"
-COPTS.lto-lang.c+=-O0
-COPTS.lto-symtab.c+=-O0
-.endif
-
 LDADD+=	${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} -lintl -lz -lm
 DPADD+=	${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} ${LIBINTL} ${LIBZ} ${LIBM}

diff --git a/external/gpl3/gcc.old/usr.bin/lto1/Makefile b/external/gpl3/gcc.old/usr.bin/lto1/Makefile
index 4c49161a64c..340d3c6124f 100644
--- a/external/gpl3/gcc.old/usr.bin/lto1/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/lto1/Makefile
@@@@ -21,11 +21,6 @@@@ COPTS.lto-common.c+=	-Wno-stack-protector
 .include "../Makefile.libcpp"
 .include "../Makefile.libdecnumber"

-.if ${MACHINE_ARCH} == "vax"
-COPTS.lto-lang.c+=-O0
-COPTS.lto-symtab.c+=-O0
-.endif
-
 LDADD+= ${LIBIBERTYOBJ}/libiberty.a
 DPADD+= ${LIBIBERTYOBJ}/libiberty.a
 LDADD+=	${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} -lintl -lz -lm
diff --git a/external/gpl3/gdb.old/lib/libdecnumber/Makefile b/external/gpl3/gdb.old/lib/libdecnumber/Makefile
index bcd4ae5b222..ce28811526b 100644
--- a/external/gpl3/gdb.old/lib/libdecnumber/Makefile
+++ b/external/gpl3/gdb.old/lib/libdecnumber/Makefile
@@@@ -18,10 +18,6 @@@@ CPPFLAGS+=	-I${.CURDIR}/arch/${GDB_MACHINE_ARCH} \

 SRCS=		${G_OBJS:.o=.c} ${G_SOURCES}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
 .PATH: ${DIST}/libdecnumber ${DIST}/libdecnumber/dpd

 .include <bsd.lib.mk>
diff --git a/external/gpl3/gdb/lib/libdecnumber/Makefile b/external/gpl3/gdb/lib/libdecnumber/Makefile
index c95d36e3dfa..e3169865304 100644
--- a/external/gpl3/gdb/lib/libdecnumber/Makefile
+++ b/external/gpl3/gdb/lib/libdecnumber/Makefile
@@@@ -18,10 +18,6 @@@@ CPPFLAGS+=	-I${.CURDIR}/arch/${GDB_MACHINE_ARCH} \

 SRCS=		${G_OBJS:.o=.c} ${G_SOURCES}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
 .PATH: ${DIST}/libdecnumber ${DIST}/libdecnumber/dpd ${DIST}/libdecnumber/bid

 .include <bsd.lib.mk>
diff --git a/external/gpl3/gdb/lib/libgdb/Makefile b/external/gpl3/gdb/lib/libgdb/Makefile
index b87a515d13a..c118c363975 100644
--- a/external/gpl3/gdb/lib/libgdb/Makefile
+++ b/external/gpl3/gdb/lib/libgdb/Makefile
@@@@ -66,12 +66,6 @@@@ CFLAGS:=		${CXXFLAGS} -std=gnu++17 -Wno-error=stack-protector

 ada-exp.c: ada-lex.c

-.if ${MACHINE} == "vax"
-. if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8
-COPTS.read.c+=	-O0
-. endif
-.endif
-
 # These are generated by implicit rules and are not easy to generate
 CLEANDIRFILES+= \
 	ada-exp.c ada-lex.c \
diff --git a/external/mit/xorg/lib/gallium.old/Makefile b/external/mit/xorg/lib/gallium.old/Makefile
index 55b2fe3d1c1..bfa40c8974f 100644
--- a/external/mit/xorg/lib/gallium.old/Makefile
+++ b/external/mit/xorg/lib/gallium.old/Makefile
@@@@ -1211,10 +1211,6 @@@@ SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHL
 COPTS+=	${${ACTIVE_CC} == "clang":? -Wa,-Av8plus  :}
 .endif

-.if ${MACHINE_ARCH} == "vax"
-COPTS.nir.c += -O1
-.endif
-
 # XXXGCC12
 .if ${MACHINE_ARCH} == "m68k"
 COPTS.st_glsl_to_tgsi.cpp += -O1
diff --git a/external/mit/xorg/lib/gallium/Makefile b/external/mit/xorg/lib/gallium/Makefile
index 6778a8c11c8..9f1422080fe 100644
--- a/external/mit/xorg/lib/gallium/Makefile
+++ b/external/mit/xorg/lib/gallium/Makefile
@@@@ -1428,10 +1428,6 @@@@ SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHL
 COPTS+=	${${ACTIVE_CC} == "clang":? -Wa,-Av8plus  :}
 .endif

-.if ${MACHINE_ARCH} == "vax"
-COPTS.nir.c += -O1
-.endif
-
 COPTS.u_atomic.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-builtin-declaration-mismatch :}

 .include <bsd.lib.mk>
diff --git a/external/mit/xorg/lib/libX11/Makefile.libx11 b/external/mit/xorg/lib/libX11/Makefile.libx11
index e103d9ace12..0e55c2a4732 100644
--- a/external/mit/xorg/lib/libX11/Makefile.libx11
+++ b/external/mit/xorg/lib/libX11/Makefile.libx11
@@@@ -471,11 +471,6 @@@@ COPTS.OpenDis.c+=	-Wno-error	# XXX xf86bigfstr.h
 COPTS.XlibInt.c+=	-Wno-error	# XXX xcmiscstr.h
 COPTS.XKBBind.c+=	-Wno-deprecated-declarations	# uses XKeycodeToKeysym

-# XXX
-.if ${MACHINE} == "vax"
-COPTS.lcWrap.c+=	-O0
-.endif
-
 CWARNFLAGS.clang+=	-Wno-string-plus-int

 .include "${NETBSDSRCDIR}/external/mit/xorg/tools/makekeys/Makefile.makekeys"
diff --git a/games/gomoku/Makefile b/games/gomoku/Makefile
index e86a63aaea7..678537066ed 100644
--- a/games/gomoku/Makefile
+++ b/games/gomoku/Makefile
@@@@ -9,10 +9,6 @@@@ LDADD=	-lcurses -lterminfo
 HIDEGAME=hidegame
 CPPFLAGS+=	${DEBUG:D-DDEBUG}

-.if ${MACHINE} == "vax"
-COPTS.pickmove.c += -O0
-.endif
-
 #WARNS=		6	# would produce warnings about small integer types
 LINTFLAGS+=	-w	# treat warnings as errors
 LINTFLAGS+=	-T	# strict bool mode
diff --git a/games/phantasia/Makefile b/games/phantasia/Makefile
index e9c53f23ae5..b919dac17c6 100644
--- a/games/phantasia/Makefile
+++ b/games/phantasia/Makefile
@@@@ -52,7 +52,3 @@@@ map: map.c
 	./map | plot > /dev/tty

 .include <bsd.prog.mk>
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.misc.c+=	-O0
-.endif
diff --git a/lib/i18n_module/UTF7/Makefile b/lib/i18n_module/UTF7/Makefile
index 712c1515d42..7136f7f0cc3 100644
--- a/lib/i18n_module/UTF7/Makefile
+++ b/lib/i18n_module/UTF7/Makefile
@@@@ -3,6 +3,3 @@@@
 SRCPRE=citrus_
 .include <bsd.lib.mk>

-.if ${MACHINE_ARCH} == "vax" && defined(HAVE_GCC)
-COPTS.citrus_utf7.c+=	-O0
-.endif
diff --git a/lib/libbz2/Makefile b/lib/libbz2/Makefile
index b2aea1e04b0..e60a2862d48 100644
--- a/lib/libbz2/Makefile
+++ b/lib/libbz2/Makefile
@@@@ -15,11 +15,6 @@@@ SRCS=		blocksort.c huffman.c crctable.c randtable.c compress.c \
 INCS=		bzlib.h
 INCSDIR=	/usr/include

-# XXX huffman.c gets mis-compiled with 2.95.3
-.if ${MACHINE_ARCH} == "vax"
-COPTS+=		-O0
-.endif
-
 COPTS+=		${CC_WNO_IMPLICIT_FALLTHROUGH}

 # XXX blocksort.c gets mis-compiled with 4.1
diff --git a/lib/libc/gdtoa/Makefile.inc b/lib/libc/gdtoa/Makefile.inc
index 132686fc33d..609da919803 100644
--- a/lib/libc/gdtoa/Makefile.inc
+++ b/lib/libc/gdtoa/Makefile.inc
@@@@ -44,10 +44,3 @@@@ SRCS+=	dmisc.c \
 .if ${MACHINE_ARCH} != "vax"
 SRCS+=	strtord.c
 .endif
-
-# XXX revisit with newer GCC.
-# Ensure numbers like 0xffff319f5fa95963 print correctly
-# ("999999999999999.98", not garbage like "?A>C>@@>C:BA;A><.:<")
-.if ${MACHINE_ARCH} == "vax" && defined(HAVE_GCC)
-COPTS.misc.c+=	-O0
-.endif
diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile
index cb3f89d6d09..e9c8be820da 100644
--- a/lib/libcrypt/Makefile
+++ b/lib/libcrypt/Makefile
@@@@ -30,9 +30,6 @@@@ SRCS+=		crypt-argon2.c
 SRCS+=		${src}
 COPTS.${src}+=	-fvisibility=hidden
 .  endfor
-.  if ${MACHINE} == "vax"
-COPTS.blake2b.c+=	-O0
-.  endif
 .endif

 WARNS?=	5
diff --git a/libexec/ld.elf_so/Makefile b/libexec/ld.elf_so/Makefile
index f5baae1e883..24f7e1121e5 100644
--- a/libexec/ld.elf_so/Makefile
+++ b/libexec/ld.elf_so/Makefile
@@@@ -141,10 +141,6 @@@@ CPPFLAGS+=	-DRTLD_DEFAULT_LIBRARY_PATH=\"${SHLIBDIR}:${LIBDIR}\"
 COPTS.rtld.c+=	-Wno-stack-protector
 COPTS.symbol.c+=-Wno-stack-protector

-.if ${MACHINE_CPU} == "vax"
-COPTS.rtld.c+=	-O0
-.endif
-
 LDADD+=		-Wl,--version-script=${.CURDIR}/symbols.map
 LDADD+=		-L${CLIBOBJ} -L${DESTDIR}${LIBDIR}
 .if ${MKPICLIB} != "no"
diff --git a/sbin/fsck_ffs/Makefile.common b/sbin/fsck_ffs/Makefile.common
index 765638b2801..824e3bf2628 100644
--- a/sbin/fsck_ffs/Makefile.common
+++ b/sbin/fsck_ffs/Makefile.common
@@@@ -36,7 +36,3 @@@@ COPTS.ffs_appleufs.c+=	-Wno-pointer-sign
 .if ${MACHINE_ARCH} == "m68000"
 COPTS.pass1.c+=	-fno-tree-fre -fno-tree-lrs
 .endif
-.if ${MACHINE_ARCH} == "vax"
-COPTS.pass1.c+=	-O0
-COPTS.inode.c+=	-O0
-.endif
diff --git a/sbin/fsdb/Makefile b/sbin/fsdb/Makefile
index c039f73a1eb..3b0331e5880 100644
--- a/sbin/fsdb/Makefile
+++ b/sbin/fsdb/Makefile
@@@@ -39,12 +39,6 @@@@ COPTS.${f}.c+=	-Wno-pointer-sign
 COPTS.pass1.c+=	-fno-tree-fre -fno-tree-lrs
 .endif

-.if ${MACHINE_ARCH} == "vax"
-COPTS.pass1.c+=	-O0
-COPTS.inode.c+=	-O0
-COPTS.fsdb.c+=	-O0
-.endif
-
 CWARNFLAGS.gcc+=	${CC_WNO_ADDRESS_OF_PACKED_MEMBER}

 .include <bsd.prog.mk>
diff --git a/sbin/newfs_ext2fs/Makefile b/sbin/newfs_ext2fs/Makefile
index 40a44b9a038..ecfdbff4d3a 100644
--- a/sbin/newfs_ext2fs/Makefile
+++ b/sbin/newfs_ext2fs/Makefile
@@@@ -20,8 +20,4 @@@@ DPADD+=${LIBPROP}

 .PATH:	${NETBSDSRCDIR}/sys/ufs/ext2fs ${FSCK}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.mke2fs.c=-O0
-.endif
-
 .include <bsd.prog.mk>
diff --git a/sbin/ping/Makefile b/sbin/ping/Makefile
index 4f33501ea7a..1f7f56e3ea5 100644
--- a/sbin/ping/Makefile
+++ b/sbin/ping/Makefile
@@@@ -12,8 +12,4 @@@@ CPPFLAGS+=	-DIPSEC
 LDADD+= -lipsec
 DPADD+= ${LIBIPSEC}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.ping.c=-O0
-.endif
-
 .include <bsd.prog.mk>
diff --git a/sys/arch/vax/conf/Makefile.vax b/sys/arch/vax/conf/Makefile.vax
index cf095d54a86..c483eaa644a 100644
--- a/sys/arch/vax/conf/Makefile.vax
+++ b/sys/arch/vax/conf/Makefile.vax
@@@@ -34,7 +34,6 @@@@ GENASSYM_CONF=	${VAX}/vax/genassym.cf
 CPPFLAGS+=	-D_VAX_INLINE_
 AFLAGS+=	-x assembler-with-cpp -fno-pic
 CFLAGS+=	-fno-pic
-COPTS.wsmux.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -O1 :}


 ##
diff --git a/sys/lib/libsa/Makefile b/sys/lib/libsa/Makefile
index 718c97ce857..4ef3840c753 100644
--- a/sys/lib/libsa/Makefile
+++ b/sys/lib/libsa/Makefile
@@@@ -96,7 +96,3 @@@@ SRCS+=	ufs.c
 lib${LIB}.o:: ${OBJS:O} __buildstdlib

 CPPFLAGS+=	-Wno-pointer-sign
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.bootp.c+=	-O0
-.endif
diff --git a/sys/lib/libz/Makefile b/sys/lib/libz/Makefile
index 6945c0da6c6..61fb7d4f652 100644
--- a/sys/lib/libz/Makefile
+++ b/sys/lib/libz/Makefile
@@@@ -25,7 +25,3 @@@@ CLEANFILES+= lib${LIB}.o
 .include <bsd.lib.mk>

 lib${LIB}.o:: ${OBJS:O} __buildstdlib
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.inftrees.c+=	-O0
-.endif
diff --git a/sys/modules/lfs/Makefile b/sys/modules/lfs/Makefile
index 962538821a5..ea8f187e160 100644
--- a/sys/modules/lfs/Makefile
+++ b/sys/modules/lfs/Makefile
@@@@ -18,9 +18,4 @@@@ SRCS+=	ulfs_bmap.c ulfs_dirhash.c ulfs_inode.c ulfs_lookup.c \

 WARNS=	3

-.if ${MACHINE} == "vax"
-# GCC 6.5 and 7.4 cannot compile this with -DDIAGNOSTIC and -O2/-O1
-COPTS.lfs_inode.c+=	-O0
-.endif
-
 .include <bsd.kmodule.mk>
diff --git a/sys/rump/fs/lib/liblfs/Makefile b/sys/rump/fs/lib/liblfs/Makefile
index abade3767d9..68b74c62502 100644
--- a/sys/rump/fs/lib/liblfs/Makefile
+++ b/sys/rump/fs/lib/liblfs/Makefile
@@@@ -17,9 +17,6 @@@@ SRCS+=	ulfs_bmap.c ulfs_dirhash.c ulfs_extattr.c 			\


 CFLAGS+=        -DLFS_KERNEL_RFW
-.if ${MACHINE_ARCH} == "vax"
-COPTS.lfs_inode.c+=-O0
-.endif

 .include <bsd.lib.mk>
 .include <bsd.klinks.mk>
diff --git a/usr.sbin/mtrace/Makefile b/usr.sbin/mtrace/Makefile
index aef09db6198..9c125c15265 100644
--- a/usr.sbin/mtrace/Makefile
+++ b/usr.sbin/mtrace/Makefile
@@@@ -12,10 +12,6 @@@@ PROG=	mtrace
 SRCS=	igmp.c inet.c kern.c mtrace.c
 MAN=	mtrace.8

-.if ${MACHINE_ARCH} == "vax"
-COPTS.mtrace.c=-O0
-.endif
-
 BINMODE=4555
 BINOWN= root

diff --git a/external/gpl3/gcc.old/usr.bin/backend/Makefile b/external/gpl3/gcc.old/usr.bin/backend/Makefile
index d69a26fe619..99e881c783d 100644
--- a/external/gpl3/gcc.old/usr.bin/backend/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/backend/Makefile
@@@@ -533,68 +533,9 @@@@ COPTS.insn-recog.c+=-Wno-error

 .if ${GCC_MACHINE_ARCH} == "vax"
 CPPFLAGS+=-I${.CURDIR}/../../lib/libgcc/libgcov/arch/${GCC_MACHINE_ARCH}
-COPTS.builtins.c+=-O0
-COPTS.calls.c+=-O0
-COPTS.convert.c+=-O0
-COPTS.data-streamer-out.c+=-O0
-COPTS.dse.c+=-O0					# XXX port-vax/51967
-COPTS.dwarf2out.c+=-O0
-COPTS.expmed.c+=-O0
-COPTS.expr.c+=-O0 -Wno-error=tautological-compare
-COPTS.fixed-value.c+=-O0
-COPTS.fold-const.c+=-O0
-COPTS.generic-match.c+=-O0
-COPTS.gimple-fold.c+=-O0
-COPTS.gimple-match.c+=-O0
-COPTS.gimple-ssa-strength-reduction.c+=-O0
-COPTS.gimple-ssa-warn-restrict.c+=-O0
-COPTS.gimple.c+=-O0
-COPTS.internal-fn.c+=-O0
-COPTS.lto-streamer-out.c+=-O0
-COPTS.omp-low.c+=-O0
-COPTS.predict.c+=-O0
-COPTS.range-op.cc+=-O0
-COPTS.recog.c+=-O0
-COPTS.sanopt.c+=-O0
-COPTS.stmt.c+=-O0
-COPTS.stor-layout.c+=-O0
-COPTS.targhooks.c+=-O0
-COPTS.tree-affine.c+=-O0
-COPTS.tree-cfg.c+=-O0
-COPTS.tree-data-ref.c+=-O0
-COPTS.tree-eh.c+=-O0
-COPTS.tree-if-conv.c+=-O0
-COPTS.tree-object-size.c+=-O0
-COPTS.tree-parloops.c+=-O0
-COPTS.tree-predcom.c+=-O0
-COPTS.tree-pretty-print.c+=-O0
-COPTS.tree-ssa-alias.c+=-O0
-COPTS.tree-ssa-ccp.c+=-O0
-COPTS.tree-ssa-forwprop.c+=-O0
-COPTS.tree-ssa-loop-ivopts.c+=-O0
-COPTS.tree-ssa-loop-manip.c+=-O0
-COPTS.tree-ssa-loop-niter.c+=-O0
-COPTS.tree-ssa-math-opts.c+=-O0
-COPTS.tree-ssa-phiopt.c+= -O0
-COPTS.tree-ssa-pre.c+=-O0
-COPTS.tree-ssa-reassoc.c+=-O0
-COPTS.tree-ssa-strlen.c+=-O0
-COPTS.tree-ssa-uninit.c+=-O0
-COPTS.tree-ssa.c+=-O0
-COPTS.tree-switch-conversion.c+=-O0
-COPTS.tree-vect-data-refs.c+=-O0
-COPTS.tree-vect-loop-manip.c+=-O0
-COPTS.tree-vect-loop.c+=-O0
-COPTS.tree-vect-patterns.c+=-O0
-COPTS.tree-vect-stmts.c+=-O0
-COPTS.tree-vrp.c+=-O0
-COPTS.tree.c+=-O0
-COPTS.ubsan.c+=-O0
-COPTS.varasm.c+=-O0
-COPTS.vr-values.c+=-O0
-COPTS.web.c+=-O0
-COPTS.wide-int-range.cc+=-O0
-COPTS.wide-int.cc+=-O0
+
+COPTS.expmed.c+=-Wno-error=tautological-compare
+COPTS.expr.c+=-Wno-error=tautological-compare
 .else
 COPTS.tree.c=	${${ACTIVE_CC} == "clang" :? -O0 :}
 .endif
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.50 2023/07/16 22:20:54 rjs Exp $
d31 2
a300 1
	os_misc.c \
@


1.50
log
@Make most of MesaLib build.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.49 2023/02/07 06:19:03 mrg Exp $
a1430 4
.if ${MACHINE_ARCH} == "vax"
COPTS.nir.c += -O1
.endif

@


1.49
log
@apply -g1 to the gallium sources as well.  saves another couple of 100MB.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.48 2021/07/11 20:52:06 mrg Exp $
d33 2
a34 2
CXXFLAGS+=	-g1
CFLAGS+=	-g1
d55 1
d67 1
a67 1
	state_trackers/dri
d70 1
a70 1
	state_trackers/vdpau
d83 1
d91 8
d112 2
d116 2
d155 6
d185 1
a194 1
	draw_pt_fetch_emit.c \
d201 1
d270 3
a301 1
	u_blit.c \
d304 1
a304 2
	u_debug.c \
	u_debug_describe.c \
a305 1
	u_debug_gallium.c \
a306 4
	u_debug_memory.c \
	u_debug_refcnt.c \
	u_debug_stack.c \
	u_debug_symbol.c \
d310 1
a312 10
	u_format.c \
	u_format_bptc.c \
	u_format_etc.c \
	u_format_latc.c \
	u_format_other.c \
	u_format_rgtc.c \
	u_format_s3tc.c \
	u_format_tests.c \
	u_format_yuv.c \
	u_format_zs.c \
a315 1
	u_hash_table.c \
a316 1
	u_idalloc.c \
d319 1
a320 1
	u_mm.c \
a325 1
	u_ringbuffer.c \
d329 1
a331 1
	u_surfaces.c \
d335 1
d340 2
a341 1
	u_vbuf.c
d343 3
d370 2
a371 2
	u_unfilled_gen.c \
	u_format_table.c
d375 3
d393 1
d406 1
d409 2
d431 1
d476 1
d500 89
d614 2
d633 1
d671 41
d775 2
a776 1
	cik_sdma.c \
d783 1
a785 2
	si_dma.c \
	si_dma_cs.c \
d794 1
d796 7
d804 1
a804 3
	si_shader_tgsi_alu.c \
	si_shader_tgsi_mem.c \
	si_shader_tgsi_setup.c \
d806 1
d809 6
a814 1
	si_state_draw.c \
d819 1
a819 1
	si_test_dma.c \
d824 15
d848 1
a848 1
.for _f in ${GALLIUM_SOURCES.drivers/r600} ${GALLIUM_SOURCES.drivers/r600/sb} ${GALLIUM_SOURCES.drivers/radeonsi}
d853 1
d859 1
d929 1
d937 1
d944 1
d947 1
a979 1

d1007 3
d1012 1
a1012 1
GALLIUM_SOURCES.state_trackers/vdpau = \
d1034 1
d1039 4
d1048 3
d1056 1
d1059 1
d1064 1
d1067 4
d1077 1
d1131 1
a1131 1
GALLIUM_SOURCES.state_trackers/dri = \
a1138 3
.for _f in ${GALLIUM_SOURCES.state_trackers/dri}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/state_trackers/dri/common
.endfor
d1173 6
d1213 1
d1339 3
d1361 1
a1361 1
	-I${X11SRCDIR.Mesa}/src/gallium/state_trackers/dri \
d1378 10
@


1.48
log
@xorg/lib stuff to enable mesa.old, prepare for new mesa

- rename OLD_PREFIX to OLD_SUFFIX, since it is
- include mesa-which.mk and use ${OLD_SUFFIX} in several places
- remove mesa < 18 support
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.47 2021/05/30 01:57:00 joerg Exp $
d31 6
@


1.48.2.1
log
@Pull up following revision(s) (requested by mrg in ticket #81):

	external/gpl3/gdb.old/Makefile.inc: revision 1.12
	share/mk/bsd.lib.mk: revision 1.390
	external/gpl3/gdb/Makefile.inc: revision 1.13
	external/mit/xorg/lib/gallium.old/Makefile: revision 1.5
	external/mit/xorg/lib/gallium/Makefile: revision 1.49

fix code attempting to skip adding "-g" if "-g*" already is used.

in bsd.lib.mk there's a check for "MKDEBUG != no" that will add
-g to CFLAGS (maybe) and to CSHLIBFLAGS (always), given that it
isn't in CFLAGS already.. except the conditional is "||" instead
of "&&" and since the MKDEBUG/NODEBUG checks pass, the CFLAGS
check isn't even performed.

additionally, check CXXFLAGS as well as CFLAGS.

this fixes the attempt to use "-g1" in the llvmrt build, which
fails because the compile lines end up being "... -g1 .. -g ..",
(the "-g" comes from the CSHLIBFLAGS variable in that case.)
this reduces the size of llvm-enabled gallium debug by ~1.5GiB
on amd64.

apply -g1 to the gallium sources as well.  saves another couple of 100MB.

apply -g1 to the gdb build as well.
reduces the size of gdb.debug and gdbtui.debug by 100MB each on amd64,
and about 70MB total in the debug set.  (across all builds, this may
be in the order of 3-4GB in releasedir output.)
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.48 2021/07/11 20:52:06 mrg Exp $
a30 6
# Reduce debugging for these extremely large objects.
.if ${MKDEBUG:Uno} != "no"
CXXFLAGS+=	-g1
CFLAGS+=	-g1
.endif

@


1.48.2.2
log
@Pull up following revision(s) (requested by rin in ticket #394):

	external/gpl3/binutils/dist/gas/config/tc-vax.h: revision 1.10
	tools/gcc/Makefile: revision 1.109
	external/gpl3/binutils/dist/gas/config/tc-vax.c: revision 1.16
	external/gpl3/binutils/dist/gas/config/tc-vax.c: revision 1.17
	external/gpl3/binutils/dist/gas/config/tc-vax.c: revision 1.18
	external/gpl3/gcc.old/dist/gcc/recog.c: revision 1.12
	external/gpl3/gcc.old/dist/gcc/function.c: revision 1.16
	external/gpl3/gcc.old/dist/gcc/dse.c: revision 1.14 - 1.16
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.13
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.14
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.15
	external/gpl3/gcc.old/dist/gcc/doc/tm.texi.in: revision 1.10
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.16
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.17
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.18
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.19
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.12
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.13
	external/gpl3/gcc.old/usr.bin/backend/Makefile: revision 1.20
	external/gpl3/gcc.old/dist/gcc/targhooks.c: revision 1.12
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.14
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.15
	external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md: revision 1.12
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.16
	external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md: revision 1.13
	external/gpl3/gcc.old/dist/gcc/doc/tm.texi: revision 1.12
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.17
	external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.18
	external/gpl3/gcc.old/dist/gcc/config/vax/elf.h: revision 1.12
	external/gpl3/gcc.old/dist/gcc/config/vax/elf.h: revision 1.13
	external/gpl3/gcc.old/dist/gcc/targhooks.h: revision 1.12
	external/gpl3/gcc.old/dist/gcc/target.def: revision 1.10
	external/gpl3/gcc.old/dist/gcc/rtlanal.c: revision 1.14
	external/gpl3/gcc.old/dist/gcc/reload.c: revision 1.12
	external/gpl3/gcc.old/usr.bin/gcc/Makefile: revision 1.11
	external/gpl3/gcc.old/usr.bin/lto-dump/Makefile: revision 1.3
	external/gpl3/gcc.old/lib/Makefile.sanitizer: revision 1.7
	external/gpl3/binutils.old/lib/libbfd/Makefile: revision 1.10
	distrib/utils/x_ping/Makefile: revision 1.9
	games/phantasia/Makefile: revision 1.38
	external/apache2/argon2/lib/libargon2/Makefile.inc: revision 1.2
	external/gpl3/gcc.old/lib/libubsan/Makefile: revision 1.8
	external/bsd/mdocml/lib/libmandoc/Makefile: revision 1.13
	sbin/ping/Makefile: revision 1.18
	sbin/newfs_ext2fs/Makefile: revision 1.7
	sys/lib/libz/Makefile: revision 1.24
	sys/lib/libsa/Makefile: revision 1.97
	external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile: revision 1.3
	external/gpl3/gdb/lib/libgdb/Makefile: revision 1.36
	sys/modules/lfs/Makefile: revision 1.11
	external/mit/xorg/lib/gallium/Makefile: revision 1.51
	external/gpl3/gdb.old/lib/libdecnumber/Makefile: revision 1.10
	external/mit/xorg/lib/libX11/Makefile.libx11: revision 1.26
	libexec/ld.elf_so/Makefile: revision 1.148
	external/bsd/jemalloc/lib/Makefile.inc: revision 1.16
	external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile: revision 1.14
	crypto/external/bsd/openssh/lib/Makefile: revision 1.38
	external/gpl3/gcc.old/usr.bin/backend/Makefile: revision 1.21
	external/gpl3/gcc.old/usr.bin/cc1/Makefile: revision 1.12
	external/gpl3/gcc.old/lib/libasan/Makefile: revision 1.11
	external/gpl3/gcc.old/usr.bin/cc1plus/Makefile: revision 1.13
	lib/libcrypt/Makefile: revision 1.36
	external/gpl3/gdb/lib/libdecnumber/Makefile: revision 1.5
	lib/libc/gdtoa/Makefile.inc: revision 1.13
	games/gomoku/Makefile: revision 1.13
	sbin/fsdb/Makefile: revision 1.43
	external/gpl3/gcc.old/usr.bin/lto1/Makefile: revision 1.9
	external/mit/xorg/lib/gallium.old/Makefile: revision 1.8
	lib/libbz2/Makefile: revision 1.22
	external/gpl3/gcc.old/usr.bin/cc1obj/Makefile: revision 1.12
	usr.sbin/mtrace/Makefile: revision 1.14
	external/gpl3/gcc.old/usr.bin/cc1obj/Makefile: revision 1.13
	sys/arch/vax/conf/Makefile.vax: revision 1.86
	sys/rump/fs/lib/liblfs/Makefile: revision 1.18
	sbin/fsck_ffs/Makefile.common: revision 1.3
	external/gpl3/binutils/lib/libbfd/Makefile: revision 1.27
	lib/i18n_module/UTF7/Makefile: revision 1.5
	external/gpl3/gcc.old/lib/liblsan/Makefile: revision 1.7
	doc/CHANGES (apply patch)
	(all external/gpl3/gcc.old/ changes applied to external/gpl3/gcc/)

PR 57646: Import major vax toolchain fix.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.48.2.1 2023/02/14 15:47:01 martin Exp $
d1211 4
@


1.47
log
@Update LLVM build system for 249b40b558955afe5ac2b549edcf2d7f859c8cc9

This enables the use of modules for a significant build performance gain
when building with clang as host compiler or when using HAVE_LLVM=yes.
Switch libc++ to using the copy from the mono-repo.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.46 2021/04/13 04:59:00 mrg Exp $
d10 2
d975 1
a975 1
LIBDPLIBS+= 	glapi		${.CURDIR}/../libglapi
@


1.46
log
@apply some -Wno- to ignore several new warnings with GCC 10.


ntp: ignore truncation beyond api sizes, and ignore wrongly
guessed underflow

tmux: ignore maybe uninitialised warning for impossible case

libbfd: signed/unsigned variables assigned in the same statement

dri/gallium: -Wno-builtin-declaration-mismatch for u_atomic.c as
it implements backend functions with different in-C-machine but
same-in-real-machine types

libXfont/libXfont2: signed/unsigned variables assigned in the same
statement

i915drm: ignore impossible maybe uninitialised warnings

sysinst: ignore an invalid string truncation issue
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.45 2021/02/23 15:16:43 joerg Exp $
a985 2
		TransformsCoroutines \
		Passes \
d988 3
d1010 1
a1010 2
		X86TargetInfo \
		X86Utils
d1052 3
d1073 2
d1081 1
a1087 1
		TransformsUtils \
@


1.46.2.1
log
@sync with head
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.47 2021/05/30 01:57:00 joerg Exp $
d986 2
a989 3
		ExecutionEngineOrcTargetProcess \
		ExecutionEngineOrcShared \
		Orc \
d1009 2
a1010 1
		X86TargetInfo
a1051 3
		Passes \
		TransformsCoroutines \
		ObjCARC \
a1069 2
		BitWriter \
		FrontendOpenMP \
a1075 1
		TransformsUtils \
d1082 1
@


1.45
log
@Don't hard-code LLVM version, but pick it up from build glue.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.44 2020/04/04 03:04:58 christos Exp $
d1202 2
@


1.44
log
@Add all the dependent libraries and sort
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.43 2020/01/31 21:13:40 jmcneill Exp $
d1117 2
a1118 2
CPPFLAGS.r600_pipe_common.c+=	-DMESA_LLVM_VERSION_STRING=\"9.0.0\"
CPPFLAGS.si_get.c+=	-DMESA_LLVM_VERSION_STRING=\"9.0.0\"
@


1.43
log
@Bump MESA_LLVM_VERSION_STRING
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.42 2020/01/31 20:56:03 jmcneill Exp $
a27 1
LIBDPLIBS+=	pthread		${.CURDIR}/../../../../../lib/libpthread
a954 1
LIBDPLIBS+=	pthread		${.CURDIR}/../../../../../lib/libpthread
d957 3
a959 1
LIBDPLIBS+=	m		${.CURDIR}/../../../../../lib/libm
d976 3
d980 1
a980 3
LIBDPLIBS+=	execinfo	${.CURDIR}/../../../../../lib/libexecinfo
LIBDPLIBS+=	X11-xcb         ${.CURDIR}/../libX11/libX11-xcb
LIBDPLIBS+=	xcb-dri2        ${.CURDIR}/../libxcb/dri2
@


1.42
log
@Build radeonsi driver.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.41 2020/01/19 00:58:14 jmcneill Exp $
d1116 2
a1117 2
CPPFLAGS.r600_pipe_common.c+=	-DMESA_LLVM_VERSION_STRING=\"7.0.0\"
CPPFLAGS.si_get.c+=	-DMESA_LLVM_VERSION_STRING=\"7.0.0\"
@


1.41
log
@Build radeon and nouveau drivers on evbarm.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.40 2019/11/20 06:23:31 martin Exp $
d121 1
a121 1
DRIVERS+=		r600 r300
@


1.40
log
@Restrict -Wl,-z,defs to x86 and aarch64 for now to avoid global build
lossage. Suggested by mrg.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.39 2019/11/19 08:59:18 martin Exp $
d97 3
a102 3
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE} == "evbarm"
BUILD_NOUVEAU=1
@


1.39
log
@Looks like this requires pthread.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.38 2019/11/18 22:26:15 joerg Exp $
d1089 4
a1092 1
LDFLAGS+=	-Wl,--version-script=${X11SRCDIR.Mesa}/src/gallium/targets/dri/dri.sym -Wl,-z,defs
@


1.38
log
@Build some more LLVM components for Gallium. Switch it to -Wl,-z,defs
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.37 2019/11/11 22:45:26 joerg Exp $
d26 4
@


1.37
log
@Update LLVM to 10.0.0git (01f3a59fb3e2542fce74c768718f594d0debd0da)
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.36 2019/10/28 18:38:54 christos Exp $
d1052 1
d1057 1
d1060 2
d1073 2
d1078 2
a1079 1
		Support
d1085 1
a1085 1
LDFLAGS+=	-Wl,--version-script=${X11SRCDIR.Mesa}/src/gallium/targets/dri/dri.sym
@


1.36
log
@another vax optimizer hack.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.35 2019/09/24 19:29:41 maya Exp $
d16 1
a16 1
LLVM_INCLUDE_OBJDIR!=	cd ${NETBSDSRCDIR}/external/bsd/llvm/include && ${PRINTOBJDIR}
d18 1
a18 1
CWARNFLAGS.clang += -Wno-atomic-alignment -Wno-unknown-warning-option
d20 1
a20 1
CXXFLAGS+=	-std=c++11
d23 2
a24 2
		-I${NETBSDSRCDIR}/external/bsd/llvm/dist/llvm/include \
		-I${LLVM_INCLUDE_OBJDIR} -I${NETBSDSRCDIR}/external/bsd/llvm/config
a990 1
		AMDGPUAsmPrinter \
a1003 1
		X86AsmPrinter \
a1013 1
		AArch64AsmPrinter \
a1024 1
		ARMAsmPrinter \
a1033 1
		MipsAsmPrinter \
d1043 1
a1043 2
		PowerPCAsmParser \
		PowerPCAsmPrinter
d1074 1
a1074 1
.include "${NETBSDSRCDIR}/external/bsd/llvm/link.mk"
@


1.35
log
@Update build logic for mesa 19.1.7.

A lot of files are now living outside of dist, since they're not in the
distributed sources: they're generated, usually by python/meson.

The remaining changes are due to files being moved around.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.34 2019/07/07 17:50:34 mrg Exp $
d1189 3
@


1.34
log
@re-add arm64 to the list of llvm-ok platforms.  fixes gallium_dri.so:

swrast_dri.so: Undefined symbol "lp_native_vector_width" (symnum = 388))
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.33 2019/06/19 05:17:05 mrg Exp $
d207 2
a208 1
			-I${X11SRCDIR.Mesa}/src/loader
a212 2
	pb_buffer_malloc.c \
	pb_bufmgr_alt.c \
a215 2
	pb_bufmgr_ondemand.c \
	pb_bufmgr_pool.c \
d329 2
a371 1
	lp_bld_format_cached.c \
d375 1
a474 2
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/r600/r600_perfcounter.c r600_r600_perfcounter.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/r600_perfcounter.c radeon_r600_perfcounter.c
a484 1
	radeon_r600_perfcounter.c \
d501 1
a501 1
	r600_r600_perfcounter.c \
d662 1
d735 2
d738 3
d743 2
d746 1
a753 5
	nv50_ir_emit_gk110.cpp \
	nv50_ir_emit_gm107.cpp \
	nv50_ir_emit_nvc0.cpp \
	nv50_ir_lowering_gm107.cpp \
	nv50_ir_lowering_nvc0.cpp \
d1108 3
d1131 2
@


1.33
log
@allow all arm platforms, not just evbarm, to build with MKLLVMRT.
allow mips and powerpc platforms as well.

amusingly, this allows my shark to finally have functional
if not usable GL :-)  glxgears gets 1fps.

status:
- arm32 and ppc have llvm dynamic linker patches.
- ppc is not yet working.
- mips untested.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.32 2019/06/09 01:56:49 mrg Exp $
d106 1
@


1.32
log
@add ARMDisassembler for the arm section.  fixes linkage issue.

unfortunately, this doesn't work.  something generates code
with an R_ARM_REL32 relocation and the
llvm::RuntimeDyldELF::resolveARMRelocation() function doesn not
support this and boom:

500       switch (Type) {
501       default:
502         llvm_unreachable("Not implemented relocation type!");
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.31 2019/06/07 12:11:43 mrg Exp $
d100 9
a1009 1
# XXX duplicates
a1020 1
# XXX duplicates
d1031 20
@


1.31
log
@allow building arm llvmpipe.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.30 2019/06/07 06:00:05 mrg Exp $
d1016 1
@


1.30
log
@put BUILD_LLVMPIPE and it's MKLLVMRT conditional inside the x86 + evbarm
section, so that arm* can build llvmpipe.

the default for arm* and MKLLVMRT remains "no", and for arm64 it does not
actually work yet (faults in "dc cvau", but i don't know why yet).

NFCI.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.29 2019/06/02 11:35:55 mrg Exp $
d1012 11
@


1.29
log
@fix building x86 with X11 but not LLVM:

- change the defaults for MKLLVMRT and MKX11 so we don't have to
  force-override later.  this makes "build.sh -V MKLLVMRT=no"
  work to disable building the LLVM Mesa components.

- in gallium, don't BUILD_RADEON if MKLLVMRT is no.

this stops GL from working, but basic X seems OK enough for Xvideo
to still work on modern radeon (ie, video mostly works fine, though
eg, "mpv -vo gpu" won't.  use "mpv -vo xv".)
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.28 2019/05/30 23:15:46 maya Exp $
d93 1
a93 1
.if ${MKLLVMRT} != "no"
d95 1
a95 2
BUILD_LLVMPIPE=1
.endif
d100 3
d999 13
d1094 1
d1100 1
@


1.28
log
@Add libraries to resolve missing xcb symbols
Fixes executing 'emulators/nestopia' on r600, reported by nia, thanks!

XXX we might want to get rid of the references instead.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.27 2019/05/16 01:22:35 christos Exp $
a91 1
BUILD_RADEON=1
d94 1
@


1.27
log
@Fix MKCOMPATX11 build
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.26 2019/05/11 17:44:16 christos Exp $
d962 2
@


1.26
log
@elide clang warnings
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.25 2019/04/16 17:29:09 christos Exp $
d1048 2
a1049 3
.if ${MACHINE} == "i386"
CPPFLAGS+=	-march=i586
.endif
@


1.25
log
@Ran out of patience playing stack protector bingo.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.24 2019/04/12 17:43:25 christos Exp $
d18 2
@


1.24
log
@more stack protector (arm32)
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.23 2019/04/10 20:32:56 joerg Exp $
d1107 2
a1123 18
.for f in \
	decode.c \
	dd_context.c \
	draw.c \
	nir_from_ssa.c \
	nir_inline_functions.c \
	nir_instr_set.c \
	nir_instr_set.c \
	nir_liveness.c \
	nir_lower_registers_to_ssa.c \
	nir_lower_regs_to_ssa.c \
	nir_lower_vars_to_ssa.c \
	nir_phi_builder.c \
	shaderapi.c \
	spirv_to_nir.c \
	vtn_cfg.c
COPTS.${f}+=-Wno-error=stack-protector
.endfor
@


1.23
log
@Extend LLVM link.mk to handle librt. Use it in Gallium.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.20 2019/04/03 15:26:34 joerg Exp $
d1123 1
d1133 1
@


1.22
log
@Fix stack protector build.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.21 2019/04/07 05:28:09 rin Exp $
d964 1
a964 3
LLVM_LIB_DIR!=	cd ${.CURDIR}/../../../../../external/bsd/llvm/librt; ${PRINTOBJDIR}

LLVM_LIBS=	\
d972 1
a972 1
LLVM_LIBS+=	\
d983 1
a983 1
LLVM_LIBS+=	\
d993 1
a993 1
LLVM_LIBS+=	\
d1021 1
a1021 6
.for llvm_library in ${LLVM_LIBS}
dir!=	cd ${LLVM_LIB_DIR}/libLLVM${llvm_library}; ${PRINTOBJDIR}
lib=	${dir}/libLLVM${llvm_library}_pic.a
DPADD+=	${lib}
LDADD+=	${lib}
.endfor
@


1.21
log
@Handle objdir correctly.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.20 2019/04/03 15:26:34 joerg Exp $
d1129 17
@


1.20
log
@Use and enable MKLLVMRT for HAVE_MESA_VER=18.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.19 2019/03/10 10:51:58 mrg Exp $
d1024 4
a1027 2
DPADD+=	${LLVM_LIB_DIR}/libLLVM${llvm_library}/libLLVM${llvm_library}_pic.a
LDADD+=	${LLVM_LIB_DIR}/libLLVM${llvm_library}/libLLVM${llvm_library}_pic.a
@


1.19
log
@pull across most of the new build infrastruture for mesa18 from maya's
git tree.  this includes may of the changes from the changes below:


commit 52d85e74a1197aace38cc7acb705509e969120e6
Author: coypu <coypu@@sdf.org>
Date:   Mon Mar 4 12:25:33 2019 +0200

    Make 32bit archs happier.

    except i386, which now suffers from locked atomics because we
    don't have clever ifunc tricks in libc.

commit ee9b4c19c58127934ed3548ad0d68934cc95ccc7
Author: coypu <coypu@@sdf.org>
Date:   Mon Mar 4 09:08:35 2019 +0200

    Adjust includes, append rather than replace, appease clang ppc builds

commit a5341a3ad42572c78b6a2e6e5545bd323d7f2e4c
Author: coypu <coypu@@sdf.org>
Date:   Sun Mar 3 11:52:19 2019 +0200

    Resolve i386 atomic issue and set lists.

    XXX libGL in i386 is still causing issues
    XXX pkgconfig file for vdpau
    XXX set lists for arm32

commit 27bffc20bc15186c92cc5b8d5cc08d7299966b34
Author: coypu <coypu@@sdf.org>
Date:   Sat Mar 2 21:52:45 2019 +0200

    make llvm sources x86 specific

    hopefully not breaking non-x86 clang builds, which
    have MKLLVM set.

commit f9d34922619cc8f2a224c0138a73985e50daf87f
Author: coypu <coypu@@sdf.org>
Date:   Sat Mar 2 21:33:31 2019 +0200

    move hack to build llvm libraries soon enough.

    add u_process.c to libGL specifically (dri, gallium and libGL all need
    it).

    Add some missing includes for pipe-loader when it moved to gallium

commit 2b1083d0d538bb5d5dd88ab2ca0ca6c331e5dd5b
Author: coypu <coypu@@sdf.org>
Date:   Sat Mar 2 16:47:58 2019 +0200

    shuffle around:

    some files move from shared driver.mk/loader.mk into gallium.
    others move to shared.

    add i915 files.

    now i965 glxgears works (amd64).

commit 1897a90569b30b294bcbedadb3745092eca0bb33
Author: Maya Rashish <maya@@NetBSD.org>
Date:   Sun Feb 24 23:36:26 2019 +0200

    Progress towards glxgears on i915

commit 28c9c99a236404de41ae74e88ea6d9578c088b92
Author: Maya Rashish <maya@@NetBSD.org>
Date:   Sun Feb 24 21:55:56 2019 +0200

    rototill i965/i915 causing it to no longer startx.

    Now missing sw_screen_create in the dri driver.

commit 48eb746983a5a7967fba221e7b167808af36f44a
Author: Maya Rashish <maya@@NetBSD.org>
Date:   Sun Feb 24 09:31:22 2019 +0200

    More of vdpau. Cogs spin.

commit d9fbba8f61a43648d32f160c5fa62626788566ff
Author: Maya Rashish <maya@@NetBSD.org>
Date:   Sat Feb 23 22:36:37 2019 +0200

    Adjust for MesaLib 18.

    Build llvmpipe driver on x86 (the driver itself is x86-only).
    build llvm on all x86, even on GCC builds.
    galahad driver removed (upstream).
    Don't build mesa 7 at all.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.18 2019/03/10 02:29:52 mrg Exp $
d16 1
a16 2
LLVM_TOOLCONF_OBJDIR!=	cd ${NETBSDSRCDIR}/tools/llvm && ${PRINTOBJDIR}
LLVM_INCLUDE_OBJDIR!=	cd ${NETBSDSRCDIR}/tools/llvm-include && ${PRINTOBJDIR}
d22 1
a22 2
		-I${LLVM_TOOLCONF_OBJDIR}/config/include \
		-I${LLVM_INCLUDE_OBJDIR}
d92 1
a92 1
.if ${MKLLVM} == "yes"
d161 1
a161 1
.if ${MKLLVM:Uno} != "no"
d964 1
a964 1
LLVM_LIB_DIR!=	cd ${.CURDIR}/../../../../../external/bsd/llvm/lib; ${PRINTOBJDIR}
d1024 2
a1025 2
DPADD+=	${LLVM_LIB_DIR}/libLLVM${llvm_library}/libLLVM${llvm_library}.a
LDADD+=	${LLVM_LIB_DIR}/libLLVM${llvm_library}/libLLVM${llvm_library}.a
@


1.18
log
@move mesa10 build into .old scheme:

- add ${X11SRCDIR.MesaLib.old} and introduce ${X11SRCDIR.Mesa} as an
  alias for either the former or the non old.  this allows many of
  the makefiles to simply use ${X11SRCDIR.Mesa} (but does not really
  enable much sharing of makefiles, but reduces their diffs.)

- use mesa-which.mk to define ${OLD_PREFIX} to either "" or ".old",
  and to know if to build 'dri7' (.old only.)  ${OLD_PREFIX} is used
  by other code (eg, LIBDPLIBS) to pick the right subdir.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.17 2016/11/29 23:17:22 dholland Exp $
d16 3
d20 5
a24 1
CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/libdrm
d30 4
d36 1
d39 1
d42 1
a47 2
	drivers/galahad \
	drivers/identity \
a48 1
	drivers/trace \
a50 1
	winsys/sw/null \
d53 2
d57 7
d66 3
d71 6
a76 1
	winsys/radeon/drm
d88 3
d93 4
d100 1
d105 1
a105 1
DRIVERS+=		r600
d112 9
d126 1
a130 1
	draw_pipe.c \
d133 1
d162 9
d175 4
d184 14
a197 3
	os_misc.c \
	os_process.c \
	os_time.c
d208 2
d220 2
a221 2
	rbug_context.c \
	rbug_core.c \
d230 1
d234 2
d238 1
d240 1
d246 1
d255 6
d264 2
a269 8
	u_dump_defines.c \
	u_dump_state.c \
	u_bitmask.c \
	u_blit.c \
	u_blitter.c \
	u_cache.c \
	u_caps.c \
	u_cpu_detect.c \
d273 2
d276 3
d280 1
a280 1
	u_format_latc.c \
a281 3
	u_format_rgtc.c \
	u_format_etc.c \
	u_format_bptc.c \
a287 1
	u_hash.c \
d290 1
a291 1
	u_keymap.c \
d293 2
a294 1
	u_linkage.c \
d296 2
a297 2
	u_math.c \
	u_mm.c \
d299 1
d302 1
a303 3
	u_slab.c \
	u_snprintf.c \
	u_staging.c \
d307 1
d311 2
a312 1
	u_resource.c \
d315 2
d318 2
d321 3
a323 1
	vl_compositor.c \
d325 1
d327 1
a327 1
	vl_decoder.c \
a328 4
	vl_mpeg12_bitstream.c \
	vl_zscan.c \
	vl_idct.c \
	vl_mc.c \
d331 2
a332 1
	vl_deint_filter.c
d340 3
d345 45
a391 9
GALLIUM_SOURCES.drivers/galahad= \
	glhd_objects.c \
	glhd_context.c \
	glhd_screen.c

GALLIUM_SOURCES.drivers/identity = \
        id_objects.c \
        id_context.c \
        id_screen.c
d393 6
a398 1
GALLIUM_SOURCES.drivers/noop = \
d402 1
a402 1
GALLIUM_SOURCES.drivers/trace = \
d409 1
a409 1
GALLIUM_SOURCES.drivers/rbug = \
d415 4
a418 2
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/rbug/rbug_core.c    DRIVERrbug_core.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/rbug/rbug_context.c DRIVERrbug_context.c
d420 1
a420 1
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/rbug
d423 1
a423 1
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/rbug
d426 43
d476 13
a488 9
        radeon_video.c \
        radeon_uvd.c \
        radeon_vce.c \
        radeon_vce_40_2_2.c
#LLVM_C_FILES := \
#        radeon_elf_util.c \
#        radeon_setup_tgsi_llvm.c \
#        radeon_llvm_emit.c \
#        radeon_llvm_util.c
d491 11
a508 4
        r700_asm.c \
        evergreen_hw_context.c \
        evergreen_state.c \
        eg_asm.c \
d510 4
a513 3
        evergreen_compute.c \
        compute_memory_pool.c \
        r600_uvd.c
a540 1
#LLVM_C_SOURCES = r600_llvm.c
d542 109
a650 1
.for _f in ${GALLIUM_SOURCES.drivers/r600} ${GALLIUM_SOURCES.drivers/r600/sb}
d652 7
d662 1
a662 1
	nouveau_screen.c \
d664 1
d666 1
a666 2
	nouveau_buffer.c \
	nouveau_heap.c \
d668 1
a669 1
	nouveau_vp3_video_bsp.c \
d673 1
a673 1
	nv30_screen.c \
d675 1
d677 5
d683 1
a683 2
	nv30_transfer.c \
	nv30_miptree.c \
d687 3
a689 1
	nv30_fragtex.c \
d691 2
a692 9
	nv30_fragprog.c \
	nv30_vertprog.c \
	nv30_clear.c \
	nv30_vbo.c \
	nv30_push.c \
	nv30_draw.c \
	nv30_query.c \
	nvfx_vertprog.c \
	nvfx_fragprog.c
d695 1
d699 6
d707 1
d714 1
a714 4
	nv50_program.c \
	nv50_shader_state.c \
	nv50_push.c \
	nv50_query.c \
a715 1
	nv84_video_bsp.c \
d717 1
d719 2
a720 3
	nv98_video_bsp.c \
	nv98_video_vp.c \
	nv98_video_ppp.c
a736 1
	nv50_ir_emit_nvc0.cpp \
d739 2
d742 2
a743 3
	nv50_ir_lowering_gm107.cpp \
	nv50_ir_target_nvc0.cpp \
	nv50_ir_target_gm107.cpp
d762 4
d772 4
d780 4
a783 2
	   ${GALLIUM_SOURCES.drivers/nouveau/nvc0}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/nouveau
a785 1

d789 1
a789 1
        radeon_drm_cs_dump.c \
d792 65
a856 2
GALLIUM_SOURCES.winsys/nouveau/drm = \
        nouveau_drm_winsys.c
d859 33
a891 29
        sp_fs_exec.c \
        sp_clear.c \
        sp_fence.c \
        sp_flush.c \
        sp_query.c \
        sp_context.c \
        sp_draw_arrays.c \
        sp_prim_vbuf.c \
        sp_quad_pipe.c \
        sp_quad_stipple.c \
        sp_quad_depth_test.c \
        sp_quad_fs.c \
        sp_quad_blend.c \
        sp_screen.c \
        sp_setup.c \
        sp_state_blend.c \
        sp_state_clip.c \
        sp_state_derived.c \
        sp_state_sampler.c \
        sp_state_shader.c \
        sp_state_so.c \
        sp_state_rasterizer.c \
        sp_state_surface.c \
        sp_state_vertex.c \
        sp_texture.c \
        sp_tex_sample.c \
        sp_tex_tile_cache.c \
        sp_tile_cache.c \
        sp_surface.c
d896 3
d908 1
d926 3
d946 3
d951 1
d959 72
d1036 4
d1049 6
a1054 1
CFLAGS.streaming-load-memcpy.c+= -msse4.1
a1070 1
	-DGALLIUM_GALAHAD \
d1079 9
d1091 3
a1093 1
	-DGALLIUM_R600
d1108 5
a1112 1
			-Wno-error=logical-not-parentheses
@


1.17
log
@Build gallium with -pthread if we're building the radeon driver. It uses a
thread, so without this the driver doesn't load and nothing works. ok mrg
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.16 2016/09/27 19:18:42 joerg Exp $
d251 1
a251 1
.PATH: ${X11SRCDIR.MesaLib}/../src/gallium/auxiliary
d257 1
a257 1
CPPFLAGS.${_f} +=	-I${X11SRCDIR.MesaLib}/src/gallium/auxiliary/util
d287 8
a294 8
BUILDSYMLINKS+=	${X11SRCDIR.MesaLib}/src/gallium/drivers/rbug/rbug_core.c    DRIVERrbug_core.c
BUILDSYMLINKS+=	${X11SRCDIR.MesaLib}/src/gallium/drivers/rbug/rbug_context.c DRIVERrbug_context.c
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/auxiliary
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers/rbug
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/auxiliary
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers/rbug
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers
d359 1
a359 1
CPPFLAGS.${_f} +=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers/r600
d470 1
a470 1
CPPFLAGS.${_f} +=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers/nouveau
d531 1
a531 1
CPPFLAGS.${_f} +=	-I${X11SRCDIR.MesaLib}/src/gallium/state_trackers/dri/common
d542 1
a542 1
.PATH: ${X11SRCDIR.MesaLib}/src/gallium/${_d}
d570 1
a570 1
LDFLAGS+=	-Wl,--version-script=${X11SRCDIR.MesaLib}/src/gallium/targets/dri/dri.sym
d578 1
a578 1
.PATH: ${X11SRCDIR.MesaLib}/src/mesa/x86
d589 1
a589 1
.PATH: ${X11SRCDIR.MesaLib}/src/gallium/targets/dri
d593 4
a596 4
	-I${X11SRCDIR.MesaLib}/src/gallium/include \
	-I${X11SRCDIR.MesaLib}/src/gallium/auxiliary \
	-I${X11SRCDIR.MesaLib}/src/gallium/drivers \
	-I${X11SRCDIR.MesaLib}/../src/mesa/drivers/dri/common
d605 3
a607 3
	-I${X11SRCDIR.MesaLib}/src/gallium/state_trackers/dri \
	-I${X11SRCDIR.MesaLib}/src/loader \
	-I${X11SRCDIR.MesaLib}/src/gallium/winsys
@


1.17.14.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.32 2019/06/09 01:56:49 mrg Exp $
a15 4
LLVM_INCLUDE_OBJDIR!=	cd ${NETBSDSRCDIR}/external/bsd/llvm/include && ${PRINTOBJDIR}

CWARNFLAGS.clang += -Wno-atomic-alignment -Wno-unknown-warning-option

d17 1
a17 4
CFLAGS+=	-std=gnu11
CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/libdrm \
		-I${NETBSDSRCDIR}/external/bsd/llvm/dist/llvm/include \
		-I${LLVM_INCLUDE_OBJDIR} -I${NETBSDSRCDIR}/external/bsd/llvm/config
a22 4
	auxiliary/driver_ddebug \
	auxiliary/driver_noop \
	auxiliary/driver_rbug \
	auxiliary/driver_trace \
a24 1
	auxiliary/nir \
a26 1
	auxiliary/pipe-loader \
a28 1
	auxiliary/renderonly \
d34 2
d37 1
d40 1
a42 2
	winsys/sw/null \
	winsys/sw/wrapper \
a44 7
GALLIUM_SUBDIRS_VDPAU=	\
	state_trackers/vdpau

GALLIUM_SUBDIRS_LLVMPIPE= \
	auxiliary/gallivm \
	drivers/llvmpipe

a46 3
	drivers/radeonsi \
	drivers/r300 \
	drivers/r300/compiler \
d49 1
a49 6
	winsys/radeon/drm \
	winsys/amdgpu/drm

GALLIUM_SUBDIRS_I915= \
	drivers/i915 \
	winsys/i915/drm
a60 3
BUILD_VDPAU=0
BUILD_LLVMPIPE=0
BUILD_I915=0
a61 2
BUILD_I915=1
. if ${MKLLVMRT} != "no"
a62 1
. endif
a65 4
BUILD_VDPAU=1
. if ${MKLLVMRT} != "no"
BUILD_LLVMPIPE=1
. endif
d70 1
a70 1
DRIVERS+=		r600 r300
a76 9
.if ${BUILD_VDPAU} == 1
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_VDPAU}
.endif
.if ${BUILD_I915} == 1
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_I915}
.endif
.if ${BUILD_LLVMPIPE} == 1
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_LLVMPIPE}
.endif
a81 1

d86 1
a88 1
	draw_pipe.c \
a116 9

.if ${MKLLVMRT} != "no"
GALLIUM_SOURCES.auxiliary/draw+= \
	draw_llvm.c \
	draw_llvm_sample.c \
	draw_pt_fetch_shade_pipeline_llvm.c \
	draw_vs_llvm.c
.endif

a120 4
	hud_nic.c \
	hud_cpufreq.c \
	hud_diskstat.c \
	hud_sensors_temp.c \
d126 3
a128 14
	os_process.c
GALLIUM_SOURCES.auxiliary/pipe-loader= \
	pipe_loader.c \
	pipe_loader_drm.c \
	pipe_loader_sw.c

.for _f in ${GALLIUM_SOURCES.auxiliary/pipe-loader}
CPPFLAGS.${_f} +=	-DHAVE_PIPE_LOADER_KMS=1 \
			-DHAVE_PIPE_LOADER_DRI=1 \
			-DGALLIUM_STATIC_TARGETS=1 \
			-I${X11SRCDIR.Mesa}/src/gallium/winsys \
			-I${X11SRCDIR.Mesa}/src/loader
.endfor

a138 2
	pb_cache.c \
	pb_slab.c \
d149 2
a150 2
	RBUGrbug_context.c \
	RBUGrbug_core.c \
a158 1
	tgsi_aa_point.c \
a161 2
	tgsi_emulate.c \
	tgsi_from_mesa.c \
a163 1
	tgsi_lowering.c \
a164 1
	tgsi_point_sprite.c \
a169 1
	tgsi_two_side.c \
a177 6
	os_misc.c \
	u_async_debug.c \
	u_bitmask.c \
	u_blit.c \
	u_blitter.c \
	u_cache.c \
a180 2
	u_debug_gallium.c \
	u_debug_image.c \
d185 8
a195 2
	u_dump_defines.c \
	u_dump_state.c \
d197 1
a197 2
	u_format_bptc.c \
	u_format_etc.c \
d199 1
a199 1
	u_format_other.c \
d201 2
a202 1
	u_format_s3tc.c \
d209 1
a211 1
	u_idalloc.c \
d213 1
d215 3
a217 1
	u_log.c \
a218 3
	u_network.c \
	u_prim.c \
	u_prim_restart.c \
a219 1
	u_resource.c \
a221 1
	u_screen.c \
d223 3
a228 1
	u_tests.c \
d232 1
a232 2
	u_transfer_helper.c \
	u_threaded_context.c \
a234 2
GALLIUM_SOURCES.auxiliary/nir = \
	tgsi_to_nir.c
d236 1
a236 1
	vl_bicubic_filter.c \
d238 2
a239 1
	vl_csc.c \
d241 3
a243 1
	vl_deint_filter.c \
a244 1
	vl_matrix_filter.c \
a245 3
	vl_median_filter.c \
	vl_mpeg12_bitstream.c \
	vl_mpeg12_decoder.c \
d248 1
a248 2
	vl_winsys_dri.c \
	vl_zscan.c
d251 1
a251 1
.PATH: ${X11SRCDIR.Mesa}/../src/gallium/auxiliary
a255 3
.for _f in ${GALLIUM_SOURCES.auxiliary/vl}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/loader
.endfor
d257 1
a257 2
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary/util
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/util
d260 4
a263 2
GALLIUM_SOURCES.auxiliary/renderonly= \
	renderonly.c
d265 4
a268 36
GALLIUM_SOURCES.auxiliary/gallivm= \
	lp_bld_arit.c \
	lp_bld_arit_overflow.c \
	lp_bld_assert.c \
	lp_bld_bitarit.c \
	lp_bld_const.c \
	lp_bld_conv.c \
	lp_bld_flow.c \
	lp_bld_format_aos_array.c \
	lp_bld_format_aos.c \
	lp_bld_format_cached.c \
	lp_bld_format_float.c \
	lp_bld_format.c \
	lp_bld_format_soa.c \
	lp_bld_format_srgb.c \
	lp_bld_format_yuv.c \
	lp_bld_gather.c \
	lp_bld_init.c \
	lp_bld_intr.c \
	lp_bld_logic.c \
	lp_bld_misc.cpp \
	lp_bld_pack.c \
	lp_bld_printf.c \
	lp_bld_quad.c \
	lp_bld_sample_aos.c \
	lp_bld_sample.c \
	lp_bld_sample_soa.c \
	lp_bld_struct.c \
	lp_bld_swizzle.c \
	lp_bld_tgsi_action.c \
	lp_bld_tgsi_aos.c \
	lp_bld_tgsi.c \
	lp_bld_tgsi_info.c \
	lp_bld_tgsi_soa.c \
	lp_bld_type.c
	#lp_bld_debug.cpp
d270 1
a270 11
.for _f in ${GALLIUM_SOURCES.auxiliary/gallivm}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary/util
.endfor


GALLIUM_SOURCES.auxiliary/driver_ddebug = \
        dd_context.c \
	dd_draw.c \
	dd_screen.c

GALLIUM_SOURCES.auxiliary/driver_noop = \
d274 1
a274 1
GALLIUM_SOURCES.auxiliary/driver_trace = \
d281 1
a281 1
GALLIUM_SOURCES.auxiliary/driver_rbug = \
d287 8
a294 53
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/auxiliary/rbug/rbug_core.c		RBUGrbug_core.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/auxiliary/rbug/rbug_context.c		RBUGrbug_context.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug/rbug_core.c	DRIVERrbug_core.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug/rbug_context.c	DRIVERrbug_context.c
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.Mesa}/src/gallium/drivers
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.Mesa}/src/gallium/drivers

GALLIUM_SOURCES.drivers/i915= \
	i915_blit.c \
	i915_clear.c \
	i915_context.c \
	i915_debug.c \
	i915_debug_fp.c \
	i915_flush.c \
	i915_fpc_emit.c \
	i915_fpc_optimize.c \
	i915_fpc_translate.c \
	i915_prim_emit.c \
	i915_prim_vbuf.c \
	i915_query.c \
	i915_resource_buffer.c \
	i915_resource.c \
	i915_resource_texture.c \
	i915_screen.c \
	i915_state.c \
	i915_state_derived.c \
	i915_state_dynamic.c \
	i915_state_emit.c \
	i915_state_fpc.c \
	i915_state_immediate.c \
	i915_state_sampler.c \
	i915_state_static.c \
	i915_surface.c

GALLIUM_SOURCES.winsys/i915/drm= \
	i915_drm_batchbuffer.c \
	i915_drm_buffer.c \
	i915_drm_fence.c \
	i915_drm_winsys.c

# Conflicts with r600/radeon_video.c and radeon/radeon_video.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_video.c r600_radeon_video.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_video.c radeon_radeon_video.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_vce.c r600_radeon_vce.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_vce.c radeon_radeon_vce.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/r600/r600_perfcounter.c r600_r600_perfcounter.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/r600_perfcounter.c radeon_r600_perfcounter.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_uvd.c r600_radeon_uvd.c
BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_uvd.c radeon_radeon_uvd.c
d303 9
a311 13
	radeon_r600_perfcounter.c \
        radeon_radeon_uvd.c \
	radeon_uvd_enc.c \
	radeon_uvd_enc_1_1.c \
        radeon_vce_40_2_2.c \
	radeon_vce_50.c \
	radeon_vce_52.c \
	radeon_vcn_dec.c \
	radeon_vcn_dec_jpeg.c \
	radeon_vcn_enc.c \
	radeon_vcn_enc_1_2.c \
        radeon_radeon_vce.c \
        radeon_radeon_video.c \
a313 11
	eg_debug.c \
	r600_gpu_load.c \
	r600_r600_perfcounter.c \
	r600_radeon_vce.c \
	r600_radeon_video.c \
        compute_memory_pool.c \
	r600_viewport.c \
        eg_asm.c \
        evergreen_compute.c \
        evergreen_hw_context.c \
        evergreen_state.c \
d321 4
d326 3
a328 4
        r600_uvd.c \
        r600_radeon_uvd.c \
	r600_test_dma.c \
        r700_asm.c
d356 1
d358 2
a359 117
GALLIUM_SOURCES.drivers/r300 = \
	r300_blit.c \
	r300_chipset.c \
	r300_context.c \
	r300_debug.c \
	r300_emit.c \
	r300_flush.c \
	r300_fs.c \
	r300_hyperz.c \
	r300_query.c \
	r300_render.c \
	r300_render_stencilref.c \
	r300_render_translate.c \
	r300_resource.c \
	r300_screen_buffer.c \
	r300_screen.c \
	r300_state.c \
	r300_state_derived.c \
	r300_texture.c \
	r300_texture_desc.c \
	r300_tgsi_to_rc.c \
	r300_transfer.c \
	r300_vs.c \
	r300_vs_draw.c

GALLIUM_SOURCES.drivers/r300/compiler = \
	memory_pool.c \
	r300_fragprog.c \
	r300_fragprog_emit.c \
	r300_fragprog_swizzle.c \
	r3xx_fragprog.c \
	r3xx_vertprog.c \
	r3xx_vertprog_dump.c \
	r500_fragprog.c \
	r500_fragprog_emit.c \
	radeon_code.c \
	radeon_compiler.c \
	radeon_compiler_util.c \
	radeon_dataflow.c \
	radeon_dataflow_deadcode.c \
	radeon_dataflow_swizzles.c \
	radeon_emulate_branches.c \
	radeon_emulate_loops.c \
	radeon_inline_literals.c \
	radeon_list.c \
	radeon_opcodes.c \
	radeon_optimize.c \
	radeon_pair_dead_sources.c \
	radeon_pair_regalloc.c \
	radeon_pair_schedule.c \
	radeon_pair_translate.c \
	radeon_program_alu.c \
	radeon_program.c \
	radeon_program_pair.c \
	radeon_program_print.c \
	radeon_program_tex.c \
	radeon_remove_constants.c \
	radeon_rename_regs.c \
	radeon_variable.c \
	radeon_vert_fc.c

GALLIUM_SOURCES.drivers/radeonsi = \
	cik_sdma.c \
	si_blit.c \
	si_buffer.c \
	si_clear.c \
	si_compute.c \
	si_compute_blit.c \
	si_cp_dma.c \
	si_debug.c \
	si_descriptors.c \
	si_dma.c \
	si_dma_cs.c \
	si_fence.c \
	si_get.c \
	si_gfx_cs.c \
	si_gpu_load.c \
	si_pipe.c \
	si_pm4.c \
	si_perfcounter.c \
	si_query.c \
	si_shader.c \
	si_shader_nir.c \
	si_shader_tgsi_alu.c \
	si_shader_tgsi_mem.c \
	si_shader_tgsi_setup.c \
	si_shaderlib_tgsi.c \
	si_state.c \
	si_state_binning.c \
	si_state_draw.c \
	si_state_msaa.c \
	si_state_shaders.c \
	si_state_streamout.c \
	si_state_viewport.c \
	si_test_dma.c \
	si_test_dma_perf.c \
	si_texture.c \
	si_uvd.c

.for _f in ${GALLIUM_SOURCES.drivers/radeon}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/radeon
.endfor

.for _f in ${GALLIUM_SOURCES.drivers/r300} ${GALLIUM_SOURCES.drivers/r300/compiler}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/r300 \
			-I${X11SRCDIR.Mesa}/src/gallium/drivers/r300/compiler
.endfor

.for _f in ${GALLIUM_SOURCES.drivers/r600} ${GALLIUM_SOURCES.drivers/r600/sb} ${GALLIUM_SOURCES.drivers/radeonsi}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/r600
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/../src/gallium/drivers/r600
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/amd/common
.endfor

.for _f in ${GALLIUM_SOURCES.drivers/radeon}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/amd/common
d363 3
a366 1
	nouveau_fence.c \
a367 2
	nouveau_mm.c \
	nouveau_screen.c \
d369 1
a370 1
	nouveau_vp3_video.c \
d374 1
a374 1
	nv30_clear.c \
a375 1
	nv30_draw.c \
d377 2
a378 2
	nv30_fragprog.c \
	nv30_fragtex.c \
a379 4
	nv30_push.c \
	nv30_query.c \
	nv30_resource.c \
	nv30_screen.c \
d383 5
a387 1
	nv30_transfer.c \
d389 5
a393 4
	nv30_vertprog.c \
	nv40_verttex.c \
	nvfx_fragprog.c \
	nvfx_vertprog.c
a395 1
	nv50_compute.c \
a398 6
	nv50_program.c \
	nv50_push.c \
	nv50_query.c \
	nv50_query_hw.c \
	nv50_query_hw_metric.c \
	nv50_query_hw_sm.c \
a400 1
	nv50_shader_state.c \
d407 5
a412 1
	nv84_video.c \
d414 1
d416 2
a417 3
	nv98_video.c \
	nv98_video_ppp.c \
	nv98_video_vp.c
d434 1
d437 1
a437 1
	nv50_ir_emit_nvc0.cpp \
d439 2
a440 3
	nv50_ir_lowering_nvc0.cpp \
	nv50_ir_target_gm107.cpp \
	nv50_ir_target_nvc0.cpp
a458 4
	nvc0_query_hw.c \
	nvc0_query_hw_metric.c \
	nvc0_query_hw_sm.c \
	nvc0_query_sw.c \
a464 4

GALLIUM_SOURCES.winsys/nouveau/drm = \
        nouveau_drm_winsys.c

d469 2
a470 4
	   ${GALLIUM_SOURCES.drivers/nouveau/nvc0} \
	   ${GALLIUM_SOURCES.winsys/nouveau/drm}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/drivers/nouveau \
			-I${DESTDIR}${X11INCDIR}/libdrm/nouveau
d473 1
d477 1
a477 1
	radeon_drm_surface.c \
d480 2
a481 65
GALLIUM_SOURCES.winsys/amdgpu/drm = \
	amdgpu_bo.c \
	amdgpu_cs.c \
	amdgpu_surface.c \
	amdgpu_winsys.c

.for _f in ${GALLIUM_SOURCES.winsys/amdgpu/drm}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/amd
.endfor

GALLIUM_SOURCES.state_trackers/vdpau = \
	bitmap.c \
	decode.c \
	device.c \
	ftab.c \
	htab.c \
	mixer.c \
	output.c \
	preemption.c \
	presentation.c \
	query.c \
	surface.c

GALLIUM_SOURCES.drivers/llvmpipe = \
	lp_bld_alpha.c \
	lp_bld_blend_aos.c \
	lp_bld_blend.c \
	lp_bld_blend_logicop.c \
	lp_bld_depth.c \
	lp_bld_interp.c \
	lp_clear.c \
	lp_context.c \
	lp_draw_arrays.c \
	lp_fence.c \
	lp_flush.c \
	lp_jit.c \
	lp_memory.c \
	lp_perf.c \
	lp_query.c \
	lp_rast.c \
	lp_rast_debug.c \
	lp_rast_tri.c \
	lp_scene.c \
	lp_scene_queue.c \
	lp_screen.c \
	lp_setup.c \
	lp_setup_line.c \
	lp_setup_point.c \
	lp_setup_tri.c \
	lp_setup_vbuf.c \
	lp_state_blend.c \
	lp_state_clip.c \
	lp_state_derived.c \
	lp_state_fs.c \
	lp_state_gs.c \
	lp_state_rasterizer.c \
	lp_state_sampler.c \
	lp_state_setup.c \
	lp_state_so.c \
	lp_state_surface.c \
	lp_state_vertex.c \
	lp_state_vs.c \
	lp_surface.c \
	lp_tex_sample.c \
	lp_texture.c
d484 29
a512 33
	sp_buffer.c \
	sp_clear.c \
	sp_context.c \
	sp_compute.c \
	sp_draw_arrays.c \
	sp_fence.c \
	sp_flush.c \
	sp_fs_exec.c \
	sp_image.c \
	sp_prim_vbuf.c \
	sp_quad_blend.c \
	sp_quad_depth_test.c \
	sp_quad_fs.c \
	sp_quad_pipe.c \
	sp_quad_stipple.c \
	sp_query.c \
	sp_screen.c \
	sp_setup.c \
	sp_state_blend.c \
	sp_state_clip.c \
	sp_state_derived.c \
	sp_state_image.c \
	sp_state_rasterizer.c \
	sp_state_sampler.c \
	sp_state_shader.c \
	sp_state_so.c \
	sp_state_surface.c \
	sp_state_vertex.c \
	sp_surface.c \
	sp_tex_sample.c \
	sp_tex_tile_cache.c \
	sp_texture.c \
	sp_tile_cache.c
a516 3
GALLIUM_SOURCES.winsys/sw/wrapper = \
	wrapper_sw_winsys.c

a525 1
	dri_helpers.c \
d531 1
a531 1
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/src/gallium/state_trackers/dri/common
d542 1
a542 4
.PATH: ${X11SRCDIR.Mesa}/src/gallium/${_d}
. for _s in ${GALLIUM_SOURCES.${_d}}
CPPFLAGS.${_s}+= -I${X11SRCDIR.Mesa}/src/gallium/${_d}
. endfor
a559 3
.if ${BUILD_I915} == 1
LIBDPLIBS+= 	drm_intel	${.CURDIR}/../libdrm_intel
.endif
a561 1
LIBDPLIBS+= 	drm_amdgpu	${.CURDIR}/../libdrm_amdgpu
a568 15
LIBDPLIBS+=	terminfo	${.CURDIR}/../../../../../lib/libterminfo
LIBDPLIBS+=	z		${.CURDIR}/../../../../../lib/libz
LIBDPLIBS+=	execinfo	${.CURDIR}/../../../../../lib/libexecinfo
LIBDPLIBS+=	X11-xcb         ${.CURDIR}/../libX11/libX11-xcb
LIBDPLIBS+=	xcb-dri2        ${.CURDIR}/../libxcb/dri2

# gallium drivers requiring LLVM
.if ${BUILD_LLVMPIPE} == 1 || ${BUILD_RADEON} == 1

LLVMRT_LIBS=	\
		TransformsCoroutines \
		Passes \
		MCJIT \
		ExecutionEngine \
		RuntimeDyld
d570 1
a570 80
.if ${BUILD_RADEON} == 1
LLVMRT_LIBS+=	\
		AMDGPUCodeGen \
		AMDGPUMCTargetDesc \
		AMDGPUAsmPrinter \
		AMDGPUTargetInfo \
		AMDGPUAsmParser \
		AMDGPUUtils
.endif

.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
# XXX duplicates
LLVMRT_LIBS+=	\
		X86Disassembler \
		X86CodeGen \
		X86MCTargetDesc \
		X86Disassembler \
		X86MCTargetDesc \
		X86AsmPrinter \
		X86TargetInfo \
		X86Utils
.endif

.if ${MACHINE_CPU} == "aarch64"
# XXX duplicates
LLVMRT_LIBS+=	\
		AArch64AsmParser \
		AArch64CodeGen \
		AArch64MCTargetDesc \
		AArch64Utils \
		AArch64AsmPrinter \
		AArch64Disassembler \
		AArch64TargetInfo
.endif

.if ${MACHINE_CPU} == "arm"
# XXX duplicates
LLVMRT_LIBS+=	\
		ARMCodeGen \
		ARMDisassembler \
		ARMTargetInfo \
		ARMMCTargetDesc \
		ARMAsmParser \
		ARMAsmPrinter \
		ARMUtils
.endif

LLVMRT_LIBS+=	\
		GlobalISel \
		MCDisassembler \
		SelectionDAG \
		AsmPrinter \
		CodeGen \
		Target \
		InstCombine \
		ScalarOpts \
		DebugInfoCodeView \
		Object \
		BitReader \
		MCParser \
		MC \
		ipo \
		Instrumentation \
		IRReader \
		AsmParser \
		Vectorize \
		TransformsAggressiveInstCombine \
		ProfileData \
		Analysis \
		IR \
		Linker \
		BinaryFormat \
		TransformsUtils \
		Support

.include "${NETBSDSRCDIR}/external/bsd/llvm/link.mk"

.endif  # ${BUILD_LLVM_PIPE} == 1 || ${BUILD_RADEON} == 1

LDFLAGS+=	-Wl,--version-script=${X11SRCDIR.Mesa}/src/gallium/targets/dri/dri.sym
a573 4
.if ${BUILD_RADEON} == 1
MESA_SRC_MODULES+= amd
.endif

d578 1
a578 1
.PATH: ${X11SRCDIR.Mesa}/src/mesa/x86
d583 1
a583 1
CPPFLAGS.streaming-load-memcpy.c+= -msse4.1
a585 4
# Needs 64bit atomics
CPPFLAGS.i386+= -march=i586
CPPFLAGS+=	${CPPFLAGS.${XORG_MACHINE_ARCH:U${MACHINE_ARCH}}}

d589 1
a589 1
.PATH: ${X11SRCDIR.Mesa}/src/gallium/targets/dri
d593 4
a596 4
	-I${X11SRCDIR.Mesa}/src/gallium/include \
	-I${X11SRCDIR.Mesa}/src/gallium/auxiliary \
	-I${X11SRCDIR.Mesa}/src/gallium/drivers \
	-I${X11SRCDIR.Mesa}/../src/mesa/drivers/dri/common
d600 1
d605 3
a607 14
	-I${X11SRCDIR.Mesa}/src/gallium/state_trackers/dri \
	-I${X11SRCDIR.Mesa}/src/loader \
	-I${X11SRCDIR.Mesa}/src/gallium/winsys

.if ${BUILD_LLVMPIPE} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_LLVMPIPE
.endif  #${BUILD_LLVMPIPE} == 1

.if ${BUILD_I915} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_I915 \
	-DGALLIUM_ILO
.endif
d612 1
a612 3
	-DGALLIUM_R300 \
	-DGALLIUM_R600 \
	-DGALLIUM_RADEONSI
d627 1
a627 7
			-Wno-error=logical-not-parentheses \
			-Wno-error=constant-logical-operand \
			-Wno-error=unknown-warning-option \
			-Wno-error=typedef-redefinition \
			-Wno-error=enum-conversion # https://bugs.freedesktop.org/show_bug.cgi?id=109761

CWARNFLAGS+=		-Wno-error=stack-protector
a643 1

@


1.17.14.2
log
@Mostly merge changes from HEAD upto 20200411
@
text
@d1 1
a1 1
# $NetBSD$
d16 1
a16 1
LLVM_INCLUDE_OBJDIR!=	cd ${NETBSDSRCDIR}/external/apache2/llvm/include && ${PRINTOBJDIR}
d18 1
a18 1
CWARNFLAGS.clang += -Wno-atomic-alignment -Wno-unknown-warning-option -Wno-implicit-int-float-conversion
d20 1
a20 1
CXXFLAGS+=	-std=c++14
d23 2
a24 5
		-I${NETBSDSRCDIR}/external/apache2/llvm/dist/llvm/include \
		-I${LLVM_INCLUDE_OBJDIR} -I${NETBSDSRCDIR}/external/apache2/llvm/config

CFLAGS+=	-pthread
LDFLAGS+=	-pthread
d93 3
a98 3
. if ${MKLLVMRT} != "no"
BUILD_RADEON=1
. endif
a99 10
.endif

.if ${MACHINE_ARCH} == "i386" || \
    ${MACHINE_ARCH} == "x86_64" || \
    ${MACHINE_ARCH} == "powerpc" || \
    ${MACHINE_ARCH} == "powerpc64" || \
    !empty(MACHINE_ARCH:Maarch64*) || \
    !empty(MACHINE_ARCH:Mmips*) || \
    !empty(MACHINE_ARCH:Mearm*) || \
    !empty(MACHINE_ARCH:Marm*)
d107 1
a107 1
DRIVERS+=		r600 r300 radeonsi
d197 1
a197 2
			-I${X11SRCDIR.Mesa}/src/loader \
			-I${X11SRCDIR.Mesa}/../src/util
d202 2
d207 2
a321 2
	vl_compositor_cs.c \
	vl_compositor_gfx.c \
d363 1
a366 1
	lp_bld_format_s3tc.c \
d466 2
d478 1
d495 1
a495 1
	r600_perfcounter.c \
a655 1
CPPFLAGS.${_f} +=	-I${X11SRCDIR.Mesa}/../src/amd/common
a727 2
	nv50_ir_emit_gk110.cpp \
	nv50_ir_emit_gm107.cpp \
a728 3
	nv50_ir_emit_nvc0.cpp \
	nv50_ir_from_common.cpp \
	nv50_ir_from_nir.cpp \
a730 2
	nv50_ir_lowering_gm107.cpp \
	nv50_ir_lowering_helper.cpp \
a731 1
	nv50_ir_lowering_nvc0.cpp \
d739 5
d942 1
d945 1
a945 3
LIBDPLIBS+=	X11-xcb         ${.CURDIR}/../libX11/libX11-xcb
LIBDPLIBS+=	xcb-dri2        ${.CURDIR}/../libxcb/dri2
LIBDPLIBS+=	xcb		${.CURDIR}/../libxcb/libxcb
d962 1
d964 2
a965 4

LIBDPLIBS+=	elf		${NETBSDSRCDIR}/external/bsd/elftoolchain/lib/libelf
LIBDPLIBS+=	z		${.CURDIR}/../../../../../lib/libz
LIBDPLIBS+=	m		${.CURDIR}/../../../../../lib/libm
d981 1
d995 1
d1001 1
d1007 1
d1013 1
d1020 1
a1023 18
.if ${MACHINE_CPU} == "mips"
LLVMRT_LIBS+=	\
		MipsCodeGen \
		MipsDisassembler \
		MipsAsmParser \
		MipsMCTargetDesc \
		MipsTargetInfo
.endif

.if ${MACHINE_CPU} == "powerpc"
LLVMRT_LIBS+=	\
		PowerPCCodeGen \
		PowerPCDisassembler \
		PowerPCTargetInfo \
		PowerPCMCTargetDesc \
		PowerPCAsmParser
.endif

a1029 1
		TransformsCFGuard \
a1033 1
		DebugInfoDWARF \
a1035 2
		TextAPI \
		MIRParser \
a1046 2
		Remarks \
		BitstreamReader \
d1050 1
a1050 2
		Support \
		Demangle
d1052 1
a1052 1
.include "${NETBSDSRCDIR}/external/apache2/llvm/link.mk"
a1056 3
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE_CPU} == "aarch64"
LDFLAGS+=	-Wl,-z,defs
.endif
a1079 3
CPPFLAGS.r600_pipe_common.c+=	-DMESA_LLVM_VERSION_STRING=\"9.0.0\"
CPPFLAGS.si_get.c+=	-DMESA_LLVM_VERSION_STRING=\"9.0.0\"

a1099 2
	-I${X11SRCDIR.Mesa}/../src/util \
	-I${X11SRCDIR.Mesa}/../src/gallium/drivers \
a1155 3
.if ${MACHINE_ARCH} == "vax"
COPTS.nir.c += -O1
.endif
@


1.16
log
@Allow clang to generate SPARCv8+ assembly for now.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.15 2016/08/16 21:05:14 mrg Exp $
d551 5
@


1.15
log
@only build the radeon and nouveau drivers on i386/amd64/evbarm,
where they're useful.  this saves almost 2MB in text/data on shark.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.14 2016/02/28 22:55:21 joerg Exp $
d635 4
@


1.14
log
@Make using ! on the LHS of a compare non-fatal, even if it is not
cosher. It is currently not clear what the code is actually trying to
do.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.13 2016/02/26 18:29:55 riastradh Exp $
a15 8
DRIVERS=	kms_swrast swrast
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
DRIVERS+=	r600
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE} == "evbarm"
DRIVERS+=	nouveau
.endif

d17 1
a17 5
CPPFLAGS+= \
	-I${DESTDIR}${X11INCDIR}/libdrm

# cargo culted.
#CPPFLAGS+= -D_NETBSD_SOURCE -DPTHREADS
d39 7
d49 3
d57 20
a76 7
	drivers/softpipe \
	winsys/radeon/drm \
	winsys/nouveau/drm \
	winsys/sw/null \
	winsys/sw/dri \
	winsys/sw/kms-dri \
	state_trackers/dri
d551 1
d553 1
d555 1
d557 2
a558 1
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE} == "evbarm"
d560 2
a561 1
.endif
a598 3
	-DGALLIUM_R200 \
	-DGALLIUM_R600 \
	-DGALLIUM_NOUVEAU \
d604 11
@


1.14.2.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.16 2016/09/27 19:18:42 joerg Exp $
a610 4
.if ${MACHINE_ARCH} == "sparc" || ${COMMON_MACHINE_ARCH:U} == "sparc"
COPTS+=	${${ACTIVE_CC} == "clang":? -Wa,-Av8plus  :}
.endif

@


1.14.2.2
log
@Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.17 2016/11/29 23:17:22 dholland Exp $
a539 6
.if ${BUILD_RADEON} == 1
CFLAGS+=	-pthread
LDFLAGS+=	-pthread
LIBDPLIBS+=	pthread		${.CURDIR}/../../../../../lib/libpthread
.endif

@


1.13
log
@Use -std=c++11 unordered_set, not TR1 unordered_set.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.12 2015/11/03 10:43:31 szptvlfn Exp $
d597 2
a598 1
			-Wno-error=static-in-inline
@


1.12
log
@remove redundant \
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.11 2015/10/31 20:13:45 mrg Exp $
d24 1
@


1.11
log
@don't look for libdrm_nouveau unless we've built it.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.10 2015/10/29 10:10:09 jmcneill Exp $
d526 1
a526 1
	-DMESA_EGL_NO_X11_HEADERS \
@


1.10
log
@build nouveau on evbarm, too
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.9 2015/10/29 08:09:55 mrg Exp $
d542 1
d544 1
@


1.9
log
@properly link and enable all the nouveau parts.
with this, hw GL seems to work!
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.8 2015/10/26 07:15:36 mrg Exp $
d18 4
a21 1
DRIVERS+=	r600 nouveau
@


1.8
log
@build the nouveau gallium driver.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.7 2015/09/23 05:28:14 mrg Exp $
d57 1
d465 3
d539 1
d579 1
@


1.7
log
@remove unused GALLIUM_NAMES variable.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6 2015/01/05 20:06:06 joerg Exp $
d18 1
a18 1
DRIVERS+=	r600
d50 5
d346 110
@


1.6
log
@Don't bail out on the broken inline functions that use static variables.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.5 2015/01/05 18:51:10 gson Exp $
a56 2
GALLIUM_NAMES=	kms_swrast r600 swrant

@


1.6.2.1
log
@file Makefile was added on branch netbsd-7 on 2015-01-05 21:23:51 +0000
@
text
@d1 487
@


1.6.2.2
log
@Pull up following revision(s) (requested by mrg in ticket #381):
	distrib/sets/lists/xdebug/md.amd64: revision 1.7
	external/mit/xorg/lib/libGL/internal/Makefile: revision 1.2
	distrib/sets/lists/xdebug/md.amd64: revision 1.8
	distrib/sets/lists/xserver/md.sparc64: revision 1.55
	distrib/sets/lists/xdebug/md.sparc64: revision 1.4
	external/mit/xorg/lib/Makefile: revision 1.30
	external/mit/xorg/lib/libglapi/Makefile: revision 1.1
	distrib/sets/lists/xserver/md.macppc: revision 1.67
	external/mit/xorg/lib/dri/radeon/Makefile: file removal
	external/mit/xorg/lib/asm.mk: revision 1.1
	external/mit/xorg/lib/dri/dri.mk: file removal
	external/mit/xorg/lib/dri/mach64/Makefile: file removal
	external/mit/xorg/lib/libGL/Makefile: revision 1.21
	external/mit/xorg/lib/libGL/Makefile.glslsrcs: file removal
	external/mit/xorg/lib/dri/Makefile: revision 1.20
	external/mit/xorg/lib/driver.mk: revision 1.1
	external/mit/xorg/lib/dri/r600/Makefile: file removal
	external/mit/xorg/lib/dri/r128/Makefile: file removal
	external/mit/xorg/lib/dri/i915/Makefile: file removal
	external/mit/xorg/lib/dri/Makefile: revision 1.23
	external/mit/xorg/lib/gallium/Makefile: revision 1.1
	external/mit/xorg/lib/gallium/Makefile: revision 1.2
	distrib/sets/lists/xcomp/mi: revision 1.154
	external/mit/xorg/lib/libOSMesa/libmesa.mk: file removal
	external/mit/xorg/lib/libGL/mesa-ver.mk: revision 1.2
	distrib/sets/lists/xserver/mi: revision 1.34
	external/mit/xorg/bin/glxgears/Makefile: revision 1.4
	distrib/sets/lists/xserver/md.alpha: revision 1.38
	external/mit/xorg/lib/libOSMesa/shlib_version: file removal
	external/mit/xorg/lib/dri/trident/Makefile: file removal
	external/mit/xorg/lib/dri/i810/Makefile: file removal
	external/mit/xorg/lib/libGLw/Makefile: revision 1.4
	external/mit/xorg/TODO: file removal
	external/mit/xorg/lib/dri/sis/Makefile: file removal
	distrib/sets/lists/xserver/md.sparc: revision 1.57
	distrib/sets/lists/xserver/md.prep: revision 1.15
	distrib/sets/lists/xcomp/shl.mi: revision 1.38
	external/mit/xorg/lib/dri/tdfx/Makefile: file removal
	external/mit/xorg/lib/dri/mga/Makefile: file removal
	distrib/sets/lists/xdebug/md.macppc: revision 1.4
	external/mit/xorg/lib/libOSMesa/Makefile: file removal
	distrib/sets/lists/xdebug/shl.mi: revision 1.16
	external/mit/xorg/lib/libGL/Makefile.mesa: file removal
	distrib/sets/lists/xdebug/mi: revision 1.9
	distrib/sets/lists/xdebug/md.i386: revision 1.7
	external/mit/xorg/lib/dri/swrast/Makefile: file removal
	distrib/sets/lists/xdebug/md.i386: revision 1.8
	external/mit/xorg/lib/dri/savage/Makefile: file removal
	external/mit/xorg/lib/dri/r200/Makefile: file removal
	distrib/sets/lists/xetc/mi: revision 1.24
	distrib/sets/lists/xbase/shl.mi: revision 1.57
	distrib/sets/lists/xdebug/md.sparc: revision 1.5
	external/mit/xorg/lib/dri/i965/Makefile: file removal
	external/mit/xorg/lib/libloader.mk: revision 1.1
	external/mit/xorg/bin/glxinfo/Makefile: revision 1.5
	distrib/sets/lists/xserver/md.ofppc: revision 1.20
	external/mit/xorg/lib/libmesa.mk: revision 1.1
	external/mit/xorg/lib/dri/libmesa/Makefile: file removal
	external/mit/xorg/lib/dri/Makefile: revision 1.19
	distrib/sets/lists/xserver/md.amd64: revision 1.74
	distrib/sets/lists/xserver/md.bebox: revision 1.11
	distrib/sets/lists/xdebug/md.ofppc: revision 1.4
	external/mit/xorg/lib/libglsl.mk: revision 1.1
	external/mit/xorg/lib/dri/r300/Makefile: file removal
	external/mit/xorg/lib/dri/unichrome/Makefile: file removal
	external/mit/xorg/lib/dri/s3v/Makefile: file removal
	distrib/sets/lists/xserver/md.i386: revision 1.93
update sets and reachover makefiles for mesa 10.3.5.
fix build problem with radeon_*.c files.
- mesa_dri_drivers.so.0.debug is not obsolete for amd64
- kms_swrast_dri.so.0.debug was missing
- Don't install absolute symlinks
- Add missing debug symlinks
- consistently install symlinks (like we do for everything else)
- add missing debug libs
@
text
@a0 477
# $NetBSD: Makefile,v 1.1 2014/12/18 06:24:30 mrg Exp $

# Link the gallium mega driver.

LIBISMODULE=	yes
LIBISCXX=     yes

.include <bsd.own.mk>

SHLIB_MAJOR=    0

LIB=		gallium_dri
DRIDIR=		${X11USRLIBDIR}/modules/dri
DRIDEBUGDIR=	${DEBUGDIR}${X11USRLIBDIR}/modules/dri

DRIVERS=	kms_swrast swrast
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
DRIVERS+=	r600
.endif

CPPFLAGS+= \
	-I${DESTDIR}${X11INCDIR}/libdrm

# cargo culted.
#CPPFLAGS+= -D_NETBSD_SOURCE -DPTHREADS

GALLIUM_SUBDIRS= \
	auxiliary \
	auxiliary/cso_cache \
	auxiliary/draw \
	auxiliary/hud \
	auxiliary/indices \
	auxiliary/os \
	auxiliary/pipebuffer \
	auxiliary/postprocess \
	auxiliary/rbug \
	auxiliary/rtasm \
	auxiliary/tgsi \
	auxiliary/translate \
	auxiliary/util \
	auxiliary/vl \
	drivers/galahad \
	drivers/identity \
	drivers/noop \
	drivers/trace \
	drivers/rbug \
	drivers/radeon \
	drivers/r600 \
	drivers/r600/sb \
	drivers/softpipe \
	winsys/radeon/drm \
	winsys/sw/null \
	winsys/sw/dri \
	winsys/sw/kms-dri \
	state_trackers/dri

GALLIUM_NAMES=	kms_swrast r600 swrant

GALLIUM_SOURCES.auxiliary/cso_cache= \
	cso_cache.c \
	cso_context.c \
	cso_hash.c
GALLIUM_SOURCES.auxiliary/draw= \
	draw_context.c \
	draw_fs.c \
	draw_gs.c \
	draw_pipe.c \
	draw_pipe_aaline.c \
	draw_pipe_aapoint.c \
	draw_pipe_clip.c \
	draw_pipe_cull.c \
	draw_pipe_flatshade.c \
	draw_pipe_offset.c \
	draw_pipe_pstipple.c \
	draw_pipe_stipple.c \
	draw_pipe_twoside.c \
	draw_pipe_unfilled.c \
	draw_pipe_util.c \
	draw_pipe_validate.c \
	draw_pipe_vbuf.c \
	draw_pipe_wide_line.c \
	draw_pipe_wide_point.c \
	draw_prim_assembler.c \
	draw_pt.c \
	draw_pt_emit.c \
	draw_pt_fetch.c \
	draw_pt_fetch_emit.c \
	draw_pt_fetch_shade_emit.c \
	draw_pt_fetch_shade_pipeline.c \
	draw_pt_post_vs.c \
	draw_pt_so_emit.c \
	draw_pt_util.c \
	draw_pt_vsplit.c \
	draw_vertex.c \
	draw_vs.c \
	draw_vs_exec.c \
	draw_vs_variant.c
GALLIUM_SOURCES.auxiliary/hud= \
	font.c \
	hud_context.c \
	hud_cpu.c \
	hud_fps.c \
	hud_driver_query.c
GALLIUM_SOURCES.auxiliary/indices= \
	u_primconvert.c
GALLIUM_SOURCES.auxiliary/os= \
	os_misc.c \
	os_process.c \
	os_time.c
GALLIUM_SOURCES.auxiliary/pipebuffer= \
	pb_buffer_fenced.c \
	pb_buffer_malloc.c \
	pb_bufmgr_alt.c \
	pb_bufmgr_cache.c \
	pb_bufmgr_debug.c \
	pb_bufmgr_mm.c \
	pb_bufmgr_ondemand.c \
	pb_bufmgr_pool.c \
	pb_bufmgr_slab.c \
	pb_validate.c
GALLIUM_SOURCES.auxiliary/postprocess= \
	pp_celshade.c \
	pp_colors.c \
	pp_init.c \
	pp_mlaa.c \
	pp_run.c \
	pp_program.c
GALLIUM_SOURCES.auxiliary/rbug= \
	rbug_connection.c \
	rbug_context.c \
	rbug_core.c \
	rbug_demarshal.c \
	rbug_texture.c \
	rbug_shader.c
GALLIUM_SOURCES.auxiliary/rtasm= \
	rtasm_cpu.c \
	rtasm_execmem.c \
	rtasm_x86sse.c
GALLIUM_SOURCES.auxiliary/tgsi= \
	tgsi_build.c \
	tgsi_dump.c \
	tgsi_exec.c \
	tgsi_info.c \
	tgsi_iterate.c \
	tgsi_parse.c \
	tgsi_sanity.c \
	tgsi_scan.c \
	tgsi_strings.c \
	tgsi_text.c \
	tgsi_transform.c \
	tgsi_ureg.c \
	tgsi_util.c
GALLIUM_SOURCES.auxiliary/translate= \
	translate.c \
	translate_cache.c \
	translate_generic.c \
	translate_sse.c
GALLIUM_SOURCES.auxiliary/util= \
	u_debug.c \
	u_debug_describe.c \
	u_debug_flush.c \
	u_debug_memory.c \
	u_debug_refcnt.c \
	u_debug_stack.c \
	u_debug_symbol.c \
	u_dump_defines.c \
	u_dump_state.c \
	u_bitmask.c \
	u_blit.c \
	u_blitter.c \
	u_cache.c \
	u_caps.c \
	u_cpu_detect.c \
	u_dl.c \
	u_draw.c \
	u_draw_quad.c \
	u_format.c \
	u_format_other.c \
	u_format_latc.c \
	u_format_s3tc.c \
	u_format_rgtc.c \
	u_format_etc.c \
	u_format_bptc.c \
	u_format_tests.c \
	u_format_yuv.c \
	u_format_zs.c \
	u_framebuffer.c \
	u_gen_mipmap.c \
	u_handle_table.c \
	u_hash.c \
	u_hash_table.c \
	u_helpers.c \
	u_index_modify.c \
	u_keymap.c \
	u_linear.c \
	u_linkage.c \
	u_network.c \
	u_math.c \
	u_mm.c \
	u_pstipple.c \
	u_ringbuffer.c \
	u_sampler.c \
	u_simple_shaders.c \
	u_slab.c \
	u_snprintf.c \
	u_staging.c \
	u_suballoc.c \
	u_surface.c \
	u_surfaces.c \
	u_texture.c \
	u_tile.c \
	u_transfer.c \
	u_resource.c \
	u_upload_mgr.c \
	u_vbuf.c
GALLIUM_SOURCES.auxiliary/vl= \
	vl_csc.c \
	vl_compositor.c \
	vl_matrix_filter.c \
	vl_median_filter.c \
	vl_decoder.c \
	vl_mpeg12_decoder.c \
	vl_mpeg12_bitstream.c \
	vl_zscan.c \
	vl_idct.c \
	vl_mc.c \
	vl_vertex_buffers.c \
	vl_video_buffer.c \
	vl_deint_filter.c

# Generated
.PATH: ${X11SRCDIR.MesaLib}/../src/gallium/auxiliary
GALLIUM_SOURCES.auxiliary= \
	u_indices_gen.c \
	u_unfilled_gen.c \
	u_format_table.c
.for _f in ${GALLIUM_SOURCES.auxiliary}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.MesaLib}/src/gallium/auxiliary/util
.endfor

GALLIUM_SOURCES.drivers/galahad= \
	glhd_objects.c \
	glhd_context.c \
	glhd_screen.c

GALLIUM_SOURCES.drivers/identity = \
        id_objects.c \
        id_context.c \
        id_screen.c

GALLIUM_SOURCES.drivers/noop = \
        noop_pipe.c \
        noop_state.c

GALLIUM_SOURCES.drivers/trace = \
        tr_context.c \
        tr_dump.c \
        tr_dump_state.c \
        tr_screen.c \
        tr_texture.c

GALLIUM_SOURCES.drivers/rbug = \
        DRIVERrbug_core.c \
        DRIVERrbug_context.c \
        rbug_objects.c \
        rbug_screen.c
# Conflicts with auxiliary/rbug/ files
BUILDSYMLINKS+=	${X11SRCDIR.MesaLib}/src/gallium/drivers/rbug/rbug_core.c    DRIVERrbug_core.c
BUILDSYMLINKS+=	${X11SRCDIR.MesaLib}/src/gallium/drivers/rbug/rbug_context.c DRIVERrbug_context.c
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/auxiliary
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers/rbug
CPPFLAGS.DRIVERrbug_core.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/auxiliary
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers/rbug
CPPFLAGS.DRIVERrbug_context.c+=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers

GALLIUM_SOURCES.drivers/radeon = \
        cayman_msaa.c \
        r600_buffer_common.c \
        r600_pipe_common.c \
        r600_query.c \
        r600_streamout.c \
        r600_texture.c \
        radeon_video.c \
        radeon_uvd.c \
        radeon_vce.c \
        radeon_vce_40_2_2.c
#LLVM_C_FILES := \
#        radeon_elf_util.c \
#        radeon_setup_tgsi_llvm.c \
#        radeon_llvm_emit.c \
#        radeon_llvm_util.c

GALLIUM_SOURCES.drivers/r600 = \
        r600_asm.c \
        r600_blit.c \
        r600_hw_context.c \
        r600_isa.c \
        r600_pipe.c \
        r600_shader.c \
        r600_state.c \
        r700_asm.c \
        evergreen_hw_context.c \
        evergreen_state.c \
        eg_asm.c \
        r600_state_common.c \
        evergreen_compute.c \
        compute_memory_pool.c \
        r600_uvd.c
GALLIUM_SOURCES.drivers/r600/sb = \
        sb_bc_builder.cpp \
        sb_bc_decoder.cpp \
        sb_bc_dump.cpp \
        sb_bc_finalize.cpp \
        sb_bc_parser.cpp \
        sb_context.cpp \
        sb_core.cpp \
        sb_dce_cleanup.cpp \
        sb_def_use.cpp \
        sb_dump.cpp \
        sb_expr.cpp \
        sb_gcm.cpp \
        sb_gvn.cpp \
        sb_if_conversion.cpp \
        sb_ir.cpp \
        sb_liveness.cpp \
        sb_pass.cpp \
        sb_peephole.cpp \
        sb_psi_ops.cpp \
        sb_ra_checker.cpp \
        sb_ra_coalesce.cpp \
        sb_ra_init.cpp \
        sb_sched.cpp \
        sb_shader.cpp \
        sb_ssa_builder.cpp \
        sb_valtable.cpp
#LLVM_C_SOURCES = r600_llvm.c

.for _f in ${GALLIUM_SOURCES.drivers/r600} ${GALLIUM_SOURCES.drivers/r600/sb}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers/r600
.endfor



GALLIUM_SOURCES.winsys/radeon/drm = \
        radeon_drm_bo.c \
        radeon_drm_cs.c \
        radeon_drm_cs_dump.c \
        radeon_drm_winsys.c

GALLIUM_SOURCES.drivers/softpipe = \
        sp_fs_exec.c \
        sp_clear.c \
        sp_fence.c \
        sp_flush.c \
        sp_query.c \
        sp_context.c \
        sp_draw_arrays.c \
        sp_prim_vbuf.c \
        sp_quad_pipe.c \
        sp_quad_stipple.c \
        sp_quad_depth_test.c \
        sp_quad_fs.c \
        sp_quad_blend.c \
        sp_screen.c \
        sp_setup.c \
        sp_state_blend.c \
        sp_state_clip.c \
        sp_state_derived.c \
        sp_state_sampler.c \
        sp_state_shader.c \
        sp_state_so.c \
        sp_state_rasterizer.c \
        sp_state_surface.c \
        sp_state_vertex.c \
        sp_texture.c \
        sp_tex_sample.c \
        sp_tex_tile_cache.c \
        sp_tile_cache.c \
        sp_surface.c

GALLIUM_SOURCES.winsys/sw/null = \
	null_sw_winsys.c

GALLIUM_SOURCES.winsys/sw/dri = \
	dri_sw_winsys.c

GALLIUM_SOURCES.winsys/sw/kms-dri = \
	kms_dri_sw_winsys.c

GALLIUM_SOURCES.state_trackers/dri = \
        dri_context.c \
        dri_drawable.c \
        dri_query_renderer.c \
        dri_screen.c \
	drisw.c \
	dri2.c
.for _f in ${GALLIUM_SOURCES.state_trackers/dri}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.MesaLib}/src/gallium/state_trackers/dri/common
.endfor

# missing
CPPFLAGS+=	\
	-DGALLIUM_SOFTPIPE \
	-DGALLIUM_STATIC_TARGETS=1 \
	-DMESA_EGL_NO_X11_HEADERS \

.for _d in ${GALLIUM_SUBDIRS}
SRCS+=	${GALLIUM_SOURCES.${_d}}
.PATH: ${X11SRCDIR.MesaLib}/src/gallium/${_d}
.endfor

#. if defined(${GALLIUM_SOURCES.${_d}})
#SRCS+=	${GALLIUM_SOURCES.${_d}}
#. endif

.include "../libloader.mk"

LIBDPLIBS+=	m		${.CURDIR}/../../../../../lib/libm
LIBDPLIBS+= 	drm		${.CURDIR}/../libdrm
LIBDPLIBS+= 	drm_radeon	${.CURDIR}/../libdrm_radeon
LIBDPLIBS+= 	glapi		${.CURDIR}/../libglapi
LIBDPLIBS+=	expat		${.CURDIR}/../../../../../external/mit/expat/lib/libexpat

LDFLAGS+=	-Wl,--version-script=${X11SRCDIR.MesaLib}/src/gallium/targets/dri/dri.sym

##  build mesagallium parts
MESA_SRC_MODULES=  main math vbo state_tracker program asm_s
.include "../libmesa.mk"
.include "../libglsl.mk"

# Special addition for just gallium; it misses the rest of asm_c files.
.PATH: ${X11SRCDIR.MesaLib}/src/mesa/x86
SRCS+=	common_x86.c

.if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
SRCS+=	streaming-load-memcpy.c
CFLAGS.streaming-load-memcpy.c+= -msse4.1
.endif

.include "../driver.mk"


.PATH: ${X11SRCDIR.MesaLib}/src/gallium/targets/dri
SRCS+=	target.c

CPPFLAGS+= \
	-I${X11SRCDIR.MesaLib}/src/gallium/include \
	-I${X11SRCDIR.MesaLib}/src/gallium/auxiliary \
	-I${X11SRCDIR.MesaLib}/src/gallium/drivers \
	-I${X11SRCDIR.MesaLib}/../src/mesa/drivers/dri/common

CPPFLAGS.target.c += \
	-DDRI_TARGET \
	-DGALLIUM_GALAHAD \
	-DGALLIUM_NOOP \
	-DGALLIUM_RBUG \
	-DGALLIUM_TRACE \
	-DGALLIUM_R200 \
	-DGALLIUM_R600 \
	-DGALLIUM_SOFTPIPE \
	-I${X11SRCDIR.MesaLib}/src/gallium/state_trackers/dri \
	-I${X11SRCDIR.MesaLib}/src/loader \
	-I${X11SRCDIR.MesaLib}/src/gallium/winsys

.include <bsd.x11.mk>
LIBDIR=		${X11USRLIBDIR}/modules/dri

.for _d in ${DRIVERS}
SYMLINKS+= gallium_dri.so ${DRIDIR}/${_d}_dri.so
SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.${SHLIB_MAJOR} 
.if ${MKDEBUG:Uno} == "yes"
SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHLIB_MAJOR}.debug
.endif
.endfor

.include <bsd.lib.mk>
@


1.6.2.3
log
@Pull up following revision(s) (requested by mrg in ticket #381):
	external/mit/xorg/lib/dri/Makefile: revision 1.21,1.22,1.24-1.26
	external/mit/xorg/lib/gallium/Makefile: revision 1.3-1.6

Fix yacc (.y->.c) handling.
Make it compile with clang.
Fix MKDEBUG handling.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6.2.2 2015/01/05 21:23:51 martin Exp $
a465 8
CWARNFLAGS.clang+=	-Wno-error=constant-conversion \
			-Wno-error=tautological-constant-out-of-range-compare \
			-Wno-error=pointer-sign \
			-Wno-error=switch \
			-Wno-error=absolute-value \
			-Wno-error=tautological-compare \
			-Wno-error=static-in-inline

d472 1
a472 1
.if ${MKDEBUG} != "no"
a477 2
# Don't regenerate c files
.y.c:
@


1.6.2.3.4.1
log
@Sync with netbsd-5
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6.2.5 2016/12/14 10:50:52 martin Exp $
d16 10
a25 1
CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/libdrm
d47 3
d51 1
a56 33
GALLIUM_SUBDIRS_ATI= \
	drivers/radeon \
	drivers/r600 \
	drivers/r600/sb \
	winsys/radeon/drm

GALLIUM_SUBDIRS_NOUVEAU= \
	drivers/nouveau \
	drivers/nouveau/nv30 \
	drivers/nouveau/nv50 \
	drivers/nouveau/codegen \
	drivers/nouveau/nvc0 \
	winsys/nouveau/drm

BUILD_RADEON=0
BUILD_NOUVEAU=0
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
BUILD_RADEON=1
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
BUILD_NOUVEAU=1
.endif

DRIVERS=		kms_swrast swrast
.if ${BUILD_RADEON} == 1
DRIVERS+=		r600
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_ATI}
.endif
.if ${BUILD_NOUVEAU} == 1
DRIVERS+=		nouveau
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_NOUVEAU}
.endif

a342 110
GALLIUM_SOURCES.drivers/nouveau = \
	nouveau_screen.c \
	nouveau_fence.c \
	nouveau_mm.c \
	nouveau_buffer.c \
	nouveau_heap.c \
	nouveau_video.c \
	nouveau_vp3_video.c \
	nouveau_vp3_video_bsp.c \
	nouveau_vp3_video_vp.c

GALLIUM_SOURCES.drivers/nouveau/nv30 = \
	nv30_screen.c \
	nv30_context.c \
	nv30_format.c \
	nv30_resource.c \
	nv30_transfer.c \
	nv30_miptree.c \
	nv30_state.c \
	nv30_state_validate.c \
	nv30_texture.c \
	nv30_fragtex.c \
	nv40_verttex.c \
	nv30_fragprog.c \
	nv30_vertprog.c \
	nv30_clear.c \
	nv30_vbo.c \
	nv30_push.c \
	nv30_draw.c \
	nv30_query.c \
	nvfx_vertprog.c \
	nvfx_fragprog.c

GALLIUM_SOURCES.drivers/nouveau/nv50 = \
	nv50_context.c \
	nv50_formats.c \
	nv50_miptree.c \
	nv50_resource.c \
	nv50_screen.c \
	nv50_state.c \
	nv50_state_validate.c \
	nv50_surface.c \
	nv50_tex.c \
	nv50_transfer.c \
	nv50_vbo.c \
	nv50_program.c \
	nv50_shader_state.c \
	nv50_push.c \
	nv50_query.c \
	nv84_video.c \
	nv84_video_bsp.c \
	nv84_video_vp.c \
	nv98_video.c \
	nv98_video_bsp.c \
	nv98_video_vp.c \
	nv98_video_ppp.c

GALLIUM_SOURCES.drivers/nouveau/codegen = \
	nv50_ir.cpp \
	nv50_ir_bb.cpp \
	nv50_ir_build_util.cpp \
	nv50_ir_emit_nv50.cpp \
	nv50_ir_from_tgsi.cpp \
	nv50_ir_graph.cpp \
	nv50_ir_lowering_nv50.cpp \
	nv50_ir_peephole.cpp \
	nv50_ir_print.cpp \
	nv50_ir_ra.cpp \
	nv50_ir_ssa.cpp \
	nv50_ir_target.cpp \
	nv50_ir_target_nv50.cpp \
	nv50_ir_util.cpp \
	nv50_ir_emit_nvc0.cpp \
	nv50_ir_emit_gk110.cpp \
	nv50_ir_emit_gm107.cpp \
	nv50_ir_lowering_nvc0.cpp \
	nv50_ir_lowering_gm107.cpp \
	nv50_ir_target_nvc0.cpp \
	nv50_ir_target_gm107.cpp

GALLIUM_SOURCES.drivers/nouveau/nvc0 = \
	nvc0_compute.c \
	nvc0_context.c \
	nvc0_formats.c \
	nvc0_miptree.c \
	nvc0_resource.c \
	nvc0_screen.c \
	nvc0_state.c \
	nvc0_state_validate.c \
	nvc0_surface.c \
	nvc0_tex.c \
	nvc0_transfer.c \
	nvc0_vbo.c \
	nvc0_vbo_translate.c \
	nvc0_program.c \
	nvc0_shader_state.c \
	nvc0_query.c \
	nve4_compute.c \
	nvc0_video.c \
	nvc0_video_bsp.c \
	nvc0_video_vp.c \
	nvc0_video_ppp.c

.for _f in ${GALLIUM_SOURCES.drivers/nouveau} \
	   ${GALLIUM_SOURCES.drivers/nouveau/nv30} \
	   ${GALLIUM_SOURCES.drivers/nouveau/nv50} \
	   ${GALLIUM_SOURCES.drivers/nouveau/codegen} \
	   ${GALLIUM_SOURCES.drivers/nouveau/nvc0}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers/nouveau
.endfor
a350 3
GALLIUM_SOURCES.winsys/nouveau/drm = \
        nouveau_drm_winsys.c

a418 1

a419 1
.if ${BUILD_RADEON} == 1 || ${BUILD_NOUVEAU} == 1
a420 1
.if ${BUILD_RADEON} == 1
a421 5
.endif	# ${BUILD_RADEON} == 1
.if ${BUILD_NOUVEAU} == 1
LIBDPLIBS+= 	drm_nouveau	${.CURDIR}/../libdrm_nouveau
.endif	# ${BUILD_NOUVEAU} == 1
.endif	# ${BUILD_RADEON} == 1 || ${BUILD_NOUVEAU} == 1
d459 2
a465 11
.if ${BUILD_RADEON} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_R200 \
	-DGALLIUM_R600
.endif	# ${BUILD_RADEON} == 1

.if ${BUILD_NOUVEAU} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_NOUVEAU
.endif	# ${BUILD_NOUVEAU} == 1

@


1.6.2.4
log
@Pull up following revision(s) (requested by snj in ticket #1305):
	distrib/sets/lists/xbase/md.amd64: revision 1.15 via patch
	distrib/sets/lists/xbase/md.i386: revision 1.29
	distrib/sets/lists/xcomp/md.amd64: revision 1.43 via patch
	distrib/sets/lists/xcomp/md.i386: revision 1.48 via patch
	distrib/sets/lists/xcomp/mi: revision 1.175
	distrib/sets/lists/xdebug/md.amd64: revision 1.22 via patch
	distrib/sets/lists/xdebug/md.i386: revision 1.21 via patch
	distrib/sets/lists/xserver/md.amd64: revisions 1.85-1.87
	distrib/sets/lists/xserver/md.i386: revision 1.103-1.105
	external/mit/xorg/lib/Makefile: revision 1.36
	external/mit/xorg/lib/gallium/Makefile: revision 1.8, 1.9
	external/mit/xorg/lib/libdrm/drm/Makefile: revision 1.7
	external/mit/xorg/lib/libdrm_nouveau/Makefile: revision 1.1
	external/mit/xorg/lib/libdrm_nouveau/shlib_version: revision 1.1
	external/mit/xorg/server/drivers/Makefile: revision 1.70
	external/mit/xorg/server/drivers/xf86-video-nouveau/Makefile: revisions 1.1, 1.2 via patch
	share/mk/bsd.own.mk: revision 1.875 via patch
Build xf86-video-nouveau and libdrm_nouveau on x86.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6.2.3 2015/01/06 11:00:40 martin Exp $
d18 1
a18 1
DRIVERS+=	r600 nouveau
a49 5
	drivers/nouveau \
	drivers/nouveau/nv30 \
	drivers/nouveau/nv50 \
	drivers/nouveau/codegen \
	drivers/nouveau/nvc0 \
a51 1
	winsys/nouveau/drm \
a342 110
GALLIUM_SOURCES.drivers/nouveau = \
	nouveau_screen.c \
	nouveau_fence.c \
	nouveau_mm.c \
	nouveau_buffer.c \
	nouveau_heap.c \
	nouveau_video.c \
	nouveau_vp3_video.c \
	nouveau_vp3_video_bsp.c \
	nouveau_vp3_video_vp.c

GALLIUM_SOURCES.drivers/nouveau/nv30 = \
	nv30_screen.c \
	nv30_context.c \
	nv30_format.c \
	nv30_resource.c \
	nv30_transfer.c \
	nv30_miptree.c \
	nv30_state.c \
	nv30_state_validate.c \
	nv30_texture.c \
	nv30_fragtex.c \
	nv40_verttex.c \
	nv30_fragprog.c \
	nv30_vertprog.c \
	nv30_clear.c \
	nv30_vbo.c \
	nv30_push.c \
	nv30_draw.c \
	nv30_query.c \
	nvfx_vertprog.c \
	nvfx_fragprog.c

GALLIUM_SOURCES.drivers/nouveau/nv50 = \
	nv50_context.c \
	nv50_formats.c \
	nv50_miptree.c \
	nv50_resource.c \
	nv50_screen.c \
	nv50_state.c \
	nv50_state_validate.c \
	nv50_surface.c \
	nv50_tex.c \
	nv50_transfer.c \
	nv50_vbo.c \
	nv50_program.c \
	nv50_shader_state.c \
	nv50_push.c \
	nv50_query.c \
	nv84_video.c \
	nv84_video_bsp.c \
	nv84_video_vp.c \
	nv98_video.c \
	nv98_video_bsp.c \
	nv98_video_vp.c \
	nv98_video_ppp.c

GALLIUM_SOURCES.drivers/nouveau/codegen = \
	nv50_ir.cpp \
	nv50_ir_bb.cpp \
	nv50_ir_build_util.cpp \
	nv50_ir_emit_nv50.cpp \
	nv50_ir_from_tgsi.cpp \
	nv50_ir_graph.cpp \
	nv50_ir_lowering_nv50.cpp \
	nv50_ir_peephole.cpp \
	nv50_ir_print.cpp \
	nv50_ir_ra.cpp \
	nv50_ir_ssa.cpp \
	nv50_ir_target.cpp \
	nv50_ir_target_nv50.cpp \
	nv50_ir_util.cpp \
	nv50_ir_emit_nvc0.cpp \
	nv50_ir_emit_gk110.cpp \
	nv50_ir_emit_gm107.cpp \
	nv50_ir_lowering_nvc0.cpp \
	nv50_ir_lowering_gm107.cpp \
	nv50_ir_target_nvc0.cpp \
	nv50_ir_target_gm107.cpp

GALLIUM_SOURCES.drivers/nouveau/nvc0 = \
	nvc0_compute.c \
	nvc0_context.c \
	nvc0_formats.c \
	nvc0_miptree.c \
	nvc0_resource.c \
	nvc0_screen.c \
	nvc0_state.c \
	nvc0_state_validate.c \
	nvc0_surface.c \
	nvc0_tex.c \
	nvc0_transfer.c \
	nvc0_vbo.c \
	nvc0_vbo_translate.c \
	nvc0_program.c \
	nvc0_shader_state.c \
	nvc0_query.c \
	nve4_compute.c \
	nvc0_video.c \
	nvc0_video_bsp.c \
	nvc0_video_vp.c \
	nvc0_video_ppp.c

.for _f in ${GALLIUM_SOURCES.drivers/nouveau} \
	   ${GALLIUM_SOURCES.drivers/nouveau/nv30} \
	   ${GALLIUM_SOURCES.drivers/nouveau/nv50} \
	   ${GALLIUM_SOURCES.drivers/nouveau/codegen} \
	   ${GALLIUM_SOURCES.drivers/nouveau/nvc0}
CPPFLAGS.${_f} +=	-I${X11SRCDIR.MesaLib}/src/gallium/drivers/nouveau
.endfor
a350 3
GALLIUM_SOURCES.winsys/nouveau/drm = \
        nouveau_drm_winsys.c

a421 1
LIBDPLIBS+= 	drm_nouveau	${.CURDIR}/../libdrm_nouveau
a460 1
	-DGALLIUM_NOUVEAU \
@


1.6.2.5
log
@Pull up revisions 1.11 and 1.15, requested by snj in #1305:

don't look for libdrm_nouveau unless we've built it.
only build the radeon and nouveau drivers on i386/amd64/evbarm,
where they're useful.  this saves almost 2MB in text/data on shark.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6.2.4 2016/12/12 09:32:35 msaitoh Exp $
d16 10
a25 1
CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/libdrm
a46 7
	drivers/softpipe \
	winsys/sw/null \
	winsys/sw/dri \
	winsys/sw/kms-dri \
	state_trackers/dri

GALLIUM_SUBDIRS_ATI= \
a49 3
	winsys/radeon/drm

GALLIUM_SUBDIRS_NOUVEAU= \
d55 7
a61 20
	winsys/nouveau/drm

BUILD_RADEON=0
BUILD_NOUVEAU=0
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
BUILD_RADEON=1
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
BUILD_NOUVEAU=1
.endif

DRIVERS=		kms_swrast swrast
.if ${BUILD_RADEON} == 1
DRIVERS+=		r600
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_ATI}
.endif
.if ${BUILD_NOUVEAU} == 1
DRIVERS+=		nouveau
GALLIUM_SUBDIRS+=	${GALLIUM_SUBDIRS_NOUVEAU}
.endif
a537 1

a538 1
.if ${BUILD_RADEON} == 1 || ${BUILD_NOUVEAU} == 1
a539 1
.if ${BUILD_RADEON} == 1
a540 2
.endif	# ${BUILD_RADEON} == 1
.if ${BUILD_NOUVEAU} == 1
a541 2
.endif	# ${BUILD_NOUVEAU} == 1
.endif	# ${BUILD_RADEON} == 1 || ${BUILD_NOUVEAU} == 1
d579 3
a586 11
.if ${BUILD_RADEON} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_R200 \
	-DGALLIUM_R600
.endif	# ${BUILD_RADEON} == 1

.if ${BUILD_NOUVEAU} == 1
CPPFLAGS.target.c += \
	-DGALLIUM_NOUVEAU
.endif	# ${BUILD_NOUVEAU} == 1

@


1.5
log
@Test for ${MKDEBUG} using the same construct as in other places, so that
we get consistent behavior when the value is neither "no" nor "yes".
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.4 2015/01/05 01:34:42 joerg Exp $
d471 2
a472 1
			-Wno-error=tautological-compare
@


1.4
log
@Make a number of clang warnings non-fatal, too many changes with little
gain.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.3 2015/01/04 01:26:31 christos Exp $
d479 1
a479 1
.if ${MKDEBUG:Uno} == "yes"
@


1.3
log
@don't regenerate y->
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.2 2014/12/23 17:49:59 christos Exp $
d466 7
@


1.2
log
@- Don't install absolute symlinks
- Add missing debug symlinks
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.1 2014/12/18 06:24:30 mrg Exp $
d478 2
@


1.1
log
@update sets and reachover makefiles for mesa 10.3.5.
@
text
@d1 1
a1 1
# $NetBSD$
d14 1
d470 5
a474 2
SYMLINKS+= ${DRIDIR}/gallium_dri.so ${DRIDIR}/${_d}_dri.so
SYMLINKS+= ${DRIDIR}/gallium_dri.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.${SHLIB_MAJOR} 
@

