Cleanup of screen library detection m4 code.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2012-08-10 10:32:58 +04:00
parent 6c249ec0f2
commit d84e462b89
3 changed files with 24 additions and 44 deletions

View File

@ -48,7 +48,7 @@ AC_DEFUN([MC_CHECK_NCURSES_BY_PATH], [
if test x"$found_ncurses" = x"yes"; then
screen_type=ncurses
screen_msg="ncurses library (installed on the system)"
screen_msg="Ncurses library"
AC_DEFINE(HAVE_NCURSES, 1,
[Define to use ncurses library for screen management])
@ -100,7 +100,7 @@ AC_DEFUN([MC_WITH_NCURSES], [
[AC_MSG_ERROR([Cannot find ncurses library])])
screen_type=ncurses
screen_msg="ncurses library"
screen_msg="Ncurses library"
AC_DEFINE(USE_NCURSES, 1,
[Define to use ncurses for screen management])
else
@ -124,7 +124,7 @@ AC_DEFUN([MC_WITH_NCURSES], [
fi
screen_type=ncurses
screen_msg="ncurses library"
screen_msg="Ncurses library"
AC_DEFINE(USE_NCURSES, 1,
[Define to use ncurses for screen management])
fi
@ -174,7 +174,7 @@ AC_DEFUN([MC_WITH_NCURSESW], [
fi
screen_type=ncursesw
screen_msg="ncursesw library"
screen_msg="Ncursesw library"
AC_DEFINE(USE_NCURSESW, 1,
[Define to use ncursesw for screen management])

View File

@ -63,7 +63,7 @@ AC_DEFUN([MC_CHECK_SLANG_BY_PATH], [
MC_CHECK_SLANG_HEADER
if test x"$found_slang" = xno; then
error_msg_slang="Slang header not found"
error_msg_slang="S-Lang header not found"
else
if test x"$ac_slang_inc_path" = x; then
ac_slang_inc_path="-I/usr/include"
@ -124,7 +124,6 @@ int main (void)
saved_LDFLAGS="-ltermcap $saved_LDFLAGS"
fi
dnl Check the library
unset ac_cv_lib_slang_SLang_init_tty
AC_CHECK_LIB(
@ -133,33 +132,19 @@ int main (void)
[:],
[
found_slang=no
error_msg_slang="S-lang library not found"
error_msg_slang="S-Lang library not found"
]
)
fi
dnl Unless external S-Lang was requested, reject S-Lang with UTF-8 hacks
if test x"$found_slang" = x"yes"; then
unset ac_cv_lib_slang_SLsmg_write_nwchars
AC_CHECK_LIB(
[slang],
[SLsmg_write_nwchars],
[
found_slang=no
error_msg_slang="Rejecting S-Lang with UTF-8 support, it's not fully supported yet"
],
[:]
)
fi
if test x"$found_slang" = x"yes"; then
screen_type=slang
screen_msg="S-Lang library (installed on the system)"
screen_msg="S-Lang library"
MCLIBS="$ac_slang_lib_path -lslang $MCLIBS"
CFLAGS="$ac_slang_inc_path $saved_CFLAGS"
dnl do not reset CPPFLAGS
dnl - if CPPFLAGS are resetted then cpp does not find the specified header
dnl - if CPPFLAGS are reset then cpp does not find the specified header
LDFLAGS="$saved_LDFLAGS"
else
CFLAGS="$saved_CFLAGS"
@ -178,7 +163,7 @@ AC_DEFUN([MC_WITH_SLANG], [
AC_ARG_WITH([slang-includes],
AS_HELP_STRING([--with-slang-includes=@<:@DIR@:>@],
[set path to SLANG includes @<:@default=/usr/include@:>@; make sense only if --with-screen=slang]
[set path to S-Lang includes @<:@default=/usr/include@:>@; make sense only if --with-screen=slang]
),
[ac_slang_inc_path="$withval"],
[ac_slang_inc_path=""]
@ -186,13 +171,13 @@ AC_DEFUN([MC_WITH_SLANG], [
AC_ARG_WITH([slang-libs],
AS_HELP_STRING([--with-slang-libs=@<:@DIR@:>@],
[set path to SLANG library @<:@default=/usr/lib@:>@; make sense only if --with-screen=slang]
[set path to S-Lang library @<:@default=/usr/lib@:>@; make sense only if --with-screen=slang]
),
[ac_slang_lib_path="$withval"],
[ac_slang_lib_path=""]
)
if test x"$ac_slang_lib_path" != x -o x"$ac_slang_inc_path" != x; then
echo 'checking SLANG-headers in specified place ...'
echo 'checking S-Lang headers in specified place ...'
MC_CHECK_SLANG_BY_PATH([$ac_slang_inc_path],[$ac_slang_lib_path])
else
found_slang=no
@ -208,14 +193,14 @@ AC_DEFUN([MC_WITH_SLANG], [
ac_slang_inc_path="/usr/include"
ac_slang_lib_path="/usr/lib"
echo 'checking SLANG-headers in /usr ...'
echo 'checking S-Lang headers in /usr ...'
MC_CHECK_SLANG_BY_PATH([$ac_slang_inc_path],[$ac_slang_lib_path])
if test x"$found_slang" = "xno"; then
found_slang=yes
ac_slang_inc_path="/usr/local/include"
ac_slang_lib_path="/usr/local/lib"
echo 'checking SLANG-headers in /usr/local ...'
echo 'checking S-Lang headers in /usr/local ...'
MC_CHECK_SLANG_BY_PATH( $ac_slang_inc_path , $ac_slang_lib_path )
if test x"$found_slang" = "xno"; then
AC_MSG_ERROR([$error_msg_slang])
@ -223,9 +208,7 @@ AC_DEFUN([MC_WITH_SLANG], [
fi
fi
AC_DEFINE(HAVE_SLANG, 1,
[Define to use S-Lang library for screen management])
AC_DEFINE(HAVE_SLANG, 1, [Define to use S-Lang library for screen management])
MC_CHECK_SLANG_HEADER
])

View File

@ -7,13 +7,13 @@ dnl
AC_DEFUN([MC_WITH_SCREEN], [
AC_ARG_WITH(screen,
[ --with-screen=LIB Compile with screen library: slang or
ncurses [[slang if found]]])
AC_ARG_WITH([screen],
AS_HELP_STRING([--with-screen=@<:@LIB@:>@],
[Compile with screen library: slang or ncurses @<:@slang if found@:>@]))
case x$with_screen in
xslang)
MC_WITH_SLANG(strict)
x | xslang)
MC_WITH_SLANG
;;
xncurses)
MC_WITH_NCURSES
@ -21,9 +21,6 @@ AC_DEFUN([MC_WITH_SCREEN], [
xncursesw)
MC_WITH_NCURSESW
;;
x)
MC_WITH_SLANG
;;
*)
AC_MSG_ERROR([Value of the screen library is incorrect])
;;