传递包含逗号的选项来配置脚本 (Linux)

发布于 2024-09-14 18:56:48 字数 322 浏览 9 评论 0原文

我有一个配置脚本,我需要传递一个包含逗号的选项。现在,如果没有逗号,我可以在周围放置一些“,以使配置识别整个字符串:

 ./configure --with-arpack="-Wl,-rpath,/my/path -L/my/path -larpack"

但是逗号被解释为选项分隔符,因此脚本仅将 -Wl 识别为移交的选项:

=== With linker flags: -Wl -rpath /my/path -L/my/path -larpack

如何我能解决这个问题吗

I have a configure script where I need to pass an option that contains a comma. Now if it weren't for the comma I could put some "s around to make configure recognize the string as a whole:

 ./configure --with-arpack="-Wl,-rpath,/my/path -L/my/path -larpack"

But the commas are interpreted as option delimiters, so the script only recognizes -Wl as the handed over option:

=== With linker flags: -Wl -rpath /my/path -L/my/path -larpack

How can I get around this?

Sebastian

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜味超标? 2024-09-21 18:56:48

使用 LDFLAGS 和 LIBS 代替:

$ export LDFLAGS="-Wl,-rpath,/my/path -L/my/path"
$ export LIBS="-larpack"
$ ./configure --with-arpack

Use LDFLAGS and LIBS instead:

$ export LDFLAGS="-Wl,-rpath,/my/path -L/my/path"
$ export LIBS="-larpack"
$ ./configure --with-arpack
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文