gnulib源码安装

news2024/10/7 0:27:59

接上文《autoconf-archive源码安装》, 链接如下:

autoconf-archive源码安装_蓝天居士的博客-CSDN博客

上篇文章在构建autoconf-archive的时候,第一步引导构建就出现了错误,如下所示:

$ ./bootstrap.sh 
./bootstrap.sh:行18: gnulib-tool:未找到命令

根据提示,需要gnulib-tool,这个工具也可以说命令在gnulib包中。本文就对于gnulib包进行源码构建,构建并在系统中安装之后,再继续执行autoconf-archive中的步骤。

0. 源码地址

gnulib源码下载地址经由https://savannah.gnu.org搜索"gnulib"到gnulib - GNU portability library - Summary [Savannah]

在其中点击上图中箭头位置,转到Gnulib - GNU Portability Library - GNU Project - Free Software Foundation

这就是gnulib的github网址,暨上游地址。 

1. 源码下载

运行以下命令下载源码:

$ git clone https://git.savannah.gnu.org/git/gnulib.git
正克隆到 'gnulib'...
remote: Counting objects: 261470, done.
remote: Compressing objects: 100% (31052/31052), done.
接收对象中:  68% (179166/261470), 43.39 MiB | 42.00 KiB/s
remote: Total 261470 (delta 230370), reused 261429 (delta 230340)
接收对象中: 100% (261470/261470), 62.18 MiB | 53.00 KiB/s, 完成.
处理 delta 中: 100% (230370/230370), 完成.

下载完成后,源码内容如下所示(由于文件过多,在此不列出tree结果):

$ ls gnulib/
all-modules  cfg.mk     check-AC_LIBOBJ  check-module  COPYING       doc  examples     gnulib-tool.py       lib  Makefile  MODULES.html.sh  posix-modules  README           tests  users.txt
build-aux    ChangeLog  check-copyright  config        DEPENDENCIES  etc  gnulib-tool  gnulib-tool.py.TODO  m4   modules   NEWS             pygnulib       STATUS-libposix  top

2. 查看帮助

源码下载后,进入源码根目录,并使用./gnulib-tools --help命令查看帮助。如下所示:

$ cd gnulib

$ ./gnulib-tool --help
Usage: gnulib-tool --list
       gnulib-tool --find filename
       gnulib-tool --import [module1 ... moduleN]
       gnulib-tool --add-import [module1 ... moduleN]
       gnulib-tool --remove-import [module1 ... moduleN]
       gnulib-tool --update
       gnulib-tool --create-testdir --dir=directory [module1 ... moduleN]
       gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN]
       gnulib-tool --test --dir=directory [module1 ... moduleN]
       gnulib-tool --megatest --dir=directory [module1 ... moduleN]
       gnulib-tool --extract-description module
       gnulib-tool --extract-comment module
       gnulib-tool --extract-status module
       gnulib-tool --extract-notice module
       gnulib-tool --extract-applicability module
       gnulib-tool --extract-filelist module
       gnulib-tool --extract-dependencies module
       gnulib-tool --extract-recursive-dependencies module
       gnulib-tool --extract-autoconf-snippet module
       gnulib-tool --extract-automake-snippet module
       gnulib-tool --extract-include-directive module
       gnulib-tool --extract-link-directive module
       gnulib-tool --extract-recursive-link-directive module
       gnulib-tool --extract-license module
       gnulib-tool --extract-maintainer module
       gnulib-tool --extract-tests-module module
       gnulib-tool --copy-file file [destination]

