Commit Graph

39 Commits

Author SHA1 Message Date
Andrew Bettison
ca8e846264 Add iOS Framework Bundle build
The new ios/configure script performs a separate ../configure for each of
the following iOS targets:

    iPhoneOS        on armv7
    iPhoneOS        on arm64
    iPhoneSimulator on i386
    iPhoneSimulator on x86_64

The script then creates ios/Makefile that builds a static iOS Framework
Bundle suitable for inclusion in an Xcode iOS project.

Add the --xcode-sdk=SDK option to configure.ac, to support cross
compiling using Apple Xcode.  It prefixes all compile/link toolchain
commands with the "xcrun --sdk SDK" command, ie, CC, AS, LD, AR, RANLIB,
etc.

Re-structure headerfiles.mk to separate "public" from "private" headers,
because the Framework module only exposes the public ones.  Moves the
SQLITE3_AMALGAMATION definition from Makefile.in into headerfiles.mk.

Update INSTALL.md and add a technical document for Apple iOS.

This enables development of Serval DNA within the context of an Xcode
iOS project using the standard edit-make-test cycle: after modifying a
Serval DNA source file, "cd ios; make" will recompile the changed file
for all the target architectures and update the Framework Bundle.
Rebuilding the Xcode project will then incorporate the changes, which
can be tested immediately.
2018-03-06 15:29:29 +10:30
Andrew Bettison
a79156c4d0 Add Swift daemon API, use in 'servaldswift'
The daemon API is built as a Swift module called ServalDNA.

The new CliContext class allows easy implementation of CLI output using
Swift code.  The new CliContextFile subclass is the obvious first
implementation, equivalent to cli_stdio.c.  The 'servaldswift'
executable now uses CliContextFile to print its CLI output to standard
output.

The new delegated log output support constructs each log line in a
buffer and prints it by calling the delegate's 'print' function at
end-of-line.  The 'servaldswift' executable now provides a log output
delegate in Swift that simply prints to standard error, replacing
log_output_console.o, which is omitted from its link.
2018-03-06 15:29:17 +10:30
Andrew Bettison
3ffa4b10af Add Swift keyring client API with tests
Add a swift-client-api subdirectory containing a Swift source package
and a Makefile.in that compiles it into the "ServalClient" Swift module
using the Swift package manager.  The Swift API contains the following
classes:

- ServalKeyring provides the operations: add, remove, set, list
- AbstractId and its specialisation SubscriberId, already in near-final
  form, are data types for SID and the like
- ServalRestfulClient (internal) uses an HTTP client to access the
  Serval DNA RESTful interface

Improve the REST /keyring/set operation to only alter the DID or Name if
the corresponding query parameter is supplied.  Modify the internal
keyring_set_did() function to only assign the DID or Name if the
corresponding parameter is not a null pointer.

The configure script ensures that the Swift build target version is
10.10 or later when compiling for Mac OS-X, so that the package manager
will succeed.

Add autoconf macros for the Swift package manager.
2018-03-06 15:29:17 +10:30
Andrew Bettison
f2eb2bf9ab Add Swift 3/4 'servaldswift' executable
If the Swift 3 or Swift 4 compiler is present or passed to the configure
script in the SWIFTC variable, then the Makefile will compile a Swift
'servaldswift' executable to ensure that the module map links correctly
into a stand-alone Swift program.

Use the gold linker if supported, to avoid relocation errors on symbols
produced by Swift when linking dynamic libraries.
2018-03-06 15:29:17 +10:30
Andrew Bettison
46cfb81967 Configure and build libsodium from subtree
The libsodium source code is now embedded in the Serval DNA sourcecode
as a git subtree, so configure.ac and Makefile.in now recurse into it as
part of the Serval DNA build.

This simplifies the build instructions and eliminates all external
dependencies on libsodium development files and operating system
packages, returning Serval DNA to a self-contained component whose only
external dependencies are standard system libraries.

