ensure var/log/freeradius is created in debian pkg
[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 modconfdir      = @modconfdir@
23 radacctdir      = @radacctdir@
24 top_builddir    = @abs_top_builddir@
25 top_build_prefix=@abs_top_builddir@/
26 top_srcdir      = @abs_top_srcdir@
27 datarootdir     = @datarootdir@
28
29 MAKE            = @MAKE@
30
31 # Makeflags set within the makefile appear to be additive and override
32 # flags set on the command line and the environmental variables
33 MAKEFLAGS       = @FR_MAKEFLAGS@
34
35 CC              = @CC@
36 RANLIB          = @RANLIB@
37 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
38 INCLUDE         = -I${top_srcdir} -I${top_srcdir}/src
39 CFLAGS          = $(IMACROS) $(INCLUDE) -std=c99 -fno-strict-aliasing @CFLAGS@
40 CPPFLAGS        = @CPPFLAGS@
41 LIBPREFIX       = @LIBPREFIX@
42 EXEEXT          = @EXEEXT@
43
44 LIBTOOL         = JLIBTOOL
45 ACLOCAL         = @ACLOCAL@
46 AUTOCONF        = @AUTOCONF@
47 AUTOHEADER      = @AUTOHEADER@
48 INSTALL         = ${top_builddir}/install-sh -c
49 INSTALL_PROGRAM = ${INSTALL}
50 INSTALL_DATA    = ${INSTALL} -m 644
51 INSTALL_SCRIPT  = ${INSTALL_PROGRAM}
52 INSTALLSTRIP    = @INSTALLSTRIP@
53
54 LCRYPT          = @CRYPTLIB@
55 LIBS            = @LIBS@
56 LDFLAGS         = @LDFLAGS@
57
58 LOGDIR          = ${logdir}
59 RADDBDIR        = ${raddbdir}
60 RUNDIR          = ${localstatedir}/run/radiusd
61 SBINDIR         = ${sbindir}
62 RADIR           = ${radacctdir}
63 LIBRADIUS       = $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la -l talloc
64
65 #USE_SHARED_LIBS = @USE_SHARED_LIBS@
66 #USE_STATIC_LIBS = @USE_STATIC_LIBS@
67
68 USE_SHARED_LIBS = yes
69 USE_STATIC_LIBS = yes
70 STATIC_MODULES  = @STATIC_MODULES@
71
72 OPENSSL_LIBS    = @OPENSSL_LIBS@
73 OPENSSL_INCLUDE = @OPENSSL_INCLUDE@
74 CFLAGS          += $(OPENSSL_INCLUDE)
75
76 #
77 #  If the system has OpenSSL, use it's version of MD4/MD5/SHA1, instead of
78 #  using ours.
79 #
80 ifneq "$(OPENSSL_LIBS)" ""
81 CFLAGS          +=  -DWITH_OPENSSL_MD4 -DWITH_OPENSSL_MD5 $(OPENSSL_INCLUDE)
82 LDFLAGS         += $(OPENSSL_LIBS)
83 endif
84
85 LIBREADLINE     = @LIBREADLINE@
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