pkg-config 0.26 on OS X Lion seems to be ignoring PKG_CONFIG_PATH

天涯浪子 提交于 2019-12-08 09:33:41

问题


I am using pkg-config 0.26 on OS X Lion.

When I echo $PKG_CONFIG_PATH, it seems that the variable is blank.

When I assign into it, e.g. PKG_CONFIG_PATH=/path/to/my/folder/containing/pc/files, and then run pkg-config --list-all, the .pc files in the directory that I ostensibly just added are not found.

I have been side-stepping this issue by soft linking to individual .pc files from /opt/local/share/pkgconfig, but I would prefer to figure out what the right way is.


回答1:


Aha! This works:

export PKG_CONFIG_PATH=/path/to/my/folder/containing/pc/files

This makes total sense, it's just that I wrote the question before I knew the meaning of the command export.

Quoting from Defining a variable with or without export :

export makes the variable available to subprocesses

And pkgconfig is a subprocess of the shell when it is run.



来源:https://stackoverflow.com/questions/8692462/pkg-config-0-26-on-os-x-lion-seems-to-be-ignoring-pkg-config-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!