gdk: select pixelops sources by target architecture

This commit is contained in:
Daemonratte 2026-08-11 19:26:17 +02:00
commit 74635ad98b
4 changed files with 70 additions and 1 deletions

View file

@ -117,6 +117,54 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
AC_CANONICAL_HOST
AC_MSG_CHECKING([for GDK pixel operations target architecture])
case "$host_cpu" in
i?86 | x86_64 | amd64)
gdk_pixelops_arch=x86
;;
arm* | aarch64*)
gdk_pixelops_arch=arm
;;
powerpc* | ppc*)
gdk_pixelops_arch=powerpc
;;
mips*)
gdk_pixelops_arch=mips
;;
riscv*)
gdk_pixelops_arch=riscv
;;
loongarch*)
gdk_pixelops_arch=loongarch
;;
sparc*)
gdk_pixelops_arch=sparc
;;
alpha*)
gdk_pixelops_arch=alpha
;;
hppa* | parisc*)
gdk_pixelops_arch=hppa
;;
m68k*)
gdk_pixelops_arch=m68k
;;
s390*)
gdk_pixelops_arch=s390
;;
sh*)
gdk_pixelops_arch=sh
;;
*)
gdk_pixelops_arch=generic
;;
esac
AC_MSG_RESULT([$gdk_pixelops_arch])
AM_CONDITIONAL(GDK_PIXELOPS_X86,
test "$gdk_pixelops_arch" = x86)
MATH_LIB=-lm
AC_MSG_CHECKING([for native Win32])
LIB_EXE_MACHINE_FLAG=X86

View file

@ -119,8 +119,15 @@ gdk_private_headers = \
gdkpoly-generic.h \
gdkregion-generic.h
gdk_pixelops_arch_sources =
if GDK_PIXELOPS_X86
gdk_pixelops_arch_sources += gdkpixelops-x86.c
endif
gdk_pixelops_private_sources = \
gdkpixelops-generic.c
gdkpixelops-generic.c \
$(gdk_pixelops_arch_sources)
gdk_c_sources = \
$(medialib_sources) \

13
gdk/gdkpixelops-x86.c Normal file
View file

@ -0,0 +1,13 @@
/* GDK - The GIMP Drawing Kit
*
* x86 pixel operation backend.
*
* This file is selected at build time only for x86 targets.
*/
#include "config.h"
#if !defined(__i386__) && !defined(__x86_64__) && \
!defined(_M_IX86) && !defined(_M_X64)
#error "gdkpixelops-x86.c must only be built for an x86 target"
#endif

View file

@ -74,6 +74,7 @@ gdk_OBJECTS = \
gdkdraw.obj \
gdkpixelops.obj \
gdkpixelops-generic.obj \
gdkpixelops-x86.obj \
gdkenumtypes.obj \
gdkevents.obj \
gdkfont.obj \