Date: Sun, 26 Feb 2006 11:25:09 +0900
authorSam Lantinga <slouken@libsdl.org>
Sun, 26 Feb 2006 04:54:01 +0000
changeset 14381f4f09641645
parent 1437 f1781c15934c
child 1439 4d3bb026cd16
Date: Sun, 26 Feb 2006 11:25:09 +0900
From: Hayashi Naoyuki
Subject: Re: [SDL] CVS stable again, please update SDL ports

Some problems are caused on Tru64 UNIX.
If applying SDL12-osf1.path, these problems are fixed.


1. configure-script say "recursive mutexes... no" and "pthread
semaphores... no".
checking for pthreads... yes
checking for recursive mutexes... no
checking for pthread semaphores... no

This is because it compiled without pthread_cflags and pthread_lib when
checking recursive mutexes and pthread semaphores.


2. Compiling src/audio/mme/SDL_mmeaudio.c fails.
cc: Severe: ./src/audio/mme/SDL_mmeaudio.c, line 25: Cannot find file
<mme_api.h> specified in #include directive. (noinclfilef)
#include <mme_api.h>
-^

This is because BUILD_CFLAGS is wrong.


3. Compiling src/cdrom/osf/SDL_syscdrom.c fails.
cc: Warning: ./src/cdrom/osf/SDL_syscdrom.c, line 176: Too few actual
parameters in the invocation of the macro "SDL_stack_alloc". (toofewactuals)
cdpath = SDL_stack_alloc(len);
------------------------------------^
cc: Error: ./src/cdrom/osf/SDL_syscdrom.c, line 176: Invalid expression.
(badexpr)
cdpath = SDL_stack_alloc(len);
-----------------^

SDL_stack_alloc is defined in include/SDL_stdinc.h.
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*count)


4. Linking fails if running configure with --enable-x11-shared=yes.
/usr/ccs/bin/ld:
Warning: Unresolved:
p_XData32


