Unified the thread detection code for UNIX platforms
authorSam Lantinga <slouken@libsdl.org>
Mon, 10 Jun 2002 21:39:49 +0000
changeset 399cfcf6bf1640c
parent 398 d219b0e02f5f
child 400 3dde0301f5f9
Unified the thread detection code for UNIX platforms
configure.in
     1.1 --- a/configure.in	Mon Jun 10 20:42:53 2002 +0000
     1.2 +++ b/configure.in	Mon Jun 10 21:39:49 2002 +0000
     1.3 @@ -1099,6 +1099,34 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +dnl See if we can use GNU pth library for threads
     1.8 +CheckPTH()
     1.9 +{
    1.10 +    dnl Check for pth support
    1.11 +    AC_ARG_ENABLE(pth,
    1.12 +[  --enable-pth            use GNU pth library for multi-threading [default=yes]],
    1.13 +                  , enable_pth=yes)
    1.14 +    if test x$enable_threads = xyes -a x$enable_pth = xyes; then
    1.15 +        AC_PATH_PROG(PTH_CONFIG, pth-config, no)
    1.16 +        if test "$PTH_CONFIG" = "no"; then
    1.17 +            use_pth=no
    1.18 +        else
    1.19 +            PTH_CFLAGS=`$PTH_CONFIG --cflags`
    1.20 +            PTH_LIBS=`$PTH_CONFIG --libs --all`
    1.21 +            SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
    1.22 +            SDL_LIBS="$SDL_LIBS $PTH_LIBS"
    1.23 +            CFLAGS="$CFLAGS -DENABLE_PTH"
    1.24 +            use_pth=yes
    1.25 +        fi
    1.26 +        AC_MSG_CHECKING(pth)
    1.27 +        if test "x$use_pth" = xyes; then
    1.28 +            AC_MSG_RESULT(yes)
    1.29 +        else
    1.30 +            AC_MSG_RESULT(no)
    1.31 +        fi
    1.32 +    fi
    1.33 +}
    1.34 +
    1.35  dnl See what type of thread model to use on Linux and Solaris
    1.36  CheckPTHREAD()
    1.37  {
    1.38 @@ -1193,6 +1221,9 @@
    1.39              ])
    1.40              # Some systems have broken recursive mutex implementations
    1.41              case "$target" in
    1.42 +                *-*-darwin*)
    1.43 +                    has_recursive_mutexes=no
    1.44 +                    ;;
    1.45                  *-*-solaris*)
    1.46                      has_recursive_mutexes=no
    1.47                      ;;
    1.48 @@ -1253,45 +1284,80 @@
    1.49          CFLAGS="$CFLAGS -DHAVE_SEMUN"
    1.50      fi
    1.51  
    1.52 -    # See if we can use clone() on Linux directly
    1.53 -    use_clone=no
    1.54 +    # See if we can use GNU Pth or clone() on Linux directly
    1.55      if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
    1.56 -        case "$target" in
    1.57 -            *-*-linux*)
    1.58 -                use_clone=yes
    1.59 -                ;;
    1.60 -            *)
    1.61 -                CFLAGS="$CFLAGS -DFORK_HACK"
    1.62 -                ;;
    1.63 -        esac
    1.64 +        CheckPTH
    1.65 +        if test x$use_pth != xyes; then
    1.66 +            case "$target" in
    1.67 +                *-*-linux*)
    1.68 +                    use_clone=yes
    1.69 +                    ;;
    1.70 +            esac
    1.71 +        fi
    1.72      fi
    1.73  }
    1.74  
    1.75 -dnl See if we can use GNU pth library for threads
    1.76 -CheckPTH()
    1.77 +# Note that we need to have either semaphores or to have mutexes and
    1.78 +# condition variables to implement all thread synchronization primitives
    1.79 +CopyUnixThreadSource()
    1.80  {
    1.81 -    dnl Check for pth support
    1.82 -    AC_ARG_ENABLE(pth,
    1.83 -[  --enable-pth            use GNU pth library for multi-threading [default=yes]],
    1.84 -                  , enable_pth=yes)
    1.85 -    if test x$enable_threads = xyes -a x$enable_pth = xyes; then
    1.86 -        AC_PATH_PROG(PTH_CONFIG, pth-config, no)
    1.87 -        if test "$PTH_CONFIG" = "no"; then
    1.88 -            use_pth=no
    1.89 +    if test x$use_pthreads = xyes -o x$use_clone = xyes; then
    1.90 +        # Basic thread creation functions
    1.91 +        COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
    1.92 +        if test x$use_pthreads != xyes; then
    1.93 +            COPY_ARCH_SRC(src/thread, linux, clone.S)
    1.94 +        fi
    1.95 +        COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
    1.96 +
    1.97 +        # Semaphores
    1.98 +        # We can fake these with mutexes and condition variables if necessary
    1.99 +        if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
   1.100 +            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.101          else
   1.102 -            PTH_CFLAGS=`$PTH_CONFIG --cflags`
   1.103 -            PTH_LIBS=`$PTH_CONFIG --libs --all`
   1.104 -            SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
   1.105 -            SDL_LIBS="$SDL_LIBS $PTH_LIBS"
   1.106 -            CFLAGS="$CFLAGS -DENABLE_PTH"
   1.107 -            use_pth=yes
   1.108 +            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.109          fi
   1.110 -        AC_MSG_CHECKING(pth)
   1.111 -        if test "x$use_pth" = xyes; then
   1.112 -            AC_MSG_RESULT(yes)
   1.113 +        COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.114 +
   1.115 +        # Mutexes
   1.116 +        # We can fake these with semaphores if necessary
   1.117 +        case "$target" in
   1.118 +            *-*-bsdi*)
   1.119 +                COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
   1.120 +                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.121 +                ;;
   1.122 +            *)
   1.123 +                if test x$glibc20_pthreads = xyes; then
   1.124 +                    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
   1.125 +                    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
   1.126 +                else
   1.127 +                    COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.128 +                    COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.129 +                fi
   1.130 +                ;;
   1.131 +        esac
   1.132 +
   1.133 +        # Condition variables
   1.134 +        # We can fake these with semaphores and mutexes if necessary
   1.135 +        if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then
   1.136 +            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
   1.137          else
   1.138 -            AC_MSG_RESULT(no)
   1.139 +            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.140          fi
   1.141 +        COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.142 +
   1.143 +    elif text x$use_pth = xyes; then
   1.144 +        COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
   1.145 +        COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
   1.146 +        COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
   1.147 +        COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
   1.148 +        COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
   1.149 +        COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
   1.150 +        COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.151 +        COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.152 +    else
   1.153 +       AC_MSG_ERROR([
   1.154 +*** No thread support detected
   1.155 +       ])
   1.156      fi
   1.157  }
   1.158  
   1.159 @@ -1593,32 +1659,7 @@
   1.160          fi
   1.161          # Set up files for the thread library
   1.162          if test x$enable_threads = xyes; then
   1.163 -            if test x$use_pthreads != xyes; then
   1.164 -                COPY_ARCH_SRC(src/thread, linux, clone.S)
   1.165 -            fi
   1.166 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.167 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.168 -            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
   1.169 -                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.170 -            else
   1.171 -                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.172 -            fi
   1.173 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.174 -            if test x$glibc20_pthreads = xyes; then
   1.175 -                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
   1.176 -                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
   1.177 -                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
   1.178 -                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.179 -            else
   1.180 -                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.181 -                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.182 -                if test x$has_recursive_mutexes != xyes; then
   1.183 -                    COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
   1.184 -                else
   1.185 -                    COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.186 -                fi
   1.187 -                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.188 -            fi
   1.189 +            CopyUnixThreadSource
   1.190          fi
   1.191          # Set up files for the timer library
   1.192          if test x$enable_timers = xyes; then
   1.193 @@ -1663,14 +1704,7 @@
   1.194          fi
   1.195          # Set up files for the thread library
   1.196          if test x$enable_threads = xyes; then
   1.197 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.198 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.199 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.200 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.201 -            COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
   1.202 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.203 -            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.204 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.205 +            CopyUnixThreadSource
   1.206          fi
   1.207          # Set up files for the timer library
   1.208          if test x$enable_timers = xyes; then
   1.209 @@ -1711,18 +1745,7 @@
   1.210          fi
   1.211          # Set up files for the thread library
   1.212          if test x$enable_threads = xyes; then
   1.213 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.214 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.215 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.216 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.217 -            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
   1.218 -                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.219 -            else
   1.220 -                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.221 -            fi
   1.222 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.223 -            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.224 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.225 +            CopyUnixThreadSource
   1.226          fi
   1.227          # Set up files for the timer library
   1.228          if test x$enable_timers = xyes; then
   1.229 @@ -1759,18 +1782,7 @@
   1.230          fi
   1.231          # Set up files for the thread library
   1.232          if test x$enable_threads = xyes; then
   1.233 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.234 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.235 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.236 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.237 -            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
   1.238 -                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.239 -            else
   1.240 -                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.241 -            fi
   1.242 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.243 -            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.244 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.245 +            CopyUnixThreadSource
   1.246          fi
   1.247          # Set up files for the timer library
   1.248          if test x$enable_timers = xyes; then
   1.249 @@ -1813,18 +1825,7 @@
   1.250          fi
   1.251          # Set up files for the thread library
   1.252          if test x$enable_threads = xyes; then
   1.253 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.254 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.255 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.256 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.257 -            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
   1.258 -                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.259 -            else
   1.260 -                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.261 -            fi
   1.262 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.263 -            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.264 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.265 +            CopyUnixThreadSource
   1.266          fi
   1.267          # Set up files for the timer library
   1.268          if test x$enable_timers = xyes; then
   1.269 @@ -1868,14 +1869,7 @@
   1.270          fi
   1.271          # Set up files for the thread library
   1.272          if test x$enable_threads = xyes; then
   1.273 -            COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
   1.274 -            COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
   1.275 -            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
   1.276 -            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
   1.277 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.278 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.279 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
   1.280 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.281 +            CopyUnixThreadSource
   1.282          fi
   1.283          # Set up files for the timer library
   1.284          if test x$enable_timers = xyes; then
   1.285 @@ -1918,14 +1912,7 @@
   1.286          fi
   1.287          # Set up files for the thread library
   1.288          if test x$enable_threads = xyes; then
   1.289 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.290 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.291 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.292 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.293 -            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.294 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.295 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
   1.296 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.297 +            CopyUnixThreadSource
   1.298          fi
   1.299          # Set up files for the timer library
   1.300          if test x$enable_timers = xyes; then
   1.301 @@ -1966,19 +1953,8 @@
   1.302          fi
   1.303          # Set up files for the thread library
   1.304          if test x$enable_threads = xyes; then
   1.305 -            if test x$use_pthreads = xyes; then
   1.306 -                COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.307 -                COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.308 -                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.309 -                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.310 -                if test x$have_pthread_sem != xyes; then
   1.311 -                    COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.312 -                else
   1.313 -                    COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.314 -                fi
   1.315 -                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.316 -                COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.317 -                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.318 +            if test x$use_pthreads = xyes -o x$use_pth = xyes; then
   1.319 +                CopyUnixThreadSource
   1.320              else
   1.321                  COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
   1.322                  COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
   1.323 @@ -2029,14 +2005,7 @@
   1.324          fi
   1.325          # Set up files for the thread library
   1.326          if test x$enable_threads = xyes; then
   1.327 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.328 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.329 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.330 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.331 -            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.332 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.333 -            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.334 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.335 +            CopyUnixThreadSource
   1.336          fi
   1.337          # Set up files for the timer library
   1.338          if test x$enable_timers = xyes; then
   1.339 @@ -2075,14 +2044,7 @@
   1.340          fi
   1.341          # Set up files for the thread library
   1.342          if test x$enable_threads = xyes; then
   1.343 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.344 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.345 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.346 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.347 -            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.348 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.349 -            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.350 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.351 +            CopyUnixThreadSource
   1.352          fi
   1.353          # Set up files for the timer library
   1.354          if test x$enable_timers = xyes; then
   1.355 @@ -2122,14 +2084,7 @@
   1.356          fi
   1.357          # Set up files for the thread library
   1.358          if test x$enable_threads = xyes; then
   1.359 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.360 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.361 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.362 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.363 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.364 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.365 -            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.366 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.367 +            CopyUnixThreadSource
   1.368          fi
   1.369          # Set up files for the timer library
   1.370          if test x$enable_timers = xyes; then
   1.371 @@ -2168,14 +2123,7 @@
   1.372          fi
   1.373          # Set up files for the thread library
   1.374          if test x$enable_threads = xyes; then
   1.375 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.376 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.377 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.378 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.379 -            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.380 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.381 -            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
   1.382 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.383 +            CopyUnixThreadSource
   1.384          fi
   1.385          # Set up files for the timer library
   1.386          if test x$enable_timers = xyes; then
   1.387 @@ -2369,18 +2317,7 @@
   1.388          fi
   1.389          # Set up files for the thread library
   1.390          if test x$enable_threads = xyes; then
   1.391 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
   1.392 -            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.393 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.394 -            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.395 -            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
   1.396 -                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.397 -            else
   1.398 -                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.399 -            fi
   1.400 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.401 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
   1.402 -            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.403 +            CopyUnixThreadSource
   1.404          fi
   1.405          # Set up files for the timer library
   1.406          if test x$enable_timers = xyes; then
   1.407 @@ -2422,23 +2359,7 @@
   1.408          fi
   1.409          # Set up files for the thread library
   1.410          if test x$enable_threads = xyes; then
   1.411 -            if test x$enable_pth = xyes; then
   1.412 -                COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
   1.413 -                COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
   1.414 -                COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
   1.415 -                COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
   1.416 -                COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
   1.417 -                COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
   1.418 -            else
   1.419 -                COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
   1.420 -                COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
   1.421 -                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
   1.422 -                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
   1.423 -                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
   1.424 -                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
   1.425 -            fi
   1.426 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.427 -            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
   1.428 +            CopyUnixThreadSource
   1.429          fi
   1.430          # Set up files for the timer library
   1.431          if test x$enable_timers = xyes; then