使用config.site构建* .pc时,@ libdir @不正确? [英] Incorrect @libdir@ when building *.pc using config.site?

查看:101
本文介绍了使用config.site构建* .pc时,@ libdir @不正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Fedora x86_64.它使用/lib64/usr/lib64和朋友.我有以下*.pc.in文件:

I'm working on Fedora x86_64. It uses /lib64, /usr/lib64 and friends. I have the following *.pc.in file:

$ cat libcryptopp.pc.in
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
...

我的config.site具有以下内容.它是从Fedora的config.site复制到的,位于/usr/share/config.site.使用该副本是因为 Fedora x86_64上供应商库的config.site .

My config.site has the following. It was copied from Fedora's config.site at /usr/share/config.site. The copy was used because of config.site for vendor libs on Fedora x86_64.

$ cat /usr/local/share/config.site
...

# Note: This file includes also RHEL/Fedora fix for installing libraries into
# "/lib/lib64" on 64bit systems.

if test -n "$host"; then
    # skip when cross-compiling
    return 0
fi

if test "$prefix" = /usr \
   || { test "$prefix" = NONE && test "$ac_default_prefix" = /usr ; }
then
    test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
    test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var
    test "$localstatedir" = '${prefix}/var' && localstatedir=/var

    ARCH=`uname -m`
    for i in x86_64 ppc64 s390x aarch64; do
        if test $ARCH = $i; then
            test libdir='${exec_prefix}/lib64'
            break
        fi
    done
fi

但是,在Autoconf处理我的*.pc.in文件之后:

However, after Autoconf processes my *.pc.in file:

$ autoreconf --install --force
...
$ ./configure
...

$ cat libcryptopp.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
...

注意libdir=${exec_prefix}/lib,而不是libdir=${exec_prefix}/lib64.

GCC肯定会为该软件包构建64位二进制文​​件.我没有添加-mx32-m32:

GCC is definitely building 64-bit binaries for the package. I did not add -mx32 or -m32:

$ gcc -dumpmachine
x86_64-redhat-linux

为什么使用了错误的lib/目录,该如何解决?

Why is the wrong lib/ directory being used, and how do I fix it?

推荐答案

/usr/local/share/config.site是错误的.尽管它是从Fedora的config.site复制并放置在/usr/local/share中的,但前缀目录是错误的.前缀测试应使用/usr/local而不是/usr.

The /usr/local/share/config.site is wrong. Though it was copied from Fedora's config.site and placed in /usr/local/share, the prefix directories are wrong. The prefix test should use /usr/local and not /usr.

以下是更正的内容.

$ cat /usr/local/share/config.site
...

if test -n "$host"; then
    # skip when cross-compiling
    return 0
fi

if test "$prefix" = /usr/local \
   || { test "$prefix" = NONE && test "$ac_default_prefix" = /usr/local ; }
then
    test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
    test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var
    test "$localstatedir" = '${prefix}/var' && localstatedir=/var

    ARCH=`uname -m`
    for i in x86_64 ppc64 s390x aarch64; do
        if test $ARCH = $i; then
            test "$libdir" = '${exec_prefix}/lib' && libdir='${exec_prefix}/lib64'
            break
        fi
    done
fi

现在,下一个问题是,为什么Fedora的/usr/share/config.site无法正确处理prefix=/usr/local.在问题1510073上,这是一个悬而未决的问题:Autoconf不认可config.site中的libdir为"libdir" = .lib文件中的= @ libdir @" ,已作为 NOT A BUG 关闭.

Now, the next question is, why Fedora's /usr/share/config.site is not handling prefix=/usr/local properly. That's an open question at Issue 1510073 : Autoconf does not honor libdir in config.site for "libdir=@libdir@" in *.pc file, which has been closed as NOT A BUG.

这篇关于使用config.site构建* .pc时,@ libdir @不正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