Re: [AD] fshook patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2008-10-06, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> On Monday 06 October 2008, Peter Wang wrote:
> > On 2008-10-06, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> > > Attached is the (large) diff I generated using 'svn diff', let me know if
> > > theres any problems. Or if its ok for me to merge fshook into 4.9. If its
> > > ok, the fshook history is a bit of a mess, so I suppose it doesn't matter
> > > if we merge, or just apply the patch.
> >
> > Thanks for that.
> >
> > It looks *mostly* okay (only really skimmed it at this point).
> > Some minor things but we can fix those afterwards.
> >
> > But, there are some changes that shouldn't be there, e.g. in
> >     CMakeLists.txt,
> >     readme_a5.txt,
> >     addons/kcm_audio/CMakeLists.txt,
> >     addons/acodec/CMakeLists.txt
> >
> > I'm not sure the FSHOOK-TODO should be there either.
> 
> Yeah, if I apply I'll weed out stuff like FSHOOK-TODO. I'll look at the 
> others, but I think some CMakeList changes are needed, which specifically are 
> you against?



> Index: include/allegro5/platform/alwin.h
> ===================================================================
> --- include/allegro5/platform/alwin.h	(.../4.9)	(revision 11023)
> +++ include/allegro5/platform/alwin.h	(.../4.9-fshook)	(revision 11023)
> @@ -24,6 +24,7 @@
>     #include <windows.h>
>  #endif
>  
> +
>  /*******************************************/
>  /********** magic main emulation ***********/
>  /*******************************************/

Might as well revert this nothing change.


> Index: src/unix/usystem.c
> ===================================================================
> --- src/unix/usystem.c	(.../4.9)	(revision 11023)
> +++ src/unix/usystem.c	(.../4.9-fshook)	(revision 11023)
> @@ -21,12 +21,14 @@
>  #include <stdlib.h>
>  #include <string.h>
>  #include <sys/stat.h>
> +#include <sys/types.h>
> +#include <pwd.h>

Might as well wrap with ALLEGRO_HAVE_SYS_TYPES_H

> Index: src/win/wnewsys.c
> ===================================================================
> --- src/win/wnewsys.c	(.../4.9)	(revision 11023)
> +++ src/win/wnewsys.c	(.../4.9-fshook)	(revision 11023)
> @@ -33,7 +33,14 @@
>     #include <mmsystem.h>
>  #endif
>  
> +/* FIXME: should we check for psapi _WIN32_IE and shlobj?
> +{ */
> +   #include <psapi.h>
>  
> +   #define _WIN32_IE 0x500
> +   #include <shlobj.h>
> +/* } */
> +
>  static ALLEGRO_SYSTEM_INTERFACE *vt = 0;
>  static bool using_higher_res_timer;
>  
> @@ -333,7 +340,77 @@
>     return _al_mouse_driver_list[0].driver;
>  }
>  
> +/* _win_get_path:
> +    *  Returns full path to various system and user diretories
> +    */

Might as well fix the indentation.



> Index: readme_a5.txt
> ===================================================================
> --- readme_a5.txt	(.../4.9)	(revision 11023)
> +++ readme_a5.txt	(.../4.9-fshook)	(revision 11023)
> @@ -96,9 +96,6 @@
>  Alternatively, you can use `ccmake` (Unix) or `cmake-gui` (Windows) to bring up
>  an interactive option selector. e.g. `ccmake ..` or `cmake-gui ..`.
>  
> -*Note:* At least one user has had no luck with `cmake-gui` on Windows. If you
> -run into problems, please try again with `cmake`.
> -
>  Now run `make` (or `mingw32-make`) and, optionally, `make install`.
>  (For MinGW users, you may have to set `MINGDIR` to point to your MinGW
>  directory before you do `mingw32-make install`):

Revert that.


> Index: addons/kcm_audio/CMakeLists.txt
> ===================================================================
> --- addons/kcm_audio/CMakeLists.txt	(.../4.9)	(revision 11023)
> +++ addons/kcm_audio/CMakeLists.txt	(.../4.9-fshook)	(revision 11023)
> @@ -22,8 +22,7 @@
>  if(SUPPORT_ALSA)
>      set(ALLEGRO_CFG_KCM_ALSA 1)
>      list(APPEND AUDIO_SOURCES alsa.c)
> -    list(APPEND AUDIO_LIBRARIES ${ALSA_LIBRARIES})
> -    include_directories(${ALSA_INCLUDE_DIRS})
> +    list(APPEND AUDIO_LIBRARIES asound)
>  endif(SUPPORT_ALSA)
>  
>  if(SUPPORT_DSOUND)

