diff options
Diffstat (limited to 'gl/m4/getprogname.m4')
| -rw-r--r-- | gl/m4/getprogname.m4 | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/gl/m4/getprogname.m4 b/gl/m4/getprogname.m4 index b67c527c..90f34c74 100644 --- a/gl/m4/getprogname.m4 +++ b/gl/m4/getprogname.m4 | |||
| @@ -1,16 +1,34 @@ | |||
| 1 | # getprogname.m4 - check for getprogname or replacements for it | 1 | # getprogname.m4 |
| 2 | # serial 8 | ||
| 3 | dnl Copyright (C) 2016-2025 Free Software Foundation, Inc. | ||
| 4 | dnl This file is free software; the Free Software Foundation | ||
| 5 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 6 | dnl with or without modifications, as long as this notice is preserved. | ||
| 7 | dnl This file is offered as-is, without any warranty. | ||
| 2 | 8 | ||
| 3 | # Copyright (C) 2016-2023 Free Software Foundation, Inc. | 9 | # Check for getprogname or replacements for it |
| 4 | # This file is free software; the Free Software Foundation | ||
| 5 | # gives unlimited permission to copy and/or distribute it, | ||
| 6 | # with or without modifications, as long as this notice is preserved. | ||
| 7 | |||
| 8 | # serial 4 | ||
| 9 | 10 | ||
| 10 | AC_DEFUN([gl_FUNC_GETPROGNAME], | 11 | AC_DEFUN([gl_FUNC_GETPROGNAME], |
| 11 | [ | 12 | [ |
| 12 | AC_CHECK_FUNCS_ONCE([getprogname getexecname]) | 13 | AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) |
| 14 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | ||
| 15 | gl_CHECK_FUNCS_ANDROID([getprogname], [[#include <stdlib.h>]]) | ||
| 16 | if test $ac_cv_func_getprogname = no; then | ||
| 17 | HAVE_GETPROGNAME=0 | ||
| 18 | case "$gl_cv_onwards_func_getprogname" in | ||
| 19 | future*) REPLACE_GETPROGNAME=1 ;; | ||
| 20 | esac | ||
| 21 | fi | ||
| 22 | AC_CHECK_DECLS([program_invocation_name], | ||
| 23 | [], | ||
| 24 | [HAVE_DECL_PROGRAM_INVOCATION_NAME=0], | ||
| 25 | [[#include <errno.h>]]) | ||
| 26 | ]) | ||
| 27 | |||
| 28 | AC_DEFUN([gl_PREREQ_GETPROGNAME], | ||
| 29 | [ | ||
| 13 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | 30 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
| 31 | AC_CHECK_FUNCS_ONCE([getexecname]) | ||
| 14 | ac_found=0 | 32 | ac_found=0 |
| 15 | AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], | 33 | AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], |
| 16 | [#include <errno.h>]) | 34 | [#include <errno.h>]) |
