Moonshot spec file based on Fedora spec file with help from Stefan
[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         = $(datadir)/freeradius
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 IMACROS         = -imacros ${top_srcdir}/src/freeradius-devel/build.h -imacros ${top_srcdir}/src/freeradius-devel/autoconf.h -imacros ${top_srcdir}/src/freeradius-devel/features.h
51 INCLUDE         = -I${top_srcdir} -I${top_srcdir}/src
52 CFLAGS          = $(IMACROS) $(INCLUDE) -std=c99 -fno-strict-aliasing @CFLAGS@
53 CPPFLAGS        = @CPPFLAGS@
54 LIBPREFIX       = @LIBPREFIX@
55 EXEEXT          = @EXEEXT@
56
57 LIBTOOL         = JLIBTOOL
58 ACLOCAL         = @ACLOCAL@
59 AUTOCONF        = @AUTOCONF@
60 AUTOHEADER      = @AUTOHEADER@
61 INSTALL         = ${top_builddir}/install-sh -c
62 INSTALL_PROGRAM = ${INSTALL}
63 INSTALL_DATA    = ${INSTALL} -m 644
64 INSTALL_SCRIPT  = ${INSTALL_PROGRAM}
65 INSTALLSTRIP    = @INSTALLSTRIP@
66 DARWIN_CFLAGS   = @DARWIN_CFLAGS@
67
68 LCRYPT          = @CRYPTLIB@
69 LIBS            = @LIBS@
70 LDFLAGS         = @LDFLAGS@
71
72 LOGDIR          = ${logdir}
73 RADDBDIR        = ${raddbdir}
74 RUNDIR          = ${localstatedir}/run/radiusd
75 SBINDIR         = ${sbindir}
76 RADIR           = ${radacctdir}
77 LIBRADIUS       = $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la -ltalloc
78
79 USE_SHARED_LIBS = @USE_SHARED_LIBS@
80 bm_shared_libs  = @USE_SHARED_LIBS@
81 USE_STATIC_LIBS = @USE_STATIC_LIBS@
82 bm_static_libs  = @USE_STATIC_LIBS@
83
84 STATIC_MODULES  = @STATIC_MODULES@
85
86 OPENSSL_LIBS    = @OPENSSL_LIBS@
87 OPENSSL_INCLUDE = @OPENSSL_INCLUDE@
88
89 #
90 #  If the system has OpenSSL, use it's version of MD4/MD5/SHA1, instead of
91 #  using ours.
92 #
93 ifneq "$(OPENSSL_INCLUDE)" ""
94 CFLAGS          +=  -DWITH_OPENSSL_MD4 -DWITH_OPENSSL_MD5
95 endif
96
97 LIBREADLINE     = @LIBREADLINE@
98
99 #
100 #  Version to use for packaging and other Make related things
101 #
102 RADIUSD_VERSION_STRING = @RADIUSD_VERSION_STRING@
103
104 #
105 #  This allows dlopen to do runtime checks for version mistmatches
106 #  between what it was originally linked with, and the library it's
107 #  actually loading.
108 #
109 #LDFLAGS += -release=$(RADIUSD_VERSION_STRING)
110
111 MODULES         = @MODULES@
112 HOSTINFO        = @HOSTINFO@
113
114 ifneq ($(WITH_OPENSSL_MD5),)
115 LIBRADIUS_WITH_OPENSSL = 1
116 CFLAGS += -DWITH_OPENSSL_MD5
117 endif
118
119 ifneq ($(WITH_OPENSSL_SHA1),)
120 LIBRADIUS_WITH_OPENSSL = 1
121 CFLAGS += -DWITH_OPENSSL_SHA1
122 endif
123
124 ifneq ($(LIBRADIUS_WITH_OPENSSL),)
125 ifeq ($(OPENSSL_LIBS),)
126 $(error OPENSSL_LIBS must be define in order to use WITH_OPENSSL_*)
127 else
128 LIBRADIUS += $(OPENSSL_LIBS)
129 endif
130 endif
131
132 #  http://clang.llvm.org/StaticAnalysis.html
133 #
134 #  $ make SCAN=/path/to/checker/ 
135 #
136 ifneq ($(SCAN),)
137 CC              := $(SCAN)/scan-build gcc -DFR_SCAN_BUILD
138 LIBTOOL         := 
139 endif
140
141 #
142 #  Portability cruft.  This is for replacing libtroll && libltdl
143 #  with gcc and dlopen().
144 #
145 ifeq "$(USE_SHARED_LIBS)" "yes"
146 LINK_MODE.exe   = -export-dynamic
147 CFLAGS          += -fPIC
148 else
149 LINK_MODE.exe   = -static
150 endif
151
152 ifneq "$(LIBTOOL)" ""
153 COMPILE.c       := $(LIBTOOL) --quiet --mode=compile $(CC) 
154 LINK.lib        := $(LIBTOOL) --quiet --mode=link $(CC) -rpath $(libdir) -o
155 LO              := lo
156 LA              := la
157 else
158 COMPILE.c       := $(CC)
159 LO              := o
160
161 ifeq "$(USE_SHARED_LIBS)" "yes"
162 LINK.lib        := $(CC) -shared -o
163 LA              := so
164 else
165 LINK.lib        := $(AR) cru
166 LA              := a
167 endif
168
169 endif
170
171 ifeq "$(LA)" "so"
172 ifneq "$(findstring Darwin,$(shell uname -a))" ""
173 LA              := dylib
174 endif
175 endif
176
177 # Path to clang, setting this enables the 'scan.*' build targets
178 # which perform static analysis on various server components.
179 ANALYZE.c       := @clang_path@
180
181 ifeq "${CC}" "clang"
182     ifeq "${ANALYZE.c}" ""
183         ANALYZE.c := "${CC}"
184     endif
185 endif
186
187 #
188 #  With shared libs, the test binaries are in a different place
189 #  AND the method we use to run those binaries changes.
190 #
191 ifeq "$(USE_SHARED_LIBS)" "yes"
192         TESTBINDIR = ./$(BUILD_DIR)/bin/local
193         TESTBIN    = $(JLIBTOOL) --quiet --mode=execute $(TESTBINDIR)
194 else
195         TESTBINDIR = ./$(BUILD_DIR)/bin
196         TESTBIN    = ./$(BUILD_DIR)/bin
197 endif