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:
@@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
|
||||||
|
#undef DEFINED_ACS
|
||||||
|
|
||||||
#undef GLK_DRV
|
#undef GLK_DRV
|
||||||
|
|
||||||
#undef HD44780_DRV
|
#undef HD44780_DRV
|
||||||
|
|||||||
+45
-8
@@ -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_DEFUN(LCD_DRIVERS_SELECT, [
|
||||||
AC_MSG_CHECKING(for which drivers to compile)
|
AC_MSG_CHECKING(for which drivers to compile)
|
||||||
|
|
||||||
@@ -52,20 +72,35 @@ fi
|
|||||||
actdrivers=["$actdrivers sli"]
|
actdrivers=["$actdrivers sli"]
|
||||||
;;
|
;;
|
||||||
curses)
|
curses)
|
||||||
|
AC_CHECK_HEADERS(ncurses.h curses.h)
|
||||||
AC_CHECK_LIB(ncurses, main,
|
AC_CHECK_LIB(ncurses, main,
|
||||||
LIBCURSES="-lncurses"
|
AC_CHECK_HEADER(ncurses.h,
|
||||||
DRIVERS="$DRIVERS curses_drv.o"
|
dnl We have ncurses.h and libncurses, add driver.
|
||||||
AC_DEFINE(CURSES_DRV)
|
AC_CHECK_DEFINE_ACS(ncurses.h)
|
||||||
actdrivers=["$actdrivers ncurses"]
|
LIBCURSES="-lncurses"
|
||||||
,
|
|
||||||
dnl else
|
|
||||||
AC_CHECK_LIB(curses, main,
|
|
||||||
LIBCURSES="-lcurses"
|
|
||||||
DRIVERS="$DRIVERS curses_drv.o"
|
DRIVERS="$DRIVERS curses_drv.o"
|
||||||
AC_DEFINE(CURSES_DRV)
|
AC_DEFINE(CURSES_DRV)
|
||||||
actdrivers=["$actdrivers curses"]
|
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
|
dnl else
|
||||||
|
AC_MSG_WARN([Could not find curses.h]),
|
||||||
|
)
|
||||||
|
,
|
||||||
|
dnl else
|
||||||
AC_MSG_WARN([The curses driver needs the curses (or ncurses) library.]),
|
AC_MSG_WARN([The curses driver needs the curses (or ncurses) library.]),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -158,6 +193,8 @@ AC_SUBST(DRIVERS)
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Filesystem information detection
|
dnl Filesystem information detection
|
||||||
dnl
|
dnl
|
||||||
|
|||||||
+3
-9
@@ -23,10 +23,11 @@ AC_ARG_ENABLE(debug,
|
|||||||
AC_MSG_RESULT($debug)
|
AC_MSG_RESULT($debug)
|
||||||
|
|
||||||
if test $debug = "yes"; then
|
if test $debug = "yes"; then
|
||||||
|
dnl Enable debugging information
|
||||||
CFLAGS="-g"
|
CFLAGS="-g"
|
||||||
else
|
else
|
||||||
dnl CFLAGS="-Wno-unused -O6"
|
dnl Maximum optimization
|
||||||
CFLAGS="-O6"
|
CFLAGS="-O3"
|
||||||
fi
|
fi
|
||||||
CFLAGS="-Wall $CFLAGS"
|
CFLAGS="-Wall $CFLAGS"
|
||||||
export CFLAGS
|
export CFLAGS
|
||||||
@@ -37,12 +38,6 @@ AC_PROG_CPP
|
|||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_RANLIB
|
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
|
dnl Solaris
|
||||||
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
|
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
|
||||||
AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
|
AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
|
||||||
@@ -74,7 +69,6 @@ dnl Checks for header files.
|
|||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h)
|
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
|
dnl Check for particular preprocessor macros
|
||||||
|
|
||||||
|
|||||||
@@ -454,9 +454,13 @@ curses_drv_num (int x, int num)
|
|||||||
void
|
void
|
||||||
curses_drv_vbar (int x, int len)
|
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;
|
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);
|
ValidX(x);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user