do less alloc/free
[freeradius.git] / Make.inc.in
index 854c485..a69292e 100644 (file)
@@ -47,12 +47,12 @@ MAKEFLAGS   = @FR_MAKEFLAGS@
 
 CC             = @CC@
 RANLIB         = @RANLIB@
-INCLUDE                = -I${top_srcdir} -I${top_srcdir}/src \
-                 -include ${top_srcdir}/src/freeradius-devel/autoconf.h \
-                 -include ${top_srcdir}/src/freeradius-devel/build.h \
-                 -include ${top_srcdir}/src/freeradius-devel/features.h \
-                 -include ${top_srcdir}/src/freeradius-devel/radpaths.h
-CFLAGS         = $(INCLUDE) -std=c99 -fno-strict-aliasing @CFLAGS@
+INCLUDE                = -I. -Isrc \
+                 -include src/freeradius-devel/autoconf.h \
+                 -include src/freeradius-devel/build.h \
+                 -include src/freeradius-devel/features.h \
+                 -include src/freeradius-devel/radpaths.h
+CFLAGS         = $(INCLUDE) -fno-strict-aliasing @CFLAGS@
 CPPFLAGS       = @CPPFLAGS@
 LIBPREFIX      = @LIBPREFIX@
 EXEEXT         = @EXEEXT@
@@ -76,6 +76,7 @@ TALLOC_LDFLAGS  = @TALLOC_LDFLAGS@
 
 OPENSSL_LIBS    = @OPENSSL_LIBS@
 OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@
+OPENSSL_CPPFLAGS = @OPENSSL_CPPFLAGS@
 
 PCAP_LIBS      = @PCAP_LIBS@
 PCAP_LDFLAGS    = @PCAP_LDFLAGS@
@@ -107,6 +108,8 @@ bm_static_libs  = @USE_STATIC_LIBS@
 STATIC_MODULES = @STATIC_MODULES@
 LIBREADLINE    = @LIBREADLINE@
 
+WITH_DHCP      = @WITH_DHCP@
+
 #
 #  Version to use for packaging and other Make related things
 #
@@ -129,6 +132,7 @@ HOSTINFO    = @HOSTINFO@
 #
 ifeq "$(WITH_OPENSSL)" "yes"
 CFLAGS         +=  -DWITH_OPENSSL_MD4 -DWITH_OPENSSL_MD5
+CPPFLAGS       := "$(OPENSSL_CPPFLAGS) $(CPPFLAGS)"
 endif
 
 OPENSSL_LIBS   = @OPENSSL_LIBS@
@@ -151,68 +155,17 @@ 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
-
-#
-#  Portability cruft.  This is for replacing libtroll && libltdl
-#  with gcc and dlopen().
-#
-ifeq "$(USE_SHARED_LIBS)" "yes"
-LINK_MODE.exe  = -export-dynamic
-CFLAGS         += -fPIC
-else
-LINK_MODE.exe  = -static
-endif
-
-ifneq "$(LIBTOOL)" ""
-COMPILE.c      := $(LIBTOOL) --quiet --mode=compile $(CC)
-LINK.lib       := $(LIBTOOL) --quiet --mode=link $(CC) -rpath $(libdir) -o
-LO             := lo
-LA             := la
-else
-COMPILE.c      := $(CC)
-LO             := o
-
-ifeq "$(USE_SHARED_LIBS)" "yes"
-LINK.lib       := $(CC) -shared -o
-LA             := so
-else
-LINK.lib       := $(AR) cru
-LA             := a
-endif
-
-endif
-
-ifeq "$(LA)" "so"
-ifneq "$(findstring Darwin,$(shell uname -a))" ""
-LA             := dylib
-endif
-endif
-
 # Path to clang, setting this enables the 'scan.*' build targets
 # which perform static analysis on various server components.
 ANALYZE.c       := @clang_path@
 
-ifeq "${CC}" "clang"
-    ifeq "${ANALYZE.c}" ""
-        ANALYZE.c := "${CC}"
-    endif
-endif
-
 #
 #  With shared libs, the test binaries are in a different place
 #  AND the method we use to run those binaries changes.
 #
 ifeq "$(USE_SHARED_LIBS)" "yes"
        TESTBINDIR = ./$(BUILD_DIR)/bin/local
-       TESTBIN    = $(JLIBTOOL) --quiet --mode=execute $(TESTBINDIR)
+       TESTBIN    =  FR_LIBRARY_PATH=./build/lib/.libs $(JLIBTOOL) --quiet --mode=execute $(TESTBINDIR)
 else
        TESTBINDIR = ./$(BUILD_DIR)/bin
        TESTBIN    = ./$(BUILD_DIR)/bin