Operation modes:

      --list                print the available module names
      --find                find the modules which contain the specified file
      --import              import the given modules into the current package
      --add-import          augment the list of imports from gnulib into the
                            current package, by adding the given modules;
                            if no modules are specified, update the current
                            package from the current gnulib
      --remove-import       reduce the list of imports from gnulib into the
                            current package, by removing the given modules
      --update              update the current package, restore files omitted
                            from version control
      --create-testdir      create a scratch package with the given modules
      --create-megatestdir  create a mega scratch package with the given modules
                            one by one and all together
      --test                test the combination of the given modules
                            (recommended to use CC="gcc -Wall" here)
      --megatest            test the given modules one by one and all together
                            (recommended to use CC="gcc -Wall" here)
      --extract-description        extract the description
      --extract-comment            extract the comment
      --extract-status             extract the status (obsolete etc.)
      --extract-notice             extract the notice or banner
      --extract-applicability      extract the applicability
      --extract-filelist           extract the list of files
      --extract-dependencies       extract the dependencies
      --extract-recursive-dependencies  extract the dependencies of the module
                                        and its dependencies, recursively, all
                                        together, but without the conditions
      --extract-autoconf-snippet   extract the snippet for configure.ac
      --extract-automake-snippet   extract the snippet for library makefile
      --extract-include-directive  extract the #include directive
      --extract-link-directive     extract the linker directive
      --extract-recursive-link-directive  extract the linker directive of the
                                          module and its dependencies,
                                          recursively, all together
      --extract-license            report the license terms of the source files
                                   under lib/
      --extract-maintainer         report the maintainer(s) inside gnulib
      --extract-tests-module       report the unit test module, if it exists
      --copy-file                  copy a file that is not part of any module
      --help                Show this help text.
      --version             Show version and authorship information.

General options:

      --dir=DIRECTORY       Specify the target directory.
                            For --import, this specifies where your
                            configure.ac can be found.  Defaults to current
                            directory.
      --local-dir=DIRECTORY  Specify a local override directory where to look
                            up files before looking in gnulib's directory.
      --cache-modules       Enable module caching optimization.
      --no-cache-modules    Disable module caching optimization.
      --verbose             Increase verbosity. May be repeated.
      --quiet               Decrease verbosity. May be repeated.

Options for --import, --add/remove-import, --update:

      --dry-run             Only print what would have been done.

Options for --import, --add/remove-import:

      --with-tests          Include unit tests for the included modules.

Options for --create-[mega]testdir, --[mega]test:

      --without-tests       Don't include unit tests for the included modules.

Options for --import, --add/remove-import,
            --create-[mega]testdir, --[mega]test:

      --with-obsolete       Include obsolete modules when they occur among the
                            dependencies. By default, dependencies to obsolete
                            modules are ignored.
      --with-c++-tests      Include even unit tests for C++ interoperability.
      --without-c++-tests   Exclude unit tests for C++ interoperability.
      --with-longrunning-tests
                            Include even unit tests that are long-runners.
      --without-longrunning-tests
                            Exclude unit tests that are long-runners.
      --with-privileged-tests
                            Include even unit tests that require root
                            privileges.
      --without-privileged-tests
                            Exclude unit tests that require root privileges.
      --with-unportable-tests
                            Include even unit tests that fail on some platforms.
      --without-unportable-tests
                            Exclude unit tests that fail on some platforms.
      --with-all-tests      Include all kinds of problematic unit tests.
      --avoid=MODULE        Avoid including the given MODULE. Useful if you
                            have code that provides equivalent functionality.
                            This option can be repeated.
      --conditional-dependencies
                            Support conditional dependencies (may save configure
                            time and object code).
      --no-conditional-dependencies
                            Don't use conditional dependencies.
      --libtool             Use libtool rules.
      --no-libtool          Don't use libtool rules.

Options for --import, --add/remove-import:

      --lib=LIBRARY         Specify the library name.  Defaults to 'libgnu'.
      --source-base=DIRECTORY
                            Directory relative to --dir where source code is
                            placed (default "lib").
      --m4-base=DIRECTORY   Directory relative to --dir where *.m4 macros are
                            placed (default "m4").
      --po-base=DIRECTORY   Directory relative to --dir where *.po files are
                            placed (default "po").
      --doc-base=DIRECTORY  Directory relative to --dir where doc files are
                            placed (default "doc").
      --tests-base=DIRECTORY
                            Directory relative to --dir where unit tests are
                            placed (default "tests").
      --aux-dir=DIRECTORY   Directory relative to --dir where auxiliary build
                            tools are placed (default comes from configure.ac).
      --gnu-make            Output for GNU Make instead of for the default
                            Automake
      --lgpl[=2|=3orGPLv2|=3]
                            Abort if modules aren't available under the LGPL.
                            Also modify license template from GPL to LGPL.
                            The version number of the LGPL can be specified;
                            the default is currently LGPLv3.
      --makefile-name=NAME  Name of makefile in the source-base and tests-base
                            directories (default "Makefile.am", or
                            "Makefile.in" if --gnu-make).
      --tests-makefile-name=NAME
                            Name of makefile in the tests-base directory
                            (default as specified through --makefile-name).
      --automake-subdir     Specify that the makefile in the source-base
                            directory be generated in such a way that it can
                            be 'include'd from the toplevel Makefile.am.
      --automake-subdir-tests
                            Likewise, but for the tests directory.
      --macro-prefix=PREFIX  Specify the prefix of the macros 'gl_EARLY' and
                            'gl_INIT'. Default is 'gl'.
      --po-domain=NAME      Specify the prefix of the i18n domain. Usually use
                            the package name. A suffix '-gnulib' is appended.
      --witness-c-macro=NAME  Specify the C macro that is defined when the
                            sources in this directory are compiled or used.
      --vc-files            Update version control related files.
      --no-vc-files         Don't update version control related files
                            (.gitignore and/or .cvsignore).

