summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2012-11-19 10:45:41 -0800
committerDan Nicholson <dbn.lists@gmail.com>2012-12-04 13:04:57 -0800
commit9adfd9ebfcb8a9656999116307c15061364bf7df (patch)
tree221281c51f3906aa1490fc15b0b6dbd6505af017 /check
parent5b6ec1b6e92b9de070a36df11eb123338228a85b (diff)
downloadpkg-config-9adfd9ebfcb8a9656999116307c15061364bf7df.tar.gz
Only strip duplicate arguments when they appear consecutivelyflag-order-fixes
pkg-config strips all duplicate arguments from the flag output string. This is done for 2 reasons: 1. When a package shows up twice in the final package list after resolving all Requires, stripping was used to ensure it's flags only showed up once at the correct location. 2. An optimization so that the output string is not excessively long. Since commit c6ec7869, 1. is no longer necessary as the final package list only contains each package once. 2. causes problems when applied too aggressively since some arguments have different semantics depending on the prior or subsequent arguments. To keep a bit of optimization, the stripping is reduced to only removing consecutive duplicate arguments. This should ensure that the semantics are kept intact while removing obviously unnecessary arguments. The drawback is that some arguments will now appear multiple times in the output when they previously would have only appeared once. Here we have to rely on the tools using these arguments to handle the duplicates appropriately since there is no way for pkg-config to encode all the semantics of those arguments. Another thing that can help this situation is if pkg-config is used for all packages in the Requires chain so that the Libs/Cflags of each package only pertain to itself and don't encode the compiling/linking rules of a 3rd party package. Freedesktop #16101 (https://bugs.freedesktop.org/show_bug.cgi?id=16101)
Diffstat (limited to 'check')
-rwxr-xr-xcheck/check-duplicate-flags7
-rwxr-xr-xcheck/check-gtk14
2 files changed, 12 insertions, 9 deletions
diff --git a/check/check-duplicate-flags b/check/check-duplicate-flags
index 4e0bcab..110da5b 100755
--- a/check/check-duplicate-flags
+++ b/check/check-duplicate-flags
@@ -4,11 +4,12 @@ set -e
. ${srcdir}/common
-RESULT="-DPATH2 -DPATH1 -DFOO -I/path/include"
+RESULT="-DPATH2 -DFOO -DPATH1 -DFOO -I/path/include"
run_test --cflags flag-dup-1 flag-dup-2
run_test --cflags flag-dup-2 flag-dup-1
-RESULT="-L/path/lib -lpath2 -lpath1 -Wl,--whole-archive -lm \
---Wl,--no-whole-archive -R -Xlinker /path/lib"
+RESULT="-L/path/lib -lpath2 -Wl,--whole-archive -lm --Wl,--no-whole-archive \
+-Xlinker -R -Xlinker /path/lib -lpath1 -Wl,--whole-archive -lm \
+--Wl,--no-whole-archive -Xlinker -R -Xlinker /path/lib"
run_test --libs flag-dup-1 flag-dup-2
run_test --libs flag-dup-2 flag-dup-1
diff --git a/check/check-gtk b/check/check-gtk
index e42892b..7fd01bb 100755
--- a/check/check-gtk
+++ b/check/check-gtk
@@ -16,7 +16,8 @@ PKG_CONFIG_LIBDIR=${srcdir}/gtk
RESULT="-DGSEAL_ENABLE -pthread -I/gtk/include/gtk-3.0 \
-I/gtk/include/pango-1.0 -I/gtk/include/atk-1.0 -I/gtk/include/cairo \
-I/gtk/include/pixman-1 -I/gtk/include -I/gtk/include/gdk-pixbuf-2.0 \
--I/gtk/include/glib-2.0 -I/gtk/lib/glib-2.0/include -I/gtk/include/freetype2"
+-I/gtk/include -I/gtk/include/pango-1.0 -I/gtk/include/glib-2.0 \
+-I/gtk/lib/glib-2.0/include -I/gtk/include/freetype2 -I/gtk/include"
run_test --cflags gtk+-3.0
run_test --cflags --static gtk+-3.0
@@ -28,7 +29,8 @@ run_test --cflags --static gtk+-3.0
# -lglib-2.0
RESULT="-L/gtk/lib -lgtk-3 -lgdk-3 -lpangocairo-1.0 -latk-1.0 -lcairo-gobject \
-lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 \
--lgthread-2.0 -lgmodule-2.0 -pthread -lrt -lglib-2.0 -lfreetype -lfontconfig"
+-lgthread-2.0 -pthread -lrt -lgmodule-2.0 -pthread -lrt -lglib-2.0 -lfreetype \
+-lfontconfig"
if [ "$list_indirect_deps" = no ]; then
run_test --libs gtk+-3.0
fi
@@ -47,10 +49,10 @@ fi
# -lpango-1.0 -lfontconfig -lexpat -lfreetype -lgobject-2.0 -lffi \
# -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 -lrt
RESULT="-L/gtk/lib -lgtk-3 -lgdk-3 -lpangocairo-1.0 -latk-1.0 -lcairo-gobject \
--lcairo -lpixman-1 -lXrender -lX11 -lpthread -lxcb -lXau -lgdk_pixbuf-2.0 \
--lpng12 -lm -lgio-2.0 -lz -lresolv -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 \
--lffi -lgthread-2.0 -lgmodule-2.0 -pthread -ldl -lglib-2.0 -lrt -lfontconfig \
--lexpat -lfreetype"
+-lcairo -lz -lpixman-1 -lpng12 -lz -lm -lXrender -lX11 -lpthread -lxcb -lXau \
+-lgdk_pixbuf-2.0 -lm -lpng12 -lz -lm -lgio-2.0 -lz -lresolv -lpangoft2-1.0 \
+-lpango-1.0 -lgobject-2.0 -lffi -lgthread-2.0 -pthread -lrt -lgmodule-2.0 \
+-pthread -lrt -ldl -lglib-2.0 -lrt -lfreetype -lfontconfig -lexpat -lfreetype"
if [ "$list_indirect_deps" = yes ]; then
run_test --libs gtk+-3.0
fi