Some cleanup:

Changed the optimization value to -O3
Moved the (n)curses autoconf tests to the (n)curses driver section.
Removed commented commands in configure.in
Added define ACS_* test for curses driver
This commit is contained in:
gfk
2001-10-31 22:05:14 +00:00
parent 7a4f465560
commit 39874bbf87
4 changed files with 57 additions and 20 deletions
+2
View File
@@ -28,6 +28,8 @@
#undef DEBUG
#undef DEFINED_ACS
#undef GLK_DRV
#undef HD44780_DRV
+45 -8
View File
@@ -1,3 +1,23 @@
dnl This test is used by the curses driver.
dnl Checks if $1 defined the ACS_S* preprocessor macros.
dnl Example: AC_CHECK_DEFINE_ACS(curses.h)
AC_DEFUN(AC_CHECK_DEFINE_ACS, [
AC_MSG_CHECKING(if $1 defines ACS_S*)
AC_TRY_RUN([
#include <$1>
int main() {
[[char map[] = { ACS_S9, ACS_S7, ACS_S3, ACS_S1 };]]
return 0;
}
], [
dnl then
AC_DEFINE(DEFINED_ACS)
AC_MSG_RESULT(yes) ], [
dnl else
AC_MSG_RESULT(no) ],
[:])
])
AC_DEFUN(LCD_DRIVERS_SELECT, [
AC_MSG_CHECKING(for which drivers to compile)
@@ -52,20 +72,35 @@ fi
actdrivers=["$actdrivers sli"]
;;
curses)
AC_CHECK_HEADERS(ncurses.h curses.h)
AC_CHECK_LIB(ncurses, main,
LIBCURSES="-lncurses"
DRIVERS="$DRIVERS curses_drv.o"
AC_DEFINE(CURSES_DRV)
actdrivers=["$actdrivers ncurses"]
,
dnl else
AC_CHECK_LIB(curses, main,
LIBCURSES="-lcurses"
AC_CHECK_HEADER(ncurses.h,
dnl We have ncurses.h and libncurses, add driver.
AC_CHECK_DEFINE_ACS(ncurses.h)
LIBCURSES="-lncurses"
DRIVERS="$DRIVERS curses_drv.o"
AC_DEFINE(CURSES_DRV)
actdrivers=["$actdrivers curses"]
,
dnl else
AC_MSG_WARN([Could not find ncurses.h]),
)
,
dnl else
AC_CHECK_LIB(curses, main,
AC_CHECK_HEADER(curses.h,
dnl We have curses.h and libcurses, add driver.
AC_CHECK_DEFINE_ACS(curses.h)
LIBCURSES="-lcurses"
DRIVERS="$DRIVERS curses_drv.o"
AC_DEFINE(CURSES_DRV)
actdrivers=["$actdrivers curses"]
,
dnl else
AC_MSG_WARN([Could not find curses.h]),
)
,
dnl else
AC_MSG_WARN([The curses driver needs the curses (or ncurses) library.]),
)
)
@@ -158,6 +193,8 @@ AC_SUBST(DRIVERS)
])
dnl
dnl Filesystem information detection
dnl
+3 -9
View File
@@ -23,10 +23,11 @@ AC_ARG_ENABLE(debug,
AC_MSG_RESULT($debug)
if test $debug = "yes"; then
dnl Enable debugging information
CFLAGS="-g"
else
dnl CFLAGS="-Wno-unused -O6"
CFLAGS="-O6"
dnl Maximum optimization
CFLAGS="-O3"
fi
CFLAGS="-Wall $CFLAGS"
export CFLAGS
@@ -37,12 +38,6 @@ AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_RANLIB
dnl Checks for libraries.
dnl Replace `main' with a function in -lLCDstuff:
dnl AC_CHECK_LIB(LCDstuff, main)
dnl Replace `main' with a function in -lncurses:
dnl AC_CHECK_LIB(ncurses, main)
dnl Solaris
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
@@ -74,7 +69,6 @@ dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h)
AC_CHECK_HEADERS(curses.h ncurses.h)
dnl Check for particular preprocessor macros
+7 -3
View File
@@ -454,10 +454,14 @@ curses_drv_num (int x, int num)
void
curses_drv_vbar (int x, int len)
{
//char map[] = "_.,,ooO8";
char map[] = { ACS_S9, ACS_S9, ACS_S7, ACS_S7, ACS_S3, ACS_S3, ACS_S1, ACS_S1 };
int y;
// Some curses.h do not define ACS_S* preprocessor macros, so we take a guess.
#ifdef DEFINED_ACS
char map[] = { ACS_S9, ACS_S9, ACS_S7, ACS_S7, ACS_S3, ACS_S3, ACS_S1, ACS_S1 };
#else
char map[] = "_.,,ooO8";
#endif
ValidX(x);
#define MAX_LINES (curses_drv->cellhgt * curses_drv->hgt)