From a033969bcab3e802c37fa397f7b10593ae12e417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Mon, 12 Mar 2018 00:00:00 +0000 Subject: [PATCH] man: Use shell function from make to process pkg-config output. pkg-config uses backslashes to escape special characters (including spaces among others) in its --cflags and --libs output. This is incompatible with command substitution as used in POSIX shell, i.e., $(cmd ...) or `cmd ...`, because field splitting following such substitution splits the result using sequences of , , and characters as separators (supposing default value of IFS). Backslash does not have any special meaning in this process, and thus escaping for those characters is ineffective. Suggest using shell make function instead, which will expand the results into the command output (converting newlines into spaces, but not processing it further), and then when final command is executed by POSIX shell, the shell tokenization rules will take into effect which do respect backquotes and split input using unquoted ( or in POSIX locale). --- pkg-config.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg-config.1 b/pkg-config.1 index a147fc8..fe21085 100644 --- a/pkg-config.1 +++ b/pkg-config.1 @@ -32,7 +32,7 @@ scenario in a Makefile: .PP .nf program: program.c - cc program.c `pkg-config --cflags --libs gnomeui` + cc program.c $(shell pkg-config --cflags --libs gnomeui) .fi .PP .I pkg-config -- 2.16.2