| @@ -1,61 +1,59 @@ | | | @@ -1,61 +1,59 @@ |
1 | $NetBSD: README,v 1.6 2013/12/04 11:43:52 mrg Exp $ | | 1 | $NetBSD: README,v 1.7 2017/08/17 23:00:38 mrg Exp $ |
2 | | | 2 | |
3 | GMP in NetBSD. We need GMP for GCC >= 4.2. | | 3 | GMP in NetBSD. We need GMP for GCC >= 4.2. |
4 | | | 4 | |
5 | | | 5 | |
6 | Building GMP without configure - how to port GMP build to a new platform. | | 6 | Building GMP without configure - how to port GMP build to a new platform. |
7 | | | 7 | |
8 | The GMP build doesn't map very well to normal make. The ./configure phase | | 8 | The GMP build doesn't map very well to normal make. The ./configure phase |
9 | creates a bunch of symlinks and weeds out the sources lists, and there are | | 9 | creates a bunch of symlinks and weeds out the sources lists, and there are |
10 | files with the same name in different subdirectories linked into the same | | 10 | files with the same name in different subdirectories linked into the same |
11 | final product. All of these issues need to be dealt with. | | 11 | final product. All of these issues need to be dealt with. |
12 | | | 12 | |
13 | There are a few steps to this: | | 13 | There are a few steps to this: |
14 | | | 14 | |
15 | - run ./configure, save the output. you can use the makefile | | 15 | - run ./configure, save the output. you can use the makefile |
16 | "Makefile.netbsd-gmp" in this directory to run this with the | | 16 | "Makefile.netbsd-gmp" in this directory to run this with the |
17 | right options, etc. run it with nbmake-$MACHINE. | | 17 | right options, etc. run it with nbmake-$MACHINE. |
18 | | | 18 | |
19 | - create src/external/gpl3/gmp/lib/libgmp/arch/${MACHINE_ARCH} dir, | | 19 | - create src/external/gpl3/gmp/lib/libgmp/arch/${MACHINE_ARCH} dir, |
20 | and copy these files into it: | | 20 | and copy these files into it: |
21 | config.h | | 21 | config.h |
22 | config.m4 | | 22 | config.m4 |
23 | gmp-mparam.h | | 23 | gmp-mparam.h |
24 | gmp.h | | 24 | gmp.h |
25 | mp.h | | | |
26 | | | 25 | |
27 | some of these files might have src/obj references. in particular | | 26 | some of these files might have src/obj references. in particular |
28 | fix GMP_MPARAM_H_SUGGEST to start from ./mpn/... and make sure | | 27 | fix GMP_MPARAM_H_SUGGEST to start from ./mpn/... and make sure |
29 | we #define __GMP_CC to "gcc -std=gnu99", and make sure that | | 28 | we #define __GMP_CC to "gcc -std=gnu99", and make sure that |
30 | CONFIG_TOP_SRCDIR is not defined in config.m4 | | 29 | CONFIG_TOP_SRCDIR is not defined in config.m4 |
31 | | | 30 | |
32 | XXX make this automatic | | 31 | XXX make this automatic |
33 | | | 32 | |
34 | | | 33 | |
35 | - parse the ./configure output and note all created symlinks | | 34 | - parse the ./configure output and note all created symlinks |
36 | for mpn. these need to be converted into a new Makefile.inc. | | 35 | for mpn. these need to be converted into a new Makefile.inc. |
37 | there is a script in this subdir build-gmp-Makefile.inc.awk | | 36 | there is a script in this subdir build-gmp-Makefile.inc.awk |
38 | that can be used to do this. it should just work to generate | | 37 | that can be used to do this. it should just work to generate |
39 | the first section of Makefile.inc if fed the entire configure | | 38 | the first section of Makefile.inc if fed the entire configure |
40 | output. | | 39 | output. |
41 | | | 40 | |
42 | assembler files generally want -DOPERATION_${foo} defined for | | 41 | assembler files generally want -DOPERATION_${foo} defined for |
43 | each way they are compiled or pre-processed. the pre-processor | | 42 | each way they are compiled or pre-processed. the pre-processor |
44 | used is m4 to parse, and we and create .s files from the .asm | | 43 | used is m4 to parse, and we and create .s files from the .asm |
45 | files that we then we feed into $CC. | | 44 | files that we then we feed into $CC. |
46 | | | 45 | |
47 | The amd64 port is a good reference to compare. The trialdivtab.h | | 46 | The amd64 port is a good reference to compare. |
48 | generation may need to be moved the into libgmp/Makefile itself. | | | |
49 | | | 47 | |
50 | This mips64* ports need some minor hacks to the generated gmp*.h | | 48 | This mips64* ports need some minor hacks to the generated gmp*.h |
51 | files to fix their library builds for compat issues. See these | | 49 | files to fix their library builds for compat issues. See these |
52 | files in: | | 50 | files in: |
53 | http://mail-index.netbsd.org/source-changes/2011/07/10/msg024467.html | | 51 | http://mail-index.netbsd.org/source-changes/2011/07/10/msg024467.html |
54 | | | 52 | |
55 | | | 53 | |
56 | This is still a work in progress and methods used to build may be | | 54 | This is still a work in progress and methods used to build may be |
57 | changed at any time. | | 55 | changed at any time. |
58 | | | 56 | |
59 | | | 57 | |
60 | mrg@netbsd.org | | 58 | mrg@netbsd.org |
61 | - 2011/06/22 | | 59 | - 2011/06/22 |