From d409ba85145aa53ddf9b8ac41e0cb677e894e8be Mon Sep 17 00:00:00 2001 From: fche Date: Mon, 24 Sep 2001 21:03:11 +0000 Subject: [PATCH] * build fix: cygwin -lcurses is sometimes bad 2001-09-24 Frank Ch. Eigler * configure.in (lcd_libs): Set HAVE_CURSES_LIBRARY if found some usable curses library. * config.in, configure: Regenerated. [lcd] 2001-09-24 Frank Ch. Eigler * lcd-char-display.cxx: Be sensitive to ! HAVE_CURSES_LIBRARY. --- sid/component/ChangeLog | 6 +++ sid/component/config.in | 3 ++ sid/component/configure | 90 ++++++++++++++++++---------------- sid/component/configure.in | 3 ++ sid/component/lcd/ChangeLog | 4 ++ sid/component/lcd/lcd-char-display.cxx | 16 +++--- 6 files changed, 72 insertions(+), 50 deletions(-) diff --git a/sid/component/ChangeLog b/sid/component/ChangeLog index 75237f8cdd..5e46f4ee0c 100644 --- a/sid/component/ChangeLog +++ b/sid/component/ChangeLog @@ -1,3 +1,9 @@ +2001-09-24 Frank Ch. Eigler + + * configure.in (lcd_libs): Set HAVE_CURSES_LIBRARY if found some + usable curses library. + * config.in, configure: Regenerated. + 2001-07-25 Frank Ch. Eigler From Corinna Vinschen diff --git a/sid/component/config.in b/sid/component/config.in index cf24787c67..ef075fc105 100644 --- a/sid/component/config.in +++ b/sid/component/config.in @@ -78,6 +78,9 @@ /* Version number of package */ #undef VERSION +/* Define if curses library is usable */ +#undef HAVE_CURSES_LIBRARY + /* Define if ftime(3) is declared via sys/timeb.h */ #undef HAVE_FTIME_DECL diff --git a/sid/component/configure b/sid/component/configure index aff937ab26..532f7b4263 100755 --- a/sid/component/configure +++ b/sid/component/configure @@ -2562,10 +2562,16 @@ fi fi +if test "x$lcd_libs" != "x"; then + cat >> confdefs.h <<\EOF +#define HAVE_CURSES_LIBRARY 1 +EOF + +fi socket_libs= echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:2569: checking for connect in -lsocket" >&5 +echo "configure:2575: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2573,7 +2579,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2608,7 +2614,7 @@ else fi echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:2612: checking for gethostbyname in -lnsl" >&5 +echo "configure:2618: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2616,7 +2622,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2649,7 +2655,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lresolv""... $ac_c" 1>&6 -echo "configure:2653: checking for gethostbyname in -lresolv" >&5 +echo "configure:2659: checking for gethostbyname in -lresolv" >&5 ac_lib_var=`echo resolv'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2657,7 +2663,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2698,12 +2704,12 @@ fi for ac_func in ftime times gettimeofday usleep strtoul strtoull select do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2702: checking for $ac_func" >&5 +echo "configure:2708: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2759,12 +2765,12 @@ LIBS="$LIBS $socket_libs" for ac_func in inet_aton inet_addr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2763: checking for $ac_func" >&5 +echo "configure:2769: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2820,17 +2826,17 @@ for ac_hdr in curses.h time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2824: checking for $ac_hdr" >&5 +echo "configure:2830: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2860,17 +2866,17 @@ for ac_hdr in sys/time.h sys/timeb.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2864: checking for $ac_hdr" >&5 +echo "configure:2870: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2900,17 +2906,17 @@ for ac_hdr in sys/socket.h netinet/in.h netinet/tcp.h arpa/inet.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2904: checking for $ac_hdr" >&5 +echo "configure:2910: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2941,17 +2947,17 @@ for ac_hdr in ../ucbinclude/sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2945: checking for $ac_hdr" >&5 +echo "configure:2951: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2979,13 +2985,13 @@ done echo $ac_n "checking whether ftime is declared""... $ac_c" 1>&6 -echo "configure:2983: checking whether ftime is declared" >&5 +echo "configure:2989: checking whether ftime is declared" >&5 if eval "test \"`echo '$''{'ac_cv_decl_ftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -3010,13 +3016,13 @@ EOF fi echo $ac_n "checking whether usleep is declared""... $ac_c" 1>&6 -echo "configure:3014: checking whether usleep is declared" >&5 +echo "configure:3020: checking whether usleep is declared" >&5 if eval "test \"`echo '$''{'ac_cv_decl_usleep'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -3042,13 +3048,13 @@ EOF fi echo $ac_n "checking whether socklen_t is declared""... $ac_c" 1>&6 -echo "configure:3046: checking whether socklen_t is declared" >&5 +echo "configure:3052: checking whether socklen_t is declared" >&5 if eval "test \"`echo '$''{'ac_cv_decl_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -3080,7 +3086,7 @@ fi # Extract the first word of "links", so it can be a program name with args. set dummy links; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3084: checking for $ac_word" >&5 +echo "configure:3090: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LINKS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3120,7 +3126,7 @@ fi # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3124: checking for $ac_word" >&5 +echo "configure:3130: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_XSLTPROC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3160,7 +3166,7 @@ fi # Extract the first word of "sabcmd", so it can be a program name with args. set dummy sabcmd; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3164: checking for $ac_word" >&5 +echo "configure:3170: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_SABLOTRON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3261,7 +3267,7 @@ esac echo $ac_n "checking ARM family support""... $ac_c" 1>&6 -echo "configure:3265: checking ARM family support" >&5 +echo "configure:3271: checking ARM family support" >&5 @@ -3275,7 +3281,7 @@ fi echo "$ac_t""$sidtarget_arm" 1>&6 echo $ac_n "checking MIPS family support""... $ac_c" 1>&6 -echo "configure:3279: checking MIPS family support" >&5 +echo "configure:3285: checking MIPS family support" >&5 @@ -3289,7 +3295,7 @@ fi echo "$ac_t""$sidtarget_mips" 1>&6 echo $ac_n "checking M32R family support""... $ac_c" 1>&6 -echo "configure:3293: checking M32R family support" >&5 +echo "configure:3299: checking M32R family support" >&5 @@ -3303,7 +3309,7 @@ fi echo "$ac_t""$sidtarget_m32r" 1>&6 echo $ac_n "checking M68K family support""... $ac_c" 1>&6 -echo "configure:3307: checking M68K family support" >&5 +echo "configure:3313: checking M68K family support" >&5 @@ -3317,7 +3323,7 @@ fi echo "$ac_t""$sidtarget_m68k" 1>&6 echo $ac_n "checking PPC family support""... $ac_c" 1>&6 -echo "configure:3321: checking PPC family support" >&5 +echo "configure:3327: checking PPC family support" >&5 @@ -3565,7 +3571,7 @@ cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=60 # Maximum number of lines to put in a sed script. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. diff --git a/sid/component/configure.in b/sid/component/configure.in index abd7fce3b7..2fd9c70615 100644 --- a/sid/component/configure.in +++ b/sid/component/configure.in @@ -29,6 +29,9 @@ AC_CHECK_LIB(curses, refresh, lcd_libs="-lcurses", AC_CHECK_LIB(curses, refresh, lcd_libs="-lcurses -ltermcap", AC_CHECK_LIB(ncurses, refresh, lcd_libs="-lncurses"), -ltermcap)) AC_SUBST(lcd_libs) +if test "x$lcd_libs" != "x"; then + AC_DEFINE(HAVE_CURSES_LIBRARY, 1, [Define if curses library is usable]) +fi dnl For socket-related components only. socket_libs= diff --git a/sid/component/lcd/ChangeLog b/sid/component/lcd/ChangeLog index e72d45b62f..5c6438a42a 100644 --- a/sid/component/lcd/ChangeLog +++ b/sid/component/lcd/ChangeLog @@ -1,3 +1,7 @@ +2001-09-24 Frank Ch. Eigler + + * lcd-char-display.cxx: Be sensitive to ! HAVE_CURSES_LIBRARY. + 2001-08-03 matthew green * HD44780U.cxx (ctor): Remove unnecessary parens GCC 3.0 is diff --git a/sid/component/lcd/lcd-char-display.cxx b/sid/component/lcd/lcd-char-display.cxx index 23a5137e82..5aaf147aa8 100644 --- a/sid/component/lcd/lcd-char-display.cxx +++ b/sid/component/lcd/lcd-char-display.cxx @@ -51,7 +51,7 @@ private: void new_frame( host_int_4 val ); void init( host_int_4 ); -#ifdef HAVE_CURSES_H +#if HAVE_CURSES_H && HAVE_CURSES_LIBRARY WINDOW *w; #endif @@ -106,21 +106,21 @@ lcd_char_display :: lcd_char_display() : & lcd_char_display::save_state, & lcd_char_display::restore_state); -#ifdef HAVE_CURSES_H +#if HAVE_CURSES_H && HAVE_CURSES_LIBRARY initscr(); w = 0; #endif } lcd_char_display :: ~lcd_char_display() throw () { -#ifdef HAVE_CURSES_H +#if HAVE_CURSES_H && HAVE_CURSES_LIBRARY endwin(); #endif } void lcd_char_display :: init( host_int_4 ) { -#ifdef HAVE_CURSES_H +#if HAVE_CURSES_H && HAVE_CURSES_LIBRARY if( !w ) { w = newwin( height, width, 0, 0 ); box( w, 0, 0 ); @@ -138,12 +138,12 @@ lcd_char_display::set_pixel (host_int_4 val) int row = i >> 16; int col = i & 0x0ffff; -#ifndef HAVE_CURSES_H - cout << '[' << row << ',' << col << ']'; -#else +#if HAVE_CURSES_H && HAVE_CURSES_LIBRARY if (!w) return; mvwaddch( w, row, col, '*' ); +#else + cout << '[' << row << ',' << col << ']'; #endif // HAVE_CURSES_H trigger_mgr.check_and_dispatch(); @@ -152,7 +152,7 @@ lcd_char_display::set_pixel (host_int_4 val) void lcd_char_display::new_frame (host_int_4 val) { -#ifdef HAVE_CURSES_H +#if HAVE_CURSES_H && HAVE_CURSES_LIBRARY if (!w) return; -- 2.11.0