📄 configure.in
字号:
dnl Process this file with autoconf to produce a configure script.AC_INIT(mpeg4ip, 1.6.1)AM_CONFIG_HEADER(mpeg4ip_config.h)dnl Prevent user from running just ./configureAC_CHECK_FILE(./bootstrapped, [did_bootstrap=yes], [did_bootstrap=no])if test x$did_bootstrap = xno; then AC_MSG_ERROR([Please run bootstrap first]) exit -1firm -f config.h >&/dev/nulltouch config.hdnl Detect the canonical host and target build environmentAC_CANONICAL_HOSTAC_CANONICAL_TARGETAM_INIT_AUTOMAKE([1.5 no-define])dnl Checks for programs. dnl check for macSUN_LIBS=have_macosx=falseconfig_sdl=truecase "$target" in *-apple-darwin*) have_macosx=true config_sdl=false AC_DEFINE(HAVE_MACOSX, [1], [have mac]) ;; *-*-solaris*) SUN_LIBS=-lstdc++ ;; *-cygwin*) config_sdl=false ;; *) ;;esacif test $config_sdl = true; then AC_CONFIG_SUBDIRS(lib/SDLAudio)fiAM_CONDITIONAL(HAVE_MAC_OSX, $have_macosx)AC_CONFIG_SUBDIRS(common/video/iso-mpeg4)AC_LIBTOOL_DLOPENAM_PROG_LIBTOOLAC_MSG_CHECKING([libtool tag=C for nasm])if test -z "`./libtool --help | grep \"\\-\\-tag\"`"; then AC_MSG_RESULT([no])else LIBTOOL_C_TAG="--tag=CXX" AC_SUBST(LIBTOOL_C_TAG) AC_MSG_RESULT([yes])fi AC_PROG_MAKE_SETAC_PROG_CCOBJC="???"AC_SUBST(OBJC)AC_PROG_CXX(c++)AC_C_INLINEAC_C_CONSTAC_PROG_INSTALLAC_PATH_XTRAAC_C_BIGENDIANAC_SUBST(ACLOCAL_AMFLAGS)AS=gccAC_SUBST(AS)ASFLAGS="$ASFLAGS"AC_SUBST(ASFLAGS)CCAS=gccAC_SUBST(CCAS)CCASFLAGS="$ASFLAGS"AC_SUBST(CCASFLAGS)dnl Checks for libraries.dnl Checks for header files.AC_HEADER_STDCAC_HEADER_TIMEAC_CHECK_SIZEOF(long)AC_LANG_PUSH(C++)AC_CHECK_SIZEOF(bool)AC_LANG_POP(C++)AC_CHECK_HEADERS(fcntl.h unistd.h stdint.h inttypes.h getopt.h byteswap.h)AC_CHECK_HEADERS(sys/time.h)AC_CHECK_FILE(/dev/urandom, AC_DEFINE([HAVE_DEV_URANDOM], [1], [have /dev/urandom]))dnl AC_LANG_PUSH(C++)AC_ARG_ENABLE(id3tags,[AC_HELP_STRING([--disable-id3tags],[disable use of installed id3tags library])],[ case "${enableval}" in no) disable_it=yes ;; yes) disable_it=no ;; *) AC_MSG_ERROR([bad valud ${enableval} for --disable-id3tags]) ;;esac], [disable_it=no])if test x$disable_it = xyes; then have_id3_tag=false AC_MSG_NOTICE([disabling id3 tag library])else AC_LANG_PUSH(C++) AC_CHECK_HEADER(id3/tag.h, [have_id3_tag=true], [have_id3_tag=false]) if test x$have_id3_tag = xtrue; then saved_LIBS="$LIBS" LIBS="$LIBS -lid3 -lz" AC_LINK_IFELSE( [#include <id3/tag.h> #include <id3/misc_support.h> int main () { ID3_GetAlbum((const ID3_Tag *)NULL); return 0; } ], [have_id3_tag=true], [have_id3_tag=false]) LIBS=$saved_LIBS fi AC_LANG_POP(C++)fiif test $have_id3_tag = true; then dnl should check for libraries here AC_DEFINE(HAVE_ID3_TAG_H, [1], [have id3/tag.h])fiAM_CONDITIONAL(HAVE_ID3_TAG, $have_id3_tag)dnl Check for pre 1.0 API version of xvidAC_ARG_ENABLE(xvid,[AC_HELP_STRING([--disable-xvid],[disable xvid link])],[ case "${enableval}" in no) disable_xvid=yes ;; yes) disable_xvid=no ;; *) AC_MSG_ERROR([bad valud ${enableval} for --disable-xvid]) ;;esac], [disable_xvid=no])if test x$disable_xvid = xyes; then use_xvid10=false no_xvid=true AC_MSG_NOTICE([disabling xvid library])elseAC_MSG_CHECKING([for xvid.h, API version 3])AC_TRY_COMPILE([], [#include <xvid.h> int ix = API_VERSION;], [no_xvid=false], [no_xvid=true])use_xvid10=falseif test $no_xvid = false; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XVID_H, [1], [have xvid.h])else AC_MSG_RESULT(no) AC_CHECK_HEADER(xvid.h, [no_xvid=false], [noxvid=true]) if test $no_xvid = false; then use_xvid10=true AC_DEFINE(HAVE_XVID10, [1], [have xvid.h with 1.0 API]) fififiAM_CONDITIONAL(HAVE_XVID_1_0, $use_xvid10)AM_CONDITIONAL(NO_XVID, $no_xvid)dnl check for Sun, BSD/OS librariesAC_CHECK_LIB(socket, socket)AC_CHECK_LIB(gnugetopt, getopt_long)AC_SEARCH_LIBS(inet_addr, nsl)AC_SEARCH_LIBS(inet_aton, resolv)AC_SEARCH_LIBS(dlopen, dl libc)dnl check for this for mp3lamesaved_LIBS="$LIBS"LIBS="$LIBS -lm"AC_ARG_ENABLE(a52dec,[AC_HELP_STRING([--disable-a52dec],[disable use of installed a52dec library])],[ case "${enableval}" in no) disable_a52=yes ;; yes) disable_a52=no ;; *) AC_MSG_ERROR([bad valud ${enableval} for --disable-a52]) ;;esac], [disable_a52=no])if test x$disable_a52 = xyes; then have_a52=false AC_MSG_NOTICE([disabling a52dec library])else AC_CHECK_LIB(a52, a52_syncinfo, [have_a52=true], [have_a52=false])fiAM_CONDITIONAL(HAVE_A52DEC_LIB, $have_a52)AC_ARG_ENABLE(mad,[AC_HELP_STRING([--disable-mad],[disable use of installed mad library])],[ case "${enableval}" in no) disable_it=yes ;; yes) disable_it=no ;; *) AC_MSG_ERROR([bad valud ${enableval} for --disable-mad]) ;;esac], [disable_it=no])if test x$disable_it = xyes; then have_mad=false AC_MSG_NOTICE([disabling mad library])else AC_CHECK_LIB(mad, mad_decoder_init, [have_mad=true], [have_mad=false])fiAM_CONDITIONAL(HAVE_LIBMAD, $have_mad)AC_ARG_ENABLE(mpeg2dec,[AC_HELP_STRING([--disable-mpeg2dec],[disable use of installed mpeg2dec library])],[ case "${enableval}" in no) disable_it=yes ;; yes) disable_it=no ;; *) AC_MSG_ERROR([bad valud ${enableval} for --disable-mpeg2dec]) ;;esac], [disable_it=no])if test x$disable_it = xyes; then have_mpeg2=false AC_MSG_NOTICE([disabling mpeg2dec library])else AC_CHECK_LIB(mpeg2, mpeg2_init, [have_mpeg2=true], [have_mpeg2=false]) if test x$have_mpeg2 = xtrue; then AC_MSG_CHECKING([libmpeg2 version]) AC_COMPILE_IFELSE([#include <stdint.h>#include <mpeg2dec/mpeg2.h>#ifndef MPEG2_VERSION#error no mpeg2 version#else#if MPEG2_VERSION(0, 4, 0) <= MPEG2_RELEASEint main (int argc, char **argv){ return 0;}#else#error prior release#endif#endif], [have_mpeg2=true], [have_mpeg2=false]) if test x$have_mpeg2 = xtrue; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fifiAM_CONDITIONAL(HAVE_LIBMPEG2, $have_mpeg2)if test $have_mpeg2 = true; then AC_DEFINE(HAVE_LIBMPEG2, [1], [have libmpeg2 decoder library])fiLIBS=$saved_LIBSdnl Checks for typedefs, structures, and compiler characteristics.dnl Checks for library functions.AC_CHECK_FUNCS(strerror strcasestr poll getopt getopt_long getopt_long_only socketpair strsep inet_ntoa inet_pton inet_ntop inet_aton vsnprintf)AC_CHECK_TYPES([in_port_t, socklen_t, struct iovec, struct sockaddr_storage], , , [#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h>])AC_ARG_ENABLE(igmpv3, [AC_HELP_STRING([--enable-igmpv3],[enable igmpv3])],[ case "${enableval}" in yes) igmpv3=true ;; no) igmpv3=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-igmpv3) ;;esac],[igmpv3=true])if test igmpv3 = true; thenAC_CHECK_TYPES([struct ip_mreq_source], AC_DEFINE(HAVE_IGMP_V3, [1], [IGMPv3 definition]),, [#include <netinet/in.h>])fiAC_CHECK_MEMBERS(fpos_t.__pos,,, [#include <stdio.h>])dnl borrowed from ac-archive.sourceforge.netdnl @author Guido Draheim <guidod@gmx.de>dnl heavilly modifiedAC_DEFUN([MY_CHECK_CC_OPT],[save_CFLAG="$CFLAGS"save_CXXFLAG="$CXXFLAGS"CFLAGS="$CFLAGS -Werror $1"CXXFLAGS="$CXXFLAGS -Werror $1" AC_MSG_CHECKING([whether $3 accepts $1]) AC_COMPILE_IFELSE([extern void f(void); void f(void){}],[$2=yes AC_MSG_RESULT([yes])],[$2=no AC_MSG_RESULT([no])])CFLAGS="$save_CFLAG"CXXFLAGS="$save_CXXFLAG"])AC_DEFUN([MY_CHECK_CC_OPT_SET],[ MY_CHECK_CC_OPT($1, mpeg4ip_ok, $3) if test $mpeg4ip_ok = yes; then $2="$$2 $1" fi])AC_DEFUN([MY_CHECK_CC_OPT_F_OR_M],[ temp_val=-m$1 MY_CHECK_CC_OPT($temp_val,mpeg4ip_ok, [c compiler]) if test $mpeg4ip_ok = yes; then AC_SUBST($2, $temp_val) AM_CONDITIONAL(HAVE_$2, true) else temp_val=-f$1 MY_CHECK_CC_OPT($temp_val, mpeg4ip_ok, [c compiler]) if test $mpeg4ip_ok = yes; then AC_SUBST($2, $temp_val) AM_CONDITIONAL(HAVE_$2, true) else temp_val= AC_SUBST($2, $temp_val) AM_CONDITIONAL(HAVE_$2, false) fi fi])dnl Allow server build to be disabledAC_ARG_ENABLE(server, [AC_HELP_STRING([--enable-server],[enable server build])],[ case "${enableval}" in yes) server=true ;; no) server=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-server) ;;esac],[server=true])AM_CONDITIONAL(SERVER, test $server = true)dnl Allow player build to be disabledAC_ARG_ENABLE(player, [AC_HELP_STRING([--enable-player],[enable player build])],[ case "${enableval}" in yes) player=true ;; no) player=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-player) ;;esac],[player=true])AM_CONDITIONAL(PLAYER, [test x$player = xtrue])#autoconf is slightly confusing here: #enableval will be 'no' if --disable-* is present and '' if it isn'tAC_ARG_ENABLE(srtp,[AC_HELP_STRING([--disable-srtp],[disable use of installed SRTP library])],[ case "${enableval}" in yes) have_srtp=true ;; no) have_srtp=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --disable-srtp]) ;;esac], [have_srtp=true])if test $have_srtp = true; then AC_CHECK_LIB(srtp, srtp_init, [have_srtp=true], [have_srtp=false])fiif test $have_srtp = true; then SRTPLIB="-lsrtp" AC_MSG_NOTICE([enabling use of SRTP library]) AC_DEFINE(HAVE_SRTP, [1], [enable use of srtp library])else SRTPLIB="" AC_MSG_NOTICE([not using SRTP library])fiAC_SUBST(SRTPLIB)AC_ARG_ENABLE(mp4live, [AC_HELP_STRING([--enable-mp4live],[enable mp4live build on Linux [default=yes]])], , enable_mp4live=yes)have_mp4live=falseif test x$enable_mp4live = xyes; then case "$target" in *-*-linux*) have_mp4live=true AC_ARG_ENABLE(mp4live-alsa, [AC_HELP_STRING([--enable-mp4live-alsa], [enable ALSA interface in mp4live])], [ case "${enableval}" in no) enable_alsa=no ;; yes) enable_alsa=yes ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-mp4live-alsa) ;; esac], [ enable_alsa=no]) if test x$enable_alsa = xyes; then dnl - CheckAlsa - from SDL AM_PATH_ALSA(0.9.0, [have_alsa=yes], [have_alsa=no]) if test x$have_alsa = xyes; then AC_CHECK_FUNCS(snd_pcm_hw_params_set_rate_resample) dnl - not needed AC_SUBST(ALSA_CFLAGS) - gotten by SDL_CFLAGS dnl - not needed AC_SUBST(ALSA_LIBS) - gotten by SDL_LIBS AC_DEFINE(HAVE_ALSA, [1], [have alsa enabled for mp4live]) fi CFLAGS="$alsa_save_CFLAGS" LDFLAGS="$alsa_save_LDFLAGS" LIBS="$alsa_save_LIBS" dnl - restore flags fi AC_CHECK_TYPE([struct v4l2_buffer], [AC_DEFINE(HAVE_MP4LIVE, 1, [mp4live can be used])], [have_mp4live=false], [#include <sys/time.h>#include <sys/types.h>#include <linux/videodev.h>]) if test x$have_mp4live = xfalse; then KERNEL_VERSION=`uname -r` AC_CHECK_FILE(/lib/modules/$KERNEL_VERSION/build/include/linux/videodev2.h, [AC_MSG_WARN([]) AC_MSG_WARN([]) AC_MSG_WARN([We cannot locate videodev2.h in /usr/include/linux]) AC_MSG_WARN([]) AC_MSG_WARN([This file is responsible for V4L2 in mp4live]) AC_MSG_WARN([This file is correct in /lib/modules/$KERNEL_VERSION/build/include]) AC_MSG_WARN([It is recommended that you copy this file and videodev.h to /usr/include/linux and re-run bootstrap]) AC_MSG_WARN([You may also have to have to copy compiler.h, as well]) AC_MSG_WARN([]) AC_MSG_WARN([This is known to happen on Fedora Core systems]) AC_MSG_WARN([Mp4live has been disabled]) AC_MSG_WARN([]) ]) fi ;; *) ;; esacfiAM_CONDITIONAL(MP4LIVE, [test x$have_mp4live = xtrue])LIBVORBIS_LIB=if test x$have_mp4live = xtrue; then AC_CHECK_LIB(vorbis, vorbis_bitrate_init, [have_vorbis=true], [have_vorbis=false]) if test x$have_vorbis = xtrue; then LIBVORBIS_LIB="-lvorbis -lvorbisenc" AC_CHECK_HEADER([faad.h], [LIBVORBIS_LIB="$LIBVORBIS_LIB -lfaad"]) fifiAC_SUBST(LIBVORBIS_LIB)dnl test for ffmpeghave_ffmpeg=falsedisable_ffmpeg=falseFFMPEG_INC=FFMPEG_LIB=AC_ARG_ENABLE(ffmpeg, [AC_HELP_STRING([--enable-ffmpeg=<directory>],[enable ffmpeg for mp4live and specify ffmpeg home directory])], [if test x$enableval = xno; then disable_ffmpeg=true else if test x$enableval != xyes; then have_ffmpeg_arg=true fi fi ], [have_ffmpeg_arg=false] )if test x$disable_ffmpeg = xfalse; then if test x$have_ffmpeg_arg = xtrue; then AC_MSG_NOTICE([have enable ffmpeg $enable_ffmpeg]) FFMPEG_INC=-I${enable_ffmpeg}/libavcodec FFMPEG_LIB="${enable_ffmpeg}/libavcodec/libavcodec.a -lz" saveCFLAGS="$CFLAGS" CFLAGS="$CFLAGS $FFMPEG_INC" AC_CHECK_TYPES([AVRational], , , [#include <avcodec.h>]) AC_CHECK_MEMBERS(AVCodecContext.time_base, , , [#include <avcodec.h>]) AC_CHECK_DECLS([avcodec_decode_audio2], , ,[#include <avcodec.h>]) CFLAGS=$saveCFLAGS have_ffmpeg=true AC_DEFINE(HAVE_FFMPEG, 1, [enable ffmpeg for mp4live]) else saved_LIBS="$LIBS" LIBS="$LIBS -lm -lz" AC_CHECK_LIB(avutil, av_crc_init, [have_avutil=true], [have_avutil=false])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -