Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /branches/destination-access/Makefile.conf

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1969 - (show annotations) (download)
Wed Mar 13 13:31:03 2019 UTC (6 years ago) by amb
File size: 4018 byte(s)
Merge from trunk.

1 # Configuration Makefile
2 #
3 # Part of the Routino routing software.
4 #
5 # This file Copyright 2013-2015, 2017, 2018 Andrew M. Bishop
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
16 #
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #
20
21 # Automatic operating system detection
22
23 UNAME=$(shell uname)
24
25 HOST=UNIX
26
27 ifneq ($(findstring CYGWIN,$(UNAME)),)
28 HOST=CYGWIN
29 endif
30
31 ifneq ($(findstring MINGW,$(UNAME)),)
32 HOST=MINGW
33 endif
34
35
36 # Simplify handling of executable targets ending in .exe
37
38 ifeq ($(HOST),MINGW)
39 .EXE=.exe
40 else
41 .EXE=
42 endif
43
44
45 # Installation locations (edit if required)
46
47 ifneq ($(HOST),MINGW)
48 prefix=/usr/local
49 bindir=$(prefix)/bin
50 incdir=$(prefix)/include
51 libdir=$(prefix)/lib
52 docdir=$(prefix)/doc/routino
53 datadir=$(prefix)/share/routino
54 else
55 prefix="c:/Program Files/Routino"
56 bindir=$(prefix)/bin
57 incdir=$(prefix)/include
58 libdir=$(prefix)/lib
59 docdir=$(prefix)/doc
60 datadir=$(prefix)/xml
61 endif
62
63
64 # Library version for ABI compatibility
65 SOVERSION=0
66
67 # Full library version (SOVERSION.MINOR[.RELEASE])
68 LIBVERSION=$(SOVERSION).0.0
69
70
71 # Compilation programs
72 CC=gcc
73 CXX=g++
74 LD=gcc
75
76 ifdef CLANG
77 ifeq ($(CLANG),1)
78 CC=clang
79 CXX=clang++
80 LD=clang
81 endif
82 endif
83
84 # Maths library
85 LDFLAGS=-lm
86
87 # Language dialect selection
88 CFLAGS=-std=c99
89
90 # Warning options
91 CFLAGS+=-Wall -Wmissing-prototypes -Wextra -Wno-unused-parameter -pedantic
92
93 ifdef CLANG
94 ifeq ($(CLANG),1)
95 CFLAGS+=-Wno-missing-field-initializers
96 endif
97 endif
98
99 # Optimisation options
100 CFLAGS+=-O3
101
102 # Fast maths option - makes test cases fail slightly
103 CFLAGS+=-ffast-math
104 ifdef FASTMATHS
105 ifeq ($(FASTMATHS),0)
106 CFLAGS+=-fno-fast-math
107 endif
108 endif
109
110 # Optimisation option (only works if compilation and execution use exactly the same CPU architecture).
111 #CFLAGS+=-march=native
112
113 # Compile with debugging symbols
114 CFLAGS+=-g
115
116 # Option for compiling with sanitizer for debugging memory addresses and undefined behaviour
117 ifdef SANITIZE
118 ifeq ($(SANITIZE),1)
119 CFLAGS+=-fsanitize=address -fsanitize=leak -fsanitize=undefined
120 LDFLAGS+=-fsanitize=address -fsanitize=leak -fsanitize=undefined
121 endif
122 endif
123
124 # Extra flags for compiling libroutino shared library (visibility of symbols, shared)
125 CFLAGS_LIB=-fvisibility=hidden
126 LDFLAGS_LIB=-shared
127
128 # Extra flags for compiling libroutino shared library (position independent code)
129 ifeq ($(HOST),UNIX)
130 CFLAGS_LIB+=-fPIC
131 LDFLAGS_LIB+=-fPIC
132 endif
133
134 # Extra flags for compiling libroutino shared library (SONAME)
135 ifeq ($(HOST),UNIX)
136 LDFLAGS_SONAME=-Wl,-soname=libroutino.so.$(SOVERSION)
137 LDFLAGS_SLIM_SONAME=-Wl,-soname=libroutino-slim.so.$(SOVERSION)
138 endif
139
140 # Put the current directory in the shared library path for the router using libroutino
141 LDFLAGS_LDSO=-Wl,-R.
142
143
144 # Required for multi-threaded support (comment these two lines out if not required)
145 CFLAGS+=-pthread -DUSE_PTHREADS
146 LDFLAGS+=-pthread -lpthread
147
148
149 # Required for bzip2 support (comment these two lines out if not required)
150 ifneq ($(HOST),MINGW)
151 CFLAGS+=-DUSE_BZIP2
152 LDFLAGS+=-lbz2
153 endif
154
155
156 # Required for gzip support (comment these two lines out if not required)
157 CFLAGS+=-DUSE_GZIP
158 LDFLAGS+=-lz
159
160
161 # Required for xz support (uncomment these two lines if required)
162 #CFLAGS+=-DUSE_XZ
163 #LDFLAGS+=-llzma
164
165
166 # Required to use stdio with files > 2GiB on 32-bit system.
167 CFLAGS+=-D_FILE_OFFSET_BITS=64
168
169
170 # Required to compile on Linux without a warning about pread() and pwrite() functions.
171 ifneq ($(HOST),MINGW)
172 CFLAGS+=-D_POSIX_C_SOURCE=200809L
173 endif