X11Basic icon indicating copy to clipboard operation
X11Basic copied to clipboard

Building for macOS?

Open gingerbeardman opened this issue 5 years ago • 4 comments

I'd like to generate macOS binaries and share with you.

Referring to the old discussion: https://sourceforge.net/p/x11-basic/discussion/mac/thread/b88a6293/#ce13

I simply did this:

git clone https://gitlab.com/kollo/X11Basic.git
cd X11Basic
git fetch origin apple
git checkout apple
cd src
./configure

This goes OK!

But with make I get fatal errors:

$ make
gcc -Wall -MM -MT raw_keyboard.o -MT raw_keyboard.d  raw_keyboard.c -o raw_keyboard.d
raw_keyboard.c:18:10: fatal error: 'linux/input.h' file not found
#include <linux/input.h>
         ^~~~~~~~~~~~~~~
1 error generated.
gcc  -fPIC -shared -Wl,-Bsymbolic-functions   -g -O2 -I/usr/X11/include  -DUSE_X11  -O3  -Wl,-soname,libx11basic.so.1.27 -o libx11basic.so.1.27 xbasic.c tools.c loadprg.c file.c io.c io_basic.c parser.c variablen.c svariablen.c array.c parameter.c fft.c mathematics.c memory.c runtime.c wort_sep.c ltext.c functions.c sfunctions.c afunctions.c kommandos.c gkommandos.c bitmap.c do_gets.c errortxt.c window.c sysVstuff.c aes.c graphics.c sound.c number.c keywords.c decode.c virtual-machine.c vm-api.c type.c lodepng.c md5.c sha1.c -ldl -lm -lpthread -lutil -lreadline -llapack -lgmp -lgmp   
io.c:104:9: warning: 'NAME_MAX' macro redefined [-Wmacro-redefined]
#define NAME_MAX FILENAME_MAX
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h:83:9: note: previous definition is here
#define NAME_MAX                  255   /* max bytes in a file name */
        ^
io.c:820:95: warning: if statement has empty body [-Wempty-body]
  if(setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable))<0) ; /* ignore error */
                                                                                              ^
io.c:820:95: note: put the semicolon on a separate line to silence this warning
io.c:2668:15: warning: implicit declaration of function 'forkpty' is invalid in C99 [-Wimplicit-function-declaration]
  pid_t pid = forkpty (&ret_fd,slavename, NULL, &win);
              ^
3 warnings generated.
sfunctions.c:235:50: warning: illegal character encoding in character literal [-Winvalid-source-encoding]
       (*(n.pointer)=='`' && n.pointer[n.len-1]=='<B4>') ||
                                                 ^
1 warning generated.
ld: unknown option: -Bsymbolic-functions
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libx11basic.so.1.27] Error 1

and then edited option.h to add:

#define NOGRAPHICS 1

But I get linker error:

Details
matt@matt:~/Projects/X11Basic/src$ make
gcc -Wall -MM -MT xb2c.o -MT xb2c.d  xb2c.c -o xb2c.d
In file included from xb2c.c:25:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT xbvm.o -MT xbvm.d  xbvm.c -o xbvm.d
In file included from xbvm.c:22:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT xbbc.o -MT xbbc.d  xbbc.c -o xbbc.d
In file included from xbbc.c:31:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT main.o -MT main.d  main.c -o main.d
In file included from main.c:34:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT raw_keyboard.o -MT raw_keyboard.d  raw_keyboard.c -o raw_keyboard.d
raw_keyboard.c:18:10: fatal error: 'linux/input.h' file not found
#include <linux/input.h>
         ^~~~~~~~~~~~~~~
