aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2022-09-25 11:39:54 +0200
committerTheJackiMonster <thejackimonster@gmail.com>2022-09-25 11:39:54 +0200
commit43a8fae35436910946742e551ff46a1549e2d262 (patch)
tree4d6e50e56785bcf7b826adbf2fdf20e3b664910e
parent839a12cc576e20a8385c157ad53fc427ff0d740e (diff)
downloadlibgnunetchat-43a8fae35436910946742e551ff46a1549e2d262.tar.gz
libgnunetchat-43a8fae35436910946742e551ff46a1549e2d262.zip
Add compile options and adjust README.md
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--Makefile.am2
-rw-r--r--README.md16
-rw-r--r--configure.ac9
-rw-r--r--src/Makefile.am10
4 files changed, 33 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index 30e4c19..e8d6340 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,6 +9,8 @@ SUBDIRS = \
9 src \ 9 src \
10 tests 10 tests
11 11
12ACLOCAL_AMFLAGS = -I m4
13
12docs: 14docs:
13 mkdir -p doc 15 mkdir -p doc
14 doxygen 16 doxygen
diff --git a/README.md b/README.md
index 79c2cbd..56b7119 100644
--- a/README.md
+++ b/README.md
@@ -22,17 +22,25 @@ The following dependencies are required and need to be installed to build the li
22 22
23 - [gnunet](https://git.gnunet.org/gnunet.git/): For using GNUnet services and its datatypes 23 - [gnunet](https://git.gnunet.org/gnunet.git/): For using GNUnet services and its datatypes
24 24
25Then you can simply use the provided Makefile as follows: 25Then you can simply use [Autotools](https://www.gnu.org/software/automake/) as follows:
26```
27./bootstrap # Generate the configure script
28./configure # Configure the Makefiles for your system
29make # Build the library using the Makefiles
30sudo make install # Install the library
31```
26 32
27 - `make` to just compile everything with default parameters 33Here is a list of some useful build targets in the Makefile:
34
35 - `make` to just compile everything with configured parameters
28 - `make clean` to cleanup build files in case you want to recompile 36 - `make clean` to cleanup build files in case you want to recompile
29 - `make debug` to compile everything with debug parameters
30 - `make release` to compile everything with build optimizations enabled
31 - `make install` to install the compiled files (you might need sudo permissions to install) 37 - `make install` to install the compiled files (you might need sudo permissions to install)
32 - `make dist` to create a tar file for distribution 38 - `make dist` to create a tar file for distribution
33 - `make docs` to build Doxygen documentation ([Doxygen](https://www.doxygen.nl/index.html) is required to do that) 39 - `make docs` to build Doxygen documentation ([Doxygen](https://www.doxygen.nl/index.html) is required to do that)
34 - `make check` to test the library with automated unit tests ([Check](https://libcheck.github.io/check/) is required to do that) 40 - `make check` to test the library with automated unit tests ([Check](https://libcheck.github.io/check/) is required to do that)
35 41
42If 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.
43
36## Contribution 44## Contribution
37 45
38If you want to contribute to this project as well, the following options are available: 46If you want to contribute to this project as well, the following options are available:
diff --git a/configure.ac b/configure.ac
index 9fb9c7d..fc58e40 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,6 +51,15 @@ LT_INIT([disable-static dlopen])
51AS_IF([test "x$enable_shared" = "xno"], 51AS_IF([test "x$enable_shared" = "xno"],
52 [AC_MSG_ERROR([GNUnet works only with shared libraries, sorry])]) 52 [AC_MSG_ERROR([GNUnet works only with shared libraries, sorry])])
53 53
54AC_ARG_ENABLE([debug],
55[ --enable-debug turn on debugging],
56[case "${enableval}" in
57 yes) debug=true ;;
58 no) debug=false ;;
59 *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
60esac],[debug=false])
61AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
62
54AC_CONFIG_FILES([ 63AC_CONFIG_FILES([
55 Makefile 64 Makefile
56 include/Makefile 65 include/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 38e2cdd..f87788e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -27,3 +27,13 @@ libgnunetchat_la_LIBADD = \
27 -lgnunetregex \ 27 -lgnunetregex \
28 -lgnunetutil 28 -lgnunetutil
29 29
30libgnunetchat_la_CFLAGS = \
31 -fPIC -pedantic -Wall -Wextra
32
33if DEBUG
34libgnunetchat_la_CFLAGS += \
35 -O0 -D _DEBUG -ggdb3
36else
37libgnunetchat_la_CFLAGS += \
38 -O2 -D NDEBUG
39endif