jwt27 / build-gcc

Shell scripts to build various gcc cross-compilers (primarily djgpp)
https://jw.h4ck.me/debian/
GNU General Public License v3.0
41 stars 9 forks source link

build-djgpp fails on Fedora 37 #33

Open cwwcww opened 1 year ago

cwwcww commented 1 year ago

Just tried this on fedora:

[root@e40b6d64708f build-gcc]# ./build-djgpp.sh --batch --prefix=/usr/local --target=i386-pc-msdosdjgpp all
/build-gcc/script/check-deps-and-confirm.sh: line 49: which: command not found
/build-gcc/script/check-deps-and-confirm.sh: line 51: which: command not found
curl or wget not installed

The last message could be ignored, the problem is with which command, it seems to work differently then in Debian-based distros.

jwt27 commented 1 year ago

That's odd. From a quick google, I see Fedora has a separate which package which installs a wrapper function:

https://ask.fedoraproject.org/t/where-is-the-which-command-defined/15119

That breaks which which, but which curl should of course work. Do you have a /usr/bin/which? Does env which which work?

cwwcww commented 1 year ago

Do you have a /usr/bin/which? Does env which which work?

No to both questions, running in clean fedora:37 docker image.

To clarify, I'm not a fedora user, I was just playing around with dockerizing djgpp toolchain, and tried fedora build as well. I'm not particularly interested in making this work, but thought that you would like to know that some of the instructions are broken :)

jwt27 commented 1 year ago

Can you confirm if it works after sudo yum install which? I'll add that in the readme then. Bit surprising that it's not installed by default.

cwwcww commented 1 year ago

The which issue is gone, but it failed on something else:

make[2]: Entering directory '/build-gcc/build/djcross-gcc-12.2.0/autoconf-2.69/bin'
autom4te_perllibdir='..'/lib AUTOM4TE_CFG='../lib/autom4te.cfg'         ../bin/autom4te -B '..'/lib -B '..'/lib
--language M4sh --cache '' --melt ./autoconf.as -o autoconf.in
Can't locate File/Compare.pm in @INC (you may need to install the File::Compare module) (@INC contains: ../lib /usr/local/lib64/perl5/5.36 /usr/local/share/perl5/5.36 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ../lib/Autom4te/FileUtils.pm line 166.
BEGIN failed--compilation aborted at ../lib/Autom4te/FileUtils.pm line 166.
Compilation failed in require at ../bin/autom4te line 40.
BEGIN failed--compilation aborted at ../bin/autom4te line 40.
make[2]: *** [Makefile:641: autoconf.in] Error 2
stsp commented 1 year ago

You can use fedora-built djgpp from here for the time being: https://copr.fedorainfracloud.org/coprs/stsp/dosemu2/package/build-gcc/ Its not to compete with this project, just is available for those who have problems building this one.

sudo dnf copr enable stsp/dosemu2
sudo dnf install build-gcc

(I didn't even care to rename it to djgpp, yep)

stsp commented 1 year ago

@jwt27 you may want to take a look into the patches I applied for the fedora-37 build: https://github.com/stsp/build-gcc/commit/9bcb1ae3d581808c95c21b28e14e7e4414dd79d8 https://github.com/stsp/build-gcc/commit/b6414337e1f291c56c64501e48d5148d5e83059c

Whether or not its going to fix this particular problem is what I don't know because our branches have diverged for too long.