Revert that.

> Index: addons/acodec/CMakeLists.txt
> ===================================================================
> --- addons/acodec/CMakeLists.txt	(.../4.9)	(revision 11023)
> +++ addons/acodec/CMakeLists.txt	(.../4.9-fshook)	(revision 11023)
> @@ -32,6 +32,9 @@
>              set(ALLEGRO_CFG_ACODEC_FLAC 1)
>              include_directories(${FLAC_INCLUDE_DIR})
>              list(APPEND ACODEC_EXTRA_LIBS ${FLAC_LIBRARIES})
> +            if(WIN32)
> +	        list(APPEND ACODEC_EXTRA_LIBS -lwsock32)
> +            endif(WIN32)
>              list(APPEND ACODEC_SOURCES flac.c)
>          endif(FLAC_COMPILES)
>      endif(FLAC_FOUND)

Revert that.


> Index: CMakeLists.txt
> ===================================================================
> --- CMakeLists.txt	(.../4.9)	(revision 11023)
> +++ CMakeLists.txt	(.../4.9-fshook)	(revision 11023)
> @@ -239,8 +239,9 @@
>  check_include_files(sys/io.h ALLEGRO_HAVE_SYS_IO_H)
>  check_include_files(sys/stat.h ALLEGRO_HAVE_SYS_STAT_H)
>  check_include_files(sys/time.h ALLEGRO_HAVE_SYS_TIME_H)
> +check_include_files(time.h ALLEGRO_HAVE_TIME_H)
>  check_include_files(sys/utsname.h ALLEGRO_HAVE_SYS_UTSNAME_H)
> -
> +check_include_files(sys/types.h ALLEGRO_HAVE_SYS_TYPES_H)
>  check_include_files(soundcard.h ALLEGRO_HAVE_SOUNDCARD_H)
>  check_include_files(sys/soundcard.h ALLEGRO_HAVE_SYS_SOUNDCARD_H)
>  check_include_files(machine/soundcard.h ALLEGRO_HAVE_MACHINE_SOUNDCARD_H)
> @@ -327,12 +328,12 @@
>  
>  if(WANT_OPENAL)
>      find_package(OpenAL)
> -    mark_as_advanced(OPENAL_INCLUDE_DIR OPENAL_LIBRARY)

Revert that.

>      if(OPENAL_FOUND)
>          set(SUPPORT_OPENAL 1)
>      endif(OPENAL_FOUND)
>  endif(WANT_OPENAL)
>  
> +
>  # Accumulate extra libraries needed due to drivers.
>  set(DRIVER_LIBS_STATIC)
>  set(DRIVER_LIBS_SHARED)
> @@ -346,9 +347,6 @@
>      find_package(Threads)
>      if(CMAKE_USE_PTHREADS_INIT)
>          set(ALLEGRO_HAVE_LIBPTHREAD 1)
> -    else(CMAKE_USE_PTHREADS_INIT)
> -        message(FATAL_ERROR
> -            "Unix port requires pthreads support, not detected.")
>      endif(CMAKE_USE_PTHREADS_INIT)
>  
>      #

Revert that.

> @@ -356,19 +354,61 @@
>      #
>  
>      if(WANT_ALSA)
> -        pkg_check_modules(ALSA alsa)
> -        if(ALSA_FOUND)
> +        check_c_source_compiles("
> +            #include <sys/asoundlib.h>
> +            int main(void) {
> +            #if(SND_LIB_MAJOR > 0) || (SND_LIB_MAJOR == 0 && SND_LIB_MINOR == 9 && SND_LIB_SUBMINOR >= 1)
> +                return 0;
> +            #else
> +                return 1;
> +            #endif
> +            }"
> +            CAN_ALSA
> +        )
> +        if(CAN_ALSA)
>              set(SUPPORT_ALSA 1)
> -        endif(ALSA_FOUND)
> +        endif(CAN_ALSA)
>      endif(WANT_ALSA)

