1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-06 05:44:11 +01:00

configure: Moved detection of GIF support to a dedicated macro

The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.

The new macro:
 - uses as much as possible autoconf macros for portability and code
consistency;
 - provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
 - makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
 - introduces a tracking of unsupported things to be reported to user

It includes a fixes from a problem found by Amadeusz S-B³awiñski, because-A
the function 'wm_fn_imgfmt_try_link' modified the variable LDFLAGS
instead of LIBS.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-11-04 20:52:28 +01:00
committed by Carlos R. Mafra
parent 6223ed1854
commit f892ce4d37
2 changed files with 124 additions and 30 deletions

View File

@@ -120,6 +120,12 @@ AS_IF([test "x$debug" = "xyes"],
AX_CFLAGS_GCC_OPTION([-Wno-deprecated-declarations])
])
dnl Tracking on what is detected for final status
dnl =============================================
unsupported=""
dnl Platform-specific Makefile setup
dnl ================================
AS_CASE(["$host"],
@@ -709,36 +715,13 @@ fi
dnl GIF Support
dnl ============
gif=yes
AC_ARG_ENABLE(gif, AS_HELP_STRING([--disable-gif], [disable GIF support through libgif or libungif]),
gif=$enableval, gif=yes, gif=no)
if test "$gif" = yes; then
my_libname=""
WM_CHECK_LIB(ungif, DGifOpenFileName, [$XLFLAGS $XLIBS])
if test "x$ac_cv_lib_ungif_DGifOpenFileName" = xyes; then
my_libname=-lungif
fi
dnl
dnl libungif is the same thing as libgif for all practical purposes.
dnl
if test "x$my_libname" = x; then
WM_CHECK_LIB(gif, DGifOpenFileName, [$XLFLAGS $XLIBS])
if test "x$ac_cv_lib_gif_DGifOpenFileName" = xyes; then
my_libname=-lgif
fi
fi
if test "$my_libname" != x; then
WM_CHECK_HEADER(gif_lib.h)
if test "x$ac_cv_header_gif_lib_h" = xyes; then
GFXLIBS="$GFXLIBS $my_libname"
supported_gfx="$supported_gfx GIF"
AC_DEFINE(USE_GIF, 1, [define if GIF libraries are available (set by configure)])
fi
fi
fi
AC_ARG_ENABLE(gif,
[AS_HELP_STRING([--disable-gif], [disable GIF support through libgif or libungif])],
[AS_CASE(["$enableval"],
[yes|no], [],
[AC_MSG_ERROR([bad value $enableval for --enable-gif])] )],
[enable_gif=auto])
WM_IMGFMT_CHECK_GIF
dnl TIFF Support
@@ -924,6 +907,7 @@ echo "Installation path for binaries : $_bindir"
echo "Installation path for libraries : $libdir"
echo "Installation path for WPrefs.app : $wprefs_base_dir" | sed -e 's|\${prefix}|'"$prefix|"
echo "Supported graphic format libraries : $supported_gfx"
echo "Unsupported features :$unsupported"
echo "Antialiased text support in WINGs : $xft"
echo "Xinerama extension support : $xinerama"
echo "XRandR extension support : $xrandr"