Skip to content

Commit

Permalink
feat: 0.3.15 add enable-curses to configure.ac (#54)
Browse files Browse the repository at this point in the history
* feat: add enable curses to configure.ac
  • Loading branch information
jgabaut authored Dec 15, 2023
1 parent 3be3448 commit 87db20a
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 15 deletions.
10 changes: 8 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ AM_CFLAGS = $(KOLISEO_CFLAGS) -O2 -Werror -Wpedantic -Wall --std=c11

if DEBUG_BUILD
AM_LDFLAGS += -ggdb -O0
AM_CFLAGS += -DKLS_DEBUG_CORE -DKOLISEO_HAS_CURSES -DKOLISEO_HAS_GULP -DKLS_SETCONF_DEBUG
AM_CFLAGS += -DKLS_DEBUG_CORE -DKOLISEO_HAS_GULP -DKLS_SETCONF_DEBUG
else
# Linker flag to strip symbols
AM_LDFLAGS += -s
endif

if CURSES_BUILD
AM_CFLAGS += -DKOLISEO_HAS_CURSES
endif


./anvil:
@echo -e "\033[1;35m[Makefile]\e[0m Bootstrapping \"./anvil\":"
Expand All @@ -51,7 +55,9 @@ libkoliseo.o: $(lib_SOURCES)

libkoliseo.so: libkoliseo.o
@echo -e "\033[1;35m[Makefile]\e[0m Building \"$@\":"
$(CCOMP) -shared $< -o $@
@echo -e " \033[1;35mAM_CFLAGS\e[0m: [ \"\033[1;34m$(AM_CFLAGS)\e[0m\" ]"
@echo -e " \033[1;35mCFLAGS\e[0m: [ \"\033[1;34m$(CFLAGS)\e[0m\" ]"
$(CCOMP) $(CFLAGS) $(AM_CFLAGS) -shared $< -o $@
@echo -e "\033[1;33mDone.\e[0m"

# Build rule for object files
Expand Down
2 changes: 1 addition & 1 deletion bin/stego.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ testsdir = "ok"
"0.3.10" = "Fill docs, bump amboso to 1.7.4"
"0.3.12" = "Bump amboso to 1.9.6"
"0.3.13" = "Bump amboso to 1.9.7, add invil"
"0.3.14" = "Prep lib global install"
"0.3.15" = "Prep lib global install"
File renamed without changes.
File renamed without changes.
38 changes: 29 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Define the package name and version
AC_INIT([koliseo], [0.3.14], [[email protected]])
AC_INIT([koliseo], [0.3.15], [[email protected]])

# Verify automake version and enable foreign option
AM_INIT_AUTOMAKE([foreign -Wall])
Expand All @@ -10,45 +10,65 @@ echo "Host os: $host_os"
AM_CONDITIONAL([OS_DARWIN], [test "$host_os" = "darwin"])
AM_CONDITIONAL([MINGW32_BUILD], [test "$host_os" = "mingw32"])
#
# Check for the --enable-debug option
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Enable debug build])],
[enable_debug=$enableval],
[enable_debug=no])
# Define the DEBUG_BUILD conditional based on the --enable-debug option
AC_ARG_ENABLE([curses],
[AS_HELP_STRING([--enable-curses], [Enable curses functions])],
[enable_curses=$enableval],
[enable_curses=no])
AM_CONDITIONAL([DEBUG_BUILD], [test "$enable_debug" = "yes"])

