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

# Location of files.
prefix		= /usr/pkg
exec_prefix	= ${prefix}
sysconfdir	= /usr/pkg/etc
localstatedir	= /var
libdir		= ${exec_prefix}/lib
bindir		= ${exec_prefix}/bin
sbindir		= ${exec_prefix}/sbin
docdir		= ${datadir}/doc/freeradius
mandir		= /usr/pkg/man
datadir		= ${datarootdir}
dictdir		= $(datadir)/freeradius
logdir		= /var/log/radiusd
includedir	= ${prefix}/include
raddbdir	= ${sysconfdir}/raddb
radacctdir	= ${logdir}/radacct
top_builddir	= /tmp/pkgbuild/net/freeradius2/work.earmv6hf/freeradius-server-2.2.10
top_build_prefix=/tmp/pkgbuild/net/freeradius2/work.earmv6hf/freeradius-server-2.2.10/
top_srcdir	= /tmp/pkgbuild/net/freeradius2/work.earmv6hf/freeradius-server-2.2.10
datarootdir	= ${prefix}/share

MAKE		= /tmp/pkgbuild/net/freeradius2/work.earmv6hf/.tools/bin/gmake
CC		= gcc
RANLIB		= ranlib
INCLUDE		= -I${top_srcdir} -I${top_srcdir}/src
CFLAGS		= $(INCLUDE) -O2 -D_FORTIFY_SOURCE=2 -I/usr/pkg/include -I/usr/include -Wall -D_GNU_SOURCE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DNDEBUG
CPPFLAGS	= -I/usr/pkg/include -I/usr/include -DOPENSSL_NO_KRB5
LIBPREFIX	= lib
EXEEXT		= 

LIBTOOL		= /tmp/pkgbuild/net/freeradius2/work.earmv6hf/.cwrapper/bin/libtool
ACLOCAL		= ${SHELL} /tmp/pkgbuild/net/freeradius2/work.earmv6hf/freeradius-server-2.2.10/missing --run aclocal
AUTOCONF	= ${SHELL} /tmp/pkgbuild/net/freeradius2/work.earmv6hf/freeradius-server-2.2.10/missing --run autoconf
AUTOHEADER	= ${SHELL} /tmp/pkgbuild/net/freeradius2/work.earmv6hf/freeradius-server-2.2.10/missing --run autoheader
INSTALL		= ${top_builddir}/install-sh -c
INSTALL_PROGRAM	= ${INSTALL}
INSTALL_DATA	= ${INSTALL} -m 644
INSTALL_SCRIPT	= ${INSTALL_PROGRAM}
INSTALLSTRIP	= 

LCRYPT		= -lcrypt
LIBS		=  -lcrypto -lssl -lcrypto -lcrypto -lresolv  -pthread  
LDFLAGS		= -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -lexecinfo
RLM_LIBS	+= -lcrypto -L${PREFIX}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib

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

LIBLTDL		= -lltdl
INCLTDL		= -DWITH_SYSTEM_LTDL
LTDL_SUBDIRS	= 
CFLAGS		+= $(INCLTDL)

USE_SHARED_LIBS	= yes
USE_STATIC_LIBS = yes
STATIC_MODULES	= 

OPENSSL_LIBS	=  -lcrypto -lssl -lcrypto
OPENSSL_INCLUDE = -DOPENSSL_NO_KRB5

LIBREADLINE	= -ledit

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

RADIUSD_MAJOR_VERSION	= 2
RADIUSD_MINOR_VERSION	= 2
RADIUSD_INCRM_VERSION	= 10
RADIUSD_VERSION		= 020210
RADIUSD_VERSION_STRING  = 2.2.10
RADIUSD_VERSION_COMMIT  = 

MODULES			=  rlm_acctlog rlm_acct_unique rlm_always rlm_attr_filter rlm_attr_rewrite rlm_cache rlm_chap rlm_checkval rlm_copy_packet rlm_counter rlm_dbm rlm_detail rlm_digest rlm_dynamic_clients rlm_eap rlm_exec rlm_expiration rlm_expr rlm_fastusers rlm_files rlm_ippool rlm_krb5 rlm_ldap rlm_linelog rlm_logintime rlm_mschap rlm_ns_mta_md5 rlm_otp rlm_pam rlm_pap rlm_passwd rlm_perl rlm_policy rlm_preprocess rlm_python rlm_radutmp rlm_realm rlm_replicate rlm_soh rlm_sql rlm_sqlcounter rlm_sqlippool rlm_sql_log rlm_unix rlm_wimax
HOSTINFO		= armv6--netbsdelf-eabihf

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
