|
1 | 1 | dnl $Id$ |
2 | 2 | dnl Process this file with autoconf to produce a configure script. |
3 | 3 | dnl |
4 | | -dnl Copyright 2015-2021 Karl Berry <tex-live@tug.org> |
| 4 | +dnl Copyright 2015-2026 Karl Berry <tex-live@tug.org> |
5 | 5 | dnl Copyright 2009-2015 Peter Breitenlohner <tex-live@tug.org> |
6 | 6 | dnl |
7 | 7 | dnl This file is free software; the copyright holder |
@@ -42,25 +42,27 @@ AC_CHECK_DECLS([putenv]) |
42 | 42 | AC_REPLACE_FUNCS([putenv]) |
43 | 43 |
|
44 | 44 | if test "x$ac_cv_func_getcwd" = xyes; then |
45 | | -# We only need to run this if we have getcwd. |
46 | | -AC_CACHE_CHECK([whether getcwd uses fork or vfork], |
| 45 | + # We only need to run this if we have getcwd. |
| 46 | + # Don't declare getcwd(), since C23 doesn't allow empty parens. |
| 47 | + # Instead, we just have to hope that it's declared where it should be. |
| 48 | + AC_CACHE_CHECK([whether getcwd uses fork or vfork], |
47 | 49 | [kb_cv_func_getcwd_forks], |
48 | | - [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> |
49 | | - int fork() { exit(1); } |
| 50 | + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h> |
| 51 | + int fork() { exit(1); } |
50 | 52 | int vfork() { exit(1); } |
51 | | - extern char *getcwd(); |
52 | 53 | char path[100];]], |
53 | 54 | [[getcwd(path,100);]])], |
54 | 55 | [kb_cv_func_getcwd_forks=no], |
55 | 56 | [kb_cv_func_getcwd_forks=yes], |
56 | 57 | [kb_cv_func_getcwd_forks=no])]) |
57 | | -if test "x$kb_cv_func_getcwd_forks" = xyes; then |
58 | | - AC_DEFINE([GETCWD_FORKS], 1, |
| 58 | + if test "x$kb_cv_func_getcwd_forks" = xyes; then |
| 59 | + AC_DEFINE([GETCWD_FORKS], 1, |
59 | 60 | [Define to 1 if getcwd is implemented using fork or vfork. |
60 | | - Let me know if you have to add this by hand because configure |
61 | | - failed to detect it.]) |
62 | | -fi |
63 | | -fi |
| 61 | + Email tex-k@tug.org with your system info and config.log if |
| 62 | + you have to add this by hand because configure failed to |
| 63 | + detect it.]) |
| 64 | + fi # forks=yes |
| 65 | +fi # have_getcwd |
64 | 66 |
|
65 | 67 | KPSE_COND_MINGW32 |
66 | 68 |
|
|
0 commit comments