From 834a6084c308c5691c1853a52f62deabca07ef8d Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Wed, 28 May 2025 14:03:13 -0700 Subject: [PATCH 01/11] WIP. Moving to WSL1 environment --- bin/makefile-cygwin.x86_64-sdl | 2 +- bin/makefile-wsl1.x86_64-sdl | 25 +++++++++++++++++++++++++ bin/makefile-wsl1.x86_64-x | 28 ++++++++++++++++++++++++++++ bin/osversion | 7 ++++++- inc/maiko/platform.h | 12 +++++++++++- 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 bin/makefile-wsl1.x86_64-sdl create mode 100644 bin/makefile-wsl1.x86_64-x diff --git a/bin/makefile-cygwin.x86_64-sdl b/bin/makefile-cygwin.x86_64-sdl index 28531eb..6538071 100644 --- a/bin/makefile-cygwin.x86_64-sdl +++ b/bin/makefile-cygwin.x86_64-sdl @@ -15,7 +15,7 @@ XFLAGS = -DSDL=2 # OPTFLAGS is normally -O2. OPTFLAGS = -O2 -g3 -DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) +DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__ LDFLAGS = -lm -L/usr/local/lib -lSDL2 # diff --git a/bin/makefile-wsl1.x86_64-sdl b/bin/makefile-wsl1.x86_64-sdl new file mode 100644 index 0000000..ccf98c3 --- /dev/null +++ b/bin/makefile-wsl1.x86_64-sdl @@ -0,0 +1,25 @@ +# Options for Linux, Intel x86_64 and SDL + +CC = gcc -m64 $(GCC_CFLAGS) +# CC = clang -m64 $(CLANG_CFLAGS) + +XFILES = $(OBJECTDIR)sdl.o + +# +# For SDL version 2 +# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS +# For SDL version 3 +# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS +# +XFLAGS = -DSDL=2 + +# OPTFLAGS is normally -O2. +OPTFLAGS = -O2 -g3 +DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) + +LDFLAGS = -lm -lSDL2 +LDELDFLAGS = + +OBJECTDIR = ../$(RELEASENAME)/ + +default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl diff --git a/bin/makefile-wsl1.x86_64-x b/bin/makefile-wsl1.x86_64-x new file mode 100644 index 0000000..4e80252 --- /dev/null +++ b/bin/makefile-wsl1.x86_64-x @@ -0,0 +1,28 @@ +# Options for Linux, Intel x86_64 and X-Window + +CC = gcc -m64 $(GCC_CFLAGS) +# CC = clang -m64 $(CLANG_CFLAGS) + +XFILES = $(OBJECTDIR)xmkicon.o \ + $(OBJECTDIR)xbbt.o \ + $(OBJECTDIR)dspif.o \ + $(OBJECTDIR)xinit.o \ + $(OBJECTDIR)xscroll.o \ + $(OBJECTDIR)xcursor.o \ + $(OBJECTDIR)xlspwin.o \ + $(OBJECTDIR)xrdopt.o \ + $(OBJECTDIR)xwinman.o + + +XFLAGS = -DXWINDOW + +# OPTFLAGS is normally -O2. +OPTFLAGS = -O2 -g3 +DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__ + +LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm +LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm + +OBJECTDIR = ../$(RELEASENAME)/ + +default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex diff --git a/bin/osversion b/bin/osversion index 80bf6bd..6d6cf21 100755 --- a/bin/osversion +++ b/bin/osversion @@ -8,7 +8,12 @@ case "$os" in *-*-solaris2*) echo sunos5 ;; alpha-dec-osf1) echo osf1 ;; *-apple-darwin*) echo darwin ;; - *-*-linux*) echo linux ;; + *-*-linux*) + echo d"${WSL_DISTRO_NAME}"d + echo i"${WSL_INTEROP}"i + + if [ -n "${WSL_DISTRO_NAME}" ] && [ -z "${WSL_INTEROP}" ]; + then echo wsl1; else echo linux; fi ;; *-*-openbsd*) echo openbsd ;; *-*-freebsd*) echo freebsd ;; *-*-cygwin*) echo cygwin ;; diff --git a/inc/maiko/platform.h b/inc/maiko/platform.h index 725db07..8769731 100644 --- a/inc/maiko/platform.h +++ b/inc/maiko/platform.h @@ -38,13 +38,23 @@ # define MAIKO_OS_DETECTED 1 #endif -#ifdef __linux__ +#if defined(__linux__) && !defined(__wsl1__) # define MAIKO_OS_LINUX 1 # define MAIKO_OS_NAME "Linux" # define MAIKO_OS_UNIX_LIKE 1 # define MAIKO_OS_DETECTED 1 #endif +#if defined(__linux__) && defined(__wsl1__) +# define MAIKO_OS_LINUX 1 +# define MAIKO_OS_WSL1 1 +# define MAIKO_OS_NAME "Windows System for Linux v1" +# define MAIKO_OS_UNIX_LIKE 1 +# define MAIKO_EMULATE_TIMER_INTERRUPTS 1 +# define MAIKO_EMULATE_ASYNC_INTERRUPTS 1 +# define MAIKO_OS_DETECTED 1 +#endif + #ifdef __NetBSD__ # define MAIKO_OS_NETBSD 1 # define MAIKO_OS_NAME "NetBSD" From 6d171bff1d2d868ac6ffd744ed0d45d5812cf8a4 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 3 Jun 2025 18:54:15 -0700 Subject: [PATCH 02/11] Create/update additional makefiles for building maiko for WSL1. Update buildRelease workflow and assicated Dockerfile to build the WSL1 variants along wih standard linux variants. --- .github/workflows/Dockerfile_maiko | 13 +++++++++++-- .github/workflows/buildRelease.yml | 10 +++++++++- bin/makefile-init-wsl1.aarch64 | 29 +++++++++++++++++++++++++++++ bin/makefile-init-wsl1.x86_64 | 29 +++++++++++++++++++++++++++++ bin/makefile-wsl1.aarch64-sdl | 25 +++++++++++++++++++++++++ bin/makefile-wsl1.aarch64-x | 27 +++++++++++++++++++++++++++ bin/makefile-wsl1.x86_64-sdl | 29 ++++++++++++++++++++++++++++- bin/makefile-wsl1.x86_64-x | 2 +- bin/osversion | 3 --- 9 files changed, 159 insertions(+), 8 deletions(-) create mode 100644 bin/makefile-init-wsl1.aarch64 create mode 100644 bin/makefile-init-wsl1.x86_64 create mode 100644 bin/makefile-wsl1.aarch64-sdl create mode 100644 bin/makefile-wsl1.aarch64-x diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index 5f9cd45..b7a52b9 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -18,8 +18,17 @@ COPY . ${INSTALL_LOCATION} # Build maiko RUN cd ${INSTALL_LOCATION}/bin \ && ./makeright x cleanup \ - && ./makeright x -RUN cd ${INSTALL_LOCATION}/bin \ + && ./makeright x \ && if [ "$(./machinetype)" = "x86_64" ]; then \ ./makeright init; \ fi +# Build specially for WSL1 by "fooling" a linux build +RUN arch="$(./machinetype)" \ + && if [ "$arch" = "x86_64" ] || [ "$arch" = "aarch64" ]; then \ + cd ${INSTALL_LOCATION}/bin \ + && echo "echo #!/bin/sh" > osversion \ + && echo "echo wsl1" >> osversion \ + && ./makeright x cleanup \ + && ./makeright x \ + && ./makeright init; \ + fi diff --git a/.github/workflows/buildRelease.yml b/.github/workflows/buildRelease.yml index becc4d8..ce99828 100644 --- a/.github/workflows/buildRelease.yml +++ b/.github/workflows/buildRelease.yml @@ -224,7 +224,13 @@ jobs: RELEASE_TAG: ${{ steps.tag.outputs.release_tag }} run: | mkdir -p /tmp/release_tars - for OSARCH in "linux.x86_64:linux_amd64" "linux.aarch64:linux_arm64" "linux.armv7l:linux_arm_v7" ; \ + for OSARCH in \ + "linux.x86_64:linux_amd64" \ + "linux.aarch64:linux_arm64" \ + "linux.armv7l:linux_arm_v7" \ + "wsl1.x86_64:linux_amd64" \ + "wsl1.aarch64:linux_arm64" \ + ; \ do \ pushd /tmp/docker_images/${OSARCH##*:}/usr/local/interlisp >/dev/null ; \ /usr/bin/tar -c -z \ @@ -246,6 +252,8 @@ jobs: artifacts: /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-linux.x86_64.tgz, /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-linux.aarch64.tgz, + /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-wsl1.x86_64.tgz, + /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-wsl1.aarch64.tgz, /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-linux.armv7l.tgz tag: ${{ steps.tag.outputs.release_tag }} draft: ${{ needs.inputs.outputs.draft }} diff --git a/bin/makefile-init-wsl1.aarch64 b/bin/makefile-init-wsl1.aarch64 new file mode 100644 index 0000000..5362d82 --- /dev/null +++ b/bin/makefile-init-wsl1.aarch64 @@ -0,0 +1,29 @@ +# Options for Windows System for Linux v1, aarch64 processor, X windows, for INIT processing + +CC = gcc $(GCC_CFLAGS) +#CC = clang $(CLANG_CFLAGS) + +XFILES = $(OBJECTDIR)xmkicon.o \ + $(OBJECTDIR)xbbt.o \ + $(OBJECTDIR)dspif.o \ + $(OBJECTDIR)xinit.o \ + $(OBJECTDIR)xscroll.o \ + $(OBJECTDIR)xcursor.o \ + $(OBJECTDIR)xlspwin.o \ + $(OBJECTDIR)xrdopt.o \ + $(OBJECTDIR)xwinman.o + + +XFLAGS = -DXWINDOW + +# OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it +OPTFLAGS = -O0 -g +DEBUGFLAGS = +DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT -D__wsl1__ + +LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm +LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm + +OBJECTDIR = ../$(RELEASENAME)/ + +default : ../$(OSARCHNAME)/ldeinit diff --git a/bin/makefile-init-wsl1.x86_64 b/bin/makefile-init-wsl1.x86_64 new file mode 100644 index 0000000..182631f --- /dev/null +++ b/bin/makefile-init-wsl1.x86_64 @@ -0,0 +1,29 @@ +# Options for Windows System for Linux v1, Intel x86_64 processor, X windows, for INIT processing + +CC = gcc $(GCC_CFLAGS) +#CC = clang $(CLANG_CFLAGS) + +XFILES = $(OBJECTDIR)xmkicon.o \ + $(OBJECTDIR)xbbt.o \ + $(OBJECTDIR)dspif.o \ + $(OBJECTDIR)xinit.o \ + $(OBJECTDIR)xscroll.o \ + $(OBJECTDIR)xcursor.o \ + $(OBJECTDIR)xlspwin.o \ + $(OBJECTDIR)xrdopt.o \ + $(OBJECTDIR)xwinman.o + + +XFLAGS = -DXWINDOW + +# OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it +OPTFLAGS = -O0 -g +DEBUGFLAGS = +DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT -D__wsl1__ + +LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm +LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm + +OBJECTDIR = ../$(RELEASENAME)/ + +default : ../$(OSARCHNAME)/ldeinit diff --git a/bin/makefile-wsl1.aarch64-sdl b/bin/makefile-wsl1.aarch64-sdl new file mode 100644 index 0000000..94b719c --- /dev/null +++ b/bin/makefile-wsl1.aarch64-sdl @@ -0,0 +1,25 @@ +# Options for Linux, ARM64 and SDL + +CC = gcc $(GCC_CFLAGS) +#CC = clang $(CLANG_CFLAGS) + +XFILES = $(OBJECTDIR)sdl.o + +# +# For SDL version 2 +# -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS +# For SDL version 3 +# -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS +# +SDLFLAGS = -DSDL=2 + +# OPTFLAGS is normally -O2. +OPTFLAGS = -O2 -g3 +DFLAGS = $(SDLFLAGS) -DRELEASE=$(RELEASE) + +LDFLAGS = -lSDL2 -lm +LDELDFLAGS = + +OBJECTDIR = ../$(RELEASENAME)/ + +default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl diff --git a/bin/makefile-wsl1.aarch64-x b/bin/makefile-wsl1.aarch64-x new file mode 100644 index 0000000..15964b5 --- /dev/null +++ b/bin/makefile-wsl1.aarch64-x @@ -0,0 +1,27 @@ +# Options for Windows System for Linux v1, aarch64 and X-Window + +CC = gcc $(GCC_CFLAGS) +#CC = clang $(CLANG_CFLAGS) + +XFILES = $(OBJECTDIR)xmkicon.o \ + $(OBJECTDIR)xbbt.o \ + $(OBJECTDIR)dspif.o \ + $(OBJECTDIR)xinit.o \ + $(OBJECTDIR)xscroll.o \ + $(OBJECTDIR)xcursor.o \ + $(OBJECTDIR)xlspwin.o \ + $(OBJECTDIR)xrdopt.o \ + $(OBJECTDIR)xwinman.o + +XFLAGS = -DXWINDOW + +# OPTFLAGS is normally -O2. +OPTFLAGS = -O2 -g3 +DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__ + +LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm +LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm + +OBJECTDIR = ../$(RELEASENAME)/ + +default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex diff --git a/bin/makefile-wsl1.x86_64-sdl b/bin/makefile-wsl1.x86_64-sdl index ccf98c3..765b562 100644 --- a/bin/makefile-wsl1.x86_64-sdl +++ b/bin/makefile-wsl1.x86_64-sdl @@ -1,3 +1,30 @@ +# Options for Windows System for Linux v1, Intel x86_64 and SDL + +CC = gcc $(GCC_CFLAGS) +#CC = clang $(CLANG_CFLAGS) + +XFILES = $(OBJECTDIR)xmkicon.o \ + $(OBJECTDIR)xbbt.o \ + $(OBJECTDIR)dspif.o \ + $(OBJECTDIR)xinit.o \ + $(OBJECTDIR)xscroll.o \ + $(OBJECTDIR)xcursor.o \ + $(OBJECTDIR)xlspwin.o \ + $(OBJECTDIR)xrdopt.o \ + $(OBJECTDIR)xwinman.o + +XFLAGS = -DXWINDOW + +# OPTFLAGS is normally -O2. +OPTFLAGS = -O2 -g3 +DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__ + +LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm +LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm + +OBJECTDIR = ../$(RELEASENAME)/ + +default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex # Options for Linux, Intel x86_64 and SDL CC = gcc -m64 $(GCC_CFLAGS) @@ -15,7 +42,7 @@ XFLAGS = -DSDL=2 # OPTFLAGS is normally -O2. OPTFLAGS = -O2 -g3 -DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) +DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__ LDFLAGS = -lm -lSDL2 LDELDFLAGS = diff --git a/bin/makefile-wsl1.x86_64-x b/bin/makefile-wsl1.x86_64-x index 4e80252..fe1b6c0 100644 --- a/bin/makefile-wsl1.x86_64-x +++ b/bin/makefile-wsl1.x86_64-x @@ -1,4 +1,4 @@ -# Options for Linux, Intel x86_64 and X-Window +# Options for Windows System for Linux v1, Intel x86_64 and X-Window CC = gcc -m64 $(GCC_CFLAGS) # CC = clang -m64 $(CLANG_CFLAGS) diff --git a/bin/osversion b/bin/osversion index 6d6cf21..b51d919 100755 --- a/bin/osversion +++ b/bin/osversion @@ -9,9 +9,6 @@ case "$os" in alpha-dec-osf1) echo osf1 ;; *-apple-darwin*) echo darwin ;; *-*-linux*) - echo d"${WSL_DISTRO_NAME}"d - echo i"${WSL_INTEROP}"i - if [ -n "${WSL_DISTRO_NAME}" ] && [ -z "${WSL_INTEROP}" ]; then echo wsl1; else echo linux; fi ;; *-*-openbsd*) echo openbsd ;; From 59953c2629a1c2f8a436a9e91256d5b3733edb3c Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 3 Jun 2025 19:01:14 -0700 Subject: [PATCH 03/11] Fix error is Dockerfile_maiko for wsl1 --- .github/workflows/Dockerfile_maiko | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index b7a52b9..37e0cdc 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -23,10 +23,10 @@ RUN cd ${INSTALL_LOCATION}/bin \ ./makeright init; \ fi # Build specially for WSL1 by "fooling" a linux build -RUN arch="$(./machinetype)" \ +RUN cd ${INSTALL_LOCATION}/bin \ + && arch="$(./machinetype)" \ && if [ "$arch" = "x86_64" ] || [ "$arch" = "aarch64" ]; then \ - cd ${INSTALL_LOCATION}/bin \ - && echo "echo #!/bin/sh" > osversion \ + echo "echo #!/bin/sh" > osversion \ && echo "echo wsl1" >> osversion \ && ./makeright x cleanup \ && ./makeright x \ From 5d3639a9055e156ae5465099da74f2b6bfe3279b Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 3 Jun 2025 19:19:08 -0700 Subject: [PATCH 04/11] Fix another error is Dockerfile_maiko for wsl1 --- .github/workflows/Dockerfile_maiko | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index 37e0cdc..00f0b0b 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -26,7 +26,7 @@ RUN cd ${INSTALL_LOCATION}/bin \ RUN cd ${INSTALL_LOCATION}/bin \ && arch="$(./machinetype)" \ && if [ "$arch" = "x86_64" ] || [ "$arch" = "aarch64" ]; then \ - echo "echo #!/bin/sh" > osversion \ + echo "#!/bin/sh" > osversion \ && echo "echo wsl1" >> osversion \ && ./makeright x cleanup \ && ./makeright x \ From 389ecf78748e9afecd431a294963ac3b879d56b3 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 3 Jun 2025 22:27:16 -0700 Subject: [PATCH 05/11] Fix Dockerfile_maiko so osversion is restored after building the wsl1 lde executables. --- .github/workflows/Dockerfile_maiko | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index 00f0b0b..2ddee5c 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -26,9 +26,12 @@ RUN cd ${INSTALL_LOCATION}/bin \ RUN cd ${INSTALL_LOCATION}/bin \ && arch="$(./machinetype)" \ && if [ "$arch" = "x86_64" ] || [ "$arch" = "aarch64" ]; then \ - echo "#!/bin/sh" > osversion \ + mv osversion oserversion.hold \ + && echo "#!/bin/sh" > osversion \ && echo "echo wsl1" >> osversion \ && ./makeright x cleanup \ && ./makeright x \ - && ./makeright init; \ + && ./makeright init \ + && mv osversion.hold osversion \ + ; \ fi From 7dd3c90a77787df4645ed8d7baab64910aad5408 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 3 Jun 2025 22:40:11 -0700 Subject: [PATCH 06/11] Fix up various makefile-wsl (and -cygwin) errors pointed out by gemini-code-assist! --- bin/makefile-cygwin.x86_64-sdl | 2 +- bin/makefile-wsl1.aarch64-sdl | 4 ++-- bin/makefile-wsl1.x86_64-sdl | 27 --------------------------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/bin/makefile-cygwin.x86_64-sdl b/bin/makefile-cygwin.x86_64-sdl index 6538071..28531eb 100644 --- a/bin/makefile-cygwin.x86_64-sdl +++ b/bin/makefile-cygwin.x86_64-sdl @@ -15,7 +15,7 @@ XFLAGS = -DSDL=2 # OPTFLAGS is normally -O2. OPTFLAGS = -O2 -g3 -DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__ +DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) LDFLAGS = -lm -L/usr/local/lib -lSDL2 # diff --git a/bin/makefile-wsl1.aarch64-sdl b/bin/makefile-wsl1.aarch64-sdl index 94b719c..f3ce3ca 100644 --- a/bin/makefile-wsl1.aarch64-sdl +++ b/bin/makefile-wsl1.aarch64-sdl @@ -1,4 +1,4 @@ -# Options for Linux, ARM64 and SDL +# Options for Windows System for Linux v1, ARM64 and SDL CC = gcc $(GCC_CFLAGS) #CC = clang $(CLANG_CFLAGS) @@ -15,7 +15,7 @@ SDLFLAGS = -DSDL=2 # OPTFLAGS is normally -O2. OPTFLAGS = -O2 -g3 -DFLAGS = $(SDLFLAGS) -DRELEASE=$(RELEASE) +DFLAGS = $(SDLFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__ LDFLAGS = -lSDL2 -lm LDELDFLAGS = diff --git a/bin/makefile-wsl1.x86_64-sdl b/bin/makefile-wsl1.x86_64-sdl index 765b562..ec16b95 100644 --- a/bin/makefile-wsl1.x86_64-sdl +++ b/bin/makefile-wsl1.x86_64-sdl @@ -1,32 +1,5 @@ # Options for Windows System for Linux v1, Intel x86_64 and SDL -CC = gcc $(GCC_CFLAGS) -#CC = clang $(CLANG_CFLAGS) - -XFILES = $(OBJECTDIR)xmkicon.o \ - $(OBJECTDIR)xbbt.o \ - $(OBJECTDIR)dspif.o \ - $(OBJECTDIR)xinit.o \ - $(OBJECTDIR)xscroll.o \ - $(OBJECTDIR)xcursor.o \ - $(OBJECTDIR)xlspwin.o \ - $(OBJECTDIR)xrdopt.o \ - $(OBJECTDIR)xwinman.o - -XFLAGS = -DXWINDOW - -# OPTFLAGS is normally -O2. -OPTFLAGS = -O2 -g3 -DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__ - -LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm - -OBJECTDIR = ../$(RELEASENAME)/ - -default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex -# Options for Linux, Intel x86_64 and SDL - CC = gcc -m64 $(GCC_CFLAGS) # CC = clang -m64 $(CLANG_CFLAGS) From b029b98fca9b5aad66a25543d79e2ec1c7188b41 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 3 Jun 2025 23:25:35 -0700 Subject: [PATCH 07/11] Fix Dockerfile_maiko to set execute permissions on osversion while building wsl1 versions of maiko --- .github/workflows/Dockerfile_maiko | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index 2ddee5c..685b413 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -29,9 +29,11 @@ RUN cd ${INSTALL_LOCATION}/bin \ mv osversion oserversion.hold \ && echo "#!/bin/sh" > osversion \ && echo "echo wsl1" >> osversion \ + && chmod ugo+x osversion \ && ./makeright x cleanup \ && ./makeright x \ && ./makeright init \ && mv osversion.hold osversion \ + && chmod ugo+x osversion \ ; \ fi From 5dc9233aef77120126e8bf2aa874215a529f4e44 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 3 Jun 2025 23:31:46 -0700 Subject: [PATCH 08/11] One more typo in Dockerfile_maiko --- .github/workflows/Dockerfile_maiko | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index 685b413..3b3e66d 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -26,7 +26,7 @@ RUN cd ${INSTALL_LOCATION}/bin \ RUN cd ${INSTALL_LOCATION}/bin \ && arch="$(./machinetype)" \ && if [ "$arch" = "x86_64" ] || [ "$arch" = "aarch64" ]; then \ - mv osversion oserversion.hold \ + mv osversion osversion.hold \ && echo "#!/bin/sh" > osversion \ && echo "echo wsl1" >> osversion \ && chmod ugo+x osversion \ From 6aafbbcb051c33c8e7f205b8e7747a3840852424 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Sun, 15 Jun 2025 22:56:36 -0700 Subject: [PATCH 09/11] Enable using LDEARCH to set wsl1 as the osversion. Set LDEARCH to get a WSL1 compile on a standard Linux system in Dockerfile_maiko (and hence in the workflow buildRelease.yml). --- .github/workflows/Dockerfile_maiko | 8 ++------ bin/osversion | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index 3b3e66d..4b209ca 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -26,14 +26,10 @@ RUN cd ${INSTALL_LOCATION}/bin \ RUN cd ${INSTALL_LOCATION}/bin \ && arch="$(./machinetype)" \ && if [ "$arch" = "x86_64" ] || [ "$arch" = "aarch64" ]; then \ - mv osversion osversion.hold \ - && echo "#!/bin/sh" > osversion \ - && echo "echo wsl1" >> osversion \ - && chmod ugo+x osversion \ + && export LDEARCH="${arch}-microsoft-wsl1" \ && ./makeright x cleanup \ && ./makeright x \ + && ./makeright init clean \ && ./makeright init \ - && mv osversion.hold osversion \ - && chmod ugo+x osversion \ ; \ fi diff --git a/bin/osversion b/bin/osversion index b51d919..c002796 100755 --- a/bin/osversion +++ b/bin/osversion @@ -15,6 +15,7 @@ case "$os" in *-*-freebsd*) echo freebsd ;; *-*-cygwin*) echo cygwin ;; *-*-haiku*) echo haiku ;; + *-microsoft-wsl1) echo wsl1 ;; esac ### Don't leave the variable set. unset os From 8e17c0747db3868f353dd9a35bf1a599e1333e3a Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Sun, 15 Jun 2025 23:32:27 -0700 Subject: [PATCH 10/11] Fix typo in Dockerfile_maiko --- .github/workflows/Dockerfile_maiko | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index 4b209ca..8b5dd94 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -26,7 +26,7 @@ RUN cd ${INSTALL_LOCATION}/bin \ RUN cd ${INSTALL_LOCATION}/bin \ && arch="$(./machinetype)" \ && if [ "$arch" = "x86_64" ] || [ "$arch" = "aarch64" ]; then \ - && export LDEARCH="${arch}-microsoft-wsl1" \ + export LDEARCH="${arch}-microsoft-wsl1" \ && ./makeright x cleanup \ && ./makeright x \ && ./makeright init clean \ From 6f42b353b2216307b8f69ce575839a76492ac23b Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Mon, 16 Jun 2025 00:00:54 -0700 Subject: [PATCH 11/11] In Dockerfile_maiko, for wsl1 case called makeright XX clean twice. Eliminated second call, which was deleting first run of makefile x --- .github/workflows/Dockerfile_maiko | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index 8b5dd94..ca8bf71 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -29,7 +29,6 @@ RUN cd ${INSTALL_LOCATION}/bin \ export LDEARCH="${arch}-microsoft-wsl1" \ && ./makeright x cleanup \ && ./makeright x \ - && ./makeright init clean \ && ./makeright init \ ; \ fi