Use pkg-config (if available) to set up the link option for the term gui.

This commit is contained in:
Volker Ruppert 2019-11-11 22:36:40 +00:00
parent 32c342eda7
commit 27c47b6ab8
2 changed files with 179 additions and 9 deletions

173
bochs/configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Id: configure.in 13593 2019-11-11 19:40:09Z vruppert .
# From configure.in Id: configure.in 13594 2019-11-11 20:47:13Z vruppert .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
@ -25238,7 +25238,169 @@ esac
if test "$use_curses" = yes -a "$cross_configure" = 0; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -lcurses" >&5
if test "$PKGCONFIG" != not_found; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -lcurses" >&5
$as_echo_n "checking for mvaddch in -lcurses... " >&6; }
if ${ac_cv_lib_curses_mvaddch+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcurses $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char mvaddch ();
int
main ()
{
return mvaddch ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_curses_mvaddch=yes
else
ac_cv_lib_curses_mvaddch=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_mvaddch" >&5
$as_echo "$ac_cv_lib_curses_mvaddch" >&6; }
if test "x$ac_cv_lib_curses_mvaddch" = xyes; then :
GUI_LINK_OPTS_TERM="`pkg-config --libs curses`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -lncurses" >&5
$as_echo_n "checking for mvaddch in -lncurses... " >&6; }
if ${ac_cv_lib_ncurses_mvaddch+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncurses $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char mvaddch ();
int
main ()
{
return mvaddch ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_ncurses_mvaddch=yes
else
ac_cv_lib_ncurses_mvaddch=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_mvaddch" >&5
$as_echo "$ac_cv_lib_ncurses_mvaddch" >&6; }
if test "x$ac_cv_lib_ncurses_mvaddch" = xyes; then :
GUI_LINK_OPTS_TERM="`pkg-config --libs ncurses`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -ltermlib" >&5
$as_echo_n "checking for mvaddch in -ltermlib... " >&6; }
if ${ac_cv_lib_termlib_mvaddch+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ltermlib $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char mvaddch ();
int
main ()
{
return mvaddch ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_termlib_mvaddch=yes
else
ac_cv_lib_termlib_mvaddch=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termlib_mvaddch" >&5
$as_echo "$ac_cv_lib_termlib_mvaddch" >&6; }
if test "x$ac_cv_lib_termlib_mvaddch" = xyes; then :
GUI_LINK_OPTS_TERM="`pkg-config --libs termlib`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -lpdcurses" >&5
$as_echo_n "checking for mvaddch in -lpdcurses... " >&6; }
if ${ac_cv_lib_pdcurses_mvaddch+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdcurses $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char mvaddch ();
int
main ()
{
return mvaddch ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_pdcurses_mvaddch=yes
else
ac_cv_lib_pdcurses_mvaddch=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pdcurses_mvaddch" >&5
$as_echo "$ac_cv_lib_pdcurses_mvaddch" >&6; }
if test "x$ac_cv_lib_pdcurses_mvaddch" = xyes; then :
GUI_LINK_OPTS_TERM="`pkg-config --libs pdcurses`"
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -lcurses" >&5
$as_echo_n "checking for mvaddch in -lcurses... " >&6; }
if ${ac_cv_lib_curses_mvaddch+:} false; then :
$as_echo_n "(cached) " >&6
@ -25278,7 +25440,7 @@ if test "x$ac_cv_lib_curses_mvaddch" = xyes; then :
GUI_LINK_OPTS_TERM='-lcurses'
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -lncurses" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -lncurses" >&5
$as_echo_n "checking for mvaddch in -lncurses... " >&6; }
if ${ac_cv_lib_ncurses_mvaddch+:} false; then :
$as_echo_n "(cached) " >&6
@ -25318,7 +25480,7 @@ if test "x$ac_cv_lib_ncurses_mvaddch" = xyes; then :
GUI_LINK_OPTS_TERM='-lncurses'
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -ltermlib" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -ltermlib" >&5
$as_echo_n "checking for mvaddch in -ltermlib... " >&6; }
if ${ac_cv_lib_termlib_mvaddch+:} false; then :
$as_echo_n "(cached) " >&6
@ -25358,7 +25520,7 @@ if test "x$ac_cv_lib_termlib_mvaddch" = xyes; then :
GUI_LINK_OPTS_TERM='-ltermlib'
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -lpdcurses" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddch in -lpdcurses" >&5
$as_echo_n "checking for mvaddch in -lpdcurses... " >&6; }
if ${ac_cv_lib_pdcurses_mvaddch+:} false; then :
$as_echo_n "(cached) " >&6
@ -25398,6 +25560,7 @@ if test "x$ac_cv_lib_pdcurses_mvaddch" = xyes; then :
GUI_LINK_OPTS_TERM='-lpdcurses'
fi
fi
if test "$GUI_LINK_OPTS_TERM" = ""; then
echo Curses library not found: tried curses, ncurses, termlib and pdcurses.
exit 1

View File

@ -2903,10 +2903,17 @@ AC_SUBST(DIALOG_OBJS)
AC_SUBST(EXPORT_DYNAMIC)
if test "$use_curses" = yes -a "$cross_configure" = 0; then
AC_CHECK_LIB(curses, mvaddch, GUI_LINK_OPTS_TERM='-lcurses')
AC_CHECK_LIB(ncurses, mvaddch, GUI_LINK_OPTS_TERM='-lncurses')
AC_CHECK_LIB(termlib, mvaddch, GUI_LINK_OPTS_TERM='-ltermlib')
AC_CHECK_LIB(pdcurses, mvaddch, GUI_LINK_OPTS_TERM='-lpdcurses')
if test "$PKGCONFIG" != not_found; then
AC_CHECK_LIB(curses, mvaddch, GUI_LINK_OPTS_TERM="`pkg-config --libs curses`")
AC_CHECK_LIB(ncurses, mvaddch, GUI_LINK_OPTS_TERM="`pkg-config --libs ncurses`")
AC_CHECK_LIB(termlib, mvaddch, GUI_LINK_OPTS_TERM="`pkg-config --libs termlib`")
AC_CHECK_LIB(pdcurses, mvaddch, GUI_LINK_OPTS_TERM="`pkg-config --libs pdcurses`")
else
AC_CHECK_LIB(curses, mvaddch, GUI_LINK_OPTS_TERM='-lcurses')
AC_CHECK_LIB(ncurses, mvaddch, GUI_LINK_OPTS_TERM='-lncurses')
AC_CHECK_LIB(termlib, mvaddch, GUI_LINK_OPTS_TERM='-ltermlib')
AC_CHECK_LIB(pdcurses, mvaddch, GUI_LINK_OPTS_TERM='-lpdcurses')
fi
if test "$GUI_LINK_OPTS_TERM" = ""; then
echo Curses library not found: tried curses, ncurses, termlib and pdcurses.
exit 1