1 error generated.
gcc -Wall -MM -MT framebuffer.o -MT framebuffer.d  framebuffer.c -o framebuffer.d
In file included from framebuffer.c:44:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT ccs.o -MT ccs.d  ccs.c -o ccs.d
In file included from ccs.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT bytecode.o -MT bytecode.d  bytecode.c -o bytecode.d
In file included from bytecode.c:25:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT type.o -MT type.d  type.c -o type.d
In file included from type.c:13:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT vm-api.o -MT vm-api.d  vm-api.c -o vm-api.d
In file included from vm-api.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT virtual-machine.o -MT virtual-machine.d  virtual-machine.c -o virtual-machine.d
In file included from virtual-machine.c:17:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT number.o -MT number.d  number.c -o number.d
In file included from number.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT sound.o -MT sound.d  sound.c -o sound.d
In file included from sound.c:24:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT graphics.o -MT graphics.d  graphics.c -o graphics.d
In file included from graphics.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT aes.o -MT aes.d  aes.c -o aes.d
In file included from aes.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT sysVstuff.o -MT sysVstuff.d  sysVstuff.c -o sysVstuff.d
In file included from sysVstuff.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT window.o -MT window.d  window.c -o window.d
In file included from window.c:22:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT errortxt.o -MT errortxt.d  errortxt.c -o errortxt.d
In file included from errortxt.c:9:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT do_gets.o -MT do_gets.d  do_gets.c -o do_gets.d
In file included from do_gets.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT bitmap.o -MT bitmap.d  bitmap.c -o bitmap.d
In file included from bitmap.c:23:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT gkommandos.o -MT gkommandos.d  gkommandos.c -o gkommandos.d
In file included from gkommandos.c:19:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT kommandos.o -MT kommandos.d  kommandos.c -o kommandos.d
In file included from kommandos.c:33:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT afunctions.o -MT afunctions.d  afunctions.c -o afunctions.d
In file included from afunctions.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT sfunctions.o -MT sfunctions.d  sfunctions.c -o sfunctions.d
In file included from sfunctions.c:23:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT functions.o -MT functions.d  functions.c -o functions.d
In file included from functions.c:21:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT runtime.o -MT runtime.d  runtime.c -o runtime.d
In file included from runtime.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT memory.o -MT memory.d  memory.c -o memory.d
In file included from memory.c:11:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT mathematics.o -MT mathematics.d  mathematics.c -o mathematics.d
In file included from mathematics.c:13:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT fft.o -MT fft.d  fft.c -o fft.d
In file included from fft.c:5:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT parameter.o -MT parameter.d  parameter.c -o parameter.d
In file included from parameter.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT array.o -MT array.d  array.c -o array.d
In file included from array.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT svariablen.o -MT svariablen.d  svariablen.c -o svariablen.d
In file included from svariablen.c:22:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT variablen.o -MT variablen.d  variablen.c -o variablen.d
In file included from variablen.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT parser.o -MT parser.d  parser.c -o parser.d
In file included from parser.c:20:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT io_basic.o -MT io_basic.d  io_basic.c -o io_basic.d
In file included from io_basic.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT io.o -MT io.d  io.c -o io.d
In file included from io.c:24:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
io.c:104:9: warning: 'NAME_MAX' macro redefined [-Wmacro-redefined]
#define NAME_MAX FILENAME_MAX
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h:83:9: note: previous definition is here
#define NAME_MAX                  255   /* max bytes in a file name */
        ^
2 warnings generated.
gcc -Wall -MM -MT loadprg.o -MT loadprg.d  loadprg.c -o loadprg.d
In file included from loadprg.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT tools.o -MT tools.d  tools.c -o tools.d
In file included from tools.c:12:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT xbasic.o -MT xbasic.d  xbasic.c -o xbasic.d
In file included from xbasic.c:47:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
gcc -Wall -MM -MT raw_keyboard.o -MT raw_keyboard.d  raw_keyboard.c -o raw_keyboard.d
raw_keyboard.c:18:10: fatal error: 'linux/input.h' file not found
#include <linux/input.h>
         ^~~~~~~~~~~~~~~
1 error generated.
gcc  -fPIC -shared -Wl,-Bsymbolic-functions   -g -O2 -I/usr/X11/include  -DUSE_X11  -O3  -Wl,-soname,libx11basic.so.1.27 -o libx11basic.so.1.27 xbasic.c tools.c loadprg.c file.c io.c io_basic.c parser.c variablen.c svariablen.c array.c parameter.c fft.c mathematics.c memory.c runtime.c wort_sep.c ltext.c functions.c sfunctions.c afunctions.c kommandos.c gkommandos.c bitmap.c do_gets.c errortxt.c window.c sysVstuff.c aes.c graphics.c sound.c number.c keywords.c decode.c virtual-machine.c vm-api.c type.c lodepng.c md5.c sha1.c -ldl -lm -lpthread -lutil -lreadline -llapack -lgmp -lgmp   
In file included from xbasic.c:47:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from tools.c:12:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from loadprg.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from io.c:24:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
io.c:104:9: warning: 'NAME_MAX' macro redefined [-Wmacro-redefined]
#define NAME_MAX FILENAME_MAX
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h:83:9: note: previous definition is here
#define NAME_MAX                  255   /* max bytes in a file name */
        ^
