[Olsr-cvs] olsrd-current Makefile.inc,1.35,1.36

Bernd Petrovitsch (spam-protected)
Sat Oct 20 21:27:35 CEST 2007


Update of /cvsroot/olsrd/olsrd-current
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20173

Modified Files:
	Makefile.inc 
Log Message:
- added "-fomit-frame-pointer" to the normal build
. start a new era on configuration:
We introduce a new higher level configuratino layer to enable or disable
features/configuration options:

Rationale: Take "debug build" as prime example.
To have a real debug build, you want (at least) "-g" in CFLAGS and no
stripping. It is cumbersome and error prone to edit that by hand (or pass
parameters to the "make") and with a new options somewhere (e.g.
"-fomit-frame-pointer" from above) one has to adjust that.
For these (so called) high leveloptions, I started with
---  snip  ----
# activate debugging with 1 or deactivate with 0
DEBUG ?= 0

# the optimize option to be set for gcc
OPTIMIZE ?= -O2

# enable mudflap with 1 or deactivate with 0
# you need a recent enough gcc and the libmudflap installed
MUDFLAP ?= 0
---  snip  ----
Feel free to propose other useful ones (and submit patches;-).

The lower part, which is basically the former Makefile.inc, gets now "ifeq"
etc. so that a simple "make DEBUG=1" makes a real debug build.
ANd this is available and usefule to the plugin Makeifle's too of course.



Index: Makefile.inc
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** Makefile.inc	13 Oct 2007 14:51:32 -0000	1.35
--- Makefile.inc	20 Oct 2007 19:27:33 -0000	1.36
***************
*** 1,2 ****
--- 1,25 ----
+ ######################
+ #
+ # Highlevel configuration options for all
+ #
+ # $Id$
+ #
+ 
+ # activate debugging with 1 or deactivate with 0
+ DEBUG ?= 0
+ 
+ # the optimize option to be set for gcc
+ OPTIMIZE ?= -O2
+ 
+ # enable mudflap with 1 or deactivate with 0
+ # you need a recent enough gcc and the libmudflap installed
+ MUDFLAP ?= 0
+ 
+ 
+ ######################
+ #
+ # Lowlevel options and rules
+ #
+ 
  # programs
  CCACHE ?=       $(shell which ccache 2> /dev/null)
***************
*** 6,10 ****
--- 29,37 ----
  CC ?= 		$(CCACHE) gcc
  endif
+ ifeq ($(DEBUG),0)
  STRIP ?=	strip
+ else
+ STRIP ?=	:
+ endif
  BISON ?=	bison
  FLEX ?=		flex
***************
*** 22,26 ****
  CFGFILE ?= $(ETCDIR)/$(CFGNAME)
  
! CPPFLAGS =	-Isrc -I$(TOPDIR)/src
  
  # add gcc warnings and optimizations if CFLAGS not set
--- 49,56 ----
  CFGFILE ?= $(ETCDIR)/$(CFGNAME)
  
! CPPFLAGS =	-Isrc
! ifneq ($(TOPDIR),.)
! CPPFLAGS +=	-I$(TOPDIR)/src
! endif
  
  # add gcc warnings and optimizations if CFLAGS not set
***************
*** 41,45 ****
--- 71,78 ----
  WARNINGS +=	-Wno-deprecated-declarations
  #WARNINGS +=	-Wredundant-decls
+ ifeq ($(MUDFLAP),0)
+ # work around a bug in gcc-4.*
  WARNINGS +=	-Wnested-externs
+ endif
  # Alas, htons() triggers this so we can't seriously activate it.
  #WARNINGS +=	-Wunreachable-code
***************
*** 49,52 ****
--- 82,88 ----
  WARNINGS +=	-finline-functions-called-once
  WARNINGS +=	-fearly-inlining
+ ifeq ($(DEBUG),0)
+ WARNINGS +=	-fomit-framepointers
+ endif
  # we have small inline functions in src/lq_route.c which should always be inlined
  WARNINGS +=	-finline-limit=50
***************
*** 54,59 ****
  endif
  CFLAGS +=	$(WARNINGS)
! CFLAGS +=	-O2
! #CFLAGS +=	-g
  CFLAGS +=	$(EXTRA_CFLAGS)
  
--- 90,94 ----
  endif
  CFLAGS +=	$(WARNINGS)
! CFLAGS +=	$(OPTIMIZE)
  CFLAGS +=	$(EXTRA_CFLAGS)
  
***************
*** 61,64 ****
--- 96,102 ----
  CPPFLAGS +=	$(OS_CFLAG_PTHREAD)
  endif
+ ifneq ($(MUDFLAP),0)
+ CFLAGS +=	-fmudflapth
+ endif
  
  ifdef OLSRD_PLUGIN
***************
*** 71,74 ****
--- 109,116 ----
  LDFLAGS +=	-Wl,-export-dynamic 
  endif
+ ifneq ($(MUDFLAP),0)
+ LIBS +=		-lmudflapth
+ endif
+ LIBS +=		$(OS_LIB_PTHREAD)
  
  ###################################
***************
*** 77,81 ****
  
  # we have plugins with the old interface
! CPPFLAGS +=	-DSUPPORT_OLD_PLUGIN_VERSIONS=1
  
  # search sources and headers in current dir and in src/
--- 119,123 ----
  
  # we have plugins with the old interface
! #CPPFLAGS +=	-DSUPPORT_OLD_PLUGIN_VERSIONS=1
  
  # search sources and headers in current dir and in src/
***************
*** 102,109 ****
  
  # debugging or non-debugging flags
! ifdef DEBUG
  CPPFLAGS +=	-DDEBUG
! endif
! ifdef NODEBUG
  CPPFLAGS +=	-DNODEBUG
  endif
--- 144,152 ----
  
  # debugging or non-debugging flags
! ifeq ($(DEBUG),1)
  CPPFLAGS +=	-DDEBUG
! CFLAGS +=	-g
! else
! CPPFLAGS +=	-DNDEBUG
  CPPFLAGS +=	-DNODEBUG
  endif





More information about the Olsr-cvs mailing list