Remove the build-libsodium.sh script, as it is no longer needed.
2017-09-27 14:49:08 +09:30
Andrew Bettison
e769af0067 Compile Java during make, not during tests
Re-organised all Java source code under the java-api subdirectory, which
also contains a Makefile.in that performs the Java compilation.  This
makefile is only invoked if ./configure finds a working Java compiler.
2016-11-14 11:28:08 +10:30
Andrew Bettison
1efe6686fc Use config.h instead of -DHAVE_FOO=1
swiftc(1) requires every -D option to be prefixed with -Xcc, which
is not easy to achieve using autoconf.

Now instead of setting configuration macros like HAVE_LSEEK64 on the
command line using -D, they are defined in config.h, which is generated
by ./configure, ignored by Git, and included by all headers and source
files that use any configuration macro.

The dependency on Makefile has been replaced with a dependency on
Makefile.in and config.h, which helps avoid some redundant full
recompiles after running ./configure, because the configure script
does not overwrit config.h if its content does not change.
2016-10-19 16:27:20 +10:30
Andrew Bettison
937e402794 Improve build-libsodium.sh
Add the --branch option to specify which libsodium branch to checkout
and build.

Invoke libsodium's autogen.sh script if libsodium's 'configure' script
is not present (eg, on development branches).
2016-10-13 17:00:17 +10:30
Andrew Bettison
29a771e315 Overhaul Makefile.in
Changed the built libraries and updated INSTALL.md accordingly:
- the 'servaldwrap' executable is now built
- libservald.[a,so] now contains the full daemon executable
- libservalclient.[a,so] contains the client library
- libserval.a is no longer built

Building the 'servaldwrap' executable is a step towards ensuring that
the libservald.so library can be linked and executed, without requiring
an Android build to reveal any failure.

Added the SOURCE_PREFIX variable that allows the make to be invoked from
within any current working directory, not just the serval-dna
repository's root directory.

Fixed the serval_version.o target to invoke the version_string.sh
script with the --repository=DIR option, so that the build will work
even if the current working directory is not within the serval-dna
repository.

Re-ordered and added some comments for clarity, and added some missing
.PHONY declarations.
2016-10-13 16:23:09 +10:30
Andrew Bettison
c45e92b731 Fix OS-X build with libsodium
Add a new 'build-libsodium.sh' script and instructions in
doc/Development.md.  Update the configure.in script to check for
libsodium headers and library, and print helpful messages if not
present.
2016-09-12 15:09:41 +09:30
Andrew Bettison
e51189a1c8 Remove aclocal.m4 from version control
Henceforward, aclocal.m4 will be generated by the 'autoreconf' command.

The 'autoreconf -f -i' command may now emit a warning "Unsupported
attribute section, the test may fail" on some systems, but it will still
generate the proper aclocal.m4 and ./configure files.  To suppress this
warning, simply invoke autoreconf with '-I m4' argument:

    autoreconf -f -i -I m4

The INSTALL.md has been updated accordingly, and a new 'Notes for
Developers' technical document added, explaining the use of aclocal and
autoreconf, and documenting that these warning messages are of no
concern.
2016-01-11 18:02:26 +10:30
Jeremy Lakeman
628faaedbf Ignore new test binary 2015-02-06 09:56:36 +10:30
Andrew Bettison
3d537f9645 Improve test framework: test coverage support 2014-06-06 14:47:54 +09:30
Jeremy Lakeman
e835d0230f Stop ignoring .o files 2014-05-29 14:54:18 +09:30
Andrew Bettison
aa670fc8a5 Ignore new objs subdirectories 2014-05-27 04:59:09 +09:30
Jeremy Lakeman
7420f46653 Create new AF_UNIX based network simulator 2014-05-23 10:47:22 +09:30
Andrew Bettison
8e9440860b version_string.sh uses VERSION.txt if not in a Git repo 2014-03-03 15:21:53 +10:30
Andrew Bettison
92253ca97d Revive config_test.c
Move config-dependent code (recvwithttl) from net.c to mdp_net.c (new)

Move log-implementation-independent code from log.c to log_util.c (new)

Build config_test binary in Makefile
2013-11-21 16:05:17 +10:30
Jeremy Lakeman
852c8b235c Build fakeradio with other test binaries 2013-08-19 13:56:19 +09:30
Andrew Bettison
d38ce66c95 Improve test framework: create_file()
New executable in Makefile 'all' target: tfw_createfile.

New str.h function: str_to_ll_scaled().
2012-10-31 18:13:33 +10:30
Jeremy Lakeman
7c73ca7a78 Finish test and implementation of directory service 2012-09-18 12:30:15 +09:30
Jeremy Lakeman
ac8d9b93e6 Add stub directory service 2012-09-14 11:50:45 +09:30
Andrew Bettison
cd35c5e2ae Fix issues arising from new strlcpy.c 2012-08-14 11:23:27 +09:30
Andrew Bettison
d63318cd2f Mop up executable rename from 'dna' to 'servald' 2012-07-30 16:15:42 +09:30
Andrew Bettison
db04f30b08 Ignore test log directory 2012-06-27 17:23:43 +09:30
Andrew Bettison
b82a8c35cd Add other libtool scripts created by libtoolize -i
- needed for ./configure to work on libtool-less platforms
2012-04-24 11:46:35 +09:30
Andrew Bettison
1494172da6 Trival test of dna JNI command line entry point 2012-04-23 18:25:26 +09:30
Daniel O'Connor
1d10ee7ba8 Merge branch 'master' of github.com:servalproject/serval-dna 2012-04-23 16:33:44 +09:30
Daniel O'Connor
63ec1d017b Ignore [g]libtoolize detritus. 2012-04-23 16:33:12 +09:30
Andrew Bettison
87e072f172 Fix <jni.h> detection on Mac OS X 2012-04-23 15:29:26 +09:30
Andrew Bettison
36c7e492e8 Native build now supports JNI code on GNU/Linux
- ./configure detects if javac and JDK are present
- Makefile default target builds libservald.so
- probably doesn't work on Mac OS X (yet)
2012-04-20 16:57:36 +09:30
Andrew Bettison
ce5dc011b8 Split dna bit error tests into separate script
- Put common utility functions into testdefs.sh
 - Add abspath() and realpath() functions to test framework
 - Test framework now executes all tests with working directory in a temporary
   directory, to avoid pollution of caller's working directory
 - Improve test log verbosity
 - Name test log files by test script name
2012-04-10 12:41:15 +09:30
Andrew Bettison
f5acb301d8 Transcribe from ./testdna to new test framework
- testframework.sh is now a very full-featured, creates test.log
 - some tests fail, looks like bugs in dna
2012-04-05 19:47:57 +09:30
Andrew Bettison
c31860986f Get native build working on Debian Linux
- now './autoconf && ./configure && make' will produce ./dna executable
 - added various missing libraries to configure.in
 - fixed nacl CFLAGS and LDFLAGS settings in configure.in
 - make git ignore autoconf and configure detritus
2012-04-03 10:33:21 +09:30
Andrew Bettison
8df5af7a93 Ignore Vim swap files 2012-03-13 16:35:15 +10:30
Daniel O'Connor
a8411edf3f - Use system wide sqlite3 lib via pkg-config
- Remove nacl-gcc-prep, it's now in nacl
- Sort sources and have 1 per line.
- Add missing source files.
- Use naclinc.txt and nacllib.txt generated by nacl/nacl-gcc-prep
- Update ignore file now nacl files don't pollute this directory.
2012-02-27 12:41:48 +10:30
Jeremy Lakeman
ccb86b45e9 Tidy up build process 2011-11-03 11:23:19 +10:30
Jeremy Lakeman
ad53f85f8f Update .gitignore to ignore object files 2011-05-23 21:16:45 +09:30
Jeremy Lakeman
59a0a4a2a0 Build a win32 console exe with VS2008 express 2011-03-30 22:17:11 +10:30