[AC21.5] Cleaning out old work #2: clean up pkgconfig include path

"Stephen J. Turnbull" <[email protected]> Mon, 4 Jan 2016 12:46:42 +0900
Newsgroups gmane.emacs.xemacs.patches
Message-ID <[email protected]>
APPROVE COMMIT 21.5

Cosmetic.  Xft's pkgconfig output produces the same path multiple
times, which is useless and ugly, and somewhat costly to read now that
the whole compiler command is provided in Installation.

Oops, I just noticed that ChangeLog doesn't mention that configure was
rebuilt, but as you can see it was.  Mea culpa, already pushed.

diff -U0 -r 28813695b141 -r 822430f873bc ChangeLog
--- a/ChangeLog	Mon Jan 04 12:14:20 2016 +0900
+++ b/ChangeLog	Mon Jan 04 12:16:28 2016 +0900
@@ -0,0 +1,4 @@
+2015-01-11  Stephen J. Turnbull  <[email protected]>
+
+	* configure.ac (Xft): Remove dupes from pkg-config --cflags.
+
diff -r 28813695b141 -r 822430f873bc configure
--- a/configure	Mon Jan 04 12:14:20 2016 +0900
+++ b/configure	Mon Jan 04 12:16:28 2016 +0900
@@ -13903,6 +13903,15 @@
     xft_config_ok=`$xft_config_prog --cflags 2>/dev/null`
     if test "$?" = 0 ; then
 	xft_cflags=`$xft_config_prog --cflags`
+                        cleaned_xft_cflags=""
+        for xft_cflag in $xft_cflags; do
+          case $xft_cleaned_cflags in
+          *${xft_cflag}* ) ;;
+          * ) xft_cleaned_cflags="$xft_cleaned_cflags $xft_cflag" ;;
+          esac
+        done
+        xft_cflags=$xft_cleaned_cflags
+        unset xft_cflag xft_cleaned_cflags
 	xft_libs=`$xft_config_prog --libs`
 	c_switch_site="$c_switch_site $xft_cflags"
 	ld_switch_site="$ld_switch_site $xft_libs"
diff -r 28813695b141 -r 822430f873bc configure.ac
--- a/configure.ac	Mon Jan 04 12:14:20 2016 +0900
+++ b/configure.ac	Mon Jan 04 12:16:28 2016 +0900
@@ -3240,6 +3240,17 @@
     xft_config_ok=`$xft_config_prog --cflags 2>/dev/null`
     if test "$?" = 0 ; then
 	xft_cflags=`$xft_config_prog --cflags`
+        dnl #### I tried to create XE_REMOVE_DUPS(original,cleaned),
+        dnl but it didn't work.
+        cleaned_xft_cflags=""
+        for xft_cflag in $xft_cflags; do
+          case $xft_cleaned_cflags in
+          *${xft_cflag}* ) ;;
+          * ) xft_cleaned_cflags="$xft_cleaned_cflags $xft_cflag" ;;
+          esac
+        done
+        xft_cflags=$xft_cleaned_cflags
+        unset xft_cflag xft_cleaned_cflags
 	xft_libs=`$xft_config_prog --libs`
 	c_switch_site="$c_switch_site $xft_cflags"
 	ld_switch_site="$ld_switch_site $xft_libs"