Added README.
[irreco.git] / lirc-0.8.4a / configure.ac
blob55abed621fb6cf944c60f52434a537da3ab8722e
1 dnl $Id: configure.ac,v 1.17.2.1 2008/10/26 14:11:30 lirc Exp $
3 dnl Process this file with autoconf to produce a configure script.
4 dnl configure.ac, (c)1999 Tom Wheeley <tw104@york.ac.uk>
6 AC_INIT
7 AC_CONFIG_SRCDIR([daemons/lircd.c])
9 AM_INIT_AUTOMAKE(lirc, 0.8.4a)
10 AM_CONFIG_HEADER(config.h)
12 CFLAGS="${CFLAGS--O2 -g -Wall}"
14 dnl Checks for programs.
15 AC_PROG_CC
16 AM_PROG_CC_C_O
17 AC_PROG_INSTALL
18 AC_PROG_MAKE_SET
19 AC_PATH_PROG(mknod, mknod, /bin/mknod)
20 AC_PATH_PROG(mkfifo, mkfifo, /usr/bin/mkfifo)
21 AC_PATH_PROG(depmod, depmod, /sbin/depmod, $PATH:/sbin)
22 AC_PATH_PROG(LIBUSB_CONFIG, libusb-config)
23 AC_PROG_LN_S
24 AC_PROG_LIBTOOL
25 AM_PATH_PYTHON
26 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ""])
28 dnl Checks for header files.
29 AC_HEADER_STDC
30 AC_HEADER_TIME
31 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h syslog.h unistd.h)
33 dnl Checks for typedefs, structures, and compiler characteristics.
34 AC_C_CONST
35 AC_C_INLINE
36 AC_TYPE_OFF_T
37 AC_TYPE_PID_T
38 AC_TYPE_SIZE_T
39 AC_STRUCT_TM
41 dnl Checks for library functions.
42 AC_TYPE_SIGNAL
43 AC_FUNC_VPRINTF
44 AC_CHECK_FUNCS(gethostname gettimeofday mkfifo select socket strdup \
45         strerror strtoul snprintf strsep vsyslog)
47 forkpty=""
48 AC_CHECK_FUNCS(forkpty)
49 if test "$ac_cv_func_forkpty" != yes; then
50   AC_CHECK_LIB(util,forkpty,[
51     forkpty="-lutil"
52     AC_DEFINE(HAVE_FORKPTY)])
55 vga_progs=
56 AC_CHECK_HEADER(vga.h,
57   [AC_CHECK_HEADER(vgagl.h,
58     [AC_CHECK_LIB(vga, vga_init,
59       [AC_CHECK_LIB(vgagl, gl_setcontextvga,
60         [AC_DEFINE(HAVE_LIBVGA)]
61         vga_progs=smode2,,
62         -lvga
63       )]
64     )]
65   )]
67 x_progs="irxevent xmode2"
68 AC_PATH_XTRA
69 if test "$no_x" = "yes"; then
70   x_progs=
73 dnl getopt_long support
74 AC_CHECK_FUNCS(getopt_long,,
75   [AC_CHECK_LIB(gnugetopt,getopt_long,LDFLAGS="${LDFLAGS} -lgnugetopt",
76     [AC_MSG_ERROR([*** your libc doesn't provide the getopt_long function.
77 Therfore you need to have \"libgnugetopt\" installed to compile LIRC.
78 You can get a version from:
79   http://www.inf.ethz.ch/~mringwal/downloads/libgnugetopt-1.2.tar.gz
80 Extract the package and do a \"./configure  && make && sudo make install\"
81 in its directory.
82 ])]
83   )]
85         
87 dnl Determine default configuration based on OS
88 case "${host_os}" in
89   darwin*)
90     dnl Mac OS X configuration
92     dnl PortAudio for mac os x
93     portaudio_lib_other="-framework CoreAudio -framework AudioToolbox"
95     dnl default devdir, on mac os x/darwin, /dev/ can not be used without kernel programming, so use a fifo somewhere else
96     devdir_default="/usr/lirc/dev/"
97     use_fifos="yes"
98     ;;
99   *)
100     dnl Unix OSS configuration
102     dnl PortAudio for UNIX OSS
103     portaudio_lib_other="-lm -lpthread ${forkpty}"
105     dnl default devdir
106     devdir_default="/dev"
107     use_fifos="no"
108     ;;
109 esac
111 # use fifo instead of devnode (required on mac os x)
112 AM_CONDITIONAL(USE_FIFOS, test "$use_fifos" = "yes")
115 dnl look for Linux kernel source
117 AC_PATH_KERNEL_SOURCE
119 dnl here we see what drivers we could possibly even hope to run.
120 dnl this could be _much_ more sophisticated!  especially the lirc ones.
122 AC_MSG_CHECKING([for which drivers can be installed on this system])
123 AC_MSG_RESULT()
125 possible_drivers="(none) \
126         (userspace) \
127         (accent) \
128         (bte) \
129         (creative) \
130         (ea65) \
131         (exaudio) \
132         (irlink) \
133         (irreal) \
134         (livedrive_midi) \
135         (livedrive_seq) \
136         (logitech) \
137         (mediafocusI) \
138         (mouseremote) \
139         (mouseremote_ps2) \
140         (mp3anywhere) \
141         (mplay) \
142         (pcmak) \
143         (pcmak_usb) \
144         (pctv) \
145         (remotemaster) \
146         (silitek) \
147         (slinke) \
148         (tira) \
149         (uirt2) \
150         (uirt2_raw) \
151         (usb_uirt_raw) \
152         (usbx) \
153         (udp)"
155 if test x${no_kernel} != xyes; then
156   possible_drivers="${possible_drivers} \
157         (all) \
158         (lirc_dev) \
159         (lirc_dev lirc_atiusb) \
160         (lirc_dev lirc_bt829) \
161         (lirc_dev commandir lirc_cmdir) \
162         (lirc_dev lirc_gpio) \
163         (lirc_dev lirc_i2c) \
164         (lirc_dev lirc_igorplugusb) \
165         (lirc_dev lirc_ttusbir) \
166         (lirc_dev lirc_imon) \
167         (lirc_dev lirc_it87) \
168         (lirc_dev lirc_ite8709) \
169         (lirc_dev lirc_mceusb) \
170         (lirc_dev lirc_mceusb2) \
171         (lirc_dev lirc_parallel) \
172         (lirc_dev lirc_sasem) \
173         (lirc_dev lirc_serial) \
174         (lirc_dev lirc_sir) \
175         (lirc_dev lirc_streamzap)"
178 AH_TEMPLATE([DAEMONIZE],
179         [Define to run daemons as daemons])
181 AH_TEMPLATE([DEBUG],
182         [Define to enable debugging output])
184 AH_TEMPLATE([DEVDIR],
185         [device files directory])
187 AH_TEMPLATE([DYNCODES],
188         [Define to use dynamic IR codes])
190 AH_TEMPLATE([HAVE_ALSA_SB_RC],  
191         [Define if the ALSA library with SB RC support is installed])
193 AH_TEMPLATE([HAVE_FORKPTY],
194         [Define if forkpty is available])
196 AH_TEMPLATE([HAVE_IGUANAIR],
197         [Define if the iguanaIR library is installed])
199 AH_TEMPLATE([HAVE_LIBALSA],
200         [Define if the ALSA library is installed])
202 AH_TEMPLATE([HAVE_LIBCARACA],
203         [Define if the caraca library is installed])
205 AH_TEMPLATE([HAVE_LIBIRMAN],
206         [Define if the libirman library is installed])
208 AH_TEMPLATE([HAVE_LIBIRMAN_SW],
209         [Define if the software only test version of libirman is installed])
211 AH_TEMPLATE([HAVE_LIBPORTAUDIO],
212         [Define if the portaudio library is installed])
214 AH_TEMPLATE([HAVE_LIBUSB],
215         [Define if libusb is installed])
217 AH_TEMPLATE([HAVE_LIBVGA],
218         [Define if the complete vga libraries (vga, vgagl) are installed])
220 AH_TEMPLATE([HAVE_LINUX_DEVINPUT],
221         [defined if Linux input interface is available])
223 AH_TEMPLATE([HAVE_LINUX_HIDDEV_FLAG_UREF],
224         [defined if Linux hiddev HIDDEV_FLAG_UREF flag is available])
226 AH_TEMPLATE([HAVE_SCSI],
227         [defined if SCSI API is available])
229 AH_TEMPLATE([HAVE_SOUNDCARD],
230         [defined if soundcard API is available])
232 AH_TEMPLATE([HAVE_VSYSLOG],
233         [define if you have vsyslog( prio, fmt, va_arg )])
235 AH_TEMPLATE([HW_DEFAULT],
236         [The name of the hw_* structure to use by default])
238 AH_TEMPLATE([LIRC_DRIVER],
239         [Text string signifying which driver is configured])
241 AH_TEMPLATE([LIRC_DRIVER_ANY],
242         [Define to include most drivers])
244 AH_TEMPLATE([LIRC_HAVE_DEVFS],
245         [Define if devfs support is present in current kernel])
247 AH_TEMPLATE([LIRC_IRQ],
248         [Set the IRQ for the lirc driver])
250 AH_TEMPLATE([LIRC_IRTTY],
251         [Set the default tty used by the irman/remotemaster driver])
253 AH_TEMPLATE([LIRC_IT87_DIGIMATRIX],
254         [Define if you want to use lirc_it87 with an Asus Digimatrix])
256 AH_TEMPLATE([LIRC_MAJOR],
257         [Set the device major for the lirc driver])
259 AH_TEMPLATE([LIRC_ON_SA1100],
260         [Define if you want to cross-compile for the SA1100])
262 AH_TEMPLATE([LIRC_PORT],
263         [Set the port address for the lirc driver])
265 AH_TEMPLATE([LIRC_SERIAL_ANIMAX],
266         [Define if you have an animax serial port receiver])
268 AH_TEMPLATE([LIRC_SERIAL_IGOR],
269         [Define if you have an Igor Cesko receiver])
271 AH_TEMPLATE([LIRC_SERIAL_IRDEO],
272         [Define if you have an IRdeo serial port receiver])
274 AH_TEMPLATE([LIRC_SERIAL_IRDEO_REMOTE],
275         [Define if you have an IRdeo remote transmitter])
277 AH_TEMPLATE([LIRC_SERIAL_NSLU2],
278         [Define if you have a Linksys NSLU2 and use CTS2+GreenLED])
280 AH_TEMPLATE([LIRC_SERIAL_SOFTCARRIER],
281         [Define if the software needs to generate the carrier frequency])
283 AH_TEMPLATE([LIRC_SERIAL_TRANSMITTER],
284         [Define if you have a IR diode connected to the serial port])
286 AH_TEMPLATE([LIRC_SIR_ACTISYS_ACT200L],
287         [Define if you want to use a Actisys Act200L])
289 AH_TEMPLATE([LIRC_SIR_ACTISYS_ACT220L],
290         [Define if you want to use a Actisys Act220L])
292 AH_TEMPLATE([LIRC_SIR_TEKRAM],
293         [Define if you want to use a Tekram Irmate 210])
295 AH_TEMPLATE([LIRC_SYSLOG],
296         [syslog facility to use])
298 AH_TEMPLATE([LIRC_IMON_LCD],
299         [Define if your iMON is an LCD and not a VFD.])
301 AH_TEMPLATE([LIRC_TIMER],
302         [Set the timer for the parallel port driver])
304 AH_TEMPLATE([LOCALSTATEDIR],
305         [modifiable single-machine data])
307 AH_TEMPLATE([LONG_IR_CODE],
308         [Define to use long long IR codes])
310 AH_TEMPLATE([MAINTAINER_MODE],
311         [define in maintainer mode])
313 AH_TEMPLATE([SYSCONFDIR],
314         [system configuration directory])
316 AH_TEMPLATE([USE_SYSLOG],
317         [define if you want to log to syslog instead of logfile])
319 if test -n "${LIBUSB_CONFIG}"; then
320   AC_DEFINE(HAVE_LIBUSB)
321   possible_drivers="${possible_drivers} (atilibusb) (commandir)"
323 AC_CHECK_LIB(caraca_client, caraca_init,
324   AC_DEFINE(HAVE_LIBCARACA)
325   possible_drivers="${possible_drivers} (caraca)"
327 AC_CHECK_HEADER(iguanaIR.h,
328   AC_DEFINE(HAVE_IGUANAIR)
329   possible_drivers="${possible_drivers} (iguanaIR)"
331 AC_CHECK_LIB(irman, ir_strerror,
332   AC_DEFINE(HAVE_LIBIRMAN)
333   possible_drivers="${possible_drivers} (irman)"
335 AC_CHECK_LIB(irman_sw, ir_strerror,
336   AC_DEFINE(HAVE_LIBIRMAN_SW)
337   possible_drivers="${possible_drivers} (irman_sw)"
339 dnl audio driver requires PortAudio library installed and some linker flags
340 AC_CHECK_HEADERS(portaudio.h,[
341   AC_CHECK_LIB(portaudio, Pa_Initialize,[
342     AC_DEFINE(HAVE_LIBPORTAUDIO)
343     possible_drivers="${possible_drivers} (audio)"
344     ],,${portaudio_lib_other}
345   )]
347 dnl audio_alsa driver requires ALSA library installed and some linker flags
348 have_alsa=no
349 AC_CHECK_HEADERS(alsa/asoundlib.h,[
350   AC_CHECK_LIB(asound, snd_pcm_open,[
351     AC_DEFINE(HAVE_LIBALSA)
352     have_alsa=yes
353     possible_drivers="${possible_drivers} (audio_alsa)"
354     ],,
355   )]
357 dnl alsa_usb driver requires an ALSA that knows about our hwdep device
358 if test "$have_alsa" = "yes"; then
359   AC_MSG_CHECKING(for ALSA SB RC hwdep support)
360   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
361 #include <alsa/asoundlib.h>
362 ]], [[
363   if (snd_hwdep_info_get_iface(NULL) == SND_HWDEP_IFACE_SB_RC) {}
364 ]])],[
365     AC_MSG_RESULT(yes)
366     AC_DEFINE(HAVE_ALSA_SB_RC)
367     possible_drivers="${possible_drivers} (alsa_usb)"
368     ],[
369     AC_MSG_RESULT(no)
370   ])
372 dnl creative_infracd driver requires linux scsi api
373 AC_CHECK_HEADERS(scsi/sg.h,[
374   AC_DEFINE(HAVE_SCSI)
375   possible_drivers="${possible_drivers} (creative_infracd)"
376   ]
378 dnl dev_input driver requires linux input device api
379 AC_CHECK_HEADERS(linux/input.h,[
380   AC_DEFINE(HAVE_LINUX_DEVINPUT)
381   possible_drivers="${possible_drivers} (devinput)"
382   ]
384 dnl check if hiddev is available
385 AC_CHECK_HEADERS([linux/types.h])
386 AC_CHECK_HEADERS([linux/hiddev.h],[
387   possible_drivers="${possible_drivers} (dvico) (asusdh) (bw6130) (macmini)"
388   AC_MSG_CHECKING(for HIDDEV_FLAG_UREF support)
389   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
390 #include <linux/types.h>
391 #include <linux/hiddev.h>
392     ]], [[
393       int flag = HIDDEV_FLAG_UREF;
394     ]])],[
395     AC_MSG_RESULT(yes)
396     AC_DEFINE(HAVE_LINUX_HIDDEV_FLAG_UREF)
397     possible_drivers="${possible_drivers} (samsung) (sb0540)"
398     ],[
399     AC_MSG_RESULT(no)
400     ])
401   ], [],
402 [#ifdef HAVE_LINUX_TYPES_H
403 #include <linux/types.h>
404 #endif
407 dnl dsp driver requires linux soundcard api
408 AC_CHECK_HEADERS(sys/soundcard.h,[
409   AC_DEFINE(HAVE_SOUNDCARD)
410   possible_drivers="${possible_drivers} (dsp)"
411   ]
413 dnl i2cuser driver requires the Linux I2C API
414 AC_CHECK_HEADERS(linux/i2c-dev.h,[
415   possible_drivers="${possible_drivers} (i2cuser)"
416   ]
419 dnl here we see what driver the user wants.
421 AC_ARG_WITH(driver,
422 [  --with-driver=X         specify the driver to use, where X is one of:
423                           all, none, userspace, accent, act200l,
424                           act220l, adaptec, alsa_usb, animax, asusdh,
425                           atilibusb, atiusb, audio, audio_alsa
426                           avermedia, avermedia_vdomate, avermedia98,
427                           bestbuy, bestbuy2, breakoutbox, bte, bw6130,
428                           caraca, chronos, cmdir, commandir, comX, cph06x,
429                           creative, creative_infracd, devinput,
430                           digimatrix, dsp, dvico, ea65, exaudio,
431                           flyvideo, gvbctv5pci, hauppauge,
432                           hauppauge_dvb, hercules_smarttv_stereo,
433                           i2cuser, igorplugusb, iguanaIR, imon,
434                           imon_24g, imon_knob, imon_lcd, imon_pad,
435                           imon_rsc, irdeo, irdeo_remote, irlink,
436                           irman, irreal, it87, ite8709, knc_one, kworld,
437                           leadtek_0007, leadtek_0010, leadtek_pvr2000,
438                           livedrive_midi, livedrive_seq, logitech,
439                           lptX, macmini, mceusb, mceusb2, mediafocusI,
440                           mouseremote, mouseremote_ps2, mp3anywhere,
441                           mplay, nslu2,packard_bell, parallel, pcmak,
442                           pcmak_usb, pctv, pixelview_bt878,
443                           pixelview_pak, pixelview_pro, provideo,
444                           realmagic, remotemaster, sa1100, samsung,
445                           sasem, sb0540, serial, silitek, sir, slinke,
446                           streamzap, tekram, tekram_bt829, tira,
447                           ttusbir, tuxbox, tvbox, udp, uirt2, 
448                           uirt2_raw, usb_uirt_raw, usbx], 
449 driver=${withval},
450 driver="unset"
453 #START HARDWARE HEURISTIC
455 lirc_driver="$driver"
456 lircd_conf=""
457 lircmd_conf=""
458 iguanaIR_lib=""
459 irman_lib=""
460 caraca_lib=""
461 commandir_lib=""
462 portaudio_lib=""
463 alsa_lib=""
464 atilibusb_lib=""
465 hw_module="hw_default.o receive.o transmit.o"
466 HW_DEFAULT="hw_default"
467 kernel_module=""
469 if test "$driver" = "none"; then
470   lirc_driver=none
471   hw_module=""
472   HW_DEFAULT="hw_null"
475 if test "$driver" = "userspace" -o "$driver" = "all"; then
476   AC_DEFINE(LIRC_DRIVER_ANY)
477   lirc_driver=$driver
478   
479   any_possible_drivers=`echo ${possible_drivers} | sed -e's/ /-/g' \
480                           -e's/)-(/ /g'  -e's/(//g' -e's/)//g' \
481                           -e's/-$//g'`
482   for any_driver in ${any_possible_drivers}; do
483   case ${any_driver} in
484         accent)
485                 hw_module="${hw_module} hw_accent.o serial.o"
486                 ;;
487         alsa_usb)
488                 hw_module="${hw_module} hw_alsa_usb.o"
489                 alsa_lib=-lasound
490                 ;;
491         asusdh)
492                 hw_module="${hw_module} hw_hiddev.o"
493                 ;;
494         atilibusb)
495                 hw_module="${hw_module} hw_atilibusb.o receive.o"
496                 atilibusb_lib=`${LIBUSB_CONFIG} --libs`
497                 CFLAGS="$CFLAGS `${LIBUSB_CONFIG} --cflags`"
498                 ;;
499         audio)
500                 hw_module="${hw_module} hw_audio.o receive.o"
501                 portaudio_lib="-lportaudio ${portaudio_lib_other}"
502                 ;;
503         audio_alsa)
504                 hw_module="${hw_module} hw_audio_alsa.o receive.o"
505                 alsa_lib=-lasound
506                 ;;
507         bte)
508                 hw_module="${hw_module} hw_bte.o serial.o"
509                 ;;
510         bw6130)
511                 hw_module="${hw_module} hw_hiddev.o"
512                 ;;
513         caraca)
514                 hw_module="${hw_module} hw_caraca.o"
515                 caraca_lib=-lcaraca_client
516                 ;;
517         creative)
518                 hw_module="${hw_module} hw_creative.o serial.o"
519                 ;;
520         creative_infracd)
521                 hw_module="${hw_module} hw_creative_infracd.o"
522                 ;;
523         commandir)
524                 hw_module="${hw_module} hw_commandir.o receive.o"
525                 commandir_lib=`${LIBUSB_CONFIG} --libs`
526                 CFLAGS="$CFLAGS `${LIBUSB_CONFIG} --cflags`"
527                 ;;
528         devinput)
529                 hw_module="${hw_module} hw_devinput.o"
530                 ;;
531         dsp)
532                 hw_module="${hw_module} hw_dsp.o receive.o"
533                 ;;
534         dvico)
535                 hw_module="${hw_module} hw_hiddev.o"
536                 ;;
537         ea65)
538                 hw_module="${hw_module} hw_ea65.o serial.o"
539                 ;;
540         exaudio)
541                 ;;
542         i2cuser)
543                 hw_module="${hw_module} hw_i2cuser.o receive.o"
544                 ;;
545         iguanaIR)
546                 hw_module="${hw_module} hw_iguanaIR.o transmit.o receive.o"
547                 iguanaIR_lib=-liguanaIR
548                 ;;
549         irlink)
550                 hw_module="${hw_module} hw_irlink.o serial.o receive.o"
551                 ;;
552         irman)
553                 hw_module="${hw_module} hw_irman.o serial.o"
554                 irman_lib=-lirman
555                 ;;
556         # There is not much sense in using 'irman_sw' with driver
557         # 'any' and that would conflict with 'irman' which will
558         # probably also be available.
559         #
560         #irman_sw)
561                 #hw_module="${hw_module} hw_irman.o serial.o"
562                 #irman_lib=-lirman_sw
563                 #;;
564         irreal)
565                 #hw_module="${hw_module} hw_irreal.o serial.o receive.o transmit.o"
566                 ;;
567         lirc_dev-lirc_atiusb)
568                 ;;
569         lirc_dev-commandir-lirc_cmdir)
570                 ;;
571         lirc_dev-lirc_gpio)
572                 #lirc_driver="${lirc_driver} lirc_dev lirc_gpio"
573                 ;;
574         lirc_dev-lirc_i2c)
575                 #lirc_driver="${lirc_driver} lirc_dev lirc_i2c"
576                 ;;
577         lirc_dev-lirc_igorplugusb)
578                 ;;
579         lirc_dev-lirc_ttusbir)
580                 ;;
581         lirc_dev-lirc_imon)
582                 ;;
583         lirc_dev-lirc_it87)
584                 ;;
585         lirc_dev-lirc_ite8709)
586                 ;;
587         lirc_dev-lirc_mceusb)
588                 ;;
589         lirc_dev-lirc_mceusb2)
590                 ;;
591         lirc_dev-lirc_parallel)
592                 ;;
593         lirc_dev-lirc_sasem)
594                 ;;
595         lirc_dev-lirc_serial)
596                 ;;
597         lirc_dev-lirc_sir)
598                 ;;
599         lirc_dev-lirc_streamzap)
600                 ;;
601         lirc_flyvideo)
602                 ;;
603         livedrive_midi)
604                 hw_module="${hw_module} hw_livedrive_common.o hw_livedrive_midi.o"
605                 ;;
606         livedrive_seq)
607                 hw_module="${hw_module} hw_livedrive_common.o hw_livedrive_seq.o"
608                 ;;
609         logitech)
610                 hw_module="${hw_module} hw_logitech.o serial.o"
611                 ;;
612         macmini)
613                 hw_module="${hw_module} hw_hiddev.o"
614                 ;;
615         mediafocusI)
616                 ;;
617         mouseremote)
618                 hw_module="${hw_module} hw_mouseremote.o serial.o"
619                 ;;
620         mouseremote_ps2)
621                 hw_module="${hw_module} hw_mouseremote.o serial.o"
622                 ;;
623         mp3anywhere)
624                 hw_module="${hw_module} hw_mp3anywhere.o serial.o"
625                 ;;
626         mplay)
627                 hw_module="${hw_module} hw_mplay.o serial.o"
628                 ;;
629         pcmak*)
630                 hw_module="${hw_module} hw_pcmak.o serial.o"
631                 ;;
632         pctv)
633                 hw_module="${hw_module} hw_pinsys.o serial.o"
634                 ;;
635         remotemaster)
636                 hw_module="${hw_module} hw_pixelview.o serial.o"
637                 ;;
638         samsung)
639                 hw_module="${hw_module} hw_hiddev.o"
640                 ;;
641         sb0540)
642                 hw_module="${hw_module} hw_hiddev.o"
643                 ;;
644         silitek)
645                 hw_module="${hw_module} hw_silitek.o serial.o"
646                 ;;
647         #slinke)
648                 #hw_module="${hw_module} hw_slinke.o serial.o receive.o"
649                 #;;
650         tira)
651                 hw_module="${hw_module} hw_tira.o"
652                 ;;
653         udp)
654                 hw_module="${hw_module} hw_udp.o receive.o"
655                 ;;
656         uirt2)
657                 hw_module="${hw_module} hw_uirt2.o serial.o"
658                 ;;
659         uirt2_raw|usb_uirt_raw)
660                 hw_module="${hw_module} hw_uirt2_raw.o hw_uirt2_common.o serial.o receive.o transmit.o"
661                 ;;
662         usbx)
663                 hw_module="${hw_module} hw_usbx.o serial.o"
664                 ;;
665   esac
666   done
667   #remove duplicates
669   #sed segfaults when $hw_module is too long :(
670   #hw_module=`echo ${hw_module}| sed \
671   #                     -e':again' \
672   #                     -e's/\(.*\)\(\<.*\) \(.*\) \2\(.*\)$/\1\2 \3\4/' \
673   #                     -e'tagain'`
675   space_to_newline()
676   { for token in $*; do echo $token; done; }
677   newline_to_space()
678   { echo $*; }
679   
680   hw_module=$(newline_to_space $(space_to_newline ${hw_module}| sort -u))
684 if test "$driver" = "accent"; then
685   lirc_driver="none"
686   hw_module="hw_accent.o serial.o"
687   HW_DEFAULT="hw_accent"
688   lircd_conf="kanam_accent/lircd.conf.IR-100"
691 if test "$driver" = "act200l"; then
692   lirc_driver="lirc_dev lirc_sir"
693   AC_DEFINE(LIRC_SIR_ACTISYS_ACT200L)
696 if test "$driver" = "act220l"; then
697   lirc_driver="lirc_dev lirc_sir"
698   AC_DEFINE(LIRC_SIR_ACTISYS_ACT220L)
700     
701 if test "$driver" = "adaptec"; then
702   lirc_driver="lirc_dev lirc_i2c"
703   lircd_conf="adaptec/lircd.conf.AVC-2410"
704 #  lircmd_conf="adaptec/lircmd.conf.AVC-2410"
707 if test "$driver" = "alsa_usb"; then
708   lirc_driver="alsa_usb"
709   hw_module="hw_alsa_usb.o"
710   HW_DEFAULT="hw_alsa_usb"
711   alsa_lib=-lasound
712   lircd_conf="creative/lircd.conf.alsa_usb"
715 if test "$driver" = "animax"; then
716   lirc_driver="lirc_dev lirc_serial"
717   lircd_conf="animax/lircd.conf.animax"
718   lircmd_conf="animax/lircmd.conf.animax"
719   AC_DEFINE(LIRC_SERIAL_ANIMAX)
722 if test "$driver" = "asusdh"; then
723   lirc_driver="$driver"
724   hw_module="hw_hiddev.o"
725   HW_DEFAULT="hw_asusdh"
726   lircd_conf="asus/lircd.conf.asusdh"
729 if test "$driver" = "atiusb"; then
730   lirc_driver="lirc_dev lirc_atiusb"
731   lircd_conf="atiusb/lircd.conf.atiusb"
734 if test "$driver" = "atilibusb"; then
735   lirc_driver="$driver"
736   hw_module="hw_atilibusb.o receive.o"
737   HW_DEFAULT="hw_atilibusb"
738   lircd_conf="atiusb/lircd.conf.atilibusb"
739   if test -n "${LIBUSB_CONFIG}"; then
740     atilibusb_lib=`${LIBUSB_CONFIG} --libs`
741     CFLAGS="$CFLAGS `${LIBUSB_CONFIG} --cflags`"
742   fi
745 if test "$driver" = "audio"; then
746   lirc_driver="audio"
747   hw_module="hw_audio.o receive.o"
748   HW_DEFAULT="hw_audio"
749   portaudio_lib="-lportaudio ${portaudio_lib_other}"
752 if test "$driver" = "audio_alsa"; then
753   lirc_driver="audio_alsa"
754   hw_module="hw_audio_alsa.o receive.o"
755   HW_DEFAULT="hw_audio_alsa"
756   alsa_lib=-lasound
759 if test "$driver" = "avermedia"; then
760   lirc_driver="lirc_dev lirc_gpio"
761   lircd_conf="avermedia/lircd.conf.avermedia"
762   lircmd_conf="avermedia/lircmd.conf.avermedia"
765 if test "$driver" = "avermedia98"; then
766   lirc_driver="lirc_dev lirc_gpio"
767   lircd_conf="avermedia/lircd.conf.avermedia98"
768   lircmd_conf="avermedia/lircmd.conf.avermedia98"
771 if test "$driver" = "avermedia_vdomate"; then
772   lirc_driver="lirc_dev lirc_gpio"
773   lircd_conf="avermedia/lircd.conf.vdomate"
774 #  lircmd_conf="avermedia/lircmd.conf.vdomate"
777 if test "$driver" = "bestbuy"; then
778   lirc_driver="lirc_dev lirc_gpio"
779   lircd_conf="bestbuy/lircd.conf.bestbuy"
780   lircmd_conf="bestbuy/lircmd.conf.bestbuy"
783 if test "$driver" = "bestbuy2"; then
784   lirc_driver="lirc_dev lirc_gpio"
785   lircd_conf="bestbuy/lircd.conf.bestbuy2"
786   lircmd_conf="bestbuy/lircmd.conf.bestbuy2"
789 if test "$driver" = "breakoutbox"; then
790   lirc_driver="lirc_dev lirc_i2c"
791   lircd_conf="creative/lircd.conf.breakoutbox"
794 if test "$driver" = "bte"; then
795   lirc_driver="none"
796   hw_module="hw_bte.o  serial.o"
797   HW_DEFAULT="hw_bte"
798   lircd_conf="ericsson/lircd.conf.bte"
799 #  lircmd_conf="ericsson/lircmd.conf.bte"
802 if test "$driver" = "bw6130"; then
803   lirc_driver="$driver"
804   hw_module="hw_hiddev.o"
805   HW_DEFAULT="hw_bw6130"
806   lircd_conf="remotec/lircd.conf.BW6130"
807   lircmd_conf="remotec/lircmd.conf.BW6130"
810 if test "$driver" = "caraca"; then
811   lirc_driver="caraca"
812   hw_module="hw_caraca.o"
813   HW_DEFAULT="hw_caraca"
814   caraca_lib=-lcaraca_client
815   lircd_conf="caraca/lircd.conf.caraca"
816 #  lircmd_conf="caraca/lircmd.conf.caraca"
819 if test "$driver" = "chronos"; then
820   lirc_driver="lirc_dev lirc_gpio"
821   lircd_conf="chronos/lircd.conf.chronos"
822 #  lircmd_conf="chronos/lircmd.conf.chronos"
825 if test "$driver" = "cmdir"; then
826   lirc_driver="lirc_dev commandir lirc_cmdir"
829 if test "$driver" = "com1"; then
830   lirc_driver="lirc_dev lirc_serial"
831   port=0x3f8
832   irq=4
835 if test "$driver" = "com2"; then
836   lirc_driver="lirc_dev lirc_serial"
837   port=0x2f8
838   irq=3
841 if test "$driver" = "com3"; then
842   lirc_driver="lirc_dev lirc_serial"
843   port=0x3e8
844   irq=4
847 if test "$driver" = "com4"; then
848   lirc_driver="lirc_dev lirc_serial"
849   port=0x2e8
850   irq=3
853 if test "$driver" = "commandir"; then
854   lirc_driver="$driver"
855   hw_module="hw_commandir.o receive.o transmit.o"
856   HW_DEFAULT="hw_commandir"
857   lircd_conf="hauppauge/lircd.conf.hauppauge"
858   lircmd_conf="hauppauge/lircmd.conf.hauppauge"
859   if test -n "${LIBUSB_CONFIG}"; then
860     commandir_lib=`${LIBUSB_CONFIG} --libs`
861     CFLAGS="$CFLAGS `${LIBUSB_CONFIG} --cflags`"
862   fi
865 if test "$driver" = "cph03x" -o "$driver" = "cph06x"; then
866   lirc_driver="lirc_dev lirc_gpio"
867   lircd_conf="cph03x/lircd.conf.cph03x"
868 #  lircmd_conf="cph03x/lircmd.conf.cph03x"
871 if test "$driver" = "creative"; then
872   lirc_driver="none"
873   hw_module="hw_creative.o serial.o"
874   HW_DEFAULT="hw_creative"
875   lircd_conf="creative/lircd.conf.creative"
876 #  lircmd_conf="creative/lircmd.conf.creative"
879 if test "$driver" = "creative_infracd"; then
880   lirc_driver="none"
881   hw_module="hw_creative_infracd.o"
882   HW_DEFAULT="hw_creative_infracd"
883   lircd_conf="creative/lircd.conf.infracd"
886 if test "$driver" = "devinput"; then
887   lirc_driver="none"
888   hw_module="hw_devinput.o"
889   HW_DEFAULT="hw_devinput"
890 # for table.html (unset later)
891   lircd_conf='<A HREF="http://linux.bytesex.org/v4l2/faq.html#lircd">generic config file for Linux input layer</A>'
894 if test "$driver" = "digimatrix"; then
895   lirc_driver="lirc_dev lirc_it87"
896   lircd_conf="asus/lircd.conf.digimatrix"
897   AC_DEFINE(LIRC_IT87_DIGIMATRIX)
900 if test "$driver" = "dsp"; then
901   lirc_driver="none"
902   hw_module="hw_dsp.o receive.o"
903   HW_DEFAULT="hw_dsp"
906 if test "$driver" = "dvico"; then
907   lirc_driver="$driver"
908   hw_module="hw_hiddev.o"
909   HW_DEFAULT="hw_dvico"
910   lircd_conf="dvico/lircd.conf.fusionHDTV"
913 if test "$driver" = "ea65"; then
914   lirc_driver="none"
915   hw_module="hw_ea65.o  serial.o"
916   HW_DEFAULT="hw_ea65"
917   lircd_conf="ea65/lircd.conf.ea65"
920 if test "$driver" = "exaudio"; then
921   lirc_driver="none"
922 #  lircd_conf="creative/lircd.conf.exaudio"
923 #  lircmd_conf="creative/lircmd.conf.exaudio"
926 if test "$driver" = "flyvideo"; then
927   lirc_driver="lirc_dev lirc_gpio"
928   lircd_conf="life-view/lircd.conf.flyvideo"
929   lircmd_conf="life-view/lircmd.conf.flyvideo"
932 if test "$driver" = "gvbctv5pci"; then
933   lirc_driver="lirc_dev lirc_gpio"
934   lircd_conf="iodata/lircd.conf.gvbctv5pci"
935 #  lircmd_conf="iodata/lircmd.conf.gvbctv5pci"
938 if test "$driver" = "hauppauge"; then
939   lirc_driver="lirc_dev lirc_i2c"
940   lircd_conf="hauppauge/lircd.conf.hauppauge"
941   lircmd_conf="hauppauge/lircmd.conf.hauppauge"
944 if test "$driver" = "hauppauge_dvb"; then
945   lirc_driver="lirc_dev"
946   lircd_conf="hauppauge/lircd.conf.hauppauge"
947   lircmd_conf="hauppauge/lircmd.conf.hauppauge"
950 if test "$driver" = "hercules_smarttv_stereo"; then
951   lirc_driver="lirc_dev lirc_i2c"
952   lircd_conf="hercules/lircd.conf.smarttv_stereo"
955 if test "$driver" = "i2cuser"; then
956   lirc_driver="none"
957   hw_module="hw_i2cuser.o receive.o"
958   HW_DEFAULT="hw_i2cuser"
961 if test "$driver" = "igorplugusb"; then
962   lirc_driver="lirc_dev lirc_igorplugusb"
965 if test "$driver" = "iguanaIR"; then
966   lirc_driver="iguanaIR"
967   hw_module="hw_iguanaIR.o transmit.o receive.o"
968   HW_DEFAULT="hw_iguanaIR"
969   iguanaIR_lib=-liguanaIR
972 if test "$driver" = "imon"; then
973   lirc_driver="lirc_dev lirc_imon"
974   lircd_conf="imon/lircd.conf.imon"  
977 if test "$driver" = "imon_24g"; then
978   lirc_driver="lirc_dev lirc_imon"
979   lircd_conf="imon/lircd.conf.imon-2.4g"
982 if test "$driver" = "imon_knob"; then
983   lirc_driver="lirc_dev lirc_imon"
984   lircd_conf="imon/lircd.conf.imon-knob"
987 if test "$driver" = "imon_lcd"; then
988   lirc_driver="lirc_dev lirc_imon"
989   lircd_conf="imon/lircd.conf.imon"
990   AC_DEFINE(LIRC_IMON_LCD)
993 if test "$driver" = "imon_pad"; then
994   lirc_driver="lirc_dev lirc_imon"
995   lircd_conf="imon/lircd.conf.imon-pad"  
998 if test "$driver" = "imon_rsc"; then
999   lirc_driver="lirc_dev lirc_imon"
1000   lircd_conf="imon/lircd.conf.imon-rsc"  
1003 if test "$driver" = "irdeo"; then
1004   lirc_driver="lirc_dev lirc_serial"
1005   AC_DEFINE(LIRC_SERIAL_IRDEO)
1008 if test "$driver" = "irdeo_remote"; then
1009   lirc_driver="lirc_dev lirc_serial"
1010   AC_DEFINE(LIRC_SERIAL_IRDEO_REMOTE)
1013 if test "$driver" = "irlink"; then
1014   lirc_driver="none"
1015   hw_module="hw_irlink.o serial.o receive.o"
1016   HW_DEFAULT="hw_irlink"
1019 if test "$driver" = "irman"; then
1020   lirc_driver="irman"
1021   hw_module="hw_irman.o serial.o"
1022   HW_DEFAULT="hw_irman"
1023   irman_lib=-lirman
1026 if test "$driver" = "irman_sw"; then
1027   lirc_driver="irman_sw"
1028   hw_module="hw_irman.o serial.o"
1029   HW_DEFAULT="hw_irman"
1030   irman_lib=-lirman_sw
1033 if test "$driver" = "irreal"; then
1034   lirc_driver="none"
1035   hw_module="hw_irreal.o serial.o receive.o transmit.o"
1036   HW_DEFAULT="hw_irreal"
1039 if test "$driver" = "it87"; then
1040   lirc_driver="lirc_dev lirc_it87"
1043 if test "$driver" = "ite8709"; then
1044   lirc_driver="lirc_dev lirc_ite8709"
1047 if test "$driver" = "knc_one"; then
1048   lirc_driver="lirc_dev lirc_i2c"
1049   lircd_conf="knc_one/lircd.conf.knc_one"
1050 #  lircmd_conf="knc_one/lircmd.conf.knc_one"
1053 if test "$driver" = "kworld"; then
1054   lirc_driver="lirc_dev lirc_gpio"
1055   lircd_conf="kworld/lircd.conf.kworld"
1056 #  lircmd_conf="kworld/lircmd.conf.kworld"
1059 if test "$driver" = "leadtek_0007"; then
1060   lirc_driver="lirc_dev lirc_gpio"
1061   lircd_conf="leadtek/lircd.conf.RM-0007"
1062   lircmd_conf="leadtek/lircmd.conf.RM-0007"
1065 if test "$driver" = "leadtek_0010"; then
1066   lirc_driver="lirc_dev lirc_gpio"
1067   lircd_conf="leadtek/lircd.conf.RM-0010"
1068   lircmd_conf="leadtek/lircmd.conf.RM-0010"
1071 if test "$driver" = "leadtek_pvr2000"; then
1072   lirc_driver="lirc_dev lirc_i2c"
1073   lircd_conf="leadtek/lircd.conf.PVR2000"
1074 #  lircmd_conf="leadtek/lircmd.conf.PVR2000"
1077 if test "$driver" = "livedrive_midi"; then
1078   lirc_driver="none"
1079   hw_module="hw_livedrive_common.o hw_livedrive_midi.o"
1080   HW_DEFAULT="hw_livedrive_midi"
1081   lircd_conf="creative/lircd.conf.livedrive"
1082 #  lircmd_conf="creative/lircmd.conf.livedrive"
1085 if test "$driver" = "livedrive_seq"; then
1086   lirc_driver="none"
1087   hw_module="hw_livedrive_common.o hw_livedrive_seq.o"
1088   HW_DEFAULT="hw_livedrive_seq"
1089   lircd_conf="creative/lircd.conf.livedrive"
1090 #  lircmd_conf="creative/lircmd.conf.livedrive"
1093 if test "$driver" = "logitech"; then
1094   lirc_driver="none"
1095   hw_module="hw_logitech.o serial.o"
1096   HW_DEFAULT="hw_logitech"
1097   lircd_conf="logitech/lircd.conf.logitech"
1098   lircmd_conf="logitech/lircmd.conf.logitech"
1101 if test "$driver" = "lpt1"; then
1102   lirc_driver="lirc_dev lirc_parallel"
1103   port=0x378
1104   irq=7
1107 if test "$driver" = "lpt2"; then
1108   lirc_driver="lirc_dev lirc_parallel"
1109   port=0x278
1110   irq=5
1113 if test "$driver" = "macmini"; then
1114   lirc_driver="$driver"
1115   hw_module="hw_hiddev.o"
1116   HW_DEFAULT="hw_macmini"
1117   lircd_conf="apple/lircd.conf.macmini"
1120 if test "$driver" = "mceusb"; then
1121   lirc_driver="lirc_dev lirc_mceusb"
1122   lircd_conf="mceusb/lircd.conf.mceusb"
1125 if test "$driver" = "mceusb2"; then
1126   lirc_driver="lirc_dev lirc_mceusb2"
1127   lircd_conf="mceusb/lircd.conf.mceusb"
1130 if test "$driver" = "mediafocusI"; then
1131   lirc_driver="none"
1132   lircd_conf="technisat/lircd.conf.mediafocusI"
1133 #  lircmd_conf="technisat/lircmd.conf.mediafocusI"
1136 if test "$driver" = "mouseremote"; then
1137   lirc_driver="none"
1138   hw_module="hw_mouseremote.o serial.o"
1139   HW_DEFAULT="hw_mouseremote"
1140   lircd_conf="x10/lircd.conf.mouseremote"
1141   lircmd_conf="x10/lircmd.conf.mouseremote"
1144 if test "$driver" = "mouseremote_ps2"; then
1145   lirc_driver="none"
1146   hw_module="hw_mouseremote.o serial.o"
1147   HW_DEFAULT="hw_mouseremote_ps2"
1148   lircd_conf="x10/lircd.conf.mouseremote"
1149   lircmd_conf="x10/lircmd.conf.mouseremote"
1152 if test "$driver" = "mp3anywhere"; then
1153   lirc_driver="none"
1154   hw_module="hw_mp3anywhere.o serial.o"
1155   HW_DEFAULT="hw_mp3anywhere"
1156   lircd_conf="x10/lircd.conf.mp3anywhere"
1159 if test "$driver" = "mplay"; then
1160   lirc_driver="none"
1161   hw_module="hw_mplay.o serial.o"
1162   HW_DEFAULT="hw_mplay"
1163   lircd_conf="vlsystem/lircd.conf.mplay"
1166 if test "$driver" = "nslu2"; then
1167   lirc_driver="lirc_dev lirc_serial"
1168   AC_DEFINE(LIRC_SERIAL_NSLU2)
1171 if test "$driver" = "packard_bell"; then
1172   lirc_driver="lirc_dev lirc_serial"
1173   lircd_conf="packard_bell/lircd.conf.packard_bell"
1176 if test "$driver" = "parallel"; then
1177   lirc_driver="lirc_dev lirc_parallel"
1180 if test "$driver" = "pcmak" -o "$driver" = "pcmak_usb"; then
1181   lirc_driver="none"
1182   hw_module="hw_pcmak.o serial.o"
1183   HW_DEFAULT="hw_pcmak"
1184   lircd_conf="pcmak/lircd.conf.pcmak"
1185   lircmd_conf="pcmak/lircmd.conf.pcmak"
1188 if test "$driver" = "pctv"; then
1189   lirc_driver="none"
1190   hw_module="hw_pinsys.o serial.o"
1191   HW_DEFAULT="hw_pinsys"
1192   lircd_conf="pinnacle_systems/lircd.conf.pctv"
1193 #  lircmd_conf="pinnacle_systems/lircmd.conf.pctv"
1196 if test "$driver" = "pixelview_bt878"; then
1197   lirc_driver="lirc_dev lirc_i2c"
1198   lircd_conf="pixelview/lircd.conf.playtv_bt878"
1199 #  lircmd_conf="pixelview/lircmd.conf.pixelview_bt878"
1202 if test "$driver" = "pixelview_pak"; then
1203   lirc_driver="lirc_dev lirc_gpio"
1204 # the config files are the same as for the PlayTV pro
1205   lircd_conf="pixelview/lircd.conf.playtv_pro"
1206   lircmd_conf="pixelview/lircmd.conf.playtv_pro"
1209 if test "$driver" = "pixelview_pro"; then
1210   lirc_driver="lirc_dev lirc_gpio"
1211   lircd_conf="pixelview/lircd.conf.playtv_pro"
1212   lircmd_conf="pixelview/lircmd.conf.playtv_pro"
1215 if test "$driver" = "provideo"; then
1216   lirc_driver="lirc_dev lirc_i2c"
1217   lircd_conf="provideo/lircd.conf.pv951"
1218 #  lircmd_conf="provideo/lircmd.conf.pv951"
1221 if test "$driver" = "realmagic"; then
1222   lirc_driver="none"
1223   hw_module="hw_pixelview.o serial.o"
1224   HW_DEFAULT="hw_pixelview"
1225   lircd_conf="sigma_designs/lircd.conf.realmagic"
1226 #  lircmd_conf="sigma_designs/lircmd.conf.realmagic"
1229 if test "$driver" = "remotemaster"; then
1230   lirc_driver="none"
1231   hw_module="hw_pixelview.o serial.o"
1232   HW_DEFAULT="hw_pixelview"
1233   lircd_conf="pixelview/lircd.conf.remotemaster"
1234   lircmd_conf="pixelview/lircmd.conf.remotemaster"
1237 if test "$driver" = "sa1100"; then
1238   lirc_driver="lirc_dev lirc_sir"
1239   AC_DEFINE(LIRC_ON_SA1100)
1242 if test "$driver" = "sasem"; then
1243   lirc_driver="lirc_dev lirc_sasem"
1244   lircd_conf="sasem/lircd.conf.sasem"
1247 if test "$driver" = "samsung"; then
1248   lirc_driver="$driver"
1249   hw_module="hw_hiddev.o"
1250   HW_DEFAULT="hw_samsung"
1251   lircd_conf="samsung/lircd.conf.samsung"
1254 if test "$driver" = "sb0540"; then
1255   lirc_driver="$driver"
1256   hw_module="hw_hiddev.o"
1257   HW_DEFAULT="hw_sb0540"
1258 # original RM-1500 is included here
1259   lircd_conf="creative/lircd.conf.alsa_usb"
1262 if test "$driver" = "serial"; then
1263   lirc_driver="lirc_dev lirc_serial"
1266 if test "$driver" = "silitek"; then
1267   lirc_driver="none"
1268   hw_module="hw_silitek.o serial.o"
1269   HW_DEFAULT="hw_silitek"
1270   lircd_conf="silitek/lircd.conf.silitek"
1271   lircmd_conf="silitek/lircmd.conf.silitek"
1274 if test "$driver" = "sir"; then
1275   lirc_driver="lirc_dev lirc_sir"
1278 if test "$driver" = "sir_com3"; then
1279   lirc_driver="lirc_dev lirc_sir"
1280   port=0x3e8
1281   irq=4
1284 if test "$driver" = "slinke"; then
1285   echo
1286   echo "Please use lirc-0.6.5. The Slink-e is no longer supported."
1287   echo
1288   exit 1
1289   lirc_driver="none"
1290   hw_module="hw_slinke.o serial.o receive.o"
1291   HW_DEFAULT="hw_slinke"
1294 if test "$driver" = "streamzap"; then
1295   lirc_driver="lirc_dev lirc_streamzap"
1296   lircd_conf="streamzap/lircd.conf.streamzap"
1299 if test "$driver" = "tekram"; then
1300   lirc_driver="lirc_dev lirc_sir"
1301   AC_DEFINE(LIRC_SIR_TEKRAM)
1304 if test "$driver" = "tekram_bt829"; then
1305   lirc_driver="lirc_dev lirc_bt829"
1306   lircd_conf="tekram/lircd.conf.m230"
1307   lircmd_conf="tekram/lircmd.conf.m230"
1310 if test "$driver" = "tira"; then
1311   lirc_driver="none"
1312   hw_module="hw_tira.o serial.o"
1313   HW_DEFAULT="hw_tira"
1316 if test "$driver" = "ttusbir"; then
1317   lirc_driver="lirc_dev lirc_ttusbir"
1320 if test "$driver" = "tuxbox"; then
1321   lirc_driver="none"
1322   hw_module="hw_default.o receive.o transmit.o"
1323   HW_DEFAULT="hw_default"
1326 if test "$driver" = "tvbox"; then
1327   lirc_driver="lirc_dev lirc_i2c"
1328   lircd_conf="asus/lircd.conf.asus"
1331 if test "$driver" = "udp"; then
1332   lirc_driver="none"
1333   hw_module="hw_udp.o receive.o"
1334   HW_DEFAULT="hw_udp"
1337 if test "$driver" = "uirt2"; then
1338   lirc_driver="none"
1339   hw_module="hw_uirt2.o serial.o"
1340   HW_DEFAULT="hw_uirt2"
1342 if test "$driver" = "uirt2_raw"; then
1343   lirc_driver="none"
1344   hw_module="hw_uirt2_raw.o hw_uirt2_common.o serial.o receive.o transmit.o"
1345   HW_DEFAULT="hw_uirt2_raw"
1347 if test "$driver" = "usb_uirt_raw"; then
1348   lirc_driver="none"
1349   hw_module="hw_uirt2_raw.o hw_uirt2_common.o serial.o receive.o transmit.o"
1350   HW_DEFAULT="hw_usb_uirt_raw"
1352 if test "$driver" = "usbx"; then
1353   lirc_driver="none"
1354   hw_module="hw_usbx.o serial.o"
1355   HW_DEFAULT="hw_usbx"
1356   lircd_conf="adstech/lircd.conf.usbx-707"
1359 #END HARDWARE HEURISTIC
1361 if test "$driver" = "devinput"; then
1362   lircd_conf=""
1366 AC_DEFINE_UNQUOTED(HW_DEFAULT, ${HW_DEFAULT})
1368 dnl now check to see if the user is behaving himself
1370 if test "$lirc_driver" = "unset"; then
1371   AC_MSG_ERROR([no driver specified, try ./configure --help])
1374 if echo ${possible_drivers} | grep "($lirc_driver)" >/dev/null 2>&1; then
1375   dummy=
1376 else
1377   case $lirc_driver in
1378   irman*)
1379     AC_MSG_ERROR([*** you need to first install the libirman package
1380         (libirman-0.4.2 or better) before you can use this driver])
1381     ;;
1382   caraca*)
1383     AC_MSG_ERROR([*** you need to first install the caraca package
1384         before you can use this driver])
1385     ;;
1386   all|lirc_*)
1387     AC_MSG_ERROR([*** you need to have the Linux kernel source installed
1388         for this driver])
1389     ;;
1390   atilibusb)
1391     AC_MSG_ERROR([*** you need to have libusb installed for this driver.
1393 Get it at:
1395   http://libusb.sourceforge.net/
1397     ;;
1398   audio)
1399     AC_MSG_ERROR([*** you need to have the PortAudio library V18 installed
1400 to use the audio driver. You can get it at:
1401   http://www.inf.ethz.ch/~mringwal/downloads/portaudio_v18_with_configure.zip
1402 Extract the package and do a \"./configure && make && sudo make install\"
1403 in its directory.
1405     ;;
1406   audio_alsa)
1407     AC_MSG_ERROR([*** you need to have the ALSA headers and libraries
1408         for this driver])
1409     ;;
1410   alsa_usb)
1411     AC_MSG_ERROR([*** you need to have the ALSA libraries and drivers
1412         from at least version 1.0.9 for this driver])
1413     ;;
1414   commandir)
1415     AC_MSG_ERROR([*** you need to have libusb installed for this driver.
1417 Get it at:
1419   http://libusb.sourceforge.net/
1420   
1421 Or install these packages from your distro:
1423    libusb
1424    libusb-dev 
1427     ;;
1428   iguanaIR)
1429     AC_MSG_ERROR([*** you need to have the iguanaIR headers and
1430         libraries for this driver])
1431     ;;
1432   *)
1433     AC_MSG_ERROR([*** it is not possible to install the specified driver
1434         on this system])
1435     ;;
1436   esac
1439 dnl now we've checked, we can rename things for the drivers/Makefile
1441 if test "$lirc_driver" = "none" || \
1442         test "$lirc_driver" = "alsa_usb" || \
1443         test "$lirc_driver" = "asusdh" || \
1444         test "$lirc_driver" = "atilibusb" || \
1445         test "$lirc_driver" = "audio" || \
1446         test "$lirc_driver" = "audio_alsa" || \
1447         test "$lirc_driver" = "bw6130" || \
1448         test "$lirc_driver" = "caraca" || \
1449         test "$lirc_driver" = "commandir" || \
1450         test "$lirc_driver" = "dvico" || \
1451         test "$lirc_driver" = "iguanaIR" || \
1452         test "$lirc_driver" = "irman" || \
1453         test "$lirc_driver" = "irman_sw" || \
1454         test "$lirc_driver" = "macmini" || \
1455         test "$lirc_driver" = "samsung" || \
1456         test "$lirc_driver" = "sb0540" || \
1457         test "$lirc_driver" = "userspace"; then
1458   lirc_driver=
1459 elif test "$lirc_driver" = "all"; then
1460   lirc_driver="lirc_dev \
1461         lirc_atiusb \
1462         lirc_bt829 \
1463         lirc_cmdir \
1464         lirc_gpio \
1465         lirc_i2c \
1466         lirc_igorplugusb \
1467         lirc_imon \
1468         lirc_it87 \
1469         lirc_ite8709 \
1470         lirc_mceusb \
1471         lirc_mceusb2 \
1472         lirc_parallel \
1473         lirc_sasem \
1474         lirc_serial \
1475         lirc_sir \
1476         lirc_streamzap \
1477         lirc_ttusbir"
1479 if kernel_module=$(expr "$lirc_driver" : 'lirc_dev \(.*\)'); then
1480   :
1481 elif test "$lirc_driver" != ""; then
1482   kernel_module=$lirc_driver
1485 dnl slightly more advanced options
1487 dnl maintainer mode options
1489 maintmode_daemons_extra=
1490 AC_ARG_ENABLE(maintainer-mode,
1491 [  --enable-maintainer-mode    enable maintainer specific things],
1493 if test x${enableval} = xyes; then
1494 AC_DEFINE(MAINTAINER_MODE)
1495 maintmode_daemons_extra="lircd.simrec lircd.simsend slinke"
1499 dnl don't create nor destroy devices when installing and uninstalling
1501 AC_ARG_ENABLE(sandboxed,
1502 [  --enable-sandboxed      don't touch anything out of the install directory],
1503 [ enable_sandboxed="${enableval}" ],
1504 [ enable_sandboxed="no"])
1505 AM_CONDITIONAL(SANDBOXED, test x$enable_sandboxed = xyes)
1507 AC_ARG_WITH(devdir,
1508 [  --with-devdir=DIR       Install device files in DIR (/dev)],
1509 devdir=${withval},
1510 devdir=${devdir_default})
1512 default_moduledir=/lib/modules/`uname -r`/misc
1513 AC_ARG_WITH(moduledir,
1514 [  --with-moduledir=DIR    kernel modules in DIR (/lib/modules/`uname -r`/misc)], 
1515 moduledir=${withval},
1516 moduledir=${default_moduledir})
1518 AC_ARG_ENABLE(long-codes,
1519 [  --disable-long-codes    use this if your compiler won't do long long],
1520 test x${enableval} = xyes && AC_DEFINE(LONG_IR_CODE),
1521 AC_DEFINE(LONG_IR_CODE))
1523 AC_ARG_ENABLE(dyncodes,
1524 [  --enable-dyncodes       use dynamic codes],
1525 test x${enableval} = xyes && AC_DEFINE(DYNCODES))
1527 AC_ARG_WITH(major,
1528 [  --with-major=value      specify the device major for the driver (61)],
1529 lirc_major=${withval},
1530 lirc_major=61)
1532 AC_ARG_WITH(port,
1533 [  --with-port=port        specify the port number for the lirc device.],
1534 port=${withval}
1537 AC_ARG_WITH(irq,
1538 [  --with-irq=irq          specify the irq line for the lirc device.],
1539 irq=${withval}
1542 AC_ARG_WITH(timer,
1543 [  --with-timer=value      specify the timer value for the parallel driver],
1544 timer=${withval})
1546 dnl I dont think libirman  will accept this at the moment
1547 AC_ARG_WITH(tty,
1548 [  --with-tty=file         specify the tty to use (Irman, RemoteMaster, etc.)],
1549 irtty=${withval})
1551 AC_ARG_WITH(soft-carrier,
1552 [  --without-soft-carrier  use this if your serial hw generates carrier],
1553 test x${withval} = xyes && AC_DEFINE(LIRC_SERIAL_SOFTCARRIER),
1554 AC_DEFINE(LIRC_SERIAL_SOFTCARRIER))
1556 AC_ARG_WITH(transmitter,
1557 [  --with-transmitter      use this if you use a transmitter diode],
1558 test x${withval} = xyes && AC_DEFINE(LIRC_SERIAL_TRANSMITTER))
1560 AC_ARG_WITH(igor,
1561 [  --with-igor             use this if you have an Igor Cesko receiver],
1562 test x${withval} = xyes && AC_DEFINE(LIRC_SERIAL_IGOR))
1564 AC_ARG_ENABLE(debug,
1565 [  --enable-debug          enable debugging features],
1566 test x${enableval} = xyes && AC_DEFINE(DEBUG)
1569 AC_ARG_ENABLE(daemonize,
1570 [  --disable-daemonize     disable daemons from daemonizing],
1571 test x${enableval} = xyes && AC_DEFINE(DAEMONIZE),
1573 AC_CHECK_FUNCS(daemon)
1574 if test "$ac_cv_func_daemon" != yes; then
1575   daemon=""
1576   AC_CHECK_LIB(bsd,daemon,daemon="-lbsd")
1577   if test "$daemon" = ""; then
1578     AC_MSG_ERROR([*** daemon() function not available on this system and --disable-daemonize not specified])
1579   fi
1581 AC_DEFINE(DAEMONIZE)
1584 AC_ARG_WITH(syslog,
1585 [  --with-syslog=facility  use syslog instead of logfile],
1586 if test -n "${withval}"; then
1587   facility="${withval}"
1588   if test "${withval}" = yes; then
1589     facility=LOG_DAEMON;
1590   elif test "${withval}" = LOG_AUTH; then
1591     true;
1592   elif test "${withval}" = LOG_AUTHPRIV; then
1593     true;
1594   elif test "${withval}" = LOG_DAEMON; then
1595     true;
1596   elif test "${withval}" = LOG_LOCAL0; then
1597     true;
1598   elif test "${withval}" = LOG_LOCAL1; then
1599     true;
1600   elif test "${withval}" = LOG_LOCAL2; then
1601     true;
1602   elif test "${withval}" = LOG_LOCAL3; then
1603     true;
1604   elif test "${withval}" = LOG_LOCAL4; then
1605     true;
1606   elif test "${withval}" = LOG_LOCAL5; then
1607     true;
1608   elif test "${withval}" = LOG_LOCAL6; then
1609     true;
1610   elif test "${withval}" = LOG_LOCAL7; then
1611     true;
1612   elif test "${withval}" = LOG_USER; then
1613     true;
1614   else
1615     AC_MSG_ERROR([*** invalid facility (see syslog(3) for possible facilities) ])
1616   fi
1617   AC_DEFINE(USE_SYSLOG)
1621 dnl if --prefix is not specified, then $prefix is still set to NONE by
1622 dnl configure.  That's bad here where we want to expand it!
1623 cur_prefix=$prefix
1624 test "x${prefix}" = "xNONE" && prefix=$ac_default_prefix 
1625 test "${sysconfdir}" = "\${prefix}/etc" && sysconfdir=/etc
1626 test "${localstatedir}" = "\${prefix}/var" && localstatedir=/var
1627 sysconfdir_exp=`eval "echo ${sysconfdir}"`
1628 localstatedir_exp=`eval "echo ${localstatedir}"`
1629 prefix=$cur_prefix
1631 receive=""
1632 if ! echo ${hw_module}|grep " receive.o" >/dev/null; then
1633         receive="receive.o"
1636 hw_module_libs="${alsa_lib} ${atilibusb_lib} ${caraca_lib} ${commandir_lib} ${iguanaIR_lib} ${irman_lib} ${portaudio_lib}"
1638 dnl tell the Makefiles what we decided
1639 AC_SUBST(daemon)
1640 AC_SUBST(forkpty)
1641 AC_SUBST(devdir)
1642 AC_SUBST(sysconfdir)
1643 AC_SUBST(moduledir)
1644 AC_SUBST(lirc_major)
1645 AC_SUBST(driver)
1646 AC_SUBST(lirc_driver)
1647 AC_SUBST(hw_module_libs)
1648 AC_SUBST(vga_progs) 
1649 AC_SUBST(x_progs)
1650 AC_SUBST(hw_module)
1651 AC_SUBST(receive)
1652 AC_SUBST(irtty)
1653 AC_SUBST(lircd_conf)
1654 AC_SUBST(lircmd_conf)
1655 AC_SUBST(maintmode_daemons_extra)
1657 if test "$lirc_driver" = "lirc_dev commandir lirc_cmdir"; then
1658   lirc_driver="lirc_dev lirc_cmdir"
1661 dnl tell the C code what we decided
1662 AC_DEFINE_UNQUOTED(DEVDIR, "$devdir")
1663 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir_exp")
1664 AC_DEFINE_UNQUOTED(LOCALSTATEDIR, "$localstatedir_exp")
1665 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
1666 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
1668 AC_DEFINE_UNQUOTED(LIRC_DRIVER, "$driver")
1669 AC_DEFINE_UNQUOTED(LIRC_MAJOR, $lirc_major)
1670 if test "$port" != ""; then
1671   AC_DEFINE_UNQUOTED(LIRC_PORT, $port)
1673 if test "$irq" != ""; then
1674   AC_DEFINE_UNQUOTED(LIRC_IRQ, $irq)
1676 if test "$timer" != ""; then
1677   AC_DEFINE_UNQUOTED(LIRC_TIMER, $timer)
1679 AC_DEFINE_UNQUOTED(LIRC_IRTTY, "$irtty")
1680 AC_DEFINE_UNQUOTED(LIRC_SYSLOG, $facility)
1682 AH_TOP([
1683 /* device file names - beneath DEVDIR (default /dev) */
1684 #define DEV_LIRC        "lirc"
1685 #define DEV_LIRCD       "lircd"
1686 #define DEV_LIRCM       "lircm"
1688 /* config file names - beneath SYSCONFDIR (default /etc) */
1689 #define CFG_LIRCD       "lircd.conf"
1690 #define CFG_LIRCM       "lircmd.conf"
1692 /* config file names - beneath $HOME or SYSCONFDIR */
1693 #define CFG_LIRCRC      "lircrc"
1695 /* log files */
1696 #define LOG_LIRCD       "lircd"
1697 #define LOG_LIRMAND     "lirmand"
1699 /* pid file */
1700 #define PID_LIRCD       "lircd.pid"
1702 /* default port number */
1703 #define LIRC_INET_PORT  8765
1706 AH_BOTTOM([
1707 #ifdef LIRC_HAVE_DEVFS
1708 #define LIRC_DRIVER_DEVICE      DEVDIR "/" DEV_LIRC "/0"
1709 #else
1710 #define LIRC_DRIVER_DEVICE      DEVDIR "/" DEV_LIRC
1711 #endif /* LIRC_HAVE_DEVFS */
1713 #define LIRC_IRTTY              DEVDIR "/" "ttyS0"
1715 #define LIRCD                   DEVDIR "/" DEV_LIRCD
1716 #define LIRCM                   DEVDIR "/" DEV_LIRCM
1718 #define LIRCDCFGFILE            SYSCONFDIR "/" CFG_LIRCD
1719 #define LIRCMDCFGFILE           SYSCONFDIR "/" CFG_LIRCM
1721 #define LIRCRC_USER_FILE        "." CFG_LIRCRC
1722 #define LIRCRC_ROOT_FILE        SYSCONFDIR "/" CFG_LIRCRC
1724 #define LOGFILE                 LOCALSTATEDIR "/log/" LOG_LIRCD
1725 #define LIRMAND_LOGFILE         LOCALSTATEDIR "/log/" LOG_LIRMAND
1727 #define PIDFILE                 LOCALSTATEDIR "/run/" PID_LIRCD
1729 #define LIRC_RELEASE_SUFFIX     "_UP"
1732 dnl bug in automake/autoconf?
1733 dnl SHELL=/bin/sh AC_SUBST(SHELL)
1735 dnl write these decisions out to the Makefiles
1736 AC_CONFIG_FILES([
1737   Makefile
1738   drivers/Makefile
1739   drivers/lirc_atiusb/Makefile
1740   drivers/lirc_bt829/Makefile
1741   drivers/lirc_cmdir/Makefile
1742   drivers/lirc_dev/Makefile
1743   drivers/lirc_gpio/Makefile
1744   drivers/lirc_i2c/Makefile
1745   drivers/lirc_igorplugusb/Makefile
1746   drivers/lirc_ttusbir/Makefile
1747   drivers/lirc_imon/Makefile
1748   drivers/lirc_it87/Makefile
1749   drivers/lirc_ite8709/Makefile
1750   drivers/lirc_mceusb/Makefile
1751   drivers/lirc_mceusb2/Makefile
1752   drivers/lirc_parallel/Makefile
1753   drivers/lirc_sasem/Makefile
1754   drivers/lirc_serial/Makefile
1755   drivers/lirc_sir/Makefile
1756   drivers/lirc_streamzap/Makefile
1757   daemons/Makefile
1758   tools/Makefile
1759   doc/Makefile
1760   doc/man/Makefile
1762 AC_OUTPUT
1764 echo
1765 if test "$driver" = "all"; then
1766   echo "All kernel modules will be built."
1767 elif test "$driver" = "mediafocusI"; then
1768   echo "You will have to use the MediaFocus driver from:"
1769   echo "http://freenet-homepage.de/mediafocus/"
1770 elif test "$driver" = "exaudio"; then
1771   echo "You will have to use the Exaudio driver from:"
1772   echo "http://exaudio.sourceforge.net/"
1773 elif test "$driver" = "alsa_usb"; then
1774   echo "You will have to use the snd-usb-audio driver from:"
1775   echo "http://www.alsa-project.org/"
1776 elif test "$driver" = "hauppauge_dvb"; then
1777   echo "You will have to use the DVB driver from:"
1778   echo "http://www.linuxtv.org"
1779 elif test "$kernel_module" = ""; then
1780   echo "Your hardware does not require a special LIRC kernel module."
1781   if test "${irtty}" != ""; then
1782     echo
1783     echo "You will have to use the suitable kernel driver to access ${irtty}."
1784   fi
1785 else
1786   echo "You will have to use the $kernel_module kernel module."
1788 echo
1789 echo "Now enter 'make' and 'make install' to compile and install the package."
1790 echo