tomm / fab-agon-emulator

Agon Light, Agon Light 2, Agon Console8 Emulator for Linux, Windows, any system with libSDL
GNU General Public License v3.0
82 stars 19 forks source link

PLATFORM=mac massage #21

Closed fayep closed 10 months ago

fayep commented 10 months ago

So, thanks for taking the appropriate bits from my last. Here's another set. PLATFORM is unset on mac, so I've created a variable COMPILER which will get set to g++ or clang depending on $(CXX) --version. It will then set your no-narrowing warnings flag on clang. I think that's the right move - you could be running clang on a different platform - it's getting popular these days. Also, I found a better fix (not hardcoding a path) for the SDL2 location problem. My build worked once I replaced -lpthread with -pthread (as another user has already mentioned) on the test_main build. I haven't included that change. I've also created some Dockerfiles which I used to test these changes on Alpine and debian buster. Happy to contribute those.

fayep commented 10 months ago

[+] Building 257.5s (10/10) FINISHED                                                                          
 => [internal] load build definition from Dockerfile.debian                                              0.0s
 => => transferring dockerfile: 44B                                                                      0.0s
 => [internal] load .dockerignore                                                                        0.0s
 => => transferring context: 2B                                                                          0.0s
 => [internal] load metadata for docker.io/library/rust:1.73-bullseye                                    1.0s
 => [internal] load build context                                                                        0.2s
 => => transferring context: 563.86kB                                                                    0.1s
 => [stage-0 1/5] FROM docker.io/library/rust:1.73-bullseye@sha256:1c75c6b98dd762d4de70bc1b165c591c8261  0.0s
 => CACHED [stage-0 2/5] RUN --mount=type=cache,target=/var/cache/apt     apt update  && apt install -y  0.0s
 => [stage-0 3/5] COPY . /fab-agon-emulator                                                              0.5s
 => [stage-0 4/5] WORKDIR /fab-agon-emulator                                                             0.0s
 => [stage-0 5/5] RUN --mount=type=cache,target=/usr/local/cargo/registry     make                     255.1s
 => exporting to image                                                                                   0.6s 
 => => exporting layers                                                                                  0.6s 
 => => writing image sha256:307365e4330419d7c2b42ff1bcc4905ba61792779188eba88949380389eba236             0.0s 

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them          
faye@FayesMaxBookPro fab-agon-emulator % docker build -f Dockerfile.debian --platform linux/arm64 .
[+] Building 31.9s (10/10) FINISHED                                                                           
 => [internal] load build definition from Dockerfile.debian                                              0.0s
 => => transferring dockerfile: 44B                                                                      0.0s
 => [internal] load .dockerignore                                                                        0.0s
 => => transferring context: 2B                                                                          0.0s
 => [internal] load metadata for docker.io/library/rust:1.73-bullseye                                    1.8s
 => [stage-0 1/5] FROM docker.io/library/rust:1.73-bullseye@sha256:1c75c6b98dd762d4de70bc1b165c591c8261  0.0s
 => [internal] load build context                                                                        0.2s
 => => transferring context: 563.86kB                                                                    0.2s
 => CACHED [stage-0 2/5] RUN --mount=type=cache,target=/var/cache/apt     apt update  && apt install -y  0.0s
 => CACHED [stage-0 3/5] COPY . /fab-agon-emulator                                                       0.0s
 => CACHED [stage-0 4/5] WORKDIR /fab-agon-emulator                                                      0.0s
 => [stage-0 5/5] RUN --mount=type=cache,target=/usr/local/cargo/registry     make                      28.9s
 => exporting to image                                                                                   0.9s
 => => exporting layers                                                                                  0.9s
 => => writing image sha256:ccfe249a9b75ca9f775f25c7cbeb040aaba19529b170aff022ac37002f0cc88c             0.0s 

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them          
fayep commented 10 months ago

And the last bit of the native arm/darwin build:

c++ rust_glue.o -pthread test_main.o vdp-1.03.o userspace-vdp-gl/src/vdp-gl.a -o test_main
cp src/vdp/*.so firmware/
FORCE=1 cargo build -r
   Compiling libc v0.2.149
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.69
   Compiling unicode-ident v1.0.12
   Compiling bitflags v2.4.1
   Compiling serde v1.0.190
   Compiling syn v1.0.109
   Compiling version-compare v0.1.1
   Compiling thiserror v1.0.50
   Compiling rustix v0.38.20
   Compiling unicode-segmentation v1.10.1
   Compiling bitflags v1.3.2
   Compiling ppv-lite86 v0.2.17
   Compiling sdl2-sys v0.35.2
   Compiling smallvec v1.11.1
   Compiling heck v0.3.3
   Compiling version-compare v0.0.11
   Compiling pkg-config v0.3.27
   Compiling nibble_vec v0.1.0
   Compiling strum v0.20.0
   Compiling endian-type v0.1.2
   Compiling home v0.5.5
   Compiling radix_trie v0.2.1
   Compiling sdl2 v0.35.2
   Compiling utf8parse v0.2.1
   Compiling memchr v2.6.4
   Compiling ez80 v0.4.1 (https://github.com/tomm/ez80.git?rev=94649b67e98e1a8dff1a742d04c7eb7cff8ab538#94649b67)
   Compiling log v0.4.20
   Compiling unicode-width v0.1.11
   Compiling lazy_static v1.4.0
   Compiling libloading v0.8.1
   Compiling pico-args v0.5.0
   Compiling quote v1.0.33
   Compiling syn v2.0.38
   Compiling getrandom v0.2.10
   Compiling errno v0.3.5
   Compiling nix v0.26.4
   Compiling nix v0.27.1
   Compiling rand_core v0.6.4
   Compiling rand_chacha v0.3.1
   Compiling toml v0.5.11
   Compiling rand v0.8.5
   Compiling thiserror-impl v1.0.50
   Compiling fd-lock v3.0.13
   Compiling rustyline v12.0.0
   Compiling agon-cpu-emulator v0.2.2 (https://github.com/tomm/agon-cpu-emulator.git?rev=06aba0a4cba64baebacf883692b9940b1355dc1b#06aba0a4)
   Compiling ctrlc v3.4.1
   Compiling strum_macros v0.20.1
   Compiling agon-light-emulator-debugger v0.1.4 (https://github.com/tomm/agon-light-emulator-debugger.git?rev=6cee077e12b9c1b40a7c8ccbdc6d4cc02beb3f2f#6cee077e)
   Compiling system-deps v2.0.3
   Compiling fab-agon-emulator v0.8.9 (/Users/faye/Source/fab-agon-emulator)
    Finished release [optimized] target(s) in 5.75s
cp ./target/release/fab-agon-emulator .