# -*- makefile -*-
# Make.inc.in
#
# Version:	$Id$
#

# Location of files.
prefix		= @prefix@
exec_prefix	= @exec_prefix@
sysconfdir	= @sysconfdir@
localstatedir	= @localstatedir@
libdir		= @libdir@
bindir		= @bindir@
sbindir		= @sbindir@
docdir		= @docdir@
mandir		= @mandir@
datadir		= @datadir@
dictdir		= $(datadir)/freeradius
logdir		= @logdir@
includedir	= @includedir@
raddbdir	= @raddbdir@
radacctdir	= @radacctdir@
top_builddir	= @abs_top_builddir@
top_build_prefix=@abs_top_builddir@/
top_srcdir	= @abs_top_srcdir@
datarootdir	= @datarootdir@

MAKE		= @MAKE@
CC		= @CC@
RANLIB		= @RANLIB@
INCLUDE		= -I${top_srcdir} -I${top_srcdir}/src
CFLAGS		= $(INCLUDE) @CFLAGS@
CPPFLAGS	= @CPPFLAGS@
LIBPREFIX	= @LIBPREFIX@
EXEEXT		= @EXEEXT@

LIBTOOL		= @LIBTOOL@
ACLOCAL		= @ACLOCAL@
AUTOCONF	= @AUTOCONF@
AUTOHEADER	= @AUTOHEADER@
INSTALL		= ${top_builddir}/install-sh -c
INSTALL_PROGRAM	= ${INSTALL}
INSTALL_DATA	= ${INSTALL} -m 644
INSTALL_SCRIPT	= ${INSTALL_PROGRAM}
INSTALLSTRIP	= @INSTALLSTRIP@

LCRYPT		= @CRYPTLIB@
LIBS		= @LIBS@
LDFLAGS		= @LDFLAGS@

LOGDIR		= ${logdir}
RADDBDIR	= ${raddbdir}
RUNDIR		= ${localstatedir}/run/radiusd
SBINDIR		= ${sbindir}
RADIR		= ${radacctdir}
LIBRADIUS	= $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la

LIBLTDL		= @LIBLTDL@
INCLTDL		= @INCLTDL@
LTDL_SUBDIRS	= @LTDL_SUBDIRS@
CFLAGS		+= $(INCLTDL)

USE_SHARED_LIBS	= @USE_SHARED_LIBS@
USE_STATIC_LIBS = @USE_STATIC_LIBS@
STATIC_MODULES	= @STATIC_MODULES@

OPENSSL_LIBS	= @OPENSSL_LIBS@
OPENSSL_INCLUDE = @OPENSSL_INCLUDE@

LIBREADLINE	= @LIBREADLINE@

#
#  SQL driver defines
#
SQL_ODBC_LIBS = @ODBC_LIBS@
SQL_ODBC_INCLUDE = @ODBC_INCLUDE@

RADIUSD_MAJOR_VERSION	= @RADIUSD_MAJOR_VERSION@
RADIUSD_MINOR_VERSION	= @RADIUSD_MINOR_VERSION@
RADIUSD_INCRM_VERSION	= @RADIUSD_INCRM_VERSION@
RADIUSD_VERSION		= @RADIUSD_VERSION@
RADIUSD_VERSION_STRING  = @RADIUSD_VERSION_STRING@
RADIUSD_VERSION_COMMIT  = @RADIUSD_VERSION_COMMIT@

MODULES			= @MODULES@
HOSTINFO		= @HOSTINFO@

ifneq ($(WITH_OPENSSL_MD5),)
LIBRADIUS_WITH_OPENSSL = 1
CFLAGS += -DWITH_OPENSSL_MD5
endif

ifneq ($(WITH_OPENSSL_SHA1),)
LIBRADIUS_WITH_OPENSSL = 1
CFLAGS += -DWITH_OPENSSL_SHA1
endif

ifneq ($(LIBRADIUS_WITH_OPENSSL),)
ifeq ($(OPENSSL_LIBS),)
$(error OPENSSL_LIBS must be define in order to use WITH_OPENSSL_*)
else
LIBRADIUS += $(OPENSSL_LIBS)
endif
endif

#  http://clang.llvm.org/StaticAnalysis.html
#
#  $ make SCAN=/path/to/checker/ 
#
ifneq ($(SCAN),)
CC		:= $(SCAN)/scan-build gcc -DFR_SCAN_BUILD
LIBTOOL		:= 
endif

ifeq "$(LIBTOOL)" ""
$(error Building FreeRADIUS requires libtool)
endif
