dnl There is NO WARRANTY, to the extent permitted by law.
AC_DEFUN([DX_LIB_CURSES],
-[DX_LIB_SETUP([curses])dnl
+[AC_BEFORE([$0], [_DX_CURSES_LINKTEST])dnl
+DX_LIB_SETUP([curses])dnl
DX_LIB_PKGCONFIG_FLAGS([ncurses])
AC_MSG_CHECKING([for curses])
DX_LIB_SEARCH_LINK([curses],