libgnunetchat

library for GNUnet Messenger
Log | Files | Refs | README | LICENSE

commit 43a8fae35436910946742e551ff46a1549e2d262
parent 839a12cc576e20a8385c157ad53fc427ff0d740e
Author: TheJackiMonster <thejackimonster@gmail.com>
Date:   Sun, 25 Sep 2022 11:39:54 +0200

Add compile options and adjust README.md

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>

Diffstat:
MMakefile.am | 2++
MREADME.md | 16++++++++++++----
Mconfigure.ac | 9+++++++++
Msrc/Makefile.am | 10++++++++++
4 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am @@ -9,6 +9,8 @@ SUBDIRS = \ src \ tests +ACLOCAL_AMFLAGS = -I m4 + docs: mkdir -p doc doxygen diff --git a/README.md b/README.md @@ -22,17 +22,25 @@ The following dependencies are required and need to be installed to build the li - [gnunet](https://git.gnunet.org/gnunet.git/): For using GNUnet services and its datatypes -Then you can simply use the provided Makefile as follows: +Then you can simply use [Autotools](https://www.gnu.org/software/automake/) as follows: +``` +./bootstrap # Generate the configure script +./configure # Configure the Makefiles for your system +make # Build the library using the Makefiles +sudo make install # Install the library +``` - - `make` to just compile everything with default parameters +Here is a list of some useful build targets in the Makefile: + + - `make` to just compile everything with configured parameters - `make clean` to cleanup build files in case you want to recompile - - `make debug` to compile everything with debug parameters - - `make release` to compile everything with build optimizations enabled - `make install` to install the compiled files (you might need sudo permissions to install) - `make dist` to create a tar file for distribution - `make docs` to build Doxygen documentation ([Doxygen](https://www.doxygen.nl/index.html) is required to do that) - `make check` to test the library with automated unit tests ([Check](https://libcheck.github.io/check/) is required to do that) +If you want to change the installation location, use the `--prefix=` parameter in the `configure` script. Also you can enable debugging builds by adding `--enable-debug` as parameter when running the `configure` script. + ## Contribution If you want to contribute to this project as well, the following options are available: diff --git a/configure.ac b/configure.ac @@ -51,6 +51,15 @@ LT_INIT([disable-static dlopen]) AS_IF([test "x$enable_shared" = "xno"], [AC_MSG_ERROR([GNUnet works only with shared libraries, sorry])]) +AC_ARG_ENABLE([debug], +[ --enable-debug turn on debugging], +[case "${enableval}" in + yes) debug=true ;; + no) debug=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;; +esac],[debug=false]) +AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) + AC_CONFIG_FILES([ Makefile include/Makefile diff --git a/src/Makefile.am b/src/Makefile.am @@ -27,3 +27,13 @@ libgnunetchat_la_LIBADD = \ -lgnunetregex \ -lgnunetutil +libgnunetchat_la_CFLAGS = \ + -fPIC -pedantic -Wall -Wextra + +if DEBUG +libgnunetchat_la_CFLAGS += \ + -O0 -D _DEBUG -ggdb3 +else +libgnunetchat_la_CFLAGS += \ + -O2 -D NDEBUG +endif