minix/external/lgpl3/gmp
Lionel Sambuc 0cdf705cc6 Enable optional GCC install and GCC improvements
-By adding MKGCC=yes and MKGCCCMDS=yes on the make commandline
   it is now possible to compile and install GCC on the system.

   Before doing this, if you are not using the build.sh script,
   you will need to call the fetch scripts in order to retrieve
   the sources of GCC and its dependencies.

 -Reduce difference with NetBSD share/mk

   Move Minix-specific parameters from bsd.gcc.mk to bsd.own.mk,
   which is anyway patched, so that bsd.gcc.mk is now aligned
   on the NetBSD version.

 -Clean libraries dependencies, compiles stdc++ only if gcc is
   also compiled (it is part of the gcc sources)

 -Correct minix.h header sequence, cleanup spec headers.

 -Fix cross-compilation from a 32bit host targeting MINIX/arm

Change-Id: I1b234af18eed4ab5675188244e931b2a2b7bd943
2013-07-12 14:22:03 +02:00
..
lib/libgmp Enable optional GCC install and GCC improvements 2013-07-12 14:22:03 +02:00
patches Toolchain upgrade and portability improvements. 2012-11-15 16:07:29 +01:00
build-gmp-Makefile.inc.awk Import lib{mpc,gmp,mpfr} 2012-06-25 09:15:27 +00:00
fetch.sh Cross compile on minix support 2012-11-15 16:07:30 +01:00
Makefile.netbsd-gmp Import lib{mpc,gmp,mpfr} 2012-06-25 09:15:27 +00:00
README Import lib{mpc,gmp,mpfr} 2012-06-25 09:15:27 +00:00

$NetBSD: README,v 1.3 2012/03/20 08:21:38 mrg Exp $

GMP in NetBSD.  We need GMP for GCC >= 4.2.


Building GMP without configure - how to port GMP build to a new platform.

The GMP build doesn't map very well to normal make.  The ./configure phase
creates a bunch of symlinks and weeds out the sources lists, and there are
files with the same name in different subdirectories linked into the same
final product.  All of these issues need to be dealt with.

There are a few steps to this:

	- run ./configure, save the output

	- create src/external/gpl3/gmp/lib/libgmp/arch/${MACHINE_ARCH} dir,
	  and copy these files into it:
		config.h
		config.m4
		gmp-mparam.h
		gmp.h
		mp.h

	  some of these files might have src/obj references.  in particular
	  fix GMP_MPARAM_H_SUGGEST to start from ./mpn/... and make sure
	  we #define __GMP_CC to "gcc -std=gnu99".  XXX  make this automatic


	- parse the ./configure output and note all created symlinks
	  for mpn.  these need to be converted into a new Makefile.inc.
	  there is a script in this subdir build-gmp-Makefile.inc.awk
	  that can be used to do this.  it should just work to generate
	  the first section of Makefile.inc if fed the entire configure
	  output.

	  assembler files generally want -DOPERATION_${foo} defined for
	  each way they are compiled or pre-processed.  the pre-processor
	  used is m4 to parse, and we and create .s files from the .asm
	  files that we then we feed into $CC.

The amd64 port is a good reference to compare.  The trialdivtab.h
generation may need to be moved the into libgmp/Makefile itself.


This is still a work in progress and methods used to build may be
changed at any time.


mrg@netbsd.org
- 2011/06/22