diff options
-rw-r--r-- | config.h.in | 6 | ||||
-rwxr-xr-x | configure | 51 | ||||
-rw-r--r-- | configure.in | 5 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/Makefile.in | 2 |
5 files changed, 63 insertions, 3 deletions
diff --git a/config.h.in b/config.h.in index 92c62c1..abfdb80 100644 --- a/config.h.in +++ b/config.h.in @@ -12,6 +12,9 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `ncurses' library (-lncurses). */ +#undef HAVE_LIBNCURSES + /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD @@ -28,6 +31,9 @@ /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET +/* Define to 1 if you have the <ncurses.h> header file. */ +#undef HAVE_NCURSES_H + /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC @@ -2330,6 +2330,7 @@ $as_echo "$as_me: creating cache $cache_file" >&6;} fi as_fn_append ac_header_list " fcntl.h" +as_fn_append ac_header_list " ncurses.h" as_fn_append ac_header_list " stddef.h" as_fn_append ac_header_list " stdlib.h" as_fn_append ac_header_list " string.h" @@ -11133,6 +11134,54 @@ else fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 +$as_echo_n "checking for initscr in -lncurses... " >&6; } +if test "${ac_cv_lib_ncurses_initscr+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char initscr (); +int +main () +{ +return initscr (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ncurses_initscr=yes +else + ac_cv_lib_ncurses_initscr=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5 +$as_echo "$ac_cv_lib_ncurses_initscr" >&6; } +if test "x$ac_cv_lib_ncurses_initscr" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNCURSES 1 +_ACEOF + + LIBS="-lncurses $LIBS" + +else + as_fn_error $? "required library ncurses missing" "$LINENO" 5 +fi + + # Checks for header files. @@ -11165,6 +11214,8 @@ done + + # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } diff --git a/configure.in b/configure.in index 5753102..4d79e8d 100644 --- a/configure.in +++ b/configure.in @@ -23,9 +23,12 @@ LIBTOOL="$LIBTOOL --silent" # Checks for libraries. AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR([required library pthread missing])]) + +AC_CHECK_LIB([ncurses], [initscr], [], + [AC_MSG_ERROR([required library ncurses missing])]) # Checks for header files. -AC_CHECK_HEADERS_ONCE([fcntl.h stddef.h stdlib.h string.h sys/ioctl.h unistd.h]) +AC_CHECK_HEADERS_ONCE([fcntl.h ncurses.h stddef.h stdlib.h string.h sys/ioctl.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_INLINE diff --git a/src/Makefile.am b/src/Makefile.am index 563b490..d14b3bd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ sbin_PROGRAMS= netnuke netnuke_CFLAGS=-Wall -W -Wstrict-prototypes -I../include -static -netnuke_LDFLAGS=-L../libsysfs -lpthread -lsysfs -all-static +netnuke_LDFLAGS=-L../libsysfs -lncurses -lpthread -lsysfs -all-static netnuke_SOURCES= bus.c \ misc.c \ diff --git a/src/Makefile.in b/src/Makefile.in index 47723f9..bd9829b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -185,7 +185,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ netnuke_CFLAGS = -Wall -W -Wstrict-prototypes -I../include -static -netnuke_LDFLAGS = -L../libsysfs -lpthread -lsysfs -all-static +netnuke_LDFLAGS = -L../libsysfs -lncurses -lpthread -lsysfs -all-static netnuke_SOURCES = bus.c \ misc.c \ netnuke.c \ |