From 78c09fd7dcbe19936d263d365e7d7feb992fad00 Mon Sep 17 00:00:00 2001 From: nekobit Date: Mon, 27 Mar 2023 03:36:57 +0000 Subject: [PATCH] Finish premake transition FossilOrigin-Name: 30676561791954ccd8a2d8cb627fdb74b0cd38780ffa3b17a9aae4719a26e3fe --- .fossil-settings/ignore-glob | 1 + premake4.lua | 17 +++++++++++++++-- src/global_perl.h | 2 +- treebird.make | 12 ++++++------ 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.fossil-settings/ignore-glob b/.fossil-settings/ignore-glob index e0014d1..98f7ff8 100644 --- a/.fossil-settings/ignore-glob +++ b/.fossil-settings/ignore-glob @@ -15,3 +15,4 @@ templates/*.ctt test/unit/*.bin compile_commands.json build/ +obj/ diff --git a/premake4.lua b/premake4.lua index 65a1834..e137157 100644 --- a/premake4.lua +++ b/premake4.lua @@ -77,8 +77,21 @@ files(pages); includedirs { "include/" }; defines(definitions); -configuration { "linux", "bsd", "gmake" }; -linkoptions { "`pkg-config --libs mastodont`" }; +-- For some reason this one doesn't have a pkg-config file +local libfcgi = os.findlib("libfcgi"); +if not libfcgi then + print("Couldn't find libfcgi (aka fcgi-devkit). Probably gonna need that.\n"); + os.exit(1); +end + +configuration { "gmake" }; +linkoptions{ "`pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts`" }; +buildoptions{ "`pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts`" }; +links{"fcgi"}; + +if premake.gcc.cc ~= 'clang' then + buildoptions{"-Wno-compound-token-split-by-macro"}; +end -- TODO figure out perl... configuration { "Debug" }; diff --git a/src/global_perl.h b/src/global_perl.h index 6e446df..9d11440 100644 --- a/src/global_perl.h +++ b/src/global_perl.h @@ -7,7 +7,7 @@ #ifndef GLOBAL_PERL_H #define GLOBAL_PERL_H -// Hack on my system... if this breaks anything, plz dig deeper +/* Libperl has lots of warnings... */ #include #include #include "memory.h" diff --git a/treebird.make b/treebird.make index 9b9d0c7..142be46 100644 --- a/treebird.make +++ b/treebird.make @@ -26,12 +26,12 @@ ifeq ($(config),debug) DEFINES += -DCMP_ENABLE_ABOUT -DCMP_ENABLE_ACCOUNT -DCMP_ENABLE_APPLICATIONS -DCMP_ENABLE_ATTACHMENTS -DCMP_ENABLE_BASE_PAGE -DCMP_ENABLE_CONVERSATIONS -DCMP_ENABLE_EMOJI -DCMP_ENABLE_EMOJI_REACTION -DCMP_ENABLE_GLOBAL_CACHE -DCMP_ENABLE_GLOBAL_PERL -DCMP_ENABLE_HASHTAG -DCMP_ENABLE_HTTP -DCMP_ENABLE_INDEX -DCMP_ENABLE_LISTS -DDEBUG INCLUDES += -Iinclude ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g `pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts` -Wno-compound-token-split-by-macro ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - ALL_LDFLAGS += $(LDFLAGS) + ALL_LDFLAGS += $(LDFLAGS) -L. `pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts` LDDEPS += - LIBS += $(LDDEPS) + LIBS += $(LDDEPS) -lfcgi LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) define PREBUILDCMDS endef @@ -48,12 +48,12 @@ ifeq ($(config),release) DEFINES += -DCMP_ENABLE_ABOUT -DCMP_ENABLE_ACCOUNT -DCMP_ENABLE_APPLICATIONS -DCMP_ENABLE_ATTACHMENTS -DCMP_ENABLE_BASE_PAGE -DCMP_ENABLE_CONVERSATIONS -DCMP_ENABLE_EMOJI -DCMP_ENABLE_EMOJI_REACTION -DCMP_ENABLE_GLOBAL_CACHE -DCMP_ENABLE_GLOBAL_PERL -DCMP_ENABLE_HASHTAG -DCMP_ENABLE_HTTP -DCMP_ENABLE_INDEX -DCMP_ENABLE_LISTS -DNDEBUG INCLUDES += -Iinclude ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -O2 + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -O2 `pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts` -Wno-compound-token-split-by-macro ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - ALL_LDFLAGS += $(LDFLAGS) -s + ALL_LDFLAGS += $(LDFLAGS) -L. -s `pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts` LDDEPS += - LIBS += $(LDDEPS) + LIBS += $(LDDEPS) -lfcgi LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) define PREBUILDCMDS endef