vlog: Generate vlog-modules.def automatically.
[sliver-openvswitch.git] / m4 / openvswitch.m4
index d3e9f9f..6dda350 100644 (file)
@@ -60,30 +60,34 @@ AC_DEFUN([OVS_CHECK_NETLINK],
                 [Define to 1 if Netlink protocol is available.])
    fi])
 
-dnl Checks for OpenSSL, if --enable-ssl is passed in.
+dnl Checks for OpenSSL.
 AC_DEFUN([OVS_CHECK_OPENSSL],
   [AC_ARG_ENABLE(
      [ssl],
-     [AC_HELP_STRING([--enable-ssl], 
-                     [Enable ssl support (requires libssl)])],
+     [AC_HELP_STRING([--disable-ssl], [Disable OpenSSL support])],
      [case "${enableval}" in
         (yes) ssl=true ;;
         (no)  ssl=false ;;
         (*) AC_MSG_ERROR([bad value ${enableval} for --enable-ssl]) ;;
       esac],
-     [ssl=false])
+     [ssl=check])
 
-   if test "$ssl" = true; then
+   if test "$ssl" != false; then
        dnl Make sure that pkg-config is installed.
        m4_pattern_forbid([PKG_CHECK_MODULES])
-       PKG_CHECK_MODULES([SSL], [libssl], 
+       PKG_CHECK_MODULES([SSL], [openssl], 
          [HAVE_OPENSSL=yes],
          [HAVE_OPENSSL=no
-          AC_MSG_WARN([Cannot find libssl:
+          if test "$ssl" = check; then
+            AC_MSG_WARN([Cannot find openssl:
 
 $SSL_PKG_ERRORS
 
-OpenFlow connections over SSL will not be supported.])])
+OpenFlow connections over SSL will not be supported.
+(You may use --disable-ssl to suppress this warning.)])
+          else
+            AC_MSG_ERROR([Cannot find openssl (use --disable-ssl to configure without SSL support)])
+          fi])
    else
        HAVE_OPENSSL=no
    fi
@@ -194,7 +198,7 @@ AC_DEFUN([OVS_CHECK_DOT],
     [for dot],
     [ovs_cv_dot],
     [dnl "dot" writes -V output to stderr:
-     if (dot -V) 2>&1 | grep '^dot - [gG]raphviz version' >/dev/null 2>&1; then
+     if (dot -V) 2>&1 | grep '^dot - [[gG]]raphviz version' >/dev/null 2>&1; then
        ovs_cv_dot=yes
      else
        ovs_cv_dot=no
@@ -344,4 +348,6 @@ AC_DEFUN([OVS_CHECK_LINKER_SECTIONS],
                 into sections with user-defined names and the linker
                 automatically defines __start_SECNAME and __stop_SECNAME
                 symbols that designate the start and end of the section.])
-   fi])
+   fi
+   AM_CONDITIONAL(
+     [USE_LINKER_SECTIONS], [test $ovs_cv_use_linker_sections = yes])])