📄 configure.in
字号:
dnl Init.AC_INIT(FripTV,0.18)AC_PREREQ(2.50)AC_CONFIG_SRCDIR(README)dnl Detect the canonical host and target build environmentAC_CANONICAL_HOSTAC_CANONICAL_TARGETdnl Setup for automakeAM_INIT_AUTOMAKEAM_CONFIG_HEADER(config.h)dnl Checks for programs.AC_PROG_MAKE_SETAC_PROG_CCAC_PROG_CPPAC_PROG_CXXAC_PROG_INSTALLAC_PROG_RANLIBdnl Check for SDLSDL_VERSION=1.2.10AM_PATH_SDL($SDL_VERSION, :, AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))LIBS="$LIBS $SDL_LIBS"LDFLAGS="$LDFLAGS -L/usr/lib"CPPFLAGS="$CPPFLAGS $SDL_CFLAGS -I/usr/include -Wno-deprecated-declarations"#Check if SDL is patchedAH_TEMPLATE(SDL_IS_PATCHED,[Define to 1 if SDL is patched])AC_MSG_CHECKING(whether SDL is patched)AC_LINK_IFELSE([#include "SDL.h" int main(int argc, char **argv) { SDL_AudioDelay();}],,sdl_is_patched=no)if test x$sdl_is_patched = xno ; then AC_MSG_RESULT(no) AC_MSG_WARN([*** SDL is not patched.For best performance apply SDL patch from FripTV patch directory and recompile SDL])else AC_MSG_RESULT(yes) AC_DEFINE(SDL_IS_PATCHED,1)fidnl Checks for header files.dnl Checks for typedefs, structures, and compiler characteristics.AC_C_CONSTAC_C_INLINEAC_TYPE_SIZE_TAC_STRUCT_TMAC_CHECK_SIZEOF(unsigned char)AC_CHECK_SIZEOF(unsigned short)AC_CHECK_SIZEOF(unsigned int)AC_CHECK_SIZEOF(unsigned long)AC_CHECK_SIZEOF(unsigned long long)AC_CHECK_SIZEOF(int *)AC_C99_FUNC_LRINTAC_C99_FUNC_LRINTFdnl Checks for libraries.AC_CHECK_HEADER(mad.h,have_mad_h=yes,)AC_CHECK_LIB(mad, mad_stream_init, have_mad_lib=yes, ,)if test x$have_mad_lib = xyes -a x$have_mad_h = xyes ; then LIBS="$LIBS -lmad"else AC_MSG_ERROR([*** MAD library not found!])fiAC_CHECK_HEADER(samplerate.h,have_samplerate_h=yes,)AC_CHECK_LIB(samplerate, src_new, have_samplerate_lib=yes, ,)if test x$have_samplerate_lib = xyes -a x$have_samplerate_h = xyes ; then LIBS="$LIBS -lsamplerate"else AC_MSG_ERROR([*** SRC library not found!])fiAH_TEMPLATE(C_HAS_LIBAVCODEC,[Define to use libavcodec])AC_ARG_ENABLE(libavcodec,AC_HELP_STRING([--disable-libavcodec],[Disable libavcodec support]),,[ AC_CHECK_HEADER(ffmpeg/avcodec.h,have_avcodec_h=yes,) AC_CHECK_LIB(avcodec, avcodec_init, have_avcodec_lib=yes, ,) AC_CHECK_LIB(avutil, av_free, have_avutil_lib=yes, ,) AC_MSG_CHECKING(whether libavcodec will be enabled) if test x$have_avcodec_lib = xyes -a x$have_avcodec_h = xyes -a x$have_avutil_lib = xyes ; then AC_MSG_RESULT(yes) AC_DEFINE(C_HAS_LIBAVCODEC,1) LIBS="$LIBS -lavcodec -lavutil" have_libavcodec=yes else AC_MSG_RESULT(no) AC_MSG_WARN([libavcodec support disabled]) fi],)AH_TEMPLATE(C_HAS_LIBPOSTPROC,[Define to use libpostproc])AC_ARG_ENABLE(libavcodec,AC_HELP_STRING([--disable-libpostproc],[Disable libpostproc support]),,[ AC_CHECK_HEADER(postproc/postprocess.h,have_postprocess_h=yes,) AC_CHECK_LIB(postproc, pp_get_mode_by_name_and_quality, have_postproc_lib=yes, ,) if test x$have_libavcodec = x ; then AC_CHECK_LIB(avutil, av_free, have_avutil_lib=yes, ,) fi AC_MSG_CHECKING(whether libpostproc will be enabled) if test x$have_postproc_lib = xyes -a x$have_postprocess_h = xyes -a x$have_avutil_lib = xyes ; then AC_MSG_RESULT(yes) AC_DEFINE(C_HAS_LIBPOSTPROC,1) if test x$have_libavcodec = xyes ; then LIBS="$LIBS -lpostproc" else LIBS="$LIBS -lpostproc -lavutil" fi else AC_MSG_RESULT(no) AC_MSG_WARN([libpostproc support disabled]) fi],)AH_TEMPLATE(C_HAS_DIRECTSHOW,[Define to use directshow])AC_ARG_ENABLE(directshow,AC_HELP_STRING([--disable-directshow],[Disable directshow support]),,disable_directshow=no)#Check if the compiler supports __builtin_expect#Switch language to c++AC_LANG_PUSH(C++)AH_TEMPLATE([C_HAS_BUILTIN_EXPECT],[Determines if the compilers supports __builtin_expect for branch prediction.])AC_MSG_CHECKING(if compiler allows __builtin_expect)AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[int x=10;if( __builtin_expect ((x==1),0) ) ;]])], [ AC_MSG_RESULT(yes); AC_DEFINE(C_HAS_BUILTIN_EXPECT)],AC_MSG_RESULT(no))#switch language backAC_LANG_POP(C++)#Check for big endian machine, should #define WORDS_BIGENDIAN if soAC_C_BIGENDIAN#Features to enable/disableAC_ARG_ENABLE(debug,AC_HELP_STRING([--enable-debug],[Enable debug logging]),,enable_debug=no)if test x$enable_debug = xno ; then CPPFLAGS="$CPPFLAGS -DRELEASE"fiAC_ARG_ENABLE(optimizations,AC_HELP_STRING([--disable-optimizations],[Disable processor optimizations]),,disable_optimizations=no)dnl SetpriorityAH_TEMPLATE(C_SET_PRIORITY,[Define to 1 if you have setpriority support])AC_MSG_CHECKING(for setpriority support)AC_LINK_IFELSE([#include <sys/resource.h>int main(int argc,char * argv[]) { return setpriority (PRIO_PROCESS, 0,PRIO_MIN+PRIO_MAX);};],AC_MSG_RESULT(yes);AC_DEFINE(C_SET_PRIORITY,1),AC_MSG_RESULT(no))dnl wxWidgets checkAM_OPTIONS_WXCONFIGAH_TEMPLATE(C_HAVE_WXGUI,[Define to 1 if you have WxWidgets])AC_ARG_ENABLE(wxgui,AC_HELP_STRING([--disable-wxgui],[Disable wxWidgets GUI]),,disable_wxgui=no)if test x$disable_wxgui = xno ; then AM_PATH_WXCONFIG(2.6.0, wxWin=1) AC_MSG_CHECKING(whether wxGUI will be enabled) if test "$wxWin" == 1; then CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" LIBS="$LIBS $WX_LIBS" AC_MSG_RESULT(yes) AC_DEFINE(C_HAVE_WXGUI,1) WX_INCLUDES="" for opt in $WX_CPPFLAGS ; do case "$opt" in -I*) WX_INCLUDES="$WX_INCLUDES $opt" ;; esac done AC_SUBST(WX_INCLUDES) else AC_MSG_RESULT(no) fifidnl OpenGL checkAH_TEMPLATE(C_OPENGL,[Define to 1 to use opengl display output support])AC_ARG_ENABLE(opengl,AC_HELP_STRING([--disable-opengl],[Disable opengl support]),,enable_opengl=yes)if test x$enable_opengl = xyes; thenAC_CHECK_LIB(GL, main, have_gl_lib=yes, have_gl_lib=no , )AC_CHECK_LIB(opengl32, main, have_opengl32_lib=yes,have_opengl32_lib=no , )AC_CHECK_HEADER(GL/gl.h, have_gl_h=yes , have_gl_h=no , )AC_MSG_CHECKING(whether opengl display output will be enabled)case "$target" in *-*-darwin*) AC_MSG_RESULT(yes) LIBS="$LIBS -framework OpenGL" AC_DEFINE(C_OPENGL,1) ;; *) if test x$have_gl_h = xyes -a x$have_gl_lib = xyes ; then AC_MSG_RESULT(yes) LIBS="$LIBS -lGL" AC_DEFINE(C_OPENGL,1) elif test x$have_gl_h = xyes -a x$have_opengl32_lib = xyes ; then AC_MSG_RESULT(yes) LIBS="$LIBS -lopengl32" AC_DEFINE(C_OPENGL,1) else AC_MSG_RESULT(no) fi ;;esacfidnl The target cpu checksAH_TEMPLATE(C_HOSTCPU,[The type of cpu this host has])AC_MSG_CHECKING(for target cpu type)case "$target_cpu" in x86_64 | amd64) AC_DEFINE(C_HOSTCPU,X86_64) AC_MSG_RESULT(x86-64 bit compatible) if test x$disable_optimizations = xno ; then CPPFLAGS="-fomit-frame-pointer -ffast-math -funroll-loops --param max-unrolled-insns=60 $CPPFLAGS" fi ;; i?86) AC_DEFINE(C_HOSTCPU,X86) AC_MSG_RESULT(x86 compatible) CPPFLAGS="$CPPFLAGS -mmmx -msse" if test x$disable_optimizations = xno ; then CPPFLAGS="-march=$target_cpu -fomit-frame-pointer -ffast-math -funroll-loops --param max-unrolled-insns=60 $CPPFLAGS" fi # compiling on x86_64 if test x$host_cpu = xx86_64 -o x$host_cpu = xamd64 ; then CPPFLAGS="-m32 $CPPFLAGS" LDFLAGS="-m32 $LDFLAGS" fi ;; *) AC_DEFINE(C_HOSTCPU,UNKOWN) AC_MSG_RESULT(unknown) ;;esacdnl Some host detection and actions for themcase "$target" in *-*-cygwin* | *-*-mingw32*) # enable directshow if test x$disable_directshow = xno ; then AC_DEFINE(C_HAS_DIRECTSHOW,1) fi AC_CHECK_HEADERS(ddraw.h) LIBS="$LIBS -lwsock32 -lole32" ;; *-*-darwin*) dnl We have a problem here: both MacOS X and Darwin report dnl the same signature "powerpc-apple-darwin*" - so we have dnl to do more to distinguish them. dnl For now I am lazy and do not add proper detection code. AC_DEFINE(MACOSX, 1, [Compiling on Mac OS X]) LIBS="$LIBS -framework AudioUnit" ;; *-*-linux-gnu*) AC_DEFINE(LINUX, 1, [Compiling on GNU/Linux]) ;;esacdnl Some stuff for the icon.case "$target" in *-*-cygwin* | *-*-mingw32*) dnl Some stuff for the ico AC_CHECK_TOOL(WINDRES, windres, :) ;; *) WINDRES=":" ;;esac AM_CONDITIONAL(HAVE_WINDRES, test "x$WINDRES" != "x:") AC_SUBST(WINDRES)AC_CONFIG_FILES([Makefiledeinterlace/Makefilelibdshow/Makefilelibmpeg2/Makefile])AC_OUTPUT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -