comparison configure.in @ 415:104f32d04cd1

Fixed building with pthreads and the pth library
author Sam Lantinga <slouken@libsdl.org>
date Thu, 13 Jun 2002 21:36:25 +0000
parents 2a1486305412
children 3d8ad40ef561
comparison
equal deleted inserted replaced
414:dd56447ef292 415:104f32d04cd1
1136 , enable_pthreads=yes) 1136 , enable_pthreads=yes)
1137 dnl This is used on Linux for glibc binary compatibility (Doh!) 1137 dnl This is used on Linux for glibc binary compatibility (Doh!)
1138 AC_ARG_ENABLE(pthread-sem, 1138 AC_ARG_ENABLE(pthread-sem,
1139 [ --enable-pthread-sem use pthread semaphores [default=yes]], 1139 [ --enable-pthread-sem use pthread semaphores [default=yes]],
1140 , enable_pthread_sem=yes) 1140 , enable_pthread_sem=yes)
1141 ac_save_cflags="$CFLAGS"
1142 ac_save_libs="$LIBS"
1143 case "$target" in 1141 case "$target" in
1144 *-*-bsdi*) 1142 *-*-bsdi*)
1145 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" 1143 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1146 pthread_lib="" 1144 pthread_lib=""
1147 ;; 1145 ;;
1185 *) 1183 *)
1186 pthread_cflags="-D_REENTRANT" 1184 pthread_cflags="-D_REENTRANT"
1187 pthread_lib="-lpthread" 1185 pthread_lib="-lpthread"
1188 ;; 1186 ;;
1189 esac 1187 esac
1190 CFLAGS="$CFLAGS $pthread_cflags"
1191 LIBS="$LIBS $pthread_lib"
1192 if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then 1188 if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
1189 # Save the original compiler flags and libraries
1190 ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
1191 # Add the pthread compiler flags and libraries
1192 CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
1193 # Check to see if we have pthread support on this system
1193 AC_MSG_CHECKING(for pthreads) 1194 AC_MSG_CHECKING(for pthreads)
1194 use_pthreads=no 1195 use_pthreads=no
1195 AC_TRY_LINK([ 1196 AC_TRY_LINK([
1196 #include <pthread.h> 1197 #include <pthread.h>
1197 ],[ 1198 ],[
1199 pthread_attr_init(&type); 1200 pthread_attr_init(&type);
1200 ],[ 1201 ],[
1201 use_pthreads=yes 1202 use_pthreads=yes
1202 ]) 1203 ])
1203 AC_MSG_RESULT($use_pthreads) 1204 AC_MSG_RESULT($use_pthreads)
1205 # Restore the compiler flags and libraries
1206 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
1207 # Do futher testing if we have pthread support...
1204 if test x$use_pthreads = xyes; then 1208 if test x$use_pthreads = xyes; then
1205 CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS" 1209 CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
1206 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags" 1210 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
1207 SDL_LIBS="$SDL_LIBS $pthread_lib" 1211 SDL_LIBS="$SDL_LIBS $pthread_lib"
1208 1212
1267 ]) 1271 ])
1268 AC_MSG_RESULT($glibc20_pthreads) 1272 AC_MSG_RESULT($glibc20_pthreads)
1269 esac 1273 esac
1270 fi 1274 fi
1271 fi 1275 fi
1272 CFLAGS="$ac_save_cflags"
1273 LIBS="$ac_save_libs"
1274 1276
1275 AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h) 1277 AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
1276 have_semun=no 1278 have_semun=no
1277 AC_TRY_COMPILE([ 1279 AC_TRY_COMPILE([
1278 #include <sys/types.h> 1280 #include <sys/types.h>