swftools icon indicating copy to clipboard operation
swftools copied to clipboard

Fix compilation on arm64 macOS and Linux and gfx2gfx.c

Open flanter21 opened this issue 1 year ago • 0 comments

  • On Apple Silicon, homebrew installs packages to /opt/homebrew/ rather than /usr/local/ which the current configure script doesn't detect.
    • This is fixed by https://github.com/flanter21/swftools/commit/d0e9ff6f53aad5990b365b0632e6bdc0c33dd703.
  • The use of the inline directive in lib/lame/quantize.c has been known to cause problems before. See https://github.com/matthiaskramm/swftools/issues/178 and https://github.com/matthiaskramm/swftools/pull/179.
    • This is fixed by https://github.com/flanter21/swftools/commit/bd22ccad6d020779bf60f7a8f8aeda7f7177f7d7
    • The issue described above applies to both bitpressure_strategy1 and bitpressure_strategy2 on arm64 linux so I have commented out both inline directives where the issue would occur, rather than just the first like in the issues above.
  • The #includes gfx2gfx.c uses go up two folders rather than just one. I didn't notice any issue in changing it to just go up one folder.
    • https://github.com/flanter21/swftools/commit/1f2e2de76e31fcb8c9e79f807b81aadc00dfe207 fixes an issue that occurred if you attempted to compile gfx2gfx when the repo is in a folder that is not called "swftools".
  • One issue remains that none of these utilities will compile on arm64 linux unless you update config.sub and config.guess.
    • I have not included these in my pull request since I am unsure as to whether it is a license violation to include the now GPLv3-or-later files in a project that is GPLv2-or-later.
    • To fix this on their system, the user can regenerate the config files and script by running
      autoreconf --install --force --include=m4
      autoupdate
      autoconf
      
      and then just compile as normal.

Edit: had broken this pull request, but now it has been fixed

flanter21 avatar Mar 27 '24 11:03 flanter21