[parted-devel] [PATCH] libparted/labels: link with libiconv if needed

Arnout Vandecappelle (Essensium/Mind) arnout at mind.be
Sun Nov 5 22:33:37 UTC 2017


gpt.c uses iconv so it should link with it. Otherwise, on platforms
where libiconv is a separate library, we get a link failure of parted:

    CCLD     parted
  ../libparted/.libs/libparted.so: undefined reference to `libiconv'
  ../libparted/.libs/libparted.so: undefined reference to `libiconv_open'
  ../libparted/.libs/libparted.so: undefined reference to `libiconv_close'

Since iconv functionality is needed unconditionally (not only when
gettext is enabled), AM_ICONV needs to be added to configure.ac.
---
 configure.ac                 | 2 ++
 libparted/labels/Makefile.am | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index d158793..738c697 100644
--- a/configure.ac
+++ b/configure.ac
@@ -288,6 +288,8 @@ fi
 AC_PROG_LIBTOOL
 LT_INIT
 
+AM_ICONV
+
 AM_GNU_GETTEXT_VERSION([0.18])
 AM_GNU_GETTEXT([external])
 if test "$USE_INCLUDED_LIBINTL" = "yes"; then
diff --git a/libparted/labels/Makefile.am b/libparted/labels/Makefile.am
index 3327c8c..db612d1 100644
--- a/libparted/labels/Makefile.am
+++ b/libparted/labels/Makefile.am
@@ -36,7 +36,7 @@ liblabels_la_SOURCES = \
   rdb.c		\
   sun.c
 
-liblabels_la_LIBADD = $(OS_LIBS) $(INTLLIBS)
+liblabels_la_LIBADD = $(OS_LIBS) $(INTLLIBS) $(LIBICONV)
 
 AM_CPPFLAGS = $(partedincludedir) $(INTLINCS)
 
-- 
2.15.0




More information about the parted-devel mailing list