diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..8b71527 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,2 @@ +AUTOMAKE_OPTIONS = foreign +SUBDIRS = shared clients server docs diff --git a/acconfig.h b/acconfig.h new file mode 100644 index 0000000..2e95348 --- /dev/null +++ b/acconfig.h @@ -0,0 +1,58 @@ +/* acconfig.h + $Id$ + This file is in the public domain. + + Descriptive text for the C preprocessor macros that + the distributed Autoconf macros can define. + No software package will use all of them; autoheader copies the ones + your configure.in uses into your configuration header file templates. + + The entries are in sort -df order: alphabetical, case insensitive, + ignoring punctuation (such as underscores). Although this order + can split up related entries, it makes it easier to check whether + a given entry is in the file. + + Leave the following blank line there!! Autoheader needs it. */ + + +#undef CFONTZ_DRV + +#undef CURSES_DRV + +#undef DEBUG + +#undef HD44780_DRV + +#undef IRMANIN_DRV + +#undef JOY_DRV + +#undef LCDPORT + +#undef LINUX + +#undef LOAD_MAX + +#undef LOAD_MIN + +#undef MTXORB_DRV + +/* Define the package name */ +#undef PACKAGE + +#undef STAT_NFS + +#undef STAT_SMBFS + +#undef TEXT_DRV + +/* Define the package version */ +#undef VERSION + +#undef xBSD + + +/* Leave that blank line there!! Autoheader needs it. + If you're adding to this file, keep in mind: + The entries are in sort -df order: alphabetical, case insensitive, + ignoring punctuation (such as underscores). */ diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..9941081 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,61 @@ +AC_DEFUN(LCD_DRIVERS_SELECT, [ +AC_MSG_CHECKING(for which drivers to compile) + +AC_ARG_ENABLE(drivers, + [ --enable-drivers= compile driver for LCDs in .] + [ drivers may be separated with commas.] + [ \"all\" compiles all drivers], + drivers="$enableval", + drivers=[mtxorb,cfontz,curses,text]) + +if test "$drivers" = "all"; then + drivers=[mtxorb,cfontz,curses,text,hd44780,joy,irman] + AC_MSG_RESULT(all) +else + drivers=`echo $drivers | sed 's/,/ /g'` + AC_MSG_RESULT($drivers) + for driver in $drivers + do + case "$driver" in + mtxorb) + DRIVERS="$DRIVERS MtxOrb.o" + AC_DEFINE(MTXORB_DRV) + ;; + cfontz) + DRIVERS="$DRIVERS CFontz.o" + AC_DEFINE(CFONTZ_DRV) + ;; + curses) + AC_CHECK_LIB(curses, main, LIBCURSES="-lcurses", + AC_MSG_ERROR([The curses driver needs the curses library])) + DRIVERS="$DRIVERS curses_drv.o" + AC_DEFINE(CURSES_DRV) + ;; + text) + DRIVERS="$DRIVERS text.o" + AC_DEFINE(TEXT_DRV) + ;; + hd44780) + DRIVERS="$DRIVERS hd44780.o" + AC_DEFINE(HD44780_DRV) + ;; + joy) + DRIVERS="$DRIVERS joy.o" + AC_DEFINE(JOY_DRV) + ;; + irman) + AC_CHECK_LIB(irman, main, LIBIRMAN="-lirman", + AC_MSG_ERROR([The irman driver needs the irman library])) + DRIVERS="$DRIVERS irmanin.o" + AC_DEFINE(IRMANIN_DRV) + ;; + *) + AC_MSG_ERROR([Uknown driver $driver]) + ;; + esac + done +fi +AC_SUBST(LIBCURSES) +AC_SUBST(LIBIRMAN) +AC_SUBST(DRIVERS) +]) diff --git a/autogen.sh b/autogen.sh new file mode 100644 index 0000000..4259ed2 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +DIE=0 + +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`autoconf' installed." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +(automake --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`automake' installed." + echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" + echo "(or a newer version if it is available)" + DIE=1 + NO_AUTOMAKE=yes +} + +# if no automake, don't bother testing for aclocal +test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: Missing \`aclocal'. The version of \`automake'" + echo "installed doesn't appear recent enough." + echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" + echo "(or a newer version if it is available)" + DIE=1 +} + +if test "$DIE" -eq 1; then + exit 1 +fi + +echo "Running aclocal ..." +aclocal +if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then + echo "Running autoheader..." + autoheader +fi + +echo "Running automake ..." +automake --add-missing +echo "Running autoconf ..." +autoconf diff --git a/clients/Makefile.am b/clients/Makefile.am new file mode 100644 index 0000000..418e6c6 --- /dev/null +++ b/clients/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = examples headlines lcdproc diff --git a/clients/examples/Makefile.am b/clients/examples/Makefile.am new file mode 100644 index 0000000..e672fdb --- /dev/null +++ b/clients/examples/Makefile.am @@ -0,0 +1,2 @@ +bin_SCRIPTS = fortune.pl iosock.pl tail.pl x11amp.pl +EXTRA_DIST = fortune.pl iosock.pl tail.pl x11amp.pl diff --git a/clients/headlines/Makefile.am b/clients/headlines/Makefile.am new file mode 100644 index 0000000..d2cc1b0 --- /dev/null +++ b/clients/headlines/Makefile.am @@ -0,0 +1,2 @@ +bin_SCRIPTS = lcdheadlines +EXTRA_DIST = lcdheadlines diff --git a/clients/lcdproc/Makefile.am b/clients/lcdproc/Makefile.am new file mode 100644 index 0000000..959dae8 --- /dev/null +++ b/clients/lcdproc/Makefile.am @@ -0,0 +1,3 @@ +bin_PROGRAMS = lcdproc +lcdproc_SOURCES = main.c main.h mode.c mode.h batt.c batt.h chrono.c chrono.h cpu.c cpu.h disk.c disk.h load.c load.h mem.c mem.h +lcdproc_LDADD = ../../shared/libLCDstuff.a diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..d1fb0cd --- /dev/null +++ b/configure.in @@ -0,0 +1,108 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(clients/lcdproc/batt.c) +AM_INIT_AUTOMAKE(lcdproc, 0.4-pre9-auto) +AM_CONFIG_HEADER(config.h) + +AC_CANONICAL_HOST +case "$host" in +*-*-*linux*) + AC_DEFINE(LINUX) + ;; +*-*-*bsd*) + AC_DEFINE(xBSD) + ;; +esac + +AC_MSG_CHECKING(whether to enable debugging) +AC_ARG_ENABLE(debug, + [ --enable-debug show debug information], + AC_DEFINE(DEBUG) + debug=$withval, + debug="no" +) +AC_MSG_RESULT($debug) + +if test $debug = "yes"; then + CFLAGS="-g" +else + CFLAGS="-Wno-unused" +fi +CFLAGS="-Wall -Wp,-lang-c-c++-comments -O6 $CFLAGS" +export CFLAGS + +dnl Checks for programs. +AC_PROG_CC +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 Checks for header files. +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_STRUCT_TM +AC_TYPE_UID_T + +dnl Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_TYPE_SIGNAL +AC_CHECK_FUNCS(select socket strdup strerror strtol uname) + +dnl Check for various defines and features +AC_ARG_ENABLE(stat-nfs, + [ --enable-stat-nfs display filesystem stats for NFS], + AC_DEFINE(STAT_NFS) +) + +AC_ARG_ENABLE(stat-smbfs, + [ --enable-stat-smbfs display filesystem stats for SMBFS], + AC_DEFINE(STAT_SMBFS) +) + + +AC_ARG_WITH(lcdport, + [ --with-lcdport= the server port [13666]], + LCDPORT=$withval, + LCDPORT="13666" +) +AC_DEFINE_UNQUOTED(LCDPORT, $LCDPORT) + +AC_ARG_WITH(loadmax, + [ --with-loadmax= Max Load Avg at which the backlight will] + [ start blinking [1.3]], + LOAD_MAX=$withval, + LOAD_MAX=1.3 +) +AC_DEFINE_UNQUOTED(LOAD_MAX, $LOAD_MAX) + +AC_ARG_WITH(loadmin, + [ --with-loadmin= Min Load Avg at which the backlight will] + [ turn off (asleep) [0.05]], + LOAD_MIN=$withval, + LOAD_MIN=0.05 +) +AC_DEFINE_UNQUOTED(LOAD_MIN, $LOAD_MIN) + +LCD_DRIVERS_SELECT + +AC_OUTPUT(Makefile + shared/Makefile + server/Makefile + server/drivers/Makefile + clients/Makefile + clients/lcdproc/Makefile + clients/examples/Makefile + clients/headlines/Makefile + docs/Makefile) diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..f62ce44 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,2 @@ +man_MANS = lcdproc.1 +EXTRA_DIST = README.dg README.dg2 hd44780_howto.txt lcdproc.sgml menustuff.txt netstuff.txt lcdproc.1 diff --git a/server/Makefile.am b/server/Makefile.am new file mode 100644 index 0000000..aea61dc --- /dev/null +++ b/server/Makefile.am @@ -0,0 +1,4 @@ +SUBDIRS=drivers +sbin_PROGRAMS=LCDd +LCDd_SOURCES= client_data.c client_data.h client_functions.c client_functions.h client_menu.h clients.c clients.h input.c input.h main.c main.h menu.c menu.h menus.c menus.h parse.c parse.h render.c render.h screen.c screen.h screenlist.c screenlist.h serverscreens.c serverscreens.h sock.c sock.h widget.c widget.h +LCDd_LDADD = drivers/libLCDdrivers.a ../shared/libLCDstuff.a @LIBCURSES@ @LIBIRMAN@ diff --git a/server/drivers/Makefile.am b/server/drivers/Makefile.am new file mode 100644 index 0000000..4e41658 --- /dev/null +++ b/server/drivers/Makefile.am @@ -0,0 +1,8 @@ +noinst_LIBRARIES = libLCDdrivers.a +libLCDdrivers_a_SOURCES = lcd.c lcd.h drv_base.c +EXTRA_libLCDdrivers_a_SOURCES = MtxOrb.c MtxOrb.h text.c text.h \ + curses_drv.c curses_drv.h drv_base.c drv_base.h \ + hd44780.c hd44780.h port.h joy.c joy.h irmanin.c irmanin.h \ + CFontz.c CFontz.h debug.h +libLCDdrivers_a_DEPENDENCIES = @DRIVERS@ +libLCDdrivers_a_LIBADD = @DRIVERS@ diff --git a/shared/Makefile.am b/shared/Makefile.am new file mode 100644 index 0000000..5c4cb68 --- /dev/null +++ b/shared/Makefile.am @@ -0,0 +1,2 @@ +noinst_LIBRARIES = libLCDstuff.a +libLCDstuff_a_SOURCES = LL.c LL.h sockets.c sockets.h str.c str.h debug.h