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
+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