delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2006/06/17/11:00:55

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Message-ID: <44941915.10406@iki.fi>
Date: Sat, 17 Jun 2006 18:00:37 +0300
From: Andris Pavenis <andris DOT pavenis AT iki DOT fi>
User-Agent: Thunderbird 1.5.0.2 (X11/20060420)
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: djgpp CVS patches
References: <448D3C9E DOT 9090501 AT oberhumer DOT com>
In-Reply-To: <448D3C9E.9090501@oberhumer.com>
Reply-To: djgpp-workers AT delorie DOT com

This is a multi-part message in MIME format.
--------------040804070305070507040509
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Markus F.X.J. Oberhumer kirjoitti:
> As there seems to be some revived activity here it's probably a good 
> time for sending some patches against the current CVS. Please review and 
> apply if you find them useful (fseeko.patch definitely needs some review).
> 

I'm attaching a modified version of build patch:
- added .cvsignore to djgpp/src
- gcc.opt is now generated and depends on GCC version. Included phony 
target to force it being generated at start.
- removed -mcpu from gcc-l.opt. It's used for build time tools only, so
I don't think, that we need it.

I tested with gcc-4.1.1 Linux-to-DJGPP cross-compiler. Additionally GCC 
version detection is tested to work under DJGPP with earlier GCC versions.

One question:
Do we really need '-I. -I-' in compiler options? As far as I understand 
we could replace it with '-iquote .' for gcc-4.X, but earlier versions 
does not accept it. Maybe it could be reasonable to move it inside 
gcc.opt. I don't think this is very significant for gcc-l.opt.

Andris

--------------040804070305070507040509
Content-Type: text/x-patch;
 name="djgpp-build.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="djgpp-build.diff"

Index: .cvsignore
===================================================================
RCS file: .cvsignore
diff -N .cvsignore
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- .cvsignore	17 Jun 2006 14:52:01 -0000
***************
*** 0 ****
--- 1,5 ----
+ *.s
+ *.o
+ *.exe
+ gcc.opt
+ gpp.opt
Index: gcc.opt
===================================================================
RCS file: gcc.opt
diff -N gcc.opt
*** gcc.opt	3 Apr 2002 16:22:25 -0000	1.4
--- /dev/null	1 Jan 1970 00:00:00 -0000
***************
*** 1,19 ****
- -MD
- -O2
- -mcpu=pentium
- -march=i386
- -Wall
- -Wbad-function-cast
- -Wcast-qual
- -Werror
- -Wmissing-declarations
- -Wmissing-prototypes
- -Wpointer-arith
- -Wshadow
- -Wstrict-prototypes
- -Wwrite-strings
- -Wundef
- -Wcast-align
- -Wsign-compare
- -nostdinc
- 
--- 0 ----
Index: genopt.awk
===================================================================
RCS file: genopt.awk
diff -N genopt.awk
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- genopt.awk	17 Jun 2006 14:52:01 -0000
***************
*** 0 ****
--- 1,48 ----
+ # Copyright (C) 2006 DJ Delorie, see COPYING.DJ for details
+ #
+ # For generating gcc.opt corresponding to the used compiler version
+ #
+ BEGIN { major=-1; minor=-1; patchlevel=0; }
+ 
+ $1=="#define" && $2=="__GNUC__" { major=$3; }
+ 
+ $1=="#define" && $2=="__GNUC_MINOR__" { minor=$3; }
+ 
+ $1=="#define" && $2=="__GNUC_PATCHLEVEL__" { patchlevel=$3; }
+ 
+ END {
+ 	if (major == -1 || minor == -1) { ver = 30306; }
+ 		else { ver = 10000*major + 100*minor + patchlevel; }
+ 
+ 	print ver >"gcc.ver"
+ 
+ 	print "-MD"
+ 	print "-O2"
+ 
+ 	if (ver < 30400) { print "-mcpu=pentium" }
+ 		else     { print "-mtune=pentium" }
+ 
+ 	print "-march=i386"
+ 	print "-Wall"
+ 	print "-Wbad-function-cast"
+ 	print "-Wcast-qual"
+ 	print "-Werror"
+ 	print "-Wmissing-declarations"
+ 	print "-Wmissing-prototypes"
+ 	print "-Wpointer-arith"
+ 	print "-Wshadow"
+ 	print "-Wstrict-prototypes"
+ 	print "-Wwrite-strings"
+ 	print "-Wundef"
+ 	print "-Wcast-align"
+ 	print "-Wsign-compare"
+ 	print "-nostdinc"
+ 	
+ # I'm not sure about version here. At least old gcc-3.2.3 (included for compatibility
+ # in Fedora Core 5) does not complain...
+ 	if (ver >= 30400)
+ 	{
+ 	    print "-fno-builtin-cabs"
+ 	    print "-fno-builtin-cabsf"
+ 	}
+ }
Index: makefile
===================================================================
RCS file: /cvs/djgpp/djgpp/src/makefile,v
retrieving revision 1.10
diff -p -r1.10 makefile
*** makefile	28 Jul 2003 20:11:45 -0000	1.10
--- makefile	17 Jun 2006 14:52:01 -0000
***************
*** 11,16 ****
--- 11,18 ----
  # If you don't have ../zoneinfo/src, Make will report (and ignore) an
  # error when it tries to build files there; disregard it.
  
