[Olsr-cvs] olsrd-current ld-warnings, 1.2, 1.3 gcc-warnings, 1.8, 1.9 Makefile.inc, 1.48, 1.49

Bernd Petrovitsch (spam-protected)
Tue Dec 11 18:16:05 CET 2007


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

Modified Files:
	ld-warnings gcc-warnings Makefile.inc 
Log Message:
- Replaced "which" with a /bin/sh script snippet.
- inspired by Sven-Ola Tücke: avoid a bash'ism (i.e. "OPTS="${OPTS//$opt}") in
  gcc-warnings and ld-warnings. But we do not replace it with `sed` (since it
  costs a fork(2) and an exec(3)) but also with shell code which doesn't use
  any external program.

For a specification of /bin/sh: see
http://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html#tag_02



Index: gcc-warnings
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/gcc-warnings,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** gcc-warnings	6 Dec 2007 22:07:29 -0000	1.8
--- gcc-warnings	11 Dec 2007 17:16:03 -0000	1.9
***************
*** 34,45 ****
              opt="${error#*\"}"
              opt="${opt%\"*}"
-             OPTS="${OPTS//$opt}"
              ;;
          *:\ unrecognized\ *option\ \`*)
              opt="${error#*\`}"
              opt="${opt%\'*}"
!             OPTS="${OPTS//$opt}"
              ;;
         esac
      done
      echo $OPTS
--- 34,55 ----
              opt="${error#*\"}"
              opt="${opt%\"*}"
              ;;
          *:\ unrecognized\ *option\ \`*)
              opt="${error#*\`}"
              opt="${opt%\'*}"
!             ;;
!         *) continue
              ;;
         esac
+        # if we come here, we have in $opt the option to remove. and
+        # we remove all instances. And we save agoinst leading "-"
+        NEW_OPTS=""
+        for o in $OPTS; do
+            case "$o" in
+                $opt) : echo "Removed $o" >&2;;
+                *)    NEW_OPTS="$NEW_OPTS $o";;
+            esac
+        done
+        OPTS="$NEW_OPTS"
      done
      echo $OPTS

Index: Makefile.inc
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** Makefile.inc	6 Dec 2007 20:13:56 -0000	1.48
--- Makefile.inc	11 Dec 2007 17:16:03 -0000	1.49
***************
*** 26,30 ****
  
  # programs
! CCACHE ?=       $(shell which ccache 2> /dev/null)
  ifeq ($(origin CC),default)
  CC = 		$(CCACHE) gcc
--- 26,30 ----
  
  # programs
! CCACHE ?=       $(shell IFS=:; for i in $$PATH;do test -x "$$i/ccache" && echo "$$i/ccache" && break; done)
  ifeq ($(origin CC),default)
  CC = 		$(CCACHE) gcc
***************
*** 92,100 ****
  WARNINGS +=	-Winline
  WARNINGS +=	-Wdisabled-optimization
! #WARNINGS +=	-Werror
  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
--- 92,100 ----
  WARNINGS +=	-Winline
  WARNINGS +=	-Wdisabled-optimization
! #nnnWARNINGS +=	-Werror
  WARNINGS +=	-finline-functions-called-once
  WARNINGS +=	-fearly-inlining
  ifeq ($(DEBUG),0)
! WARNINGS +=	-fomit-frame-pointer
  endif
  # we have small inline functions in src/lq_route.c which should always be inlined
***************
*** 124,128 ****
  # c and ld flags for libraries (plugins)
  CPPFLAGS +=	-DOLSR_PLUGIN
! LDFLAGS +=	-shared -Wl,-soname,$(PLUGIN_NAME)
  LDFLAGS +=	-Wl,--version-script=version-script.txt 
  else
--- 124,129 ----
  # c and ld flags for libraries (plugins)
  CPPFLAGS +=	-DOLSR_PLUGIN
! LDFLAGS +=	-shared
! LDFLAGS +=	-Wl,-soname,$(PLUGIN_NAME)
  LDFLAGS +=	-Wl,--version-script=version-script.txt 
  else

Index: ld-warnings
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/ld-warnings,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ld-warnings	6 Dec 2007 22:07:29 -0000	1.2
--- ld-warnings	11 Dec 2007 17:16:02 -0000	1.3
***************
*** 34,40 ****
              opt="${error#*\'}"
              opt="${opt%\'*}"
!             OPTS="${OPTS//-Wl,$opt}"
              ;;
         esac
      done
      echo $OPTS
--- 34,51 ----
              opt="${error#*\'}"
              opt="${opt%\'*}"
!             ;;
!         *) continue
              ;;
         esac
+        # if we come here, we have in $opt the option to remove. and
+        # we remove all instances. And we save agoinst leading "-"
+        NEW_OPTS=""
+        for o in $OPTS; do
+            case "$o" in
+                -Wl,$opt) : echo "Removed $o" >&2;;
+                *)        NEW_OPTS="$NEW_OPTS $o";;
+            esac
+        done
+        OPTS="$NEW_OPTS"
      done
      echo $OPTS





More information about the Olsr-cvs mailing list