Merge branch 't/gui_improvements'
[paraslash.git] / configure.ac
index 35c9fd58d6073bdb68c2ee5723225973837480b1..12959c817984ccfffde88f50d7214c9a0ce8e4ce 100644 (file)
@@ -247,6 +247,18 @@ if test x$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf != "xyesyes";
 AC_MSG_ERROR([fatal: buggy snprintf() detected])
 fi])
 AX_FUNC_SNPRINTF()
 AC_MSG_ERROR([fatal: buggy snprintf() detected])
 fi])
 AX_FUNC_SNPRINTF()
+################################################################## clock_gettime
+clock_gettime_lib=
+AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
+       AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
+])
+if test -n "$clock_gettime_lib"; then
+       AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
+               define to 1 if clock_gettime() is supported])
+fi
+if test "$clock_gettime_lib" = "rt"; then
+       AC_SUBST(clock_gettime_ldflags, -lrt)
+fi
 ########################################################################### osl
 have_osl=yes
 OLD_CPPFLAGS="$CPPFLAGS"
 ########################################################################### osl
 have_osl=yes
 OLD_CPPFLAGS="$CPPFLAGS"
@@ -471,12 +483,17 @@ fi
 AC_CHECK_HEADER(curses.h, [], [
        have_curses="no"
 ])
 AC_CHECK_HEADER(curses.h, [], [
        have_curses="no"
 ])
-AC_CHECK_LIB([curses], [initscr], [], [
-       have_curses="no"
-])
+gui_ldflags="$curses_libs"
+AC_CHECK_LIB([ncursesw], [initscr],
+       [gui_ldflags="$curses_libs -lncursesw"], [
+               AC_CHECK_LIB([curses], [initscr],
+                       [gui_ldflags="$curses_libs -lcurses"],
+                       [have_curses="no"]
+               )
+       ]
+)
 if test "$have_curses" = "yes"; then
        AC_SUBST(curses_cppflags)
 if test "$have_curses" = "yes"; then
        AC_SUBST(curses_cppflags)
-       AC_DEFINE(HAVE_NCURSES, 1, [define to 1 to turn on curses support])
        extras="$extras gui"
        executables="$executables gui"
 else
        extras="$extras gui"
        executables="$executables gui"
 else
@@ -1243,6 +1260,7 @@ AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
        objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
 
 AC_SUBST(gui_objs, add_dot_o($gui_objs))
        objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
 
 AC_SUBST(gui_objs, add_dot_o($gui_objs))
+AC_SUBST(gui_ldflags, $gui_ldflags)
 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
        objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
 
 AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
        objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
 
@@ -1251,8 +1269,6 @@ AC_SUBST(play_ldflags, $play_ldflags)
 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
        objlist_to_errlist($play_errlist_objs), errors used by para_play)
 
 AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
        objlist_to_errlist($play_errlist_objs), errors used by para_play)
 
-AC_MSG_NOTICE(play objs: $play_objs)
-
 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
        enum of supported filters)
 enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
 AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
        enum of supported filters)