From bcb679804b2040e3fee1e4f1ff05163674aa7f08 Mon Sep 17 00:00:00 2001
From: Albrecht Schlosser <albrechts.fltk@online.de>
Date: Tue, 21 Jan 2025 16:05:33 +0100
Subject: [PATCH] fltk-config: reorder include dirs of bundled image libs

1. prepend include dirs of bundled image libs and append Cairo include
   dirs and flags

2. remove forgotten debug statement from previous commit
---
 fltk-config.in | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fltk-config.in b/fltk-config.in
index d3ddcad3a..ee16204b5 100644
--- a/fltk-config.in
+++ b/fltk-config.in
@@ -71,7 +71,6 @@ CAIROLIBS="@CAIROLIBS@"
 GLLIBS="@GLLIBS@"
 
 # Check bundled image libraries in source tree
-echo "--- includedir='$includedir' ---"
 if test -f "$libdir/libfltk_jpeg.a" -a -d $includedir/jpeg; then
     CFLAGS="-I$includedir/jpeg $CFLAGS"
     CXXFLAGS="-I$includedir/jpeg $CXXFLAGS"
@@ -94,10 +93,10 @@ if test -d "$includedir/FL/images"; then
     CXXFLAGS="-I$includedir/FL/images $CXXFLAGS"
 fi
 
-# Cairo support
+# Cairo support: *append* CAIROFLAGS
 if test -n "$CAIROFLAGS"; then
-    CFLAGS="$CAIROFLAGS $CFLAGS"
-    CXXFLAGS="$CAIROFLAGS $CXXFLAGS"
+    CFLAGS="$CFLAGS $CAIROFLAGS"
+    CXXFLAGS="$CXXFLAGS $CAIROFLAGS"
 fi
 
 usage ()
-- 
GitLab