[lcd4linux @ 2001-03-12 12:39:36 by reinelt]

reworked autoconf a lot: drivers may be excluded, #define's went to config.h

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@110 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
This commit is contained in:
reinelt
2001-03-12 12:39:36 +00:00
parent ae1c4ae6f4
commit 3f2399e0a6
14 changed files with 846 additions and 464 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: HD44780.c,v 1.12 2001/02/14 07:40:16 reinelt Exp $ /* $Id: HD44780.c,v 1.13 2001/03/12 12:39:36 reinelt Exp $
* *
* driver for display modules based on the HD44780 chip * driver for display modules based on the HD44780 chip
* *
@@ -20,6 +20,10 @@
* *
* *
* $Log: HD44780.c,v $ * $Log: HD44780.c,v $
* Revision 1.13 2001/03/12 12:39:36 reinelt
*
* reworked autoconf a lot: drivers may be excluded, #define's went to config.h
*
* Revision 1.12 2001/02/14 07:40:16 reinelt * Revision 1.12 2001/02/14 07:40:16 reinelt
* *
* first (incomplete) GPO implementation * first (incomplete) GPO implementation
@@ -95,6 +99,8 @@
* *
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -397,6 +403,7 @@ int HD_init (LCD *Self)
return -1; return -1;
} }
#ifdef USE_OLD_UDELAY
s=cfg_get ("Delay"); s=cfg_get ("Delay");
if (s==NULL || *s=='\0') { if (s==NULL || *s=='\0') {
error ("HD44780: no 'Delay' entry in %s", cfg_file()); error ("HD44780: no 'Delay' entry in %s", cfg_file());
@@ -406,6 +413,7 @@ int HD_init (LCD *Self)
error ("HD44780: bad delay '%s' in %s", s, cfg_file()); error ("HD44780: bad delay '%s' in %s", s, cfg_file());
return -1; return -1;
} }
#endif
s=cfg_get("Size"); s=cfg_get("Size");
if (s==NULL || *s=='\0') { if (s==NULL || *s=='\0') {

View File

@@ -86,11 +86,12 @@ EXTRA_DIST = lcd4linux.conf.sample lcd4kde.conf lcd4linux.kdelnk lcd4linux.xpm
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
PROGRAMS = $(bin_PROGRAMS) PROGRAMS = $(bin_PROGRAMS)
DEFS = @DEFS@ -I. -I$(srcdir) DEFS = @DEFS@ -I. -I$(srcdir) -I.
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ LIBS = @LIBS@
@@ -105,8 +106,9 @@ CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC) CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = README COPYING INSTALL Makefile.am Makefile.in TODO \ DIST_COMMON = README ./stamp-h.in COPYING INSTALL Makefile.am \
aclocal.m4 configure configure.in install-sh missing mkinstalldirs Makefile.in TODO acconfig.h aclocal.m4 config.h.in configure \
configure.in install-sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -141,6 +143,34 @@ config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF) cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
@if test ! -f $@; then \
rm -f stamp-h; \
$(MAKE) stamp-h; \
else :; fi
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
$(SHELL) ./config.status
@echo timestamp > stamp-h 2> /dev/null
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/stamp-h.in; \
$(MAKE) $(srcdir)/stamp-h.in; \
else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
mostlyclean-hdr:
clean-hdr:
distclean-hdr:
-rm -f config.h
maintainer-clean-hdr:
mostlyclean-binPROGRAMS: mostlyclean-binPROGRAMS:
clean-binPROGRAMS: clean-binPROGRAMS:
@@ -196,15 +226,15 @@ ID: $(HEADERS) $(SOURCES) $(LISP)
here=`pwd` && cd $(srcdir) \ here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP) && mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \ tags=; \
here=`pwd`; \ here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \ list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \ unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \ awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \ END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags: mostlyclean-tags:
@@ -308,6 +338,9 @@ check-am: all-am
check: check-am check: check-am
installcheck-am: installcheck-am:
installcheck: installcheck-am installcheck: installcheck-am
all-recursive-am: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
install-exec-am: install-binPROGRAMS install-exec-am: install-binPROGRAMS
install-exec: install-exec-am install-exec: install-exec-am
@@ -319,7 +352,7 @@ install-am: all-am
install: install-am install: install-am
uninstall-am: uninstall-binPROGRAMS uninstall-am: uninstall-binPROGRAMS
uninstall: uninstall-am uninstall: uninstall-am
all-am: Makefile $(PROGRAMS) all-am: Makefile $(PROGRAMS) config.h
all-redirect: all-am all-redirect: all-am
install-strip: install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
@@ -337,23 +370,25 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]* -rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic: maintainer-clean-generic:
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \
mostlyclean-tags mostlyclean-depend mostlyclean-generic mostlyclean-compile mostlyclean-tags mostlyclean-depend \
mostlyclean-generic
mostlyclean: mostlyclean-am mostlyclean: mostlyclean-am
clean-am: clean-binPROGRAMS clean-compile clean-tags clean-depend \ clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \
clean-generic mostlyclean-am clean-depend clean-generic mostlyclean-am
clean: clean-am clean: clean-am
distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \
distclean-depend distclean-generic clean-am distclean-tags distclean-depend distclean-generic \
clean-am
distclean: distclean-am distclean: distclean-am
-rm -f config.status -rm -f config.status
maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \ maintainer-clean-depend maintainer-clean-generic \
distclean-am distclean-am
@@ -363,15 +398,16 @@ maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -f config.status -rm -f config.status
.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \ mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \ clean-tags maintainer-clean-tags distdir mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend info-am info \ distclean-depend clean-depend maintainer-clean-depend info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
install-exec install-data-am install-data install-am install \ install-exec-am install-exec install-data-am install-data install-am \
uninstall-am uninstall all-redirect all-am all installdirs \ install uninstall-am uninstall all-redirect all-am all installdirs \
mostlyclean-generic distclean-generic clean-generic \ mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean maintainer-clean-generic clean mostlyclean distclean maintainer-clean

View File

@@ -1,4 +1,4 @@
/* $Id: Raster.c,v 1.16 2001/03/02 17:18:52 reinelt Exp $ /* $Id: Raster.c,v 1.17 2001/03/12 12:39:36 reinelt Exp $
* *
* driver for raster formats * driver for raster formats
* *
@@ -20,6 +20,10 @@
* *
* *
* $Log: Raster.c,v $ * $Log: Raster.c,v $
* Revision 1.17 2001/03/12 12:39:36 reinelt
*
* reworked autoconf a lot: drivers may be excluded, #define's went to config.h
*
* Revision 1.16 2001/03/02 17:18:52 reinelt * Revision 1.16 2001/03/02 17:18:52 reinelt
* *
* let configure find gd.h * let configure find gd.h
@@ -100,6 +104,8 @@
* *
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

3
TODO
View File

@@ -58,3 +58,6 @@ at least try to....
read configuration file earlier (before forking) so that specific drivers read configuration file earlier (before forking) so that specific drivers
(especially 'Text') would not fork. (especially 'Text') would not fork.
There's a reason for forking that early, but I forgot... There's a reason for forking that early, but I forgot...
2001-03-12 Michael Reinelt <reinelt@eunet.at>
remove USE_OLD_UDELAY after wide testing of new udelay code

23
aclocal.m4 vendored
View File

@@ -102,3 +102,26 @@ else
fi fi
AC_SUBST($1)]) AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
dnl This file resides in the same directory as the config header
dnl that is generated. We must strip everything past the first ":",
dnl and everything past the last "/".
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
<<am_indx=1
for am_file in <<$1>>; do
case " <<$>>CONFIG_HEADERS " in
*" <<$>>am_file "*<<)>>
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
;;
esac
am_indx=`expr "<<$>>am_indx" + 1`
done<<>>dnl>>)
changequote([,]))])

155
config.h.in Normal file
View File

@@ -0,0 +1,155 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if your <sys/time.h> declares struct tm. */
#undef TM_IN_SYS_TIME
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
/* Define if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* Define if you want the Beckmann&Egle driver compiled */
#undef WITH_BECKMANNEGLE
/* Define if you want the Crystalfontz driver compiled */
#undef WITH_CRYSTALFONTZ
/* Define if you want the HD44780 driver compiled */
#undef WITH_HD44780
/* Define if you want the Matrix Orbital driver compiled */
#undef WITH_MATRIXORBITAL
/* Define if you want the PalmPilot driver compiled */
#undef WITH_PALMPILOT
/* Define if you want the PNG Raster driver compiled */
#undef WITH_PNG
/* Define if you want the PPM Raster driver compiled */
#undef WITH_PPM
/* Define if you want the SIN Router driver compiled */
#undef WITH_SIN
/* Define if you want the Skeleton driver compiled */
#undef WITH_SKELETON
/* Define if you want the Text driver compiled */
#undef WITH_TEXT
/* Define if you want the X11 driver compiled */
#undef WITH_X11
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
/* Define if you have the select function. */
#undef HAVE_SELECT
/* Define if you have the socket function. */
#undef HAVE_SOCKET
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the strstr function. */
#undef HAVE_STRSTR
/* Define if you have the strtol function. */
#undef HAVE_STRTOL
/* Define if you have the uname function. */
#undef HAVE_UNAME
/* Define if you have the <asm/io.h> header file. */
#undef HAVE_ASM_IO_H
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <gd.h> header file. */
#undef HAVE_GD_H
/* Define if you have the <gd/gd.h> header file. */
#undef HAVE_GD_GD_H
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <net/if_ppp.h> header file. */
#undef HAVE_NET_IF_PPP_H
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <sys/io.h> header file. */
#undef HAVE_SYS_IO_H
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION

