如何将 autoconf/automake 指向非标准包

发布于 2024-08-05 01:17:23 字数 775 浏览 9 评论 0原文

我正在尝试在 RedHat Linux 机器上构建 ZooKeeper。 (ZooKeeper 到底是什么可能并不重要:-)

当我按照包说明进行操作时,我得到:

 $ autoreconf -if
aclocal:configure.ac:33: warning: macro `AM_PATH_CPPUNIT' not found in library
aclocal:configure.ac:33: warning: macro `AM_PATH_CPPUNIT' not found in library
configure.ac:33: error: possibly undefined macro: AM_PATH_CPPUNIT
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

我无法在标准位置安装 CPPPUNIT。 (没有root权限,系统团队 有一个与标准配置“不偏差”的政策。)

我通过注释掉对的引用来解决这个问题 AM_PATH_CPPUNIT 在我的configure.ac 文件中,但是我真正想做的 是在我的个人目录中安装 CPPPUNIT 并指向它,但我 在弄清楚如何告诉 autoconf/auotmake 方面没有取得太大进展 系统在非标准位置寻找它。任何人有任何提示 怎么办?

I'm trying to build ZooKeeper on a RedHat Linux box. (Exactly what ZooKeeper is is probably not important :-)

When I follow the package instructions, I get:

 $ autoreconf -if
aclocal:configure.ac:33: warning: macro `AM_PATH_CPPUNIT' not found in library
aclocal:configure.ac:33: warning: macro `AM_PATH_CPPUNIT' not found in library
configure.ac:33: error: possibly undefined macro: AM_PATH_CPPUNIT
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

I can't install CPPPUNIT in the standard place. (Don't have root privileges, system team
has a policy of "no deviations" from standard configuration.)

I've worked around the problem by commenting out the references to
AM_PATH_CPPUNIT in my configure.ac file, but what I'd really like to do
is to install CPPPUNIT in my personal directory and point to it, but I'm
not making much progress in figuring out how to tell the autoconf/auotmake
system to look for it in a non-standard place. Anybody have any hints on
how to do that?

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

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

发布评论

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

评论(5

丶情人眼里出诗心の 2024-08-12 01:17:23

您要设置环境变量 ACLOCAL_PATH。

ACLOCAL_PATH="/home/YOU/path/to/share/aclocal" autoreconf -if

要确定需要将 ACLOCAL_PATH 指向哪个目录,您必须找到包含定义 AM_PATH_CPPUNIT 的 .m4 文件的目录。

You want to set the environment variable ACLOCAL_PATH.

ACLOCAL_PATH="/home/YOU/path/to/share/aclocal" autoreconf -if

To figure out what directory you need to point ACLOCAL_PATH at, you'll have to find the directory that contains the .m4 file that defines AM_PATH_CPPUNIT.

人疚 2024-08-12 01:17:23

就我而言,由于缺少 cppunit-devel 包,我收到了此错误。通过 yum -y install cppunit-devel 在我的 centos 服务器上安装此软件包后,一切正常。

In my case, I got this error because of missing the package cppunit-devel. After install this package on my centos server by yum -y install cppunit-devel, everything work well.

救赎№ 2024-08-12 01:17:23

如果路径变量无法添加到您的配置文件或环境..或其他什么中,您可以尝试在运行 autoconf 之前“导出”路径。这将设置该选项,至少对于该会话...

export ACLOCAL_PATH=/home/YOU/path/to/share/aclocal

此外,如果推送到了紧要关头,您可以..(这会清除您的 Makefiles 中 autoconf/configure 命令留给您的任何非工作垃圾... )

make clean

并打开你的“./configure”脚本,它是小朋友(任何名为“configure.*”的东西)..在文本编辑器中。然后,稍微小心地“查找并替换”任何困扰你的“事物”的实例。一旦您修复了配置脚本中的指令,并再次运行它们...如果幸运的话,您的 make 文件将在您的环境中运行。

注意:这是我在 MAC 上所做的,通常用于编译未经测试或未在 Mac 上运行的 LINUX 软件。这可能是错误的方法,但是当没有太多选择时,有时你只需要进去并搞砸它。

If the path variable cant be added to your profile, or environmen.. or what have you, you can you try to "export" the path prior to running the autoconf. This will set that option, at least for that session...

export ACLOCAL_PATH=/home/YOU/path/to/share/aclocal

Also, if push comes to shove, you can.. (This clears out your Makefiles of any non-working crap that the autoconf/configure commands left you with...)

make clean

And open up your "./configure" script, and it's little friends (anything named "configure.*").. in a text editor. Then, somewhat carefully "Find and Replace" the instances of whatever "Thing" is messing you up. Once you fix the directives iN the coNfigure scriptS, and run them again... with any luck your make files will work in your environment.

Note: This is what I do on my MAC, usually for compiling LINUX SW that is NOT tested or meant to run on a Mac. This may be the wrong way to do it, but when there's not a lot of options, sometimes you just have to get in there and muck with it.

小帐篷 2024-08-12 01:17:23

如果有多个路径,请使用 : 分隔符添加它们。
喜欢:

export ACLOCAL_PATH="/usr/share/aclocal/:/usr/local/share/aclocal"

In case of multiple path, add them with : separator.
Like:

export ACLOCAL_PATH="/usr/share/aclocal/:/usr/local/share/aclocal"
七禾 2024-08-12 01:17:23

对于 Debian 11 和 Ubuntu 22.04,我只需运行:

sudo apt-get install libcppunit-dev

现在它可以工作了

For Debian 11 and Ubuntu 22.04 I just run:

sudo apt-get install libcppunit-dev

and now it works

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文