From a8f5291bd75343ae6e27984bd8eb6f87c3fcf059 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Thu, 17 Oct 2024 21:15:30 +0100 Subject: [PATCH] defs.mak.in: restore autoconf LIBS functionality This is a standard autoconf variable, it was probably disabled due to how the graphics/Makefile works and the more complex detection taking place there. Needed to use it to add -lpthread to some platforms (freebsd/openbsd) to make it build out the box. --- scripts/configure.in | 13 +++++++++++++ scripts/defs.mak.in | 1 + 2 files changed, 14 insertions(+) diff --git a/scripts/configure.in b/scripts/configure.in index 2932d674..312a779f 100644 --- a/scripts/configure.in +++ b/scripts/configure.in @@ -1401,6 +1401,19 @@ if test $usingX11 ; then gr_libs="$gr_libs \${X11_LDFLAGS}" fi +dnl We use GR_LIBS for graphics but some autoconf helpers might edit LIBS +dnl remove "-lcairo" from LIBS if present in GR_LIBS +for find in \ + cairo X11 GL GLU fontconfig freetype +do + if echo "$gr_libs" | grep -q -- "\-l${find}" ; then + dnl Not all sed support wildcard '\?' + LIBS=`echo "$LIBS" | sed -e "s/\-l${find} \?//" | tr -d '\n'` + LIBS=`echo "$LIBS" | sed -e "s/\-l${find} //" | tr -d '\n'` + LIBS=`echo "$LIBS" | sed -e "s/\-l${find}//" | tr -d '\n'` + fi +done + dnl ---------------------------------------------------------------- dnl Define system-specific settings dnl ---------------------------------------------------------------- diff --git a/scripts/defs.mak.in b/scripts/defs.mak.in index 0683b93e..2b418f00 100755 --- a/scripts/defs.mak.in +++ b/scripts/defs.mak.in @@ -46,6 +46,7 @@ LD_EXTRA_LIBS = @ld_extra_libs@ LD_SHARED = @ld_extra_objs@ TOP_EXTRA_LIBS = @top_extra_libs@ SUB_EXTRA_LIBS = @sub_extra_libs@ +LIBS = @LIBS@ MODULES += @modules@ UNUSED_MODULES += @unused@