summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjin-eld <jin at mediatomb dot cc>2013-08-13 21:55:32 +0300
committerjin-eld <jin at mediatomb dot cc>2013-08-24 03:25:07 +0300
commit50c8a820e5ab46acc129a49ab849f8848e40d915 (patch)
tree4eb66794fd31fd96cf0ac0c6cbb01bca5e122283
parente658892793c42b2d058eed0937025ef2ddaaa372 (diff)
Implemented autotools based build scripts
supported options: --with-dependency-search=DIR will tell configure to look for various dependencies in DIR/include and DIR/lib Alternatively you can also specify libsodium header and libs location with --with-libsodium-headers and --with-libsodium-libs if it is installed elsewhere. Ncurses and libconfig are handled via the default pkg-config way, see ./configure --help=short for detailed information. The tox library is compiled as libtoxcore in shared and static variants, public headers are installed to ${prefix}/include/tox A pkg-config libtoxcore.pc configuration file is provided. Use ./configure --help for a full list of configure options or ./configure --help=short for the options that I added. To generate the configure script after pulling from git use: autoreconf -i To generate a release tarball use: make dist Unit tests are handled by the libcheck library integration that is provided by autotools, use: make check to compile and run the tests. Unit tests are currently optional, i.e. - if the check library is not found on the system, then tests will be disabled. Same goes for nTox and DHT bootstrap daemon - they will be enabled or disabled depending on the availability of ncurses (for nTox) or libconfig (for DHT bootstrap daemon). The above can be also tuned by: --enable-tests / --disable-tests --enable-ntox / --disable-ntox --enable-dht-bootstrap-daemon / --disable-dht-bootstrap-daemon
-rw-r--r--.gitignore24
-rw-r--r--.travis.yml2
-rw-r--r--AUTHORS0
-rw-r--r--ChangeLog0
-rw-r--r--INSTALL365
-rw-r--r--Makefile.am31
-rw-r--r--NEWS0
l---------README1
-rw-r--r--auto_tests/Makefile.inc39
-rw-r--r--build/Makefile.am10
-rw-r--r--configure.ac336
-rw-r--r--libtoxcore.pc.in12
-rw-r--r--m4/pkg.m4199
-rw-r--r--other/Makefile.inc20
-rw-r--r--other/bootstrap_serverdaemon/Makefile.inc27
-rw-r--r--testing/Makefile.inc97
-rw-r--r--toxcore/Makefile.inc42
17 files changed, 1203 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 49ac783a..99f6cfe8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,8 @@
2 2
3//nacl build 3//nacl build
4nacl/build/ 4nacl/build/
5build 5build/
6!build/Makefile.am
6sodium 7sodium
7 8
8CMakeCache.txt 9CMakeCache.txt
@@ -22,11 +23,32 @@ tags
22 23
23# Object files 24# Object files
24*.o 25*.o
26*.lo
27*.a
25 28
26# Executables 29# Executables
27*.exe 30*.exe
28*.out 31*.out
29*.app 32*.app
33*.swp
34*.la
35
36m4/*
37!m4/pkg.m4
38configure
39configure_aux
40Makefile.in
41aclocal.m4
42config.h*
43config.log
44config.status
45stamp-h1
46autom4te.cache
47libtoxcore.pc
48libtool
49
50.deps
51.libs
30 52
31#netbeans 53#netbeans
32nbproject 54nbproject
diff --git a/.travis.yml b/.travis.yml
index c8b479f8..85b3251e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,7 +27,7 @@ before_script:
27 - sudo apt-get install check 27 - sudo apt-get install check
28 28
29script: 29script:
30 - mkdir build && cd build 30 - mkdir -p build && cd build
31 - cmake .. 31 - cmake ..
32 - make -j3 32 - make -j3
33 - make test 33 - make test
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/AUTHORS
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/ChangeLog
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 00000000..7d1c323b
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,365 @@
1Installation Instructions
2*************************
3
4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
52006, 2007, 2008, 2009 Free Software Foundation, Inc.
6
7 Copying and distribution of this file, with or without modification,
8are permitted in any medium without royalty provided the copyright
9notice and this notice are preserved. This file is offered as-is,
10without warranty of any kind.
11
12Basic Installation
13==================
14
15 Briefly, the shell commands `./configure; make; make install' should
16configure, build, and install this package. The following
17more-detailed instructions are generic; see the `README' file for
18instructions specific to this package. Some packages provide this
19`INSTALL' file but do not implement all of the features documented
20below. The lack of an optional feature in a given package is not
21necessarily a bug. More recommendations for GNU packages can be found
22in *note Makefile Conventions: (standards)Makefile Conventions.
23
24 The `configure' shell script attempts to guess correct values for
25various system-dependent variables used during compilation. It uses
26those values to create a `Makefile' in each directory of the package.
27It may also create one or more `.h' files containing system-dependent
28definitions. Finally, it creates a shell script `config.status' that
29you can run in the future to recreate the current configuration, and a
30file `config.log' containing compiler output (useful mainly for
31debugging `configure').
32
33 It can also use an optional file (typically called `config.cache'
34and enabled with `--cache-file=config.cache' or simply `-C') that saves
35the results of its tests to speed up reconfiguring. Caching is
36disabled by default to prevent problems with accidental use of stale
37cache files.
38
39 If you need to do unusual things to compile the package, please try
40to figure out how `configure' could check whether to do them, and mail
41diffs or instructions to the address given in the `README' so they can
42be considered for the next release. If you are using the cache, and at
43some point `config.cache' contains results you don't want to keep, you
44may remove or edit it.
45
46 The file `configure.ac' (or `configure.in') is used to create
47`configure' by a program called `autoconf'. You need `configure.ac' if
48you want to change it or regenerate `configure' using a newer version
49of `autoconf'.
50
51 The simplest way to compile this package is:
52
53 1. `cd' to the directory containing the package's source code and type
54 `./configure' to configure the package for your system.
55
56 Running `configure' might take a while. While running, it prints
57 some messages telling which features it is checking for.
58
59 2. Type `make' to compile the package.
60
61 3. Optionally, type `make check' to run any self-tests that come with
62 the package, generally using the just-built uninstalled binaries.
63
64 4. Type `make install' to install the programs and any data files and
65 documentation. When installing into a prefix owned by root, it is
66 recommended that the package be configured and built as a regular
67 user, and only the `make install' phase executed with root
68 privileges.
69
70 5. Optionally, type `make installcheck' to repeat any self-tests, but
71 this time using the binaries in their final installed location.
72 This target does not install anything. Running this target as a
73 regular user, particularly if the prior `make install' required
74 root privileges, verifies that the installation completed
75 correctly.
76
77 6. You can remove the program binaries and object files from the
78 source code directory by typing `make clean'. To also remove the
79 files that `configure' created (so you can compile the package for
80 a different kind of computer), type `make distclean'. There is
81 also a `make maintainer-clean' target, but that is intended mainly
82 for the package's developers. If you use it, you may have to get
83 all sorts of other programs in order to regenerate files that came
84 with the distribution.
85
86 7. Often, you can also type `make uninstall' to remove the installed
87 files again. In practice, not all packages have tested that
88 uninstallation works correctly, even though it is required by the
89 GNU Coding Standards.
90
91 8. Some packages, particularly those that use Automake, provide `make
92 distcheck', which can by used by developers to test that all other
93 targets like `make install' and `make uninstall' work correctly.
94 This target is generally not run by end users.
95
96Compilers and Options
97=====================
98
99 Some systems require unusual options for compilation or linking that
100the `configure' script does not know about. Run `./configure --help'
101for details on some of the pertinent environment variables.
102
103 You can give `configure' initial values for configuration parameters
104by setting variables in the command line or in the environment. Here
105is an example:
106
107 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
108
109 *Note Defining Variables::, for more details.
110
111Compiling For Multiple Architectures
112====================================
113
114 You can compile the package for more than one kind of computer at the
115same time, by placing the object files for each architecture in their
116own directory. To do this, you can use GNU `make'. `cd' to the
117directory where you want the object files and executables to go and run
118the `configure' script. `configure' automatically checks for the
119source code in the directory that `configure' is in and in `..'. This
120is known as a "VPATH" build.
121
122 With a non-GNU `make', it is safer to compile the package for one
123architecture at a time in the source code directory. After you have
124installed the package for one architecture, use `make distclean' before
125reconfiguring for another architecture.
126
127 On MacOS X 10.5 and later systems, you can create libraries and
128executables that work on multiple system types--known as "fat" or
129"universal" binaries--by specifying multiple `-arch' options to the
130compiler but only a single `-arch' option to the preprocessor. Like
131this:
132
133 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
134 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
135 CPP="gcc -E" CXXCPP="g++ -E"
136
137 This is not guaranteed to produce working output in all cases, you
138may have to build one architecture at a time and combine the results
139using the `lipo' tool if you have problems.
140
141Installation Names
142==================
143
144 By default, `make install' installs the package's commands under
145`/usr/local/bin', include files under `/usr/local/include', etc. You
146can specify an installation prefix other than `/usr/local' by giving
147`configure' the option `--prefix=PREFIX', where PREFIX must be an
148absolute file name.
149
150 You can specify separate installation prefixes for
151architecture-specific files and architecture-independent files. If you
152pass the option `--exec-prefix=PREFIX' to `configure', the package uses
153PREFIX as the prefix for installing programs and libraries.
154Documentation and other data files still use the regular prefix.
155
156 In addition, if you use an unusual directory layout you can give
157options like `--bindir=DIR' to specify different values for particular
158kinds of files. Run `configure --help' for a list of the directories
159you can set and what kinds of files go in them. In general, the
160default for these options is expressed in terms of `${prefix}', so that
161specifying just `--prefix' will affect all of the other directory
162specifications that were not explicitly provided.
163
164 The most portable way to affect installation locations is to pass the
165correct locations to `configure'; however, many packages provide one or
166both of the following shortcuts of passing variable assignments to the
167`make install' command line to change installation locations without
168having to reconfigure or recompile.
169
170 The first method involves providing an override variable for each
171affected directory. For example, `make install
172prefix=/alternate/directory' will choose an alternate location for all
173directory configuration variables that were expressed in terms of
174`${prefix}'. Any directories that were specified during `configure',
175but not in terms of `${prefix}', must each be overridden at install
176time for the entire installation to be relocated. The approach of
177makefile variable overrides for each directory variable is required by
178the GNU Coding Standards, and ideally causes no recompilation.
179However, some platforms have known limitations with the semantics of
180shared libraries that end up requiring recompilation when using this
181method, particularly noticeable in packages that use GNU Libtool.
182
183 The second method involves providing the `DESTDIR' variable. For
184example, `make install DESTDIR=/alternate/directory' will prepend
185`/alternate/directory' before all installation names. The approach of
186`DESTDIR' overrides is not required by the GNU Coding Standards, and
187does not work on platforms that have drive letters. On the other hand,
188it does better at avoiding recompilation issues, and works well even
189when some directory options were not specified in terms of `${prefix}'
190at `configure' time.
191
192Optional Features
193=================
194
195 If the package supports it, you can cause programs to be installed
196with an extra prefix or suffix on their names by giving `configure' the
197option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
198
199 Some packages pay attention to `--enable-FEATURE' options to
200`configure', where FEATURE indicates an optional part of the package.
201They may also pay attention to `--with-PACKAGE' options, where PACKAGE
202is something like `gnu-as' or `x' (for the X Window System). The
203`README' should mention any `--enable-' and `--with-' options that the
204package recognizes.
205
206 For packages that use the X Window System, `configure' can usually
207find the X include and library files automatically, but if it doesn't,
208you can use the `configure' options `--x-includes=DIR' and
209`--x-libraries=DIR' to specify their locations.
210
211 Some packages offer the ability to configure how verbose the
212execution of `make' will be. For these packages, running `./configure
213--enable-silent-rules' sets the default to minimal output, which can be
214overridden with `make V=1'; while running `./configure
215--disable-silent-rules' sets the default to verbose, which can be
216overridden with `make V=0'.
217
218Particular systems
219==================
220
221 On HP-UX, the default C compiler is not ANSI C compatible. If GNU
222CC is not installed, it is recommended to use the following options in
223order to use an ANSI C compiler:
224
225 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
226
227and if that doesn't work, install pre-built binaries of GCC for HP-UX.
228
229 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
230parse its `<wchar.h>' header file. The option `-nodtk' can be used as
231a workaround. If GNU CC is not installed, it is therefore recommended
232to try
233
234 ./configure CC="cc"
235
236and if that doesn't work, try
237
238 ./configure CC="cc -nodtk"
239
240 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
241directory contains several dysfunctional programs; working variants of
242these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
243in your `PATH', put it _after_ `/usr/bin'.
244
245 On Haiku, software installed for all users goes in `/boot/common',
246not `/usr/local'. It is recommended to use the following options:
247
248 ./configure --prefix=/boot/common
249
250Specifying the System Type
251==========================
252
253 There may be some features `configure' cannot figure out
254automatically, but needs to determine by the type of machine the package
255will run on. Usually, assuming the package is built to be run on the
256_same_ architectures, `configure' can figure that out, but if it prints
257a message saying it cannot guess the machine type, give it the
258`--build=TYPE' option. TYPE can either be a short name for the system
259type, such as `sun4', or a canonical name which has the form:
260
261 CPU-COMPANY-SYSTEM
262
263where SYSTEM can have one of these forms:
264
265 OS
266 KERNEL-OS
267
268 See the file `config.sub' for the possible values of each field. If
269`config.sub' isn't included in this package, then this package doesn't
270need to know the machine type.
271
272 If you are _building_ compiler tools for cross-compiling, you should
273use the option `--target=TYPE' to select the type of system they will
274produce code for.
275
276 If you want to _use_ a cross compiler, that generates code for a
277platform different from the build platform, you should specify the
278"host" platform (i.e., that on which the generated programs will
279eventually be run) with `--host=TYPE'.
280
281Sharing Defaults
282================
283
284 If you want to set default values for `configure' scripts to share,
285you can create a site shell script called `config.site' that gives
286default values for variables like `CC', `cache_file', and `prefix'.
287`configure' looks for `PREFIX/share/config.site' if it exists, then
288`PREFIX/etc/config.site' if it exists. Or, you can set the
289`CONFIG_SITE' environment variable to the location of the site script.
290A warning: not all `configure' scripts look for a site script.
291
292Defining Variables
293==================
294
295 Variables not defined in a site shell script can be set in the
296environment passed to `configure'. However, some packages may run
297configure again during the build, and the customized values of these
298variables may be lost. In order to avoid this problem, you should set
299them in the `configure' command line, using `VAR=value'. For example:
300
301 ./configure CC=/usr/local2/bin/gcc
302
303causes the specified `gcc' to be used as the C compiler (unless it is
304overridden in the site shell script).
305
306Unfortunately, this technique does not work for `CONFIG_SHELL' due to
307an Autoconf bug. Until the bug is fixed you can use this workaround:
308
309 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
310
311`configure' Invocation
312======================
313
314 `configure' recognizes the following options to control how it
315operates.
316
317`--help'
318`-h'
319 Print a summary of all of the options to `configure', and exit.
320
321`--help=short'
322`--help=recursive'
323 Print a summary of the options unique to this package's
324 `configure', and exit. The `short' variant lists options used
325 only in the top level, while the `recursive' variant lists options
326 also present in any nested packages.
327
328`--version'
329`-V'
330 Print the version of Autoconf used to generate the `configure'
331 script, and exit.
332
333`--cache-file=FILE'
334 Enable the cache: use and save the results of the tests in FILE,
335 traditionally `config.cache'. FILE defaults to `/dev/null' to
336 disable caching.
337
338`--config-cache'
339`-C'
340 Alias for `--cache-file=config.cache'.
341
342`--quiet'
343`--silent'
344`-q'
345 Do not print messages saying which checks are being made. To
346 suppress all normal output, redirect it to `/dev/null' (any error
347 messages will still be shown).
348
349`--srcdir=DIR'
350 Look for the package's source code in directory DIR. Usually
351 `configure' can determine that directory automatically.
352
353`--prefix=DIR'
354 Use DIR as the installation prefix. *note Installation Names::
355 for more details, including other options available for fine-tuning
356 the installation locations.
357
358`--no-create'
359`-n'
360 Run the configure checks, but stop before creating any output
361 files.
362
363`configure' also accepts some other, not widely useful, options. Run
364`configure --help' for more details.
365
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 00000000..7bead885
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,31 @@
1SUBDIRS = build
2
3ACLOCAL_AMFLAGS = -I m4
4
5pkgconfigdir = $(libdir)/pkgconfig
6pkgconfig_DATA = $(top_srcdir)/libtoxcore.pc
7
8BUILT_SOURCES = $(top_srcdir)/libtoxcore.pc
9CLEANFILES = $(top_srcdir)/libtoxcore.pc
10
11
12EXTRA_DIST = \
13 $(top_srcdir)/libtoxcore.pc.in \
14 $(top_srcdir)/cmake/FindCheck.cmake \
15 $(top_srcdir)/cmake/FindLIBCONFIG.cmake \
16 $(top_srcdir)/cmake/FindSphinx.cmake \
17 $(top_srcdir)/cmake/FindSODIUM.cmake \
18 $(top_srcdir)/cmake/FindNaCl.cmake \
19 $(top_srcdir)/cmake/FindCursesw.cmake \
20 $(top_srcdir)/docs/CMakeLists.txt \
21 $(top_srcdir)/docs/commands.rst \
22 $(top_srcdir)/docs/conf.py.in \
23 $(top_srcdir)/docs/index.rst \
24 $(top_srcdir)/docs/install.rst \
25 $(top_srcdir)/docs/start_guide.de.rst \
26 $(top_srcdir)/docs/start_guide.rst \
27 $(top_srcdir)/CMakeLists.txt \
28 $(top_srcdir)/tools/README \
29 $(top_srcdir)/tools/astylerc \
30 $(top_srcdir)/tools/pre-commit
31
diff --git a/NEWS b/NEWS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 120000
index 00000000..42061c01
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
README.md \ No newline at end of file
diff --git a/auto_tests/Makefile.inc b/auto_tests/Makefile.inc
new file mode 100644
index 00000000..c15f1089
--- /dev/null
+++ b/auto_tests/Makefile.inc
@@ -0,0 +1,39 @@
1if BUILD_TESTS
2
3TESTS = messenger_autotest crypto_test
4
5check_PROGRAMS = messenger_autotest crypto_test
6
7messenger_autotest_SOURCES = \
8 $(top_srcdir)/auto_tests/messenger_test.c
9
10messenger_autotest_CFLAGS = \
11 $(LIBSODIUM_CFLAGS) \
12 $(CHECK_CFLAGS)
13
14messenger_autotest_LDADD = \
15 $(LIBSODIUM_LDFLAGS) \
16 libtoxcore.la \
17 $(LIBSODIUM_LIBS) \
18 $(CHECK_LIBS)
19
20
21crypto_test_SOURCES = $(top_srcdir)/auto_tests/crypto_test.c
22
23crypto_test_CFLAGS = $(LIBSODIUM_CFLAGS) \
24 $(CHECK_CFLAGS)
25
26crypto_test_LDADD = $(LIBSODIUM_LDFLAGS) \
27 libtoxcore.la \
28 $(LIBSODIUM_LIBS) \
29 $(CHECK_LIBS)
30
31endif
32
33EXTRA_DIST += $(top_srcdir)/auto_tests/CMakeLists.txt \
34 $(top_srcdir)/auto_tests/run_tests \
35 $(top_srcdir)/auto_tests/cmake/messenger_test.cmake \
36 $(top_srcdir)/auto_tests/cmake/crypto_test.cmake \
37 $(top_srcdir)/auto_tests/cmake/friends_test.cmake \
38 $(top_srcdir)/auto_tests/friends_test.c
39
diff --git a/build/Makefile.am b/build/Makefile.am
new file mode 100644
index 00000000..5cc735f9
--- /dev/null
+++ b/build/Makefile.am
@@ -0,0 +1,10 @@
1bin_PROGRAMS =
2noinst_PROGRAMS =
3noinst_bindir = $(top_builddir)/build
4EXTRA_DIST=
5
6include $(top_srcdir)/toxcore/Makefile.inc
7include $(top_srcdir)/other/Makefile.inc
8include $(top_srcdir)/testing/Makefile.inc
9include $(top_srcdir)/other/bootstrap_serverdaemon/Makefile.inc
10include $(top_srcdir)/auto_tests/Makefile.inc
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 00000000..248d87da
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,336 @@
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.65])
5AC_INIT([tox], [0.0.0], [http://tox.im])
6AC_CONFIG_AUX_DIR(configure_aux)
7AC_CONFIG_SRCDIR([toxcore/net_crypto.c])
8AC_CONFIG_HEADERS([config.h])
9AM_INIT_AUTOMAKE([1.10 -Wall])
10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11AC_CONFIG_MACRO_DIR([m4])
12
13if test "x${prefix}" = "xNONE"; then
14 prefix="${ac_default_prefix}"
15fi
16
17BUILD_DHT_BOOTSTRAP_DAEMON="yes"
18BUILD_NTOX="yes"
19BUILD_TESTS="yes"
20
21NCURSES_FOUND="no"
22LIBCONFIG_FOUND="no"
23LIBCHECK_FOUND="no"
24
25AC_ARG_ENABLE([tests],
26 [AC_HELP_STRING([--disable-tests], [build unit tests (default: auto)]) ],
27 [
28 if test "x$enableval" = "xno"; then
29 BUILD_TESTS="no"
30 elif test "x$enableval" = "xyes"; then
31 BUILD_TESTS="yes"
32 fi
33 ]
34)
35
36AC_ARG_ENABLE([ntox],
37 [AC_HELP_STRING([--disable-ntox], [build nTox client (default: auto)]) ],
38 [
39 if test "x$enableval" = "xno"; then
40 BUILD_NTOX="no"
41 elif test "x$enableval" = "xyes"; then
42 BUILD_NTOX="yes"
43 fi
44 ]
45)
46
47AC_ARG_ENABLE([dht-bootstrap-daemon],
48 [AC_HELP_STRING([--disable-dht-boostrap-daemon], [build DHT bootstrap daemon (default: auto)]) ],
49 [
50 if test "x$enableval" = "xno"; then
51 BUILD_DHT_BOOTSTRAP_DAEMON="no"
52 elif test "x$enableval" = "xyes"; then
53 BUILD_DHT_BOOTSTRAP_DAEMON="yes"
54 fi
55 ]
56)
57
58DEPSEARCH=
59LIBSODIUM_SEARCH_HEADERS=
60LIBSODIUM_SEARCH_LIBS=
61
62AC_ARG_WITH(dependency-search,
63 AC_HELP_STRING([--with-dependency-search=DIR],
64 [search for dependencies in DIR, i.e. look for libraries in
65 DIR/lib and for headers in DIR/include]),
66 [
67 DEPSEARCH="$withval"
68 ]
69)
70
71if test -n "$DEPSEARCH"; then
72 CFLAGS="$CFLAGS -I$DEPSEARCH/include"
73 CPPFLAGS="$CPPFLAGS -I$DEPSEARCH/include"
74 LDFLAGS="$LDFLAGS -L$DEPSEARCH/lib"
75 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$DEPSEARCH/lib/pkgconfig
76fi
77
78AC_ARG_WITH(libsodium-headers,
79 AC_HELP_STRING([--with-libsodium-headers=DIR],
80 [search for libsodium header files in DIR]),
81 [
82 LIBSODIUM_SEARCH_HEADERS="$withval"
83 AC_MSG_NOTICE([Will search for libsodium header files in $withval])
84 ]
85)
86
87AC_ARG_WITH(libsodium-libs,
88 AC_HELP_STRING([--with-libsodium-libs=DIR],
89 [search for libsodium libraries in DIR]),
90 [
91 LIBSODIUM_SEARCH_LIBS="$withval"
92 AC_MSG_NOTICE([Will search for libsodium libraries in $withval])
93 ]
94)
95
96# Checks for programs.
97AC_PROG_CC
98AM_PROG_CC_C_O
99AC_PROG_LIBTOOL
100
101WIN32=no
102AC_CANONICAL_HOST
103case $host_os in
104 *mingw*)
105 WIN32="yes"
106 AC_MSG_WARN([nTox is not supported on $host_os yet, disabling])
107 BUILD_NTOX="no"
108 ;;
109 *solaris*)
110 LIBS="$LIBS -lssp -lsocket -lnsl"
111 ;;
112esac
113AM_CONDITIONAL(WIN32, test "x$WIN32" = "xyes")
114
115# Checks for libraries.
116LIBSODIUM_LIBS=
117LIBSODIUM_LDFLAGS=
118LDFLAGS_SAVE="$LDFLAGS"
119if test -n "$LIBSODIUM_SEARCH_LIBS"; then
120 LDFLAGS="-L$LIBSODIUM_SEARCH_LIBS $LDFLAGS"
121 AC_CHECK_LIB(sodium, randombytes_random,
122 [
123 LIBSODIUM_LDFLAGS="-L$LIBSODIUM_SEARCH_LIBS"
124 LIBSODIUM_LIBS="-lsodium"
125 ],
126 [
127 AC_MSG_ERROR([required library libsodium was not found in requested location $LIBSODIUM_SEARCH_LIBS])
128 ]
129 )
130else
131 AC_CHECK_LIB(sodium, randombytes_random,
132 [],
133 [
134 AC_MSG_ERROR([required library libsodium was not found on your system, please check http://download.libsodium.org/libsodium/releases/])
135 ]
136 )
137fi
138
139LDFLAGS="$LDFLAGS_SAVE"
140AC_SUBST(LIBSODIUM_LIBS)
141AC_SUBST(LIBSODIUM_LDFLAGS)
142
143# Checks for header files.
144AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
145
146LIBSODIUM_CFLAGS=
147CFLAGS_SAVE="$CFLAGS"
148CPPFLAGS_SAVE="$CPPFLAGS"
149if test -n "$LIBSODIUM_SEARCH_HEADERS"; then
150 CFLAGS="-I$LIBSODIUM_SEARCH_HEADERS $CFLAGS"
151 CPPFLAGS="-I$LIBSODIUM_SEARCH_HEADERS $CPPFLAGS"
152 AC_CHECK_HEADER(sodium.h,
153 [
154 LIBSODIUM_CFLAGS="-I$LIBSODIUM_SEARCH_HEADERS"
155 ],
156 [
157 AC_MSG_ERROR([header files for required library libsodium was not found in requested location $LIBSODIUM_SEARCH_HEADERS])
158 ]
159 )
160else
161 AC_CHECK_HEADER(sodium.h,
162 [],
163 [
164 AC_MSG_ERROR([header files for required library libsodium was not found on your system, please check http://download.libsodium.org/libsodium/releases/])
165 ]
166 )
167fi
168CFLAGS="$CFLAGS_SAVE"
169CPPFLAGS="$CPPFLAGS_SAVE"
170AC_SUBST(LIBSODIUM_CFLAGS)
171
172# Checks for typedefs, structures, and compiler characteristics.
173AC_HEADER_STDBOOL
174AC_TYPE_INT16_T
175AC_TYPE_INT32_T
176AC_TYPE_PID_T
177AC_TYPE_SIZE_T
178AC_TYPE_UINT16_T
179AC_TYPE_UINT32_T
180AC_TYPE_UINT64_T
181AC_TYPE_UINT8_T
182
183# Checks for library functions.
184AC_FUNC_FORK
185AC_FUNC_MALLOC
186AC_FUNC_REALLOC
187AC_CHECK_FUNCS([gettimeofday memset socket strchr])
188
189# pkg-config based tests
190PKG_PROG_PKG_CONFIG
191
192if test -n "$PKG_CONFIG"; then
193 if test "x$BUILD_TESTS" = "xyes"; then
194 PKG_CHECK_MODULES([CHECK], [check],
195 [
196 LIBCHECK_FOUND="yes"
197 ],
198 [
199 AC_MSG_WARN([libcheck not found, not building unit tests: $CHECK_PKG_ERRORS])
200 BUILD_TESTS="no"
201 ])
202 fi
203
204 if test "x$BUILD_DHT_BOOTSTRAP_DAEMON" = "xyes"; then
205 PKG_CHECK_MODULES([LIBCONFIG], [libconfig >= 1.4.6],
206 [
207 LIBCONFIG_FOUND="yes"
208 ],
209 [
210 AC_MSG_WARN([$LIBCONFIG_PKG_ERRORS])
211 AC_MSG_WARN([libconfig not available, will not build DHT botstrap daemon])
212 BUILD_DHT_BOOTSTRAP_DAEMON="no"
213 ])
214 fi
215
216 if test "x$BUILD_NTOX" = "xyes"; then
217 PKG_CHECK_MODULES([NCURSES], [ncurses],
218 [
219 NCURSES_FOUND="yes"
220 ],
221 [
222 AC_MSG_WARN([$NCURSES_PKG_ERRORS])
223 ])
224 fi
225else
226 AC_MSG_WARN([pkg-config was not found on your sytem])
227fi
228
229if (test "x$BUILD_NTOX" = "xyes") && (test "x$NCURSES_FOUND" != "xyes"); then
230 AC_PATH_PROG([CURSES_CONFIG], [ncurses5-config], [no])
231 if test "x$CURSES_CONFIG" != "xno"; then
232 AC_MSG_CHECKING(ncurses cflags)
233 NCURSES_CFLAGS=`${CURSES_CONFIG} --cflags`
234 AC_MSG_RESULT($NCURSES_CFLAGS)
235
236 AC_MSG_CHECKING(ncurses libraries)
237 NCURSES_LIBS=`${CURSES_CONFIG} --libs`
238 AC_MSG_RESULT($NCURSES_LIBS)
239
240 AC_SUBST(NCURSES_CFLAGS)
241 AC_SUBST(NCURSES_LIBS)
242 NCURSES_FOUND="yes"
243 fi
244
245 if test "x$NCURSES_FOUND" != "xyes"; then
246 AC_CHECK_HEADER([curses.h],
247 [],
248 [
249 AC_MSG_WARN([not building nTox client because headers for the curses library were not found on your system])
250 BUILD_NTOX="no"
251 ]
252 )
253 if test "x$BUILD_NTOX" = "xyes"; then
254 AC_CHECK_LIB([ncurses], [clear],
255 [],
256 [
257 unset ac_cv_lib_ncurses_clear
258 AC_CHECK_LIB([ncurses], [clear],
259 [],
260 [
261 AC_MSG_WARN([not building nTox client because required library ncurses was not found on your system])
262 BUILD_NTOX="no"
263 ],
264 [
265 -ltinfo
266 ]
267 )
268 ]
269 )
270 fi
271 fi
272fi
273
274if (test "x$BUILD_DHT_BOOTSTRAP_DAEMON" = "xyes") && \
275 (test "x$LIBCONFIG_FOUND" = "xno"); then
276 AC_CHECK_HEADER(libconfig.h,
277 [],
278 [
279 AC_MSG_WARN([header files for library libconfig was not found on your system, not building DHT bootstrap daemon])
280 BUILD_DHT_BOOTSTRAP_DAEMON="no"
281 ]
282 )
283
284 if test "x$BUILD_DHT_BOOTSTRAP_DAEMON" = "xyes"; then
285 AC_CHECK_LIB(config, config_read,
286 [],
287 [
288 AC_MSG_WARN([library libconfig was not found on the system])
289 BUILD_DHT_BOOTSTRAP_DAEMON="no"
290 ]
291 )
292 fi
293fi
294
295if (test "x$BUILD_TESTS" = "xyes") && (test "x$LIBCHECK_FOUND" = "xno"); then
296 AC_CHECK_HEADER([check.h],
297 [],
298 [
299 AC_MSG_WARN([header file for check library was not found on your system, unit tests will be disabled])
300 BUILD_TESTS="no"
301 ]
302 )
303
304 if test "x$BUILD_TESTS" = "xyes"; then
305 AC_CHECK_LIB([check], [suite_create],
306 [],
307 [
308 AC_MSG_WARN([library check was not found on the system, unit tests will be disabled])
309 BUILD_TESTS="no"
310 ]
311 )
312 fi
313fi
314
315if test "x$WIN32" = "xyes"; then
316 AC_CHECK_LIB(ws2_32, main,
317 [
318 WINSOCK2_LIBS="-lws2_32"
319 AC_SUBST(WINSOCK2_LIBS)
320 ],
321 [
322 AC_MSG_ERROR([required library was not found on the system, please check your MinGW installation])
323 ]
324 )
325fi
326
327AM_CONDITIONAL(BUILD_DHT_BOOTSTRAP_DAEMON, test "x$BUILD_DHT_BOOTSTRAP_DAEMON" = "xyes")
328
329AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
330AM_CONDITIONAL(BUILD_NTOX, test "x$BUILD_NTOX" = "xyes")
331
332AC_CONFIG_FILES([Makefile
333 build/Makefile
334 libtoxcore.pc
335 ])
336AC_OUTPUT
diff --git a/libtoxcore.pc.in b/libtoxcore.pc.in
new file mode 100644
index 00000000..7286f43b
--- /dev/null
+++ b/libtoxcore.pc.in
@@ -0,0 +1,12 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@
5
6Name: libtoxcore
7Description: Tox protocol library
8Requires:
9Version: @PACKAGE_VERSION@
10Libs: -L${libdir} -ltoxcore @LIBS@
11Cflags: -I${includedir}/tox
12
diff --git a/m4/pkg.m4 b/m4/pkg.m4
new file mode 100644
index 00000000..f26f84c9
--- /dev/null
+++ b/m4/pkg.m4
@@ -0,0 +1,199 @@
1# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
2# serial 1 (pkg-config-0.24)
3#
4# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19#
20# As a special exception to the GNU General Public License, if you
21# distribute this file as part of a program that contains a
22# configuration script generated by Autoconf, you may include it under
23# the same distribution terms that you use for the rest of that program.
24
25# PKG_PROG_PKG_CONFIG([MIN-VERSION])
26# ----------------------------------
27AC_DEFUN([PKG_PROG_PKG_CONFIG],
28[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
29m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
30m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
31AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
32AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
33AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
34
35if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
36 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
37fi
38if test -n "$PKG_CONFIG"; then
39 _pkg_min_version=m4_default([$1], [0.9.0])
40 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
41 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
42 AC_MSG_RESULT([yes])
43 else
44 AC_MSG_RESULT([no])
45 PKG_CONFIG=""
46 fi
47fi[]dnl
48])# PKG_PROG_PKG_CONFIG
49
50# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
51#
52# Check to see whether a particular set of modules exists. Similar
53# to PKG_CHECK_MODULES(), but does not set variables or print errors.
54#
55# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
56# only at the first occurence in configure.ac, so if the first place
57# it's called might be skipped (such as if it is within an "if", you
58# have to call PKG_CHECK_EXISTS manually
59# --------------------------------------------------------------
60AC_DEFUN([PKG_CHECK_EXISTS],
61[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
62if test -n "$PKG_CONFIG" && \
63 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
64 m4_default([$2], [:])
65m4_ifvaln([$3], [else
66 $3])dnl
67fi])
68
69# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
70# ---------------------------------------------
71m4_define([_PKG_CONFIG],
72[if test -n "$$1"; then
73 pkg_cv_[]$1="$$1"
74 elif test -n "$PKG_CONFIG"; then
75 PKG_CHECK_EXISTS([$3],
76 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
77 test "x$?" != "x0" && pkg_failed=yes ],
78 [pkg_failed=yes])
79 else
80 pkg_failed=untried
81fi[]dnl
82])# _PKG_CONFIG
83
84# _PKG_SHORT_ERRORS_SUPPORTED
85# -----------------------------
86AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
87[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
88if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
89 _pkg_short_errors_supported=yes
90else
91 _pkg_short_errors_supported=no
92fi[]dnl
93])# _PKG_SHORT_ERRORS_SUPPORTED
94
95
96# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
97# [ACTION-IF-NOT-FOUND])
98#
99#
100# Note that if there is a possibility the first call to
101# PKG_CHECK_MODULES might not happen, you should be sure to include an
102# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
103#
104#
105# --------------------------------------------------------------
106AC_DEFUN([PKG_CHECK_MODULES],
107[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
108AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
109AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
110
111pkg_failed=no
112AC_MSG_CHECKING([for $1])
113
114_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
115_PKG_CONFIG([$1][_LIBS], [libs], [$2])
116
117m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
118and $1[]_LIBS to avoid the need to call pkg-config.
119See the pkg-config man page for more details.])
120
121if test $pkg_failed = yes; then
122 AC_MSG_RESULT([no])
123 _PKG_SHORT_ERRORS_SUPPORTED
124 if test $_pkg_short_errors_supported = yes; then
125 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
126 else
127 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
128 fi
129 # Put the nasty error message in config.log where it belongs
130 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
131
132 m4_default([$4], [AC_MSG_ERROR(
133[Package requirements ($2) were not met:
134
135$$1_PKG_ERRORS
136
137Consider adjusting the PKG_CONFIG_PATH environment variable if you
138installed software in a non-standard prefix.
139
140_PKG_TEXT])[]dnl
141 ])
142elif test $pkg_failed = untried; then
143 AC_MSG_RESULT([no])
144 m4_default([$4], [AC_MSG_FAILURE(
145[The pkg-config script could not be found or is too old. Make sure it
146is in your PATH or set the PKG_CONFIG environment variable to the full
147path to pkg-config.
148
149_PKG_TEXT
150
151To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
152 ])
153else
154 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
155 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
156 AC_MSG_RESULT([yes])
157 $3
158fi[]dnl
159])# PKG_CHECK_MODULES
160
161
162# PKG_INSTALLDIR(DIRECTORY)
163# -------------------------
164# Substitutes the variable pkgconfigdir as the location where a module
165# should install pkg-config .pc files. By default the directory is
166# $libdir/pkgconfig, but the default can be changed by passing
167# DIRECTORY. The user can override through the --with-pkgconfigdir
168# parameter.
169AC_DEFUN([PKG_INSTALLDIR],
170[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
171m4_pushdef([pkg_description],
172 [pkg-config installation directory @<:@]pkg_default[@:>@])
173AC_ARG_WITH([pkgconfigdir],
174 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
175 [with_pkgconfigdir=]pkg_default)
176AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
177m4_popdef([pkg_default])
178m4_popdef([pkg_description])
179]) dnl PKG_INSTALLDIR
180
181
182# PKG_NOARCH_INSTALLDIR(DIRECTORY)
183# -------------------------
184# Substitutes the variable noarch_pkgconfigdir as the location where a
185# module should install arch-independent pkg-config .pc files. By
186# default the directory is $datadir/pkgconfig, but the default can be
187# changed by passing DIRECTORY. The user can override through the
188# --with-noarch-pkgconfigdir parameter.
189AC_DEFUN([PKG_NOARCH_INSTALLDIR],
190[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
191m4_pushdef([pkg_description],
192 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
193AC_ARG_WITH([noarch-pkgconfigdir],
194 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
195 [with_noarch_pkgconfigdir=]pkg_default)
196AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
197m4_popdef([pkg_default])
198m4_popdef([pkg_description])
199]) dnl PKG_NOARCH_INSTALLDIR
diff --git a/other/Makefile.inc b/other/Makefile.inc
new file mode 100644
index 00000000..4f195e63
--- /dev/null
+++ b/other/Makefile.inc
@@ -0,0 +1,20 @@
1noinst_PROGRAMS += DHT_bootstrap
2
3DHT_bootstrap_SOURCES = $(top_srcdir)/other/DHT_bootstrap.c \
4 $(top_srcdir)/toxcore/DHT.h \
5 $(top_srcdir)/toxcore/friend_requests.h \
6 $(top_srcdir)/testing/misc_tools.h \
7 $(top_srcdir)/testing/misc_tools.c
8
9DHT_bootstrap_CFLAGS = -I$(top_srcdir)/other \
10 $(LIBSODIUM_CFLAGS)
11
12DHT_bootstrap_LDADD = $(LIBSODIUM_LDFLAGS) \
13 libtoxcore.la \
14 $(LIBSODIUM_LIBS) \
15 $(WINSOCK2_LIBS)
16
17EXTRA_DIST += $(top_srcdir)/other/cmake/DHT_bootstrap.cmake \
18 $(top_srcdir)/other/CMakeLists.txt \
19 $(top_srcdir)/other/DHTservers \
20 $(top_srcdir)/other/tox.png
diff --git a/other/bootstrap_serverdaemon/Makefile.inc b/other/bootstrap_serverdaemon/Makefile.inc
new file mode 100644
index 00000000..a04475c5
--- /dev/null
+++ b/other/bootstrap_serverdaemon/Makefile.inc
@@ -0,0 +1,27 @@
1if BUILD_DHT_BOOTSTRAP_DAEMON
2
3noinst_PROGRAMS += DHT_bootstrap_daemon
4
5DHT_bootstrap_daemon_SOURCES = \
6 $(top_srcdir)/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c
7
8DHT_bootstrap_daemon_CFLAGS = \
9 -I$(top_srcdir)/other/bootstrap_serverdaemon \
10 $(LIBSODIUM_CFLAGS) \
11 $(LIBCONFIG_CFLAGS)
12
13DHT_bootstrap_daemon_LDADD = \
14 $(LIBSODIUM_LDFLAGS) \
15 libtoxcore.la \
16 $(LIBCONFIG_LIBS) \
17 $(LIBSODIUM_LIBS)
18
19endif
20
21EXTRA_DIST += \
22 $(top_srcdir)/other/bootstrap_serverdaemon/server.cfg \
23 $(top_srcdir)/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.sh \
24 $(top_srcdir)/other/bootstrap_serverdaemon/cmake/Modules \
25 $(top_srcdir)/other/bootstrap_serverdaemon/cmake/Modules/FindLibConfig.cmake \
26 $(top_srcdir)/other/bootstrap_serverdaemon/cmake/Modules/FindLibConfig.cmake \
27 $(top_srcdir)/other/bootstrap_serverdaemon/CMakeLists.txt
diff --git a/testing/Makefile.inc b/testing/Makefile.inc
new file mode 100644
index 00000000..28604958
--- /dev/null
+++ b/testing/Makefile.inc
@@ -0,0 +1,97 @@
1if BUILD_NTOX
2
3bin_PROGRAMS += nTox
4
5nTox_SOURCES = $(top_srcdir)/testing/misc_tools.h \
6 $(top_srcdir)/testing/misc_tools.c \
7 $(top_srcdir)/testing/nTox.h \
8 $(top_srcdir)/testing/nTox.c
9
10nTox_CFLAGS = $(LIBSODIUM_CFLAGS) \
11 $(NCURSES_CFLAGS)
12
13nTox_LDADD = $(LIBSODIUM_LDFLAGS) \
14 libtoxcore.la \
15 $(LIBSODIUM_LIBS) \
16 $(NCURSES_LIBS)
17
18endif
19
20
21noinst_PROGRAMS += DHT_test \
22 Lossless_UDP_testclient \
23 Lossless_UDP_testserver \
24 Messenger_test \
25 crypto_speed_test
26
27DHT_test_SOURCES = $(top_srcdir)/testing/DHT_test.c \
28 $(top_srcdir)/testing/misc_tools.h \
29 $(top_srcdir)/testing/misc_tools.c
30
31DHT_test_CFLAGS = $(LIBSODIUM_CFLAGS)
32
33DHT_test_LDADD = $(LIBSODIUM_LDFLAGS) \
34 libtoxcore.la \
35 $(LIBSODIUM_LIBS) \
36 $(WINSOCK2_LIBS)
37
38
39Lossless_UDP_testclient_SOURCES = \
40 $(top_srcdir)/testing/Lossless_UDP_testclient.c
41
42Lossless_UDP_testclient_CFLAGS = \
43 $(LIBSODIUM_CFLAGS)
44
45Lossless_UDP_testclient_LDADD = \
46 $(LIBSODIUM_LDFLAGS) \
47 libtoxcore.la \
48 $(LIBSODIUM_LIBS) \
49 $(WINSOCK2_LIBS)
50
51
52Lossless_UDP_testserver_SOURCES = \
53 $(top_srcdir)/testing/Lossless_UDP_testserver.c
54
55Lossless_UDP_testserver_CFLAGS = \
56 $(LIBSODIUM_CFLAGS)
57
58Lossless_UDP_testserver_LDADD = \
59 $(LIBSODIUM_LDFLAGS) \
60 libtoxcore.la \
61 $(LIBSODIUM_LIBS) \
62 $(WINSOCK2_LIBS)
63
64
65Messenger_test_SOURCES = \
66 $(top_srcdir)/testing/Messenger_test.c \
67 $(top_srcdir)/testing/misc_tools.h \
68 $(top_srcdir)/testing/misc_tools.c
69
70Messenger_test_CFLAGS = $(LIBSODIUM_CFLAGS)
71
72Messenger_test_LDADD = $(LIBSODIUM_LDFLAGS) \
73 libtoxcore.la \
74 $(LIBSODIUM_LIBS) \
75 $(WINSOCK2_LIBS)
76
77
78crypto_speed_test_SOURCES = \
79 $(top_srcdir)/testing/crypto_speed_test.c
80
81crypto_speed_test_CFLAGS = \
82 $(LIBSODIUM_CFLAGS)
83
84crypto_speed_test_LDADD = \
85 $(LIBSODIUM_LDFLAGS) \
86 libtoxcore.la \
87 $(LIBSODIUM_LIBS) \
88 $(WINSOCK2_LIBS)
89
90
91EXTRA_DIST += $(top_srcdir)/testing/cmake/Messenger_test.cmake \
92 $(top_srcdir)/testing/cmake/DHT_test.cmake \
93 $(top_srcdir)/testing/cmake/Lossless_UDP_testclient.cmake \
94 $(top_srcdir)/testing/cmake/Lossless_UDP_testserver.cmake \
95 $(top_srcdir)/testing/cmake/nTox.cmake \
96 $(top_srcdir)/testing/cmake/crypto_speed_test.cmake \
97 $(top_srcdir)/testing/CMakeLists.txt
diff --git a/toxcore/Makefile.inc b/toxcore/Makefile.inc
new file mode 100644
index 00000000..a5b245f5
--- /dev/null
+++ b/toxcore/Makefile.inc
@@ -0,0 +1,42 @@
1LIBTOXCORE_VERSION = 0:0:0
2
3lib_LTLIBRARIES = libtoxcore.la
4
5libtoxcore_la_include_HEADERS = \
6 $(top_srcdir)/toxcore/tox.h
7
8libtoxcore_la_includedir = $(includedir)/tox
9
10libtoxcore_la_SOURCES = $(top_srcdir)/toxcore/DHT.h \
11 $(top_srcdir)/toxcore/DHT.c \
12 $(top_srcdir)/toxcore/network.h \
13 $(top_srcdir)/toxcore/network.c \
14 $(top_srcdir)/toxcore/Lossless_UDP.h \
15 $(top_srcdir)/toxcore/Lossless_UDP.c \
16 $(top_srcdir)/toxcore/net_crypto.h \
17 $(top_srcdir)/toxcore/net_crypto.c \
18 $(top_srcdir)/toxcore/friend_requests.h \
19 $(top_srcdir)/toxcore/friend_requests.c \
20 $(top_srcdir)/toxcore/LAN_discovery.h \
21 $(top_srcdir)/toxcore/LAN_discovery.c \
22 $(top_srcdir)/toxcore/Messenger.h \
23 $(top_srcdir)/toxcore/Messenger.c \
24 $(top_srcdir)/toxcore/packets.h \
25 $(top_srcdir)/toxcore/ping.h \
26 $(top_srcdir)/toxcore/ping.c \
27 $(top_srcdir)/toxcore/tox.h \
28 $(top_srcdir)/toxcore/tox.c \
29 $(top_srcdir)/toxcore/util.h \
30 $(top_srcdir)/toxcore/util.c
31
32libtoxcore_la_CFLAGS = -I$(top_srcdir) \
33 -I$(top_srcdir)/toxcore \
34 $(LIBSODIUM_CFLAGS)
35
36libtoxcore_la_LDFLAGS = -version-info $(LIBTOXCORE_VERSION) \
37 $(LIBSODIUM_LDFLAGS)
38
39libtoxcore_la_LIBS = $(LIBSODIUM_LIBS) \
40 $(WINSOCK2_LIBS)
41
42EXTRA_DIST += $(top_srcdir)/toxcore/CMakeLists.txt