Skip to content

Commit

Permalink
build: Fix the readline linking mess.
Browse files Browse the repository at this point in the history
We should add the -L <dir> to the CONS_LIBS and not use CONS_LDFLAGS at
all. We can also ditch the deppkg stuff which we don't support anyway
and have removed most support for anyway.
  • Loading branch information
Marco van Wieringen committed Dec 18, 2015
1 parent b4de2c7 commit 8cc292d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 31 deletions.
2 changes: 1 addition & 1 deletion GNUmakefile.in
Expand Up @@ -19,7 +19,7 @@ dummy:

# --client-only directories
fd_subdirs = src scripts src/lib src/findlib @LMDB_DIR@ src/filed \
@READLINE_SRC@ @BAT_DIR@ @TRAY_MONITOR_DIR@ src/console @FD_PLUGIN_DIR@
@BAT_DIR@ @TRAY_MONITOR_DIR@ src/console @FD_PLUGIN_DIR@

# Non-client-only directores
subdirs = src/cats @NDMP_DIR@ @DIRD_DIR@ @STORED_DIR@ @SD_BACKENDS_DIR@ @SD_PLUGIN_DIR@ @DIR_PLUGIN_DIR@ src/tools
Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Expand Up @@ -19,7 +19,7 @@ dummy:

# --client-only directories
fd_subdirs = src scripts src/lib src/findlib @LMDB_DIR@ src/filed \
@READLINE_SRC@ @BAT_DIR@ @TRAY_MONITOR_DIR@ src/console @FD_PLUGIN_DIR@
@BAT_DIR@ @TRAY_MONITOR_DIR@ src/console @FD_PLUGIN_DIR@

# Non-client-only directores
subdirs = src/cats @NDMP_DIR@ @DIRD_DIR@ @STORED_DIR@ @SD_BACKENDS_DIR@ @SD_PLUGIN_DIR@ @DIR_PLUGIN_DIR@ src/tools
Expand Down
33 changes: 9 additions & 24 deletions autoconf/configure.in
Expand Up @@ -777,7 +777,6 @@ if test x$TERM_LIB = x ; then
fi

got_readline="no"
READLINE_SRC=
if test x$support_readline = xyes; then
AC_ARG_WITH(readline,
AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
Expand All @@ -789,10 +788,10 @@ if test x$support_readline = xyes; then
yes|*)
if test -f ${with_readline}/readline.h; then
CONS_INC="-I${with_readline}"
CONS_LDFLAGS="-L$with_readline"
CONS_LIBS="-L$with_readline"
elif test -f ${with_readline}/include/readline/readline.h; then
CONS_INC="-I${with_readline}/include/readline"
CONS_LDFLAGS="-L${with_readline}/lib"
CONS_LIBS="-L${with_readline}/lib"
with_readline="${with_readline}/include/readline"
else
CONS_INC="-I/usr/include/readline"
Expand All @@ -802,7 +801,7 @@ if test x$support_readline = xyes; then
AC_CHECK_HEADER(${with_readline}/readline.h,
[
AC_DEFINE(HAVE_READLINE, 1, [Define to 1 if readline support should be enabled])
CONS_LIBS="-lreadline -lhistory $TERM_LIB"
CONS_LIBS="${CONS_LIBS} -lreadline -lhistory ${TERM_LIB}"
got_readline="yes"
], [
echo " "
Expand All @@ -819,24 +818,12 @@ if test x$support_readline = xyes; then
AC_DEFINE(HAVE_READLINE, 1, [Define to 1 if readline support should be enabled])
got_readline="yes"
CONS_INC="-I/usr/include/readline"
CONS_LIBS="-lreadline $TERM_LIB"
CONS_LIBS="${CONS_LIBS} -lreadline ${TERM_LIB}"
], [
dnl Did not find standard library, so try Bareos's default
AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
[
AC_DEFINE(HAVE_READLINE, 1, [Define to 1 if readline support should be enabled])
got_readline="yes"
CONS_INC="-I${TOP_DIR}/depkgs/readline"
CONS_LIBS="-lreadline -lhistory $TERM_LIB"
CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
], [
echo " "
echo "readline.h not found. readline turned off ..."
echo " "
]
)
]
echo " "
echo "readline.h not found. readline turned off ..."
echo " "
]
)
]
)
Expand All @@ -845,8 +832,6 @@ fi
AC_SUBST(CONS_INC)
AC_SUBST(CONS_SRC)
AC_SUBST(CONS_LIBS)
AC_SUBST(CONS_LDFLAGS)
AC_SUBST(READLINE_SRC)

dnl End of readline/conio stuff

Expand Down Expand Up @@ -4805,7 +4790,7 @@ Configuration on `date`:

Large file support: $largefile_support
Bareos conio support: ${got_conio} ${CONS_LIBS}
readline support: ${got_readline} ${PRTREADLINE_SRC}
readline support: ${got_readline}
TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
TLS support: ${have_tls}
Encryption support: ${have_crypto}
Expand Down
9 changes: 4 additions & 5 deletions src/console/Makefile.in
Expand Up @@ -26,7 +26,6 @@ GNUTLS_LIBS_NONSHARED = @GNUTLS_LIBS_NONSHARED@

CONS_INC = @CONS_INC@
CONS_LIBS = @CONS_LIBS@
CONS_LDFLAGS = @CONS_LDFLAGS@

JANSSON_CPPFLAGS = @JANSSON_INC@

Expand All @@ -50,13 +49,13 @@ console_conf.o: console_conf.c
$(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_INC) $(JANSSON_CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<

bconsole: Makefile $(CONSOBJS) ../lib/libbareos$(DEFAULT_ARCHIVE_TYPE) ../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE)
$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
$(DLIB) $(CONS_LIBS) -lbareoscfg -lbareos -lm $(LIBS) $(GETTEXT_LIBS) \
$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
$(DLIB) -lbareoscfg -lbareos -lm $(CONS_LIBS) $(LIBS) $(GETTEXT_LIBS) \
$(OPENSSL_LIBS_NONSHARED) $(GNUTLS_LIBS_NONSHARED)

static-bconsole: Makefile $(CONSOBJS) ../lib/libbareos.a ../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE)
$(LIBTOOL_LINK) $(CXX) -static $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
$(DLIB) $(CONS_LIBS) -lbareoscfg -lbareos -lm $(LIBS) $(GETTEXT_LIBS) \
$(LIBTOOL_LINK) $(CXX) -static $(LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
$(DLIB) -lbareoscfg -lbareos -lm $(CONS_LIBS) $(LIBS) $(GETTEXT_LIBS) \
$(OPENSSL_LIBS) $(GNUTLS_LIBS)
strip $@

Expand Down

0 comments on commit 8cc292d

Please sign in to comment.