LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File liballeg4_4-alsa_default.patch of Package allegro (Project home:ykoba)

Index: include/allegro/platform/alunix.h
===================================================================
--- include/allegro/platform/alunix.h.orig
+++ include/allegro/platform/alunix.h
@@ -71,17 +71,18 @@ AL_VAR(TIMER_DRIVER, timerdrv_unix_sigal
 #define DIGI_JACK             AL_ID('J','A','C','K')
 
 
-#ifdef ALLEGRO_WITH_OSSDIGI
-AL_VAR(DIGI_DRIVER, digi_oss);
-#define DIGI_DRIVER_OSS                                          \
-      {  DIGI_OSS,        &digi_oss,            TRUE  },
-#endif /* ALLEGRO_WITH_OSSDIGI */
+#ifdef ALLEGRO_WITH_ALSADIGI
+AL_VAR(DIGI_DRIVER, digi_alsa);
+#define DIGI_DRIVER_ALSA                                         \
+      {  DIGI_ALSA,       &digi_alsa,           TRUE  },
+#endif /* ALLEGRO_WITH_ALSADIGI */
 
-#ifdef ALLEGRO_WITH_OSSMIDI
-AL_VAR(MIDI_DRIVER, midi_oss);
-#define MIDI_DRIVER_OSS                                          \
-      {  MIDI_OSS,        &midi_oss,            TRUE  },
-#endif /* ALLEGRO_WITH_OSSMIDI */
+
+#ifdef ALLEGRO_WITH_ALSAMIDI
+AL_VAR(MIDI_DRIVER, midi_alsa);
+#define MIDI_DRIVER_ALSA                                          \
+      {  MIDI_ALSA,        &midi_alsa,            TRUE  },
+#endif /* ALLEGRO_WITH_ALSAMIDI */
 
 #ifndef ALLEGRO_WITH_MODULES
 
@@ -103,18 +104,17 @@ AL_VAR(DIGI_DRIVER, digi_sgial);
       {  DIGI_SGIAL,      &digi_sgial,          TRUE  },
 #endif /* ALLEGRO_WITH_SGIALDIGI */
 
-#ifdef ALLEGRO_WITH_ALSADIGI
-AL_VAR(DIGI_DRIVER, digi_alsa);
-#define DIGI_DRIVER_ALSA                                         \
-      {  DIGI_ALSA,       &digi_alsa,           TRUE  },
-#endif /* ALLEGRO_WITH_ALSADIGI */
-
+#ifdef ALLEGRO_WITH_OSSDIGI
+AL_VAR(DIGI_DRIVER, digi_oss);
+#define DIGI_DRIVER_OSS                                          \
+      {  DIGI_OSS,        &digi_oss,            TRUE  },
+#endif /* ALLEGRO_WITH_OSSDIGI */
 
-#ifdef ALLEGRO_WITH_ALSAMIDI
-AL_VAR(MIDI_DRIVER, midi_alsa);
-#define MIDI_DRIVER_ALSA                                          \
-      {  MIDI_ALSA,        &midi_alsa,            TRUE  },
-#endif /* ALLEGRO_WITH_ALSAMIDI */
+#ifdef ALLEGRO_WITH_OSSMIDI
+AL_VAR(MIDI_DRIVER, midi_oss);
+#define MIDI_DRIVER_OSS                                          \
+      {  MIDI_OSS,        &midi_oss,            TRUE  },
+#endif /* ALLEGRO_WITH_OSSMIDI */
 
 	  
 #ifdef ALLEGRO_WITH_JACKDIGI
Index: src/unix/alsa9.c
===================================================================
--- src/unix/alsa9.c.orig
+++ src/unix/alsa9.c
@@ -20,7 +20,7 @@
 
 #include "allegro.h"
 
-#if (ALLEGRO_ALSA_VERSION == 9) && (defined ALLEGRO_WITH_ALSADIGI) && ((!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE))
+#if (ALLEGRO_ALSA_VERSION == 9) && (defined ALLEGRO_WITH_ALSADIGI)
 
 #include "allegro/internal/aintern.h"
 #ifdef ALLEGRO_QNX
Index: src/unix/alsamidi.c
===================================================================
--- src/unix/alsamidi.c.orig
+++ src/unix/alsamidi.c
@@ -17,7 +17,7 @@
 
 #include "allegro.h"
 
-#if (defined ALLEGRO_WITH_ALSAMIDI) && ((!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE))
+#ifdef ALLEGRO_WITH_ALSAMIDI
 
 #include "allegro/internal/aintern.h"
 
Index: src/unix/uoss.c
===================================================================
--- src/unix/uoss.c.orig
+++ src/unix/uoss.c
@@ -22,7 +22,7 @@
 
 #include "allegro.h"
 
-#ifdef ALLEGRO_WITH_OSSDIGI
+#if (defined ALLEGRO_WITH_OSSDIGI) && ((!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE))
 
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintunix.h"
@@ -612,4 +612,16 @@ static int oss_rec_read(void *buf)
 }
 
 