Options for --create-[mega]testdir, --[mega]test:

      --single-configure    Generate a single configure file, not a separate
                            configure file for the tests directory.

Options for --import, --add/remove-import, --update,
            --create-[mega]testdir, --[mega]test:

  -s, --symbolic, --symlink Make symbolic links instead of copying files.
      --local-symlink       Make symbolic links instead of copying files, only
                            for files from the local override directory.
  -h, --hardlink            Make hard links instead of copying files.
      --local-hardlink      Make hard links instead of copying files, only
                            for files from the local override directory.

Options for --import, --add/remove-import, --update:

  -S, --more-symlinks       Deprecated; equivalent to --symlink.
  -H, --more-hardlinks      Deprecated; equivalent to --hardlink.

Report bugs to <bug-gnulib@gnu.org>.

3. 创建链接

$ sudo ln -s /home/penghao/TPM/dependencies/gnulib/gnulib/gnulib-tool /usr/bin/gnulib-tool

$ ls -l /usr/bin/gnulib-tool 
lrwxrwxrwx 1 root root 56 12月 9日 23:28 /usr/bin/gnulib-tool -> /home/penghao/TPM/dependencies/gnulib/gnulib/gnulib-tool

此时,autoconf-archive之前./bootstrap时的错误就可以解决了。后边的步骤回到本文开头的链接中,感兴趣的读者可以看看。

在此,额外补充一些关于gnulib的知识,以下内容引用自:

glibc、glib和gnulib区别--转帖_honghuzhilangzixin的博客-CSDN博客

------------------------------------------------------------------------------------------------------------------------

glibc、glib和gnulib区别

All three are used for completely different tasks.
这个应该理解成:三者各自适合不同的开发场景;类比什么时候项目用C开发,什么项目又可以基于JVM用JAVA开发。

