--- a/configure.ac +++ b/configure.ac @@ -717,40 +717,28 @@ [ac_lib_slang=auto] ) if test $ac_lib_slang = auto; then - PKG_CHECK_MODULES([SLANG], [slang], [ac_lib_slang=yes], [ac_lib_slang=no]) - if test $ac_lib_slang = yes; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="SLANG_CFLAGS $CFLAGS" - LIBS="$SLANG_LIBS $LIBS" - AC_MSG_CHECKING([for linking slang]) - AC_TRY_LINK([ - #include - ], [ - if (SLang_init_tty(-1, 0, 0) < 0) { - perror("SLang_init_tty"); - return 1; - } - - SLang_reset_tty(); - return 0; - ],[ac_lib_slang=yes],[ac_lib_slang=no]) - AC_MSG_RESULT([$ac_lib_slang]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi + AC_CHECK_LIB( + [slang], + [SLang_init_tty], + [ac_lib_slang=yes], + [ac_lib_slang=no], + [] + ) elif test $ac_lib_slang = yes; then - PKG_CHECK_MODULES([SLANG], [slang], [], AC_MSG_ERROR([the slang library is missing])) + AC_CHECK_LIB( + [slang], + [SLang_init_tty], + [], + [AC_MSG_ERROR([the sLang library is missing])], + [] + ) fi if test $ac_lib_slang = yes; then AC_CHECK_HEADERS([slang.h slang/slang.h], [break]) ac_lib_video="$ac_lib_video slang" ac_lib_text_flag=yes fi -AC_SUBST([SLANGCFLAGS],[$SLANG_CFLAGS]) -AC_SUBST([SLANGLIBS],[$SLANG_LIBS]) AC_SUBST([CONF_LIB_SLANG],[$ac_lib_slang]) - dnl Checks for ncurses AC_ARG_ENABLE( @@ -760,36 +748,27 @@ [ac_lib_ncurses=auto] ) if test $ac_lib_ncurses = auto; then - PKG_CHECK_MODULES([NCURSES], [ncurses], [ac_lib_ncurses=yes], [ac_lib_ncurses=no]) - if test $ac_lib_ncurses = yes; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$NCURSES_CFLAGS $CFLAGS" - LIBS="$NCURSES_LIBS $LIBS" - AC_MSG_CHECKING([for linking ncurses]) - AC_TRY_LINK([ - #include - ], [ - initscr(); - noecho(); - curs_set(FALSE); - endwin(); - ],[ac_lib_ncurses=yes],[ac_lib_ncurses=no]) - AC_MSG_RESULT([$ac_lib_ncurses]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi + AC_CHECK_LIB( + [ncurses], + [endwin], + [ac_lib_ncurses=yes], + [ac_lib_ncurses=no], + [] + ) elif test $ac_lib_ncurses = yes; then - PKG_CHECK_MODULES([NCURSES], [ncurses], [], AC_MSG_ERROR([the ncurses library is missing])) + AC_CHECK_LIB( + [ncurses], + [endwin], + [], + [AC_MSG_ERROR([the sLang library is missing])], + [] + ) fi if test $ac_lib_ncurses = yes; then ac_lib_video="$ac_lib_video ncurses" ac_lib_text_flag=yes fi -AC_SUBST([NCURSESCFLAGS],[$NCURSES_CFLAGS]) -AC_SUBST([NCURSESLIBS],[$NCURSES_LIBS]) AC_SUBST([CONF_LIB_NCURSES],[$ac_lib_ncurses]) - dnl Checks for freetype AC_ARG_ENABLE(