pkg-config/check/check-duplicate-flags
Stefano Sabatini 9a6c72edca pkg: reintroduce less aggressive flags deduplication
Stripping non-consecutives options was dropped in 9adfd9ebfc, in
order to prevent the alteration of the command semantics.

To mitigate cases when the generated flags list is too long, the
deduplication is reintroduced but limited only to a few cases (-L, -l,
-I) for which semantics is not altered by a repetition of the same
flag.

Address issue:
https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/75
2022-11-21 10:42:31 +01:00

15 lines
445 B
Bash
Executable file

#! /bin/sh
set -e
. ${srcdir}/common
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 -Wl,--whole-archive -lm --Wl,--no-whole-archive \
-Xlinker -R -Xlinker /path/lib -lpath1 -Wl,--whole-archive \
--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