diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-02 18:57:45 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-02 18:57:45 -0500 |
commit | 5625bc523861cf16c1aade7a4e7e6f8731a24b6e (patch) | |
tree | bfed6af1d5ddc60bbc22a1ab8d74036034c67db3 | |
parent | dd349c6c7e0eba659afc2149fd214f9972826052 (diff) |
got OpenBSD build to work
-rw-r--r-- | Makefile | 11 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | base.h | 5 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | make.bat | 2 | ||||
-rw-r--r-- | process-posix.c | 1 | ||||
-rw-r--r-- | text.h | 2 |
7 files changed, 15 insertions, 11 deletions
@@ -1,6 +1,6 @@ ALL_CFLAGS=$(CFLAGS) -Wall -Wextra -Wshadow -Wconversion -Wpedantic -pedantic -std=gnu11 \ -Wno-unused-function -Wno-fixed-enum-extension -Wimplicit-fallthrough -Wno-format-truncation -Wno-unknown-warning-option -LIBS=-lSDL2 -lGL -ldl -lm libpcre2-32.a -Ipcre2-10.36/build +LIBS=-lSDL2 -lGL -lm libpcre2-32.a DEBUG_CFLAGS=$(ALL_CFLAGS) -DDEBUG -O0 -g RELEASE_CFLAGS=$(ALL_CFLAGS) -O3 -g PROFILE_CFLAGS=$(ALL_CFLAGS) -O3 -g -DPROFILE=1 @@ -10,7 +10,7 @@ INSTALL_BIN_DIR=/usr/bin ted: *.[ch] libpcre2-32.a stb_truetype.o $(CC) main.c stb_truetype.o -o ted $(DEBUG_CFLAGS) $(LIBS) stb_truetype.o: stb_truetype.c - $(CC) $< -c -o $@ + $(CC) stb_truetype.c -c -o stb_truetype.o release: *.[ch] libpcre2-32.a $(CC) main.c -o ted $(RELEASE_CFLAGS) $(LIBS) profile: *.[ch] libpcre2-32.a @@ -28,10 +28,9 @@ install: release install ted $(INSTALL_BIN_DIR) libpcre2-32.a: pcre2-10.36.zip rm -rf pcre2-10.36 - unzip $< - mkdir pcre2-10.36/build - cd pcre2-10.36/build && cmake -DPCRE2_BUILD_PCRE2_32=ON .. && $(MAKE) -j8 - cp pcre2-10.36/build/$@ ./ + unzip pcre2-10.36.zip + cd pcre2-10.36 && cmake -DPCRE2_BUILD_PCRE2_32=ON . && $(MAKE) -j8 + cp pcre2-10.36/libpcre2-32.a ./ ted.deb: release rm -rf /tmp/ted @@ -35,11 +35,12 @@ To install `ted` on Linux, you will need: - A C compiler - The SDL2 development libraries - wget, unzip (for downloading, extracting PCRE2) +- cmake (for PCRE2) These can be installed on Ubuntu/Debian with: ``` -sudo apt install gcc libsdl2-dev wget unzip +sudo apt install gcc libsdl2-dev wget unzip cmake ``` Then run @@ -31,7 +31,12 @@ #include <float.h> #include <limits.h> #include <assert.h> +#if __linux__ || _WIN32 #include <uchar.h> +#else +// OpenBSD has uchar.h but it doesn't seem to define char32_t ? +typedef uint32_t char32_t; +#endif #if !__TINYC__ && __STDC_VERSION__ >= 201112 #define static_assert_if_possible(cond) _Static_assert(cond, "Static assertion failed"); @@ -28,7 +28,7 @@ no_warn_end #endif #define PCRE2_STATIC #define PCRE2_CODE_UNIT_WIDTH 32 -#include "pcre2.h" +#include "pcre2-10.36/pcre2.h" #include "unicode.h" #include "util.c" @@ -10,7 +10,7 @@ if not exist pcre2-32.lib ( popd copy pcre2-10.36\Release\pcre2-32.lib ) -SET C_FLAGS=/nologo /W4 /MD /wd4200 /wd4204 /wd4221 /wd4706 /wd4214 /D_CRT_SECURE_NO_WARNINGS /I pcre2-10.36 /I SDL2/include SDL2/lib/x64/SDL2main.lib SDL2/lib/x64/SDL2.lib pcre2-32.lib +SET C_FLAGS=/nologo /W4 /MD /wd4200 /wd4204 /wd4221 /wd4706 /wd4214 /D_CRT_SECURE_NO_WARNINGS /I SDL2/include SDL2/lib/x64/SDL2main.lib SDL2/lib/x64/SDL2.lib pcre2-32.lib rc /nologo ted.rc if _%1 == _ ( cl main.c stb_truetype.c ted.res /DDEBUG /DEBUG /Zi %C_FLAGS% /Fe:ted diff --git a/process-posix.c b/process-posix.c index 8bfe036..1236323 100644 --- a/process-posix.c +++ b/process-posix.c @@ -2,6 +2,7 @@ #include <fcntl.h> #include <sys/wait.h> +#include <signal.h> struct Process { pid_t pid; @@ -1,8 +1,6 @@ #ifndef TEXT_H_ #define TEXT_H_ -#include <uchar.h> - // A text-rendering interface. // Example usage: // Font *font = text_font_load("font.ttf", 18); |