5. Compiling src/video/x11/SDL_x11dyn.c fails if running configure with
--enable-x11-shared=no.
cc: Error: ./src/video/x11/SDL_x11sym.h, line 149: In this statement,
"_SmtBufferOverflow" is not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr))
^
cc: Error: ./src/video/x11/SDL_x11sym.h, line 150: In this statement,
"_SmtBufferOverflow" is not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr))
^
cc: Error: ./src/video/x11/SDL_x11sym.h, line 150: In this statement,
"_SmtIpError" is not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtIpError,(Display *dpy,register smtDisplayPtr, int))
^
configure.in
src/cdrom/osf/SDL_syscdrom.c
src/video/x11/SDL_x11dyn.h
src/video/x11/SDL_x11sym.h
     1.1 --- a/configure.in	Sun Feb 26 04:48:24 2006 +0000
     1.2 +++ b/configure.in	Sun Feb 26 04:54:01 2006 +0000
     1.3 @@ -397,6 +397,44 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +dnl Check whether we want to use Tru64 UNIX native audio or not
     1.8 +CheckMME()
     1.9 +{
    1.10 +    dnl Make sure we are running on an Tru64 UNIX
    1.11 +    case $ARCH in
    1.12 +        osf)
    1.13 +            ;;
    1.14 +        *)
    1.15 +            return
    1.16 +            ;;
    1.17 +    esac
    1.18 +    if test x$enable_audio = xyes; then
    1.19 +        AC_MSG_CHECKING(for MME audio support)
    1.20 +        MME_CFLAGS="-I/usr/include/mme"
    1.21 +        MME_LIBS="-lmme"
    1.22 +        have_mme=no
    1.23 +        save_CFLAGS="$CFLAGS"
    1.24 +        CFLAGS="$CFLAGS $MME_CFLAGS"
    1.25 +        AC_TRY_COMPILE([
    1.26 +          #include <mme_api.h>
    1.27 +        ],[
    1.28 +          HWAVEOUT sound;
    1.29 +        ],[
    1.30 +        have_mme=yes
    1.31 +        ])
    1.32 +        CFLAGS="$save_CFLAGS"
    1.33 +        AC_MSG_RESULT($have_mme)
    1.34 +        # Set up files for the audio library
    1.35 +        if test x$have_mme = xyes; then
    1.36 +            AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
    1.37 +            SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
    1.38 +            BUILD_CFLAGS="$BUILD_CFLAGS $MME_CFLAGS"
    1.39 +            BUILD_LDFLAGS="$BUILD_LDFLAGS $MME_LIBS"
    1.40 +            have_audio=yes
    1.41 +        fi
    1.42 +    fi
    1.43 +}
    1.44 +
    1.45  dnl Find the ESD includes and libraries
    1.46  CheckESD()
    1.47  {
    1.48 @@ -1555,6 +1593,11 @@
    1.49              SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
    1.50              SDL_LIBS="$SDL_LIBS $pthread_lib"
    1.51  
    1.52 +            # Save the original compiler flags and libraries
    1.53 +            ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
    1.54 +            # Add the pthread compiler flags and libraries
    1.55 +            CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
    1.56 +
    1.57              # Check to see if recursive mutexes are available
    1.58              AC_MSG_CHECKING(for recursive mutexes)
    1.59              has_recursive_mutexes=no
    1.60 @@ -1596,6 +1639,9 @@
    1.61                  AC_MSG_RESULT($have_pthread_sem)
    1.62              fi
    1.63  
    1.64 +            # Restore the compiler flags and libraries
    1.65 +            CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
    1.66 +
    1.67              # Basic thread creation functions
    1.68              SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
    1.69  
    1.70 @@ -1903,6 +1949,7 @@
    1.71          CheckAltivec
    1.72          CheckOSS
    1.73          CheckDMEDIA
    1.74 +        CheckMME
    1.75          CheckALSA
    1.76          CheckARTSC
    1.77          CheckESD
    1.78 @@ -1945,12 +1992,6 @@
    1.79                  SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
    1.80                  have_audio=yes
    1.81              ;;
    1.82 -            osf)
    1.83 -                AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
    1.84 -                SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
    1.85 -                BUILD_LDFLAGS="$BUILD_LDFLAGS -lmme"
    1.86 -                have_audio=yes
    1.87 -            ;;
    1.88            esac
    1.89          fi
    1.90          # Set up files for the joystick library
     2.1 --- a/src/cdrom/osf/SDL_syscdrom.c	Sun Feb 26 04:48:24 2006 +0000
     2.2 +++ b/src/cdrom/osf/SDL_syscdrom.c	Sun Feb 26 04:54:01 2006 +0000
     2.3 @@ -173,7 +173,7 @@
     2.4      if ( SDLcdrom != NULL ) {
     2.5  	char *cdpath, *delim;
     2.6  	size_t len = SDL_strlen(SDLcdrom)+1;
     2.7 -	cdpath = SDL_stack_alloc(len);
     2.8 +	cdpath = SDL_stack_alloc(char, len);
     2.9  	if ( cdpath != NULL ) {
    2.10  	    SDL_strlcpy(cdpath, SDLcdrom, len);
    2.11  	    SDLcdrom = cdpath;
     3.1 --- a/src/video/x11/SDL_x11dyn.h	Sun Feb 26 04:48:24 2006 +0000
     3.2 +++ b/src/video/x11/SDL_x11dyn.h	Sun Feb 26 04:54:01 2006 +0000
     3.3 @@ -50,6 +50,15 @@
     3.4  extern "C" {
     3.5  #endif
     3.6  
     3.7 +#ifdef __osf__
     3.8 +extern int _XData32(Display *,register long *,unsigned);
     3.9 +extern void _XRead32(Display *,register long *,long);
    3.10 +extern void _SmtBufferOverflow(Display *,register smtDisplayPtr);
    3.11 +extern void _SmtIpError(Display *,register smtDisplayPtr, int);
    3.12 +extern int ipAllocateData(ChannelPtr, IPCard, IPDataPtr *);
    3.13 +extern int ipUnallocateAndSendData(ChannelPtr, IPCard);
    3.14 +#endif
    3.15 +
    3.16  /* evil function signatures... */
    3.17  typedef Bool (*SDL_X11_XESetWireToEventRetType)(Display*,XEvent*,xEvent*);
    3.18  typedef int (*SDL_X11_XSynchronizeRetType)(Display*);
    3.19 @@ -72,7 +81,7 @@
    3.20  #define XFree pXFree
    3.21  #define _XData32 p_XData32
    3.22  
    3.23 -#if defined(__osf__) && defined(SDL_VIDEO_DRIVER_X11_DYNAMIC)
    3.24 +#if defined(__osf__)
    3.25  #define _SmtBufferOverflow p_SmtBufferOverflow
    3.26  #define _SmtIpError p_SmtIpError
    3.27  #define ipAllocateData pipAllocateData
     4.1 --- a/src/video/x11/SDL_x11sym.h	Sun Feb 26 04:48:24 2006 +0000
     4.2 +++ b/src/video/x11/SDL_x11sym.h	Sun Feb 26 04:54:01 2006 +0000
     4.3 @@ -140,7 +140,7 @@
     4.4   * These don't exist in 32-bit versions and are removed by Xlib macros, but
     4.5   *  64+ bit systems will use them.
     4.6   */
     4.7 -#if defined(LONG64) && !defined(__osf__)
     4.8 +#if defined(LONG64)
     4.9  SDL_X11_SYM(1,int,_XData32,(Display *dpy,register long *data,unsigned len))
    4.10  SDL_X11_SYM(1,void,_XRead32,(Display *dpy,register long *data,long len))
    4.11  #endif