Skip to content

Commit

Permalink
Add build.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
SekaiMoe committed Oct 12, 2024
1 parent e10b90c commit b5e71f9
Show file tree
Hide file tree
Showing 12 changed files with 10,097 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cpp/configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/env sh

set -e

# This is a thin wrapper which will call the real configure script, and
# make sure that is called using bash.

# Get an absolute path to this script, since that determines the top-level directory.
source_path="$(dirname ${0})"
this_script_dir="$(cd -- "${source_path}" > /dev/null && pwd)"
if test -z "${this_script_dir}"; then
echo "Error: Could not determine location of configure script"
exit 1
fi

# Delegate to wrapper, forcing wrapper to believe $0 is this script by using -c.
# This trick is needed to get autoconf to co-operate properly.
# The ${-:+-$-} construction passes on bash options.
bash ${-:+-$-} -c ". \"${this_script_dir}/scripts/autoconf/configure" CHECKME "${this_script_dir}" "$@"
26 changes: 26 additions & 0 deletions cpp/scripts/autoconf/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
AUTOMAKE_OPTIONS = subdir-objects

bin_PROGRAMS = helper
helper_SOURCES = \
src/helper.cpp \
src/index.cpp \
src/json.cpp \
src/search.cpp \
src/signal.cpp \
src/usage.cpp \
src/version.cpp \
src/data.cpp \
src/web/web.cpp

AM_CPPFLAGS = -I$(top_srcdir)/include

AM_CXXFLAGS = -Wall -Wno-unused-result -fstack-clash-protection -fstack-protector-all -std=c++17 -pipe
if DEBUG_MODE
AM_CXXFLAGS += -Wextra -Wpedantic -Winit-self -Wlogical-op
endif

helper_LDFLAGS = -ffunction-sections -fdata-sections -z now -z noexecstack -fPIE -flto

install-exec-hook:
$(INSTALL) helper $(DESTDIR)/usr/local/bin/

Loading

0 comments on commit b5e71f9

Please sign in to comment.