Define PATH_MAX and MAXPATHLEN for GNU/Hurd compatibility #5046
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On GNU Hurd systems (such as Debian GNU/Hurd), Fontforge failed to build from source (FTBFS) because of
MAXPATHLEN
andPATH_MAX
being undefined on Hurd, e.g.Special thanks to fellow Debian Developers @henrich, @ucko and @kilobyte for reporting the issue and offering suggestions on a fix back in 2017; see #3119 and https://bugs.debian.org/877795.
Hurd's philosophy of using dynamic memory allocation for these variables aside (thanks to @jtanx for the reference), defining
PATH_MAX
andMAXPATHLEN
as4096
for GNU Hurd (distinguished by its unique__GNU__
definition) is an easy and non-intrusive solution that would make Fontforge truly universal, as can be seen in the Fontforge build for all 23 architectures that Debian builds for at https://buildd.debian.org/status/package.php?p=fontforge.This patch has been tested to build successfully on Hurd (and all architectures) with the Debian release of fontforge (1:20201107~dfsg-4) on 2021-01-15.
Fixes #3119
Type of change