Skip to content

Fix the configure script and makefile to work on Window/Linux#110

Open
playmer wants to merge 48 commits into
Galladite27:masterfrom
playmer:playmer/multiplat_makefile
Open

Fix the configure script and makefile to work on Window/Linux#110
playmer wants to merge 48 commits into
Galladite27:masterfrom
playmer:playmer/multiplat_makefile

Conversation

@playmer

@playmer playmer commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

This resolves the issues causing the configure script and generated makefiles from working on Windows, as well as some general enhancements and cleanups of the build and extlibs. There's a few general issues that caused the failures:

  • Hardcoding of secondary scripts, such as the libtool, freetype, and sdl configs.
  • Not accounting for configuring on each platform, this technically was set up, but couldn't work due to the configure scripts also needing to be regenerated.
  • Removal of generation/configuration required files from various dependencies. This was partially addressed in the previous PR, but for future dependency upgrades, they should not be "cleaned". If anything by taking source drops instead of using submodules or some other cloning system, we're often losing files such as .gitignores that cause various cleaning issues for us.
  • Various line ending issues. The various generation and configure scripts absolutely choke when files are not using LF line endings. Without explicitly forcing this in the repo settings in .gitattributes, we're up to whatever the settings on the users install gives them.

As part of this I had to rewrite dep handling in Makefile.extlibs. While I was in there, I set things up such that nearly every built/installed file gets put into a top level build folder. Without doing this the repo is populated with detritus from previous, potentially failed builds, some ignored, some not, as mentioned above. We also don't build from the extlib directory anymore, we copy the dependencies out into the build folder first, since we can't easily change everything they mess with otherwise. This greatly simplifies cleaning in the makefile, so that was adjusted.

Additional Changes:

  • Added the packaged dependencies flow to the CI.
  • Some flag generation was adjusted, but this is relatively lightly touched.
  • I've tried to improve the compiler detection.

Lingering Issues:

  • There's still a few oddities with regards to packaged builds, but as far as I can tell they already existed and we just weren't testing them well. It seems like the configure script just isn't correctly picking up packaged dependencies, which isn't surprising given the detection logic, but I've not really touched that besides SDL, which does work. My plan is to fix these issues in a follow up PR.
  • Linked to the above, we'll probably need to look further at flag generation to ensure we're using our dependencies properly. It's a little slapdash at the moment, leading to to these issues. I think this will be improved alongside fixing the package detection.
  • Although improved, the compiler detection still seems a bit...off. I plan to take another pass at this.

Not done of course, the connections between the extlib and onscripter stuff in the makefile doesn't work right yet, needs a look-see. So CI will likely fail. Linux will need a checkup after WIndows is up to scratch.
@SeanMcG

SeanMcG commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

sorry for taking so long to look at this... I will be honest, it's quite large and overwhelming to review it.

@playmer

playmer commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

Yeah unfortunately it's not trivial to do this in phases. The external libs needed a fundamental overhaul on how they were being built and depended on. Doing some mix and one dep at a time was probably doable, but wouildn't have actually fixed anything until most of them had been done. I could've likely separated out the work with regards to where intermediates and installations go, but it would've made things much more difficult to structure.

As it is, there's still work that can be done here to simplify things in the configure script and generated makefile, but that would've required even more changes. I tried to keep it relatively simple if more verbose than I'd like.

There's also probably a discussion to be had on if dependencies should be built/installed as part of the configure script rather than during the make invokation, I decided to continue doing it during make, as otherwise you can run afoul of system deps changing out from under the libraries we built, and I didn't want to risk it.

At the very least, the extlibs deps are all structured very similarly, the only interesting differences being if they need to be autoconf'd, reconf'd, or just built. I spent some time looking into how trivial it'd be to unify how these are done to make the diff less annoying to look at, but it just seemed like it'd make things more difficult to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants