diff options
Diffstat (limited to 'doc/INSTALL')
-rw-r--r-- | doc/INSTALL | 70 |
1 files changed, 68 insertions, 2 deletions
diff --git a/doc/INSTALL b/doc/INSTALL index f0b3e87b..aad0a5e5 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -109,6 +109,35 @@ If you use the 'configure' program, be sure to edit config.mk _after_ you run 'configure', since 'configure' generates config.mk. +COMPILED-IN BUILD DATETIME +-------------------------- + +By default, the Netpbm build system builds the datetime that you built it +into libnetpbm, so the --version global command line option can display it. +It's actually just when you began building from a clean build tree; if you +modify code and rebuild, the build datetime does not change. + +This is problematic for any of various reasons you might want to compare two +versions of libnetpbm, or anything of which it is part, for equality. Two +libnetpbms that are identical except that they were built at different times +would compare as different. + +Furthermore, as version information, the modification datetime of the source +code is often more useful than the build datetime. + +For these reasons, it is possible to change this timestamping behavior by +setting the environment variable 'SOURCE_DATE_EPOCH'. That is supposed to be +the POSIX datetime value (decimal number of seconds since 1969, excluding leap +seconds) for when the source code was last modified. When you set this, +before doing 'make' for the first time in a clean build tree, the resulting +libnetpbm contains that information and not build datetime information, and +the --version global option causes a different message. + +The name and meaning of the environment variable is taken from a standard +described at https://reproducible-builds.org/specs/source-date-epoch/ on March +16, 2017. + + AUTOMATING THE BUILD -------------------- @@ -153,6 +182,45 @@ Netpbm has also been built for Windows using Djgpp, as late as 2001. See also the general installation instructions above. +Mingw Modification +------------------- + +With at least some versions of MinGW, you have to make a small change to +_mingw.h or you get a compilation failure for invalid syntax in that file +where it expands the macro _XOPEN_SOURCE. + +The problem is that many Netpbm programs declare that they need a C library +that conforms to any version of the X/Open (XPG, XSI, SUS) standard. The way +they do that is, in accordance with the earliest version of that standard, by +defining the macro _XOPEN_SOURCE with a null (zero-length) body. But MinGW is +not designed to work with programs that request anything earlier than Issue +(version) 5 of this standard, and in fact _mingw.h will not compile if the +macro expands to something other than a number. + +But it is easy to add pre-Issue 5 function to MinGW and having done so, your +MinGW installation will also work with lots of other code. All you have to do +is change + + if _XOPEN_SOURCE < 500 + +to + + if (_XOPEN_SOURCE + 0) < 500 + +in _mingw.h. This is the trick other C libraries use. + +(A user proposed that this change be distributed in _mingw.h, in April 2017 on +the mingw-users mailing list, but the maintainer was opposed to accomodating +programs written for the older standards). + +If you cannot change _mingw.h, you can alternatively change Netpbm. Find all +instances of + + #define _XOPEN_SOURCE + +and change them to + + #define _XOPEN_SOURCE 0 INSTALLATION - MAKING ONLY THE PARTS YOU NEED @@ -428,5 +496,3 @@ link is picking up the old system version instead. Why? Because the link options say to search /usr/lib _before_ the local build directory. And they do that because libpng-config erroneously says that you need a -L /usr/lib link option to find the Libpng library. - - |