public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH] Allow to disable components
@ 2016-10-14  1:56 Akihiko Odaki
  0 siblings, 0 replies; 4+ messages in thread
From: Akihiko Odaki @ 2016-10-14  1:56 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

Hi,

I actually want only libelf, but I don't think it makes sense to split 
elfutils into libelf and others.
Actually the patch doesn't consider the dependencies. The change of argp 
check should be a mistake. I'll send a new patch to solve those issues. 
The testsuite will also be updated.

Regards,
Akihiko Odaki

On 2016-10-13 18:51, Mark Wielaard wrote:
> Hi,
>
> We this split up and why do you want to enable/disable these specific
> parts?
>
> I don't think it makes sense to be able to not build the ebl backends
> (unless you don't build libasm, libdw and also not the tools - only
> libelf doesn't directly use the backends). And obviously various tools
> won't build if you disable either libdw or libasm. And libasm won't
> build without libdw.
>
> arpg is part of the libdwfl interface, so isn't really specific to the
> tools.
>
> Cheers,
>
> Mark
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Allow to disable components
@ 2016-10-13 10:04 Mark Wielaard
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Wielaard @ 2016-10-13 10:04 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

On Thu, 2016-10-13 at 11:51 +0200, Mark Wielaard wrote:
> We this split up and why do you want to enable/disable these specific
> parts?
> 
> I don't think it makes sense to be able to not build the ebl backends
> (unless you don't build libasm, libdw and also not the tools - only
> libelf doesn't directly use the backends). And obviously various tools
> won't build if you disable either libdw or libasm. And libasm won't
> build without libdw.
> 
> arpg is part of the libdwfl interface, so isn't really specific to the
> tools.

And again, the testsuite needs to be adapted to skip any tests that
don't make sense when some parts are disabled.

Thanks,

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Allow to disable components
@ 2016-10-13  9:51 Mark Wielaard
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Wielaard @ 2016-10-13  9:51 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

Hi,

We this split up and why do you want to enable/disable these specific
parts?

I don't think it makes sense to be able to not build the ebl backends
(unless you don't build libasm, libdw and also not the tools - only
libelf doesn't directly use the backends). And obviously various tools
won't build if you disable either libdw or libasm. And libasm won't
build without libdw.

arpg is part of the libdwfl interface, so isn't really specific to the
tools.

Cheers,

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Allow to disable components
@ 2016-10-11 14:11 Akihiko Odaki
  0 siblings, 0 replies; 4+ messages in thread
From: Akihiko Odaki @ 2016-10-11 14:11 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 6931 bytes --]

Signed-off-by: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
---
 Makefile.am  |  27 +++++++++++++--
 configure.ac | 107 ++++++++++++++++++++++++++++++++++++++++++-----------------
 lib/system.h |   9 ++++-
 3 files changed, 110 insertions(+), 33 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2ff444e..7abd95f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,8 +27,31 @@ AM_MAKEFLAGS = --no-print-directory
 pkginclude_HEADERS = version.h
 
 # Add doc back when we have some real content.
-SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \
-	  backends src po tests
+SUBDIRS = config m4 libelf po tests
+
+if ENABLE_LIBEU
+SUBDIRS += lib
+endif
+
+if ENABLE_LIBEBL
+SUBDIRS += libebl
+endif
+
+if ENABLE_LIBDW
+SUBDIRS += libdwelf libdwfl libdw
+endif
+
+if ENABLE_LIBEBL
+SUBDIRS += libcpu backends
+endif
+
+if ENABLE_LIBASM
+SUBDIRS += libasm
+endif
+
+if ENABLE_TOOLS
+SUBDIRS += src
+endif
 
 EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
 	     COPYING COPYING-GPLV2 COPYING-LGPLV3
diff --git a/configure.ac b/configure.ac
index e5503f1..cf6a59c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -214,6 +214,28 @@ AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
 	       [tests_use_rpath=$enableval], [tests_use_rpath=no])
 AM_CONDITIONAL(TESTS_RPATH, test "$tests_use_rpath" = yes)
 
+AC_ARG_ENABLE([tools],
+AS_HELP_STRING([--disable-tools], [do not build tools]),
+	       [tools=$enableval], [tools=yes])
+AM_CONDITIONAL(ENABLE_TOOLS, test "$tools" = yes)
+
+AC_ARG_ENABLE([libasm],
+AS_HELP_STRING([--disable-libasm], [do not build libasm]),
+	       [libasm=$enableval], [libasm=yes])
+AM_CONDITIONAL(ENABLE_LIBASM, test "$libasm" = yes)
+
+AC_ARG_ENABLE([libdw],
+AS_HELP_STRING([--disable-libdw], [do not build libdw]),
+	       [libdw=$enableval], [libdw=yes])
+AM_CONDITIONAL(ENABLE_LIBDW, test "$libdw" = yes)
+
+AC_ARG_ENABLE([libebl],
+AS_HELP_STRING([--disable-libebl], [do not build libebl]),
+	       [libebl=$enableval], [libebl=yes])
+AM_CONDITIONAL(ENABLE_LIBEBL, test "$libebl" = yes)
+
+AM_CONDITIONAL(ENABLE_LIBEU, test "$libdw" = yes -o "$libebl" = yes)
+
 LIBEBL_SUBDIR="$PACKAGE"
 AC_ARG_ENABLE([libebl-subdir],
 AS_HELP_STRING([--enable-libebl-subdir=DIR],
@@ -306,30 +328,32 @@ CFLAGS="$old_CFLAGS"])
 AM_CONDITIONAL(HAVE_NULL_DEREFERENCE_WARNING,
 	       [test "x$ac_cv_null_dereference" != "xno"])
 
-dnl Check if we have argp available from our libc
-AC_LINK_IFELSE(
-	[AC_LANG_PROGRAM(
-		[#include <argp.h>],
-		[int argc=1; char *argv[]={"test"}; argp_parse(0,argc,&argv,0,0,0); return 0;]
-		)],
-	[libc_has_argp="true"],
-	[libc_has_argp="false"]
-)
-
-dnl If our libc doesn't provide argp, then test for libargp
-if test "$libc_has_argp" = "false" ; then
-	AC_MSG_WARN("libc does not have argp")
-	AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
-
-	if test "$have_argp" = "false"; then
-		AC_MSG_ERROR("no libargp found")
+if test "$tools" = yes ; then
+	dnl Check if we have argp available from our libc
+	AC_LINK_IFELSE(
+		[AC_LANG_PROGRAM(
+			[#include <argp.h>],
+			[int argc=1; char *argv[]={"test"}; argp_parse(0,argc,&argv,0,0,0); return 0;]
+			)],
+		[libc_has_argp="true"],
+		[libc_has_argp="false"]
+	)
+
+	dnl If our libc doesn't provide argp, then test for libargp
+	if test "$libc_has_argp" = "false" ; then
+		AC_MSG_WARN("libc does not have argp")
+		AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
+
+		if test "$have_argp" = "false"; then
+			AC_MSG_ERROR("no libargp found")
+		else
+			argp_LDADD="-largp"
+		fi
 	else
-		argp_LDADD="-largp"
+		argp_LDADD=""
 	fi
-else
-	argp_LDADD=""
+	AC_SUBST([argp_LDADD])
 fi
-AC_SUBST([argp_LDADD])
 
 dnl Check if we have <linux/bpf.h> for EM_BPF disassembly.
 AC_CHECK_HEADERS(linux/bpf.h)
@@ -348,29 +372,47 @@ dnl ELF library.
 AC_CONFIG_FILES([libelf/Makefile])
 
 dnl Higher-level ELF support library.
-AC_CONFIG_FILES([libebl/Makefile])
+if test "$libebl" = yes ; then
+	AC_CONFIG_FILES([libebl/Makefile])
+fi
 
 dnl DWARF-ELF Lower-level Functions support library.
-AC_CONFIG_FILES([libdwelf/Makefile])
+if test "$libdw" = yes; then
+	AC_CONFIG_FILES([libdwelf/Makefile])
+fi
 
 dnl DWARF library.
-AC_CONFIG_FILES([libdw/Makefile])
+if test "$libdw" = yes; then
+	AC_CONFIG_FILES([libdw/Makefile])
+fi
 
 dnl Higher-level DWARF support library.
-AC_CONFIG_FILES([libdwfl/Makefile])
+if test "$libdw" = yes; then
+	AC_CONFIG_FILES([libdwfl/Makefile])
+fi
 
 dnl CPU handling library.
-AC_CONFIG_FILES([libcpu/Makefile])
+if test "$libebl" = yes; then
+	AC_CONFIG_FILES([libcpu/Makefile])
+fi
 
 dnl Assembler library.
-AM_CONDITIONAL(HAVE_LIBASM, true)dnl Used in tests/Makefile.am, which see.
-AC_CONFIG_FILES([libasm/Makefile])
+AM_CONDITIONAL(HAVE_LIBASM, test "$libasm" = yes)dnl Used in tests/Makefile.am, which see.
+if test "$libasm" = yes; then
+	AC_CONFIG_FILES([libasm/Makefile])
+fi
 
 dnl CPU-specific backend libraries.
-AC_CONFIG_FILES([backends/Makefile])
+if test "$libebl" = yes; then
+	AC_CONFIG_FILES([backends/Makefile])
+fi
 
 dnl Tools.
-AC_CONFIG_FILES([src/Makefile po/Makefile.in])
+if test "$tools" = yes ; then
+	AC_CONFIG_FILES([src/Makefile])
+fi
+
+AC_CONFIG_FILES([po/Makefile.in])
 
 dnl Test suite.
 AM_CONDITIONAL(STANDALONE, false)dnl Used in tests/Makefile.am, which see.
@@ -384,6 +426,11 @@ AC_CONFIG_FILES([config/libelf.pc config/libdw.pc])
 AC_SUBST(USE_NLS, yes)
 AM_PO_SUBDIRS
 
+AH_TEMPLATE([ENABLE_TOOLS], [Defined if the tools will be built.])
+if test "$tools" = yes ; then
+	AC_DEFINE([ENABLE_TOOLS])
+fi
+
 dnl Appended to the config.h file.
 dnl We hide all kinds of configuration magic in lib/eu-config.h.
 AH_BOTTOM([#include <eu-config.h>])
diff --git a/lib/system.h b/lib/system.h
index f31cfd0..6391dec 100644
--- a/lib/system.h
+++ b/lib/system.h
@@ -29,7 +29,12 @@
 #ifndef LIB_SYSTEM_H
 #define LIB_SYSTEM_H	1
 
-#include <argp.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#ifdef ENABLE_TOOLS
+# include <argp.h>
+#endif
 #include <stddef.h>
 #include <stdint.h>
 #include <endian.h>
@@ -126,6 +131,7 @@ pread_retry (int fd, void *buf, size_t len, off_t off)
 }
 
 
+#ifdef ENABLE_TOOLS
 /* We need define two variables, argp_program_version_hook and
    argp_program_bug_address, in all programs.  argp.h declares these
    variables as non-const (which is correct in general).  But we can
@@ -136,6 +142,7 @@ pread_retry (int fd, void *buf, size_t len, off_t off)
    __asm ("argp_program_version_hook")
 #define ARGP_PROGRAM_BUG_ADDRESS_DEF \
   const char *const apba__ __asm ("argp_program_bug_address")
+#endif
 
 
 /* The demangler from libstdc++.  */
-- 
2.10.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-14  1:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-14  1:56 [PATCH] Allow to disable components Akihiko Odaki
  -- strict thread matches above, loose matches on Subject: below --
2016-10-13 10:04 Mark Wielaard
2016-10-13  9:51 Mark Wielaard
2016-10-11 14:11 Akihiko Odaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).