Advertisement
frakswe

QB64pe OpenBSD patch

Jul 2nd, 2022
1,580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.53 KB | None | 0 0
  1. --- Makefile.orig   Sun Jul  3 02:39:19 2022
  2. +++ Makefile    Sun Jul  3 05:30:53 2022
  3. @@ -14,7 +14,7 @@
  4.  #
  5.  # This is important for libraries, since they could potentially be referencing
  6.  # things from our dependencies
  7. -CXXFLAGS += $(CXXFLAGS_EXTRA)
  8. +CXXFLAGS += $(CXXFLAGS_EXTRA)
  9.  CXXLIBS += $(CXXLIBS_EXTRA)
  10.  
  11.  # There are no C lib flags, those all go in CXXLIBS
  12. @@ -24,6 +24,9 @@
  13.  EXE_LIBS :=
  14.  
  15.  ifeq ($(OS),lnx)
  16. +   CXXFLAGS += -I/usr/local/include -I/usr/X11R6/include
  17. +   CXXLIBS += -L/usr/local/lib -L/usr/X11R6/lib
  18. +   CFLAGS += -I/usr/local/include -I/usr/X11R6/include
  19.     lnx := y
  20.  
  21.     PATH_INTERNAL := ./internal
  22. @@ -31,6 +34,8 @@
  23.     PATH_INTERNAL_TEMP := $(PATH_INTERNAL)/temp$(TEMP_ID)
  24.     PATH_INTERNAL_C := $(PATH_INTERNAL)/c
  25.     PATH_LIBQB := $(PATH_INTERNAL_C)/libqb
  26. +   CXX := c++
  27. +   CC := cc $(CFLAGS)
  28.     CP := cp -r
  29.     RM := rm -fr
  30.     MKDIR := mkdir -p
  31. @@ -39,13 +44,10 @@
  32.     PLATFORM := posix
  33.     EXTENSION :=
  34.  
  35. -   # Check bitness by getting length of `long
  36. +   # Check bitness
  37.     # 64 bits on x86_64, 32 bits on x86
  38. -   BITS := $(shell getconf LONG_BIT)
  39. +   BITS := $(shell file -b /bin/cp | cut -b -6 | tr -cd [:digit:])
  40.  
  41. -   ifeq ($(BITS),)
  42. -       BITS := 64
  43. -   endif
  44.  endif
  45.  
  46.  ifeq ($(OS),win)
  47. @@ -127,7 +129,7 @@
  48.  CXXFLAGS += -w -std=gnu++11
  49.  
  50.  ifeq ($(OS),lnx)
  51. -   CXXLIBS += -lGL -lGLU -lX11 -lpthread -ldl -lrt
  52. +   CXXLIBS += -lGL -lGLU -lX11 -lpthread -ldl
  53.     CXXFLAGS += -DFREEGLUT_STATIC
  54.  endif
  55.  
  56. --- internal/c/parts/core/src/freeglut_main.c.orig  Sun Jul  3 04:42:36 2022
  57. +++ internal/c/parts/core/src/freeglut_main.c   Sun Jul  3 04:44:47 2022
  58. @@ -43,6 +43,11 @@
  59.  #    define VFPRINTF(s,f,a)
  60.  #endif
  61.  
  62. +#ifdef __OpenBSD__
  63. +#include <sys/select.h> // fd_set
  64. +#endif
  65. +
  66. +
  67.  int qb64_custom_event(int event,int v1,int v2,int v3,int v4,int v5,int v6,int v7,int v8,void *p1,void *p2);
  68.  #if TARGET_HOST_POSIX_X11
  69.   void qb64_os_event_linux(XEvent *event, Display *display, int *qb64_os_event_info);
  70. --- internal/c/libqb/include/libqb-common.h.orig    Sun Jul  3 01:38:30 2022
  71. +++ internal/c/libqb/include/libqb-common.h Sun Jul  3 03:36:50 2022
  72. @@ -33,7 +33,7 @@
  73.  #    define QB64_MACOSX
  74.  #    define QB64_UNIX
  75.  #    define QB64_GCC
  76. -#elif defined(__linux__)
  77. +#elif defined(__unix__)
  78.  #    define QB64_LINUX
  79.  #    define QB64_UNIX
  80.  #    define QB64_GCC
  81. --- internal/source/main.txt.orig   Sun Jul  3 01:38:32 2022
  82. +++ internal/source/main.txt    Sun Jul  3 04:49:49 2022
  83. @@ -121845,7 +121845,7 @@
  84.  if(!qbevent)break;evnt(25828,24,"build.bas");}while(r);
  85.  }else{
  86.  do{
  87. -qbs_set(_FUNC_GETMAKEEXECUTABLE_STRING_GETMAKEEXECUTABLE,qbs_new_txt_len("make",4));
  88. +qbs_set(_FUNC_GETMAKEEXECUTABLE_STRING_GETMAKEEXECUTABLE,qbs_new_txt_len("gmake",5));
  89.  qbs_cleanup(qbs_tmp_base,0);
  90.  if(!qbevent)break;evnt(25828,26,"build.bas");}while(r);
  91.  }
  92. --- internal/c/os.h.orig    Sun Jul  3 04:29:10 2022
  93. +++ internal/c/os.h Sun Jul  3 04:41:01 2022
  94. @@ -1,6 +1,13 @@
  95.  
  96.  #include "libqb-common.h"
  97.  
  98. +#ifdef __OpenBSD__
  99. +#undef NULL
  100. +#define NULL 0
  101. +
  102. +#include <signal.h>
  103. +#endif
  104. +
  105.  /* common types (not quite an include guard, but allows an including
  106.   * file to not have these included.
  107.   *
  108. --- setup_lnx.sh.orig   Sun Jul  3 01:38:32 2022
  109. +++ setup_lnx.sh    Sun Jul  3 01:55:04 2022
  110. @@ -1,4 +1,4 @@
  111. -#!/bin/bash
  112. +#!/usr/local/bin/bash
  113.  # QB64 Installer
  114.  # Argument 1: If not blank, qb64 will not be started after compilation
  115.  
  116. @@ -109,8 +109,8 @@
  117.  fi
  118.  
  119.  echo "Compiling and installing QB64..."
  120. -make clean
  121. -make OS=lnx BUILD_QB64=y -j3
  122. +gmake OS="lnx" clean
  123. +gmake OS="lnx" BUILD_QB64="y -j4"
  124.  
  125.  if [ -e "./qb64" ]; then
  126.    echo "Done compiling!!"
  127.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement