Skip to content

Commit 070f903

Browse files
committed
renamed stub code to match valhalla repo. moved valhalla includes into include dir
1 parent dc8c97e commit 070f903

40 files changed

+1295
-0
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Kevin Kreiser <[email protected]>

COPYING

Whitespace-only changes.

ChangeLog

Whitespace-only changes.

Makefile.am

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
ACLOCAL_AMFLAGS = -I m4
2+
AM_LDFLAGS = @BOOST_LDFLAGS@ @COVERAGE_LDFLAGS@
3+
AM_CPPFLAGS = \
4+
-Iinclude \
5+
@BOOST_CPPFLAGS@
6+
AM_CXXFLAGS = @COVERAGE_CXXFLAGS@
7+
8+
if HAVE_SQLITE3
9+
AM_CPPFLAGS += @SQLITE3_CFLAGS@
10+
endif
11+
12+
LIBTOOL_DEPS = @LIBTOOL_DEPS@
13+
libtool: $(LIBTOOL_DEPS)
14+
$(SHELL) ./config.status libtool
15+
16+
# conditional test coverage
17+
if ENABLE_COVERAGE
18+
.PHONY: clean-coverage
19+
clean-coverage:
20+
-find -name '*.gcda' -exec rm -rf {} \;
21+
-$(LCOV) --directory $(top_builddir) -z
22+
-rm -rf coverage.info coverage/
23+
24+
.PHONY: coverage-report
25+
coverage-report: clean-coverage
26+
-$(MAKE) $(AM_MAKEFLAGS) -k check
27+
$(MAKE) $(AM_MAKEFLAGS) coverage/index.html
28+
29+
coverage.info:
30+
$(LCOV) --directory $(top_builddir) --base-directory $(top_builddir) --no-external --capture --output-file $@ --no-checksum --compat-libtool
31+
32+
coverage/index.html: coverage.info
33+
$(GENHTML) --prefix $(top_builddir) --output-directory $(@D) --title "Test Coverage" --legend --show-details $<
34+
35+
36+
.PHONY: clean-gcno
37+
clean-gcno:
38+
-find -name '*.gcno' -exec rm -rf {} \;
39+
40+
clean-local: clean-coverage clean-gcno
41+
endif
42+
43+
# proto compilation etc
44+
PROTO_FILES = proto/stub_message.proto
45+
BUILT_SOURCES = include/$(PROTO_FILES:.proto=.pb.h) src/$(PROTO_FILES:.proto=.pb.cc)
46+
CLEANFILES = include/$(PROTO_FILES:.proto=.pb.h) src/$(PROTO_FILES:.proto=.pb.cc)
47+
nodist_libvalhalla_la_SOURCES = src/$(PROTO_FILES:.proto=.pb.cc)
48+
#src/proto/%.pb.cc: include/proto/%.pb.h
49+
#include/proto/%.pb.h: proto/%.proto
50+
src/proto/stub_message.pb.cc: include/proto/stub_message.pb.h
51+
include/proto/stub_message.pb.h: proto/stub_message.proto
52+
@echo " PROTOC $<"; mkdir -p src/proto include/proto; @PROTOC_BIN@ -Iproto --cpp_out=src/proto $< && mv src/proto/$(@F) include/proto
53+
54+
# lib valhalla compilation etc
55+
lib_LTLIBRARIES = libvalhalla.la
56+
include_HEADERS = include/valhalla.hpp
57+
libvalhalla_la_SOURCES = \
58+
src/util.cpp
59+
libvalhalla_la_CPPFLAGS = $(DEPS_CFLAGS) $(BOOST_CPPFLAGS)
60+
libvalhalla_la_LIBADD = $(DEPS_LIBS) @PROTOC_LIBS@ @BOOST_PROGRAM_OPTIONS_LIB@
61+
if HAVE_SQLITE3
62+
libvalhalla_la_LIBADD += @SQLITE3_LDFLAGS@
63+
endif
64+
65+
# executable valhalla
66+
bin_PROGRAMS = valhalla
67+
valhalla_SOURCES = \
68+
src/valhalla.cpp
69+
valhalla_CPPFLAGS = $(DEPS_CFLAGS) $(BOOST_CPPFLAGS)
70+
valhalla_LDADD = $(DEPS_LIBS) @BOOST_LDFLAGS@ @BOOST_PROGRAM_OPTIONS_LIB@
71+
72+
# tests
73+
check_PROGRAMS = \
74+
test/valhalla
75+
test_valhalla_SOURCES = test/valhalla.cpp test/test.cpp
76+
test_valhalla_CPPFLAGS = $(DEPS_CFLAGS) $(BOOST_CPPFLAGS)
77+
test_valhalla_LDADD = $(DEPS_LIBS) @BOOST_LDFLAGS@
78+
79+
TESTS = $(check_PROGRAMS)
80+
TEST_EXTENSIONS = .sh
81+
SH_LOG_COMPILER = sh
82+
83+
test: check

