Skip to content

Commit

Permalink
feat: improve configure.ac (#60)
Browse files Browse the repository at this point in the history
feat: refactor MINGW32_BUILD defines to WINDOWS_BUILD

feat: bump amboso to 2.0.0

feat: bump invil to 0.2.1

feat: add SHARED_LIB define, which is now also in pack chain
  • Loading branch information
jgabaut committed Dec 28, 2023
1 parent c2a617e commit 3063ab9
Show file tree
Hide file tree
Showing 12 changed files with 130 additions and 98 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*.so
# ignore .a files
*.a
# ignore .dll files
*.dll
# also explicitly ignore our executable for good measure
demo
# also explicitly ignore our windows executable for good measure
Expand Down
14 changes: 11 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ libkoliseo.o: $(lib_SOURCES)
$(CCOMP) -c $(CFLAGS) $(AM_CFLAGS) -fPIC $< -o $@
@echo -e "\033[1;33mDone.\e[0m"

libkoliseo.so: libkoliseo.o
$(SHARED_LIB): libkoliseo.o
@echo -e "\033[1;35m[Makefile]\e[0m Building \"$@\":"
@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\" ]"
Expand All @@ -73,7 +73,7 @@ libkoliseo.a: libkoliseo.o
%.o: %.c
$(CCOMP) -c $(CFLAGS) $(AM_CFLAGS) $< -o $@

install: libkoliseo.so doc
install: $(SHARED_LIB) doc
@echo -en "Installing koliseo lib $(VERSION): "
./installer-sh "-i" $(VERSION) $(TARGET_INSTALL_DIR) $(SOURCE_INSTALL_DIR) $(INSTALLER_LOG_FILE)
ldconfig
Expand Down Expand Up @@ -121,20 +121,26 @@ clean:
-rm $(TARGET)
-rm ./*.o
-rm ./*.so
-rm ./*.dll
-rm src/*.o
-rm src/*.so
-rm src/*.dll
-rm static/*.o
-rm static/*.so
-rm static/*.dll
@echo -e "\033[1;33mDone.\e[0m"

cleanob:
@echo -en "Cleaning object build artifacts: "
-rm ./*.o
-rm ./*.so
-rm ./*.dll
-rm src/*.o
-rm src/*.so
-rm src/*.dll
-rm static/*.o
-rm static/*.so
-rm static/*.dll
@echo -e "\033[1;33mDone.\e[0m"

bad_size.k:
Expand Down Expand Up @@ -216,7 +222,9 @@ pack: rebuild
@echo -e "\033[1;32m[TREE] Done.\e[0m"
@echo -e "\033[1;35m[PACK] Installing:\e[0m"
install $(TARGET) ~/koliseo-local/share/$(PACK_NAME)
install $(SHARED_LIB) ~/koliseo-local/share/$(PACK_NAME)
install README.md ~/koliseo-local/share/$(PACK_NAME)
install LICENSE ~/koliseo-local/share/$(PACK_NAME)
install ./src/koliseo.c ~/koliseo-local/share/$(PACK_NAME)/src
install ./src/koliseo.h ~/koliseo-local/share/$(PACK_NAME)/src

Expand All @@ -230,7 +238,7 @@ pack: rebuild
@echo -e "\033[1;33mDone.\e[0m"

# Default target (builds everything)
all: $(TARGET) libkoliseo.so libkoliseo.a
all: $(TARGET) $(SHARED_LIB) libkoliseo.a

# Target to clean and rebuild
rebuild: clean all
Expand Down
2 changes: 1 addition & 1 deletion amboso
Submodule amboso updated 65 files
+1 −1 .github/workflows/anviltest-base-init-mode.yml
+1 −1 .github/workflows/anviltest-base-purge-mode.yml
+1 −1 .github/workflows/anviltest-git-init-mode.yml
+1 −1 .github/workflows/anviltest-git-purge-mode.yml
+1 −1 .github/workflows/anviltest-test-macro.yml
+3 −0 .gitignore
+49 −0 CHANGELOG.md
+4 −3 Makefile
+34 −22 amboso
+827 −549 amboso_fn.sh
+5 −5 bin/stego.lock
+0 −0 bin/v2.0.0/.gitignore
+0 −4 kazoj/bone/anvil_stego
+4 −0 kazoj/bone/anvil_stego.k
+0 −0 kazoj/bone/anvil_stego.k.stderr
+0 −0 kazoj/bone/anvil_stego.k.stdout
+0 −4 kazoj/bone/good_stego
+4 −0 kazoj/bone/good_stego.k
+0 −0 kazoj/bone/good_stego.k.stderr
+1 −0 kazoj/bone/good_stego.k.stdout
+0 −1 kazoj/bone/good_stego.stdout
+0 −2 kazoj/bone/good_vers
+2 −0 kazoj/bone/good_vers.k
+2 −0 kazoj/bone/good_vers.k.stderr
+1 −0 kazoj/bone/good_vers.k.stdout
+0 −2 kazoj/bone/good_vers.stderr
+0 −2 kazoj/bone/good_vers.stdout
+0 −4 kazoj/bone/lint_anvil_stego
+4 −0 kazoj/bone/lint_anvil_stego.k
+0 −0 kazoj/bone/lint_anvil_stego.k.stderr
+1 −0 kazoj/bone/lint_anvil_stego.k.stdout
+0 −1 kazoj/bone/lint_anvil_stego.stdout
+1 −1 kazoj/bone/runtimes.k
+0 −0 kazoj/bone/runtimes.k.stderr
+0 −0 kazoj/bone/runtimes.k.stdout
+0 −90 kazoj/bone/try_amboso_sourcing
+105 −0 kazoj/bone/try_amboso_sourcing.k
+1 −0 kazoj/bone/try_amboso_sourcing.k.stderr
+0 −0 kazoj/bone/try_amboso_sourcing.k.stdout
+0 −1 kazoj/bone/try_amboso_sourcing.stderr
+0 −0 kazoj/bone/vershw.k
+0 −0 kazoj/bone/vershw.k.stderr
+0 −0 kazoj/bone/vershw.k.stdout
+0 −4 kazoj/kulpo/bad_stego
+4 −0 kazoj/kulpo/bad_stego.k
+27 −0 kazoj/kulpo/bad_stego.k.stderr
+2 −0 kazoj/kulpo/bad_stego.k.stdout
+0 −27 kazoj/kulpo/bad_stego.stderr
+0 −2 kazoj/kulpo/bad_stego.stdout
+0 −2 kazoj/kulpo/bad_vers
+2 −0 kazoj/kulpo/bad_vers.k
+0 −0 kazoj/kulpo/bad_vers.k.stderr
+4 −0 kazoj/kulpo/bad_vers.k.stdout
+0 −4 kazoj/kulpo/bad_vers.stdout
+0 −3 kazoj/kulpo/error_42
+3 −0 kazoj/kulpo/error_42.k
+6 −0 kazoj/kulpo/error_42.k.stderr
+0 −0 kazoj/kulpo/error_42.k.stdout
+0 −7 kazoj/kulpo/error_42.stderr
+0 −3 kazoj/kulpo/error_69
+3 −0 kazoj/kulpo/error_69.k
+5 −5 try-anvil/try_anvil
+5 −5 try-anvil/try_anvil_auto
+0 −0 utils/dot-paths/amboso.dot
+0 −0 utils/dot-paths/echo_paths
1 change: 1 addition & 0 deletions bin/stego.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ testsdir = "ok"
"0.3.17" = "Global lib install, config options, invil 0.1.5"
"0.3.18" = "invil 0.1.6, fixes broken ./anvil -i"
"0.3.19" = "Add .a rule, bump invil"
"0.3.20" = "Improve configure.ac, refactor MINGW32_BUILD, add SHARED_LIB define"
4 changes: 4 additions & 0 deletions bin/v0.3.20/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#amboso compliant version folder, will ignore everything inside BUT the gitignore, to keep the clean dir
*
!.gitignore
!static
1 change: 1 addition & 0 deletions bin/v0.3.20/static
110 changes: 63 additions & 47 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Define the package name and version
AC_INIT([koliseo], [0.3.19], [[email protected]])
AC_INIT([koliseo], [0.3.20], [[email protected]])

# Verify automake version and enable foreign option
AM_INIT_AUTOMAKE([foreign -Wall])

# Detect the host system and set PACK_PREFIX accordingly
AC_CANONICAL_HOST
build_linux=no
build_windows=no
build_mac=no
echo "Host os: $host_os"
AM_CONDITIONAL([OS_DARWIN], [test "$host_os" = "darwin"])
AM_CONDITIONAL([MINGW32_BUILD], [test "$host_os" = "mingw32"])
#

AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Enable debug build])],
[enable_debug=$enableval],
Expand All @@ -27,53 +28,68 @@ AM_CONDITIONAL([CURSES_BUILD], [test "$enable_curses" = "yes"])
AM_CONDITIONAL([GULP_BUILD], [test "$enable_gulp" = "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
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
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([OS], ["Linux"])
AC_SUBST([TARGET], ["demo"])
fi
case "${host_os}" in
mingw*)
echo "Building for mingw32: [$host_cpu-$host_vendor-$host_os]"
# mingw32 specific flags
if test "$enable_curses" = "yes"; then
echo "Building with curses header"
build_windows=yes
AC_SUBST([KOLISEO_CFLAGS], ["-I/usr/x86_64-w64-mingw32/include -static -fstack-protector -DWINDOWS_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 -DWINDOWS_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"])
AC_SUBST([SHARED_LIB], ["libkoliseo.dll"])
;;
darwin*)
echo "Building for macos: [$host_cpu-$host_vendor-$host_os]"
build_mac=yes
# macOS specific flags
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"])
AC_SUBST([SHARED_LIB], ["libkoliseo.so"])
;;
linux*)
echo "Building for Linux: [$host_cpu-$host_vendor-$host_os]"
build_linux=yes
# 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([OS], ["Linux"])
AC_SUBST([TARGET], ["demo"])
AC_SUBST([SHARED_LIB], ["libkoliseo.so"])
;;
*)
AC_MSG_ERROR(["OS $host_os is not supported"])
;;
esac

AM_CONDITIONAL([WINDOWS_BUILD], [test "$build_windows" = "yes"])
AM_CONDITIONAL([DARWIN_BUILD], [test "$build_mac" = "yes"])
AM_CONDITIONAL([LINUX_BUILD], [test "$build_linux" = "yes"])

# Set a default version number if not specified externally
AC_ARG_VAR([VERSION], [Version number])
if test -z "$VERSION"; then
VERSION="0.3.19"
VERSION="0.3.20"
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.19"
PROJECT_NUMBER = "0.3.20"

# 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
2 changes: 1 addition & 1 deletion invil
Loading

0 comments on commit 3063ab9

Please sign in to comment.