GCC_VERSION_GE_45 := $(shell g++ -dumpversion | gawk '{print $$1>=4.5?"1":"0"}')
ifeq ($(GCC_VERSION_GE_45),1)
AM_CXXFLAGS +=-Wunreachable-code
endif
Note the use of double $ sign inside gawk script.
In Autoconf/Automake:
1. Add the following line to configure.ac
AM_CONDITIONAL(GCC_GE_45, test `g++ -dumpversion | gawk '{print $1>=4.5?"1":"0"}'` = 1)
In Autoconf/Automake:
1. Add the following line to configure.ac
AM_CONDITIONAL(GCC_GE_45, test `g++ -dumpversion | gawk '{print $1>=4.5?"1":"0"}'` = 1)
2. Add the following line to Makefile.am
include $(top_srcdir)/common.mk
3. Add the following lines to common.mk
if GCC_GE_45
AM_CXXFLAGS +=-Wunreachable-code
endif
Blinding! - thanks, that was just what I needed (even the version number...)
ReplyDeleteLionel
Thanks a lot !!! I looked it in all Internet and you gave me the solution ...
ReplyDeleteThank you, just what I needed!
ReplyDelete