configure.in
changeset 415 104f32d04cd1
parent 413 2a1486305412
child 419 3d8ad40ef561
     1.1 --- a/configure.in	Thu Jun 13 17:52:43 2002 +0000
     1.2 +++ b/configure.in	Thu Jun 13 21:36:25 2002 +0000
     1.3 @@ -1138,8 +1138,6 @@
     1.4      AC_ARG_ENABLE(pthread-sem,
     1.5  [  --enable-pthread-sem    use pthread semaphores [default=yes]],
     1.6                    , enable_pthread_sem=yes)
     1.7 -    ac_save_cflags="$CFLAGS"
     1.8 -    ac_save_libs="$LIBS"
     1.9      case "$target" in
    1.10          *-*-bsdi*)
    1.11              pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
    1.12 @@ -1187,9 +1185,12 @@
    1.13              pthread_lib="-lpthread"
    1.14              ;;
    1.15      esac
    1.16 -    CFLAGS="$CFLAGS $pthread_cflags"
    1.17 -    LIBS="$LIBS $pthread_lib"
    1.18      if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
    1.19 +        # Save the original compiler flags and libraries
    1.20 +        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
    1.21 +        # Add the pthread compiler flags and libraries
    1.22 +        CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
    1.23 +        # Check to see if we have pthread support on this system
    1.24          AC_MSG_CHECKING(for pthreads)
    1.25          use_pthreads=no
    1.26          AC_TRY_LINK([
    1.27 @@ -1201,6 +1202,9 @@
    1.28          use_pthreads=yes
    1.29          ])
    1.30          AC_MSG_RESULT($use_pthreads)
    1.31 +        # Restore the compiler flags and libraries
    1.32 +        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
    1.33 +        # Do futher testing if we have pthread support...
    1.34          if test x$use_pthreads = xyes; then
    1.35              CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
    1.36              SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
    1.37 @@ -1269,8 +1273,6 @@
    1.38              esac
    1.39          fi
    1.40      fi
    1.41 -    CFLAGS="$ac_save_cflags"
    1.42 -    LIBS="$ac_save_libs"
    1.43  
    1.44      AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
    1.45      have_semun=no