Build for Linux

This commit is contained in:
Marcel Fabian Krüger 2022-10-16 15:17:31 +02:00
parent 4772879575
commit 38076b1e7e
2 changed files with 13 additions and 5 deletions

View File

@ -1,5 +1,5 @@
# TEXLIVE_SRC must be a precompiled TEXLIVE build with dynamic libraries
TEXLIVE_SRC = $(HOME)/texlive-mingw
TEXLIVE_SRC = $(HOME)/texlive-source
LUAMETATEX_SRC = $(HOME)/luametatex
# We expect to find a precompiled static library compiled with -fpic here
LUA_DIR = $(LUAMETATEX_SRC)/source/luacore/lua54/src
@ -19,12 +19,13 @@ LUAHARFBUZZ_OBJS = $(patsubst %.c,%.o,$(LUAHARFBUZZ_SRCS))
override CFLAGS += -fpic -DHAVE_DECL_ISASCII=1 $(patsubst %,-I%,$(INCLUDE_DIRS))
override LDFLAGS += -static-libgcc -static-libstdc++ -Wl,--gc-sections
# For Linux
# override LDFLAGS += -Wl,linkscript.ld -Wl,--gc-sections
# SO_EXT = so
override LDFLAGS += -Wl,linkscript.ld -Wl,--gc-sections
SO_EXT = so
# For Windows instead:
# override LDFLAGS += -Wl,-version-script=versionscript -Wl,--gc-sections
SO_EXT = dll
# SO_EXT = dll
# For MacOS instead:
# override LDFLAGS += -Wl,-exported_symbols_list,symbols_list,-alias_list,alias_list -lc++abi
# SO_EXT = dylib
@ -32,7 +33,9 @@ SO_EXT = dll
luaharfbuzz/src/luaharfbuzz/%.o: INCLUDE_DIRS = $(HB_INCLUDE_DIRS) $(LUA_INCLUDE_DIRS)
luametalatex-kpse/lkpselib.o: INCLUDE_DIRS = $(TL_INCLUDE_DIRS) $(LUA_INCLUDE_DIRS)
luametalatex.$(SO_EXT): luametalatex-kpse/lkpselib.o $(LUAHARFBUZZ_OBJS) $(TEXLIVE_SRC)/Work/texk/kpathsea/.libs/libkpathsea.a $(HARFBUZZ_DIR)/libharfbuzz.a $(GRAPHITE_DIR)/libgraphite2.a $(LUA_DIR)/liblua.a
# luametalatex.$(SO_EXT): luametalatex-kpse/lkpselib.o $(TEXLIVE_SRC)/Work/texk/kpathsea/.libs/libkpathsea.a # $(LUA_DIR)/liblua.a
luametalatex.$(SO_EXT): luametalatex-kpse/lkpselib.o $(LUAHARFBUZZ_OBJS) $(TEXLIVE_SRC)/Work/texk/kpathsea/.libs/libkpathsea.a $(HARFBUZZ_DIR)/libharfbuzz.a $(GRAPHITE_DIR)/libgraphite2.a # $(LUA_DIR)/liblua.a
# luametalatex.$(SO_EXT): luametalatex-kpse/lkpselib.o $(LUAHARFBUZZ_OBJS) $(TEXLIVE_SRC)/Work/texk/kpathsea/.libs/libkpathsea.a $(HARFBUZZ_DIR)/libharfbuzz.a $(GRAPHITE_DIR)/libgraphite2.a ../luametatex/build/mingw-64/libluametatex.dll.a # $(LUA_DIR)/liblua.a
%.$(SO_EXT):
$(LINK.so) $^ $(LOADLIBES) $(LDLIBS) -o $@

View File

@ -59,6 +59,11 @@ static const struct luaL_Reg lib_table [] = {
{NULL, NULL}
};
#ifdef _WIN32
__declspec(dllexport)
#else
__attribute__ ((visibility ("default")))
#endif
int luaopen_luaharfbuzz (lua_State *L) {
lua_newtable(L);