diff options
Diffstat (limited to 'gl/m4/getprogname.m4')
| -rw-r--r-- | gl/m4/getprogname.m4 | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/gl/m4/getprogname.m4 b/gl/m4/getprogname.m4 index b67c527c..b24f4480 100644 --- a/gl/m4/getprogname.m4 +++ b/gl/m4/getprogname.m4 | |||
| @@ -1,16 +1,33 @@ | |||
| 1 | # getprogname.m4 - check for getprogname or replacements for it | 1 | # getprogname.m4 |
| 2 | # serial 8 | ||
| 3 | dnl Copyright (C) 2016-2024 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. | ||
| 2 | 7 | ||
| 3 | # Copyright (C) 2016-2023 Free Software Foundation, Inc. | 8 | # 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 | 9 | ||
| 10 | AC_DEFUN([gl_FUNC_GETPROGNAME], | 10 | AC_DEFUN([gl_FUNC_GETPROGNAME], |
| 11 | [ | 11 | [ |
| 12 | AC_CHECK_FUNCS_ONCE([getprogname getexecname]) | 12 | AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) |
| 13 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | ||
| 14 | gl_CHECK_FUNCS_ANDROID([getprogname], [[#include <stdlib.h>]]) | ||
| 15 | if test $ac_cv_func_getprogname = no; then | ||
| 16 | HAVE_GETPROGNAME=0 | ||
| 17 | case "$gl_cv_onwards_func_getprogname" in | ||
| 18 | future*) REPLACE_GETPROGNAME=1 ;; | ||
| 19 | esac | ||
| 20 | fi | ||
| 21 | AC_CHECK_DECLS([program_invocation_name], | ||
| 22 | [], | ||
| 23 | [HAVE_DECL_PROGRAM_INVOCATION_NAME=0], | ||
| 24 | [[#include <errno.h>]]) | ||
| 25 | ]) | ||
| 26 | |||
| 27 | AC_DEFUN([gl_PREREQ_GETPROGNAME], | ||
| 28 | [ | ||
| 13 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | 29 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
| 30 | AC_CHECK_FUNCS_ONCE([getexecname]) | ||
| 14 | ac_found=0 | 31 | ac_found=0 |
| 15 | AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], | 32 | AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], |
| 16 | [#include <errno.h>]) | 33 | [#include <errno.h>]) |
