Using autoconf check to detect if there's a parallel port.

This commit is contained in:
gfk
2002-05-02 01:17:28 +00:00
parent 77b73505ec
commit 8cff8dbf77
4 changed files with 51 additions and 16 deletions
+28 -8
View File
@@ -152,16 +152,31 @@ dnl else
)
;;
sed1330)
DRIVERS="$DRIVERS sed1330${SO}"
actdrivers=["$actdrivers sed1330"]
if test "$ac_cv_port_have_lpt" = yes
then
DRIVERS="$DRIVERS sed1330${SO}"
actdrivers=["$actdrivers sed1330"]
else
AC_MSG_WARN([The sed1330 driver needs a parallel port.])
fi
;;
sed1520)
DRIVERS="$DRIVERS sed1520${SO}"
actdrivers=["$actdrivers sed1520"]
if test "$ac_cv_port_have_lpt" = yes
then
DRIVERS="$DRIVERS sed1520${SO}"
actdrivers=["$actdrivers sed1520"]
else
AC_MSG_WARN([The sed1330 driver needs a parallel port.])
fi
;;
stv5730)
DRIVERS="$DRIVERS stv5730${SO}"
actdrivers=["$actdrivers stv5730"]
if test "$ac_cv_port_have_lpt" = yes
then
DRIVERS="$DRIVERS stv5730${SO}"
actdrivers=["$actdrivers stv5730"]
else
AC_MSG_WARN([The sed1330 driver needs a parallel port.])
fi
;;
svga)
AC_CHECK_LIB(vga, main,
@@ -179,8 +194,13 @@ dnl else
)
;;
t6963)
DRIVERS="$DRIVERS t6963${SO}"
actdrivers=["$actdrivers t6963"]
if test "$ac_cv_port_have_lpt" = yes
then
DRIVERS="$DRIVERS t6963${SO}"
actdrivers=["$actdrivers t6963"]
else
AC_MSG_WARN([The sed1330 driver needs a parallel port.])
fi
;;
*)
AC_MSG_ERROR([Unknown driver $driver])
+16 -1
View File
@@ -82,7 +82,7 @@ AC_CHECK_LIB(kvm, kvm_open,[
])
dnl NetBSD, OpenBSD and FreeBSD
AC_CHECK_HEADERS(sched.h sys/sched.h sys/types.h machine/pio.h machine/sysarch.h)
AC_CHECK_HEADERS(sched.h sys/sched.h machine/cpufunc.h sys/types.h machine/pio.h machine/sysarch.h)
ETR_SYSV_IPC
ETR_UNION_SEMUN
@@ -97,6 +97,21 @@ AC_CHECK_LIB(i386, i386_get_ioperm,
[])]
)
AC_CHECK_FUNCS(ioperm)
AC_CHECK_HEADERS(sys/io.h)
dnl Check if we support this parallel (LPT) port
dnl IMPORTANT: we must do all the checks used in port.h before doing this test!
AC_CACHE_CHECK([for a parallel port], ac_cv_port_have_lpt,
[AC_TRY_COMPILE([#include "server/drivers/port.h"], [char val = port_in(0x350)], ac_cv_port_have_lpt=yes, ac_cv_port_have_lpt=no)])
if test "$ac_cv_port_have_lpt" = yes
then
AC_DEFINE([HAVE_LPT_PORT],[1],[Define if you have a parallel port and LCDproc knows how to talk to it.])
else
AC_MSG_WARN([Can't talk to the parallel port, disabling drivers that use it.])
fi
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
+2 -2
View File
@@ -86,7 +86,7 @@ static inline int port_deny_full (unsigned short int port) {
/* ------------------------------------------------------------- */
/* Use i386_get_ioperm, i386_set_ioperm, inb and outb from <machine/pio.h> (NetBSD&OpenBSD) */
#elif defined HAVE_I386_IOPERM_NETBSD && defined HAVE_MACHINE_PIO_H && defined HAVE_MACHINE_SYSARCH_H
#elif defined HAVE_I386_IOPERM_NETBSD && defined HAVE_MACHINE_PIO_H && defined HAVE_MACHINE_SYSARCH_H && defined HAVE_SYS_TYPES_H
#include <sys/types.h>
#include <machine/pio.h>
#include <machine/sysarch.h>
@@ -175,7 +175,7 @@ static inline int port_deny_full (unsigned short int port) {
/*#endif // defined HAVE_I386_IOPERM_NETBSD && defined HAVE_MACHINE_PIO_H && defined HAVE_MACHINE_SYSARCH_H
-------------------------------------------------------------
Use i386_get_ioperm, i386_set_ioperm from <machine/sysarch.h> and inb and outb from <machine/cpufunc.h> (FreeBSD) */
#elif defined HAVE_I386_IOPERM_FREEBSD && defined HAVE_MACHINE_SYSARCH_H
#elif defined HAVE_I386_IOPERM_FREEBSD && defined HAVE_MACHINE_CPUFUNC_H && defined HAVE_MACHINE_SYSARCH_H && defined HAVE_SYS_TYPES_H
#include <sys/types.h>
#include <machine/cpufunc.h>
#include <machine/sysarch.h>
+5 -5
View File
@@ -66,14 +66,14 @@
#if defined DELAY_GETTIMEOFDAY
# undef DELAY_NANOSLEEP
# undef DELAY_IOCALLS
#elif defined DELAY_NANOSLEEP
# undef DELAY_GETTIMEOFDAY
# undef DELAY_IOCALLS
# include <sched.h>
#else // assume DELAY_IOCALLS
#elif defined DELAY_IOCALLS && defined HAVE_LPT_PORT
# undef DELAY_GETTIMEOFDAY
# undef DELAY_NANOSLEEP
# include "port.h"
#else // assume DELAY_NANOSLEEP
# undef DELAY_GETTIMEOFDAY
# undef DELAY_IOCALLS
# include <sched.h>
#endif
/////////////////////////////////////////////////////////////////