* meson.build: Fix build for other UNIX systems (e.g., FreeBSD).
Without this change the build of `unix/ftsystem.c` fails because the `ftconfig.h` header that defines macros such as `HAVE_UNISTD_H` and `HAVE_FCNTL_H` is only being generated for Linux, macOS, and Cygwin systems: ``` .../builds/unix/ftsystem.c:258:32: error: use of undeclared identifier 'O_RDONLY' file = open( filepathname, O_RDONLY ); ``` Instead of hardcoding a list of operating systems for this check, update the logic that decides whether to build the file and set a boolean flag that can be checked instead.
This commit is contained in:
parent
825b7ea2f2
commit
c5516e0f7c
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,22 @@
|
||||||
|
2021-07-12 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
|
||||||
|
|
||||||
|
* meson.build: Fix build for other UNIX systems (e.g., FreeBSD).
|
||||||
|
|
||||||
|
Without this change the build of `unix/ftsystem.c` fails because the
|
||||||
|
`ftconfig.h` header that defines macros such as `HAVE_UNISTD_H` and
|
||||||
|
`HAVE_FCNTL_H` is only being generated for Linux, macOS, and Cygwin
|
||||||
|
systems:
|
||||||
|
|
||||||
|
```
|
||||||
|
.../builds/unix/ftsystem.c:258:32: error:
|
||||||
|
use of undeclared identifier 'O_RDONLY'
|
||||||
|
file = open( filepathname, O_RDONLY );
|
||||||
|
```
|
||||||
|
|
||||||
|
Instead of hardcoding a list of operating systems for this check,
|
||||||
|
update the logic that decides whether to build the file and set a
|
||||||
|
boolean flag that can be checked instead.
|
||||||
|
|
||||||
2021-07-12 Werner Lemberg <wl@gnu.org>
|
2021-07-12 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
[autofit] More clean-ups.
|
[autofit] More clean-ups.
|
||||||
|
|
|
@ -193,6 +193,7 @@ has_sys_mman_h = cc.has_header('sys/mman.h')
|
||||||
|
|
||||||
mmap_option = get_option('mmap')
|
mmap_option = get_option('mmap')
|
||||||
|
|
||||||
|
use_unix_ftsystem_c = false
|
||||||
if mmap_option.disabled()
|
if mmap_option.disabled()
|
||||||
ft2_sources += files(['src/base/ftsystem.c',])
|
ft2_sources += files(['src/base/ftsystem.c',])
|
||||||
elif host_machine.system() == 'windows'
|
elif host_machine.system() == 'windows'
|
||||||
|
@ -201,6 +202,7 @@ else
|
||||||
if has_unistd_h and has_fcntl_h and has_sys_mman_h
|
if has_unistd_h and has_fcntl_h and has_sys_mman_h
|
||||||
# This version of `ftsystem.c` uses `mmap` to read input font files.
|
# This version of `ftsystem.c` uses `mmap` to read input font files.
|
||||||
ft2_sources += files(['builds/unix/ftsystem.c',])
|
ft2_sources += files(['builds/unix/ftsystem.c',])
|
||||||
|
use_unix_ftsystem_c = true
|
||||||
elif mmap_option.enabled()
|
elif mmap_option.enabled()
|
||||||
error('mmap was enabled via options but is not available,'
|
error('mmap was enabled via options but is not available,'
|
||||||
+ ' required headers were not found!')
|
+ ' required headers were not found!')
|
||||||
|
@ -321,7 +323,7 @@ if has_fcntl_h
|
||||||
ftconfig_command += '--enable=HAVE_FCNTL_H'
|
ftconfig_command += '--enable=HAVE_FCNTL_H'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if host_machine.system() in ['linux', 'darwin', 'cygwin']
|
if use_unix_ftsystem_c
|
||||||
ftconfig_h_in = files('builds/unix/ftconfig.h.in')
|
ftconfig_h_in = files('builds/unix/ftconfig.h.in')
|
||||||
ftconfig_h = custom_target('ftconfig.h',
|
ftconfig_h = custom_target('ftconfig.h',
|
||||||
input: ftconfig_h_in,
|
input: ftconfig_h_in,
|
||||||
|
|
Loading…
Reference in New Issue