[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getconf.c breaks --disable-nls
From: |
adamw |
Subject: |
getconf.c breaks --disable-nls |
Date: |
Mon, 03 Oct 2022 06:41:24 -0600 |
Configuration Information [Automatically generated, do not change]:
Machine: amd64
OS: freebsd13.1
Compiler: cc
Compilation CFLAGS: -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong
-isystem /usr/local/include -fno-strict-aliasing
uname output: FreeBSD apnoea.adamw.org 13.1-RELEASE-p2 FreeBSD 13.1-RELEASE-p2
GENERIC amd64
Machine Type: amd64-portbld-freebsd13.1
Bash Version: 5.2
Patch Level: 0
Release Status: release
Description:
examples/loadables/getconf.c includes libintl.h directly, which breaks
--disable-nls when libintl is not installed in the build environment.
Repeat-By:
In a build environment without libintl, build bash with --disable-nls
cc -fPIC -DHAVE_CONFIG_H -DSHELL -DHEREDOC_PIPESIZE=4096
-DDEFAULT_PATH_VALUE='"/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"'
-DSTANDARD_UTILS_PATH='"/sbin:/bin:/usr/sbin:/usr/bin"' -DLIBICONV_PLUG
-isystem /usr/local/include -D_THREAD_S AFE -O2 -pipe -DLIBICONV_PLUG
-fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -I.
-I.. -I../.. -I../../lib -I../../builtins -I. -I../../include
-I/wrkdirs/usr/ports/shells/bash/work/bash-5.2
-I/wrkdirs/usr/ports/shells/bash/wo rk/bash-5.2/lib
-I/wrkdirs/usr/ports/shells/bash/work/bash-5.2/builtins -c -o getconf.o
getconf.c
getconf.c:24:10: fatal error: 'libintl.h' file not found
#include <libintl.h>
^~~~~~~~~~~
1 error generated.
*** Error code 1
Stop.
make[2]: stopped in
/wrkdirs/usr/ports/shells/bash/work/bash-5.2/examples/loadables
*** Error code 1 (ignored)
Fix:
The fix is that libintl.h should not be included directly. gettext.h
includes
the guards that support --disable-nls.
--- examples/loadables/getconf.c.orig 2022-10-01 03:42:16 UTC
+++ examples/loadables/getconf.c
@@ -21,7 +21,7 @@
#include <unistd.h>
#include <errno.h>
#include <error.h>
-#include <libintl.h>
+#include <gettext.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
- getconf.c breaks --disable-nls,
adamw <=