# Define the include and library paths based on the host system
if test "$host_os" = "mingw32"; then
echo "Building for mingw32: [$host_cpu-$host_vendor-$host_os]"
# mingw32 specific flags
AC_SUBST([KOLISEO_CFLAGS], ["-I/usr/x86_64-w64-mingw32/include -static -fstack-protector -DMINGW32_BUILD -DNCURSES_STATIC"])
AC_SUBST([KOLISEO_LDFLAGS], ["-L/usr/x86_64-w64-mingw32/lib -lncursesw"])
if test "$enable_curses" = "yes"; then
echo "Building with curses header"
AC_SUBST([KOLISEO_CFLAGS], ["-I/usr/x86_64-w64-mingw32/include -static -fstack-protector -DMINGW32_BUILD -DNCURSES_STATIC"])
AC_SUBST([KOLISEO_LDFLAGS], ["-L/usr/x86_64-w64-mingw32/lib -lncursesw"])
else
AC_SUBST([KOLISEO_CFLAGS], ["-I/usr/x86_64-w64-mingw32/include -static -fstack-protector -DMINGW32_BUILD"])
AC_SUBST([KOLISEO_LDFLAGS], ["-L/usr/x86_64-w64-mingw32/lib"])
fi
AC_SUBST([CCOMP], ["/usr/bin/x86_64-w64-mingw32-gcc"])
AC_SUBST([OS], ["w64-mingw32"])
AC_SUBST([TARGET], ["demo.exe"])
fi
if test "$host_os" = "darwin"; then
echo "Building for macos: [$host_cpu-$host_vendor-$host_os]"
# macOS specific flags
AC_SUBST([KOLISEO_CFLAGS], ["-I/opt/homebrew/opt/ncurses/include"])
AC_SUBST([KOLISEO_LDFLAGS], ["-L/opt/homebrew/opt/ncurses/lib -lncurses"])
if test "$enable_curses" = "yes"; then
echo "Building with curses header"
AC_SUBST([KOLISEO_LDFLAGS], ["-L/opt/homebrew/opt/ncurses/lib -lncurses"])
AC_SUBST([KOLISEO_CFLAGS], ["-I/opt/homebrew/opt/ncurses/include"])
else
AC_SUBST([KOLISEO_LDFLAGS], [""])
AC_SUBST([KOLISEO_CFLAGS], [""])
fi
AC_SUBST([OS], ["darwin"])
AC_SUBST([TARGET], ["demo"])
fi
if test "$host_os" = "linux-gnu"; then
echo "Building for Linux: [$host_cpu-$host_vendor-$host_os]"
# Linux specific flags
if test "$enable_curses" = "yes"; then
echo "Building with curses header"
AC_SUBST([KOLISEO_LDFLAGS], ["-lncurses"])
else
AC_SUBST([KOLISEO_LDFLAGS], [""])
fi
AC_SUBST([KOLISEO_CFLAGS], [""])
AC_SUBST([KOLISEO_LDFLAGS], ["-lncurses"])
AC_SUBST([OS], ["Linux"])
AC_SUBST([TARGET], ["demo"])
fi
AM_CONDITIONAL([CURSES_BUILD], [test "$enable_curses" = "yes"])

# Set a default version number if not specified externally
AC_ARG_VAR([VERSION], [Version number])
if test -z "$VERSION"; then
VERSION="0.3.14"
VERSION="0.3.15"
fi

# Output variables to the config.h header
Expand Down
2 changes: 1 addition & 1 deletion docs/koliseo.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = "koliseo"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "0.3.14"
PROJECT_NUMBER = "0.3.15"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions src/koliseo.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#define KLS_MAJOR 0 /**< Represents current major release.*/
#define KLS_MINOR 3 /**< Represents current minor release.*/
#define KLS_PATCH 14 /**< Represents current patch release.*/
#define KLS_PATCH 15 /**< Represents current patch release.*/

/*! \mainpage Koliseo index page
*
Expand Down Expand Up @@ -183,7 +183,7 @@ static const int KOLISEO_API_VERSION_INT =
/**
* Defines current API version string.
*/
static const char KOLISEO_API_VERSION_STRING[] = "0.3.14"; /**< Represents current version with MAJOR.MINOR.PATCH format.*/
static const char KOLISEO_API_VERSION_STRING[] = "0.3.15"; /**< Represents current version with MAJOR.MINOR.PATCH format.*/

/**
* Returns current koliseo version as a string.
Expand Down

0 comments on commit 87db20a

Please sign in to comment.