From d7a417770bd51ea6e9adbfeb588959c81d05d023 Mon Sep 17 00:00:00 2001
From: gobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Date: Sat, 1 Oct 2011 21:52:39 +0000
Subject: [PATCH] =?utf8?q?Ajout=20option=20pour=20d=C3=A9sactiver=20--sysc?=
 =?utf8?q?onfdir=3D...=20si=20ce=20n'est=20pas=20support=C3=A9=20par=20le?=
 =?utf8?q?=20script=20configure=20(ex:=20kvm).?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 functions/ipkg | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/functions/ipkg b/functions/ipkg
index bba883d..8ac0a09 100644
--- a/functions/ipkg
+++ b/functions/ipkg
@@ -172,6 +172,20 @@ ipkg_script()
                 ${CONFIGURE_OPTS} \
                 --disable-dependency-tracking"
         fi
+
+        # Remove option --sysconfdir=... if not supported
+        if ! cat ${LFS_TMP}/${PACKAGE}/configure | \
+            grep -q "sysconfdir"; then
+            # Split on space, one per line.
+            # Remove line --sysconfdir=...
+            # Join separate lines on one line
+            # Remove trailing space
+            CONFIGURE_OPTS=$(echo ${CONFIGURE_OPTS} | \
+                tr -s " " "\n" | \
+                grep -v "\-\-sysconfdir=" | \
+                tr -s "\n" " " | \
+                sed "s/ $//")
+        fi
     fi
 
     ipkg_display_build_infos
-- 
2.20.1