开发者

Specify CPPFLAGS when building with CPAN

开发者 https://www.devze.com 2023-02-11 17:04 出处:网络
I have a CPAN module I am attempting to build. It requires compiling a small C program. I don\'t have root on the system, so I have a complete parallel source tree in $HOME/loca开发者_StackOverflow中文

I have a CPAN module I am attempting to build. It requires compiling a small C program. I don't have root on the system, so I have a complete parallel source tree in $HOME/loca开发者_StackOverflow中文版l/src installed at $HOME/local/lib and $HOME/local/include, etc.

How do I pass CPPFLAGS=-I$HOME/local/include LDFLAGS=-L$HOME/local/lib to the CPAN module so that it will be properly built?


You can pass CPPFLAGS and LDFLAGS to the CPAN module build process by setting these as environment variables. I had luck with a local tidy and tidyp install after setting these, in Bash).

Steps:

 Installed tidy and tidyp with prefix $HOME/local
 export CPPFLAGS=-I$HOME/local/include
 export LDFLAGS=-L$HOME/local/lib
 export LD_LIBRARY_PATH=$HOME/lib
 cpan
 cpan> install HTML::Tidy

I added the LD_LIBRARY_PATH setting above to get -ltidyp picked up correctly for HTML::Tidy install.

0

精彩评论

暂无评论...
验证码 换一张
取 消