)
AC_SUBST(ggo_descriptions_declared)
########################################################################### curses
-have_curses="yes"
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-AC_ARG_WITH(curses_headers, [AS_HELP_STRING(--with-curses-headers=dir,
- [look for curses.h also in dir])])
-if test -n "$with_curses_headers"; then
- curses_cppflags="-I$with_curses_headers"
- CPPFLAGS="$CPPFLAGS $curses_cppflags"
-fi
-AC_ARG_WITH(curses_libs, [AS_HELP_STRING(--with-curses-libs=dir,
- [look for libcurses also in dir])])
-if test -n "$with_curses_libs"; then
- curses_libs="-L$with_curses_libs"
- LDFLAGS="$LDFLAGS $curses_libs"
-fi
-AC_CHECK_HEADER(curses.h, [], [
- have_curses="no"
-])
-curses_ldflags="$curses_libs"
-AC_CHECK_LIB([ncursesw], [initscr],
- [curses_ldflags="$curses_libs -lncursesw"], [
- AC_CHECK_LIB([curses], [initscr],
- [curses_ldflags="$curses_libs -lcurses"],
- [have_curses="no"]
- )
- ]
-)
-AC_SUBST(curses_cppflags)
-AC_SUBST(curses_ldflags)
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
+STASH_FLAGS
+LIB_ARG_WITH([curses], [])
+HAVE_CURSES=yes
+AC_CHECK_HEADER(curses.h, [], [HAVE_CURSES=no])
+AC_SEARCH_LIBS([initscr], [ncursesw curses], [], [HAVE_CURSES=no])
+curses_ldflags="$LIBS"
+LIB_SUBST_FLAGS(curses)
+UNSTASH_FLAGS
########################################################################### ip_mreqn
AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
AC_MSG_WARN([no mixer support])
fi
########################################################################### gui
-if test "$have_curses" = "yes"; then
+if test $HAVE_CURSES = yes; then
build_gui="yes"
executables="$executables gui"
gui_cmdline_objs="gui"