mirror of
https://github.com/netfun2000/lcd4linux.git
synced 2026-02-27 09:44:34 +08:00
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
202 lines
4.1 KiB
Plaintext
202 lines
4.1 KiB
Plaintext
dnl Process this file with autoconf to produce a configure script.
|
|
AC_INIT(lcd4linux.c)
|
|
AM_INIT_AUTOMAKE(lcd4linux, 0.98)
|
|
AM_CONFIG_HEADER(config.h)
|
|
|
|
dnl Checks for programs.
|
|
AC_PROG_AWK
|
|
AC_PROG_CC
|
|
AC_PROG_INSTALL
|
|
AC_PROG_LN_S
|
|
|
|
dnl Checks for libraries.
|
|
AC_CHECK_LIB(m, log)
|
|
|
|
dnl Checks for X11
|
|
AC_PATH_XTRA
|
|
|
|
dnl drivers
|
|
AC_MSG_CHECKING([which drivers to compile])
|
|
AC_ARG_WITH(
|
|
drivers,
|
|
[ --with-drivers=<list> compile driver for displays in <list>,]
|
|
[ drivers may be separated with commas,]
|
|
[ 'all' (default) compiles all available drivers,]
|
|
[ drivers may be excluded with 'all,!<driver>',]
|
|
[ (try 'all,\!<driver>' if your shell complains...)]
|
|
[ possible drivers are:]
|
|
[ BeckmannEgle, CrystalFontz, HD44780,]
|
|
[ MatrixOrbital, PalmPilot, PNG, PPM, X11, Text],
|
|
drivers=$withval,
|
|
drivers=all
|
|
)
|
|
|
|
drivers=`echo $drivers|sed 's/,/ /g'`
|
|
|
|
for driver in $drivers; do
|
|
|
|
case $driver in
|
|
!*)
|
|
val="no"
|
|
driver=`echo $driver|cut -c 2-`
|
|
;;
|
|
*)
|
|
val="yes"
|
|
;;
|
|
esac
|
|
|
|
case "$driver" in
|
|
all)
|
|
BECKMANNEGLE="yes"
|
|
CRYSTALFONTZ="yes"
|
|
HD44780="yes"
|
|
MATRIXORBITAL="yes"
|
|
PALMPILOT="yes"
|
|
PNG="yes"
|
|
PPM="yes"
|
|
TEXT="yes"
|
|
X11="yes"
|
|
;;
|
|
BeckmannEgle)
|
|
BECKMANNEGLE=$val
|
|
;;
|
|
CrystalFontz)
|
|
CRYSTALFONTZ=$val
|
|
;;
|
|
HD44780)
|
|
HD44780=$val
|
|
;;
|
|
MatrixOrbital)
|
|
MATRIXORBITAL=$val
|
|
;;
|
|
PalmPilot)
|
|
PALMPILOT=$val
|
|
;;
|
|
PNG)
|
|
PNG=$val
|
|
;;
|
|
PPM)
|
|
PPM=$val
|
|
;;
|
|
SIN)
|
|
SIN=$val
|
|
;;
|
|
Skeleton)
|
|
SKELETON=$val
|
|
;;
|
|
Text)
|
|
TEXT=$val
|
|
;;
|
|
X11)
|
|
X11=$val
|
|
;;
|
|
*)
|
|
AC_MSG_ERROR([Unknown driver '$driver'])
|
|
;;
|
|
esac
|
|
done
|
|
|
|
AC_MSG_RESULT([done])
|
|
|
|
RASTER="no"
|
|
|
|
if test "$BECKMANNEGLE" = "yes"; then
|
|
DRIVERS="$DRIVERS BeckmannEgle.o"
|
|
AC_DEFINE(WITH_BECKMANNEGLE)
|
|
fi
|
|
|
|
if test "$CRYSTALFONTZ" = "yes"; then
|
|
DRIVERS="$DRIVERS Crystalfontz.o"
|
|
AC_DEFINE(WITH_CRYSTALFONTZ)
|
|
fi
|
|
|
|
if test "$HD44780" = "yes"; then
|
|
DRIVERS="$DRIVERS HD44780.o"
|
|
AC_DEFINE(WITH_HD44780)
|
|
fi
|
|
|
|
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(DRVLIBS)
|
|
|
|
dnl Checks for header files.
|
|
AC_HEADER_STDC
|
|
AC_HEADER_DIRENT
|
|
AC_HEADER_SYS_WAIT
|
|
AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/ioctl.h sys/time.h syslog.h unistd.h)
|
|
AC_CHECK_HEADERS(sys/io.h asm/io.h)
|
|
AC_CHECK_HEADERS(gd/gd.h gd.h)
|
|
AC_CHECK_HEADERS(net/if_ppp.h)
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
AC_C_CONST
|
|
AC_C_INLINE
|
|
AC_TYPE_PID_T
|
|
AC_TYPE_SIZE_T
|
|
AC_HEADER_TIME
|
|
AC_STRUCT_TM
|
|
AC_TYPE_UID_T
|
|
|
|
dnl Checks for library functions.
|
|
AC_PROG_GCC_TRADITIONAL
|
|
AC_FUNC_MEMCMP
|
|
AC_TYPE_SIGNAL
|
|
AC_CHECK_FUNCS(gettimeofday putenv select socket strdup strerror strstr strtol uname)
|
|
|
|
AC_OUTPUT(Makefile)
|