changeset 27775:5ea38a20e74e

Determine default CD/DVD device in configure instead of using an #ifdef jungle.
author diego
date Tue, 21 Oct 2008 07:02:25 +0000
parents 61d7742bcb75
children ef0b0f9291a2
files configure stream/stream.h
diffstat 2 files changed, 30 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Mon Oct 20 18:08:10 2008 +0000
+++ b/configure	Tue Oct 21 07:02:25 2008 +0000
@@ -5372,6 +5372,34 @@
 fi #if irix
 
 
+# set default CD/DVD devices
+if win32 || os2 ; then
+  default_cdrom_device="D:"
+elif darwin ; then
+  default_cdrom_device="/dev/disk1"
+elif dragonfly ; then
+  default_cdrom_device="/dev/cd0"
+elif freebsd ; then
+  default_cdrom_device="/dev/acd0"
+elif openbsd ; then
+  default_cdrom_device="/dev/rcd0a"
+elif sunos ; then
+  default_cdrom_device="/vol/dev/aliases/cdrom0"
+elif amigaos ; then
+  default_cdrom_device="a1ide.device:2"
+else
+  default_cdrom_device="/dev/cdrom"
+fi
+
+if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
+  default_dvd_device=$default_cdrom_device
+elif darwin ; then
+  default_dvd_device="/dev/rdiskN"
+else
+  default_dvd_device="/dev/dvd"
+fi
+
+
 echocheck "VCD support"
 if linux || freebsd || netbsd || dragonfly || bsdos || darwin || sunos || mingw32; then
   _inputmodules="vcd $_inputmodules"
@@ -8127,6 +8155,8 @@
 
 
 /* DVD/VCD/CD */
+#define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
+#define DEFAULT_DVD_DEVICE   "$default_dvd_device"
 $_def_bsdi_dvd
 $_def_cddb
 $_def_cdio
--- a/stream/stream.h	Mon Oct 20 18:08:10 2008 +0000
+++ b/stream/stream.h	Tue Oct 21 07:02:25 2008 +0000
@@ -65,32 +65,6 @@
 #define STREAM_CTRL_GET_ANGLE 10
 #define STREAM_CTRL_SET_ANGLE 11
 
-#ifdef __sun
-#define	DEFAULT_CDROM_DEVICE	"/vol/dev/aliases/cdrom0"
-#define DEFAULT_DVD_DEVICE	DEFAULT_CDROM_DEVICE
-#elif defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__)
-#define DEFAULT_CDROM_DEVICE    "D:"
-#define DEFAULT_DVD_DEVICE	DEFAULT_CDROM_DEVICE
-#elif defined(__APPLE__) || defined(__DARWIN__)
-#define DEFAULT_CDROM_DEVICE    "/dev/disk1"
-#define DEFAULT_DVD_DEVICE	"/dev/rdiskN"
-#elif defined(__OpenBSD__)
-#define DEFAULT_CDROM_DEVICE	"/dev/rcd0a"
-#define DEFAULT_DVD_DEVICE	DEFAULT_CDROM_DEVICE
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-#define DEFAULT_CDROM_DEVICE	"/dev/acd0"
-#define DEFAULT_DVD_DEVICE	DEFAULT_CDROM_DEVICE
-#elif defined(__DragonFly__)
-#define DEFAULT_CDROM_DEVICE	"/dev/cd0"
-#define DEFAULT_DVD_DEVICE	DEFAULT_CDROM_DEVICE
-#elif defined(__AMIGAOS4__)
-#define DEFAULT_CDROM_DEVICE    "a1ide.device:2"
-#define DEFAULT_DVD_DEVICE	DEFAULT_CDROM_DEVICE
-#else
-#define DEFAULT_CDROM_DEVICE    "/dev/cdrom"
-#define DEFAULT_DVD_DEVICE	"/dev/dvd"
-#endif
-
 
 #ifdef CONFIG_NETWORK
 #include "network.h"