2018-06-02 00:46:18 +03:00
|
|
|
$NetBSD: README,v 1.8 2018/06/01 21:46:18 mrg Exp $
|
2011-06-24 07:50:23 +04:00
|
|
|
|
|
|
|
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:
|
|
|
|
|
2013-07-15 12:59:47 +04:00
|
|
|
- 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.
|
2011-06-24 07:50:23 +04:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2012-03-20 12:21:38 +04:00
|
|
|
some of these files might have src/obj references. in particular
|
|
|
|
fix GMP_MPARAM_H_SUGGEST to start from ./mpn/... and make sure
|
2018-06-02 00:46:18 +03:00
|
|
|
we #define __GMP_CC to just "gcc", and make sure that
|
2013-12-04 15:43:52 +04:00
|
|
|
CONFIG_TOP_SRCDIR is not defined in config.m4
|
|
|
|
|
2018-06-02 00:46:18 +03:00
|
|
|
the "Makefile.netbsd-gmp" has a "copy-files" target that performs
|
|
|
|
these tasks.
|
2012-03-20 12:21:38 +04:00
|
|
|
|
2011-06-24 07:50:23 +04:00
|
|
|
- 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.
|
|
|
|
|
2018-06-02 00:46:18 +03:00
|
|
|
this part needs to be automated, but requires that the first
|
|
|
|
part's ./configure output be stored for it. this is not done.
|
2011-06-24 07:50:23 +04:00
|
|
|
|
2018-06-02 00:46:18 +03:00
|
|
|
it would be good to convert the Makefile.inc into a pair of
|
|
|
|
files -- srcs.mk generated from build-gmp-Makefile.inc.awk, and
|
|
|
|
the remaining static part of the Makefile.inc left with the
|
|
|
|
include of srcs.mk.
|
|
|
|
|
|
|
|
The amd64 port is a good reference to compare.
|
2013-12-04 05:03:15 +04:00
|
|
|
|
2011-06-24 07:50:23 +04:00
|
|
|
|
|
|
|
This is still a work in progress and methods used to build may be
|
|
|
|
changed at any time.
|
|
|
|
|
|
|
|
|
|
|
|
mrg@netbsd.org
|
2018-06-02 00:46:18 +03:00
|
|
|
- 2017/08/22
|