Skip to content

Commit

Permalink
Allow building --without-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
DanTheMann15 authored and nikias committed Nov 3, 2023
1 parent 74499fe commit f2a166b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 13 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([strdup strerror strcasecmp strndup malloc realloc calloc])

# Checks for libraries.
AC_CHECK_HEADERS([readline/readline.h], [],
[AC_MSG_ERROR([Please install readline development headers])]
)

# Check additional platform flags
AC_MSG_CHECKING([for platform-specific build settings])
case ${host_os} in
Expand Down Expand Up @@ -100,6 +95,19 @@ if test "$ac_cv_attribute_constructor" = "yes"; then
AC_DEFINE(HAVE_ATTRIBUTE_CONSTRUCTOR, 1, [Define if the C compiler supports constructor/destructor attributes])
fi

AC_ARG_WITH([tools],
[AS_HELP_STRING([--with-tools], [Build irecovery tools. (requires readline) [default=yes]])],
[],
[with_tools=yes])

AS_IF([test "x$with_tools" = "xyes"], [
AC_DEFINE(BUILD_TOOLS, 1, [Define if we are building irecovery tools])
AC_CHECK_HEADERS([readline/readline.h], [],
[AC_MSG_ERROR([Please install readline development headers])]
)]
)
AM_CONDITIONAL(BUILD_TOOLS, test "x$with_tools" = "xyes")

AC_ARG_WITH([dummy],
[AS_HELP_STRING([--with-dummy], [Use no USB driver at all [default=no]. This is only useful if you just want to query the device list by product type or hardware model. All other operations are no-ops or will return IRECV_E_UNSUPPORTED.])],
[],
Expand Down
2 changes: 2 additions & 0 deletions tools/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
if BUILD_TOOLS
AM_CPPFLAGS = -I$(top_srcdir)/include

AM_CFLAGS = $(GLOBAL_CFLAGS) $(libusb_CFLAGS)
Expand All @@ -9,3 +10,4 @@ irecovery_SOURCES = irecovery.c
irecovery_CFLAGS = $(AM_CFLAGS)
irecovery_LDFLAGS = $(AM_LDFLAGS)
irecovery_LDADD = $(top_builddir)/src/libirecovery-1.0.la
endif

0 comments on commit f2a166b

Please sign in to comment.