diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2022-09-25 11:39:54 +0200 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2022-09-25 11:39:54 +0200 |
commit | 43a8fae35436910946742e551ff46a1549e2d262 (patch) | |
tree | 4d6e50e56785bcf7b826adbf2fdf20e3b664910e | |
parent | 839a12cc576e20a8385c157ad53fc427ff0d740e (diff) | |
download | libgnunetchat-43a8fae35436910946742e551ff46a1549e2d262.tar.gz libgnunetchat-43a8fae35436910946742e551ff46a1549e2d262.zip |
Add compile options and adjust README.md
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | README.md | 16 | ||||
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | src/Makefile.am | 10 |
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 | ||
12 | ACLOCAL_AMFLAGS = -I m4 | ||
13 | |||
12 | docs: | 14 | docs: |
13 | mkdir -p doc | 15 | mkdir -p doc |
14 | doxygen | 16 | doxygen |
@@ -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 | ||
25 | Then you can simply use the provided Makefile as follows: | 25 | Then 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 | ||
29 | make # Build the library using the Makefiles | ||
30 | sudo make install # Install the library | ||
31 | ``` | ||
26 | 32 | ||
27 | - `make` to just compile everything with default parameters | 33 | Here 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 | ||
42 | 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. | ||
43 | |||
36 | ## Contribution | 44 | ## Contribution |
37 | 45 | ||
38 | If you want to contribute to this project as well, the following options are available: | 46 | If 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]) | |||
51 | AS_IF([test "x$enable_shared" = "xno"], | 51 | AS_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 | ||
54 | AC_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]) ;; | ||
60 | esac],[debug=false]) | ||
61 | AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) | ||
62 | |||
54 | AC_CONFIG_FILES([ | 63 | AC_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 | ||
30 | libgnunetchat_la_CFLAGS = \ | ||
31 | -fPIC -pedantic -Wall -Wextra | ||
32 | |||
33 | if DEBUG | ||
34 | libgnunetchat_la_CFLAGS += \ | ||
35 | -O0 -D _DEBUG -ggdb3 | ||
36 | else | ||
37 | libgnunetchat_la_CFLAGS += \ | ||
38 | -O2 -D NDEBUG | ||
39 | endif | ||