📄 configure.in
字号:
;; *-*-qnx*) pthread_cflags="" pthread_lib="" ;; *) pthread_cflags="-D_REENTRANT" pthread_lib="-lpthread" ;; esac if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then # Save the original compiler flags and libraries ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" # Add the pthread compiler flags and libraries CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib" # Check to see if we have pthread support on this system AC_MSG_CHECKING(for pthreads) use_pthreads=no AC_TRY_LINK([ #include <pthread.h> ],[ pthread_attr_t type; pthread_attr_init(&type); ],[ use_pthreads=yes ]) AC_MSG_RESULT($use_pthreads) # Restore the compiler flags and libraries CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs" # Do futher testing if we have pthread support... if test x$use_pthreads = xyes; then CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS" SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags" SDL_LIBS="$SDL_LIBS $pthread_lib" # Check to see if recursive mutexes are available AC_MSG_CHECKING(for recursive mutexes) has_recursive_mutexes=no AC_TRY_LINK([ #include <pthread.h> ],[ pthread_mutexattr_t attr; #if defined(linux) && !(defined(__arm__) && defined(QWS)) pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); #else pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); #endif ],[ has_recursive_mutexes=yes ]) # Some systems have broken recursive mutex implementations case "$target" in *-*-darwin*) has_recursive_mutexes=no ;; *-*-solaris*) has_recursive_mutexes=no ;; esac AC_MSG_RESULT($has_recursive_mutexes) if test x$has_recursive_mutexes != xyes; then CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX" fi # Check to see if pthread semaphore support is missing if test x$enable_pthread_sem = xyes; then AC_MSG_CHECKING(for pthread semaphores) have_pthread_sem=no AC_TRY_COMPILE([ #include <pthread.h> #include <semaphore.h> ],[ ],[ have_pthread_sem=yes ]) AC_MSG_RESULT($have_pthread_sem) fi # Check to see if this is broken glibc 2.0 pthreads case "$target" in *-*-linux*) AC_MSG_CHECKING(for broken glibc 2.0 pthreads) glibc20_pthreads=no AC_TRY_COMPILE([ #include <features.h> #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0) #warning Working around a bug in glibc 2.0 pthreads #else #error pthread implementation okay #endif /* glibc 2.0 */ ],[ ],[ glibc20_pthreads=yes ]) AC_MSG_RESULT($glibc20_pthreads) esac fi fi AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h) have_semun=no AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/sem.h> ],[ union semun t; ],[ have_semun=yes ]) AC_MSG_RESULT($have_semun) if test x$have_semun = xyes; then CFLAGS="$CFLAGS -DHAVE_SEMUN" fi # See if we can use GNU Pth or clone() on Linux directly if test x$enable_threads = xyes -a x$use_pthreads != xyes; then CheckPTH if test x$use_pth != xyes; then case "$target" in *-*-linux*) use_clone=yes ;; esac fi fi}# Note that we need to have either semaphores or to have mutexes and# condition variables to implement all thread synchronization primitivesCopyUnixThreadSource(){ if test x$use_pthreads = xyes -o x$use_clone = xyes; then # Basic thread creation functions COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c) if test x$use_clone = xyes; then COPY_ARCH_SRC(src/thread, linux, clone.S) fi COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h) # Semaphores # We can fake these with mutexes and condition variables if necessary if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c) else COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c) fi COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) # Mutexes # We can fake these with semaphores if necessary case "$target" in *-*-bsdi*) COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c) COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) ;; *) if test x$glibc20_pthreads = xyes; then COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c) COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h) else COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c) COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h) fi ;; esac # Condition variables # We can fake these with semaphores and mutexes if necessary if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c) else COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c) fi COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h) elif test x$use_pth = xyes; then COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c) COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h) COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c) COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h) COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c) COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h) COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c) COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) else AC_MSG_ERROR([*** No thread support detected ]) fi}dnl Determine whether the compiler can produce Win32 executablesCheckWIN32(){ AC_MSG_CHECKING(Win32 compiler) have_win32_gcc=no AC_TRY_COMPILE([ #include <windows.h> ],[ ],[ have_win32_gcc=yes ]) AC_MSG_RESULT($have_win32_gcc) if test x$have_win32_gcc != xyes; then AC_MSG_ERROR([*** Your compiler ($CC) does not produce Win32 executables! ]) fi dnl See if the user wants to redirect standard output to files AC_ARG_ENABLE(stdio-redirect,[ --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]], , enable_stdio_redirect=yes) if test x$enable_stdio_redirect != xyes; then CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT" fi}dnl Find the DirectX includes and librariesCheckDIRECTX(){ AC_ARG_ENABLE(directx,[ --enable-directx use DirectX for Win32 audio/video [default=yes]], , enable_directx=yes) if test x$enable_directx = xyes; then AC_MSG_CHECKING(for DirectX headers and libraries) use_directx=no AC_TRY_COMPILE([ #include "src/video/windx5/directx.h" ],[ ],[ use_directx=yes ]) AC_MSG_RESULT($use_directx) fi CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon" SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm" VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon" VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la" # Enable the DIB driver CFLAGS="$CFLAGS -DENABLE_WINDIB" VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib" VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la" # See if we should enable the DirectX driver if test x$use_directx = xyes; then CFLAGS="$CFLAGS -DENABLE_DIRECTX" SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid" VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5" VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la" fi}dnl Set up the BWindow video driver on BeOSCheckBWINDOW(){ CFLAGS="$CFLAGS -DENABLE_BWINDOW" VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow" VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"}dnl Set up the QTopia video driver if enabledCheckQtopia(){ AC_ARG_ENABLE(video-qtopia,[ --enable-video-qtopia use Qtopia video driver [default=no]], , enable_video_qtopia=no) if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then AC_MSG_CHECKING(for Qtopia support) video_qtopia=no AC_LANG_CPLUSPLUS OLD_CXX="$CXXFLAGS" CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG" AC_TRY_COMPILE([ #include <qpe/qpeapplication.h> ],[ ],[ video_qtopia=yes ]) CXXFLAGS="$OLD_CXX" AC_MSG_RESULT($video_qtopia) if test x$video_qtopia = xyes; then CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions" SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte" VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia" VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la" fi AC_LANG_C fi}dnl Set up the PicoGUI video driver if enabledCheckPicoGUI(){ AC_ARG_ENABLE(video-picogui,[ --enable-video-picogui use PicoGUI video driver [default=no]], , enable_video_picogui=no) if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then AC_MSG_CHECKING(for PicoGUI support) video_picogui=no AC_TRY_COMPILE([ #include <picogui.h> ],[ ],[ video_picogui=yes ]) AC_MSG_RESULT($video_picogui) if test x$video_picogui = xyes; then SDL_LIBS="$SDL_LIBS -lpgui" CFLAGS="$CFLAGS -DENABLE_PICOGUI" VIDEO_SUBDIRS="$VIDEO_SUBDIRS picogui" VIDEO_DRIVERS="$VIDEO_DRIVERS picogui/libvideo_picogui.la" fi AC_LANG_C fi}dnl Set up the Mac toolbox video driver for Mac OS 7-9CheckTOOLBOX(){ VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon" VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la" VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom" VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"}dnl Set up the Mac toolbox video driver for Mac OS XCheckCARBON(){ # "MACOSX" is not an official definition, but it's commonly # accepted as a way to differentiate between what runs on X # and what runs on older Macs - while in theory "Carbon" defns # are consistent between the two, in practice Carbon is still # changing. -sts Aug 2000 mac_autoconf_target_workaround="MAC" CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \ -fpascal-strings -DENABLE_TOOLBOX -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/maccommon -I\$(top_srcdir)/src/video/macrom -I\$(top_srcdir)/src/video/macdsp" VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon" VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la" VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom" VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"}dnl Set up the Mac toolbox video driver for Mac OS XCheckQUARTZ(){ # "MACOSX" is not an official definition, but it's commonly # accepted as a way to differentiate between what runs on X # and what runs on older Macs - while in theory "Carbon" defns # are consistent between the two, in practice Carbon is still # changing. -sts Aug 2000 mac_autoconf_target_workaround="MAC" CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \ -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \ -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz" VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz" VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"}dnl Check for the dlfcn.h interface for dynamically loading objectsCheckDLOPEN(){ AC_ARG_ENABLE(dlopen,[ --enable-dlopen use dlopen for shared object loading [default=no]], , enable_dlopen=no) if test x$enable_dlopen = xyes; then AC_MSG_CHECKING(for dlopen) use_dlopen=no AC_TRY_COMPILE([ #include <dlfcn.h> ],[ ],[ use_dlopen=yes ]) AC_MSG_RESULT($use_dlopen) if test x$use_dlopen = xyes; then CFLAGS="$CFLAGS -DUSE_DLOPEN" AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl") fi fi}dnl Check for the usbhid(3) library on *BSDCheckUSBHID(){ if test x$enable_joystick = xyes; then have_libusbhid=no have_libusb=no AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes) AC_CHECK_LIB(usb, hid_init, have_libusb=yes) if test x$have_libusbhid = xyes; then SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -