mirror of
https://github.com/Interlisp/maiko.git
synced 2026-03-17 15:24:44 +00:00
Compare commits
75 Commits
maiko-2306
...
fgh_emscri
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
163d5db50f | ||
|
|
a1dff20adb | ||
|
|
5f69aa4242 | ||
|
|
7564790bfe | ||
|
|
258f70a82b | ||
|
|
fa17cddf68 | ||
|
|
6793137280 | ||
|
|
895f765105 | ||
|
|
610b7f42bb | ||
|
|
461b6a901c | ||
|
|
9f02ce0590 | ||
|
|
ce20accae3 | ||
|
|
ce7deadad3 | ||
|
|
0b0c82ce18 | ||
|
|
3ae25f81f8 | ||
|
|
52a3512379 | ||
|
|
df6dd883a6 | ||
|
|
3d341e3bbd | ||
|
|
ebe4babbe1 | ||
|
|
587ce1983a | ||
|
|
b841a44427 | ||
|
|
efd200dbf7 | ||
|
|
640f69877f | ||
|
|
400f3b7835 | ||
|
|
e657b2e1dc | ||
|
|
75c815f585 | ||
|
|
696ac9a675 | ||
|
|
8c54c0fbe0 | ||
|
|
586a3206c2 | ||
|
|
e93e3c895e | ||
|
|
29fdf4c40b | ||
|
|
7bb2393637 | ||
|
|
7c1d2081c8 | ||
|
|
acffcb74aa | ||
|
|
ad71e1e830 | ||
|
|
4b0032e1b6 | ||
|
|
b21fbcbcb1 | ||
|
|
0cc8e4d71c | ||
|
|
bee6a2f33e | ||
|
|
f208fd3302 | ||
|
|
e82b47a9e7 | ||
|
|
b666b1b2de | ||
|
|
d933ba88b7 | ||
|
|
56e7591ada | ||
|
|
28d7d5ec00 | ||
|
|
1e0264416f | ||
|
|
15966ccf34 | ||
|
|
09fae0a3f5 | ||
|
|
2caa2269a9 | ||
|
|
7b2cf44c7c | ||
|
|
79a788279b | ||
|
|
42477318b5 | ||
|
|
6cea8c69b0 | ||
|
|
eb3b382ac6 | ||
|
|
c9b4164d89 | ||
|
|
562f4c30ee | ||
|
|
98569d10b4 | ||
|
|
3207df6e24 | ||
|
|
7fce08f92c | ||
|
|
2c55f7923c | ||
|
|
b441a28c34 | ||
|
|
09e73d4153 | ||
|
|
8e43a393bd | ||
|
|
4a9f5500c4 | ||
|
|
44a4a4c42c | ||
|
|
2b24184293 | ||
|
|
c4f8ccc928 | ||
|
|
0ab92f5e65 | ||
|
|
501fb8e87a | ||
|
|
da7025ff02 | ||
|
|
b6328a234d | ||
|
|
74d6728fba | ||
|
|
59f2f2e835 | ||
|
|
8563c8700d | ||
|
|
aa019bdce2 |
18
.github/workflows/Dockerfile_builder
vendored
Executable file
18
.github/workflows/Dockerfile_builder
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
#*******************************************************************************
|
||||
#
|
||||
# Dockerfile to build image with all the tools to build Maiko
|
||||
#
|
||||
# Copyright 2023 by Interlisp.org
|
||||
#
|
||||
# Frank Halasz 2023-02-21
|
||||
#
|
||||
# ******************************************************************************
|
||||
|
||||
FROM ubuntu:latest
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
USER root:root
|
||||
# Install build tools
|
||||
RUN apt-get update && apt-get install -y make clang libx11-dev gcc
|
||||
USER root
|
||||
WORKDIR /root
|
||||
ENTRYPOINT /bin/bash
|
||||
25
.github/workflows/Dockerfile_maiko
vendored
Executable file
25
.github/workflows/Dockerfile_maiko
vendored
Executable file
@@ -0,0 +1,25 @@
|
||||
#*******************************************************************************
|
||||
#
|
||||
# Dockerfile to build Maiko for Linux to be used by buildRelease github action
|
||||
# The output of this is intended to be a directory in the github workspace
|
||||
# file system it is not intended to be a useable Docker image.
|
||||
#
|
||||
# Copyright 2023 by Interlisp.org
|
||||
#
|
||||
# Frank Halasz 2023-02-21
|
||||
#
|
||||
# ******************************************************************************
|
||||
|
||||
FROM ghcr.io/interlisp/maiko-builder
|
||||
ARG INSTALL_LOCATION=/usr/local/interlisp/maiko
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
# Copy over / clean maiko repo
|
||||
COPY . ${INSTALL_LOCATION}
|
||||
# Build maiko
|
||||
RUN cd ${INSTALL_LOCATION}/bin \
|
||||
&& ./makeright x cleanup \
|
||||
&& ./makeright x
|
||||
RUN cd ${INSTALL_LOCATION}/bin \
|
||||
&& if [ "$(./machinetype)" = "x86_64" ]; then \
|
||||
./makeright init; \
|
||||
fi
|
||||
18
.github/workflows/buildBuilderImage.yml
vendored
18
.github/workflows/buildBuilderImage.yml
vendored
@@ -32,15 +32,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Checkout just the relevant Dockerfile
|
||||
- name: Checkout files
|
||||
uses: Bhacaz/checkout-files@v2
|
||||
with:
|
||||
files: .github/workflows/Dockerfile_builder
|
||||
|
||||
# Checkout the branch of maiko code
|
||||
#- name: Checkout
|
||||
# uses: actions/checkout@v3
|
||||
# Checkout maiko
|
||||
- name: Checkout maiko
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Setup docker environment variables
|
||||
- name: Setup Docker Environment Variables
|
||||
@@ -49,7 +43,7 @@ jobs:
|
||||
DOCKER_REGISTRY="ghcr.io"
|
||||
DOCKER_NAMESPACE=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
|
||||
DOCKER_REPO=${DOCKER_REGISTRY}/${DOCKER_NAMESPACE}/maiko-builder
|
||||
DOCKER_TAGS="${DOCKER_REPO}:latest
|
||||
DOCKER_TAGS="${DOCKER_REPO}:latest"
|
||||
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_ENV}
|
||||
echo "DOCKER_TAGS=${DOCKER_TAGS}" >> ${GITHUB_ENV}
|
||||
|
||||
@@ -66,7 +60,7 @@ jobs:
|
||||
|
||||
# Login to ghcr.io
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -89,5 +83,5 @@ jobs:
|
||||
push: true
|
||||
tags: ${{ env.DOCKER_TAGS }}
|
||||
|
||||
|
||||
|
||||
######################################################################################
|
||||
|
||||
@@ -1,30 +1,27 @@
|
||||
#*******************************************************************************
|
||||
# buidReleaseInclDocker.yml
|
||||
# buidRelease.yml
|
||||
#
|
||||
# Workflow to build a Maiko release that is pushed to github as well as
|
||||
# Docker images incorporating the release, which are pushed to Docker Hub.
|
||||
# For linux: release assets are built/pushed for X86_64, aarch64 and arm7vl and
|
||||
# a multiplatform Docker image is pushed.
|
||||
# For macOS: release assets are built/pushed for X86_64. (No aarch64 as yet.)
|
||||
# Workflow to build a Maiko release that is pushed to github.
|
||||
# For linux: release assets are built/pushed for X86_64, aarch64 and arm7vl.
|
||||
# For macOS: release assets are built/pushed for X86_64 and aarch64 as well as
|
||||
# a set of universal binaries.
|
||||
# For Windows: not supported
|
||||
#
|
||||
# Note release pushed to github automatically includes source code assets
|
||||
# in tar and zip formats.
|
||||
#
|
||||
# 2022-01-16 by Frank Halasz based on earlier workflow called buildDocker.yml
|
||||
# Updated 2023-06-06: Remove docker image push; increase build efficeincy for linux
|
||||
#
|
||||
# Copyright 2022 by Interlisp.org
|
||||
# Copyright 2022-2023 by Interlisp.org
|
||||
#
|
||||
#
|
||||
# ******************************************************************************
|
||||
|
||||
name: 'Build/Push Release & Docker Image'
|
||||
|
||||
env:
|
||||
workflow: 'buildReleaseInclDocker.yml'
|
||||
name: 'Build/Push Release'
|
||||
|
||||
# Run this workflow on ...
|
||||
on:
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
draft:
|
||||
@@ -66,14 +63,18 @@ defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
# 2 separate jobs here that can run in parallel
|
||||
# 3 separate jobs here that can run in parallel
|
||||
#
|
||||
# 1. Linux: Build/push a multiplatform Linux Docker image and use results to
|
||||
# build/push Linux release assets.
|
||||
# 1. Linux: Build a multiplatform Linux Docker file system (not saved) and use
|
||||
# results to build/push Linux release assets.
|
||||
#
|
||||
# 2. MacOs: Build maiko for MacOS (x86_64, aarch64, and universal) then create
|
||||
# 2. MacOs: Build maiko for MacOS (x86_64, aarch64, and universal) then create
|
||||
# and push release assets.
|
||||
#
|
||||
# 3. Windows: Build maiko for cygwin and SDL (x86_64). Build is done within the
|
||||
# cygwin-maiko-builder Docker image by building a new docker files system (and
|
||||
# not a docker container) which is used to build/push Windows(cygwin) assets.
|
||||
#
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -87,6 +88,9 @@ jobs:
|
||||
outputs:
|
||||
draft: ${{ steps.one.outputs.draft }}
|
||||
force: ${{ steps.one.outputs.force }}
|
||||
linux: ${{ steps.one.outputs.linux }}
|
||||
macos: ${{ steps.one.outputs.macos }}
|
||||
windows: ${{ steps.one.outputs.windows }}
|
||||
steps:
|
||||
- id: one
|
||||
run: >
|
||||
@@ -99,8 +103,10 @@ jobs:
|
||||
echo "workflow_call";
|
||||
echo "draft=${{ inputs.draft }}" >> $GITHUB_OUTPUT;
|
||||
echo "force=${{ inputs.force }}" >> $GITHUB_OUTPUT;
|
||||
fi
|
||||
|
||||
fi;
|
||||
echo "linux=true" >> $GITHUB_OUTPUT;
|
||||
echo "macos=true" >> $GITHUB_OUTPUT;
|
||||
echo "windows=true" >> $GITHUB_OUTPUT;
|
||||
|
||||
|
||||
######################################################################################
|
||||
@@ -114,17 +120,17 @@ jobs:
|
||||
outputs:
|
||||
release_not_built: ${{ steps.check.outputs.release_not_built }}
|
||||
|
||||
steps:
|
||||
steps:
|
||||
# Checkout the actions for this repo owner
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/.github
|
||||
path: ./Actions_${{ github.sha }}
|
||||
- run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }}
|
||||
|
||||
# Check if build already run for this commit
|
||||
- name: Build already completed?
|
||||
- name: Build already completed?
|
||||
id: check
|
||||
continue-on-error: true
|
||||
uses: ./../actions/check-sentry-action
|
||||
@@ -137,26 +143,29 @@ jobs:
|
||||
# Use docker images to create and push release assets to github
|
||||
|
||||
linux:
|
||||
|
||||
|
||||
needs: [inputs, sentry]
|
||||
if: |
|
||||
needs.sentry.outputs.release_not_built == 'true'
|
||||
|| needs.inputs.outputs.force == 'true'
|
||||
|
||||
needs.inputs.outputs.linux == 'true'
|
||||
&& (
|
||||
needs.sentry.outputs.release_not_built == 'true'
|
||||
|| needs.inputs.outputs.force == 'true'
|
||||
)
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Checkout the actions for this repo owner
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/.github
|
||||
path: ./Actions_${{ github.sha }}
|
||||
- run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }}
|
||||
|
||||
# Checkout the branch
|
||||
# Checkout the branch
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Setup release tag
|
||||
- name: Setup Release Tag
|
||||
@@ -174,33 +183,27 @@ jobs:
|
||||
echo "build_time=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
echo "docker_tags=${DOCKER_TAGS}" >> $GITHUB_OUTPUT
|
||||
|
||||
# Setup the Docker Machine Emulation environment.
|
||||
# Setup the Docker Machine Emulation environment.
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@master
|
||||
uses: docker/setup-qemu-action@v2
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
|
||||
# Setup the Docker Buildx funtion
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@master
|
||||
|
||||
# Login into DockerHub - required to store the created image
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
# Do the Docker Build using the Dockerfile in the repository we
|
||||
# checked out. Push the result to Docker Hub.
|
||||
# checked out. Save the results in a directory under /tmp to be used
|
||||
# for creating release tars. Does not creatre a docker image and does not
|
||||
# push anything to Docker Hub.
|
||||
#
|
||||
# NOTE: THE ACTUAL MAIKO BUILD (FOR LINUX) HAPPENS HERE - I.E., IN THE
|
||||
# DOCKER BUILD CALL. BUILD COMMANDS ARE SPECIFIED IN THE
|
||||
# Dockerfile, NOT HERE IN THE WORKFLOW.
|
||||
#
|
||||
- name: Build Docker Image for Push to Docker Hub
|
||||
if: ${{ true }}
|
||||
- name: Build Docker Image and Save It Locally
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
@@ -208,23 +211,7 @@ jobs:
|
||||
BUILD_DATE=${{ steps.docker_env.outputs.build_time }}
|
||||
RELEASE_TAG=${{ steps.tag.outputs.release_tag }}
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
# Push the result to DockerHub
|
||||
push: true
|
||||
tags: ${{ steps.docker_env.outputs.docker_tags }}
|
||||
|
||||
# Redo the Docker Build (hopefully mostly using the cache from the previous build).
|
||||
# But save the results in a directory under /tmp to be used for creating release tars.
|
||||
- name: Rebuild Docker Image For Saving Locally
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
build-args: |
|
||||
BUILD_DATE=${{ steps.docker_env.outputs.build_time }}
|
||||
RELEASE_TAG=${{ steps.tag.outputs.release_tag }}
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
file: ./.github/workflows/Dockerfile_maiko
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
# Put the results out to the local file system
|
||||
outputs: type=local,dest=/tmp/docker_images
|
||||
@@ -254,7 +241,7 @@ jobs:
|
||||
# Push Release to github
|
||||
- name: Push the release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts:
|
||||
/tmp/release_tars/${{ steps.tag.outputs.release_tag }}-linux.x86_64.tgz,
|
||||
@@ -273,20 +260,23 @@ jobs:
|
||||
|
||||
needs: [inputs, sentry]
|
||||
if: |
|
||||
needs.sentry.outputs.release_not_built == 'true'
|
||||
|| needs.inputs.outputs.force == 'true'
|
||||
needs.inputs.outputs.macos == 'true'
|
||||
&& (
|
||||
needs.sentry.outputs.release_not_built == 'true'
|
||||
|| needs.inputs.outputs.force == 'true'
|
||||
)
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
|
||||
# Checkout the branch
|
||||
# Checkout the branch
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Checkout the actions for this repo owner
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/.github
|
||||
path: ./Actions_${{ github.sha }}
|
||||
@@ -325,7 +315,7 @@ jobs:
|
||||
sudo ditto /Volumes/SDL2/SDL2.framework /Library/Frameworks/SDL2.framework
|
||||
hdiutil detach /Volumes/SDL2/
|
||||
|
||||
# Build maiko
|
||||
# Build maiko
|
||||
- name: Build ldeinit
|
||||
working-directory: ./bin
|
||||
run: |
|
||||
@@ -334,7 +324,7 @@ jobs:
|
||||
export LDEARCH=aarch64-apple-darwin
|
||||
./makeright init
|
||||
mkdir -p ../darwin.universal
|
||||
exe=ldeinit
|
||||
exe=ldeinit
|
||||
lipo -create \
|
||||
-arch arm64 ../darwin.aarch64/${exe} \
|
||||
-arch x86_64 ../darwin.x86_64/${exe} \
|
||||
@@ -356,7 +346,7 @@ jobs:
|
||||
lipo ${exe} -output ../darwin.x86_64/${exe} -extract x86_64
|
||||
lipo ${exe} -output ../darwin.aarch64/${exe} -extract arm64
|
||||
cp -p ${exe} ../darwin.universal/${exe}
|
||||
done
|
||||
done
|
||||
|
||||
# Create release tar for github.
|
||||
- name: Make release tar(s)
|
||||
@@ -379,7 +369,7 @@ jobs:
|
||||
# Push Release
|
||||
- name: Push the release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts:
|
||||
/tmp/release_tars/${{ steps.tag.outputs.release_tag }}-darwin.x86_64.tgz,
|
||||
@@ -389,6 +379,172 @@ jobs:
|
||||
draft: ${{ needs.inputs.outputs.draft }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
######################################################################################
|
||||
|
||||
# Windows: build for Windows-Cygwin via Docker build and use results to
|
||||
# create and push release assets to github
|
||||
|
||||
windows:
|
||||
|
||||
needs: [inputs, sentry]
|
||||
if: |
|
||||
needs.inputs.outputs.windows == 'true'
|
||||
&& (
|
||||
needs.sentry.outputs.release_not_built == 'true'
|
||||
|| needs.inputs.outputs.force == 'true'
|
||||
)
|
||||
|
||||
runs-on: windows-2022
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: powershell
|
||||
|
||||
steps:
|
||||
|
||||
# setup git to not mess up line endings
|
||||
- name: git config
|
||||
run: git config --global core.autocrlf input
|
||||
|
||||
# Retrieve Cygwin setup and install cygwin
|
||||
- name: Install cygwin
|
||||
id: cygwin
|
||||
run: |
|
||||
wget https://cygwin.com/setup-x86_64.exe -OutFile setup-x86_64.exe
|
||||
Unblock-File setup-x86_64.exe
|
||||
Start-Process setup-x86_64.exe -Wait -ArgumentList @("--root", ".\cygwin", "--quiet-mode", "--no-admin", "--wait", "--no-shortcuts", "--no-write-registry", "--verbose", "--site", "http://www.gtlib.gatech.edu/pub/cygwin/", "--packages", "nano,binutils,make,cmake,gcc,clang")
|
||||
cygwin\bin\bash -login -c 'sed -i -e "s/^none/#none/" /etc/fstab; echo "none / cygdrive binary,posix=0,user 0 0" >>/etc/fstab'
|
||||
|
||||
# Retrieve SDL2 and install in cygwin
|
||||
- name: Install SDL2
|
||||
id: sdl2
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release download 2.26.5 --repo interlisp/cygwin-sdl --pattern *.tgz --output .\cygwin\sdl2.tar.gz
|
||||
cygwin\bin\bash -login -c 'cd /; tar xzf sdl2.tar.gz'
|
||||
|
||||
# Checkout the branch
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: cygwin\maiko
|
||||
|
||||
# Checkout the actions for this repo owner
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/.github
|
||||
path: ./Actions_${{ github.sha }}
|
||||
- run: |
|
||||
mv ./Actions_${{ github.sha }}/actions ../actions
|
||||
rm -recurse -force ./Actions_${{ github.sha }}
|
||||
|
||||
# Setup release tag
|
||||
- name: Setup Release Tag
|
||||
id: tag
|
||||
uses: ./../actions/release-tag-action
|
||||
with:
|
||||
path: cygwin/maiko
|
||||
|
||||
# Build maiko TODO-cleanup
|
||||
- name: Build Cygwin-SDL Maiko
|
||||
run: |
|
||||
cygwin\bin\bash -login -c 'cd /maiko/bin && ./makeright sdl cleanup && ./makeright sdl'
|
||||
cygwin\bin\bash -login -c 'mkdir /tmp/maiko; mkdir /tmp/maiko/bin; mkdir /tmp/maiko/cygwin.x86_64'
|
||||
cygwin\bin\bash -login -c 'cp /maiko/bin/osversion /tmp/maiko/bin; cp /maiko/bin/machinetype /tmp/maiko/bin'
|
||||
cygwin\bin\bash -login -c 'cp /maiko/bin/config.guess /tmp/maiko/bin; cp /maiko/bin/config.sub /tmp/maiko/bin'
|
||||
cygwin\bin\bash -login -c 'cp /maiko/cygwin.x86_64/* /tmp/maiko/cygwin.x86_64; cp /usr/local/bin/SDL2.DLL /tmp/maiko/cygwin.x86_64'
|
||||
cygwin\bin\bash -login -c 'chmod +x /tmp/maiko/bin/*; chmod +x /tmp/maiko/cygwin.x86_64/*'
|
||||
cygwin\bin\bash -login -c 'echo lde > /tmp/maiko/cygwin.x86_64/lde.exe.local; echo ldesdl > /tmp/maiko/cygwin.x86_64/ldesdl.exe.local'
|
||||
cygwin\bin\bash -login -c 'mkdir -p /tmp/release_tars'
|
||||
cygwin\bin\bash -login -c 'tar -c -z -C /tmp -f /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-cygwin.x86_64.tgz maiko'
|
||||
|
||||
# Push Release to github
|
||||
- name: Push the release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts:
|
||||
cygwin/tmp/release_tars/${{ steps.tag.outputs.release_tag }}-cygwin.x86_64.tgz
|
||||
tag: ${{ steps.tag.outputs.release_tag }}
|
||||
draft: ${{ needs.inputs.outputs.draft }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
|
||||
######################################################################################
|
||||
|
||||
# Emscripten: build and push Maiko compiled for Emscripten (to run Maiko in browser)
|
||||
|
||||
emscripten:
|
||||
|
||||
needs: [inputs, sentry]
|
||||
if: |
|
||||
needs.inputs.outputs.linux == 'true'
|
||||
&& (
|
||||
needs.sentry.outputs.release_not_built == 'true'
|
||||
|| needs.inputs.outputs.force == 'true'
|
||||
)
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
# Checkout the actions for this repo owner
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/.github
|
||||
path: ./Actions_${{ github.sha }}
|
||||
- run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }}
|
||||
|
||||
# Install SDL2
|
||||
- name: Install SDL2
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
sudo -E apt-get install -y libsdl2-dev libsdl2-2.0-0
|
||||
|
||||
# Install Emscripten SDK
|
||||
- name: Install Empscripten
|
||||
working-directory: ../
|
||||
run: |
|
||||
git clone https://github.com/emscripten-core/emsdk.git
|
||||
cd emsdk
|
||||
./emsdk install latest
|
||||
./emsdk activate latest
|
||||
CWD="$(pwd)"
|
||||
echo "${CWD}" >> ${GITHUB_PATH}
|
||||
echo "${CWD}/upstream/emscripten" >> ${GITHUB_PATH}
|
||||
echo "${CWD}/upstream/emscripten/tools" >> ${GITHUB_PATH}
|
||||
echo "${CWD}/node/$(ls -d node/*64bit | tail -1)/bin" >> ${GITHUB_PATH}
|
||||
|
||||
# Checkout the maiko branch
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Setup release tag
|
||||
- name: Setup Release Tag
|
||||
id: tag
|
||||
uses: ./../actions/release-tag-action
|
||||
|
||||
# Compile maiko using Emscripten (no load build)
|
||||
- name: Compile Maiko using Emscripten
|
||||
working-directory: ./bin
|
||||
run: |
|
||||
./makeright wasm
|
||||
cd ../emscripten.wasm
|
||||
tar -c -z -f ../${{ steps.tag.outputs.release_tag }}-emscripten.tgz *
|
||||
|
||||
# Push Release to github
|
||||
- name: Push the release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts: ${{ steps.tag.outputs.release_tag }}-emscripten.tgz
|
||||
tag: ${{ steps.tag.outputs.release_tag }}
|
||||
draft: ${{ needs.inputs.outputs.draft }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
######################################################################################
|
||||
@@ -403,28 +559,27 @@ jobs:
|
||||
outputs:
|
||||
build_successful: ${{ steps.output.outputs.build_successful }}
|
||||
|
||||
needs: [inputs, sentry, linux, macos]
|
||||
needs: [inputs, sentry, linux, macos, windows, emscripten]
|
||||
|
||||
steps:
|
||||
steps:
|
||||
# Checkout the actions for this repo owner
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/.github
|
||||
path: ./Actions_${{ github.sha }}
|
||||
- run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }}
|
||||
|
||||
# Set sentry
|
||||
- name: Is build for this commit already completed?
|
||||
- name: Is build for this commit already completed?
|
||||
id: set
|
||||
uses: ./../actions/set-sentry-action
|
||||
with:
|
||||
tag: "release_docker"
|
||||
|
||||
|
||||
- name: Output
|
||||
id: output
|
||||
run: |
|
||||
echo "build_successful=true" >> $GITHUB_OUTPUT
|
||||
|
||||
|
||||
######################################################################################
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -19,12 +19,19 @@ cmake-build-*/**
|
||||
*.x86_64-x/**
|
||||
*.x86_64-sdl/**
|
||||
*.x86_64/**
|
||||
*.wasm/**
|
||||
*.wasm-wasm/**
|
||||
*.wasm_nl/**
|
||||
*.wasm_nl-wasm_nl/**
|
||||
*.armv7l-x/**
|
||||
*.armv7l/**
|
||||
*.aarch64-x/**
|
||||
*.aarch64-sdl/**
|
||||
*.aarch64/**
|
||||
init.386/**
|
||||
*.universal/**
|
||||
# core files
|
||||
core
|
||||
*.core
|
||||
*.swp
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ ENDIF()
|
||||
|
||||
find_program(
|
||||
CLANG_TIDY_EXE
|
||||
NAMES "clang-tidy" "clang-tidy13" "clang-tidy12" "clang-tidy11" "clang-tidy10"
|
||||
NAMES "clang-tidy" "clang-tidy16" "clang-tidy15" "clang-tidy14" "clang-tidy13" "clang-tidy12" "clang-tidy11" "clang-tidy10"
|
||||
DOC "Path to clang-tidy executable"
|
||||
)
|
||||
|
||||
@@ -41,6 +41,10 @@ SET(MAIKO_DEFINITIONS
|
||||
"-DRELEASE=351"
|
||||
)
|
||||
|
||||
SET(MAIKO_INIT_DEFINITIONS
|
||||
"-DRELEASE=351" "-DINIT" "-DNOVERSION"
|
||||
)
|
||||
|
||||
OPTION(MAIKO_DISPLAY_X11 "Use X11 for display." ON)
|
||||
OPTION(MAIKO_DISPLAY_SDL "Use SDL for display." OFF)
|
||||
|
||||
@@ -454,6 +458,18 @@ IF(MAIKO_DISPLAY_X11)
|
||||
TARGET_COMPILE_DEFINITIONS(ldex PUBLIC ${MAIKO_DEFINITIONS} ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(ldex PUBLIC inc)
|
||||
TARGET_LINK_LIBRARIES(ldex ${MAIKO_LIBRARIES} ${MAIKO_DISPLAY_X11_LIBRARIES})
|
||||
|
||||
ADD_EXECUTABLE(ldeinit
|
||||
src/main.c
|
||||
vdate.c
|
||||
${MAIKO_SRCS}
|
||||
${MAIKO_HDRS}
|
||||
${MAIKO_DISPLAY_X11_SRCS}
|
||||
${MAIKO_DISPLAY_X11_HDRS}
|
||||
)
|
||||
TARGET_COMPILE_DEFINITIONS(ldeinit PUBLIC ${MAIKO_INIT_DEFINITIONS} ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(ldeinit PUBLIC inc)
|
||||
TARGET_LINK_LIBRARIES(ldeinit ${MAIKO_LIBRARIES} ${MAIKO_DISPLAY_X11_LIBRARIES})
|
||||
ENDIF()
|
||||
|
||||
IF(MAIKO_DISPLAY_SDL)
|
||||
|
||||
55
Dockerfile
55
Dockerfile
@@ -1,55 +0,0 @@
|
||||
#*******************************************************************************
|
||||
#
|
||||
# Dockerfile to build Maiko (Stage 1) and create a Docker image and push it
|
||||
# to DockerHub (stage 2).
|
||||
#
|
||||
# Copyright 2022 by Interlisp.org
|
||||
#
|
||||
# ******************************************************************************
|
||||
|
||||
#
|
||||
# Build Maiko Stage
|
||||
#
|
||||
FROM ubuntu:focal AS builder
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
USER root:root
|
||||
# Install build tools
|
||||
RUN apt-get update && apt-get install -y make clang libx11-dev gcc x11vnc xvfb
|
||||
# Copy over / clean maiko repo
|
||||
COPY . /app/maiko
|
||||
RUN rm -rf /app/maiko/linux*
|
||||
# Build maiko
|
||||
WORKDIR /app/maiko/bin
|
||||
RUN ./makeright x
|
||||
RUN if [ "$(./osversion)" = "linux" ] && [ "$(./machinetype)" = "x86_64" ]; then ./makeright init; fi
|
||||
# Prep for Install Stage
|
||||
RUN mv ../$(./osversion).$(./machinetype) ../TRANSFER
|
||||
#
|
||||
# Install Maiko Stage
|
||||
#
|
||||
FROM ubuntu:focal
|
||||
ARG BUILD_DATE="not_available"
|
||||
ARG RELEASE_TAG="not_available"
|
||||
LABEL name="Maiko"
|
||||
LABEL description="Virtual machine for Interlisp Medley"
|
||||
LABEL url="https://github.com/Interlisp/maiko"
|
||||
LABEL build-time=$BUILD_DATE
|
||||
LABEL release_tag=$RELEASE_TAG
|
||||
ENV MAIKO_RELEASE=$RELEASE_TAG
|
||||
ENV MAIKO_BUILD_DATE=$BUILD_DATE
|
||||
ARG BUILD_LOCATION=/app/maiko
|
||||
ARG INSTALL_LOCATION=/usr/local/interlisp/maiko
|
||||
#
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
USER root:root
|
||||
# Copy release files into /usr/local/directories
|
||||
COPY --from=builder ${BUILD_LOCATION}/bin/osversion ${INSTALL_LOCATION}/bin/
|
||||
COPY --from=builder ${BUILD_LOCATION}/bin/machinetype ${INSTALL_LOCATION}/bin/
|
||||
COPY --from=builder ${BUILD_LOCATION}/bin/config.guess ${INSTALL_LOCATION}/bin/
|
||||
COPY --from=builder ${BUILD_LOCATION}/bin/config.sub ${INSTALL_LOCATION}/bin/
|
||||
COPY --from=builder ${BUILD_LOCATION}/TRANSFER/lde* ${INSTALL_LOCATION}/TRANSFER/
|
||||
RUN cd ${INSTALL_LOCATION} && mv TRANSFER "$(cd bin && ./osversion).$(cd bin/ && ./machinetype)"
|
||||
# Some niceties
|
||||
USER root
|
||||
WORKDIR /root
|
||||
ENTRYPOINT /bin/bash
|
||||
@@ -4,7 +4,7 @@ Maiko is the implementation of the Medley Interlisp virtual machine, for a
|
||||
byte-coded Lisp instruction set and some low-level functions for
|
||||
connecting with Lisp for access to display (via X11) and disk etc.
|
||||
|
||||
For an overview, see [Medley Interlisp Introduction](https://github.com/Interlisp/medley/wiki/Medley-Interlisp-Introduction).
|
||||
For an overview, see [Medley Interlisp Introduction](https://interlisp.org/medley/using/docs/medley/).
|
||||
|
||||
See [the Medley repository](https://github.com/Interlisp/medley) for
|
||||
* [Issues](https://github.com/Interlisp/medley/issues) (note that maiko issues are there too)
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
# #
|
||||
#########################################################################
|
||||
|
||||
os=${LDEARCH:-`./config.guess`}
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
os=${LDEARCH:-`$SCRIPTPATH/config.guess`}
|
||||
# o/s switch block
|
||||
case "$os" in
|
||||
m68k-*) echo m68k ;;
|
||||
|
||||
20
bin/makefile-cygwin.x86_64-sdl
Normal file
20
bin/makefile-cygwin.x86_64-sdl
Normal file
@@ -0,0 +1,20 @@
|
||||
# Options for Linux, Intel x86_64 and X-Window
|
||||
|
||||
CC = gcc -m64 $(GCC_CFLAGS) -I/usr/local/include
|
||||
#CC = clang -m64 $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
XFLAGS = -DSDL
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
|
||||
LDFLAGS = -lm -L/usr/local/lib -lSDL2
|
||||
#
|
||||
LDELDFLAGS =
|
||||
|
||||
OBJECTDIR = ../$(RELEASENAME)/
|
||||
|
||||
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl
|
||||
22
bin/makefile-emscripten.wasm-wasm
Normal file
22
bin/makefile-emscripten.wasm-wasm
Normal file
@@ -0,0 +1,22 @@
|
||||
# Options for Emscripten, WASM and SDL
|
||||
|
||||
CC = emcc $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
XFLAGS = -DSDL -sUSE_SDL=2
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351 -DMAIKO_OS_EMSCRIPTEN -DMAIKO_ENABLE_NETHUB
|
||||
|
||||
# LD not really used - but keeping it here just in case
|
||||
LD = emcc
|
||||
LDFLAGS = -sUSE_SDL=2 -sASYNCIFY -sALLOW_MEMORY_GROWTH -sEXIT_RUNTIME=1 -sFORCE_FILESYSTEM -sLZ4
|
||||
UPFRONT_LDFLAGS = -lidbfs.js
|
||||
|
||||
LDELDFLAGS =
|
||||
|
||||
OBJECTDIR = ../$(RELEASENAME)/
|
||||
|
||||
default : ../$(OSARCHNAME)/ldesdl.js
|
||||
29
bin/makefile-init-linux.aarch64
Normal file
29
bin/makefile-init-linux.aarch64
Normal file
@@ -0,0 +1,29 @@
|
||||
# Options for Linux, 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=351 -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
|
||||
OBJECTDIR = ../$(RELEASENAME)/
|
||||
|
||||
default : ../$(OSARCHNAME)/ldeinit
|
||||
@@ -1,7 +1,7 @@
|
||||
# Options for Linux, x86 processor, X windows, for INIT processing
|
||||
|
||||
#CC = gcc -m64 $(GCC_CFLAGS)
|
||||
CC = clang -m64 $(CLANG_CFLAGS)
|
||||
CC = gcc $(GCC_CFLAGS)
|
||||
#CC = clang $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)xmkicon.o \
|
||||
$(OBJECTDIR)xbbt.o \
|
||||
|
||||
27
bin/makefile-init-openbsd.x86_64
Normal file
27
bin/makefile-init-openbsd.x86_64
Normal file
@@ -0,0 +1,27 @@
|
||||
# Options for OpenBSD, Intel x86_64 and X-Window
|
||||
|
||||
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 = -I/usr/X11R6/include -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/usr/X11R6/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11R6/lib -lX11 -lc -lm
|
||||
|
||||
OBJECTDIR = ../$(RELEASENAME)/
|
||||
|
||||
default : ../$(OSARCHNAME)/ldeinit
|
||||
@@ -1,4 +1,4 @@
|
||||
# Options for Linux, ARMv7 and X-Window
|
||||
# Options for Linux, aarch64 and X-Window
|
||||
|
||||
CC = gcc $(GCC_CFLAGS)
|
||||
#CC = clang $(CLANG_CFLAGS)
|
||||
|
||||
@@ -148,7 +148,7 @@ $(OSARCHDIR)lde: $(OBJECTDIR)ldeboot.o $(OBJECTDIR)unixfork.o
|
||||
$(CC) $(OBJECTDIR)ldeboot.o $(OBJECTDIR)unixfork.o $(LDELDFLAGS) -o $(OSARCHDIR)lde
|
||||
|
||||
$(OSARCHDIR)$(LDENAME): $(LIBFILES) $(EXTFILES) $(OBJECTDIR)vdate.o
|
||||
$(CC) $(LIBFILES) $(EXTFILES) $(OBJECTDIR)vdate.o $(LDFLAGS) -o $(OSARCHDIR)$(LDENAME)
|
||||
$(CC) $(UPFRONT_LDFLAGS) $(LIBFILES) $(EXTFILES) $(OBJECTDIR)vdate.o $(LDFLAGS) -o $(OSARCHDIR)$(LDENAME)
|
||||
@ echo ""
|
||||
@ echo "Executable is now named '$(OSARCHDIR)$(LDENAME)'"
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
# Nov 20 2001 JDS: Convert to use BASH, not CSH, for open-source...
|
||||
#
|
||||
# usage: makeright [display-option] [other-option]
|
||||
#
|
||||
#
|
||||
# example: makeright single ; make lde for mmaped displayFB
|
||||
# makeright multi ; make lde for cg3,cg6
|
||||
# makeright x ; make lde for X-windows
|
||||
@@ -74,6 +74,11 @@ case "$display" in
|
||||
sdl) releasename=${osversion}.${architecture}-${display}
|
||||
ldename=ldesdl
|
||||
;;
|
||||
wasm) osversion=emscripten
|
||||
architecture=wasm
|
||||
releasename=${osversion}.${architecture}-${display}
|
||||
ldename=ldesdl.js
|
||||
;;
|
||||
*) echo "display-option: $display is not supported."
|
||||
exit
|
||||
;;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
os=${LDEARCH:-`./config.guess`}
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
os=${LDEARCH:-`$SCRIPTPATH/config.guess`}
|
||||
case "$os" in
|
||||
m68k-*-amigaos) echo amigaos ;;
|
||||
sparc-sun-sunos*) echo sunos4 ;;
|
||||
|
||||
@@ -40,7 +40,7 @@ extern int flushing;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DBPRINT(X) do {printf X ; if (flushing) fflush(stdout); } while(0)
|
||||
#define DBPRINT(X) do { printf("%s:%d ", __FILE__, __LINE__); printf X ; if (flushing) fflush(stdout); } while(0)
|
||||
#define DEBUGGER(X) X
|
||||
#else
|
||||
#define DBPRINT(X) if (0) do {printf X ; } while(0)
|
||||
@@ -51,7 +51,7 @@ extern int flushing;
|
||||
/* For trace print statements */
|
||||
|
||||
#ifdef TRACE
|
||||
#define TPRINT(X) do { printf X; if (flushing) fflush(stdout); } while (0)
|
||||
#define TPRINT(X) do { printf("%s:%d ", __FILE__, __LINE__); printf X; if (flushing) fflush(stdout); } while (0)
|
||||
#define TRACER(X) X
|
||||
#else /* TRACE */
|
||||
|
||||
@@ -64,7 +64,7 @@ extern int flushing;
|
||||
/* For tracing individual opcode executions */
|
||||
|
||||
#ifdef OPTRACE
|
||||
#define OPTPRINT(X) do { printf X; if (flushing) fflush(stdout); } while (0)
|
||||
#define OPTPRINT(X) do { printf("%s:%d ", __FILE__, __LINE__); printf X; if (flushing) fflush(stdout); } while (0)
|
||||
#define OPTRACER(X) X
|
||||
#else
|
||||
#define OPTPRINT(X) if (0) do { printf X; } while (0)
|
||||
@@ -75,7 +75,7 @@ extern int flushing;
|
||||
/* For tracing function calls */
|
||||
|
||||
#ifdef FNTRACE
|
||||
#define FNTPRINT(X) do { printf X; if (flushing) fflush(stdout); } while (0)
|
||||
#define FNTPRINT(X) do { printf("%s:%d ", __FILE__, __LINE__); printf X; if (flushing) fflush(stdout); } while (0)
|
||||
#define FNTRACER(X) X
|
||||
#else
|
||||
#define FNTPRINT(X) if (0) do { printf X; } while (0)
|
||||
@@ -86,7 +86,7 @@ extern int flushing;
|
||||
/* For function-call & return stack checking */
|
||||
|
||||
#ifdef FNSTKCHECK
|
||||
#define FNCHKPRINT(X) do { printf X ; if (flushing) fflush(stdout); } while (0)
|
||||
#define FNCHKPRINT(X) do { printf("%s:%d ", __FILE__, __LINE__); printf X ; if (flushing) fflush(stdout); } while (0)
|
||||
#define FNCHECKER(X) X
|
||||
#else
|
||||
#define FNCHKPRINT(X) if (0) do { printf X; } while (0)
|
||||
|
||||
@@ -194,8 +194,9 @@ do { \
|
||||
#endif /* min */
|
||||
|
||||
#define LispNumToCInt(Lisp) \
|
||||
( (((Lisp) & SEGMASK) == S_POSITIVE) ? \
|
||||
((Lisp) & 0xFFFF) : (*((int *)(NativeAligned4FromLAddr(Lisp)))) )
|
||||
( (((Lisp) & SEGMASK) == S_POSITIVE) ? ((Lisp) & 0xFFFF) : \
|
||||
(((Lisp) & SEGMASK) == S_NEGATIVE) ? ((Lisp) | 0xFFFF0000) : \
|
||||
(*((int *)(NativeAligned4FromLAddr(Lisp)))) )
|
||||
|
||||
#define UPLOWDIFF 0x20
|
||||
|
||||
|
||||
@@ -83,6 +83,19 @@
|
||||
# define MAIKO_OS_DETECTED 1
|
||||
#endif
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
# define MAIKO_OS_LINUX 1
|
||||
# define MAIKO_OS_EMSCRIPTEN 1
|
||||
# define MAIKO_OS_NAME "Emscripten"
|
||||
# define MAIKO_EMULATE_TIMER_INTERRUPTS 1
|
||||
# define MAIKO_EMULATE_ASYNC_INTERRUPTS 1
|
||||
# define MAIKO_OS_UNIX_LIKE 1
|
||||
# define MAIKO_OS_DETECTED
|
||||
# define MAIKO_ARCH_NAME "WebAssembly"
|
||||
# define MAIKO_ARCH_WORD_BITS 32
|
||||
# define MAIKO_ARCH_DETECTED 1
|
||||
#endif
|
||||
|
||||
/* __x86_64__: GNU C, __x86_64: Sun Studio, _M_AMD64: Visual Studio */
|
||||
#if defined(__x86_64__) || defined(__x86_64) || defined(_M_AMD64)
|
||||
# define MAIKO_ARCH_X86_64 1
|
||||
|
||||
@@ -1799,7 +1799,7 @@ void tedit_bltchar(LispPTR *args)
|
||||
|
||||
} /* end tedit_bltchar */
|
||||
|
||||
#if defined(REALCURSOR) || defined(SUNDISPLAY)
|
||||
#if defined(REALCURSOR)
|
||||
#ifndef COLOR
|
||||
/* Lisp addr hi-word, lo-word, ... */
|
||||
static int old_cursorin(DLword addrhi, DLword addrlo, int x, int w, int h, int y, int backward)
|
||||
@@ -1866,4 +1866,4 @@ static int old_cursorin(DLword addrhi, DLword addrlo, int x, int w, int h, int y
|
||||
} /* COLOR case end */
|
||||
}
|
||||
#endif /* COLOR */
|
||||
#endif /* defined(REALCURSOR) || defined(SUNDISPLAY) */
|
||||
#endif /* defined(REALCURSOR) */
|
||||
|
||||
@@ -2150,7 +2150,8 @@ LispPTR COM_next_file(LispPTR *args)
|
||||
propp = gfsp->propp;
|
||||
|
||||
dfp = &FinfoArray[finfoid];
|
||||
if (dfp->head == (FINFO *)0 || (fp = dfp->next) == (FINFO *)0) return (SMALLP_MINUSONE);
|
||||
fp = dfp->next;
|
||||
if (dfp->head == NULL || fp == NULL) return (SMALLP_MINUSONE);
|
||||
dfp->next = fp->next;
|
||||
|
||||
laddr = gfsp->name;
|
||||
|
||||
@@ -97,6 +97,18 @@ struct buf {
|
||||
};
|
||||
#endif /* BIGVM */
|
||||
#else
|
||||
#ifdef BIGVM
|
||||
struct buf {
|
||||
LispPTR filepage;
|
||||
LispPTR vmempage;
|
||||
LispPTR buffernext;
|
||||
unsigned sysnext : 28;
|
||||
unsigned unused : 1;
|
||||
unsigned iodirty : 1;
|
||||
unsigned usermapped : 1;
|
||||
unsigned noreference : 1;
|
||||
};
|
||||
#else
|
||||
struct buf {
|
||||
LispPTR filepage;
|
||||
LispPTR vmempage;
|
||||
@@ -107,6 +119,7 @@ struct buf {
|
||||
unsigned usermapped : 1;
|
||||
unsigned noreference : 1;
|
||||
};
|
||||
#endif /* BIGVM */
|
||||
#endif /* BYTESWAP */
|
||||
|
||||
/************* The following procedure is common !! **************************/
|
||||
@@ -192,8 +205,6 @@ LispPTR checkarrayblock(LispPTR base, LispPTR free, LispPTR onfreelist) {
|
||||
{
|
||||
bbase = (struct arrayblock *)NativeAligned4FromLAddr(base);
|
||||
btrailer = (struct arrayblock *)NativeAligned4FromLAddr(Trailer(base, bbase));
|
||||
bfwd = (struct arrayblock *)NativeAligned4FromLAddr(bbase->fwd);
|
||||
bbwd = (struct arrayblock *)NativeAligned4FromLAddr(bbase->bkwd);
|
||||
if (bbase->password != ARRAYBLOCKPASSWORD) {
|
||||
printarrayblock(base);
|
||||
error("ARRAYBLOCK password wrong\n");
|
||||
@@ -213,9 +224,11 @@ LispPTR checkarrayblock(LispPTR base, LispPTR free, LispPTR onfreelist) {
|
||||
printarrayblock(base);
|
||||
error("ARRAYBLOCK Trailer INUSE bit set wrong\n");
|
||||
} else if (!onfreelist || (bbase->arlen < MINARRAYBLOCKSIZE))
|
||||
/* Remaining tests only for free list. */
|
||||
return (NIL);
|
||||
else if ((bbwd->fwd != base) || (bfwd->bkwd != base)) {
|
||||
/* Remaining tests only for free list. */
|
||||
bfwd = (struct arrayblock *)NativeAligned4FromLAddr(bbase->fwd);
|
||||
bbwd = (struct arrayblock *)NativeAligned4FromLAddr(bbase->bkwd);
|
||||
if ((bbwd->fwd != base) || (bfwd->bkwd != base)) {
|
||||
error("ARRAYBLOCK links fouled\n");
|
||||
} else {
|
||||
fbl = FreeBlockChainN(bbase->arlen);
|
||||
@@ -337,7 +350,6 @@ LispPTR makefreearrayblock(LispPTR block, DLword length) {
|
||||
/* */
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
LispPTR arrayblockmerger(LispPTR base, LispPTR nbase) {
|
||||
DLword arlens, narlens, secondbite, minblocksize, shaveback;
|
||||
struct arrayblock *bbase, *bnbase;
|
||||
@@ -346,12 +358,23 @@ LispPTR arrayblockmerger(LispPTR base, LispPTR nbase) {
|
||||
arlens = bbase->arlen;
|
||||
narlens = bnbase->arlen;
|
||||
secondbite = MAXARRAYBLOCKSIZE - arlens;
|
||||
if (narlens > secondbite) {
|
||||
/* There are three cases for merging the blocks
|
||||
* (1) the total size of the two blocks is less than max:
|
||||
* merge into a single block
|
||||
* (2) creating a max size block leaves a viable leftover block:
|
||||
* move the boundary to make a max block and a leftover block
|
||||
* (3) creating a max size block leaves a non-viable leftover block
|
||||
* move the boundary to make a big block and a minimum size leftover block
|
||||
*/
|
||||
if (base + (2 * arlens) != nbase) {
|
||||
error("Attempt to merge non-adjacent blocks in array space\n");
|
||||
}
|
||||
if (narlens > secondbite) { /* (2) or (3) */
|
||||
arlens = MAXARRAYBLOCKSIZE;
|
||||
narlens = narlens - secondbite;
|
||||
minblocksize =
|
||||
((*Hunk_word == ATOM_T) ? (ARRAYBLOCKOVERHEADCELLS + MAXCELLSPERHUNK) : MINARRAYBLOCKSIZE);
|
||||
if (narlens < minblocksize) {
|
||||
if (narlens < minblocksize) { /* (3) */
|
||||
shaveback = narlens - minblocksize;
|
||||
narlens = minblocksize;
|
||||
arlens += shaveback;
|
||||
@@ -375,10 +398,10 @@ LispPTR mergebackward(LispPTR base) {
|
||||
LispPTR pbase;
|
||||
struct arrayblock *ptrailer;
|
||||
|
||||
ptrailer = (struct arrayblock *)NativeAligned4FromLAddr(base - ARRAYBLOCKTRAILERWORDS);
|
||||
if (base == NIL)
|
||||
return (NIL);
|
||||
else if ((*ArrayMerging_word == NIL) ||
|
||||
ptrailer = (struct arrayblock *)NativeAligned4FromLAddr(base - ARRAYBLOCKTRAILERWORDS);
|
||||
if ((*ArrayMerging_word == NIL) ||
|
||||
((base == *ArraySpace_word) || ((base == *ArraySpace2_word) || (ptrailer->inuse == T))))
|
||||
return (linkblock(base));
|
||||
pbase = base - 2 * ptrailer->arlen;
|
||||
@@ -398,16 +421,18 @@ LispPTR mergebackward(LispPTR base) {
|
||||
LispPTR mergeforward(LispPTR base) {
|
||||
LispPTR nbase, nbinuse;
|
||||
struct arrayblock *bbase, *bnbase;
|
||||
if (*ArrayMerging_word == NIL) return NIL;
|
||||
if (base == NIL) return NIL;
|
||||
if (checkarrayblock(base, T, T)) return NIL;
|
||||
|
||||
bbase = (struct arrayblock *)NativeAligned4FromLAddr(base);
|
||||
nbase = base + 2 * (bbase->arlen);
|
||||
if (nbase == *ArrayFrLst_word || nbase == *ArrayFrLst2_word) return NIL;
|
||||
|
||||
bnbase = (struct arrayblock *)NativeAligned4FromLAddr(nbase);
|
||||
if ((*ArrayMerging_word == NIL) ||
|
||||
((base == NIL) ||
|
||||
(checkarrayblock(base, T, T) ||
|
||||
((nbase == *ArrayFrLst_word) ||
|
||||
((nbase == *ArrayFrLst2_word) ||
|
||||
(checkarrayblock(nbase, (!(nbinuse = bnbase->inuse)), NIL) || nbinuse))))))
|
||||
return (NIL);
|
||||
nbinuse = bnbase->inuse;
|
||||
if (checkarrayblock(nbase, !nbinuse, NIL)) return NIL;
|
||||
if (nbinuse) return (NIL);
|
||||
deleteblock(nbase);
|
||||
deleteblock(base);
|
||||
return (arrayblockmerger(base, nbase));
|
||||
|
||||
@@ -375,8 +375,6 @@ static u_char *make_X_keymap(void) {
|
||||
table[xcode - 7] = code;
|
||||
}
|
||||
|
||||
XFree(mapping); /* No locking required? */
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("\n\n\tXGetKeyboardMapping table\n\n");
|
||||
for (i = 0; i < codecount * symspercode; i += symspercode) {
|
||||
@@ -394,6 +392,8 @@ static u_char *make_X_keymap(void) {
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
XFree(mapping); /* No locking required? */
|
||||
|
||||
return (table);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "ifpage.h" // for IFPAGE, MACHINETYPE_MAIKO
|
||||
#include "initsoutdefs.h" // for build_lisp_map, fixp_value, init_for_bitblt
|
||||
#include "iopage.h" // for IOPAGE
|
||||
#include "lispemul.h" // for LispPTR, DLword, NIL, BYTESPER_DLWORD
|
||||
#include "lispemul.h" // for LispPTR, DLword, NIL, BYTESPER_DLWORD, POINTERMASK
|
||||
#include "lispmap.h" // for ATMHT_OFFSET, ATOMS_OFFSET, DEFS_OFFSET
|
||||
#include "lspglob.h" // for InterfacePage, IOPage, AtomHT, Closure_Cac...
|
||||
#include "lsptypes.h" // for GetDTD, TYPE_FIXP, TYPE_LISTP
|
||||
@@ -405,7 +405,9 @@ void init_for_keyhandle(void) {
|
||||
MOUSECHORDTICKS68k = MakeAtom68k("\\MOUSECHORDTICKS");
|
||||
LASTUSERACTION68k = MakeAtom68k("\\LASTUSERACTION");
|
||||
|
||||
CLastUserActionCell68k = (LispPTR *)NativeAligned4FromLAddr(*LASTUSERACTION68k & 0xffffff);
|
||||
#ifndef INIT
|
||||
CLastUserActionCell68k = (LispPTR *)NativeAligned4FromLAddr(*LASTUSERACTION68k & POINTERMASK);
|
||||
#endif
|
||||
|
||||
DOBUFFEREDTRANSITION_index = MAKEATOM("\\DOBUFFEREDTRANSITIONS");
|
||||
INTERRUPTFRAME_index = MAKEATOM("\\INTERRUPTFRAME");
|
||||
|
||||
24
src/lde.html
Normal file
24
src/lde.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!doctype html>
|
||||
<!-- Based on https://github.com/timhutton/sdl-canvas-wasm/blob/main/index.html -->
|
||||
<!-- html to set up WebAssembly module for Medley running in a browser -->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div style="text-align: center;">
|
||||
<canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var width = 32*Math.trunc(Math.min(Math.max(window.innerWidth, 512), 1664)/32);
|
||||
var height = Math.min(Math.max(window.innerHeight, 512), 1260);
|
||||
var Module = {
|
||||
preRun: [ function() {ENV.MEDLEYDIR = "{DSK}<medley>";} ],
|
||||
arguments: ["medley/loadups/full.sysout","-sc", width+"x"+height, "-nh-host", "127.0.0.1"],
|
||||
canvas: (function() { return document.getElementById('canvas'); })()
|
||||
};
|
||||
</script>
|
||||
<script src="ldesdl.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
15
src/timer.c
15
src/timer.c
@@ -118,6 +118,19 @@ void update_miscstats(void) {
|
||||
MiscStats->diskiotime = 0; /* ?? not available ?? */
|
||||
MiscStats->diskops = 0;
|
||||
MiscStats->secondstmp = MiscStats->secondsclock = (time(0) + UNIX_ALTO_TIME_DIFF);
|
||||
#elif defined(MAIKO_OS_EMSCRIPTEN)
|
||||
/* Emscripten does not provide getrusage() functionality */
|
||||
struct timeval timev;
|
||||
|
||||
MiscStats->totaltime = gettime(0) - MiscStats->starttime;
|
||||
MiscStats->swapwaittime = 0;
|
||||
MiscStats->pagefaults = 0;
|
||||
MiscStats->swapwrites = 0;
|
||||
MiscStats->diskiotime = 0;
|
||||
MiscStats->diskops = 0;
|
||||
|
||||
gettimeofday(&timev, NULL);
|
||||
MiscStats->secondstmp = MiscStats->secondsclock = (timev.tv_sec + UNIX_ALTO_TIME_DIFF);
|
||||
#else
|
||||
struct timeval timev;
|
||||
struct rusage ru;
|
||||
@@ -288,6 +301,8 @@ void subr_settime(LispPTR args[])
|
||||
dosday.year = uxtime.tm_year;
|
||||
dosday.dayofweek = uxtime.tm_wday;
|
||||
_dos_setdate(&dosday);
|
||||
#elif defined(MAIKO_OS_EMSCRIPTEN)
|
||||
(void)args[0];
|
||||
#else
|
||||
struct timeval timev;
|
||||
timev.tv_sec = *((int *)NativeAligned4FromLAddr(args[0])) - UNIX_ALTO_TIME_DIFF;
|
||||
|
||||
@@ -518,6 +518,7 @@ LispPTR Unix_handlecomm(LispPTR *args) {
|
||||
DBPRINT(("Terminating process in slot %d.\n", slot));
|
||||
if (!valid_slot(slot)) return (ATOM_T);
|
||||
/* in all cases we need to close() the file descriptor */
|
||||
if (slot == 0) DBPRINT(("ZERO SLOT\n"));
|
||||
close(slot);
|
||||
switch (UJ[slot].type) {
|
||||
case UJSHELL:
|
||||
@@ -699,7 +700,7 @@ LispPTR Unix_handlecomm(LispPTR *args) {
|
||||
if (!valid_slot(slot)) return (NIL); /* No fd open; punt the read */
|
||||
|
||||
bufp = (NativeAligned2FromLAddr(args[2])); /* User buffer */
|
||||
DBPRINT(("Read buffer slot %d, type is %d\n", slot, UJ[slot].type));
|
||||
DBPRINT(("Read buffer slot %d, type is %d buffer LAddr 0x%x (native %p)\n", slot, UJ[slot].type, args[2], bufp));
|
||||
|
||||
switch (UJ[slot].type) {
|
||||
case UJSHELL:
|
||||
|
||||
@@ -98,7 +98,7 @@ static int ForkUnixShell(int slot, char *PtySlave, char *termtype, char *shellar
|
||||
if (SlaveFD == -1) {
|
||||
perror("Slave Open");
|
||||
perror(PtySlave);
|
||||
exit(0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef OS5
|
||||
@@ -132,7 +132,7 @@ static int ForkUnixShell(int slot, char *PtySlave, char *termtype, char *shellar
|
||||
for (userShell = getusershell(); userShell != NULL && strcmp(shell, userShell) != 0; userShell = getusershell());
|
||||
if (userShell == NULL) {
|
||||
perror("$(SHELL) not found in /etc/shells");
|
||||
exit(0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* argvec entries initialized to NULL */
|
||||
@@ -146,7 +146,7 @@ static int ForkUnixShell(int slot, char *PtySlave, char *termtype, char *shellar
|
||||
|
||||
/* Should never get here */
|
||||
perror("execv");
|
||||
exit(0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* fork_Unix is the secondary process spawned right after LISP is
|
||||
@@ -264,12 +264,14 @@ int fork_Unix(void) {
|
||||
while (1) {
|
||||
ssize_t len;
|
||||
len = SAFEREAD(LispPipeIn, IOBuf, 6);
|
||||
if (len == 0)
|
||||
exit(0);
|
||||
if (len < 0) {
|
||||
perror("Error reading packet by slave");
|
||||
exit(0);
|
||||
exit(1);
|
||||
} else if (len != 6) {
|
||||
DBPRINT(("Input packet wrong length: %zd", len));
|
||||
exit(0);
|
||||
exit(1);
|
||||
}
|
||||
slot = IOBuf[3];
|
||||
IOBuf[3] = 1; /* Start by signalling success in return-code */
|
||||
@@ -345,7 +347,7 @@ int fork_Unix(void) {
|
||||
sock = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (sock < 0) {
|
||||
perror("slave socket");
|
||||
exit(0);
|
||||
exit(1);
|
||||
}
|
||||
sprintf(PipeName, "/tmp/LPU%ld-%d", StartTime, slot);
|
||||
memset(&addr, 0, sizeof(struct sockaddr_un));
|
||||
@@ -357,7 +359,7 @@ int fork_Unix(void) {
|
||||
perror("slave connect");
|
||||
printf("Name = %s.\n", PipeName);
|
||||
fflush(stdout);
|
||||
exit(0);
|
||||
exit(1);
|
||||
} else {
|
||||
DBPRINT(("Slave connected on %s.\n", PipeName));
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ LispPTR vmem_save(char *sysout_file_name)
|
||||
TIMEOUT(sysout = open(sysout_file_name, O_WRONLY, 0666));
|
||||
if (sysout == -1) {
|
||||
/* No file error skip return. */
|
||||
if (errno != 2) return (FILECANNOTOPEN); /* No such file error.*/
|
||||
if (errno != ENOENT) return (FILECANNOTOPEN); /* No such file error.*/
|
||||
} else
|
||||
TIMEOUT(rval = close(sysout));
|
||||
|
||||
@@ -481,7 +481,7 @@ LispPTR vmem_save(char *sysout_file_name)
|
||||
TIMEOUT(rval = unlink(sysout_file_name));
|
||||
if (rval == -1) {
|
||||
/* No file error skip return. */
|
||||
if (errno != 2) /* No such file error.*/
|
||||
if (errno != ENOENT) /* No such file error.*/
|
||||
return (FILECANNOTOPEN);
|
||||
}
|
||||
|
||||
@@ -531,5 +531,5 @@ void lisp_finish(void) {
|
||||
#ifdef DOS
|
||||
exit_host_filesystem();
|
||||
#endif /* DOS */
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
6
src/xc.c
6
src/xc.c
@@ -20,6 +20,9 @@
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
#ifdef MAIKO_OS_EMSCRIPTEN
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
@@ -286,6 +289,9 @@ nextopcode:
|
||||
Irq_Stk_End = 0;
|
||||
#if defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
||||
IO_Signalled = TRUE;
|
||||
#endif
|
||||
#ifdef MAIKO_OS_EMSCRIPTEN
|
||||
emscripten_sleep(1);
|
||||
#endif
|
||||
pseudoTimerAsyncCountdown = insnsCountdownForTimerAsyncEmulation;
|
||||
}
|
||||
|
||||
26
src/xinit.c
26
src/xinit.c
@@ -16,6 +16,7 @@
|
||||
#include <signal.h> // for sig_atomic_t
|
||||
#include <stdbool.h> // for false, bool, true
|
||||
#include <stdio.h> // for NULL
|
||||
#include <stdlib.h> // for exit
|
||||
#include "adr68k.h" // for NativeAligned4FromLAddr
|
||||
#include "dbprint.h" // for TPRINT
|
||||
#include "devif.h" // for (anonymous), MRegion, DspInterface, OUTER_S...
|
||||
@@ -200,6 +201,27 @@ void Open_Display(DspInterface dsp)
|
||||
init_Xevent(dsp); /* Turn on the event reporting */
|
||||
} /* end OpenDisplay */
|
||||
|
||||
int X_FatalErrorHandler(Display *display)
|
||||
{
|
||||
/* when the fatal error handler gets called it can do cleanup
|
||||
* and either exit, or return. If it returns, the
|
||||
* FatalErrorExitHandler will be called
|
||||
*/
|
||||
/* If we could do a SAVEVM in the interrupt context we would mark it
|
||||
* as needed here. Returning will cause the FatalErrorExitHandler
|
||||
* hook to be called.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
void X_FatalErrorExitHandler(Display *display, void *userdata)
|
||||
{
|
||||
/* If we were invoking a SAVEVM/LOGOUT in the interrupt context we
|
||||
* would not exit here, as the Lisp VM needs to continue to run
|
||||
*/
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*********************************************************************/
|
||||
/* */
|
||||
/* X _ i n i t */
|
||||
@@ -236,6 +258,10 @@ DspInterface X_init(DspInterface dsp, LispPTR lispbitmap, unsigned width_hint, u
|
||||
/* Try to open the X display. If this isn't possible, we just */
|
||||
/* return FALSE. */
|
||||
if ((dsp->display_id = XOpenDisplay(dsp->identifier)) == NULL) return (NULL);
|
||||
|
||||
XSetIOErrorHandler(X_FatalErrorHandler);
|
||||
XSetIOErrorExitHandler(dsp->display_id, X_FatalErrorExitHandler, NULL);
|
||||
|
||||
/* Load the dsp structure */
|
||||
|
||||
Xscreen = ScreenOfDisplay(dsp->display_id, DefaultScreen(dsp->display_id));
|
||||
|
||||
@@ -188,6 +188,7 @@ void process_Xevents(DspInterface dsp)
|
||||
XNextEvent(dsp->display_id, &report);
|
||||
if (report.xany.window == dsp->DisplayWindow) /* Try the most important window first. */
|
||||
switch (report.type) {
|
||||
#ifndef INIT
|
||||
case MotionNotify:
|
||||
*CLastUserActionCell68k = MiscStats->secondstmp;
|
||||
*EmCursorX68K = (*((DLword *)EmMouseX68K)) =
|
||||
@@ -235,6 +236,7 @@ void process_Xevents(DspInterface dsp)
|
||||
break;
|
||||
case EnterNotify: Mouse_Included = TRUE; break;
|
||||
case LeaveNotify: Mouse_Included = FALSE; break;
|
||||
#endif
|
||||
case Expose:
|
||||
(dsp->bitblt_to_screen)(dsp, 0, report.xexpose.x + dsp->Visible.x,
|
||||
report.xexpose.y + dsp->Visible.y, report.xexpose.width,
|
||||
|
||||
Reference in New Issue
Block a user