delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2012/12/19/12:15:50

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
X-Authenticated: #27081556
X-Provags-ID: V01U2FsdGVkX19uzzk0DcVuu6ZEP8MTTPKgoC/fr4hrYc3J2wieFD
HhvROIZ0gUH5yP
Message-ID: <50D1F335.8060504@gmx.de>
Date: Wed, 19 Dec 2012 18:02:45 +0100
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Small fix for /djgpp/tests/makefile.inc
X-Y-GMX-Trusted: 0
Reply-To: djgpp-workers AT delorie DOT com

When the testsuite is compiled a lot of warnings like this:
   cc1.exe: note: obsolete option -I- used, please use -iquote instead
are generated.  This is because -I- is hardcoded in the GCC variable.
To solve this issue I have followed the same approach than in the
makefiles in the /src directory.  Especially the file gcc.opt is generated
by the makefile instead of using the one distributed.  Of course they are
identical except for the value of $(IQUOTE) that will be set according
to the used gcc version.

Regards,

Juan M. Guerrero


2012-12-15  Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>

     * djgpp/tests/makefile.inc:  Do not use -I- and create test suite specific gcc.opt.







diff -aprNU5 djgpp.orig/tests/makefile.inc djgpp/tests/makefile.inc
--- djgpp.orig/tests/makefile.inc    2002-12-16 11:40:08 +0000
+++ djgpp/tests/makefile.inc    2012-12-15 10:12:36 +0000
@@ -3,11 +3,11 @@

  include $(TOP)/../makefile.def

  .SUFFIXES: .o .i .c .cc .s

-GCC = gcc @$(TOP)/../gcc.opt -I. -I- -I$(TOP)/../../include $(CFLAGS) -c $<
+GCC = gcc @$(TOP)/../gcc.opt -I. -I$(TOP)/../../include $(CFLAGS) -c $<

  %.o : %.c
      $(GCC)
  %.o : %.cc
      $(GCC)
@@ -64,20 +64,59 @@ EXE = @${TOP}/../../bin/stubify.exe $@

  %.err : %.exp %.out
      -diff $^ > $@
      cat $@

-all :: $(EXES)
+all :: $(TOP)/../../src/misc.exe config $(EXES)
      @rem.com

  tests :: $(ERRS)

  testclean ::
      -rm -f *.out *.err

  clean :: testclean
-    -rm -f *.exe *.o *.d *.i
+    -rm -f *.exe *.o *.d *.i $(TOP)/../gcc.opt

  DEPS := $(wildcard *.d)
  ifneq ($(DEPS),)
  include $(DEPS)
  endif
+
+
+GCC_MAJOR := $(word 3, $(shell $(TOP)/../../src/misc.exe | $(CROSS_GCC) -E -dD -x c - | egrep 'define\ *__GNUC__'))
+GCC_MINOR := $(word 3, $(shell $(TOP)/../../src/misc.exe | $(CROSS_GCC) -E -dD -x c - | egrep 'define\ *__GNUC_MINOR__'))
+
+MTUNE := -mcpu=i586
+IQUOTE := -I. -I-
+
+ifeq ($(GCC_MAJOR),3)
+ifeq ($(GCC_MINOR),4)
+MTUNE := -mtune=i586
+endif
+endif
+
+ifeq ($(GCC_MAJOR),4)
+MTUNE := -mtune=i586
+IQUOTE := -iquote .
+endif
+
+config:    $(TOP)/../gcc.opt
+
+$(TOP)/../gcc.opt:
+    @$(TOP)/../../src/misc.exe echo - "-MD" >$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-O3" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "$(MTUNE)" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-march=i386" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-Wall" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-Wbad-function-cast" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-Wcast-qual" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-Werror" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-Wpointer-arith" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-Wshadow" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-Wstrict-prototypes" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-Wwrite-strings" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "-nostdinc" >>$(TOP)/../gcc.opt
+    @$(TOP)/../../src/misc.exe echo - "$(IQUOTE)" >>$(TOP)/../gcc.opt
+
+$(TOP)/../../src/misc.exe : $(TOP)/../../src/misc.c
+    gcc -O2 $(TOP)/../../src/misc.c -o $(TOP)/../../src/misc.exe

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019