summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2012-11-19 10:41:20 -0800
committerDan Nicholson <dbn.lists@gmail.com>2012-12-04 13:04:57 -0800
commit05f319d3e5a2e37788d6aa6d92c39991e4c567df (patch)
tree3ee5954885aef4173730c226eebe4f56a69d6875
parent28c6468405f983a01dc8b722f230e3fd7c20465f (diff)
downloadpkg-config-05f319d3e5a2e37788d6aa6d92c39991e4c567df.tar.gz
Output -L Libs flags before other Libs flags
Outputting other Libs flags such as -Wl,foo just prior to the -l Libs flags gives a better chance the --libs output will be correct. This should be no change in the usage of the output since pkg-config currently groups all flag types together.
-rwxr-xr-xcheck/check-duplicate-flags4
-rwxr-xr-xcheck/check-gtk4
-rwxr-xr-xcheck/check-libs6
-rwxr-xr-xcheck/check-mixed-flags10
-rwxr-xr-xcheck/check-sort-order12
-rwxr-xr-xcheck/check-whitespace2
-rw-r--r--pkg.c12
7 files changed, 25 insertions, 25 deletions
diff --git a/check/check-duplicate-flags b/check/check-duplicate-flags
index b6ac788..f6f577d 100755
--- a/check/check-duplicate-flags
+++ b/check/check-duplicate-flags
@@ -8,7 +8,7 @@ RESULT="-DPATH2 -DPATH1 -DFOO -I/path/include"
run_test --cflags flag-dup-1 flag-dup-2
run_test --cflags flag-dup-2 flag-dup-1
-RESULT="-Wl,--whole-archive --Wl,--no-whole-archive -R -Xlinker /path/lib \
--L/path/lib -lpath2 -lpath1 -lm"
+RESULT="-L/path/lib -Wl,--whole-archive --Wl,--no-whole-archive -R -Xlinker \
+/path/lib -lpath2 -lpath1 -lm"
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 7ad565f..1d6a13d 100755
--- a/check/check-gtk
+++ b/check/check-gtk
@@ -26,7 +26,7 @@ run_test --cflags --static gtk+-3.0
# -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lpango-1.0 \
# -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt \
# -lglib-2.0
-RESULT="-pthread -L/gtk/lib -lgtk-3 -lgdk-3 -lpangocairo-1.0 -latk-1.0 \
+RESULT="-L/gtk/lib -pthread -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 -lrt -lglib-2.0 \
-lfreetype -lfontconfig"
@@ -47,7 +47,7 @@ fi
# -lpixman-1 -lXrender -lX11 -lpthread -lxcb -lXau -lpng12 -lz -lm \
# -lpango-1.0 -lfontconfig -lexpat -lfreetype -lgobject-2.0 -lffi \
# -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 -lrt
-RESULT="-pthread -L/gtk/lib -lgtk-3 -lgdk-3 -lpangocairo-1.0 -latk-1.0 \
+RESULT="-L/gtk/lib -pthread -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 -ldl -lglib-2.0 \
diff --git a/check/check-libs b/check/check-libs
index b85dc29..767e3fd 100755
--- a/check/check-libs
+++ b/check/check-libs
@@ -18,7 +18,7 @@ run_test --libs --static simple
RESULT=""
run_test --libs fields-blank
-RESULT="-Wl,--as-needed -L/other/lib -lother"
+RESULT="-L/other/lib -Wl,--as-needed -lother"
run_test --libs other
RESULT="-lother"
@@ -39,11 +39,11 @@ RESULT="-Wl,--as-needed -lother"
run_test --libs-only-l --libs-only-other other
run_test --libs-only-other --libs-only-l other
-RESULT="-Wl,--as-needed -L/other/lib"
+RESULT="-L/other/lib -Wl,--as-needed"
run_test --libs-only-L --libs-only-other other
run_test --libs-only-other --libs-only-L other
-RESULT="-Wl,--as-needed -L/other/lib -lother"
+RESULT="-L/other/lib -Wl,--as-needed -lother"
run_test --libs-only-l --libs-only-L --libs-only-other other
run_test --libs --libs-only-l --libs-only-L --libs-only-other other
run_test --libs --libs-only-l other
diff --git a/check/check-mixed-flags b/check/check-mixed-flags
index b96c3b7..84dba21 100755
--- a/check/check-mixed-flags
+++ b/check/check-mixed-flags
@@ -4,7 +4,7 @@ set -e
. ${srcdir}/common
-RESULT="-DOTHER -I/other/include -Wl,--as-needed -L/other/lib -lother"
+RESULT="-DOTHER -I/other/include -L/other/lib -Wl,--as-needed -lother"
run_test --cflags --libs other
run_test --libs --cflags other
run_test --cflags-only-I --cflags-only-other --libs-only-l --libs-only-L \
@@ -50,11 +50,11 @@ RESULT="-DOTHER -Wl,--as-needed -lother"
run_test --cflags-only-other --libs-only-other --libs-only-l other
run_test --libs-only-l --libs-only-other --cflags-only-other other
-RESULT="-I/other/include -Wl,--as-needed -L/other/lib"
+RESULT="-I/other/include -L/other/lib -Wl,--as-needed"
run_test --cflags-only-I --libs-only-other --libs-only-L other
run_test --libs-only-L --libs-only-other --cflags-only-I other
-RESULT="-DOTHER -Wl,--as-needed -L/other/lib"
+RESULT="-DOTHER -L/other/lib -Wl,--as-needed"
run_test --cflags-only-other --libs-only-other --libs-only-L other
run_test --libs-only-L --libs-only-other --cflags-only-other other
@@ -70,10 +70,10 @@ RESULT="-DOTHER -I/other/include -Wl,--as-needed"
run_test --cflags --libs-only-other other
run_test --cflags-only-I --cflags-only-other --libs-only-other other
-RESULT="-I/other/include -Wl,--as-needed -L/other/lib -lother"
+RESULT="-I/other/include -L/other/lib -Wl,--as-needed -lother"
run_test --cflags-only-I --libs other
run_test --cflags-only-I --libs-only-l --libs-only-L --libs-only-other other
-RESULT="-DOTHER -Wl,--as-needed -L/other/lib -lother"
+RESULT="-DOTHER -L/other/lib -Wl,--as-needed -lother"
run_test --cflags-only-other --libs other
run_test --cflags-only-other --libs-only-l --libs-only-L --libs-only-other other
diff --git a/check/check-sort-order b/check/check-sort-order
index 94b89ef..dfcd1a0 100755
--- a/check/check-sort-order
+++ b/check/check-sort-order
@@ -53,7 +53,7 @@ run_test --cflags sort-order-2-1 sort-order-1-1 sort-order-3-1
run_test --cflags sort-order-1-1 sort-order-3-1 sort-order-2-1
run_test --cflags sort-order-1-1 sort-order-2-1 sort-order-3-1
-RESULT="-Wl,-O3 -Wl,-O2 -Wl,-O1 -L/path3/lib -L/path2/lib -L/path1/lib \
+RESULT="-L/path3/lib -L/path2/lib -L/path1/lib -Wl,-O3 -Wl,-O2 -Wl,-O1 \
-lpath3 -lpath2 -lpath1"
run_test --libs sort-order-3-1
run_test --libs sort-order-3-1 sort-order-2-1
@@ -78,7 +78,7 @@ run_test --cflags sort-order-2-2 sort-order-1-2 sort-order-3-2
run_test --cflags sort-order-1-2 sort-order-3-2 sort-order-2-2
run_test --cflags sort-order-1-2 sort-order-2-2 sort-order-3-2
-RESULT="-Wl,-O3 -Wl,-O2 -Wl,-O1 -L/path3/lib -L/path2/lib -L/path1/lib \
+RESULT="-L/path3/lib -L/path2/lib -L/path1/lib -Wl,-O3 -Wl,-O2 -Wl,-O1 \
-lpath3 -lpath2 -lpath1"
run_test --libs sort-order-3-2
run_test --libs sort-order-3-2 sort-order-2-2
@@ -103,7 +103,7 @@ run_test --cflags sort-order-2-3 sort-order-1-3 sort-order-3-3
run_test --cflags sort-order-1-3 sort-order-3-3 sort-order-2-3
run_test --cflags sort-order-1-3 sort-order-2-3 sort-order-3-3
-RESULT="-Wl,-O1 -Wl,-O2 -Wl,-O3 -L/path3/lib -L/path2/lib -L/path1/lib \
+RESULT="-L/path3/lib -L/path2/lib -L/path1/lib -Wl,-O1 -Wl,-O2 -Wl,-O3 \
-lpath1 -lpath2 -lpath3"
run_test --libs sort-order-1-3
run_test --libs sort-order-1-3 sort-order-2-3
@@ -131,7 +131,7 @@ run_test --cflags sort-order-2-1 sort-order-1-1 sort-order-3-1
run_test --cflags sort-order-1-1 sort-order-3-1 sort-order-2-1
run_test --cflags sort-order-1-1 sort-order-2-1 sort-order-3-1
-RESULT="-Wl,-O3 -Wl,-O2 -Wl,-O1 -L/path2/lib -L/path3/lib -L/path1/lib \
+RESULT="-L/path2/lib -L/path3/lib -L/path1/lib -Wl,-O3 -Wl,-O2 -Wl,-O1 \
-lpath3 -lpath2 -lpath1"
run_test --libs sort-order-3-1
run_test --libs sort-order-3-1 sort-order-2-1
@@ -156,7 +156,7 @@ run_test --cflags sort-order-2-2 sort-order-1-2 sort-order-3-2
run_test --cflags sort-order-1-2 sort-order-3-2 sort-order-2-2
run_test --cflags sort-order-1-2 sort-order-2-2 sort-order-3-2
-RESULT="-Wl,-O3 -Wl,-O2 -Wl,-O1 -L/path2/lib -L/path3/lib -L/path1/lib \
+RESULT="-L/path2/lib -L/path3/lib -L/path1/lib -Wl,-O3 -Wl,-O2 -Wl,-O1 \
-lpath3 -lpath2 -lpath1"
run_test --libs sort-order-3-2
run_test --libs sort-order-3-2 sort-order-2-2
@@ -181,7 +181,7 @@ run_test --cflags sort-order-2-3 sort-order-1-3 sort-order-3-3
run_test --cflags sort-order-1-3 sort-order-3-3 sort-order-2-3
run_test --cflags sort-order-1-3 sort-order-2-3 sort-order-3-3
-RESULT="-Wl,-O1 -Wl,-O2 -Wl,-O3 -L/path2/lib -L/path3/lib -L/path1/lib \
+RESULT="-L/path2/lib -L/path3/lib -L/path1/lib -Wl,-O1 -Wl,-O2 -Wl,-O3 \
-lpath1 -lpath2 -lpath3"
run_test --libs sort-order-1-3
run_test --libs sort-order-1-3 sort-order-2-3
diff --git a/check/check-whitespace b/check/check-whitespace
index aa551b5..1b3d87a 100755
--- a/check/check-whitespace
+++ b/check/check-whitespace
@@ -9,5 +9,5 @@ RESULT='-Dlala=misc -I/usr/white\ space/include -I$(top_builddir) -Iinclude\ dir
run_test --cflags whitespace
# expect libs from whitespace
-RESULT="-r:foo -L/usr/white\\ space/lib -lfoo\\ bar -lbar\\ baz"
+RESULT="-L/usr/white\\ space/lib -r:foo -lfoo\\ bar -lbar\\ baz"
run_test --libs whitespace
diff --git a/pkg.c b/pkg.c
index e9cfe64..5625827 100644
--- a/pkg.c
+++ b/pkg.c
@@ -998,17 +998,17 @@ packages_get_flags (GList *pkgs, FlagType flags)
g_string_append (str, cur);
g_free (cur);
}
- if (flags & LIBS_OTHER)
+ if (flags & LIBS_L)
{
- cur = get_multi_merged (pkgs, LIBS_OTHER, FALSE, !ignore_private_libs);
- debug_spew ("adding LIBS_OTHER string \"%s\"\n", cur);
+ cur = get_multi_merged (pkgs, LIBS_L, TRUE, !ignore_private_libs);
+ debug_spew ("adding LIBS_L string \"%s\"\n", cur);
g_string_append (str, cur);
g_free (cur);
}
- if (flags & LIBS_L)
+ if (flags & LIBS_OTHER)
{
- cur = get_multi_merged (pkgs, LIBS_L, TRUE, !ignore_private_libs);
- debug_spew ("adding LIBS_L string \"%s\"\n", cur);
+ cur = get_multi_merged (pkgs, LIBS_OTHER, FALSE, !ignore_private_libs);
+ debug_spew ("adding LIBS_OTHER string \"%s\"\n", cur);
g_string_append (str, cur);
g_free (cur);
}