Revert that.

>  
>      if(WANT_OSS)
> -        include(AllegroFindOSS)
> -        if(OSS_FOUND)
> -            set(SUPPORT_OSS 1)
> -        endif(OSS_FOUND)
> +        if(ALLEGRO_HAVE_SOUNDCARD_H OR ALLEGRO_HAVE_SYS_SOUNDCARD_H OR ALLEGRO_HAVE_MACHINE_SOUNDCARD_H OR ALLEGRO_LINUX_SYS_SOUNDCARD_H)
> +            if(ALLEGRO_MACHINE_SOUNDCARD_H)
> +                set(CMAKE_REQUIRED_DEFINITIONS -DALLEGRO_HAVE_MACHINE_SOUNDCARD_H)
> +            endif(ALLEGRO_MACHINE_SOUNDCARD_H)
> +            if(ALLEGRO_HAVE_LINUX_SOUNDCARD_H)
> +                set(CMAKE_REQUIRED_DEFINITIONS -DALLEGRO_HAVE_LINUX_SOUNDCARD_H)
> +            endif(ALLEGRO_HAVE_LINUX_SOUNDCARD_H)
> +            if(ALLEGRO_HAVE_SYS_SOUNDCARD_H)
> +                set(CMAKE_REQUIRED_DEFINITIONS -DALLEGRO_HAVE_SYS_SOUNDCARD_H)
> +            endif(ALLEGRO_HAVE_SYS_SOUNDCARD_H)
> +            if(ALLEGRO_HAVE_SOUNDCARD_H)
> +                set(CMAKE_REQUIRED_DEFINITIONS -DALLEGRO_HAVE_SOUNDCARD_H)
> +            endif(ALLEGRO_HAVE_SOUNDCARD_H)
> +            check_c_source_compiles("
> +                #ifdef ALLEGRO_HAVE_SOUNDCARD_H 
> +                #include <soundcard.h>
> +                #endif
> +                #ifdef ALLEGRO_HAVE_SYS_SOUNDCARD_H 
> +                #include <sys/soundcard.h>
> +                #endif
> +                #ifdef ALLEGRO_HAVE_LINUX_SOUNDCARD_H 
> +                #include <linux/soundcard.h>
> +                #endif
> +                #ifdef ALLEGRO_HAVE_MACHINE_SOUNDCARD_H 
> +                #include <machine/soundcard.h>
> +                #endif
> +                int main(void) {
> +                    audio_buf_info abi;
> +                    return 0;
> +                }"
> +                CAN_OSS
> +            )
> +            set(CMAKE_REQUIRED_DEFINITIONS)
> +            if(CAN_OSS)
> +                set(SUPPORT_OSS 1)
> +            endif(CAN_OSS)
> +        endif(ALLEGRO_HAVE_SOUNDCARD_H OR ALLEGRO_HAVE_SYS_SOUNDCARD_H OR ALLEGRO_HAVE_MACHINE_SOUNDCARD_H OR ALLEGRO_LINUX_SYS_SOUNDCARD_H)
>      endif(WANT_OSS)
> -
>  endif(UNIX)

Revert that.


> @@ -465,12 +505,12 @@
>      include/allegro5/platform/alplatf.h
>      )
>  
> -if(UNIX)
> +if(UNIX OR WIN32)
>      configure_file(
> -        include/allegro5/platform/alunixac.h.cmake
> -        include/allegro5/platform/alunixac.h
> +        include/allegro5/platform/al_cfg.h.cmake
> +        include/allegro5/platform/al_cfg.h
>          )
> -endif(UNIX)
> +endif(UNIX OR WIN32)

I don't like the name al_cfg.h as we already have alconfig.h, but leave
it for now.

>  
>  #-----------------------------------------------------------------------------#
>  #
> @@ -520,7 +560,7 @@
>  
>  if(ALLEGRO_UNIX) # not MACOSX
>      list(APPEND LIBRARY_SOURCES ${ALLEGRO_SRC_UNIX_FILES})
> -    list(APPEND PLATFORM_LIBS m ${CMAKE_THREAD_LIBS_INIT})
> +    list(APPEND PLATFORM_LIBS m pthread)
>  endif(ALLEGRO_UNIX)

Revert that.

Peter





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/