NetBSD/external/lgpl3/gmp
nonaka b593b49cd1 external/lgpl3/gmp build fail in configure phase with "ln -s J /etc/malloc.conf".
patch from pkgsrc/devel/gmp
  http://mail-index.netbsd.org/pkgsrc-changes/2017/06/15/msg158404.html
2017-10-19 03:26:28 +00:00
..
dist external/lgpl3/gmp build fail in configure phase with "ln -s J /etc/malloc.conf". 2017-10-19 03:26:28 +00:00
lib/libgmp updates for GMP 6.1.2 and most platforms. run tested on i386, amd64, 2017-08-22 09:59:37 +00:00
Makefile.arch updates for GMP 6.1.2 and most platforms. run tested on i386, amd64, 2017-08-22 09:59:37 +00:00
Makefile.netbsd-gmp update these for GMP 6.1.2, and start to make it more automatic. 2017-08-22 09:57:18 +00:00
README mp.h was removed a while ago. update the README to note this, and 2017-08-17 23:00:38 +00:00
build-gmp-Makefile.inc.awk update these for GMP 6.1.2, and start to make it more automatic. 2017-08-22 09:57:18 +00:00

README

$NetBSD: README,v 1.7 2017/08/17 23:00: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.  you can use the makefile
	  "Makefile.netbsd-gmp" in this directory to run this with the
	  right options, etc.  run it with nbmake-$MACHINE.

	- 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

	  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", and make sure that
	  CONFIG_TOP_SRCDIR is not defined in config.m4

	  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.

This mips64* ports need some minor hacks to the generated gmp*.h
files to fix their library builds for compat issues.  See these
files in:
	http://mail-index.netbsd.org/source-changes/2011/07/10/msg024467.html


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


mrg@netbsd.org
- 2011/06/22