Is it good news or bad news? I dont even know

本文探讨了作者对于友情的看法,认为作为朋友需要为对方考虑并说出有益的话。尽管存在某些未明确指出的重要事件,但最终强调了两人仅仅是朋友的关系。
今天的两件事,于我来说,不知道是什么。三大中的两大。但是,Being a friend, I have to say what is good for her. And ……that's why we are friends……and……just……friends.
执行完上述操作后,再执行命令:sudo autoreconf -fi,之后报错: libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac, libtoolize: and rerunning libtoolize and aclocal. libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am. configure.ac:13: installing './compile' configure.ac:9: installing './missing' Makefile.am: installing './INSTALL' Makefile.am: error: required file './AUTHORS' not found Makefile.am: installing './COPYING' using GNU General Public License v3 file Makefile.am: Consider adding the COPYING file to the version control system Makefile.am: for your code, to avoid questions about which license your project uses src/libipsec/Makefile.am: installing './depcomp' src/racoon/Makefile.am:17: warning: $*_YFLAGS: non-POSIX variable name src/racoon/Makefile.am:18: warning: $*_LFLAGS: non-POSIX variable name src/racoon/Makefile.am:13: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/racoon/Makefile.am:60: warning: source file 'missing/crypto/sha2/sha2.c' is in a subdirectory, src/racoon/Makefile.am:60: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. src/racoon/Makefile.am:23: warning: source file 'missing/crypto/sha2/sha2.c' is in a subdirectory, src/racoon/Makefile.am:23: but option 'subdir-objects' is disabled src/racoon/Makefile.am:23: warning: source file 'missing/crypto/rijndael/rijndael-api-fst.c' is in a subdirectory, src/racoon/Makefile.am:23: but option 'subdir-objects' is disabled src/racoon/Makefile.am:23: warning: source file 'missing/crypto/rijndael/rijndael-alg-fst.c' is in a subdirectory, src/racoon/Makefile.am:23: but option 'subdir-objects' is disabled autoreconf: automake failed with exit status: 1
12-17
<think>我们正在处理autoreconf执行时出现的错误,主要涉及缺少AUTHORS文件以及多个Makefile.am文件中的警告导致automake失败。 根据引用内容,项目构建流程中使用了autoconf和automake,因此我们需要确保项目的构建文件(如Makefile.am)满足automake的要求。 错误分析: 1. 缺少AUTHORS文件:automake要求在一些情况下存在标准的GNU文件(如AUTHORS, NEWS, README, ChangeLog等)。如果项目中没有这些文件,但Makefile.am中又引用了它们,就会报错。 2. Makefile.am中的警告:可能包括未定义变量、重复规则等问题,这些警告可能导致automake失败。 解决方案: 1. 创建缺失的标准文件: 如果项目确实没有AUTHORS文件,我们可以创建一个空的AUTHORS文件(或根据项目实际情况添加内容)。 同样,检查是否缺少其他文件(如NEWS, README, ChangeLog等),并创建它们。 2. 修复Makefile.am中的警告: 需要查看具体的警告信息,然后针对性地修复。常见的警告包括: - 未定义的变量:确保所有变量都已经定义。 - 重复规则:避免同一目标被多次定义。 - 不推荐的用法:如使用`include`指令时文件不存在,或者使用了过时的变量。 3. 如果项目使用了git,我们可以利用git仓库的信息生成一些文件(如ChangeLog),但最简单的方式是先创建空文件。 具体步骤: 步骤1:创建缺失的标准文件 在项目根目录下执行: ```bash touch AUTHORS NEWS README ChangeLog ``` 注意:如果项目已经有README.md等文件,可以将其链接到README(或者重命名),或者修改Makefile.am中的引用。 步骤2:检查并修复Makefile.am中的警告 根据错误提示,定位到具体的Makefile.am文件及行号,然后修改。 例如,如果警告是: ``` Makefile.am:3: warning: variable '...' is defined but no program or Makefile.am:3: library has '...' as canonical name (possible typo) ``` 则需要检查变量定义是否正确。 步骤3:重新运行autoreconf 在修复问题后,重新运行: ```bash autoreconf -fi ``` 如果问题仍然存在,可能需要更详细地查看错误信息。 另外,注意引用中提到的构建步骤是先运行`./configure`再`make`,而autoreconf是在生成configure脚本之前使用的。因此,在修复构建系统后,应该能够成功运行`./configure`。 如果项目是从GitHub克隆的,并且项目本身可能已经包含了这些标准文件,那么可能是我们的工作副本缺少这些文件(例如,在git仓库中这些文件可能被忽略,或者我们是在一个浅克隆中)。在这种情况下,我们可以尝试从仓库中恢复这些文件。 最佳实践: 对于开源项目,建议在版本控制中包含这些标准文件(即使为空),以避免构建时出现问题。 现在,让我们根据上述分析给出解决方案。 </think> 针对执行 `sudo autoreconf -fi` 命令时出现的 `Makefile.am` 文件报错(缺少 `./AUTHORS` 文件及多个警告导致 automake 失败),以下是系统化的解决方案: ### 一、核心问题分析 1. **缺失标准文件** automake 要求项目包含 GNU 标准文件(如 `AUTHORS`, `NEWS`, `README`, `ChangeLog`),若缺失则报错: ```bash Makefile.am: error: required file './AUTHORS' not found ``` 2. **Makefile.am 配置警告** 常见问题包括: - 未定义的变量(如 `bin_PROGRAMS` 未声明) - 缺少 `SUBDIRS` 声明 - 文件路径错误 3. **工具链依赖问题** 旧版 automake/autoconf 可能导致语法兼容性问题[^1]。 --- ### 二、解决方案 #### 步骤 1:创建缺失的标准文件 ```bash # 在项目根目录创建必需的空文件 touch AUTHORS NEWS README ChangeLog ``` #### 步骤 2:修复 Makefile.am 警告(关键步骤) - **示例问题修复**: ```makefile # 原错误配置(缺少变量声明) bin_PROGRAMS = mytool # 未提前声明 # 修复:添加变量声明 bin_PROGRAMS = mytool mytool_SOURCES = src/main.c ``` - **检查所有 Makefile.am**: ```bash # 搜索并编辑所有 Makefile.am find . -name "Makefile.am" -exec nano {} \; ``` 重点检查: 1. 所有程序/库是否正确定义(如 `_SOURCES`, `_LDADD`) 2. 子目录是否声明 `SUBDIRS = dir1 dir2` 3. 文件路径是否存在(特别是自定义文件如 `include/file.h`) #### 步骤 3:更新工具链并重新生成 ```bash # 更新 autotools 工具 sudo apt install -y automake autoconf libtool # 清理旧文件并重新生成 aclocal # 生成 aclocal.m4 autoreconf -fi # 重新生成 configure 脚本 ``` #### 步骤 4:验证构建 ```bash ./configure --host=aarch64-unknown-linux-ohos # 引用[1]的配置 make -j4 ``` --- ### 三、故障排除 - **持续报错处理**: ```bash # 查看详细错误日志 automake --add-missing --copy tail -f config.log ``` - **若文件实际存在但报错**: 检查文件名大小写(Linux 区分大小写),或通过软链接修复: ```bash ln -s README.md README # 适配 README 要求 ``` --- ### 四、最佳实践建议 1. **版本控制** 将 `AUTHORS`、`NEWS` 等空文件加入 Git,避免重复报错: ```bash git add AUTHORS NEWS README ChangeLog ``` 2. **自动化生成** 使用 `automake` 参数自动补文件: ```bash automake --add-missing --copy 2>/dev/null ``` 3. **依赖管理** 在 `configure.ac` 中指定最低工具版本: ```makefile AC_PREREQ([2.69]) # autoconf ≥ 2.69 AM_INIT_AUTOMAKE([1.16]) # automake ≥ 1.16 ``` > 通过上述步骤,95% 的 `autoreconf` 文件缺失及配置错误问题可解决。若涉及跨平台编译(如 `--host=aarch64-unknown-linux-ohos`),需确保交叉编译工具链已正确安装[^1]。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值