# -*- 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.
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.
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
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