Don't use Perl
[freeradius.git] / Make.inc.in
1 # -*- makefile -*-
2 # Make.inc.in
3 #
4 # Version:      $Id$
5 #
6
7 # Location of files.
8 prefix          = @prefix@
9 exec_prefix     = @exec_prefix@
10 sysconfdir      = @sysconfdir@
11 localstatedir   = @localstatedir@
12 libdir          = @libdir@
13 bindir          = @bindir@
14 sbindir         = @sbindir@
15 docdir          = @docdir@
16 mandir          = @mandir@
17 datadir         = @datadir@
18 dictdir         = @dictdir@
19 logdir          = @logdir@
20 includedir      = @includedir@
21
22 #
23 #  In some systems, we don't want to over-write ANY configuration.
24 #  So we do:
25 #
26 #       $./configure
27 #       $ make
28 #       $ make -Draddbdir=/tmp/garbage install
29 #
30 #  and all of the configuration files go into /tmp/garbage
31 #
32 ifeq "${raddbdir}" ""
33 raddbdir        = @raddbdir@
34 endif
35 modconfdir      = @modconfdir@
36 radacctdir      = @radacctdir@
37 top_builddir    = @abs_top_builddir@
38 top_build_prefix=@abs_top_builddir@/
39 top_srcdir      = @abs_top_srcdir@
40 datarootdir     = @datarootdir@
41
42 MAKE            = @MAKE@
43
44 # Makeflags set within the makefile appear to be additive and override
45 # flags set on the command line and the environmental variables
46 MAKEFLAGS       = @FR_MAKEFLAGS@
47
48 CC              = @CC@
49 RANLIB          = @RANLIB@
50 INCLUDE         = -I${top_srcdir} -I${top_srcdir}/src \
51                   -include ${top_srcdir}/src/freeradius-devel/autoconf.h \
52                   -include ${top_srcdir}/src/freeradius-devel/build.h \
53                   -include ${top_srcdir}/src/freeradius-devel/features.h \
54                   -include ${top_srcdir}/src/freeradius-devel/radpaths.h
55 CFLAGS          = $(INCLUDE) -std=c99 -fno-strict-aliasing @CFLAGS@
56 CPPFLAGS        = @CPPFLAGS@
57 LIBPREFIX       = @LIBPREFIX@
58 EXEEXT          = @EXEEXT@
59
60 LIBTOOL         = JLIBTOOL
61 ACLOCAL         = @ACLOCAL@
62 AUTOCONF        = @AUTOCONF@
63 AUTOHEADER      = @AUTOHEADER@
64 INSTALL         = ${top_builddir}/install-sh -c
65 INSTALL_PROGRAM = ${INSTALL}
66 INSTALL_DATA    = ${INSTALL} -m 644
67 INSTALL_SCRIPT  = ${INSTALL_PROGRAM}
68 INSTALLSTRIP    = @INSTALLSTRIP@
69
70 #
71 #  Linker arguments for libraries searched for by the main
72 #  configure script.
73 #
74 TALLOC_LIBS     = @TALLOC_LIBS@
75 TALLOC_LDFLAGS  = @TALLOC_LDFLAGS@
76
77 OPENSSL_LIBS    = @OPENSSL_LIBS@
78 OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@
79
80 PCAP_LIBS       = @PCAP_LIBS@
81 PCAP_LDFLAGS    = @PCAP_LDFLAGS@
82
83 COLLECTDC_LIBS  = @COLLECTDC_LIBS@
84 COLLECTDC_LDFLAGS = @COLLECTDC_LDFLAGS@
85
86 LCRYPT          = @CRYPTLIB@
87
88 #
89 #  OpenSSL libs (if used) must be linked everywhere in order for
90 #  the server to work properly on on all platforms.
91 #
92 LIBS            = $(OPENSSL_LIBS) $(TALLOC_LIBS) @LIBS@
93 LDFLAGS         = $(OPENSSL_LDFLAGS) $(TALLOC_LDFLAGS) @LDFLAGS@
94
95 LOGDIR          = ${logdir}
96 RADDBDIR        = ${raddbdir}
97 RUNDIR          = ${localstatedir}/run/radiusd
98 SBINDIR         = ${sbindir}
99 RADIR           = ${radacctdir}
100 LIBRADIUS       = $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la $(TALLOC_LIBS)
101
102 USE_SHARED_LIBS = @USE_SHARED_LIBS@
103 bm_shared_libs  = @USE_SHARED_LIBS@
104 USE_STATIC_LIBS = @USE_STATIC_LIBS@
105 bm_static_libs  = @USE_STATIC_LIBS@
106
107 STATIC_MODULES  = @STATIC_MODULES@
108 LIBREADLINE     = @LIBREADLINE@
109
110 #
111 #  Version to use for packaging and other Make related things
112 #
113 RADIUSD_VERSION_STRING = @RADIUSD_VERSION_STRING@
114
115 #
116 #  This allows dlopen to do runtime checks for version mismatches
117 #  between what it was originally linked with, and the library it's
118 #  actually loading.
119 #
120 MODULES         = @MODULES@
121 HOSTINFO        = @HOSTINFO@
122
123 #
124 #  If the system has OpenSSL, use it's version of MD4/MD5/SHA1, instead of
125 #  using ours.
126 #
127 ifeq "$(WITH_OPENSSL)" "yes"
128 CFLAGS          +=  -DWITH_OPENSSL_MD4 -DWITH_OPENSSL_MD5
129 endif
130
131 OPENSSL_LIBS    = @OPENSSL_LIBS@
132
133 ifneq ($(WITH_OPENSSL_MD5),)
134 LIBRADIUS_WITH_OPENSSL = 1
135 CFLAGS += -DWITH_OPENSSL_MD5
136 endif
137
138 ifneq ($(WITH_OPENSSL_SHA1),)
139 LIBRADIUS_WITH_OPENSSL = 1
140 CFLAGS += -DWITH_OPENSSL_SHA1
141 endif
142
143 ifneq ($(LIBRADIUS_WITH_OPENSSL),)
144 ifeq ($(OPENSSL_LIBS),)
145 $(error OPENSSL_LIBS must be define in order to use WITH_OPENSSL_*)
146 else
147 LIBRADIUS += $(OPENSSL_LIBS)
148 endif
149 endif
150
151 #  http://clang.llvm.org/StaticAnalysis.html
152 #
153 #  $ make SCAN=/path/to/checker/
154 #
155 ifneq ($(SCAN),)
156 CC              := $(SCAN)/scan-build gcc -DFR_SCAN_BUILD
157 LIBTOOL         :=
158 endif
159
160 #
161 #  Portability cruft.  This is for replacing libtroll && libltdl
162 #  with gcc and dlopen().
163 #
164 ifeq "$(USE_SHARED_LIBS)" "yes"
165 LINK_MODE.exe   = -export-dynamic
166 CFLAGS          += -fPIC
167 else
168 LINK_MODE.exe   = -static
169 endif
170
171 ifneq "$(LIBTOOL)" ""
172 COMPILE.c       := $(LIBTOOL) --quiet --mode=compile $(CC)
173 LINK.lib        := $(LIBTOOL) --quiet --mode=link $(CC) -rpath $(libdir) -o
174 LO              := lo
175 LA              := la
176 else
177 COMPILE.c       := $(CC)
178 LO              := o
179
180 ifeq "$(USE_SHARED_LIBS)" "yes"
181 LINK.lib        := $(CC) -shared -o
182 LA              := so
183 else
184 LINK.lib        := $(AR) cru
185 LA              := a
186 endif
187
188 endif
189
190 ifeq "$(LA)" "so"
191 ifneq "$(findstring Darwin,$(shell uname -a))" ""
192 LA              := dylib
193 endif
194 endif
195
196 # Path to clang, setting this enables the 'scan.*' build targets
197 # which perform static analysis on various server components.
198 ANALYZE.c       := @clang_path@
199
200 ifeq "${CC}" "clang"
201     ifeq "${ANALYZE.c}" ""
202         ANALYZE.c := "${CC}"
203     endif
204 endif
205
206 #
207 #  With shared libs, the test binaries are in a different place
208 #  AND the method we use to run those binaries changes.
209 #
210 ifeq "$(USE_SHARED_LIBS)" "yes"
211         TESTBINDIR = ./$(BUILD_DIR)/bin/local
212         TESTBIN    = $(JLIBTOOL) --quiet --mode=execute $(TESTBINDIR)
213 else
214         TESTBINDIR = ./$(BUILD_DIR)/bin
215         TESTBIN    = ./$(BUILD_DIR)/bin
216 endif