727
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_INIT(lcd4linux.c) AC_INIT(lcd4linux.c)
AM_INIT_AUTOMAKE(lcd4linux, 0.98) AM_INIT_AUTOMAKE(lcd4linux, 0.98)
AM_CONFIG_HEADER(config.h)
dnl Checks for programs. dnl Checks for programs.
AC_PROG_AWK AC_PROG_AWK
@@ -15,72 +16,79 @@ dnl Checks for X11
AC_PATH_XTRA AC_PATH_XTRA
dnl drivers dnl drivers
AC_MSG_CHECKING([which drivers to compile])
AC_ARG_WITH( AC_ARG_WITH(
drivers, drivers,
[ --with-drivers=<list> compile driver for displays in <list>,] [ --with-drivers=<list> compile driver for displays in <list>,]
[ drivers may be separated with commas,] [ drivers may be separated with commas,]
[ 'all' (default) compiles all available drivers.] [ 'all' (default) compiles all available drivers,]
[ drivers may be excluded with 'all,!<driver>',]
[ (try 'all,\!<driver>' if your shell complains...)]
[ possible drivers are:] [ possible drivers are:]
[ BeckmannEgle, CrystalFontz, HD44780,] [ BeckmannEgle, CrystalFontz, HD44780,]
[ MatrixOrbital, PalmPilot, PNG, PPM, X11, Text], [ MatrixOrbital, PalmPilot, PNG, PPM, X11, Text],
drivers=$withval, drivers=$withval,
drivers=all drivers=all
) )
if test "$drivers" = "all"; then
drivers=[BeckmannEgle,CrystalFontz,HD44780,MatrixOrbital,PalmPilot,PNG,PPM,X11,Text]
fi
RASTER=0
drivers=`echo $drivers|sed 's/,/ /g'` drivers=`echo $drivers|sed 's/,/ /g'`
for driver in $drivers; do for driver in $drivers; do
case $driver in
!*)
val="no"
driver=`echo $driver|cut -c 2-`
;;
*)
val="yes"
;;
esac
case "$driver" in case "$driver" in
all)
BECKMANNEGLE="yes"
CRYSTALFONTZ="yes"
HD44780="yes"
MATRIXORBITAL="yes"
PALMPILOT="yes"
PNG="yes"
PPM="yes"
TEXT="yes"
X11="yes"
;;
BeckmannEgle) BeckmannEgle)
DRIVERS="$DRIVERS BeckmannEgle.o" BECKMANNEGLE=$val
AC_DEFINE(WITH_BECKMANNEGLE)
;; ;;
CrystalFontz) CrystalFontz)
DRIVERS="$DRIVERS Crystalfontz.o" CRYSTALFONTZ=$val
AC_DEFINE(WITH_CRYSTALFONTZ)
;; ;;
HD44780) HD44780)
DRIVERS="$DRIVERS HD44780.o" HD44780=$val
AC_DEFINE(WITH_HD44780)
;; ;;
MatrixOrbital) MatrixOrbital)
DRIVERS="$DRIVERS MatrixOrbital.o" MATRIXORBITAL=$val
AC_DEFINE(WITH_MATRIXORBITAL)
;; ;;
PalmPilot) PalmPilot)
DRIVERS="$DRIVERS PalmPilot.o" PALMPILOT=$val
AC_DEFINE(WITH_PALMPILOT)
;; ;;
PNG) PNG)
RASTER=$(($RASTER + 1)) PNG=$val
AC_DEFINE(WITH_PNG)
DRVLIBS="$DRVLIBS -lgd -lpng -lz"
;; ;;
PPM) PPM)
RASTER=$(($RASTER + 1)) PPM=$val
AC_DEFINE(WITH_PPM)
;; ;;
SIN) SIN)
DRIVERS="$DRIVERS SIN.o" SIN=$val
AC_DEFINE(WITH_SIN)
;; ;;
Skeleton) Skeleton)
DRIVERS="$DRIVERS Skeleton.o" SKELETON=$val
AC_DEFINE(WITH_Skeleton)
;;
X11)
DRIVERS="$DRIVERS XWindow.o"
DRVLIBS="$DRVLIBS -lX11"
AC_DEFINE(WITH_X11)
;; ;;
Text) Text)
DRIVERS="$DRIVERS Text.o" TEXT=$val
DRVLIBS="$DRVLIBS -lncurses" ;;
AC_DEFINE(WITH_Text) X11)
X11=$val
;; ;;
*) *)
AC_MSG_ERROR([Unknown driver '$driver']) AC_MSG_ERROR([Unknown driver '$driver'])
@@ -88,87 +96,81 @@ for driver in $drivers; do
esac esac
done done
dnl delete drivers, mainly if all wa chosen above AC_MSG_RESULT([done])
AC_ARG_WITH( RASTER="no"
notdrivers,
[ --with-notdrivers=<list> do not compile driver for displays in <list>,]
[ drivers may be separated with commas,]
[ mainly useful if above all drivers were selected.]
[ possible drivers are:]
[ BeckmannEgle, CrystalFontz, HD44780,]
[ MatrixOrbital, PalmPilot, PNG, PPM, X11, Text],
notdrivers=$withval,
notdrivers="no"
)
AC_DEFUN(AC_UNDEFINE, if test "$BECKMANNEGLE" = "yes"; then
mv confdefs.h confdefs.h~ DRIVERS="$DRIVERS BeckmannEgle.o"
grep -v $1 < confdefs.h~ > confdefs.h AC_DEFINE(WITH_BECKMANNEGLE)
) fi
notdrivers=`echo $notdrivers|sed 's/,/ /g'` if test "$CRYSTALFONTZ" = "yes"; then
for driver in $notdrivers; do DRIVERS="$DRIVERS Crystalfontz.o"
case "$driver" in AC_DEFINE(WITH_CRYSTALFONTZ)
BeckmannEgle) fi
DRIVERS=${DRIVERS/ BeckmannEgle.o/}
AC_UNDEFINE(WITH_BECKMANNEGLE)
;;
CrystalFontz)
DRIVERS=${DRIVERS/ Crystalfontz.o/}
AC_UNDEFINE(WITH_CRYSTALFONTZ)
;;
HD44780)
DRIVERS=${DRIVERS/ HD44780.o/}
AC_UNDEFINE(WITH_HD44780)
;;
MatrixOrbital)
DRIVERS=${DRIVERS/ MatrixOrbital/}
AC_UNDEFINE(WITH_MATRIXORBITAL)
;;
PalmPilot)
DRIVERS=${DRIVERS/ PalmPilot/}
AC_UNDEFINE(WITH_PALMPILOT)
;;
PNG)
RASTER=$(($RASTER - 1))
AC_UNDEFINE(WITH_PNG)
DRVLIBS=${DRVLIBS/ -lgd -lpng -lz/}
;;
PPM)
RASTER=$(($RASTER - 1))
AC_UNDEFINE(WITH_PPM)
;;
SIN)
DRIVERS=${DRIVERS/ SIN.o/}
AC_UNDEFINE(WITH_SIN)
;;
Skeleton)
DRIVERS=${DRIVERS/ Skeleton.o/}
AC_UNDEFINE(WITH_Skeleton)
;;
X11)
DRIVERS=${DRIVERS/ XWindow.o/}
DRVLIBS=${DRVLIBS/ -lX11/}
AC_UNDEFINE(WITH_X11)
;;
Text)
DRIVERS=${DRIVERS/ Text.o/}
DRVLIBS=${DRVLIBS/ -lncurses/}
AC_UNDEFINE(WITH_Text)
;;
no)
;;
*)
AC_MSG_ERROR([Unknown driver '$driver'])
;;
esac
done
test $RASTER -gt 0 && RASTERDRIVER="Raster.o" if test "$HD44780" = "yes"; then
DRIVERS="$DRIVERS HD44780.o"
AC_DEFINE(WITH_HD44780)
fi
DRIVERS="$DRIVERS $RASTERDRIVER" if test "$MATRIXORBITAL" = "yes"; then
DRIVERS="$DRIVERS MatrixOrbital.o"
AC_DEFINE(WITH_MATRIXORBITAL)
fi
if test "$PALMPILOT" = "yes"; then
DRIVERS="$DRIVERS PalmPilot.o"
AC_DEFINE(WITH_PALMPILOT)
fi
if test "$PNG" = "yes"; then
RASTER="yes"
AC_DEFINE(WITH_PNG)
DRVLIBS="$DRVLIBS -lgd -lpng -lz"
fi
if test "$PPM" = "yes"; then
RASTER="yes"
AC_DEFINE(WITH_PPM)
fi
if test "$SIN" = "yes"; then
DRIVERS="$DRIVERS SIN.o"
AC_DEFINE(WITH_SIN)
fi
if test "$SKELETON" = "yes"; then
DRIVERS="$DRIVERS Skeleton.o"
AC_DEFINE(WITH_SKELETON)
fi
if test "$TEXT" = "yes"; then
DRIVERS="$DRIVERS Text.o"
DRVLIBS="$DRVLIBS -lncurses"
AC_DEFINE(WITH_TEXT)
fi
if test "$X11" = "yes"; then
if test "$no_x" = "yes"; then
AC_MSG_ERROR([cannot build X11 driver: headers or libraries not available])
fi
DRIVERS="$DRIVERS XWindow.o"
DRVLIBS="$DRVLIBS -lX11"
AC_DEFINE(WITH_X11)
fi
dnl Raster.o depends on PPM or PNG
if test "$RASTER" = "yes"; then
DRIVERS="$DRIVERS Raster.o"
fi
if test "$DRVLIBS" = ""; then
AC_MSG_ERROR([You should include at least one driver...])
fi
AC_SUBST(DRIVERS) AC_SUBST(DRIVERS)
AC_SUBST(DRVLIBS) AC_SUBST(DRVLIBS)
@@ -194,6 +196,6 @@ dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP AC_FUNC_MEMCMP
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_CHECK_FUNCS(gettimeofday select socket strdup strerror strstr strtol uname) AC_CHECK_FUNCS(gettimeofday putenv select socket strdup strerror strstr strtol uname)
AC_OUTPUT(Makefile) AC_OUTPUT(Makefile)

