aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
blob: 1143d986345156f3c77ec257e19b9d8664419b1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT([LCD4Linux],[0.10.0],[reinelt@eunet.at])
AC_CONFIG_SRCDIR([lcd4linux.c])
AM_INIT_AUTOMAKE([lcd4linux],0.10.0)
AM_CONFIG_HEADER(config.h)

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
# Using `AC_PROG_RANLIB' is rendered 
# obsolete by `AC_PROG_LIBTOOL' :-(
#AC_PROG_RANLIB
AC_PROG_LIBTOOL

# dmalloc
AM_WITH_DMALLOC

# Checks for libraries.
AC_CHECK_LIB(m, log)

# curses
sinclude(curses.m4)
AC_CHECK_CURSES

# Checks for X11
AC_PATH_XTRA

# check for gd.h
AC_CHECK_HEADERS(gd/gd.h gd.h, [has_gd=true], [has_gd=false])

# 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, Curses, Cwlinux,]
  [                        HD44780, M50530, T6963, USBLCD, MatrixOrbital,]
  [                        MilfordInstruments, PalmPilot, PNG, PPM, X11],
  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"
         CURSES="yes"
         CWLINUX="yes"
         HD44780="yes"
         M50530="yes"
         T6963="yes"
         USBLCD="yes"
         MATRIXORBITAL="yes"
         MILINST="yes"
         PALMPILOT="yes"
         PNG="yes"
         PPM="yes"
         X11="yes"
         ;;
      BeckmannEgle)
         BECKMANNEGLE=$val
         ;;
      CrystalFontz)
         CRYSTALFONTZ=$val
         ;;
      Curses)
         CURSES=$val
         ;;
      Cwlinux)
         CWLINUX=$val
         ;;
      HD44780)
         HD44780=$val
	 ;;
      M50530)
         M50530=$val
         ;;
      T6963)
         T6963=$val
         ;;
      USBLCD)
         USBLCD=$val
         ;;
      MatrixOrbital)
         MATRIXORBITAL=$val
         ;;
      MilfordInstruments)
         MILINST=$val
         ;;
      PalmPilot)
         PALMPILOT=$val
         ;;
      PNG)
         PNG=$val
         ;;
      PPM)
         PPM=$val
         ;;
      X11)
         X11=$val
         ;;
      *) 	
         AC_MSG_ERROR([Unknown driver '$driver'])
         ;;
   esac
done

AC_MSG_RESULT([done])

PARPORT="no"
SERIAL="no"
TEXT="no"
GRAPHIC="no"

if test "$BECKMANNEGLE" = "yes"; then
#  DRIVERS="$DRIVERS BeckmannEgle.lo"
#  DRIVERS="$DRIVERS BeckmannEgle.o"
   AC_DEFINE(WITH_BECKMANNEGLE,1,[Beckmann&Egle driver])
fi

if test "$CRYSTALFONTZ" = "yes"; then
   TEXT="yes"
   SERIAL="yes"
#  DRIVERS="$DRIVERS drv_Crystalfontz.lo"
   DRIVERS="$DRIVERS drv_Crystalfontz.o"
   AC_DEFINE(WITH_CRYSTALFONTZ,1,[Crystalfontz driver])
fi

if test "$CURSES" = "yes"; then
   if test "$has_curses" = true; then
#     DRIVERS="$DRIVERS Text.lo"
#     DRIVERS="$DRIVERS Text.o"
      DRVLIBS="$DRVLIBS $CURSES_LIBS"
      CPPFLAGS="$CPPFLAGS $CURSES_INCLUDES"
      AC_DEFINE(WITH_TEXT,1,[Curses driver])
   else
      AC_MSG_WARN(curses not found: Curses driver disabled)
   fi   
fi

if test "$CWLINUX" = "yes"; then
   TEXT="yes"
   SERIAL="yes"
#  DRIVERS="$DRIVERS drv_Cwlinux.lo"
   DRIVERS="$DRIVERS drv_Cwlinux.o"
   AC_DEFINE(WITH_CWLINUX,1,[CwLinux driver])
fi

if test "$HD44780" = "yes"; then
   TEXT="yes"
   PARPORT="yes"
#  DRIVERS="$DRIVERS drv_HD44780.lo"
   DRIVERS="$DRIVERS drv_HD44780.o"
   AC_DEFINE(WITH_HD44780,1,[HD44780 driver])
fi

if test "$M50530" = "yes"; then
   TEXT="yes"
   PARPORT="yes"
#  DRIVERS="$DRIVERS drv_M50530.lo"
   DRIVERS="$DRIVERS drv_M50530.o"
   AC_DEFINE(WITH_M50530,1,[M50530 driver])
fi

