|
本帖最后由 liuzhaoyzz 于 2021-6-6 08:22 编辑
看了wintoflash和caocaofff的介绍,似乎WSL效果挺高,但我的WIN10里面的WSL被我干掉了。
chenall说的ubuntu版本16.04好像有点问题,我试了下,ubuntu14.04版本apt在线get的gcc版本才是4.8.4。
另外,grub4dos编译似乎还需要texinfo软件包?gawk最好也加上吧,不清楚mawk能否正常代替之。
https://blog.csdn.net/weixin_30572265/article/details/116678855
(3) 编译源码安装
a.) 编译条件
要编译GRUB的源代码,系统必须具备以下条件:
q GCC2.95或者以上版本
q 安装了GNU Make
q binutils2.9.1.0.23或者个更高版本
q Texinfo 4.0或者更高版本
q Autoconf 2.5x
q Automake 1.7 或者更高版本
sudo apt install -y gcc-4.8 gcc-4.8-multilib nasm upx upx-ucl p7zip-full texinfo autoconf automake make patch binutils-dev liblzma-dev gawk
看下ubuntu版本号:sudo lsb_release -a
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.6 LTS
Release: 14.04
Codename: trusty
看下gcc版本:gcc -v,4.8.4的。
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4)
开始编译了:
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# ./configure
bash: ./configure: 权限不够
权限不够,试了chmod +x ./configure无效,chmod -R 777 ./无效,我原来把源代码放在NTFS分区的,尝试放在FAT32分区也没用,话说ubuntu不是有ntfs-3g加持了吗?NTFS分区读写都没有问题呀!FAT32驱动应该有吧?FAT32分区应该没有什么ACL权限吧?
直接用bash ./configure吧:
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# bash ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/media/root/SSD1/grub4dos-20210602source':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
出错了。
执行uname -m看了下名字是:x86_64
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# uname -m
x86_64
加上--host=x86-64编译试试看:
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# bash ./configure --host=x86-64
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86-64-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for x86-64-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `x86-64': system `64' not recognized
configure: error: /bin/sh ./config.sub x86-64 failed
这个错误信息该怎么解决?
看了下config.log,有几个错误:
configure:3212: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3223: $? = 4
configure:3212: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
上面的错误好像不影响什么。
configure:4016: checking build system type
configure:4030: result: x86_64-unknown-linux-gnu
configure:4050: checking host system type
configure:4059: error: /bin/sh ./config.sub x86-64 failed
上面的错误可能有点问题。./config.sub有读写权限问题?
我的ubuntu14.04是desktop64位版本的,能否正常编译grub4dos BIOS版本?看了caocaofff的介绍,他用的是server64位版本的,应该可以编译啊?奇怪。
我看了caocaofff的脚本,似乎改了国内的源,我试过改了国内的源的话,似乎软件包依赖没有ubuntu官网的丰富。
另外caocaofff似乎用了双重gcc4.6+gcc4.8共存的方案,这种方案感觉不如只用gcc4.8一种方案稳定,grub4dos官方都说了是在gcc4.8下面编译的。
g4d g4e编译都通不过。
|
|