configure.ac
来自「Motion JPEG编解码器源代码」· AC 代码 · 共 599 行 · 第 1/2 页
AC
599 行
dnl (defines GTK_CFLAGS and GTK_LIBS)dnl ********************************************************************PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.4.0], have_gtk="true", have_gtk="false")AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xtrue)dnl ********************************************************************dnl Check for the SDL library (for software playback)dnl (defines SDL_CFLAGS and SDL_LIBS)dnl ********************************************************************AM_PATH_SDL(1.1.3, [have_sdl=true AC_DEFINE(HAVE_SDL, 1, [SDL library present]) ], [have_sdl=false])AM_CONDITIONAL(HAVE_SDL, test x$have_sdl = xtrue)dnl ********************************************************************dnl Test for MMX support if an IA32 platform. If on a PPC then look fordnl Altivec support. For the IA32 platform see if gcc understands inline dnl MMX instructions.dnldnl TODO: host = non intel, target = intel <blah> do the checks also?dnl Remember we are checking that the toolchain can generate thednl code, not whether the host can execute the code, thats donednl at run time with the exception of the SSE code.have_asm_mmx=falsehave_x86cpu=falsehave_altivec=falseAC_MSG_CHECKING([Architecture])case $host_cpu in i[[3-7]]86) AC_MSG_RESULT(IA32) AC_DEFINE(HAVE_X86CPU,1, [Compiling for x86 architecture CPU]) have_x86cpu=true PROGRAM_NOPIC="-fno-PIC" ;; x86_64*) AC_MSG_RESULT(x86_64) AC_DEFINE(HAVE_X86CPU,1, [Compiling for x86-64 architecture CPU]) have_x86cpu=true have_x86_64cpu=true PROGRAM_NOPIC="-fno-PIC" ;; powerpc | powerpc64) AC_MSG_RESULT(PowerPC) AC_DEFINE(HAVE_PPCCPU,1, [Compiling for PowerPC CPU]) have_ppccpu=true case $host in *-apple-darwin*) PROGRAM_NOPIC="-mdynamic-no-pic" # dynamic-no-pic is an Apple gcc option ;; *) PROGRAM_NOPIC="" ;; esac ;; *) AC_MSG_RESULT(unknown) PROGRAM_NOPIC="" ;;esacdnl This flag is used for PROGRAMS not SHARED LIBRARIES. PIC code is requireddnl for shared libraries but is slower than non-pic code. Compute bound dnl programs such as yuvdenoise and y4mspatialfilter can use this flag bydnl simply adding programname_CFLAGS=@PROGRAM_NOPIC@ to the Makefile.amAC_SUBST(PROGRAM_NOPIC)if test "$enable_simd_accel" != "false" -a "$enable_simd_accel" != "no"then if test x$have_x86cpu = xtrue then AC_MSG_CHECKING([if C compiler accepts inline MMX assembly]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__asm__ __volatile__("emms":::"memory");]])], [have_asm_mmx=true], [have_asm_mmx=false]) if test $have_asm_mmx = true; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi if test $have_asm_mmx = true; then AC_DEFINE(HAVE_ASM_MMX,1,[Inline MMX assembly accepted by C compiler]) fi fi if test x$have_ppccpu = xtrue then AC_MSG_CHECKING([compiler support for AltiVec]) cat > conftest.c <<EOF#ifdef HAVE_ALTIVEC_H#include <altivec.h>#endifint main() { union { vector signed int v; signed int i; } vi; vi.v = vec_splat_s32(1); return vi.i;}EOF ALTIVEC_CFLAGS="" if $CC -o conftest conftest.c >/dev/null 2>&1; then have_altivec=true elif $CC $CFLAGS -faltivec -o conftest conftest.c >/dev/null 2>&1; then # Mac OS X style have_altivec=true ALTIVEC_CFLAGS="-faltivec" elif $CC $CFLAGS -fvec -o conftest conftest.c >/dev/null 2>&1; then # Motorola style have_altivec=true ALTIVEC_CFLAGS="-fvec" elif $CC $CFLAGS -DHAVE_ALTIVEC_H=1 -maltivec -mabi=altivec -o conftest conftest.c >/dev/null 2>&1; then # gcc 3.1 style have_altivec=true ALTIVEC_CFLAGS="-DHAVE_ALTIVEC_H=1 -maltivec -mabi=altivec" fi rm -f conftest*; if test x$have_altivec = xtrue then # add -O3 flag ALTIVEC_CFLAGS="-O3 ${ALTIVEC_CFLAGS}" AC_MSG_RESULT(yes) AC_DEFINE(HAVE_ALTIVEC,1, [Inline PPC Altivec primitives available]) AC_SUBST(ALTIVEC_CFLAGS) else AC_MSG_RESULT(no) fi fifidnl *********************************************************************dnl For x86 and ppc machines check which code model we should use. This isdnl done with the helper script cpuinfo.sh because the logic to do the jobdnl correctly is complex and lengthy (about as long as the entire configure.acdnl file).if test x$have_x86cpu = xtrue -o x$have_ppccpu = xtrue; then if test x$host_alias != x; then dnl This is to allow cross compiling AC_MSG_CHECKING(sub-architecture settings) if test x$have_x86cpu = xtrue; then host_mod_cpu=`echo $host_cpu | tr _ -` ARCHFLAGS="-march=$host_mod_cpu -mcpu=$host_mod_cpu" fi else if test ! -r $srcdir/cpuinfo.sh; then AC_MSG_ERROR([cpuinfo.sh script not found - do a cvs update]) fi AC_MSG_CHECKING(sub-architecture settings) chmod +x $srcdir/cpuinfo.sh if test x$have_x86cpu = xtrue; then ARCHFLAGS=`$srcdir/cpuinfo.sh x86` elif test x$have_ppccpu = xtrue; then ARCHFLAGS=`$srcdir/cpuinfo.sh ppc` fi fi AC_MSG_RESULT($ARCHFLAGS)fidnl *********************************************************************dnl Check if Z/Alpha has been enabled. use_zalpha=falseif test "x$enable_zalpha" = "xyes" ; then use_zalpha=truefiAM_CONDITIONAL(HAVE_ZALPHA, test x$use_zalpha = xtrue)dnl **********************************************************************dnl All the conditional stuff for the MakefilesAM_CONDITIONAL(HAVE_ASM_MMX, test x$have_asm_mmx = xtrue)AM_CONDITIONAL(HAVE_X86CPU, test x$have_x86cpu = xtrue)AM_CONDITIONAL(HAVE_PPCCPU, test x$have_ppccpu = xtrue)AM_CONDITIONAL(HAVE_ALTIVEC, test x$have_altivec = xtrue)have_v4l_or_sdl=falseif test x$have_video4linux = xtrue; then have_v4l_or_sdl=trueelse if test x$have_sdl = xtrue; then have_v4l_or_sdl=true fifiAM_CONDITIONAL(HAVE_V4L_OR_SDL, test x$have_v4l_or_sdl = xtrue)dnl *********************************************************************dnl Check for what warnings we want gcc to use and adjust the CFLAGSdnl as needed. This only works for GCC.dnl We do this last as it can screw up library detection etc...dnl maddog: check out AC-COMPILE-WARNINGS ???????CFLAGS="$ARCHFLAGS $CFLAGS"CXXFLAGS="$ARCHFLAGS $CXXFLAGS"if test "x${GCC}" != "xyes" ; then enable_compile_warnings=nofiAC_MSG_CHECKING(what warning flags to pass to the C compiler)warnCFLAGS=warnCXXFLAGS=if test "x$enable_compile_warnings" != "xno" ; then if test "x$GCC" = "xyes" ; then case "$CFLAGS" in *-Wall*) ;; *) warnCFLAGS="-Wall -Wunused" ;; esac if test "x$enable_compile_warnings" = "xyes" ; then warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual" warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual" fi if test "x$enable_warnings_as_errors" = "xyes" ; then warnCFLAGS="$warnCFLAGS -Werror" warnCXXFLAGS="$warnCXXFLAGS -Werror" fi fifiAC_MSG_RESULT($warnCFLAGS)AC_MSG_RESULT($warnCXXFLAGS)if test "x$cflags_set" != "xyes" ; then CFLAGS="$CFLAGS $warnCFLAGS" CXXFLAGS="$CXXFLAGS $warnCXXFLAGS" cflags_set=yesfiAC_ARG_ENABLE(assert, AC_HELP_STRING([--disable-assert], [Disable assertions (compile with NDEBUG).]), [ case "$enableval" in yes|no) : ;; *) AC_MSG_ERROR(bad value for --enable-assert) ;; esac ], [ enable_assert=yes ])if test x"$enable_assert" = x"no"; then NDEBUG=1; fiAC_DEFINE(MJPEGTOOLS,1, [Building mjpegtools])case x"$NDEBUG" in x"1") AC_DEFINE(NDEBUG,1, [Optimised no DEBUG build, assertions disabled]) ;; esacdnl **********************************************************************dnl Output a Makefile or two and the lib/header descriptor scriptdnl **********************************************************************AC_CONFIG_FILES([ Makefile debian/Makefile debian/control docs/Makefile lavtools/Makefile yuvdenoise/Makefile yuvdeinterlace/Makefile y4munsharp/Makefile yuvfilters/Makefile mpeg2enc/Makefile aenc/Makefile mplex/Makefile scripts/Makefile utils/Makefile utils/altivec/Makefile utils/mmxsse/Makefile y4mdenoise/Makefile mjpegtools.pc mjpegtools.spec ])AC_OUTPUTdnl ************************************************************************dnl Summarize the config for the user.dnl ************************************************************************AC_MSG_NOTICE([])AC_MSG_NOTICE([ MJPEG tools ${VERSION} build configuration :])AC_MSG_NOTICE([])if test "$have_x86cpu" = "true" ; then AC_MSG_NOTICE([ - X86 Optimizations:]) AC_MSG_NOTICE([ - MMX/3DNow!/SSE enabled : ${have_asm_mmx}])fiif test "$have_ppccpu" = "true" ; then AC_MSG_NOTICE([ - PowerPC Optimizations:]) AC_MSG_NOTICE([ - AltiVec enabled : ${have_altivec}])fiif test x"$ARCHFLAGS" != x; then AC_MSG_NOTICE([ - arch/cpu compiler flags : ${ARCHFLAGS}])fiAC_MSG_NOTICE([ - video4linux recording/playback: ${have_video4linux}])AC_MSG_NOTICE([ - software MJPEG playback : ${have_sdl}])AC_MSG_NOTICE([ - MPEG Z/Alpha : ${use_zalpha}])AC_MSG_NOTICE([ - Quicktime playback/recording : ${have_libquicktime}])AC_MSG_NOTICE([ - PNG input support : ${have_libpng}])AC_MSG_NOTICE([ - AVI MJPEG playback/recording : true (always)])AC_MSG_NOTICE([ - libDV (digital video) support : ${have_libdv} ])AC_MSG_NOTICE([ - Gtk+ support for glav : ${have_gtk}])AC_MSG_NOTICE([])
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?