On Sat, May 2, 2020 at 12:08 AM Marek Behun <marek.behun@xxxxxx> wrote: > > On Fri, 1 May 2020 14:27:57 +0900 > Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote: > > > Is it possible to fix the .pc file instead? > > > > This is ugly, and I do not know what is the > > point of pkg-config if it cannot detect the pkg correctly. > > I know this is ugly, though no more than some code in > scripts/Makefile.build. You missed to see the cost of parsing the Makefile. scripts/dtc/Makefile is parsed every time you run 'make'. Even if you have nothing to recompile, it builds the tiny program in background. This happens for 'make mrproper' too. > > What do you mean fixing the pc file? Maybe, file a bug report to your distribution if the pc file is strangely installed? > When the header is not present because libyaml-dev is not installed, > but the library is present, then pkg-config just reports that the > package exists, when asking with --exists, right? So, on your system, yaml-0.1.pc exists even if libyaml-dev is not installed. In which situation does this happen? The concept of pkg-config is to help to build software that depends on other packages. Obviously, pkg-config should take care of the headers because pkg-config supports --cflags option. It is weird to install the .pc file when it is not possible to build the software that depends on it. In other words, the .pc file should be installed by the dev package together with the headers, libraries, and any other components needed to compile the software that depends on it. At least, this is true for Ubuntu. The non-dev package installs only runtime libraries. The dev package installs the .pc file and all the components needed to build the program. $ apt-file list libyaml-0-2 libyaml-0-2: /usr/lib/x86_64-linux-gnu/libyaml-0.so.2 libyaml-0-2: /usr/lib/x86_64-linux-gnu/libyaml-0.so.2.0.5 libyaml-0-2: /usr/share/doc/libyaml-0-2/changelog.Debian.gz libyaml-0-2: /usr/share/doc/libyaml-0-2/copyright $ apt-file list libyaml-dev libyaml-dev: /usr/include/yaml.h libyaml-dev: /usr/lib/x86_64-linux-gnu/libyaml.a libyaml-dev: /usr/lib/x86_64-linux-gnu/libyaml.so libyaml-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/yaml-0.1.pc libyaml-dev: /usr/share/doc/libyaml-dev/changelog.Debian.gz libyaml-dev: /usr/share/doc/libyaml-dev/copyright 'make menuconfig' checks the ncurses dev package. The same for libncurses5 vs libncurses5-dev. $ apt-file list libncurses5 libncurses5: /lib/x86_64-linux-gnu/libncurses.so.5 libncurses5: /lib/x86_64-linux-gnu/libncurses.so.5.9 libncurses5: /usr/lib/x86_64-linux-gnu/libform.so.5 libncurses5: /usr/lib/x86_64-linux-gnu/libform.so.5.9 libncurses5: /usr/lib/x86_64-linux-gnu/libmenu.so.5 libncurses5: /usr/lib/x86_64-linux-gnu/libmenu.so.5.9 libncurses5: /usr/lib/x86_64-linux-gnu/libpanel.so.5 libncurses5: /usr/lib/x86_64-linux-gnu/libpanel.so.5.9 $ apt-file list libncurses5-dev libncurses5-dev: /usr/bin/ncurses5-config libncurses5-dev: /usr/include/curses.h libncurses5-dev: /usr/include/cursesapp.h libncurses5-dev: /usr/include/cursesf.h libncurses5-dev: /usr/include/cursesm.h libncurses5-dev: /usr/include/cursesp.h libncurses5-dev: /usr/include/cursesw.h libncurses5-dev: /usr/include/cursslk.h libncurses5-dev: /usr/include/eti.h libncurses5-dev: /usr/include/etip.h libncurses5-dev: /usr/include/form.h libncurses5-dev: /usr/include/menu.h libncurses5-dev: /usr/include/nc_tparm.h libncurses5-dev: /usr/include/ncurses.h libncurses5-dev: /usr/include/ncurses_dll.h libncurses5-dev: /usr/include/panel.h libncurses5-dev: /usr/include/term.h libncurses5-dev: /usr/include/term_entry.h libncurses5-dev: /usr/include/termcap.h libncurses5-dev: /usr/include/tic.h libncurses5-dev: /usr/include/unctrl.h libncurses5-dev: /usr/lib/x86_64-linux-gnu/libcurses.a libncurses5-dev: /usr/lib/x86_64-linux-gnu/libcurses.so libncurses5-dev: /usr/lib/x86_64-linux-gnu/libform.a libncurses5-dev: /usr/lib/x86_64-linux-gnu/libform.so libncurses5-dev: /usr/lib/x86_64-linux-gnu/libmenu.a libncurses5-dev: /usr/lib/x86_64-linux-gnu/libmenu.so libncurses5-dev: /usr/lib/x86_64-linux-gnu/libncurses++.a libncurses5-dev: /usr/lib/x86_64-linux-gnu/libncurses.a libncurses5-dev: /usr/lib/x86_64-linux-gnu/libncurses.so libncurses5-dev: /usr/lib/x86_64-linux-gnu/libpanel.a libncurses5-dev: /usr/lib/x86_64-linux-gnu/libpanel.so libncurses5-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/form.pc libncurses5-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/menu.pc libncurses5-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/ncurses++.pc libncurses5-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/ncurses.pc libncurses5-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/panel.pc libncurses5-dev: /usr/share/doc/libncurses5-dev libncurses5-dev: /usr/share/man/man1/ncurses5-config.1.gz > > Marek > -- Best Regards Masahiro Yamada