1. glibc
[ http://www.gnu.org/s/libc/ ]

任何类unix系统都需要一个C库,功能上包括系统调用与基本C函数。可以理解成实现C函数库一个最基本的库,也就是CRT(C Runtime C运行时库)。不同的平台上都各自有自己的C运行库,windows的包含在VC里;
重点:C语言基本库

2. gnulib
[ http://www.gnu.org/software/gnulib/ ]
GUN组织有一个美好的愿景:只要是遵守GNU POSIX标准开发的软件,就可以运行在任何GNU POSIX标准操作系统上。当你需要开发POSIX标准的软件时,你自然先需要这么一个标准库,这就是GNULIB;现实中,各操作系统所提供的开发API甚至C标准函数都不是完全一样的。
重点:POSIX标准

3. glib
[ http://www.gtk.org/ ]
A. 理解GLib的关键在于了解它的历史,简单说来,GLib来自于GTK,GTK源自于GIMP.GIMP是GNU Image Manipulation Program(GNU图像处理程序)的缩写;
B. Glib是什么,有什么?Glib的开发并不与glibc冲突,Glib延伸了C的功能,添加了许多数据结构,添加了一些开发图形系统需要的一些消息处理机制……它是GIMP组织在实际开发中不断地提炼出来的产物。
重点:GTK开发

--------------------------------------------------------------------------------------------------------------------------

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/77435.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

SSM+Mysql实现的大学校园兼职系统(功能包含注册登录,发布兼职、个人中心、论坛交流、系统公告、查看兼职信息、查看用户信息、私聊等)

博客目录SSMMysql实现的大学校园兼职系统实现功能截图系统功能使用技术代码完整源码SSMMysql实现的大学校园兼职系统 本系统是一个在线的大学校园兼职系统&#xff0c;商家可以在上面发布自己的兼职&#xff0c;学生可以根据自己的需要&#xff0c;联系兼职&#xff0c;给学生…

JavaScript 中如何实现并发控制?

一、并发控制简介 在日常开发过程中&#xff0c;你可能会遇到并发控制的场景&#xff0c;比如控制请求并发数。那么在 JavaScript 中如何实现并发控制呢&#xff1f;在回答这个问题之前&#xff0c;我们来简单介绍一下并发控制。 假设有 6 个待办任务要执行&#xff0c;而我们…

Kubernetes HPA 动态弹性扩缩容

1.HPA 1.1HPA介绍 1.在Kubernetes中&#xff0c;HPA自动更新工作负载资源&#xff08;例如&#xff1a;Deployment或者StatefulSet&#xff09;&#xff0c;目的是自动扩缩工作负载以满足需求&#xff0c;水平扩缩意味着对增加的负载的响应是部署更多的 Pod&#xff0c;与垂直…

算法工程师深度解构ChatGPT技术

引言 | 本栏目特邀腾讯知名语言文本项目算法工程师冉昱、薛晨&#xff0c;用专业视野带你由浅入深了解ChatGPT技术全貌。它经历了什么训练过程&#xff1f;成功关键技术是什么&#xff1f;将如何带动行业的变革&#xff1f;开发者如何借鉴ChatGPT思路和技术&#xff0c;投入到日…

西门子PLC S7-1500产生精确时间戳及各种数据处理的方法

目录 1、完整程序 2、将时钟转换成整型数 3、获取相对时间 4、转成微秒&#xff08;μs&#xff09;&#xff0c;并转成32位无符号整数 5、翻转的问题 6、有时间戳采集时的对时机制 在数据采集时&#xff0c;精准的相对时间是非常重要的。尤其是高速采集时&#xff0c;上位…

算法训练第四十五天 | LeetCode 70、322、279背包问题

LeetCode 70爬楼梯 题目简析&#xff1a; 假设你正在爬楼梯。需要 n 阶你才能到达楼顶。 每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢&#xff1f; 思路分析&#xff1a; 用完全背包的思路来做&#xff0c;见注释 //普通dppublic int climbStairs(in…

Redis框架(四):大众点评项目 基于Redis的短信登录

大众点评项目 基于Session的短信登录需求&#xff1a;基于Redis实现短信验证登录基于Redis的短信登录实战优化为Redis login方法配置拦截器实现双重验证配置类实现异步/排序 拦截结果展示SpringCloud章节复习已经过去&#xff0c;新的章节Redis开始了&#xff0c;这个章节中将会…

【图像处理】DWT图像处理【含Matlab源码 198期】

⛄一、数字图像处理简介 图像处理基础教程链接 1 【基础教程】基于matlab图像处理&#xff08;表示方法数据结构基本格式类型转换读取点运算代数运算&#xff09;【含Matlab源码 834期】 2 【基础教程】基于matlab图像处理&#xff08;读写显示运算转换变换增强滤波分析统计&a…

jvm学习笔记(一)----jvm简史

文章目录1. JVM简单介绍2. java虚拟机介绍1. JVM简单介绍 虚拟机是一种抽象化的计算机&#xff0c;通过在实际的计算机上仿真模拟各种计算机功能来实现的。Java虚拟机有自己完善的硬体架构&#xff0c;如处理器、堆栈、寄存器等&#xff0c;还具有相应的指令系统。Java虚拟机屏…

ASP.NET微信快速开发框架源码【源码分享】

ASP.NET微信快速开发框架源码 微信公众平台快速开发框架源码 需要源码学习&#xff0c;查看文末卡片获取&#xff0c;或私信我。 框架主要技术&#xff1a; ASP.NET MVC5、ASP.NET Identity、Bootstrap、KnockoutJs、Entity Framework等。 主要特色&#xff1a; 1、快速迭代开…

Redis主从复制原理

前面的文章中我们演示过Redis主从配置的操作&#xff0c;可以查看之前的博文Redis主从配置教程。这篇文章主要介绍一下Redis主从复制的工作过程和原理。 Redis复制工作过程 Redis复制的工作过程如上图&#xff0c;主要包含以及几个阶段&#xff1a; 1. 设置IP端口并建立连接 …

C++学习笔记(十九)——stack和queue的模拟实现

容器适配器 deque的简单介绍 stack的模拟实现 queue的模拟实现 容器适配器 适配器:一种设计模式,该种模式是将一个类的接口转换成客户希望的另外一个接口. stack和queue的底层结构 可以看出的是,这两个容器 相比我们之间见过的容器多了一个模板参数,也就是容器类的模板参数,…

数据结构复习+答案

一、选择题&#xff1a;&#xff08;每小题2分&#xff0c;共30分&#xff09; 1、在数据的逻辑结构中&#xff0c;树结构和图结构都是&#xff08; &#xff09; A.非线性结构 B.线性结构 C.动态结构 D.静态结构 2.在一个长度为n的顺序表中插入一个元素的算法的时间复杂度为&…

ThinkPHP文件包含漏洞分析

出品|长白山攻防实验室(ID:A_Tree&#xff09; 0x00 声明 以下内容&#xff0c;来自长白山攻防实验室的A_Tree作者原创&#xff0c;由于传播&#xff0c;利用此文所提供的信息而造成的任何直接或间接的后果和损失&#xff0c;均由使用者本人负责&#xff0c;长白山攻防实验室…

全宇宙最强AI 聊天机器人模型ChatGPT惊艳来袭,你还不上车?居然能写演讲稿和帮忙写代码

目录1、ChatGPT介绍2、ChatGPT如何注册&#xff0c;国内不可用3、VS Code下载安装ChatGPT3.1 打开VS Code找到ChatGPT3.2 ChatGPT 详细安装步骤&#xff1a;3.3 用法3.4 国外模式’ 此模式下&#xff0c;速度会比较稳定&#xff0c;如果有条件&#xff0c;建议使用本模式。 理论…

大数据HDFS凭啥能存下百亿数据?

前言 大家平时经常用的百度网盘存放电影、照片、文档等&#xff0c;那有想过百度网盘是如何存下那么多文件的呢&#xff1f;难到是用一台计算机器存的吗&#xff1f;那得多大磁盘啊&#xff1f;显然不是的&#xff0c;那本文就带大家揭秘。 分布式存储思想 既然一台机器的存储…

Spring 核心与设计思想 · Spring IoC容器 · 控制反转式程序开发 · DI概念

Spring 是什么&#xff1f;一、什么是容器&#xff1f;二、什么是 IoC&#xff1f;2.1 传统程序开发2.2 控制反转式程序开发2.3 对比总结规律三、理解 Spring IoC四、DI 概念说明Spring 是什么&#xff1f; 我们通常说的 Spring 是指 Spring Framework&#xff08;Spring 框架…

【Mysql】知识体系结构构建以及常见考题汇总

【Mysql】知识体系结构构建以及常见考题汇总1、基本SQL知识1.1、D_L语法以及表中常用约束1.2、mysql表列常用数据结构1.3、事务&#xff08;此处展示并发事务问题以及解决方案、实现原理见2.3&#xff09;read uncommitted有脏读问题read committed解决脏读、有不可重复读问题r…

Android基础学习(二十)—— 线程安全

1、Android中线程的常见用法 &#xff08;1&#xff09;继承 Thread class MyThread extends Thread{Overridepublic void run(){//处理具体的逻辑} } new MyThread().start(); //启动此线程//使用匿名类 new Thread(){Overridepublic void run(){//处理具体的逻辑} }.star…

【加油站会员管理小程序】03 创建应用

我们上一篇介绍了数据源的创建&#xff0c;本篇我们介绍应用的创建。 微搭低代码中一共有两类应用&#xff0c;一类是数据模型应用&#xff0c;一类是自定义应用。数据模型应用往往对应着PC端的管理后台&#xff0c;例如我们的小程序通常需要一个管理后台来录入数据。 自定义…