summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2024-11-05 02:55:37 +0100
committerGravatar Nikias Bassen2024-11-05 02:55:37 +0100
commit7a5e6196a8c5fbb8f52c2ccc0d73a5842818b5c1 (patch)
treeabd8791b6884df1ffb4baf65f60a2ce5d001460d
parent2405a807b6b5e4f33ac77a985aa77ea6ca27b49f (diff)
downloadlibirecovery-7a5e6196a8c5fbb8f52c2ccc0d73a5842818b5c1.tar.gz
libirecovery-7a5e6196a8c5fbb8f52c2ccc0d73a5842818b5c1.tar.bz2
Fix conditional compile for libreadline
-rw-r--r--configure.ac5
-rw-r--r--tools/Makefile.am5
-rw-r--r--tools/irecovery.c6
3 files changed, 13 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 4507e85..9b004dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,11 +101,14 @@ AC_ARG_WITH([tools],
101 [with_tools=yes]) 101 [with_tools=yes])
102 102
103AS_IF([test "x$with_tools" = "xyes"], [ 103AS_IF([test "x$with_tools" = "xyes"], [
104 have_readline=no
104 AC_DEFINE(BUILD_TOOLS, 1, [Define if we are building irecovery tools]) 105 AC_DEFINE(BUILD_TOOLS, 1, [Define if we are building irecovery tools])
105 AC_CHECK_HEADERS([readline/readline.h], 106 AC_CHECK_HEADERS([readline/readline.h],
106 [AC_DEFINE(HAVE_READLINE, 1, [Define if readline is available])], 107 [AC_DEFINE(HAVE_READLINE, 1, [Define if readline is available])
108 have_readline=yes],
107 [AC_MSG_NOTICE([NOTE: Building without readline support. If you want readline support, install its development package.])] 109 [AC_MSG_NOTICE([NOTE: Building without readline support. If you want readline support, install its development package.])]
108 ) 110 )
111 AM_CONDITIONAL(HAVE_READLINE, test "x$have_readline" = "xyes")
109]) 112])
110AM_CONDITIONAL(BUILD_TOOLS, test "x$with_tools" = "xyes") 113AM_CONDITIONAL(BUILD_TOOLS, test "x$with_tools" = "xyes")
111 114
diff --git a/tools/Makefile.am b/tools/Makefile.am
index ebb085c..15e2eb9 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -2,12 +2,15 @@ if BUILD_TOOLS
2AM_CPPFLAGS = -I$(top_srcdir)/include 2AM_CPPFLAGS = -I$(top_srcdir)/include
3 3
4AM_CFLAGS = $(GLOBAL_CFLAGS) $(libusb_CFLAGS) 4AM_CFLAGS = $(GLOBAL_CFLAGS) $(libusb_CFLAGS)
5AM_LDFLAGS = $(libusb_LIBS) -lreadline 5AM_LDFLAGS = $(libusb_LIBS)
6 6
7bin_PROGRAMS = irecovery 7bin_PROGRAMS = irecovery
8 8
9irecovery_SOURCES = irecovery.c 9irecovery_SOURCES = irecovery.c
10irecovery_CFLAGS = $(AM_CFLAGS) 10irecovery_CFLAGS = $(AM_CFLAGS)
11irecovery_LDFLAGS = $(AM_LDFLAGS) 11irecovery_LDFLAGS = $(AM_LDFLAGS)
12if HAVE_READLINE
13irecovery_LDFLAGS += -lreadline
14endif
12irecovery_LDADD = $(top_builddir)/src/libirecovery-1.0.la 15irecovery_LDADD = $(top_builddir)/src/libirecovery-1.0.la
13endif 16endif
diff --git a/tools/irecovery.c b/tools/irecovery.c
index f527c44..b41573c 100644
--- a/tools/irecovery.c
+++ b/tools/irecovery.c
@@ -595,7 +595,11 @@ int main(int argc, char* argv[])
595 return 0; 595 return 0;
596 596
597 case 'V': 597 case 'V':
598 printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION); 598 printf("%s %s", TOOL_NAME, PACKAGE_VERSION);
599#ifdef HAVE_READLINE
600 printf(" (readline)");
601#endif
602 printf("\n");
599 return 0; 603 return 0;
600 604
601 default: 605 default: