From 5da1894d42faf007c0ece7a0a257102589d28e75 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 31 Jan 2025 08:18:03 +0000 Subject: [PATCH] allegro: add some hacks to make this build with llvm 19 Still builds on current i386, sparc64 and amd64 and unlocks half a dozen more ports. "i think this is fine" landry --- games/allegro/Makefile | 10 +++++++--- games/allegro/patches/patch-configure_in | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/games/allegro/Makefile b/games/allegro/Makefile index 70c3062e07c..6f2dc023846 100644 --- a/games/allegro/Makefile +++ b/games/allegro/Makefile @@ -4,7 +4,7 @@ COMMENT = game programming library for C/C++ developers V = 4.2.3 DISTNAME = allegro-$V -REVISION = 8 +REVISION = 9 CATEGORIES = games devel multimedia SHARED_LIBS = alleg 1.0 # 4.2 @@ -25,9 +25,11 @@ AUTOCONF_VERSION = 2.63 SUBST_VARS = V -WANTLIB = X11 Xcursor Xext Xpm Xxf86dga Xxf86vm c m \ +WANTLIB = ${COMPILER_LIBCXX} X11 Xcursor Xext Xpm Xxf86dga Xxf86vm c m \ sndio pthread +LDFLAGS += ${COMPILER_LIBCXX:S/^/-l/} + CONFIGURE_ARGS = --enable-artsdigi=no \ --enable-esddigi=no \ --enable-jackdigi=no \ @@ -38,8 +40,10 @@ CONFIGURE_ARGS = --enable-artsdigi=no \ # XXX work around bogus configure entry with clang CONFIGURE_ENV = allegro_cv_support_include_prefix=yes +CONFIGURE_ENV += LDFLAGS="${LDFLAGS}" + .if ${MACHINE_ARCH} == "i386" -CONFIGURE_ENV += LDFLAGS="-Wl,-znotext" +LDFLAGS += -Wl,-znotext .endif MAKE_ENV += shared_major_minor=${LIBalleg_VERSION} diff --git a/games/allegro/patches/patch-configure_in b/games/allegro/patches/patch-configure_in index 4fdb1db200b..559f5b51c1b 100644 --- a/games/allegro/patches/patch-configure_in +++ b/games/allegro/patches/patch-configure_in @@ -1,5 +1,6 @@ ---- configure.in.orig Sat Jul 14 21:46:22 2007 -+++ configure.in Wed Jan 13 01:30:01 2010 +Index: configure.in +--- configure.in.orig ++++ configure.in @@ -28,26 +28,26 @@ allegro_enable_asm=yes) dnl Enable 8-bpp color depth (default). AC_ARG_ENABLE(color8, @@ -177,3 +178,12 @@ fi ALLEGRO_SFLAGS="-x assembler-with-cpp" ALLEGRO_SHAREDLIB_CFLAGS="-fPIC -DALLEGRO_SHARED" +@@ -858,7 +873,7 @@ AC_SUBST(ALLEGRO_SHAREDLIB_CFLAGS) + + dnl How to compile C++ files. + if test "X$allegro_cv_support_cplusplus" = "Xyes"; then +- CXX="$CC" ++ CXX="${CXX}" + CXXFLAGS="-fno-exceptions $CFLAGS" + ALLEGRO_DEBUG_CXXFLAGS="-fno-exceptions $ALLEGRO_DEBUG_CFLAGS" + ALLEGRO_PROFILE_CXXFLAGS="-fno-exceptions $ALLEGRO_PROFILE_CFLAGS"