Skip to content

Commit

Permalink
build: Move _XOPEN_SOURCE_EXTENDED define to config.h
Browse files Browse the repository at this point in the history
This allows configure tests to utilize the macro.
Also explain the reasons that we define _XOPEN_SOURCE_EXTENDED and not
_XOPEN_SOURCE.

Signed-off-by: Kang-Che Sung <[email protected]>
  • Loading branch information
Explorer09 authored and BenBE committed Dec 14, 2024
1 parent 3b66b20 commit de93847
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pixmap_DATA = htop.png
appicondir = $(datadir)/icons/hicolor/scalable/apps
appicon_DATA = htop.svg

AM_CFLAGS += -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR="\"$(sysconfdir)\"" -I"$(top_srcdir)/$(my_htop_platform)"
AM_CFLAGS += -DSYSCONFDIR="\"$(sysconfdir)\"" -I"$(top_srcdir)/$(my_htop_platform)"
AM_LDFLAGS =

myhtopsources = \
Expand Down
16 changes: 16 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ esac
# Enable extensions, required by hwloc scripts
AC_USE_SYSTEM_EXTENSIONS

# The header of ncurses exposes wide-character interfaces only if
# _XOPEN_SOURCE_EXTENDED is defined or _XOPEN_SOURCE defined to be
# >= 500. In DragonFly BSD, FreeBSD and OpenBSD, defining
# _XOPEN_SOURCE to any value *hides* interfaces that would be useful
# for htop.
dnl
dnl Note: The "#undef" in AH_VERBATIM will be replaced with "#define"
dnl when config.h is generated.
AH_VERBATIM([_XOPEN_SOURCE_EXTENDED],
[/* Enables XPG4v2 (SUSv1) interfaces if they are not enabled already with _XOPEN_SOURCE */
#ifndef _XOPEN_SOURCE_EXTENDED
#undef _XOPEN_SOURCE_EXTENDED
#endif
])
AC_DEFINE([_XOPEN_SOURCE_EXTENDED], 1)

# Activate some more of the missing global defines
AC_SYS_LARGEFILE

Expand Down

0 comments on commit de93847

Please sign in to comment.