vlog: Logging option '--syslog-target' needs one argument.
[cascardo/ovs.git] / m4 / openvswitch.m4
index e918f25..ba3ed9b 100644 (file)
@@ -1,6 +1,6 @@
 # -*- autoconf -*-
 
-# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -30,8 +30,20 @@ AC_DEFUN([OVS_CHECK_COVERAGE],
       esac],
      [coverage=false])
    if $coverage; then
-     CFLAGS="$CFLAGS -O0 --coverage"
-     LDFLAGS="$LDFLAGS --coverage"
+     # Autoconf by default puts "-g -O2" in CFLAGS.  We need to remove the -O2
+     # option for coverage to be useful.  This does it without otherwise
+     # interfering with anything that the user might have put there.
+     old_CFLAGS=$CFLAGS
+     CFLAGS=
+     for option in $old_CFLAGS; do
+        case $option in
+            (-O2) ;;
+            (*) CFLAGS="$CFLAGS $option" ;;
+        esac
+     done
+
+     OVS_CFLAGS="$OVS_CFLAGS --coverage"
+     OVS_LDFLAGS="$OVS_LDFLAGS --coverage"
    fi])
 
 dnl Checks for --enable-ndebug and defines NDEBUG if it is specified.
@@ -86,6 +98,17 @@ AC_DEFUN([OVS_CHECK_WIN32],
             AC_MSG_ERROR([pthread directory not specified])
          ]
       )
+      AC_ARG_WITH([debug],
+         [AS_HELP_STRING([--with-debug],
+            [Build without compiler optimizations])],
+         [
+            MSVC_CFLAGS="-O0"
+            AC_SUBST([MSVC_CFLAGS])
+         ], [
+            MSVC_CFLAGS="-O2"
+            AC_SUBST([MSVC_CFLAGS])
+         ]
+      )
 
       AC_DEFINE([WIN32], [1], [Define to 1 if building on WIN32.])
       AH_BOTTOM([#ifdef WIN32
@@ -233,7 +256,7 @@ AC_DEFUN([OVS_CHECK_PYTHON],
         ovs_cv_python=$PYTHON
       else
         ovs_cv_python=no
-        for binary in python python2.4 python2.5; do
+        for binary in python python2.4 python2.5 python2.7; do
           ovs_save_IFS=$IFS; IFS=$PATH_SEPARATOR
           for dir in $PATH; do
             IFS=$ovs_save_IFS