5 #############################################################################
25 DRIVER_PARAMETER
="com1"
38 #############################################################################
40 BACKTITLE
="LIRC $LIRC_VERSION Configuration"
42 CONFIG
=".setup.config"
46 MAIN_MENU_TEXT
="Welcome to the LIRC Configuration Menu. Here you"
47 MAIN_MENU_TEXT
="$MAIN_MENU_TEXT can configure the driver and some compile-time"
48 MAIN_MENU_TEXT
="$MAIN_MENU_TEXT settings for LIRC applications."
49 CONFIG_DRIVER_TEXT
="Please select a driver, that supports your hardware."
50 CONFIG_SOFTWARE_TEXT
="Here you can change some compile-time settings for LIRC applications"
51 SET_PORT_TEXT
="Either choose a predefined I/O base address/IRQ combination, or enter costum values"
52 SET_PORT_TEXT
="$SET_PORT_TEXT Hint: use <Space> to choose and <Enter> to proceed"
53 SET_TTY_TEXT
="Choose the tty where your hardware is available."
54 GET_PORT_TEXT
="Enter the I/O base address followed with a space and the IRQ (none for no IRQ)"
56 #############################################################################
60 COM1
="off"; COM2
="off"; COM3
="off"; COM4
="off"
61 LPT1
="off"; LPT2
="off"; LPT3
="off"; USER
="off"
64 if test "$DRIVER_PARAMETER" = "btty"; then IRTTY
="/dev/rfcomm0"; LIRC_PORT
="none"; LIRC_IRQ
="none"
65 elif test "$DRIVER_PARAMETER" = "ttyUSB1"; then COM1
="on"; IRTTY
="/dev/ttyUSB0"; LIRC_PORT
="none"; LIRC_IRQ
="none"
66 elif test "$DRIVER_PARAMETER" = "ttyUSB2"; then COM2
="on"; IRTTY
="/dev/ttyUSB1"; LIRC_PORT
="none"; LIRC_IRQ
="none"
67 elif test "$DRIVER_PARAMETER" = "ttyUSB3"; then COM3
="on"; IRTTY
="/dev/ttyUSB2"; LIRC_PORT
="none"; LIRC_IRQ
="none"
68 elif test "$DRIVER_PARAMETER" = "ttyUSB4"; then COM4
="on"; IRTTY
="/dev/ttyUSB3"; LIRC_PORT
="none"; LIRC_IRQ
="none"
69 elif test "$DRIVER_PARAMETER" = "com1"; then COM1
="on"; LIRC_PORT
=$COM1_PORT; LIRC_IRQ
=$COM1_IRQ
70 elif test "$DRIVER_PARAMETER" = "com2"; then COM2
="on"; LIRC_PORT
=$COM2_PORT; LIRC_IRQ
=$COM2_IRQ
71 elif test "$DRIVER_PARAMETER" = "com3"; then COM3
="on"; LIRC_PORT
=$COM3_PORT; LIRC_IRQ
=$COM3_IRQ
72 elif test "$DRIVER_PARAMETER" = "com4"; then COM4
="on"; LIRC_PORT
=$COM4_PORT; LIRC_IRQ
=$COM4_IRQ
73 elif test "$DRIVER_PARAMETER" = "tty1"; then COM1
="on"; IRTTY
="/dev/ttyS0"; LIRC_PORT
="none"; LIRC_IRQ
="none"
74 elif test "$DRIVER_PARAMETER" = "tty2"; then COM2
="on"; IRTTY
="/dev/ttyS1"; LIRC_PORT
="none"; LIRC_IRQ
="none"
75 elif test "$DRIVER_PARAMETER" = "tty3"; then COM3
="on"; IRTTY
="/dev/ttyS2"; LIRC_PORT
="none"; LIRC_IRQ
="none"
76 elif test "$DRIVER_PARAMETER" = "tty4"; then COM4
="on"; IRTTY
="/dev/ttyS3"; LIRC_PORT
="none"; LIRC_IRQ
="none"
77 elif test "$DRIVER_PARAMETER" = "lpt1"; then LPT1
="on"; LIRC_PORT
=$LPT1_PORT; LIRC_IRQ
=$LPT1_IRQ
78 elif test "$DRIVER_PARAMETER" = "lpt2"; then LPT2
="on"; LIRC_PORT
=$LPT2_PORT; LIRC_IRQ
=$LPT2_IRQ
79 elif test "$DRIVER_PARAMETER" = "lpt3"; then LPT3
="on"; LIRC_PORT
=$LPT3_PORT; LIRC_IRQ
=$LPT3_IRQ
80 elif test "$DRIVER_PARAMETER" = "none"; then LIRC_PORT
="none"; LIRC_IRQ
="none"
81 elif test "$DRIVER_PARAMETER" = "void"; then LIRC_PORT
="";LIRC_IRQ
=""
82 elif test "$DRIVER_PARAMETER" = "user"; then USER
="on"
85 SELECTED_DRIVER
="driver:$LIRC_DRIVER"
86 if test "$LIRC_PORT" != "none" -a "$LIRC_PORT" != ""; then SELECTED_DRIVER
="$SELECTED_DRIVER io:$LIRC_PORT"; fi
87 if test "$LIRC_IRQ" != "none" -a "$LIRC_IRQ" != ""; then SELECTED_DRIVER
="$SELECTED_DRIVER irq:$LIRC_IRQ"; fi
88 if test "$IRTTY" != "none" -a "$IRTTY" != ""; then SELECTED_DRIVER
="$SELECTED_DRIVER tty:$IRTTY"; fi
95 dialog
--clear --backtitle "$BACKTITLE" \
96 --title "Enter I/O base address and IRQ" \
97 --inputbox "$GET_PORT_TEXT" 9 74 "$LIRC_PORT $LIRC_IRQ" \
99 if test "$?" = "0"; then
113 if test "$DRIVER_PARAM_TYPE" = "com"; then
115 dialog
--clear --backtitle "$BACKTITLE" \
116 --title "Specify I/O base address and IRQ of your hardware" \
117 --radiolist "$SET_PORT_TEXT" 14 74 5 \
118 1 "COM1 ($COM1_PORT, $COM1_IRQ)" $COM1 \
119 2 "COM2 ($COM2_PORT, $COM2_IRQ)" $COM2 \
120 3 "COM3 ($COM3_PORT, $COM3_IRQ)" $COM3 \
121 4 "COM4 ($COM4_PORT, $COM4_IRQ)" $COM4 \
122 9 "Other (custom values)" $USER \
124 if test "$?" = "0"; then
127 if test "$1" = "1"; then DRIVER_PARAMETER
="com1"
128 elif test "$1" = "2"; then DRIVER_PARAMETER
="com2"
129 elif test "$1" = "3"; then DRIVER_PARAMETER
="com3"
130 elif test "$1" = "4"; then DRIVER_PARAMETER
="com4"
131 elif test "$1" = "9"; then DRIVER_PARAMETER
="user"; GetPortAndIrq
139 elif test "$DRIVER_PARAM_TYPE" = "lpt"; then
141 dialog
--clear --backtitle "$BACKTITLE" \
142 --title "Specify I/O base address and IRQ of your hardware" \
143 --radiolist "$SET_PORT_TEXT" 13 74 4 \
144 1 "LPT1 ($LPT1_PORT, $LPT1_IRQ)" $LPT1 \
145 2 "LPT2 ($LPT2_PORT, $LPT2_IRQ)" $LPT2 \
146 3 "LPT3 ($LPT3_PORT, $LPT3_IRQ)" $LPT3 \
147 9 "Other (custom values)" $USER \
149 if test "$?" = "0"; then
152 if test "$1" = "1"; then DRIVER_PARAMETER
="lpt1"
153 elif test "$1" = "2"; then DRIVER_PARAMETER
="lpt2"
154 elif test "$1" = "3"; then DRIVER_PARAMETER
="lpt3"
155 elif test "$1" = "9"; then DRIVER_PARAMETER
="user"; GetPortAndIrq
163 elif test "$DRIVER_PARAM_TYPE" = "tty"; then
165 dialog
--clear --backtitle "$BACKTITLE" \
166 --title "Select tty to use" \
167 --radiolist "$SET_TTY_TEXT" 13 74 6 \
168 1 "COM1 (/dev/ttyS0)" $COM1 \
169 2 "COM2 (/dev/ttyS1)" $COM2 \
170 3 "COM3 (/dev/ttyS2)" $COM3 \
171 4 "COM4 (/dev/ttyS3)" $COM4 \
174 if test "$?" = "0"; then
177 if test "$1" = "1"; then DRIVER_PARAMETER
="tty1"
178 elif test "$1" = "2"; then DRIVER_PARAMETER
="tty2"
179 elif test "$1" = "3"; then DRIVER_PARAMETER
="tty3"
180 elif test "$1" = "4"; then DRIVER_PARAMETER
="tty4"
187 elif test "$DRIVER_PARAM_TYPE" = "ttyUSB"; then
189 dialog
--clear --backtitle "$BACKTITLE" \
190 --title "Select tty to use" \
191 --radiolist "$SET_TTY_TEXT" 13 74 6 \
192 1 "/dev/ttyUSB0" $COM1 \
193 2 "/dev/ttyUSB1" $COM2 \
194 3 "/dev/ttyUSB2" $COM3 \
195 4 "/dev/ttyUSB3" $COM4 \
198 if test "$?" = "0"; then
201 if test "$1" = "1"; then DRIVER_PARAMETER
="ttyUSB1"
202 elif test "$1" = "2"; then DRIVER_PARAMETER
="ttyUSB2"
203 elif test "$1" = "3"; then DRIVER_PARAMETER
="ttyUSB3"
204 elif test "$1" = "4"; then DRIVER_PARAMETER
="ttyUSB4"
219 if test "$LIRC_DRIVER" = "serial"; then
221 dialog
--clear --backtitle "$BACKTITLE" \
222 --title "Driver specific Options" \
223 --checklist "" 10 74 3 \
224 1 "With transmitter diode" $TRANSMITTER \
225 2 "Software generated carrier" $SOFT_CARRIER \
226 3 "Igor Cesko's variation" $IGOR \
228 if test "$?" = "0"; then
236 if test $ITEM = "1" ||
test $ITEM = "\"1\""; then TRANSMITTER
="on";
237 elif test $ITEM = "2" ||
test $ITEM = "\"2\""; then SOFT_CARRIER
="on";
238 elif test $ITEM = "3" ||
test $ITEM = "\"3\""; then IGOR
="on";
242 # if test "$TRANSMITTER" = "off"; then SOFT_CARRIER="off"; fi
248 elif test "$LIRC_DRIVER" = "parallel"; then
250 dialog
--clear --backtitle "$BACKTITLE" \
251 --title "Driver specific Options" \
252 --inputbox "Timer value for parallel port driver" 9 74 "$TIMER" \
254 if test "$?" = "0"; then
270 if test "$?" = "0"; then
273 if test "$?" = "0"; then
283 dialog
--clear --backtitle "$BACKTITLE" \
284 --title "Software Configuration" \
285 --checklist "$CONFIG_SOFTWARE_TEXT" 14 74 6 \
286 1 "Compile tools for X-Windows" $X11_WINDOWS \
287 2 "Compile with DEBUG code" $DEBUG \
288 3 "Disable daemonize" $NO_DAEMONIZE \
289 4 "Disable long codes" $NO_LONG_CODES \
290 5 "Use syslogd instead of own log-file" $USE_SYSLOG \
291 6 "Enable dynamic codes" $DYNCODES 2>$TEMP
293 if test "$?" = "0"; then
296 X11_WINDOWS
="off"; DEBUG
="off"; NO_DAEMONIZE
="off"; NO_LONG_CODES
="off"
297 USE_SYSLOG
="off"; DYNCODES
="off"
300 if test $ITEM = "1" ||
test $ITEM = "\"1\""; then X11_WINDOWS
="on"
301 elif test $ITEM = "2" ||
test $ITEM = "\"2\""; then DEBUG
="on"
302 elif test $ITEM = "3" ||
test $ITEM = "\"3\""; then NO_DAEMONIZE
="on"
303 elif test $ITEM = "4" ||
test $ITEM = "\"4\""; then NO_LONG_CODES
="on"
304 elif test $ITEM = "5" ||
test $ITEM = "\"5\""; then USE_SYSLOG
="on"
305 elif test $ITEM = "6" ||
test $ITEM = "\"6\""; then DYNCODES
="on"
317 echo "LIRC_DRIVER=$LIRC_DRIVER" >$CONFIG
318 echo "LIRC_PORT=$LIRC_PORT" >>$CONFIG
319 echo "LIRC_IRQ=$LIRC_IRQ" >>$CONFIG
320 echo "LIRC_MAJOR=$LIRC_MAJOR" >>$CONFIG
321 echo "IRTTY=$IRTTY" >>$CONFIG
322 echo "DRIVER_PARAM_TYPE=$DRIVER_PARAM_TYPE" >>$CONFIG
323 echo "DRIVER_PARAMETER=$DRIVER_PARAMETER" >>$CONFIG
324 echo "SOFT_CARRIER=$SOFT_CARRIER" >>$CONFIG
325 echo "TRANSMITTER=$TRANSMITTER" >>$CONFIG
326 echo "IGOR=$IGOR" >>$CONFIG
327 echo "TIMER=$TIMER" >>$CONFIG
328 echo "X11_WINDOWS=$X11_WINDOWS" >>$CONFIG
329 echo "DEBUG=$DEBUG" >>$CONFIG
330 echo "NO_DAEMONIZE=$NO_DAEMONIZE" >>$CONFIG
331 echo "NO_LONG_CODES=$NO_LONG_CODES" >>$CONFIG
332 echo "USE_SYSLOG=$USE_SYSLOG" >>$CONFIG
333 echo "DYNCODES=$DYNCODES" >>$CONFIG
336 echo '#! /bin/sh' >$START
338 echo "./configure \\" >>$START
339 echo "--with-moduledir=/lib/modules/`uname -r`/misc \\" >>$START
340 if test "$LIRC_DRIVER" = "serial"; then
342 if test "$SOFT_CARRIER" = "off"; then echo "--without-soft-carrier \\" >>$START; fi
343 if test "$TRANSMITTER" = "on"; then echo "--with-transmitter \\" >>$START; fi
344 if test "$IGOR" = "on"; then echo "--with-igor \\" >>$START; fi
346 elif test "$LIRC_DRIVER" = "parallel"; then
348 if test "$TIMER" != "0"; then echo "--with-timer=$TIMER \\" >>$START;
349 else echo "--without-timer \\" >>$START;
352 elif test "$DRIVER_PARAM_TYPE" = "tty" -o "$DRIVER_PARAM_TYPE" = "ttyUSB" -o "$LIRC_DRIVER" = "bte"; then
354 echo "--with-tty=$IRTTY \\" >>$START
357 if test "$X11_WINDOWS" = "on"; then echo "--with-x \\" >>$START; else echo "--without-x \\" >>$START; fi
358 if test "$DEBUG" = "on"; then echo "--enable-debug \\" >>$START; fi
359 if test "$NO_DAEMONIZE" = "on"; then echo "--disable-daemonize \\" >>$START; fi
360 if test "$NO_LONG_CODES" = "on"; then echo "--disable-long-codes \\" >>$START; fi
361 if test "$USE_SYSLOG" = "on"; then echo "--with-syslog \\" >>$START; fi
362 if test "$DYNCODES" = "on"; then echo "--enable-dyncodes \\" >>$START; fi
363 echo "--with-driver=$LIRC_DRIVER \\" >>$START
364 echo "--with-major=$LIRC_MAJOR \\" >>$START
365 echo "--with-port=$LIRC_PORT \\" >>$START
366 echo "--with-irq=$LIRC_IRQ \\" >>$START
367 echo "\"\$@\"" >>$START
370 MESSAGE
="Configuration: $CONFIG, executable shell script: $START"
374 #############################################################################
376 if ! which dialog
>/dev
/null
; then
377 echo "dialog not found!"
381 if test -f $CONFIG; then
383 echo "Loading saved configuration from $CONFIG"
392 MESSAGE
="Abnormal Termination"
394 while test "$EXIT" != "yes"; do
396 dialog
--clear --backtitle "$BACKTITLE" \
398 --menu "$MAIN_MENU_TEXT" 13 74 5 \
399 1 "Driver configuration ($SELECTED_DRIVER)" \
400 2 "Software configuration" \
401 3 "Save configuration & run configure" \
402 4 "Save configuration & exit" \
403 5 "Exit WITHOUT doing anything" 2>$TEMP
405 if test "$?" != "0"; then
407 MESSAGE
="Configuration cancelled!"
413 if test "$1" = "1"; then ConfigDriver
414 elif test "$1" = "2"; then ConfigSoftware
415 elif test "$1" = "3"; then
420 elif test "$1" = "4"; then SaveConfig
421 elif test "$1" = "5"; then
423 MESSAGE
="Configuration NOT saved!"
433 echo "setup.sh written by Karsten Scheibler, 1999-JUN-28"
435 echo "If you have problems or questions please consult the mailing list"
436 echo "<http://lists.sourceforge.net/mailman/listinfo/lirc-list>"
439 if test "$CONFIGURE" = "yes"; then
441 echo "Starting the generated shell script which will call configure with the right"
446 ## EOF ######################################################################