Skip to content

Commit

Permalink
autoconf: update some of the m4 library
Browse files Browse the repository at this point in the history
Update some files in the m4 library. This also updates
config/unconfig.h to match.

Signed-off-by: H. Peter Anvin <[email protected]>
  • Loading branch information
H. Peter Anvin committed Nov 4, 2024
1 parent ef5fd53 commit 25757f8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
9 changes: 5 additions & 4 deletions autoconf/m4/pa_add_flags.m4
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
dnl --------------------------------------------------------------------------
dnl PA_ADD_FLAGS(flagvar, flags)
dnl PA_ADD_FLAGS(flagvar, flags [, real-flags [, success [, failure]]])
dnl
dnl Add [flags] to the variable [flagvar] if and only if it is accepted
dnl by all languages affected by [flagvar], if those languages have
dnl been previously seen in the script.
dnl Add [real-flags] (default [flags]) to the variable [flagvar] if
dnl and only if [flags] are accepted by all languages affected by
dnl [flagvar], if those languages have been previously seen in the
dnl script.
dnl --------------------------------------------------------------------------
AC_DEFUN([PA_ADD_FLAGS],
[
Expand Down
1 change: 1 addition & 0 deletions autoconf/m4/pa_common_attributes.m4
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ AC_DEFUN([PA_COMMON_ATTRIBUTES],
PA_FUNC_ATTRIBUTE(const)
PA_FUNC_ATTRIBUTE(pure)
PA_FUNC_ATTRIBUTE(cold,,,,,unlikely_func)
PA_FUNC_ATTRIBUTE(used)
PA_FUNC_ATTRIBUTE(unused)
PA_FUNC_ATTRIBUTE_ERROR])
2 changes: 2 additions & 0 deletions autoconf/m4/pa_option_debug.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ AC_DEFUN([PA_OPTION_DEBUG],
[PA_ADD_LANGFLAGS([-g3])], [PA_ADD_LANGFLAGS([-ggdb3 -g3])])
PA_ARG_ENABLED([debug], [optimize for debugging],
[PA_ADD_LANGFLAGS([-Og -O0])
AC_DEFINE([WITH_DEBUG], 1,
[Define to 1 to include code specifically indended to help debugging.])
$1],
[$2])])
5 changes: 4 additions & 1 deletion autoconf/m4/pa_option_profiling.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ dnl Try to enable profiling if --enable-profiling is set.
dnl --------------------------------------------------------------------------
AC_DEFUN([PA_OPTION_PROFILING],
[PA_ARG_ENABLED([profiling], [compile with profiling (-pg option)],
[PA_ADD_LANGFLAGS([-pg])])])
[PA_ADD_LANGFLAGS([-pg])
AC_DEFINE([WITH_PROFILING], 1,
[Define to 1 to include code specifically indended to help profiling.])
])])
16 changes: 16 additions & 0 deletions config/unconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,22 @@
# endif
#endif

#ifndef used_func
# ifdef HAVE_FUNC_ATTRIBUTE_USED
# define used_func ATTRIBUTE(used)
# else
# define used_func
# endif
#endif

#ifndef used_func_ptr
# ifdef HAVE_FUNC_PTR_ATTRIBUTE_USED
# define used_func_ptr ATTRIBUTE(used)
# else
# define used_func_ptr
# endif
#endif

#ifndef unused_func
# ifdef HAVE_FUNC_ATTRIBUTE_UNUSED
# define unused_func ATTRIBUTE(unused)
Expand Down

0 comments on commit 25757f8

Please sign in to comment.