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).
This commit is contained in:
Jehan 2021-05-16 02:35:04 +02:00
parent cf6482f716
commit a181d672ef
1 changed files with 18 additions and 6 deletions

View File

@ -1656,13 +1656,25 @@ AC_SUBST(MNG_CFLAGS)
AC_ARG_WITH(aa, [ --without-aa do not build the AA plug-in]) AC_ARG_WITH(aa, [ --without-aa do not build the AA plug-in])
have_libaa=no have_libaa=no
if test "x$with_aa" != xno && test -z "$AA_LIBS"; then if test "x$with_aa" != xno; then
have_libaa=yes have_libaa=yes
AC_CHECK_LIB(aa, aa_printf, # First case if manually set, use the AA_LIBS environment variable.
[AC_CHECK_HEADER(aalib.h, if test -z "$AA_LIBS"; then
FILE_AA='file-aa$(EXEEXT)'; AA_LIBS='-laa', # Otherwise try the aalib-config script.
[have_libaa="no (AA header file not found)"])], AA_LIBS=`aalib-config --libs`
[have_libaa="no (AA library not found)"]) 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 fi
AC_SUBST(FILE_AA) AC_SUBST(FILE_AA)