realms_realm_add
[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 raddbdir        = @raddbdir@
22 radacctdir      = @radacctdir@
23 top_builddir    = @abs_top_builddir@
24 top_build_prefix=@abs_top_builddir@/
25 top_srcdir      = @abs_top_srcdir@
26 datarootdir     = @datarootdir@
27
28 MAKE            = @MAKE@
29
30 # Makeflags set within the makefile appear to be additive and override
31 # flags set on the command line and the environmental variables
32 MAKEFLAGS       = @MAKEFLAGS@
33
34 CC              = @CC@
35 RANLIB          = @RANLIB@
36 IMACROS         = -imacros ${top_srcdir}/src/freeradius-devel/autoconf.h -imacros ${top_srcdir}/src/freeradius-devel/features.h
37 INCLUDE         = -I${top_srcdir} -I${top_srcdir}/src
38 CFLAGS          = $(IMACROS) $(INCLUDE) @CFLAGS@
39 CPPFLAGS        = @CPPFLAGS@
40 LIBPREFIX       = @LIBPREFIX@
41 EXEEXT          = @EXEEXT@
42
43 LIBTOOL         = @LIBTOOL@
44 ACLOCAL         = @ACLOCAL@
45 AUTOCONF        = @AUTOCONF@
46 AUTOHEADER      = @AUTOHEADER@
47 INSTALL         = ${top_builddir}/install-sh -c
48 INSTALL_PROGRAM = ${INSTALL}
49 INSTALL_DATA    = ${INSTALL} -m 644
50 INSTALL_SCRIPT  = ${INSTALL_PROGRAM}
51 INSTALLSTRIP    = @INSTALLSTRIP@
52
53 LCRYPT          = @CRYPTLIB@
54 LIBS            = @LIBS@
55 LDFLAGS         = @LDFLAGS@
56
57 LOGDIR          = ${logdir}
58 RADDBDIR        = ${raddbdir}
59 RUNDIR          = ${localstatedir}/run/radiusd
60 SBINDIR         = ${sbindir}
61 RADIR           = ${radacctdir}
62 LIBRADIUS       = $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la
63
64 LIBLTDL         = @LIBLTDL@
65 INCLTDL         = @INCLTDL@
66 CFLAGS          += $(INCLTDL)
67
68 #USE_SHARED_LIBS = @USE_SHARED_LIBS@
69 #USE_STATIC_LIBS = @USE_STATIC_LIBS@
70
71 USE_SHARED_LIBS = yes
72 USE_STATIC_LIBS = yes
73 STATIC_MODULES  = @STATIC_MODULES@
74
75 OPENSSL_LIBS    = @OPENSSL_LIBS@
76 OPENSSL_INCLUDE = @OPENSSL_INCLUDE@
77 CFLAGS          += $(OPENSSL_INCLUDE)
78
79 LIBREADLINE     = @LIBREADLINE@
80
81 #
82 #  SQL driver defines
83 #
84 SQL_ODBC_LIBS = @ODBC_LIBS@
85 SQL_ODBC_INCLUDE = @ODBC_INCLUDE@
86
87 #
88 #  Version to use for packaging and other Make related things
89 #
90 RADIUSD_VERSION_STRING = @RADIUSD_VERSION_STRING@
91
92 #
93 #  This allows dlopen to do runtime checks for version mistmatches
94 #  between what it was originally linked with, and the library it's
95 #  actually loading.
96 #
97 #LDFLAGS += -release=$(RADIUSD_VERSION_STRING)
98
99 MODULES         = @MODULES@
100 HOSTINFO        = @HOSTINFO@
101
102 ifneq ($(WITH_OPENSSL_MD5),)
103 LIBRADIUS_WITH_OPENSSL = 1
104 CFLAGS += -DWITH_OPENSSL_MD5
105 endif
106
107 ifneq ($(WITH_OPENSSL_SHA1),)
108 LIBRADIUS_WITH_OPENSSL = 1
109 CFLAGS += -DWITH_OPENSSL_SHA1
110 endif
111
112 ifneq ($(LIBRADIUS_WITH_OPENSSL),)
113 ifeq ($(OPENSSL_LIBS),)
114 $(error OPENSSL_LIBS must be define in order to use WITH_OPENSSL_*)
115 else
116 LIBRADIUS += $(OPENSSL_LIBS)
117 endif
118 endif
119
120 #  http://clang.llvm.org/StaticAnalysis.html
121 #
122 #  $ make SCAN=/path/to/checker/ 
123 #
124 ifneq ($(SCAN),)
125 CC              := $(SCAN)/scan-build gcc -DFR_SCAN_BUILD
126 LIBTOOL         := 
127 endif
128
129 #
130 #  Portability cruft.  This is for replacing libtroll && libltdl
131 #  with gcc and dlopen().
132 #
133 ifeq "$(USE_SHARED_LIBS)" "yes"
134 LINK_MODE.exe   = -export-dynamic
135 CFLAGS          += -fPIC
136 else
137 LINK_MODE.exe   = -static
138 endif
139
140 ifneq "$(LIBTOOL)" ""
141 COMPILE.c       := $(LIBTOOL) --quiet --mode=compile $(CC) 
142 LINK.lib        := $(LIBTOOL) --quiet --mode=link $(CC) -rpath $(libdir) -o
143 LO              := lo
144 LA              := la
145 else
146 COMPILE.c       := $(CC)
147 LO              := o
148
149 ifeq "$(USE_SHARED_LIBS)" "yes"
150 LINK.lib        := $(CC) -shared -o
151 LA              := so
152 else
153 LINK.lib        := $(AR) cru
154 LA              := a
155 endif
156
157 endif
158
159 ifeq "$(LA)" "so"
160 ifneq "$(findstring Darwin,$(shell uname -a))" ""
161 LA              := dylib
162 endif
163 endif
164
165
166 BOILER = @boilermake@
167
168 ifneq "$(BOILER)" "yes"
169 all: $(top_srcdir)/scripts/jlibtool
170
171 $(top_srcdir)/scripts/jlibtool: $(top_srcdir)/scripts/jlibtool.c
172         $(CC) $^ -o $@
173
174 # Add -module for normal libtool.  It doesn't like building "foo.la"
175 # as a library unless you tell it to shut up, yes, I KNOW this is a module
176 ifeq "$(findstring jlibtool,$(LIBTOOL))" ""
177   RLM_MOD = -module
178 else
179   MOD_RPATH = -rpath $(libdir)
180 endif
181
182 ifeq "$(LIBTOOL)" ""
183 $(error Building FreeRADIUS requires libtool)
184 endif
185 endif