NEWS

Whitespace-only changes.

README

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README.md

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
██▒ █▓ ▄▄▄ ██▓ ██░ ██ ▄▄▄ ██▓ ██▓ ▄▄▄
2+
▓██░ █▒▒████▄ ▓██▒ ▓██░ ██▒▒████▄ ▓██▒ ▓██▒ ▒████▄
3+
▓██ █▒░▒██ ▀█▄ ▒██░ ▒██▀▀██░▒██ ▀█▄ ▒██░ ▒██░ ▒██ ▀█▄
4+
▒██ █░░░██▄▄▄▄██ ▒██░ ░▓█ ░██ ░██▄▄▄▄██ ▒██░ ▒██░ ░██▄▄▄▄██
5+
▒▀█░ ▓█ ▓██▒░██████▒░▓█▒░██▓ ▓█ ▓██▒░██████▒░██████▒▓█ ▓██▒
6+
░ ▐░ ▒▒ ▓▒█░░ ▒░▓ ░ ▒ ░░▒░▒ ▒▒ ▓▒█░░ ▒░▓ ░░ ▒░▓ ░▒▒ ▓▒█░
7+
░ ░░ ▒ ▒▒ ░░ ░ ▒ ░ ▒ ░▒░ ░ ▒ ▒▒ ░░ ░ ▒ ░░ ░ ▒ ░ ▒ ▒▒ ░
8+
░░ ░ ▒ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒
9+
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
10+
11+
12+
Valhalla is an open source routing engine and accompanying libraries for use with Open Street Map data.
13+
14+
Building
15+
--------
16+
17+
Valhalla uses the [GNU Build System](http://www.gnu.org/software/automake/manual/html_node/GNU-Build-System.html) to configure and build itself and has a number of useful dependencies already included for convenience such as: [Boost libraries](http://boost.org/), [Protobuf](https://github.com/google/protobuf/), [cURL](http://curl.haxx.se/), [ZeroMQ](http://zeromq.org/) and [SQLite](http://sqlite.org/). To install on a Debian or Ubuntu system, please first install the prerequisites:
18+
19+
sudo apt-get install libboost-all-dev libprotobuf-dev libcurl4-openssl-dev libzmq3-dev protobuf-compiler libsqlite3-dev lcov
20+
21+
Then you should be able to bootstrap the build system:
22+
23+
./autogen.sh
24+
25+
And then run the standard GNU build install:
26+
27+
./configure --enable-coverage && make && make install
28+
29+
Please see `./configure --help` for more options on how to control the build process.
30+
31+
Using
32+
-----
33+
34+
For convenience valhalla has a main executable, `valhalla`, that makes use of the library it builds. The purpose of this executable to serve as a starting point for building your own custom executable against your own custom library.
35+
36+
To setup another repository of your own, based on `valhalla`, let's call it `foo_bar`, you might try the following sequence of commands:
37+
38+
39+
40+
Contributing
41+
------------
42+
43+
We welcome contributions to valhalla. If you would like to report an issue, please use the [valhalla issue tracker](https://github.com/mapzen/valhalla/issues) on GitHub.
44+
45+
If you would like to make an improvement to the code, please be aware that valhalla is written mostly in C++11, in the K&R (1TBS variant) with two spaces as indentation. We welcome contributions as pull requests to the [repository](https://github.com/mapzen/valhalla).
46+
47+
It is possible to build a test coverage report, please see [test coverage documentation](docs/test_coverage.md) for details.
48+

autogen.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
mkdir -p include
3+
libtoolize -i
4+
aclocal -I m4
5+
autoreconf -fi

configure.ac

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
AC_INIT([valhalla],
2+
[0.0.1],
3+
[https://github.com/mapzen/valhalla/issues],
4+
[valhalla-0.0.1],
5+
[https://github.com/mapzen/valhalla])
6+
AM_INIT_AUTOMAKE([subdir-objects parallel-tests])
7+
LT_INIT
8+
AC_SUBST([LIBTOOL_DEPS])
9+
10+
AM_SILENT_RULES([yes])
11+
AC_CONFIG_HEADERS([include/config.h])
12+
AC_CONFIG_MACRO_DIR([m4])
13+
14+
AC_PROG_CXX
15+
AC_PROG_INSTALL
16+
AC_PROG_MAKE_SET
17+
18+
AC_HEADER_STDC
19+
AC_LANG_CPLUSPLUS
20+
21+
# require c++11
22+
AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
23+
24+
# check for protocol buffers compiler and libraries
25+
REQUIRE_PROTOC
26+
27+
# check for SQLite, which we use for HTTP cache information
28+
AX_LIB_SQLITE3([3.6.16])
29+
AM_CONDITIONAL([HAVE_SQLITE3], [test -n "$SQLITE3_VERSION"])
30+
31+
# check for boost and make sure we have the program options library
32+
AX_BOOST_BASE([1.46], , [AC_MSG_ERROR([cannot find Boost libraries, which are are required for building valhalla. Please install libboost-dev.])])
33+
AX_BOOST_PROGRAM_OPTIONS
34+
35+
# check pkg-config packaged packages.
36+
PKG_CHECK_MODULES([DEPS], [protobuf >= 2.4.0 libzmq >= 2.1.10 libcurl >= 7.19.5])
37+
38+
# optionally enable coverage information
39+
CHECK_COVERAGE
40+
41+
AC_CONFIG_FILES([Makefile])
42+
43+
# Debian resets this to no, but this break both Spot and the libtool
44+
# test suite itself. Instead of requiring developer to install a
45+
# non-patched version of Libtool on any Debian they use, we just
46+
# cancel the effect of Debian's patch here.
47+
# see: http://git.lrde.epita.fr/?p=spot.git;a=commitdiff;h=0e74b76521341f670f6b76f8ef24a6dcf6e3813b
48+
link_all_deplibs=yes
49+
link_all_deplibs_CXX=yes
50+
51+
AC_OUTPUT
52+

docs/index.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Valhalla Library #
2+
3+
## Motivation ##
4+
5+
Valhalla was created to serve as a starting point for an autotools project for anyone who might not have experience building one from scratch. It comes with a testing harness and coverage built in and requires a bunch of common dependencies for convenience.
6+
7+
## Building ##
8+
9+
Valhalla does have several dependencies that you must have before configure will properly produce a Makefile. It is true that many of these dependencies are not actually needed to build the valhalla code however we left the dependencies in because they seemed fairly common in most moderatly complex projects. If your project doesn't need a given dependency, delete it from the `m4` directory and update `configure.ac`.
10+
11+
## Testing ##
12+
13+
Tests can be found in the `tests/` directory, and are run by autotools when you run `make check`. If you are preparing a pull request or patch, please make sure these pass before submitting it.
14+
15+
There is a test coverage tool built into the build system, but it's fairly annoying to use. Please see
16+
[the coverage docs](test_coverage.md) for more information and details on running it.
17+
18+
## Components ##
19+
20+
### Util ###
21+
22+
The Valhalla library comes with some examples of standard utilities that may or may not be applicable for a given project. They are mostly just intented as an example of what you might use to build a library within autotools.
23+
24+
## Tests ##
25+
Valhalla comes with a test suite, run with ``make check``. If you find a platform where the tests aren't passing [open an issue](https://github.com/mapzen/valhalla/issues/new).

docs/test_coverage.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Test Coverage Report #
2+
3+
You can build a test coverage report using the `--enable-coverage` argument to `./configure`, then running `make coverage-report` to build an HTML coverage report in the `coverage/` directory.
4+
5+
Note also that, because calculating the coverage requires compiler support, you will need to clean any object files from a non-coverage build by running `make clean` before `make coverage-report`.
6+
7+
## Prerequisites ##
8+
9+
For this to work, you will need to have `lcov`, `gcov` and `genhtml` installed. On Ubuntu you can just run `sudo apt-get install lcov` to get these.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

include/valhalla.h

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef VALHALLA_HPP
2+
#define VALHALLA_HPP
3+
4+
namespace valhalla {
5+
6+
7+
8+
9+
10+
}
11+
12+
#endif

0 commit comments

Comments
 (0)