gpt4 book ai didi

linux - 制作 glib : . ./libtool: line 6003: cd: (libdir): No such file or directory

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:18:57 26 4
gpt4 key购买 nike

我不会油嘴滑舌。在 kubuntu 安装中,我运行 ./configure 时没有任何选项。但是我运行 make 时,出现以下错误:

make[4]: Entering directory `/home/software/glib/glib-2.40.0/gobject'
CCLD libgobject-2.0.la
../libtool: line 6003: cd: (libdir): No such file or directory
libtool: link: cannot determine absolute directory name of `(libdir)'

据我所知,所有的依赖关系都得到了满足。我尝试将 libdir 或 LIBDIR 设置为配置选项:libdir=/usr/local/lib/&& ./configure

我一直在网上搜索,尝试编译旧版本的 glib,但我仍然完全迷失了方向。

[编辑]似乎以下搜索结果是相关的:

https://bbs.archlinux.org/viewtopic.php?id=182353

Hi,I also get the same problem when I cross compilig the glib. Then,I finally solved the problem by set the LIBFFI_LIBS and LIBFFI_CFLAGS. My problem was because I just build libffi simply, but it need to fix to install header in the right place (/usr/include) and modify the /usr/lib/pkgconfig/libffi.pc .

我自己也编译了libffi,没有任何特定的配置选项。

https://lists.gnu.org/archive/html/guile-devel/2014-04/msg00056.html

What is the output of "pkg-config --libs libffi" on your system?
-L\$(libdir) -lffi

-> Bingo! Good question :-)

在我的例子中,它是:

~/download/software/glib/glib-2.40.0 $ grep  -H '^LIBFFI' */Makefile
build/Makefile:LIBFFI_CFLAGS = -I/usr/local/lib/libffi-3.1/include
build/Makefile:LIBFFI_LIBS = -L\$\(libdir\) -lffi
docs/Makefile:LIBFFI_CFLAGS = -I/usr/local/lib/libffi-3.1/include
docs/Makefile:LIBFFI_LIBS = -L\$\(libdir\) -lffi
gio/Makefile:LIBFFI_CFLAGS = -I/usr/local/lib/libffi-3.1/include
gio/Makefile:LIBFFI_LIBS = -L\$\(libdir\) -lffi
glib/Makefile:LIBFFI_CFLAGS = -I/usr/local/lib/libffi-3.1/include
glib/Makefile:LIBFFI_LIBS = -L\$\(libdir\) -lffi
gmodule/Makefile:LIBFFI_CFLAGS = -I/usr/local/lib/libffi-3.1/include
gmodule/Makefile:LIBFFI_LIBS = -L\$\(libdir\) -lffi
gobject/Makefile:LIBFFI_CFLAGS = -I/usr/local/lib/libffi-3.1/include
gobject/Makefile:LIBFFI_LIBS = -L\$\(libdir\) -lffi
gthread/Makefile:LIBFFI_CFLAGS = -I/usr/local/lib/libffi-3.1/include
gthread/Makefile:LIBFFI_LIBS = -L\$\(libdir\) -lffi
m4macros/Makefile:LIBFFI_CFLAGS = -I/usr/local/lib/libffi-3.1/include
m4macros/Makefile:LIBFFI_LIBS = -L\$\(libdir\) -lffi
tests/Makefile:LIBFFI_CFLAGS = -I/usr/local/lib/libffi-3.1/include
tests/Makefile:LIBFFI_LIBS = -L\$\(libdir\) -lffi

看完上面的内容后,我尝试了以下但结果是一样的(上面的 grep 命令的输出是一样的):

  LIBFFI_LIBS=/usr/local/lib/ && ./configure 

让我知道要提供哪些变量、设置或信息可以使调试此问题更容易。

[编辑 2]我找到了这个文件:/usr/local/lib/pkgconfig/libffi.pc内容如下:

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
toolexeclibdir=$(libdir)
includedir=${libdir}/libffi-3.1/include

Name: libffi
Description: Library supporting Foreign Function Interfaces
Version: 3.1
Libs: -L${toolexeclibdir} -lffi
Cflags: -I${includedir}

我不确定用什么替换什么值,但我会尝试...

最佳答案

我设法编译了 glib。

问题确实在文件/usr/local/lib/pkgconfig/libffi.pc 中,我在对问题的第二次编辑中引用了该文件。

行:

toolexeclibdir=$(libdir)

应该改为

toolexeclibdir=${libdir}

为了符合pkg-config语法。

这样做之后,我终于可以毫无问题地制作 glib 了。

您可以张贴两个更简单的跟进问题作为我接受的答案:
1) libffi.pc 中的错误语法是 libffi 本身的错误吗?谁负责创建 .pc 文件? [编辑:查看 libffi 的源代码,似乎他们对原始错误负责。我将报告它以便它得到修复。谢谢。]
2) 我可以从整个错误中学到什么?我浪费了很多时间调试它并寻找解决方案。什么技巧或诀窍可以帮助我更快地找到解决方案?

关于linux - 制作 glib : . ./libtool: line 6003: cd: (libdir): No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25588520/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com