【问题标题】:Version error in autotools configure script自动工具配置脚本中的版本错误
【发布时间】:2016-02-09 19:25:55
【问题描述】:

我正在尝试从源代码交叉编译 libnetfilter_queue-1.0.2,并且我的构建环境变量指向正确的交叉工具链和依赖库路径。

我仍然在./configure 上收到以下错误

checking for LIBNFNETLINK... no
configure: error: Package requirements (libnfnetlink >= 0.0.41) were not met:

No package 'libnfnetlink' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBNFNETLINK_CFLAGS
and LIBNFNETLINK_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

我的配置命令是:

CFLAGS="-I/home/user/openwrt/openwrt/staging_dir/target-powerpc_8540_uClibc-0.9.33.2/lib/ 
-I/home/user/openwrt/openwrt/staging_dir/target-powerpc_8540_uClibc-0.9.33.2/usr/lib/ -I/home/user/openwrt/openwrt/staging_dir/target-powerpc_8540_uClibc-0.9.33.2/include/ 
-I/home/user/openwrt/openwrt/staging_dir/target-powerpc_8540_uClibc-0.9.33.2/usr/include"  
LDFLAGS="-L/home/user/openwrt/openwrt/staging_dir/target-powerpc_8540_uClibc-0.9.33.2/lib/ 
-L/home/user/openwrt/openwrt/staging_dir/target-powerpc_8540_uClibc-0.9.33.2/usr/lib/" 
./configure --build=x86_64-unknown-linux-gnu --host=powerpc-openwrt-linux-uclibcspe  
--prefix=/home/user/openwrt/openwrt/staging_dir/target-powerpc_8540_uClibc-0.9.33.2

另外,我已经在传递给 ./configure 的 -I 和 -L 路径之一中安装了 libnfnetlink.so.0.2.0

尽管如此,为什么我会收到错误消息。

编辑:一些额外的信息。

config.log

configure:11631: checking for LIBNFNETLINK
configure:11638: $PKG_CONFIG --exists --print-errors "libnfnetlink >= 0.0.41"
Package libnfnetlink was not found in the pkg-config search path.
Perhaps you should add the directory containing `libnfnetlink.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libnfnetlink' found
configure:11641: $? = 1
configure:11672: result: no
No package 'libnfnetlink' found
configure:11688: error: Package requirements (libnfnetlink >= 0.0.41) were not met:

No package 'libnfnetlink' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

ac_cv_env_LIBNFNETLINK_CFLAGS_set=
ac_cv_env_LIBNFNETLINK_CFLAGS_value=
ac_cv_env_LIBNFNETLINK_LIBS_set=set
ac_cv_env_LIBNFNETLINK_LIBS_value=:/home/jagadeesh/openwrt/openwrt/staging_dir/target-powerpc_8540_uClibc-0.9.33.2/lib/


pkg_cv_LIBNFNETLINK_LIBS=:/home/jagadeesh/openwrt/openwrt/staging_dir/target-powerpc_8540_uClibc-0.9.33.2/lib/


LIBNFNETLINK_CFLAGS=''
LIBNFNETLINK_LIBS=':/home/jagadeesh/openwrt/openwrt/staging_dir/target-powerpc_8540_uClibc-0.9.33.2/lib/'

LIBNFNETLINK 检查的配置脚本中发生了什么:

pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNFNETLINK" >&5
$as_echo_n "checking for LIBNFNETLINK... " >&6; }

if test -n "$LIBNFNETLINK_CFLAGS"; then
    pkg_cv_LIBNFNETLINK_CFLAGS="$LIBNFNETLINK_CFLAGS"
 elif test -n "$PKG_CONFIG"; then
    if test -n "$PKG_CONFIG" && \
    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnfnetlink >= 0.0.41\""; } >&5
  ($PKG_CONFIG --exists --print-errors "libnfnetlink >= 0.0.41") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then
  pkg_cv_LIBNFNETLINK_CFLAGS=`$PKG_CONFIG --cflags "libnfnetlink >= 0.0.41" 2>/dev/null`
                      test "x$?" != "x0" && pkg_failed=yes
else
  pkg_failed=yes
fi
 else
    pkg_failed=untried
fi
if test -n "$LIBNFNETLINK_LIBS"; then
    pkg_cv_LIBNFNETLINK_LIBS="$LIBNFNETLINK_LIBS"
 elif test -n "$PKG_CONFIG"; then
    if test -n "$PKG_CONFIG" && \
    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnfnetlink >= 0.0.41\""; } >&5
  ($PKG_CONFIG --exists --print-errors "libnfnetlink >= 0.0.41") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then
  pkg_cv_LIBNFNETLINK_LIBS=`$PKG_CONFIG --libs "libnfnetlink >= 0.0.41" 2>/dev/null`
                      test "x$?" != "x0" && pkg_failed=yes
else
  pkg_failed=yes
fi
 else
    pkg_failed=untried
fi



if test $pkg_failed = yes; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }

if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
        _pkg_short_errors_supported=yes
else
        _pkg_short_errors_supported=no
fi
        if test $_pkg_short_errors_supported = yes; then
                LIBNFNETLINK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnfnetlink >= 0.0.41" 2>&1`
        else
                LIBNFNETLINK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnfnetlink >= 0.0.41" 2>&1`
        fi
        # Put the nasty error message in config.log where it belongs
        echo "$LIBNFNETLINK_PKG_ERRORS" >&5

        as_fn_error $? "Package requirements (libnfnetlink >= 0.0.41) were not met:

$LIBNFNETLINK_PKG_ERRORS



if test $pkg_failed = yes; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }

if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
        _pkg_short_errors_supported=yes
else
        _pkg_short_errors_supported=no
fi
        if test $_pkg_short_errors_supported = yes; then
                LIBNFNETLINK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnfnetlink >= 0.0.41" 2>&1`
        else
                LIBNFNETLINK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnfnetlink >= 0.0.41" 2>&1`
        fi
        # Put the nasty error message in config.log where it belongs
        echo "$LIBNFNETLINK_PKG_ERRORS" >&5

        as_fn_error $? "Package requirements (libnfnetlink >= 0.0.41) were not met:
$LIBNFNETLINK_PKG_ERRORS

【问题讨论】:

  • config.log 中查找错误,然后向上查看LIBNFNETLINK 检查实际上在做什么。
  • 您的 pkg-config 路径中​​是否也有相应的 .pc 文件?
  • @MikeKinghan 请查看编辑:

标签: linux build cross-compiling autotools configure


【解决方案1】:

您已经安装了 libnfnetlink 二进制文件,但要满足 ./configurelibnetfilter_queue 你需要安装 libnfnetlink 开发库也是如此,因为 libnetfilter_queue 在编译时想要它的头文件。这也将提供pkg_config 信息,./configure 正在寻找,例如在:

/usr/lib/x86_64-linux-gnu/pkgconfig/libnfnetlink.pc

你没有说你的发行版是什么,而是在 debian 衍生产品上

sudo apt-get install libnfnetlink-dev

会解决这个问题。

./configure 脚本中的库检查通常需要开发库。

附:我只记得你在交叉编译,所以pkg_config 将需要为您的目标找到开发库信息。

【讨论】:

  • 嗨,其实我也安装了头文件,因为你指出需要头文件,所以我检查了那里的路径并在环境中设置了路径,现在它可以编译了。
猜你喜欢
  • 2020-12-25
  • 2021-04-09
  • 1970-01-01
  • 2013-03-18
  • 2023-01-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多