[gimp] configure: better libaa detection.



commit a181d672ef316be9d6bfda9b5d27a3262c990d21
Author: Jehan <jehan girinstud io>
Date:   Sun May 16 02:35:04 2021 +0200

    configure: better libaa detection.
    
    - Use aalib-config (available at least in the last releases of libaa,
      1.4rc5 from 20 years ago!). Especially important as the basic
      AC_CHECK_LIB() test does not work in my tests on Windows builds
      because some more libs are needed.
    - Make sure file-aa is also built if AA_LIBS environment variable is
      explicitly set. Prevous code was not working in such case (file-aa was
      not built even with AA_LIBS set).

 configure.ac | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d648f47ce1..33679d29a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1656,13 +1656,25 @@ AC_SUBST(MNG_CFLAGS)
 AC_ARG_WITH(aa,  [  --without-aa            do not build the AA plug-in])
 
 have_libaa=no
-if test "x$with_aa" != xno && test -z "$AA_LIBS"; then
+if test "x$with_aa" != xno; then
   have_libaa=yes
-  AC_CHECK_LIB(aa, aa_printf,
-    [AC_CHECK_HEADER(aalib.h,
-      FILE_AA='file-aa$(EXEEXT)'; AA_LIBS='-laa',
-      [have_libaa="no (AA header file not found)"])],
-    [have_libaa="no (AA library not found)"])
+  # First case if manually set, use the AA_LIBS environment variable.
+  if test -z "$AA_LIBS"; then
+    # Otherwise try the aalib-config script.
+    AA_LIBS=`aalib-config --libs`
+    if test -z "$AA_LIBS"; then
+      # Just try -laa.
+      AC_CHECK_LIB(aa, aa_printf,
+        [AC_CHECK_HEADER(aalib.h,
+          AA_LIBS='-laa',
+          [have_libaa="no (AA header file not found)"])],
+        [have_libaa="no (AA library not found)"])
+    fi
+  fi
+
+  if test "$have_libaa" = yes; then
+    FILE_AA='file-aa$(EXEEXT)'
+  fi
 fi
 
 AC_SUBST(FILE_AA)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]