Author: Pino Toscano <toscano.pino@tiscali.it>
Description: Add --disable-elf
 Add a configure switch to disable the build of the ELF plugin.
 .
 This is needed to disable the ELF plugin on big endian architectures, as it
 seems to not work on those architectures.
 .
 Drop this patch once the ELF plugin works fine also on big endian
 architectures (and thus building it unconditionally).
Bug: https://bugs.gnunet.org/view.php?id=8514
Forwarded: not-needed
Last-Update: 2024-05-12

--- a/configure.ac
+++ b/configure.ac
@@ -443,6 +443,12 @@ AC_LANG_POP(C++)
 LIBS=$LIBSOLD
 
 
+AC_ARG_ENABLE([elf],
+   [AS_HELP_STRING([--disable-elf], [disable ELF plugin (default is enabled)])],
+   [enable_elf=${enableval}],
+   [enable_elf=yes])
+AM_CONDITIONAL([ENABLE_ELF], [test "x$enable_elf" = "xyes"])
+
 
 # should 'make check' run tests?
 AC_MSG_CHECKING(whether to run tests)
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -165,10 +165,14 @@ PLUGIN_ZLIB= \
 TEST_ZLIB=test_deb
 endif
 
+if ENABLE_ELF
+PLUGIN_ELF=libextractor_elf.la
+TEST_ELF=test_elf
+endif
+
 
 plugin_LTLIBRARIES = \
   libextractor_dvi.la \
-  libextractor_elf.la \
   libextractor_it.la \
   libextractor_man.la \
   libextractor_nsf.la \
@@ -181,6 +185,7 @@ plugin_LTLIBRARIES = \
   libextractor_wav.la \
   libextractor_xm.la \
   $(PLUGIN_ARCHIVE) \
+  $(PLUGIN_ELF) \
   $(PLUGIN_EXIV2) \
   $(PLUGIN_FLAC) \
   $(PLUGIN_GIF) \
@@ -205,7 +210,6 @@ endif
 
 check_PROGRAMS = \
   test_dvi \
-  test_elf \
   test_it \
   test_man \
   test_nsf \
@@ -221,6 +225,7 @@ check_PROGRAMS = \
   test_xm \
   test_zip \
   $(TEST_ARCHIVE) \
+  $(TEST_ELF) \
   $(TEST_EXIV2) \
   $(TEST_FLAC) \
   $(TEST_GIF) \
