[make] Add sqlite.hdll target
MODIFY
.github/workflows/build.yml
.github/workflows/build.yml
@@ -96,7 +96,8 @@ jobs:
libuv1-dev:i386 \
libvorbis-dev:i386 \
libz-dev:i386 \
- zlib1g-dev:i386
+ zlib1g-dev:i386 \
+ libsqlite3-dev:i386
;;
linux-amd64)
@@ -109,7 +110,8 @@ jobs:
libsdl2-dev \
libturbojpeg-dev \
libuv1-dev \
- libvorbis-dev
+ libvorbis-dev \
+ libsqlite3-dev
;;
darwin*)

MODIFY
Brewfile
Brewfile
@@ -10,3 +10,4 @@ brew "openal-soft"
brew "mbedtls@2", link: true
brew "libuv"
brew "openssl"
+brew "sqlite"

MODIFY
Makefile
Makefile
@@ -7,9 +7,9 @@ INSTALL_BIN_DIR ?= $(PREFIX)/bin
INSTALL_LIB_DIR ?= $(PREFIX)/lib
INSTALL_INCLUDE_DIR ?= $(PREFIX)/include
-LIBS=fmt sdl ssl openal ui uv mysql
+LIBS=fmt sdl ssl openal ui uv mysql sqlite
-CFLAGS = -Wall -O3 -I src -msse2 -mfpmath=sse -std=c11 -I include -I include/pcre -I include/mikktspace -I include/minimp3 -D LIBHL_EXPORTS
+CFLAGS = -Wall -O3 -I src -msse2 -mfpmath=sse -std=c11 -D LIBHL_EXPORTS
LFLAGS = -L. -lhl
EXTRA_LFLAGS ?=
LIBFLAGS =
@@ -17,6 +17,8 @@ HLFLAGS = -ldl
LIBEXT = so
LIBTURBOJPEG = -lturbojpeg
+PCRE_INCLUDE = -I include/pcre
+
PCRE = include/pcre/pcre_chartables.o include/pcre/pcre_compile.o include/pcre/pcre_dfa_exec.o \
include/pcre/pcre_exec.o include/pcre/pcre_fullinfo.o include/pcre/pcre_globals.o \
include/pcre/pcre_newline.o include/pcre/pcre_string_utils.o include/pcre/pcre_tables.o include/pcre/pcre_xclass.o \
@@ -31,6 +33,8 @@ STD = src/std/array.o src/std/buffer.o src/std/bytes.o src/std/cast.o src/std/da
HL = src/code.o src/jit.o src/main.o src/module.o src/debugger.o src/profile.o
+FMT_INCLUDE = -I include/mikktspace -I include/minimp3
+
FMT = libs/fmt/fmt.o libs/fmt/sha1.o include/mikktspace/mikktspace.o libs/fmt/mikkt.o libs/fmt/dxt.o
SDL = libs/sdl/sdl.o libs/sdl/gl.o
@@ -45,6 +49,8 @@ UI = libs/ui/ui_stub.o
MYSQL = libs/mysql/socket.o libs/mysql/sha1.o libs/mysql/my_proto.o libs/mysql/my_api.o libs/mysql/mysql.o
+SQLITE = libs/sqlite/sqlite.o
+
LIB = ${PCRE} ${RUNTIME} ${STD}
BOOT = src/_main.o
@@ -66,7 +72,9 @@ else ifeq ($(UNAME),Darwin)
# Mac
LIBEXT=dylib
-CFLAGS += -m$(MARCH) -I /usr/local/include -I /usr/local/opt/libjpeg-turbo/include -I /usr/local/opt/jpeg-turbo/include -I /usr/local/opt/sdl2/include/SDL2 -I /usr/local/opt/libvorbis/include -I /usr/local/opt/openal-soft/include -Dopenal_soft -DGL_SILENCE_DEPRECATION
+CFLAGS += -m$(MARCH) -I include -I /usr/local/include -I /usr/local/opt/libjpeg-turbo/include \
+ -I /usr/local/opt/jpeg-turbo/include -I /usr/local/opt/sdl2/include/SDL2 -I /usr/local/opt/libvorbis/include \
+ -I /usr/local/opt/openal-soft/include -Dopenal_soft -DGL_SILENCE_DEPRECATION
LFLAGS += -Wl,-export_dynamic -L/usr/local/lib
ifdef OSX_SDK
@@ -130,6 +138,12 @@ uninstall:
libs: $(LIBS)
+./include/pcre/%.o: include/pcre/%.c
+ ${CC} ${CFLAGS} -o $@ -c $< ${PCRE_FLAGS}
+
+src/std/regexp.o: src/std/regexp.c
+ ${CC} ${CFLAGS} -o $@ -c $< ${PCRE_FLAGS}
+
libhl: ${LIB}
${CC} -o libhl.$(LIBEXT) -m${MARCH} ${LIBFLAGS} -shared ${LIB} -lpthread -lm
@@ -139,8 +153,11 @@ hlc: ${BOOT}
hl: ${HL} libhl
${CC} ${CFLAGS} -o hl ${HL} ${LFLAGS} ${EXTRA_LFLAGS} ${HLFLAGS}
+libs/fmt/%.o: libs/fmt/%.c
+ ${CC} ${CFLAGS} -o $@ -c $< ${FMT_INCLUDE}
+
fmt: ${FMT} libhl
- ${CC} ${CFLAGS} -I include/mikktspace -I include/minimp3 -shared -o fmt.hdll ${FMT} ${LIBFLAGS} -L. -lhl -lpng $(LIBTURBOJPEG) -lz -lvorbisfile
+ ${CC} ${CFLAGS} -shared -o fmt.hdll ${FMT} ${LIBFLAGS} -L. -lhl -lpng $(LIBTURBOJPEG) -lz -lvorbisfile
sdl: ${SDL} libhl
${CC} ${CFLAGS} -shared -o sdl.hdll ${SDL} ${LIBFLAGS} -L. -lhl -lSDL2 $(LIBOPENGL)
@@ -160,6 +177,9 @@ uv: ${UV} libhl
mysql: ${MYSQL} libhl
${CC} ${CFLAGS} -shared -o mysql.hdll ${MYSQL} ${LIBFLAGS} -L. -lhl
+sqlite: ${SQLITE} libhl
+ ${CC} ${CFLAGS} -shared -o sqlite.hdll ${SQLITE} ${LIBFLAGS} -L. -lhl -lsqlite3
+
mesa:
(cd libs/mesa && make)
@@ -224,7 +244,7 @@ codesign_osx:
${CC} ${CFLAGS} -o $@ -c $<
clean_o:
- rm -f ${STD} ${BOOT} ${RUNTIME} ${PCRE} ${HL} ${FMT} ${SDL} ${SSL} ${OPENAL} ${UI} ${UV} ${HL_DEBUG}
+ rm -f ${STD} ${BOOT} ${RUNTIME} ${PCRE} ${HL} ${FMT} ${SDL} ${SSL} ${OPENAL} ${UI} ${UV} ${MYSQL} ${SQLITE} ${HL_DEBUG}
clean: clean_o
rm -f hl hl.exe libhl.$(LIBEXT) *.hdll