if test "$T6963" = "yes"; then
   GRAPHIC="yes"
   PARPORT="yes"
#  DRIVERS="$DRIVERS drv_T6963.lo"
   DRIVERS="$DRIVERS drv_T6963.o"
   AC_DEFINE(WITH_T6963,1,[T6963 driver])
fi

if test "$USBLCD" = "yes"; then
   TEXT="yes"
   SERIAL="yes"
#  DRIVERS="$DRIVERS drv_USBLCD.lo"
   DRIVERS="$DRIVERS drv_USBLCD.o"
   AC_DEFINE(WITH_USBLCD,1,[USBLCD driver])
fi

if test "$MATRIXORBITAL" = "yes"; then
   SERIAL="yes"
#  DRIVERS="$DRIVERS drv_MatrixOrbital.lo"
   DRIVERS="$DRIVERS drv_MatrixOrbital.o"
   AC_DEFINE(WITH_MATRIXORBITAL,1,[MatrixOrbital driver])
fi

if test "$MILINST" = "yes"; then
#  DRIVERS="$DRIVERS MilfordInstruments.lo"
#  DRIVERS="$DRIVERS MilfordInstruments.o"
   AC_DEFINE(WITH_MILINST,1,[Milford Instruments driver])
fi

if test "$PALMPILOT" = "yes"; then
#  DRIVERS="$DRIVERS PalmPilot.lo"
#  DRIVERS="$DRIVERS PalmPilot.o"
   AC_DEFINE(WITH_PALMPILOT,1,[PalmPilot driver])
fi

if test "$PNG" = "yes"; then
   if test "$has_gd" = "true"; then
      GRAPHIC="yes"
      AC_DEFINE(WITH_PNG,1,[ driver])
      DRVLIBS="$DRVLIBS -lgd"
   else
      AC_MSG_WARN(gd.h not found: PNG driver disabled)
   fi
fi

if test "$PPM" = "yes"; then
   if test "$has_gd" = "true"; then
      GRAPHIC="yes"
      AC_DEFINE(WITH_PPM,1,[ driver])
   else
      AC_MSG_WARN(gd.h not found: PNG driver disabled)
   fi
fi

if test "$X11" = "yes"; then
   if test "$no_x" = "yes"; then
      AC_MSG_ERROR(X11 headers or libraries not available: X11 driver disabled)
   else
      GRAPHIC="yes"
#     DRIVERS="$DRIVERS drv_X11.lo"
      DRIVERS="$DRIVERS drv_X11.o"
      DRVLIBS="$DRVLIBS -L$ac_x_libraries -lX11"
      AC_DEFINE(WITH_X11,1,[X11 driver])
   fi
fi

if test "$DRIVERS" = ""; then
   AC_MSG_ERROR([You should include at least one driver...])
fi
   
# generic text driver
if test "$TEXT" = "yes"; then
#  DRIVERS="$DRIVERS drv_generic_text.lo"
   DRIVERS="$DRIVERS drv_generic_text.o"
fi

# generic graphic driver
if test "$GRAPHIC" = "yes"; then
:
#  DRIVERS="$DRIVERS 
   DRIVERS="$DRIVERS drv_generic_graphic.o"
fi

# generic parport driver
if test "$PARPORT" = "yes"; then
#  DRIVERS="$DRIVERS drv_generic_parport.lo"
   DRIVERS="$DRIVERS drv_generic_parport.o"
fi

# generic serial driver
if test "$SERIAL" = "yes"; then
#  DRIVERS="$DRIVERS drv_generic_serial.lo"
   DRIVERS="$DRIVERS drv_generic_serial.o"
fi

AC_SUBST(DRIVERS)
AC_SUBST(DRVLIBS)

# Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h])
AC_CHECK_HEADERS(sys/io.h asm/io.h)
AC_CHECK_HEADERS(linux/parport.h linux/ppdev.h)
AC_CHECK_HEADERS(linux/dvb/frontend.h)
AC_CHECK_HEADERS(net/if_ppp.h)
AC_CHECK_HEADERS(asm/msr.h)

# 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_TYPE_UID_T

# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_PROG_GCC_TRADITIONAL

# uClibc has no getloadavg()
# AC_FUNC_GETLOADAVG sounds promising, but does not really work
#AC_FUNC_GETLOADAVG

#removed for uClibc compatibility
#AC_FUNC_MALLOC
#AC_FUNC_REALLOC

AC_FUNC_MEMCMP
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_CHECK_FUNCS([atexit dup2 gethostbyname getloadavg gettimeofday memmove memset pow putenv regcomp select socket sqrt strcasecmp strchr strdup strerror strncasecmp strndup strpbrk strrchr strstr strtol uname])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT