You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

s390架构下编译Nano 2.9.7遇Make错误,求低版本工具适配方案

Compiling Nano 2.9.7 on s390 with Old Autoconf/Automake

Alright, let's work through these build issues step by step—since we can't upgrade your toolchain, we'll tweak nano's build files to play nice with autoconf 2.62 and automake 1.10.

First: Fix the Automake Version Declaration (Instead of Editing configure Directly)

You manually changed am__api_version in the configure script, but that's a temporary fix—make will overwrite this when it regenerates the script. Instead, edit the source file that controls this:

  1. Open Makefile.am
  2. Find the line starting with AM_INIT_AUTOMAKE—it probably looks like this:
    AM_INIT_AUTOMAKE([1.15 foreign no-dist-gzip dist-bzip2])
    
  3. Change the version number from 1.15 to 1.10:
    AM_INIT_AUTOMAKE([1.10 foreign no-dist-gzip dist-bzip2])
    

Second: Confirm the Autoconf Version Requirement

You already started this, but let's lock it in:

  1. Open configure.ac
  2. Ensure line 27 matches your autoconf version:
    AC_PREREQ([2.62])
    

Third: Fix the AC_CONFIG_HEADERS Autoheader Error

The new error happens because your old autoheader expects an explicit declaration for the config header file. Add this to configure.ac:

  1. Find the line right after AC_INIT([nano], [2.9.7], [nano-devel@gnu.org])
  2. Add this line:
    AC_CONFIG_HEADERS([config.h])
    
    If this line already exists, try removing the square brackets to match older autoconf syntax:
    AC_CONFIG_HEADERS(config.h)
    

Fourth: Suppress the Perl Prototype Warning

The main::scan_file() called too early warning is a compatibility issue between automake 1.10 and newer Perl versions. It doesn't break the build, but we can hide it:
Run this in your shell before generating build files:

export PERL5OPT="-Wno-deprecated"

Fifth: Regenerate Build Files Manually

Instead of letting make auto-run these commands (which can cause inconsistencies), run them yourself:

# Generate aclocal.m4 with your automake version
aclocal-1.10 -I m4
# Regenerate the configure script
autoconf
# Generate config.h.in for autoheader
autoheader
# Generate Makefile.in and other required files
automake-1.10 --add-missing

Sixth: Clean and Compile

Now let's start fresh and build nano:

# Wipe all previous build artifacts
make distclean
# Configure nano (add --prefix=/your/path if you want a custom install location)
./configure
# Build the binary
make
# Install (optional, use sudo if needed)
make install

Notes

  • If you hit other dependency errors (like missing ncurses), you'll need to ensure the development libraries for ncurses are installed on your s390 system.
  • The Perl warning might still appear even with the PERL5OPT fix, but it's harmless—you can ignore it as long as the build completes.

内容的提问来源于stack exchange,提问作者RenegadeAndy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 10:18:38