Fix typo
[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
67 LCRYPT          = @CRYPTLIB@
68 LIBS            = @LIBS@
69 LDFLAGS         = @LDFLAGS@
70
71 LOGDIR          = ${logdir}
72 RADDBDIR        = ${raddbdir}
73 RUNDIR          = ${localstatedir}/run/radiusd
74 SBINDIR         = ${sbindir}
75 RADIR           = ${radacctdir}
76 LIBRADIUS       = $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la -l talloc
77
78 USE_SHARED_LIBS = @USE_SHARED_LIBS@
79 bm_shared_libs  = @USE_SHARED_LIBS@
80 USE_STATIC_LIBS = @USE_STATIC_LIBS@
81 bm_static_libs  = @USE_STATIC_LIBS@
82
83 STATIC_MODULES  = @STATIC_MODULES@
84
85 OPENSSL_LIBS    = @OPENSSL_LIBS@
86 OPENSSL_INCLUDE = @OPENSSL_INCLUDE@
87 CFLAGS          += $(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_LIBS)" ""
94 CFLAGS          +=  -DWITH_OPENSSL_MD4 -DWITH_OPENSSL_MD5 $(OPENSSL_INCLUDE)
95 LDFLAGS         += $(OPENSSL_LIBS)
96 endif
97
98 LIBREADLINE     = @LIBREADLINE@
99
100 #
101 #  Version to use for packaging and other Make related things
102 #
103 RADIUSD_VERSION_STRING = @RADIUSD_VERSION_STRING@
104
105 #
106 #  This allows dlopen to do runtime checks for version mistmatches
107 #  between what it was originally linked with, and the library it's
108 #  actually loading.
109 #
110 #LDFLAGS += -release=$(RADIUSD_VERSION_STRING)
111
112 MODULES         = @MODULES@
113 HOSTINFO        = @HOSTINFO@
114
115 ifneq ($(WITH_OPENSSL_MD5),)
116 LIBRADIUS_WITH_OPENSSL = 1
117 CFLAGS += -DWITH_OPENSSL_MD5
118 endif
119
120 ifneq ($(WITH_OPENSSL_SHA1),)
121 LIBRADIUS_WITH_OPENSSL = 1
122 CFLAGS += -DWITH_OPENSSL_SHA1
123 endif
124
125 ifneq ($(LIBRADIUS_WITH_OPENSSL),)
126 ifeq ($(OPENSSL_LIBS),)
127 $(error OPENSSL_LIBS must be define in order to use WITH_OPENSSL_*)
128 else
129 LIBRADIUS += $(OPENSSL_LIBS)
130 endif
131 endif
132
133 #  http://clang.llvm.org/StaticAnalysis.html
134 #
135 #  $ make SCAN=/path/to/checker/ 
136 #
137 ifneq ($(SCAN),)
138 CC              := $(SCAN)/scan-build gcc -DFR_SCAN_BUILD
139 LIBTOOL         := 
140 endif
141
142 #
143 #  Portability cruft.  This is for replacing libtroll && libltdl
144 #  with gcc and dlopen().
145 #
146 ifeq "$(USE_SHARED_LIBS)" "yes"
147 LINK_MODE.exe   = -export-dynamic
148 CFLAGS          += -fPIC
149 else
150 LINK_MODE.exe   = -static
151 endif
152
153 ifneq "$(LIBTOOL)" ""
154 COMPILE.c       := $(LIBTOOL) --quiet --mode=compile $(CC) 
155 LINK.lib        := $(LIBTOOL) --quiet --mode=link $(CC) -rpath $(libdir) -o
156 LO              := lo
157 LA              := la
158 else
159 COMPILE.c       := $(CC)
160 LO              := o
161
162 ifeq "$(USE_SHARED_LIBS)" "yes"
163 LINK.lib        := $(CC) -shared -o
164 LA              := so
165 else
166 LINK.lib        := $(AR) cru
167 LA              := a
168 endif
169
170 endif
171
172 ifeq "$(LA)" "so"
173 ifneq "$(findstring Darwin,$(shell uname -a))" ""
174 LA              := dylib
175 endif
176 endif