This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pinfo configure problem - configure.ac (0/1)


> On 05/13/2014 09:32 AM, Andrew Schulman wrote:
> 
> >> autoreconf -f -i?
> > 
> > Alas, no.
> > 
> > Here's configure.ac, in case that's helpful.
> 
> which contains:
> 
> # curses
> AC_CHECK_CURSES
> if ! test "x$USE_CURSES" = "xtrue"; then
> 	AC_MSG_ERROR([Curses not found. You need curses to compile pinfo])
> fi
> 
> But without a definition for AC_CHECK_CURSES, I still don't know enough.
>  I hate packages that assume they can use the AC_ namespace for their
> third-party macros.  Can you find the definition of that macro in a .m4
> file that gets included?  That's probably the place that's creating the
> bogus command line.

Thanks.  Note that I did find a workaround, which is to set
LIBS=-lncursesw.

AC_CHECK_CURSES calls AC_CHECK_CURSES_COMPILE, which is the step that
fails.  I've included it below.  The key step seems to be that it calls
AC_LINK_IFELSE, with the curses libs (-lncursesw) appended to LDFLAGS.

dnl
dnl check if the curses header we found, works
dnl
AC_DEFUN([AC_CHECK_CURSES_COMPILE], [

    dnl save CFLAGS and LDFLAGS and set new ones
    CFLAGS_OLD=$CFLAGS
    CFLAGS="$CFLAGS $curses_includes"
    LDFLAGS_OLD=$LDFLAGS
    LDFLAGS="$LDFLAGS $curses_libs"

    dnl do the compile test
    AC_MSG_CHECKING([if curses is usable])
    AC_LINK_IFELSE([
        AC_LANG_PROGRAM(
            [[
                #include <$curses_h>
            ]],
            [[
                initscr();
                printw("Hello World !!!");
                refresh();
                getch();
                endwin();
                return 0;
            ]]
        )],
        [
            curses_usable=true
            AC_MSG_RESULT([yes])
        ],
        [
            curses_usable=false
            AC_MSG_RESULT([no])
        ]
    )

    dnl restore variables
    CFLAGS=$CFLAGS_OLD
    LDFLAGS=$LDFLAGS_OLD

])


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]