+#ifdef ALLEGRO_MODULE
+
+/* _module_init:
+ *  Called when loaded as a dynamically linked module.
+ */
+void _module_init(int system_driver)
+{
+   _unix_register_digi_driver(DIGI_OSS, &digi_oss, TRUE, FALSE);
+}
+
+#endif
+
 #endif
Index: src/unix/uossmidi.c
===================================================================
--- src/unix/uossmidi.c.orig
+++ src/unix/uossmidi.c
@@ -17,7 +17,7 @@
 
 #include "allegro.h"
 
-#ifdef ALLEGRO_WITH_OSSMIDI
+#if (defined ALLEGRO_WITH_OSSMIDI) && ((!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE))
 
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintunix.h"
@@ -588,4 +588,16 @@ static void oss_midi_exit(int input)
    }
 }
 
+#ifdef ALLEGRO_MODULE
+
+/* _module_init:
+ *   Called when loaded as a dynamically linked module.
+ */
+void _module_init(int system_driver)
+{
+   _unix_register_midi_driver(MIDI_OSS, &midi_oss, TRUE, FALSE);
+}
+
+#endif /* ALLEGRO_MODULE */
+
 #endif
Index: src/unix/usnddrv.c
===================================================================
--- src/unix/usnddrv.c.orig
+++ src/unix/usnddrv.c
@@ -33,10 +33,10 @@ BEGIN_DIGI_DRIVER_LIST
 #if (defined ALLEGRO_WITH_ESDDIGI) && (!defined ALLEGRO_WITH_MODULES)
    DIGI_DRIVER_ESD
 #endif
-#if (defined ALLEGRO_WITH_ALSADIGI) && (!defined ALLEGRO_WITH_MODULES)
+#if (defined ALLEGRO_WITH_ALSADIGI)
    DIGI_DRIVER_ALSA
 #endif
-#if (defined ALLEGRO_WITH_OSSDIGI)
+#if (defined ALLEGRO_WITH_OSSDIGI) && (!defined ALLEGRO_WITH_MODULES)
    DIGI_DRIVER_OSS
 #endif
 END_DIGI_DRIVER_LIST
@@ -44,10 +44,10 @@ END_DIGI_DRIVER_LIST
 
 BEGIN_MIDI_DRIVER_LIST
    MIDI_DRIVER_DIGMID
-#if (defined ALLEGRO_WITH_ALSAMIDI) && (!defined ALLEGRO_WITH_MODULES)
+#if (defined ALLEGRO_WITH_ALSAMIDI)
    MIDI_DRIVER_ALSA
 #endif
-#if (defined ALLEGRO_WITH_OSSMIDI)
+#if (defined ALLEGRO_WITH_OSSMIDI) && (!defined ALLEGRO_WITH_MODULES)
    MIDI_DRIVER_OSS
 #endif
 END_MIDI_DRIVER_LIST
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -396,6 +396,8 @@ if(ALLEGRO_UNIX) # not MACOSX
         set(ALLEGRO_WITH_OSSDIGI 1)
         set(ALLEGRO_WITH_OSSMIDI 1)
         include_directories(SYSTEM ${OSS_INCLUDE_DIR})
+        add_our_module(alleg-ossdigi src/unix/uoss.c)
+        add_our_module(alleg-ossmidi src/unix/uossmidi.c)
     endif(OSS_FOUND)
 
     pkg_check_modules(ALSA alsa)
@@ -405,9 +407,7 @@ if(ALLEGRO_UNIX) # not MACOSX
         set(ALLEGRO_WITH_ALSADIGI 1)
         set(ALLEGRO_WITH_ALSAMIDI 1)
         include_directories(SYSTEM ${ALSA_INCLUDE_DIRS})
-        list(APPEND PLATFORM_LIBS_NON_MODULES ${ALSA_LIBRARIES})
-        add_our_module(alleg-alsadigi src/unix/alsa9.c ${ALSA_LIBRARIES})
-        add_our_module(alleg-alsamidi src/unix/alsamidi.c ${ALSA_LIBRARIES})
+        list(APPEND PLATFORM_LIBS ${ALSA_LIBRARIES})
     endif(ALSA_FOUND)
 
     pkg_check_modules(JACK jack)