+ GCC = gcc -g -O2
+ 
  MAKEFLAGS := --no-print-directory
  
  DIRS = \
*************** DIRS = \
*** 20,38 ****
  	../info		\
  	../lib
  
! all : misc.exe $(DIRS) makemake.exe subs ../lib/libg.a ../lib/libpc.a
  
  misc.exe : misc.c
! 	gcc -O2 misc.c -o misc.exe
  
  $(DIRS) :
  	./misc.exe mkdir $@
  
  makemake.exe : makemake.c
! 	gcc -O2 makemake.c -o makemake.exe
  
  copyrite.exe : copyrite.cc
! 	gcc -O2 copyrite.cc -o copyrite.exe
  
  subs:
  	$(MAKE) -C djasm native
--- 22,41 ----
  	../info		\
  	../lib
  
! #all : misc.exe clean_gcc.opt gpp.opt $(DIRS) makemake.exe subs ../lib/libg.a ../lib/libpc.a
! all : misc.exe gppopt $(DIRS) makemake.exe subs ../lib/libg.a ../lib/libpc.a
  
  misc.exe : misc.c
! 	$(GCC) misc.c -o misc.exe
  
  $(DIRS) :
  	./misc.exe mkdir $@
  
  makemake.exe : makemake.c
! 	$(GCC) makemake.c -o makemake.exe
  
  copyrite.exe : copyrite.cc
! 	$(GCC) copyrite.cc -o copyrite.exe
  
  subs:
  	$(MAKE) -C djasm native
*************** clean : misc.exe makemake.exe
*** 66,70 ****
--- 69,81 ----
  	$(MAKE) -C djasm clean
  	-$(MAKE) -C ../zoneinfo/src clean
  	$(MAKE) -f makempty clean
+ 	./misc.exe rm gcc.opt
  	./misc.exe rm gpp.opt
  	./misc.exe rm makemake.exe copyrite.exe misc.exe
+ 
+ clean_gcc.opt:
+ 	./misc.exe rm gcc.opt gpp.opt
+ 
+ # Force rebuilding gcc.opt and gpp.opt
+ gppopt:
+ 	$(MAKE) -C libc gppopt
Index: makefile.inc
===================================================================
RCS file: /cvs/djgpp/djgpp/src/makefile.inc,v
retrieving revision 1.10
diff -p -r1.10 makefile.inc
*** makefile.inc	28 Jul 2003 20:11:45 -0000	1.10
--- makefile.inc	17 Jun 2006 14:52:02 -0000
*************** $(HOSTBIN)/%.exe : %
*** 160,168 ****
  all :: $(TOP)/../gpp.opt $(OBJS) $(EXTRA_OBJS) $(EXTRA_FILES)
  	$(NOP)
  
! $(TOP)/../gpp.opt : $(TOP)/../gcc.opt
! 	sed -f $(TOP)/../gpp.sed $< > $@
! 
  
  ifneq ($(MAKEFILE_LIB),1)
  all :: makefile.oh
--- 160,169 ----
  all :: $(TOP)/../gpp.opt $(OBJS) $(EXTRA_OBJS) $(EXTRA_FILES)
  	$(NOP)
  
! gppopt $(TOP)/../gpp.opt:
! 	echo "Generating $(TOP)/../gcc.opt and $(TOP)/../gpp.opt"
! 	$(CROSS_GCC) -E -dD -x c /dev/null | awk -f $(TOP)/../genopt.awk >$(TOP)/../gcc.opt
! 	sed -f $(TOP)/../gpp.sed $(TOP)/../gcc.opt > $(TOP)/../gpp.opt
  
  ifneq ($(MAKEFILE_LIB),1)
  all :: makefile.oh

--------------040804070305070507040509--

- Raw text -


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