📄 configure.in
字号:
AC_INIT(configure.in)AM_INIT_AUTOMAKE(jrtplib,3.7.1)RTP_FILIO="// Don't have <sys/filio.h>"RTP_SOCKIO="// Don't have <sys/sockio.h>"RTP_ENDIAN="// Little endian system"RTP_SOCKLENTYPE_UINT="// socklen_t is int'"RTP_HAVE_SOCKADDR_LEN="// No sa_len member in struct sockaddr"RTP_SUPPORT_IPV4MULTICAST="// No IPv4 multicasting support"RTP_SUPPORT_IPV6MULTICAST="// No IPv6 multicasting support"RTP_SUPPORT_THREAD="// No support for jthread"RTP_SUPPORT_SDESPRIV="// No support for SDES PRIV items"RTP_SUPPORT_PROBATION="// Do not wait for a number of consecutive packets to validate source"RTP_SUPPORT_GNUDRAND="// Not using drand48_r and srand48_r"RTP_SUPPORT_RANDR="// Not using rand_r"RTP_SUPPORT_GETLOGINR="// Not using getlogin_r"RTP_SUPPORT_IPV6="// No IPv6 support"RTP_SUPPORT_IFADDRS="// No ifaddrs support"RTP_SUPPORT_SENDAPP="// No direct support for sending RTCP APP packets"RTP_SUPPORT_MEMORYMANAGEMENT="// No memory management support"RTP_LINKLIBS=""RTP_CHECK_JTHREADLINK="no"if test "BLA$CXXFLAGS" = "BLA" ; then dnl CXXFLAGS="-g -Werror -Wall" CXXFLAGS="-O2 "fidnl ---------------------------------------------------------------------------dnl Set language to C++ and do libtool stuffdnl ---------------------------------------------------------------------------AC_LANG(C++)AM_PROG_LIBTOOLdnl ---------------------------------------------------------------------------dnl Check for the SDES PRIV supportdnl ---------------------------------------------------------------------------AC_ARG_ENABLE(sdespriv,[ --disable-sdespriv Disable support for SDES PRIV items],[ if test "$enableval" = yes ; then privsupport="yes" else privsupport="no" fi],[ privsupport="yes" ]) if test "$privsupport" = "yes" ; then RTP_SUPPORT_SDESPRIV="#define RTP_SUPPORT_SDESPRIV"fidnl ---------------------------------------------------------------------------dnl Check for the probation supportdnl ---------------------------------------------------------------------------AC_ARG_ENABLE(probation,[ --disable-probation Disable support for probation of a new source],[ if test "$enableval" = yes ; then probsupport="yes" else probsupport="no" fi],[ probsupport="yes" ]) if test "$probsupport" = "yes" ; then RTP_SUPPORT_PROBATION="#define RTP_SUPPORT_PROBATION"fidnl ---------------------------------------------------------------------------dnl Check for RTCP APP sending supportdnl ---------------------------------------------------------------------------AC_ARG_ENABLE(sendapp,[ --disable-sendapp Disable support for sending RTCP APP packets],[ if test "$enableval" = yes ; then sendappupport="yes" else sendappsupport="no" fi],[ sendappsupport="yes" ]) if test "$sendappsupport" = "yes" ; then RTP_SUPPORT_SENDAPP="#define RTP_SUPPORT_SENDAPP"fidnl ---------------------------------------------------------------------------dnl Check for memory management supportdnl ---------------------------------------------------------------------------AC_ARG_ENABLE(memory,[ --disable-memory Disable support for memory management],[ if test "$enableval" = yes ; then memsupport="yes" else memsupport="no" fi],[ memsupport="yes" ]) if test "$memsupport" = "yes" ; then RTP_SUPPORT_MEMORYMANAGEMENT="#define RTP_SUPPORT_MEMORYMANAGEMENT"fidnl ---------------------------------------------------------------------------dnl Check for the jthread headersdnl ---------------------------------------------------------------------------AC_ARG_ENABLE(jthread,[ --disable-jthread Disable support for JThread],[ if test "$enableval" = yes ; then checkjthread="yes" else checkjthread="no" fi],[ checkjthread="yes" ])if test "$checkjthread" = "yes" ; then searchdirs="/usr/include/jthread /usr/local/include/jthread" AC_MSG_CHECKING(for JThread include files) AC_ARG_WITH(jthread-includes,[ --with-jthread-includes Directory where JThread include files are located], [ if test -e "$withval"/jthread.h && test -e "$withval"/jmutex.h ; then AC_MSG_RESULT(in "$withval") AC_MSG_CHECKING(JThread version) AC_COMPILE_IFELSE([ #include "$withval/jthread.h" class MyThread : public JThread { public: void *Thread() { JThread::ThreadStarted(); return 0; } };],[ RTP_JTHREADINCLUDES="-I $withval" RTP_SUPPORT_THREAD="#define RTP_SUPPORT_THREAD" RTP_CHECK_JTHREADLINK="yes"dnl RTP_LINKLIBS="$RTP_LINKLIBS -ljthread -lpthread" AC_MSG_RESULT(>= 1.1.0) ],[ AC_MSG_RESULT(< 1.1.0) AC_MSG_WARN(You need at least JThread version 1.1.0. Support for JThread has been disabled)]) else AC_MSG_RESULT(not found) AC_MSG_WARN(The JThread include files were not found in $withval. Support for JThread has been disabled) fi ], [ for i in $searchdirs ; do if test -e $i/jthread.h && test -e $i/jmutex.h ; then RTP_JTHREADINCLUDEDIR="$i" AC_MSG_RESULT($i) break fi done if test "BLAAI$RTP_JTHREADINCLUDEDIR" = "BLAAI" ; then AC_MSG_RESULT(not found) AC_MSG_WARN(Unable to locate the JThread include files. Please specify the include path with --with-jthread-includes if they exist on your system. JThread support has been disabled) else AC_MSG_CHECKING(JThread version) AC_COMPILE_IFELSE([ #include "$RTP_JTHREADINCLUDEDIR/jthread.h" class MyThread : public JThread { public: void *Thread() { JThread::ThreadStarted(); return 0; } };],[ RTP_JTHREADINCLUDES="-I $RTP_JTHREADINCLUDEDIR" RTP_SUPPORT_THREAD="#define RTP_SUPPORT_THREAD" RTP_CHECK_JTHREADLINK="yes"dnl RTP_LINKLIBS="$RTP_LINKLIBS -ljthread -lpthread" AC_MSG_RESULT(>= 1.1.0) ],[ AC_MSG_RESULT(< 1.1.0) AC_MSG_WARN(You need at least JThread version 1.1.0. Support for JThread has been disabled)]) fi ])fiif test "$RTP_CHECK_JTHREADLINK" = "yes" ; then AC_MSG_CHECKING(if we can link against jthread and pthread) oldldflags="$LDFLAGS" LDFLAGS="$LDFLAGS -ljthread -lpthread" AC_LINK_IFELSE( [ int main(void) { } ] , [ RTP_LINKLIBS="$RTP_LINKLIBS -ljthread -lpthread" AC_MSG_RESULT(yes) ] , [ AC_MSG_RESULT(no) ] ) LDFLAGS="$oldldflags"fidnl ---------------------------------------------------------------------------dnl Check if sys/filio.h exists (used on solaris)dnl ---------------------------------------------------------------------------AC_CHECK_HEADER(sys/filio.h,[RTP_FILIO="#define RTP_HAVE_SYS_FILIO"])dnl ---------------------------------------------------------------------------dnl Check if sys/sockio.h exists (used on solaris)dnl ---------------------------------------------------------------------------AC_CHECK_HEADER(sys/sockio.h,[RTP_SOCKIO="#define RTP_HAVE_SYS_SOCKIO"])dnl ---------------------------------------------------------------------------dnl Check if it's a big endian or little endian systemdnl Note that we must be careful when a cross-compiler is being used...dnl ---------------------------------------------------------------------------if test "$cross_compiling" = yes ; then cat << EOFASSUMING TARGET IS BIG ENDIAN: The script detected a cross-compiler on your system. This can mean that there really is a cross-compiler installed, or that for some other reason, a simple program could not be run. You should check the config.log file to verify this. Since we are assuming a cross-compiler, we won't be able to actually test any program. More important, we cannot test if the system is big or little endian. For now, big endian is assumed. If this assumption should be wrong, you will have to comment the appropriate line in 'rtpconfig_unix.h'EOF RTP_ENDIAN="#define RTP_BIG_ENDIAN // comment this if the target is a little endian system"else AC_C_BIGENDIAN if test "$ac_cv_c_bigendian" = yes; then RTP_ENDIAN="#define RTP_BIG_ENDIAN" fifidnl ---------------------------------------------------------------------------dnl Check if compiler supports -Werror -Walldnl ---------------------------------------------------------------------------oldcxxflags="$CXXFLAGS"CXXFLAGS="$CXXFLAGS -Werror -Wall"AC_MSG_CHECKING(if compiler supports -Werror -Wall)AC_TRY_COMPILE([ #include <stdio.h>],[ printf("Hello world\n");], AC_MSG_RESULT(yes),[ AC_MSG_RESULT(no) CXXFLAGS="$oldcxxflags"])dnl ---------------------------------------------------------------------------dnl Check what the last argument for getsockname isdnl ---------------------------------------------------------------------------AC_MSG_CHECKING(last argument of getsockname)AC_TRY_COMPILE([#include <sys/types.h> #include <sys/socket.h>], [int param; int sock = 0; struct sockaddr addr; getsockname(sock,&addr,¶m);], AC_MSG_RESULT(int), [
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -