diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78055c8..3637a78 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,3 +18,14 @@ jobs: run: grep 'sudo apt install' INSTALL | sed 's/\$//' | sh - name: Compile run: make -C GUI/xephem + + compile-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Install OpenSSL + run: brew install openssl + - name: Install XQuartz + run: brew install xquartz --cask + - name: Compile + run: make -C GUI/xephem MOTIF=../../libXm/osx diff --git a/GUI/xephem/Makefile b/GUI/xephem/Makefile index ddfbef9..1f20e1b 100644 --- a/GUI/xephem/Makefile +++ b/GUI/xephem/Makefile @@ -28,13 +28,25 @@ ifndef MOTIFL MOTIFL = /usr/lib endif -# for linux and Apple OS X +# For Linux and Apple OS X + +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Linux) + PLATI := + PLATL := +endif +ifeq ($(UNAME_S),Darwin) + PLATI := -I/opt/X11/include -I/usr/local/opt/openssl@3/include + PLATL := -L/opt/X11/lib -L/usr/local/opt/openssl@3/lib + LASTLIB := xprint_fake.o +endif + CC = gcc CLDFLAGS = -g -CFLAGS = $(LIBINC) $(CLDFLAGS) -O2 -Wall -I$(MOTIFI) -I/opt/X11/include -LDFLAGS = $(LIBLNK) $(CLDFLAGS) -L$(MOTIFL) -L/opt/X11/lib +CFLAGS = $(LIBINC) $(CLDFLAGS) -O2 -Wall -I$(MOTIFI) $(PLATI) +LDFLAGS = $(LIBLNK) $(CLDFLAGS) -L$(MOTIFL) $(PLATL) XLIBS = -lXm -lXt -lXext -lXmu -lX11 -LIBS = $(XLIBS) $(LIBLIB) -lm -lssl +LIBS = $(XLIBS) $(LIBLIB) -lm -lssl $(LASTLIB) # static linking on Apple using X11 libs from ports # CC = gcc @@ -183,7 +195,8 @@ OBJS = \ xe2.o \ xe3.o \ xephem.o \ - xmisc.o + xmisc.o \ + xprint_fake.o all: libs xephem xephem.1 diff --git a/GUI/xephem/xprint_fake.c b/GUI/xephem/xprint_fake.c new file mode 100644 index 0000000..35a2cf0 --- /dev/null +++ b/GUI/xephem/xprint_fake.c @@ -0,0 +1 @@ +void *_XpEndJob = 0; diff --git a/libXm/osx/Xm/Xm.h b/libXm/osx/Xm/Xm.h index 07ec60d..2d52202 100644 --- a/libXm/osx/Xm/Xm.h +++ b/libXm/osx/Xm/Xm.h @@ -65,7 +65,7 @@ #include #include #include -#include +/* #include */ #include #include #include @@ -847,7 +847,7 @@ typedef struct { int reason; /* XmCR_START_JOB, XmCR_END_JOB, XmCR_PAGE_SETUP */ XEvent *event; - XPContext context; + /* XPContext context; */ Boolean last_page; /* in_out */ XtPointer detail; } XmPrintShellCallbackStruct;