2013-01-06 06:22:49 +01:00
|
|
|
Allow the usage of an external implementation of the argp functions
|
|
|
|
|
|
|
|
uClibc lack the argp family of functions that glibc has. Therefore, we
|
|
|
|
add a check in the configure script to see if argp_parse is available
|
|
|
|
in the C library. If not, we look if it is available in the additional
|
|
|
|
'argp' library. If so, we link against that library. If not, we error
|
|
|
|
out.
|
|
|
|
|
|
|
|
This allows to build elfutils against uClibc with an external argp
|
|
|
|
library.
|
|
|
|
|
2014-11-11 12:47:44 +01:00
|
|
|
Based on the former patch by Thomas Petazzoni.
|
|
|
|
|
2013-01-06 06:22:49 +01:00
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
2014-11-11 12:47:44 +01:00
|
|
|
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
|
2013-01-06 06:22:49 +01:00
|
|
|
|
2014-11-11 12:47:44 +01:00
|
|
|
diff -rup a/configure.ac b/configure.ac
|
2015-01-06 13:02:06 +01:00
|
|
|
--- a/configure.ac 2015-01-06 11:30:02.170052875 +0000
|
|
|
|
+++ b/configure.ac 2015-01-06 11:31:10.122219826 +0000
|
|
|
|
@@ -253,6 +253,13 @@ AC_SUBST([LIBEBL_SUBDIR])
|
|
|
|
AC_DEFINE_UNQUOTED(LIBEBL_SUBDIR, "$LIBEBL_SUBDIR")
|
|
|
|
AH_TEMPLATE([LIBEBL_SUBDIR], [$libdir subdirectory containing libebl modules.])
|
|
|
|
|
2013-01-06 06:22:49 +01:00
|
|
|
+AC_CHECK_FUNC([argp_parse])
|
|
|
|
+if test "$ac_cv_func_argp_parse" != yes; then
|
2014-11-11 12:47:44 +01:00
|
|
|
+ AC_CHECK_LIB([argp],[argp_parse],ARGP_LIBS=-largp,
|
2013-01-06 06:22:49 +01:00
|
|
|
+ AC_MSG_ERROR([No argp_parse function available.]))
|
|
|
|
+fi
|
|
|
|
+AC_SUBST(ARGP_LIBS)
|
|
|
|
+
|
|
|
|
dnl Test for zlib and bzlib, gives ZLIB/BZLIB .am
|
|
|
|
dnl conditional and config.h USE_ZLIB/USE_BZLIB #define.
|
|
|
|
save_LIBS="$LIBS"
|
2014-11-11 12:47:44 +01:00
|
|
|
diff -rup a/libdw/Makefile.am b/libdw/Makefile.am
|
2015-01-06 13:02:06 +01:00
|
|
|
--- a/libdw/Makefile.am 2014-12-19 20:43:11.000000000 +0000
|
|
|
|
+++ b/libdw/Makefile.am 2015-01-06 11:32:21.075438524 +0000
|
|
|
|
@@ -112,7 +112,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map l
|
|
|
|
-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
|
|
|
|
-Wl,--version-script,$<,--no-undefined \
|
|
|
|
-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
|
2014-11-11 12:47:44 +01:00
|
|
|
- -ldl $(zip_LIBS)
|
|
|
|
+ -ldl $(zip_LIBS) $(ARGP_LIBS)
|
2015-01-06 13:02:06 +01:00
|
|
|
@$(textrel_check)
|
|
|
|
ln -fs $@ $@.$(VERSION)
|
|
|
|
|
2014-11-11 12:47:44 +01:00
|
|
|
diff -rup a/src/Makefile.am b/src/Makefile.am
|
2015-01-06 13:02:06 +01:00
|
|
|
--- a/src/Makefile.am 2015-01-06 11:30:02.430057339 +0000
|
|
|
|
+++ b/src/Makefile.am 2015-01-06 11:34:53.061049752 +0000
|
2014-11-11 12:47:44 +01:00
|
|
|
@@ -94,27 +94,29 @@ readelf_no_Werror = yes
|
|
|
|
strings_no_Werror = yes
|
|
|
|
addr2line_no_Wformat = yes
|
2015-01-06 13:02:06 +01:00
|
|
|
|
2014-11-11 12:47:44 +01:00
|
|
|
-readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl
|
|
|
|
+readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl $(ARGP_LIBS)
|
|
|
|
nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl \
|
2013-01-06 06:22:49 +01:00
|
|
|
- $(demanglelib)
|
2014-11-11 12:47:44 +01:00
|
|
|
-size_LDADD = $(libelf) $(libeu)
|
|
|
|
-strip_LDADD = $(libebl) $(libelf) $(libeu) -ldl
|
|
|
|
-ld_LDADD = $(libebl) $(libelf) $(libeu) -ldl
|
2013-01-06 06:22:49 +01:00
|
|
|
+ $(demanglelib) $(ARGP_LIBS)
|
2014-11-11 12:47:44 +01:00
|
|
|
+size_LDADD = $(libelf) $(libeu) $(ARGP_LIBS)
|
|
|
|
+strip_LDADD = $(libebl) $(libelf) $(libeu) -ldl $(ARGP_LIBS)
|
|
|
|
+ld_LDADD = $(libebl) $(libelf) $(libeu) -ldl $(ARGP_LIBS)
|
2013-01-06 06:22:49 +01:00
|
|
|
if NATIVE_LD
|
|
|
|
# -ldl is always needed for libebl.
|
|
|
|
ld_LDADD += libld_elf.a
|
|
|
|
endif
|
|
|
|
ld_LDFLAGS = -rdynamic
|
2014-11-11 12:47:44 +01:00
|
|
|
-elflint_LDADD = $(libebl) $(libelf) $(libeu) -ldl
|
|
|
|
-findtextrel_LDADD = $(libdw) $(libelf)
|
|
|
|
-addr2line_LDADD = $(libdw) $(libelf)
|
|
|
|
-elfcmp_LDADD = $(libebl) $(libelf) -ldl
|
|
|
|
-objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) -ldl
|
|
|
|
-ranlib_LDADD = libar.a $(libelf) $(libeu)
|
|
|
|
-strings_LDADD = $(libelf) $(libeu)
|
|
|
|
-ar_LDADD = libar.a $(libelf) $(libeu)
|
|
|
|
-unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) -ldl
|
|
|
|
-stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) -ldl $(demanglelib)
|
|
|
|
+elflint_LDADD = $(libebl) $(libelf) $(libeu) -ldl $(ARGP_LIBS)
|
|
|
|
+findtextrel_LDADD = $(libdw) $(libelf) $(ARGP_LIBS)
|
|
|
|
+addr2line_LDADD = $(libdw) $(libelf) $(ARGP_LIBS)
|
|
|
|
+elfcmp_LDADD = $(libebl) $(libelf) -ldl $(ARGP_LIBS)
|
|
|
|
+objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) -ldl \
|
2013-01-06 06:22:49 +01:00
|
|
|
+ $(ARGP_LIBS)
|
2014-11-11 12:47:44 +01:00
|
|
|
+ranlib_LDADD = libar.a $(libelf) $(libeu) $(ARGP_LIBS)
|
|
|
|
+strings_LDADD = $(libelf) $(libeu) $(ARGP_LIBS)
|
|
|
|
+ar_LDADD = libar.a $(libelf) $(libeu) $(ARGP_LIBS)
|
|
|
|
+unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) -ldl $(ARGP_LIBS)
|
|
|
|
+stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) -ldl \
|
|
|
|
+ $(demanglelib) $(ARGP_LIBS)
|
2015-01-06 13:02:06 +01:00
|
|
|
|
2013-01-06 06:22:49 +01:00
|
|
|
ldlex.o: ldscript.c
|
|
|
|
ldlex_no_Werror = yes
|