X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=m4%2Fopenvswitch.m4;h=f9b7e578458b7b624b97a9f05a882d535cbb24a2;hb=36775dad3505929f8370166c33e8e0f04ca96c1c;hp=ce55311a39d24326c2d168fa5cacab7309c17a2e;hpb=a14bc59fb8f27db193d74662dc9c5cb8237177ef;p=openvswitch diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 index ce55311a..f9b7e578 100644 --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -14,6 +14,31 @@ # See the License for the specific language governing permissions and # limitations under the License. +dnl Checks for --enable-coverage and updates CFLAGS and LDFLAGS appropriately. +AC_DEFUN([OVS_CHECK_COVERAGE], + [AC_REQUIRE([AC_PROG_CC]) + AC_ARG_ENABLE( + [coverage], + [AC_HELP_STRING([--enable-coverage], + [Enable gcov coverage tool.])], + [case "${enableval}" in + (lcov) coverage=true lcov=true ;; + (yes) coverage=true lcov=false ;; + (no) coverage=false lcov=false ;; + (*) AC_MSG_ERROR([bad value ${enableval} for --enable-coverage]) ;; + esac], + [coverage=false lcov=false]) + if $coverage; then + CFLAGS="$CFLAGS -O0 --coverage" + LDFLAGS="$LDFLAGS --coverage" + fi + if $lcov; then + if lcov --version >/dev/null 2>&1; then :; else + AC_MSG_ERROR([--enable-coverage=lcov was specified but lcov is not in \$PATH]) + fi + fi + AC_SUBST([LCOV], [$lcov])]) + dnl Checks for --enable-ndebug and defines NDEBUG if it is specified. AC_DEFUN([OVS_CHECK_NDEBUG], [AC_ARG_ENABLE( @@ -73,11 +98,6 @@ AC_DEFUN([OVS_CHECK_OPENSSL], AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.]) fi]) -dnl Checks for libraries needed by lib/fault.c. -AC_DEFUN([OVS_CHECK_FAULT_LIBS], - [AC_CHECK_LIB([dl], [dladdr], [FAULT_LIBS=-ldl]) - AC_SUBST([FAULT_LIBS])]) - dnl Checks for libraries needed by lib/socket-util.c. AC_DEFUN([OVS_CHECK_SOCKET_LIBS], [AC_CHECK_LIB([socket], [connect]) @@ -203,8 +223,38 @@ dnl Checks for libpcre. AC_DEFUN([OVS_CHECK_PCRE], [dnl Make sure that pkg-config is installed. m4_pattern_forbid([PKG_CHECK_MODULES]) - PKG_CHECK_MODULES([PCRE], [libpcre], [HAVE_PCRE=yes], [HAVE_PCRE=no]) + PKG_CHECK_MODULES([PCRE], [libpcre >= 7.2], [HAVE_PCRE=yes], [HAVE_PCRE=no]) AM_CONDITIONAL([HAVE_PCRE], [test "$HAVE_PCRE" = yes]) if test "$HAVE_PCRE" = yes; then AC_DEFINE([HAVE_PCRE], [1], [Define to 1 if libpcre is installed.]) fi]) + +dnl Checks for Python 2.x, x >= 4. +AC_DEFUN([OVS_CHECK_PYTHON], + [AC_CACHE_CHECK( + [for Python 2.x for x >= 4], + [ovs_cv_python], + [if test -n "$PYTHON"; then + ovs_cv_python=$PYTHON + else + ovs_cv_python=no + for binary in python python2.4 python2.5; do + ovs_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for dir in $PATH; do + IFS=$ovs_save_IFS + test -z "$dir" && dir=. + if test -x $dir/$binary && $dir/$binary -c 'import sys +if sys.hexversion >= 0x02040000 and sys.hexversion < 0x03000000: + sys.exit(0) +else: + sys.exit(1)'; then + ovs_cv_python=$dir/$binary + break 2 + fi + done + done + fi]) + AM_MISSING_PROG([PYTHON], [python]) + if test $ovs_cv_python != no; then + PYTHON=$ovs_cv_python + fi])