View File

@@ -1,4 +1,4 @@
/* $Id: debug.c,v 1.2 2001/03/09 13:08:11 ltoetsch Exp $ /* $Id: debug.c,v 1.3 2001/03/12 12:39:36 reinelt Exp $
* *
* debug() and error() functions * debug() and error() functions
* *
@@ -20,6 +20,10 @@
* *
* *
* $Log: debug.c,v $ * $Log: debug.c,v $
* Revision 1.3 2001/03/12 12:39:36 reinelt
*
* reworked autoconf a lot: drivers may be excluded, #define's went to config.h
*
* Revision 1.2 2001/03/09 13:08:11 ltoetsch * Revision 1.2 2001/03/09 13:08:11 ltoetsch
* Added Text driver * Added Text driver
* *
@@ -42,6 +46,7 @@
* *
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
@@ -65,7 +70,7 @@ void message (int level, const char *format, ...)
va_end(ap); va_end(ap);
if (foreground) { if (foreground) {
#ifdef WITH_Text #ifdef WITH_TEXT
extern int curs_err(char *); extern int curs_err(char *);
if (!curs_err(buffer)) if (!curs_err(buffer))
#endif #endif

View File

@@ -1,4 +1,4 @@
/* $Id: display.c,v 1.25 2001/03/09 13:08:11 ltoetsch Exp $ /* $Id: display.c,v 1.26 2001/03/12 12:39:36 reinelt Exp $
* *
* framework for device drivers * framework for device drivers
* *
@@ -20,6 +20,10 @@
* *
* *
* $Log: display.c,v $ * $Log: display.c,v $
* Revision 1.26 2001/03/12 12:39:36 reinelt
*
* reworked autoconf a lot: drivers may be excluded, #define's went to config.h
*
* Revision 1.25 2001/03/09 13:08:11 ltoetsch * Revision 1.25 2001/03/09 13:08:11 ltoetsch
* Added Text driver * Added Text driver
* *
@@ -161,11 +165,12 @@
* de-initializes the driver * de-initializes the driver
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
#include "debug.h" #include "debug.h"
#include "cfg.h" #include "cfg.h"
#include "display.h" #include "display.h"

View File

@@ -1,4 +1,4 @@
/* $Id: lcd4linux.c,v 1.30 2001/03/08 15:25:38 ltoetsch Exp $ /* $Id: lcd4linux.c,v 1.31 2001/03/12 12:39:36 reinelt Exp $
* *
* LCD4Linux * LCD4Linux
* *
@@ -20,6 +20,10 @@
* *
* *
* $Log: lcd4linux.c,v $ * $Log: lcd4linux.c,v $
* Revision 1.31 2001/03/12 12:39:36 reinelt
*
* reworked autoconf a lot: drivers may be excluded, #define's went to config.h
*
* Revision 1.30 2001/03/08 15:25:38 ltoetsch * Revision 1.30 2001/03/08 15:25:38 ltoetsch
* improved exec * improved exec
* *
@@ -166,6 +170,8 @@
* *
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -234,6 +240,7 @@ int hello (void)
return flag; return flag;
} }
#ifdef USE_OLD_UDELAY
void calibrate (void) void calibrate (void)
{ {
int i; int i;
@@ -249,6 +256,7 @@ void calibrate (void)
} }
printf (" Delay=%ld\n", max); printf (" Delay=%ld\n", max);
} }
#endif
void handler (int signal) void handler (int signal)
{ {
@@ -270,7 +278,11 @@ int main (int argc, char *argv[])
} }
my_argv[c]=NULL; my_argv[c]=NULL;
#ifdef USE_OLD_UDELAY
while ((c=getopt (argc, argv, "c:dFf:hlo:qv"))!=EOF) { while ((c=getopt (argc, argv, "c:dFf:hlo:qv"))!=EOF) {
#else
while ((c=getopt (argc, argv, "c:dFf:hlo:qv"))!=EOF) {
#endif
switch (c) { switch (c) {
case 'c': case 'c':
if (cfg_cmd (optarg)<0) { if (cfg_cmd (optarg)<0) {
@@ -279,8 +291,13 @@ int main (int argc, char *argv[])
} }
break; break;
case 'd': case 'd':
#ifdef USE_OLD_UDELAY
calibrate(); calibrate();
exit(0); exit(0);
#else
fprintf (stderr, "delay calibration no longer supported!\n");
exit(1);
#endif
case 'F': case 'F':
foreground++; foreground++;
break; break;

View File

@@ -1,4 +1,4 @@
/* $Id: system.c,v 1.21 2001/03/09 12:14:24 reinelt Exp $ /* $Id: system.c,v 1.22 2001/03/12 12:39:36 reinelt Exp $
* *
* system status retreivement * system status retreivement
* *
@@ -20,6 +20,10 @@
* *
* *
* $Log: system.c,v $ * $Log: system.c,v $
* Revision 1.22 2001/03/12 12:39:36 reinelt
*
* reworked autoconf a lot: drivers may be excluded, #define's went to config.h
*
* Revision 1.21 2001/03/09 12:14:24 reinelt * Revision 1.21 2001/03/09 12:14:24 reinelt
* *
* minor cleanups * minor cleanups
@@ -171,6 +175,8 @@
* *
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>

View File

@@ -1,4 +1,4 @@
/* $Id: udelay.c,v 1.3 2001/03/01 22:33:50 reinelt Exp $ /* $Id: udelay.c,v 1.4 2001/03/12 12:39:36 reinelt Exp $
* *
* short delays * short delays
* *
@@ -20,6 +20,10 @@
* *
* *
* $Log: udelay.c,v $ * $Log: udelay.c,v $
* Revision 1.4 2001/03/12 12:39:36 reinelt
*
* reworked autoconf a lot: drivers may be excluded, #define's went to config.h
*
* Revision 1.3 2001/03/01 22:33:50 reinelt * Revision 1.3 2001/03/01 22:33:50 reinelt
* *
* renamed Raster_flush() to PPM_flush() * renamed Raster_flush() to PPM_flush()
@@ -57,10 +61,18 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifdef USE_OLD_UDELAY
#include <time.h> #include <time.h>
#else
#include <sys/time.h>
#include <unistd.h>
#endif
#include "udelay.h" #include "udelay.h"
#ifdef USE_OLD_UDELAY
unsigned long loops_per_usec; unsigned long loops_per_usec;
void udelay (unsigned long usec) void udelay (unsigned long usec)
@@ -104,3 +116,23 @@ void udelay_calibrate (void)
loops_per_usec&=~bit; loops_per_usec&=~bit;
} }
} }
#else
void udelay (unsigned long usec)
{
struct timeval now, end;
gettimeofday (&end, NULL);
end.tv_usec+=usec;
while (end.tv_usec>1000000) {
end.tv_usec-=1000000;
end.tv_sec++;
}
do {
gettimeofday(&now, NULL);
} while (now.tv_sec==end.tv_sec?now.tv_usec<end.tv_usec:now.tv_sec<end.tv_sec);
}
#endif

View File

@@ -1,4 +1,4 @@
/* $Id: udelay.h,v 1.1 2000/04/15 16:56:52 reinelt Exp $ /* $Id: udelay.h,v 1.2 2001/03/12 12:39:36 reinelt Exp $
* *
* short delays * short delays
* *
@@ -20,22 +20,33 @@
* *
* *
* $Log: udelay.h,v $ * $Log: udelay.h,v $
* Revision 1.2 2001/03/12 12:39:36 reinelt
*
* reworked autoconf a lot: drivers may be excluded, #define's went to config.h
*
* Revision 1.1 2000/04/15 16:56:52 reinelt * Revision 1.1 2000/04/15 16:56:52 reinelt
* *
* moved delay loops to udelay.c * moved delay loops to udelay.c
* renamed -d (debugging) switch to -v (verbose) * renamed -d (debugging) switch to -v (verbose)
* new switch -d to calibrate delay loop * new switch -d to calibrate delay loop
* 'Delay' entry for HD44780 back again * 'Delay' entry for HD44780 back again
* delay loops will not calibrate automatically, because this will fail with hich CPU load * delay loops will not calibrate automatically, because this will fail with high CPU load
* *
*/ */
#ifndef _UDELAY_H_ #ifndef _UDELAY_H_
#define _UDELAY_H_ #define _UDELAY_H_
#ifdef USE_OLD_UDELAY
extern unsigned long loops_per_usec; extern unsigned long loops_per_usec;
void udelay (unsigned long usec); void udelay (unsigned long usec);
void udelay_calibrate (void); void udelay_calibrate (void);
#else
void udelay (unsigned long usec);
#endif
#endif #endif