MODIFY
README.md
README.md
@@ -17,16 +17,17 @@ Here's the dependencies that you install in order to compile all the libraries:
* sdl: libsdl2-dev
* ssl: libmbedtls-dev
* uv: libuv1-dev
+* sqlite: libsqlite3-dev
To install all dependencies on the latest **Ubuntu**, for example:
-`sudo apt-get install libpng-dev libturbojpeg-dev libvorbis-dev libopenal-dev libsdl2-dev libmbedtls-dev libuv1-dev`
+`sudo apt-get install libpng-dev libturbojpeg-dev libvorbis-dev libopenal-dev libsdl2-dev libmbedtls-dev libuv1-dev libsqlite3-dev`
For 16.04, see [this note](https://github.com/HaxeFoundation/hashlink/issues/147).
To install all dependencies on the latest **Fedora**, for example:
-`sudo dnf install libpng-devel turbojpeg-devel libvorbis-devel openal-soft-devel SDL2-devel mesa-libGLU-devel mbedtls-devel libuv-devel`
+`sudo dnf install libpng-devel turbojpeg-devel libvorbis-devel openal-soft-devel SDL2-devel mesa-libGLU-devel mbedtls-devel libuv-devel sqlite-devel`
**And on OSX:**

MODIFY
other/azure-pipelines/build-linux.yml
other/azure-pipelines/build-linux.yml
@@ -2,7 +2,7 @@ parameters:
name: 'BuildLinux'
vmImage: 'ubuntu-18.04'
container: 'debian:stretch'
- arch: '' # set it to i386 fof 32-bit build
+ arch: '' # set it to i386 for 32-bit build
buildSystem: 'cmake' # either 'cmake' or 'make'
cmakeConfig: 'RelWithDebInfo'
@@ -44,6 +44,7 @@ jobs:
libturbojpeg0-dev \
libuv1-dev \
libopenal-dev \
+ libsqlite3-dev \
neko \
curl \
ca-certificates
@@ -67,6 +68,7 @@ jobs:
libturbojpeg0-dev:i386 \
libuv1-dev:${{ parameters.arch }} \
libopenal-dev:${{ parameters.arch }} \
+ libsqlite3-dev:${{ parameters.arch }} \
neko \
curl \
ca-certificates

[make] Add sqlite.hdll target (#520)