Skip to content

Commit

Permalink
Link with -lintl if needed
Browse files Browse the repository at this point in the history
Some libc implementations like uclibc or musl provides
gettext stubs via libintl library. Without it, build will fail on:

/home/fabrice/buildroot/output/host/bin/arm-linux-gcc -o cifsiostat -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -Wall -Wstrict-prototypes -pipe -O2 cifsiostat.o librdstats_light.a libsyscom.a -s
/home/fabrice/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-musleabihf/8.3.0/../../../../arm-buildroot-linux-musleabihf/bin/ld: tapestat.o: in function `usage':
tapestat.c:(.text+0x44c): undefined reference to `libintl_gettext'

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  • Loading branch information
ffontaine committed Apr 5, 2020
1 parent 4d98f41 commit 1b4185b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ ifeq ($(SYSPARAM),y)
DFLAGS += -DHAVE_SYS_PARAM_H
endif
NLS = @NLS@
LFLAGS += @LFINTL@
ifeq ($(NLS),y)
REQUIRE_NLS = -DUSE_NLS -DPACKAGE=\"$(PACKAGE)\" -DLOCALEDIR=\"$(NLS_DIR)\"
endif
Expand Down
2 changes: 2 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ else
NLS="n"
fi
AC_MSG_RESULT($AUX_NLS)
AC_CHECK_LIB(intl, gettext, LFINTL="-lintl")
AC_SUBST(LFINTL)
LACKING_GETTEXT="n"
if test $AUX_NLS = "yes" && test x$MSGFMT != x"msgfmt"; then
echo "WARNING: msgfmt command not found!"
Expand Down

0 comments on commit 1b4185b

Please sign in to comment.