From 437c185b4be04c7b14f8764455ec361ca9ae2835 Mon Sep 17 00:00:00 2001 From: "Kirill A. Korinsky" Date: Wed, 26 Jul 2023 12:29:40 +0200 Subject: [PATCH] Disable python27 checks Closes: https://github.com/simsong/tcpflow/issues/254 --- configure.ac | 61 ++++++++++++++++++++++++---------------------- src/CMakeLists.txt | 5 +++- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/configure.ac b/configure.ac index 2e02f38..8a89624 100644 --- a/configure.ac +++ b/configure.ac @@ -490,35 +490,38 @@ AC_CHECK_TYPES([sa_family_t], [], [], ]] ) -################################################################ -# Plugin scan_python.cpp requires header "Python.h" -# If the header is not present => Disable the source code of the plugin -# -AC_CHECK_HEADERS(python2.7/Python.h) # ==> #define HAVE_PYTHON2_7_PYTHON_H -AC_CHECK_LIB(python2.7,Py_Initialize,,[ - AC_MSG_WARN([ -*** Cannot find python library. -*** Please install python-devel to enable scanner python. - ]) - Fmissing_library="$Fmissing_library python-devel " # Validated on Fedora 25 - Umissing_library="$Umissing_library libpython2.7-dev" # Should be OK: https://packages.ubuntu.com/yakkety/libpython2.7-dev - Mmissing_library="$Mmissing_library python27" # Not sure: https://github.com/macports/macports-ports/blob/master/lang/python27/Portfile -]) - -################################################################ -# Plugin scanner_python.cpp requires header "Python.h" -# If the header is not present => Disable the source code of the plugin -# -AC_CHECK_HEADERS(python2.7/Python.h) # ==> #define HAVE_PYTHON2_7_PYTHON_H -AC_CHECK_LIB(python2.7,Py_Initialize,,[ - AC_MSG_WARN([ -*** Cannot find python library. -*** Please install python-devel to enable scanner python. - ]) - Fmissing_library="$Fmissing_library python-devel " # Validated on Fedora 25 - Umissing_library="$Umissing_library libpython2.7-dev" # Should be OK: https://packages.ubuntu.com/yakkety/libpython2.7-dev - Mmissing_library="$Mmissing_library python27" # Not sure: https://github.com/macports/macports-ports/blob/master/lang/python27/Portfile -]) +dnl +dnl NOTE: scan_python.cpp was disabled since 1.6.1, this checks are useless +dnl +dnl ################################################################ +dnl # Plugin scan_python.cpp requires header "Python.h" +dnl # If the header is not present => Disable the source code of the plugin +dnl # +dnl AC_CHECK_HEADERS(python2.7/Python.h) # ==> #define HAVE_PYTHON2_7_PYTHON_H +dnl AC_CHECK_LIB(python2.7,Py_Initialize,,[ +dnl AC_MSG_WARN([ +dnl *** Cannot find python library. +dnl *** Please install python-devel to enable scanner python. +dnl ]) +dnl Fmissing_library="$Fmissing_library python-devel " # Validated on Fedora 25 +dnl Umissing_library="$Umissing_library libpython2.7-dev" # Should be OK: https://packages.ubuntu.com/yakkety/libpython2.7-dev +dnl Mmissing_library="$Mmissing_library python27" # Not sure: https://github.com/macports/macports-ports/blob/master/lang/python27/Portfile +dnl ]) + +dnl ################################################################ +dnl # Plugin scanner_python.cpp requires header "Python.h" +dnl # If the header is not present => Disable the source code of the plugin +dnl # +dnl AC_CHECK_HEADERS(python2.7/Python.h) # ==> #define HAVE_PYTHON2_7_PYTHON_H +dnl AC_CHECK_LIB(python2.7,Py_Initialize,,[ +dnl AC_MSG_WARN([ +dnl *** Cannot find python library. +dnl *** Please install python-devel to enable scanner python. +dnl ]) +dnl Fmissing_library="$Fmissing_library python-devel " # Validated on Fedora 25 +dnl Umissing_library="$Umissing_library libpython2.7-dev" # Should be OK: https://packages.ubuntu.com/yakkety/libpython2.7-dev +dnl Mmissing_library="$Mmissing_library python27" # Not sure: https://github.com/macports/macports-ports/blob/master/lang/python27/Portfile +dnl ]) ############## drop optimization flags if requested ################ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7a2461e..561c285 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -85,7 +85,10 @@ check_include_files(unordered_map HAVE_UNORDERED_MAP) check_include_files(unordered_set HAVE_UNORDERED_SET) check_include_files(winsock2.h HAVE_WINSOCK2_H) check_include_files(zlib.h HAVE_ZLIB_H) -check_include_files(python2.7/Python.h PYTHON2_7_PYTHON_H) # TODO(olibre): Use instead PYTHON_INCLUDE_DIRS + +# NOTE: scan_python.cpp was disabled since 1.6.1, this checks are useless +# check_include_files(python2.7/Python.h PYTHON2_7_PYTHON_H) # TODO(olibre): Use instead PYTHON_INCLUDE_DIRS + # There are many other #define not (yet) implemented by above CMake directives. # To list the #define use the following command lines: # sed 's|/\* ||' config.h | awk '$1 ~ /#undef|#define/{print $2}' | sort -u | while read w ; do grep -wB1 $w config.h | grep '[^ ]*> header' -q && echo $w; done > already-implemented-using-cmake-directives