diff --git a/Makefile.am b/Makefile.am index 3cd7eaa6..493d06cc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -288,7 +288,7 @@ client_iwctl_SOURCES = client/main.c \ client/network.h client/network.c \ client/properties.h client/properties.c \ client/wsc.c client/station.c -client_iwctl_LDADD = $(ell_ldadd) -lreadline +client_iwctl_LDADD = $(ell_ldadd) $(READLINE_LIBS) if MANUAL_PAGES man_MANS += client/iwctl.1 @@ -504,7 +504,7 @@ unit_test_client_SOURCES = unit/test-client.c \ client/display.h client/display.c \ client/network.h client/network.c \ client/properties.h client/properties.c -unit_test_client_LDADD = $(ell_ldadd) -lreadline +unit_test_client_LDADD = $(ell_ldadd) $(READLINE_LIBS) endif unit_test_sae_SOURCES = unit/test-sae.c \ diff --git a/configure.ac b/configure.ac index 7bd917a4..52f27ed9 100644 --- a/configure.ac +++ b/configure.ac @@ -154,6 +154,9 @@ AC_ARG_ENABLE([client], AC_HELP_STRING([--disable-client], if (test "${enable_client}" != "no"); then AC_CHECK_HEADERS(readline/readline.h, enable_readline=yes, AC_MSG_ERROR(readline header files are required)) + PKG_CHECK_MODULES(READLINE, readline, dummy=yes, READLINE_LIBS=-lreadline) + AC_SUBST(READLINE_CFLAGS) + AC_SUBST(READLINE_LIBS) fi AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")