mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-02-05 21:40:26 +01:00
Use a bitmask to keep track of what Libs/Cflags to output. This makes it simple to handle any combination of --cflags and --libs option variants. A lot of excess code is removed in the process as all the flags options can now be carried around in a single variable. Freedesktop #54388 (https://bugs.freedesktop.org/show_bug.cgi?id=54388)
79 lines
2.9 KiB
Bash
Executable file
79 lines
2.9 KiB
Bash
Executable file
#! /bin/sh
|
|
|
|
set -e
|
|
|
|
. ${srcdir}/common
|
|
|
|
RESULT="-DOTHER -I/other/include -Wl,--as-needed -L/other/lib -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 \
|
|
--libs-only-other other
|
|
|
|
RESULT="-I/other/include -lother"
|
|
run_test --cflags-only-I --libs-only-l other
|
|
run_test --libs-only-l --cflags-only-I other
|
|
|
|
RESULT="-DOTHER -lother"
|
|
run_test --cflags-only-other --libs-only-l other
|
|
run_test --libs-only-l --cflags-only-other other
|
|
|
|
RESULT="-I/other/include -L/other/lib"
|
|
run_test --cflags-only-I --libs-only-L other
|
|
run_test --libs-only-L --cflags-only-I other
|
|
|
|
RESULT="-DOTHER -L/other/lib"
|
|
run_test --cflags-only-other --libs-only-L other
|
|
run_test --libs-only-L --cflags-only-other other
|
|
|
|
RESULT="-I/other/include -Wl,--as-needed"
|
|
run_test --cflags-only-I --libs-only-other other
|
|
run_test --libs-only-other --cflags-only-I other
|
|
|
|
RESULT="-DOTHER -Wl,--as-needed"
|
|
run_test --cflags-only-other --libs-only-other other
|
|
run_test --libs-only-other --cflags-only-other other
|
|
|
|
RESULT="-I/other/include -L/other/lib -lother"
|
|
run_test --cflags-only-I --libs-only-L --libs-only-l other
|
|
run_test --libs-only-l --libs-only-L --cflags-only-I other
|
|
|
|
RESULT="-DOTHER -L/other/lib -lother"
|
|
run_test --cflags-only-other --libs-only-L --libs-only-l other
|
|
run_test --libs-only-l --libs-only-L --cflags-only-other other
|
|
|
|
RESULT="-I/other/include -Wl,--as-needed -lother"
|
|
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 -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"
|
|
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"
|
|
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="-DOTHER -I/other/include -lother"
|
|
run_test --cflags --libs-only-l other
|
|
run_test --cflags-only-I --cflags-only-other --libs-only-l other
|
|
|
|
RESULT="-DOTHER -I/other/include -L/other/lib"
|
|
run_test --cflags --libs-only-L other
|
|
run_test --cflags-only-I --cflags-only-other --libs-only-L other
|
|
|
|
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"
|
|
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"
|
|
run_test --cflags-only-other --libs other
|
|
run_test --cflags-only-other --libs-only-l --libs-only-L --libs-only-other other
|