io.c:820:95: warning: if statement has empty body [-Wempty-body]
  if(setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable))<0) ; /* ignore error */
                                                                                              ^
io.c:820:95: note: put the semicolon on a separate line to silence this warning
io.c:2668:15: warning: implicit declaration of function 'forkpty' is invalid in C99 [-Wimplicit-function-declaration]
  pid_t pid = forkpty (&ret_fd,slavename, NULL, &win);
              ^
4 warnings generated.
In file included from io_basic.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from parser.c:20:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from variablen.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from svariablen.c:22:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from array.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from parameter.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from fft.c:5:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from mathematics.c:13:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from memory.c:11:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from runtime.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from functions.c:21:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from sfunctions.c:23:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
sfunctions.c:235:50: warning: illegal character encoding in character literal [-Winvalid-source-encoding]
       (*(n.pointer)=='`' && n.pointer[n.len-1]=='<B4>') ||
                                                 ^
2 warnings generated.
In file included from afunctions.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from kommandos.c:33:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from gkommandos.c:19:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from bitmap.c:23:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from do_gets.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from errortxt.c:9:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from window.c:22:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from sysVstuff.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from aes.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from graphics.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from sound.c:24:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from number.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from virtual-machine.c:17:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from vm-api.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
In file included from type.c:13:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
  #define NOGRAPHICS
          ^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
        ^
1 warning generated.
ld: unknown option: -Bsymbolic-functions
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libx11basic.so.1.27] Error 1

(and same error when cloning from GitHub)

gingerbeardman avatar Dec 04 '19 11:12 gingerbeardman

Hi gingerbredman, Well, as far as I know, this has worked out before, but not completely.

Fist: I am wondering, because the apple branch is not there anymore. So you should just do (starting from scratch) git clone https://gitlab.com/kollo/X11Basic.git cd X11Basic/src ./configure

And maybe you only want to try the make static, wich is the simplest build.

But first, after the configure, lets have a look at config.h which has been created by configure.

Especially look at the lines with:

#define HAVE_X11 1

kollokollo avatar Dec 06 '19 14:12 kollokollo

Looking at the other error: raw_keybord.c probably need to be modified.

try to make somethin like:

#ifndef __APPLE__ #include <linux/input.h> #endif

or for convinience, delete the line #include <linux/input.h> but other errors my show up. (for the moment, you can ignore warnings)

kollokollo avatar Dec 06 '19 14:12 kollokollo

Part of the issues I've run into is assuming that the linker is GNU ld/ELF: Apple's linker is not GNU ld, and it uses an executable format known as Mach. For me, getting it to see headers and libraries in locations not in /usr/local is a pain, as the makefile doesn't seem to use LDFLAGS nor store CPPFLAGS.

For forkpty (without the forward declaration, it is an error on Apple Silicon), including util.h will fix the warning/error.

For the libxbasic shared library, there are a few areas that makes it a no-go on Darwin/macOS:

  • linker flags -Wl,-Bsymbolic-functions and -Wl,-soname,libx11basic.so.1.28 don't translate to Mach flags (the second can be done with -install_name /usr/local/lib/libx11basic.1.28.dylib, more on this later).
  • Shared libraries must end in ".dylib" for the linker to find them.
  • Versioning must be done before the file extension.
  • All symbols must be present at link time. prglen, ifilename, program, programbuffer, programbufferlen, and verbose need to be available, otherwise the library won't link. You can use -undefined dynamic_lookup, but I would not recommend it (You'd need the symbols to be external on the executables as well).
  • For shared libraries installed in system locations, it is a good idea to set the install name to the prefix you installed it into.
  • You can set -compatibility_version and -current_version on the library to make sure the applications fail early if the ABI changes significantly. More information about them can be found here.

MaddTheSane avatar Jun 03 '21 21:06 MaddTheSane

Seems this will not compile for Mac but is it possible to cross-compile the basic code for Mac using the Windows compiler as you can cross-compile on Windows for TomTom?

omiq avatar May 08 '22 01:05 omiq