I haven't noticed this one when building manually because LDFLAGS are
being set only by package manager (portage).

export LDFLAGS="-Wl,-O1 -Wl,--as-needed"
./configure --enable-png
...
checking X11/xpm.h presence... yes
checking for X11/xpm.h... yes
checking for PNG support library... configure: error: explicit PNG support 
requested but no library found

It's fixed by moving saved LDFLAGS to be after passed linker flags.

Amadeusz Sławiński
>From 1ec32d4ff21436cf744706ed930aba8a8bc9b6f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= <am...@asmblr.net>
Date: Mon, 4 Nov 2013 18:54:10 +0100
Subject: [PATCH] Fix failing check when LDFLAGS are set

export LDFLAGS="-Wl,-O1 -Wl,--as-needed"
./configure --enable-png
...
checking X11/xpm.h presence... yes
checking for X11/xpm.h... yes
checking for PNG support library... configure: error: explicit PNG support requested but no library found
---
 m4/wm_imgfmt_check.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/m4/wm_imgfmt_check.m4 b/m4/wm_imgfmt_check.m4
index 9368266..8f3b224 100644
--- a/m4/wm_imgfmt_check.m4
+++ b/m4/wm_imgfmt_check.m4
@@ -263,7 +263,7 @@ AC_DEFUN_ONCE([_WM_IMGFMT_CHECK_FUNCTS],
 @%:@ Assumes that LDFLAGS have been saved in 'wm_save_LDFLAGS' by caller
 wm_fn_imgfmt_try_link ()
 {
-  LDFLAGS="$wm_save_LDFLAGS $[]2"
+  LDFLAGS="$[]2 $wm_save_LDFLAGS"
   AC_TRY_LINK_FUNC([$[]1],
     [wm_retval=0],
     [wm_retval=1])
-- 
1.8.4.2

Reply via email to