3 # Kscd - A simple cd player for the KDE Project
7 # Copyright (c) 1997 Bernd Johannes Wuebben math.cornell.edu
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 # the following is borrowed from configure
25 if (echo "testing\c"; echo 1,2,3) |
grep c
>/dev
/null
; then
26 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
27 if (echo -n testing
; echo 1,2,3) |
sed s
/-n/xn
/ |
grep xn
>/dev
/null
; then
37 config_file
="config.h"
38 ORG_CONFIG
="config.h.std"
44 echo " KSCD -- Configuration"
45 echo "==================================================================="
47 echo " Linux ...................... L"
48 echo " FreeBSD/NetBSD ............. F"
49 echo " BSD386 ..................... B"
50 echo " Sun ........................ S"
51 echo " HPUX ....................... H"
52 echo " Irix ....................... I"
53 echo " Sony NEWS .................. N"
54 echo " OSF/1 ...................... O"
55 echo " Ultrix ..................... U"
56 echo " Generic SVR4 (not Sun) ..... V"
58 echo " Quit ....................... Q"
61 echo " Bernd Johannes Wuebben <wuebben@kde.org>"
62 echo "=================================================================="
64 echo $ac_n " Please chose acccording to your platform:$ac_c"
72 echo "Please answer all questions. Simply hit [Enter] to select the default"
73 echo "values which are displayed in square brackets."
78 write_config_header
(){
80 echo "" >> $config_file
81 echo "/* This header file was automatically generated by the kscd" >> $config_file
82 echo " installation script. In case of trouble please edit" >> $config_file
83 echo " $ORG_CONFIG in the source directory of the kscd distribution" >> $config_file
84 echo " and rename it to $config_file .*/" >> $config_file
85 echo "" >> $config_file
92 echo "KSCD configuration for Linux systems"
93 echo "------------------------------------"
99 echo "#ifdef linux " >> $config_file
100 echo "" >> $config_file
102 echo $ac_n "Please specify your cdrom device [/dev/cdrom]:$ac_c"
105 if [ "$device" = "" ]
110 echo "Your choice was: $device"
111 echo "#define DEFAULT_CD_DEVICE \"$device\" " >> $config_file
116 echo "I have made modifications to the workman engine which cause kscd to be"
117 echo "a very fast and responsive cd player for an average IDE CDROM drive."
118 echo "Answer NO to the next question unless you have problems getting kscd"
121 echo $ac_n "Revert to original Workman behavior? (y/n) [n]:$ac_c"
126 "yes" |
"y" |
"Yes" |
"Y") echo "#define WORKMAN_ORIGINAL " >> $config_file ;;
131 echo "I have incorporated modifications from Dirk (milliByte@DeathsDoor.com)"
132 echo "which will make kscd perform better on any drive using the sbpcd or"
133 echo "mcdx drivers. If and only if your kernel uses one of these cd drivers you"
134 echo "should try answering YES to the next question. Please peruse the "
135 echo "documents in the spbcd directory of this distribution for more "
136 echo "information about theses modifications."
138 echo $ac_n "Enable SBPCD_HACK? (y/n) [n]:$ac_c"
143 "yes" |
"y" |
"Yes" |
"Y") echo "#define SBPCD_HACK " >> $config_file ;;
148 echo "If and only if you have an SCSI cdrom drive you should probably"
149 echo "answer YES to the next question"
151 echo $ac_n "Enable LINUX_SCSI_PASSTHROUGH? (y/n) [n]:$ac_c"
156 "yes" |
"y" |
"Yes" |
"Y") echo "#define LINUX_SCSI_PASSTHROUGH " >> $config_file ;;
160 echo "Most cdrom devices have a volume range from 0 to 255."
161 echo "Feel free to play with the parameters MINVOLUME and MAXVOLUME"
162 echo "until volume adjustment works to your satisfaction."
163 echo "Note: Some CDROM device only support a range from 128 to 255."
165 echo $ac_n "MIN_VOLUME [0]:$ac_c"
168 if [ "$MINVOLUME" = "" ]
173 echo "You entered $MINVOLUME "
174 echo "#define MIN_VOLUME $MINVOLUME " >> $config_file
177 echo $ac_n "MAX_VOLUME [255]:$ac_c"
180 if [ "$MAXVOLUME" = "" ]
185 echo "You entered $MAXVOLUME "
186 echo "#define MAX_VOLUME $MAXVOLUME " >> $config_file
189 echo "If you own one a cdrom player whose volume range is 128 to 255,"
190 echo "you might want to try answering YES to the next question."
191 echo "Enabling 'Curved Volume' will give you a square root like"
192 echo "volume slider - volume curve."
194 echo $ac_n "Enable CURVED_VOLUME? (y/n) [n]:$ac_c"
199 "yes" |
"y" |
"Yes" |
"Y") echo "#define CURVED_VOLUME " >> $config_file ;;
202 echo "" >> $config_file
203 echo "#endif /* linux */" >> $config_file
210 echo "KSCD configuration for Irix"
211 echo "---------------------------"
217 echo "" >> $config_file
218 echo "#if defined(sgi)" >> $config_file
219 echo "" >> $config_file
221 echo $ac_n "Please specify your cdrom device [/dev/scsi/sc0d6l0]:$ac_c"
224 if [ "$device" = "" ]
226 device
="/dev/scsi/sc0d6l0"
229 echo "Your choice was: $device"
230 echo "#define DEFAULT_CD_DEVICE \"$device\" " >> $config_file
232 echo $ac_n "Enable CDDA? (y/n) [y]:$ac_c"
237 "yes" |
"y" |
"Yes" |
"Y" |
"") echo "#define CDDA " >> $config_file ;;
240 echo "That's all for sgi ..."
242 echo "#endif /* sgi */" >> $config_file
249 echo "KSCD configuration for HPUX systems"
250 echo "-----------------------------------"
256 echo "" >> $config_file
257 echo "#if defined(hpux) || defined (__hpux)" >> $config_file
258 echo "" >> $config_file
260 echo $ac_n "Please specify your cdrom device [/dev/rscsi]:$ac_c"
263 if [ "$device" = "" ]
268 echo "Your choice was: $device"
269 echo "#define DEFAULT_CD_DEVICE \"$device\" " >> $config_file
271 echo "That's all for HPUX ..."
273 echo "#endif /* hpux */" >> $config_file
281 echo "KSCD configuration for BSD386 systems"
282 echo "-------------------------------------"
288 echo "#ifdef __bsdi__ " >> $config_file
291 echo "Please answer YES to the next question if you have a Sound Blaster cdrom."
293 echo $ac_n "Define SOUNDBALSTER? (y/n) [n]:$ac_c"
297 case "$soundblaster" in
298 "yes" |
"y" |
"Yes" |
"Y") echo "#define SOUNDBLASTER " >> $config_file ;;
301 echo "#endif /* __bsdi__ */" >> $config_file
305 freebsd_netbsd_conf
(){
308 echo "KSCD configuration for FreeBSD/NetBSD systems"
309 echo "---------------------------------------------"
315 echo "" >> $config_file
316 echo "#if defined(__FreeBSD__) || defined(__NetBSD__)" >> $config_file
317 echo "" >> $config_file
320 if [ `/usr/bin/uname -s` = "NetBSD" ]; then
321 if [ `/usr/bin/uname -m` = "i386" ]; then
322 def_device
=/dev
/rcd0d
324 def_device
=/dev
/rcd0c
328 def_device
=/dev
/acd0c
331 echo $ac_n "Please specify your cdrom device [$def_device]:$ac_c"
334 if [ "$device" = "" ]
339 echo "Your choice was:$device"
340 echo "#define DEFAULT_CD_DEVICE \"$device\" " >> $config_file
343 echo "Some experimental changes to the FreeBSD code were made."
344 echo "Please let me know whether answering yes or no to the next"
345 echo "question will give you a better functioning cd player."
346 echo "Users of NetBSD might want to experiment with this too."
348 echo $ac_n "Define NEW_BSD_PLAYCLICKED? (y/n) [y]:$ac_c"
350 read free_play_clicked
352 case "$free_play_clicked" in
353 "yes" |
"y" |
"Yes" |
"Y"|
"") echo "#define NEW_BSD_PLAYCLICKED" >> $config_file ;;
356 echo "" >> $config_file
357 echo "#endif /* FreeBSD/NetBSD */" >> $config_file
364 echo "KSCD configuration for Sun systems"
365 echo "----------------------------------"
371 echo "" >> $config_file
372 echo "#if defined(sun) || defined(__sun__) " >> $config_file
373 echo "" >> $config_file
375 echo $ac_n "Are you compiling on Solaris 2.x? (y/n) [y]:$ac_c"
384 echo "#define SYSV" >> $config_file
390 echo "You need to enable the internal audio device if you wish"
391 echo "to get sound from your workstation, as opposed to only from"
392 echo "the head-phone jack of your CDROM."
394 echo $ac_n "Activate internal audio device (CODEC)? (y/n) [y]:$ac_c"
403 echo "#define CODEC" >> $config_file
407 if [ "$solaris" = "y" ]
410 echo "Do you wish to enable digital audio capablilites on drives that"
411 echo $ac_n "support it? (y/n) [y]:$ac_c"
419 echo "#define BUILD_CDDA" >> $config_file
426 echo "Most cdrom devices have a volume range from 0 to 255."
427 echo "Feel free to play with the parameters MINVOLUME and MAXVOLUME"
428 echo "until volume adjustment works to your satisfaction."
429 echo "Note: Some CDROM device only support a range from 128 to 255."
431 echo $ac_n "MIN_VOLUME [128]:$ac_c"
434 if [ "$MINVOLUME" = "" ]
439 echo "You entered $MINVOLUME "
440 echo "#define MIN_VOLUME $MINVOLUME " >> $config_file
443 echo $ac_n "MAX_VOLUME [255]:$ac_c"
446 if [ "$MAXVOLUME" = "" ]
451 echo "You entered $MAXVOLUME "
452 echo "#define MAX_VOLUME $MAXVOLUME " >> $config_file
455 echo "If you own one a cdrom player whose volume range is 128 to 255,"
456 echo "you might want to try answering YES to the next question."
457 echo "Enabling 'Curved Volume' will give you a square root like"
458 echo "volume slider - volume curve."
460 echo $ac_n "Enable CURVED_VOLUME? (y/n) [n]:$ac_c"
465 "yes" |
"y" |
"Yes" |
"Y") echo "#define CURVED_VOLUME " >> $config_file ;;
468 echo "#endif /* Sun*/" >> $config_file
475 echo "KSCD configuration for Sony NEWS systems"
476 echo "---------------------------------------------"
482 echo "" >> $config_file
483 echo "#if defined(__sony_news) || defined(sony_news)" >> $config_file
484 echo "" >> $config_file
486 echo "Unfortunately, I have conflicting reports:"
487 echo "You might need a,b or c below."
488 echo "Please let me know what is required on Sony NEWS."
490 echo "a) #include <CD.h> "
492 echo "b) #include <newsiodev/scu.h>"
493 echo " #include <newsiodev/scsireg.h>"
495 echo "c) both of the above"
497 echo $ac_n "Please choose a,b or c. [c]:$ac_c"
501 case "$sony_include" in
503 echo "Your choice was a"
504 echo "#include <CD.h>" >> $config_file
507 echo "Your choice was b"
508 echo "#include <newsiodev/scu.h>" >> $config_file
509 echo "#include <newsiodev/scsireg.h>" >> $config_file
512 echo "Your choice was c"
513 echo "#include <CD.h>" >> $config_file
514 echo "#include <newsiodev/scu.h>" >> $config_file
515 echo "#include <newsiodev/scsireg.h>" >> $config_file
520 echo $ac_n "Please specify your cdrom device [/dev/rsd/b0i6u0p2\0]:$ac_c"
523 if [ "$device" = "" ]
525 device
="/dev/rsd/b0i6u0p2\0"
528 echo "Your choice was:$device"
529 echo "#define DEFAULT_CD_DEVICE \"$device\" " >> $config_file
532 echo "While most CDROM devices have a volume range from 0 to 255,"
533 echo "it appears that 128 to 255 is more appropriate for Sony NEWS."
534 echo "Feel free to play with the parameters MINVOLUME and MAXVOLUME"
535 echo "until volume adjustment works to your satisfaction."
536 echo "Don't forget to let me know the result of your experiments."
538 echo $ac_n "MIN_VOLUME [128]:$ac_c"
541 if [ "$MINVOLUME" = "" ]
546 echo "You entered $MINVOLUME "
547 echo "#define MIN_VOLUME $MINVOLUME " >> $config_file
550 echo $ac_n "MAX_VOLUME [255]:$ac_c"
553 if [ "$MAXVOLUME" = "" ]
558 echo "You entered $MAXVOLUME "
559 echo "#define MAX_VOLUME $MAXVOLUME " >> $config_file
561 echo "" >> $config_file
562 echo "#endif /* sony_news */" >> $config_file
569 echo "KSCD configuration for Ultrix systems"
570 echo "---------------------------------------------"
576 echo "" >> $config_file
577 echo "#if defined(ultrix) || defined(__ultrix)" >> $config_file
578 echo "" >> $config_file
580 echo "Unfortunately, I have conflicting reports:"
581 echo "You might need a,b or c below."
582 echo "Please let me know what is required on Ultrix."
584 echo "a) #include <sys/rzdisk.h>"
585 echo " #include <sys/cdrom.h>"
587 echo "b) #include <sys/devio.h>"
588 echo " #include <io/cam/cam.h>"
589 echo " #include <io/cam/uagt.h>"
590 echo " #include <io/cam/dec_cam.h>"
591 echo " #include <io/cam/scsi_all.h>"
593 echo "c) both of the above"
595 echo $ac_n "Please choose a,b or c. [a]:$ac_c"
599 case "$ultrix_include" in
601 echo "Your choice was c)"
603 echo "#include <sys/rzdisk.h>" >> $config_file
604 echo "#include <sys/cdrom.h>">> $config_file
606 echo "#include <sys/devio.h>" >> $config_file
607 echo "#include <io/cam/cam.h>" >> $config_file
608 echo "#include <io/cam/uagt.h>" >> $config_file
609 echo "#include <io/cam/dec_cam.h>" >> $config_file
610 echo "#include <io/cam/scsi_all.h>" >> $config_file
611 echo "" >> $config_file
615 echo "Your choice was b"
616 echo "#include <sys/devio.h>" >> $config_file
617 echo "#include <io/cam/cam.h>" >> $config_file
618 echo "#include <io/cam/uagt.h>" >> $config_file
619 echo "#include <io/cam/dec_cam.h>" >> $config_file
620 echo "#include <io/cam/scsi_all.h>" >> $config_file
623 echo "Your choice was a"
624 echo "#include <sys/rzdisk.h>" >> $config_file
625 echo "#include <sys/cdrom.h>">> $config_file
630 echo "While most CDROM devices have a volume range from 0 to 255,"
631 echo "it appears that 128 to 255 is more appropriate for Ultrix"
632 echo "Feel free to play with the parameters MINVOLUME and MAXVOLUME"
633 echo "until volume adjustment works to your satisfaction."
634 echo "Don't forget to let me know the result of your experiments."
636 echo $ac_n "MIN_VOLUME [128]:$ac_c"
639 if [ "$MINVOLUME" = "" ]
644 echo "You entered $MINVOLUME "
645 echo "#define MIN_VOLUME $MINVOLUME " >> $config_file
648 echo $ac_n "MAX_VOLUME [255]:$ac_c"
651 if [ "$MAXVOLUME" = "" ]
656 echo "You entered $MAXVOLUME "
657 echo "#define MAX_VOLUME $MAXVOLUME " >> $config_file
659 echo "" >> $config_file
660 echo "#endif /* ultrix */" >> $config_file
667 echo "KSCD configuration for OSF systems"
668 echo "----------------------------------"
674 echo "" >> config_file
675 echo "#if defined(__osf__)" >> $config_file
677 echo "Nothing to be done for OSF. The CD device should be automatically detected."
678 echo "If you have trouble look at plat_osf1.c and let me know what needs to be"
682 echo $ac_n "Press [Enter] to continue.$ac_c"
685 echo "" >> $config_file
686 echo "#endif /* osf */" >> $config_file
687 echo "" >> $config_file
697 echo "KSCD configuration for a generic SVR4 system"
698 echo "--------------------------------------------"
704 echo "" >> $config_file
705 echo "#if defined(SVR4) && !defined(sun) && !defined(__sun__)" >> $config_file
707 echo $ac_n "Please specify your cdrom device [/dev/rcdrom/cd0]:$ac_c"
710 if [ "$device" = "" ]
712 device
="/dev/rcdrom/cd0"
715 echo "Your choice was:$device"
716 echo "#define DEFAULT_CD_DEVICE \"$device\" " >> $config_file
718 echo "" >> $config_file
719 echo "#endif /* SVR4 */" >> $config_file
720 echo "" >> $config_file
724 ########################################################################
728 ########################################################################
730 if [ -f $config_file ]
732 echo "Found old config file. Will clean up first ...."
739 if [ "$platform" = "q" ]
748 f|F
) freebsd_netbsd_conf
;;
756 v|V
) generic_svr_conf
;;
763 echo "I have written your configuration choices to $config_file."
764 echo "Should you have trouble with the configuration file this"
765 echo "script generates, you can rename $ORG_CONFIG to $config_file"
766 echo "and edit it manually to suit your configuration."
768 echo "Have fun with kscd!"
770 echo "Bernd Johannes Wuebben"
771 echo "wuebben@kde.org"
772 echo "wuebben@math.cornell.edu"
774 echo "Press [Enter] to start the compilation."