📄 configure.in
字号:
dnl Process this file with autoconf to produce a configure script.AC_INIT(README)dnl Set various version strings - taken gratefully from the GTk sources## Making releases:# Edit include/SDL/SDL_version.h and change the version, then:# SDL_MICRO_VERSION += 1;# SDL_INTERFACE_AGE += 1;# SDL_BINARY_AGE += 1;# if any functions have been added, set SDL_INTERFACE_AGE to 0.# if backwards compatibility has been broken,# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.#SDL_MAJOR_VERSION=1SDL_MINOR_VERSION=2SDL_MICRO_VERSION=5SDL_INTERFACE_AGE=5SDL_BINARY_AGE=5SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSIONAC_SUBST(SDL_MAJOR_VERSION)AC_SUBST(SDL_MINOR_VERSION)AC_SUBST(SDL_MICRO_VERSION)AC_SUBST(SDL_INTERFACE_AGE)AC_SUBST(SDL_BINARY_AGE)AC_SUBST(SDL_VERSION)# libtool versioningLT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSIONLT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`LT_REVISION=$SDL_INTERFACE_AGELT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`AC_SUBST(LT_RELEASE)AC_SUBST(LT_CURRENT)AC_SUBST(LT_REVISION)AC_SUBST(LT_AGE)dnl Detect the canonical host and target build environmentAC_CANONICAL_HOSTAC_CANONICAL_TARGETdnl Setup for automakeAM_INIT_AUTOMAKE(SDL, $SDL_VERSION)dnl Check for toolsAC_LIBTOOL_WIN32_DLLAM_PROG_LIBTOOLAC_PROG_MAKE_SETAC_PROG_CCAC_C_INLINEAC_C_CONSTAC_PROG_CXXAC_PROG_INSTALLAC_FUNC_ALLOCAASFLAGS=""AC_SUBST(ASFLAGS)CCAS="$CC"AC_SUBST(CCAS)CCASFLAGS=""AC_SUBST(CCASFLAGS)AM_CONDITIONAL([am__fastdepOBJC], false)dnl The alpha architecture needs special flags for binary portabilitycase "$target" in alpha*-*-linux*) if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall" fi ;;esacdnl Add compiler-specific optimization flagsdnl See if the user wants aggressive optimizations of the codeAC_ARG_ENABLE(debug,[ --enable-debug Disable aggressive optimizations [default=yes]], , enable_debug=yes)if test x$enable_debug != xyes; then if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -fexpensive-optimizations" # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2 # CFLAGS="$CFLAGS -fomit-frame-pointer" fi case "$target" in i486-*-*) if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -march=486" fi ;; i?86-*-*) if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro" fi ;; *-*-osf*) if test x$ac_cv_prog_gcc != xyes; then CFLAGS="-g3 -fast -arch host" fi ;; esacfidnl Add verbose warnings by default, and allow ANSI compliance checkingAC_ARG_ENABLE(strict-ansi,[ --enable-strict-ansi Enable strict ANSI compliance build [default=no]], , enable_strict_ansi=no)if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -Wall" if test x$enable_strict_ansi = xyes; then CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE" fifidnl Initialize the compiler and linker flags for SDL applicationsSDL_CFLAGS=""SDL_LIBS="-lSDL"dnl Add the math library for the new gamma correction supportcase "$target" in *-*-cygwin* | *-*-mingw32*) MATHLIB="" ;; *-*-beos*) MATHLIB="" ;; *-*-darwin*) MATHLIB="" ;; *) MATHLIB="-lm" ;;esacSYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"dnl Enable/disable various subsystems of the SDL libraryAC_ARG_ENABLE(audio,[ --enable-audio Enable the audio subsystem [default=yes]], , enable_audio=yes)if test x$enable_audio = xyes; then SDL_EXTRADIRS="$SDL_EXTRADIRS audio" SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"else CFLAGS="$CFLAGS -DDISABLE_AUDIO"fiAC_ARG_ENABLE(video,[ --enable-video Enable the video subsystem [default=yes]], , enable_video=yes)if test x$enable_video = xyes; then SDL_EXTRADIRS="$SDL_EXTRADIRS video" SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"else CFLAGS="$CFLAGS -DDISABLE_VIDEO"fiAC_ARG_ENABLE(events,[ --enable-events Enable the events subsystem [default=yes]], , enable_events=yes)if test x$enable_video = xyes -a x$enable_events = xyes; then SDL_EXTRADIRS="$SDL_EXTRADIRS events" SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"else CFLAGS="$CFLAGS -DDISABLE_EVENTS"fiAC_ARG_ENABLE(joystick,[ --enable-joystick Enable the joystick subsystem [default=yes]], , enable_joystick=yes)if test x$enable_joystick = xyes; then SDL_EXTRADIRS="$SDL_EXTRADIRS joystick" SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"else CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"fiAC_ARG_ENABLE(cdrom,[ --enable-cdrom Enable the cdrom subsystem [default=yes]], , enable_cdrom=yes)if test x$enable_cdrom = xyes; then SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom" SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"else CFLAGS="$CFLAGS -DDISABLE_CDROM"fiAC_ARG_ENABLE(threads,[ --enable-threads Enable the threading subsystem [default=yes]], , enable_threads=yes)SDL_EXTRADIRS="$SDL_EXTRADIRS thread"SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"if test x$enable_threads != xyes; then CFLAGS="$CFLAGS -DDISABLE_THREADS" COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c) COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h) COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c) COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h) COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c) COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c) COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)fiAC_ARG_ENABLE(timers,[ --enable-timers Enable the timer subsystem [default=yes]], , enable_timers=yes)if test x$enable_timers = xyes; then SDL_EXTRADIRS="$SDL_EXTRADIRS timer" SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"else CFLAGS="$CFLAGS -DDISABLE_TIMERS"fiAC_ARG_ENABLE(endian,[ --enable-endian Enable the endian subsystem [default=yes]], , enable_endian=yes)if test x$enable_endian = xyes; then SDL_EXTRADIRS="$SDL_EXTRADIRS endian" SDL_EXTRALIBS="$SDL_EXTRALIBS endian/libendian.la"else CFLAGS="$CFLAGS -DDISABLE_ENDIAN"fiAC_ARG_ENABLE(file,[ --enable-file Enable the file subsystem [default=yes]], , enable_file=yes)if test x$enable_file = xyes; then SDL_EXTRADIRS="$SDL_EXTRADIRS file" SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"else CFLAGS="$CFLAGS -DDISABLE_FILE"fidnl See if the OSS audio interface is supportedCheckOSS(){ AC_ARG_ENABLE(oss,[ --enable-oss support the OSS audio API [default=yes]], , enable_oss=yes) if test x$enable_audio = xyes -a x$enable_oss = xyes; then AC_MSG_CHECKING(for OSS audio support) have_oss=no if test x$have_oss != xyes; then AC_TRY_COMPILE([ #include <sys/soundcard.h> ],[ int arg = SNDCTL_DSP_SETFRAGMENT; ],[ have_oss=yes ]) fi if test x$have_oss != xyes; then AC_TRY_COMPILE([ #include <soundcard.h> ],[ int arg = SNDCTL_DSP_SETFRAGMENT; ],[ have_oss=yes CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H" ]) fi AC_MSG_RESULT($have_oss) if test x$have_oss = xyes; then CFLAGS="$CFLAGS -DOSS_SUPPORT" AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp" AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la" AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma" AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la" fi fi}dnl See if the ALSA audio interface is supportedCheckALSA(){ AC_ARG_ENABLE(alsa,[ --enable-alsa support the ALSA audio API [default=yes]], , enable_alsa=yes) if test x$enable_audio = xyes -a x$enable_alsa = xyes; then AC_MSG_CHECKING(for ALSA audio support) have_alsa=no AC_TRY_COMPILE([ #include <alsa/asoundlib.h> ],[ #if SND_LIB_VERSION < ((0<<16)|(9<<8)|0) #error Your version of ALSA is too old #endif snd_pcm_t *pcm_handle; ],[ AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes) ]) if test x$have_alsa = xyes; then CFLAGS="$CFLAGS -DALSA_SUPPORT" SYSTEM_LIBS="$SYSTEM_LIBS -lasound" AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa" AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la" else AC_MSG_RESULT($have_alsa) fi fi}dnl Check whether we want to use IRIX 6.5+ native audio or notCheckDMEDIA(){ if test x$enable_audio = xyes; then AC_MSG_CHECKING(for dmedia audio support) have_dmedia=no AC_TRY_COMPILE([ #include <dmedia/audio.h> ],[ ALport audio_port; ],[ have_dmedia=yes ]) # Set up files for the audio library if test x$have_dmedia = xyes; then CFLAGS="$CFLAGS -DDMEDIA_SUPPORT" AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia" AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la" SYSTEM_LIBS="$SYSTEM_LIBS -laudio" fi fi}dnl Find the ESD includes and librariesCheckESD(){ AC_ARG_ENABLE(esd,[ --enable-esd support the Enlightened Sound Daemon [default=yes]], , enable_esd=yes) if test x$enable_audio = xyes -a x$enable_esd = xyes; then use_esd=no AM_PATH_ESD(0.2.8, use_esd=yes) if test x$use_esd = xyes; then AC_ARG_ENABLE(esd-shared,[ --enable-esd-shared dynamically load ESD audio support [default=no]], , enable_esd_shared=no) esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'` esd_lib=`ls $esd_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'` echo "-- $esd_lib_spec -> $esd_lib" if test x$enable_dlopen != xyes && \ test x$enable_esd_shared = xyes; then AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option]) fi if test x$enable_dlopen = xyes && \ test x$enable_esd_shared = xyes && test x$esd_lib != x; then CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS" AC_SUBST(esd_lib) else CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS" SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS" fi AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd" AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la" fi fi}CheckARTSC(){ AC_ARG_ENABLE(arts,[ --enable-arts support the Analog Real Time Synthesizer [default=yes]], , enable_arts=yes) if test x$enable_audio = xyes -a x$enable_arts = xyes; then AC_PATH_PROG(ARTSCCONFIG, artsc-config) if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then : # arts isn't installed else ARTSC_CFLAGS=`$ARTSCCONFIG --cflags` ARTSC_LIBS=`$ARTSCCONFIG --libs` AC_MSG_CHECKING(for aRts development environment) audio_arts=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $ARTSC_CFLAGS" AC_TRY_COMPILE([ #include <artsc.h> ],[ arts_stream_t stream; ],[ audio_arts=yes ]) CFLAGS="$save_CFLAGS" AC_MSG_RESULT($audio_arts) if test x$audio_arts = xyes; then AC_ARG_ENABLE(arts-shared,[ --enable-arts-shared dynamically load aRts audio support [default=no]], , enable_arts_shared=no) arts_lib_spec=`echo $ARTSC_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libartsc.so.*/'` arts_lib=`ls $arts_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'` echo "-- $arts_lib_spec -> $arts_lib" if test x$enable_dlopen != xyes && \ test x$enable_arts_shared = xyes; then AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option]) fi if test x$enable_dlopen = xyes && \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -