]> The Tcpdump Group git mirrors - tcpdump/commitdiff
configure, CMake: remove -fPIC hacks for Haiku.
authorGuy Harris <[email protected]>
Wed, 15 Feb 2023 00:07:22 +0000 (16:07 -0800)
committerGuy Harris <[email protected]>
Wed, 15 Feb 2023 00:07:22 +0000 (16:07 -0800)
As of llvm12_clang-12.0.1-5, Clang defaults to generating PIC, just as
GCC does, and the entire matrix now works.

CMakeLists.txt
configure.ac

index 55d8a0e48b453593275d69bada529539d072e855..f904e76b025af4c2ba6e7f183615c0a365e41646 100644 (file)
@@ -4,20 +4,7 @@ if(WIN32)
     # below.
     #
     cmake_minimum_required(VERSION 3.12)
-elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Haiku")
-    #
-    # We need 3.7 or later, so we can use CMAKE_C_FLAGS_INIT; see
-    # below.
-    #
-    # We test CMAKE_HOST_SYSTEM_NAME rather than CMAKE_SYSTEM_NAME,
-    # because the former is set before project() is called (it's set
-    # from the results of uname()), but the latter isn't set until
-    # after project() returns, and we have to do those tests before
-    # calling project() so we set CMAKE_C_FLAGS_INIT before calling
-    # project().
-    #
-    cmake_minimum_required(VERSION 3.7)
-else()
+else(WIN32)
     #
     # For now, require only 2.8.12, just in case somebody is
     # configuring with CMake on a "long-term support" version
@@ -31,7 +18,7 @@ else()
     # it finds any .pc file from there.
     #
     cmake_minimum_required(VERSION 2.8.12)
-endif()
+endif(WIN32)
 
 #
 # We want find_path() and find_library() to honor {packagename}_ROOT,
@@ -98,27 +85,6 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
 
-#
-# See above for why we test CMAKE_HOST_SYSTEM_NAME rather than
-# CMAKE_SYSTEM_NAME.
-#
-if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Haiku")
-    #
-    # On Haiku, all executables are built as shared objects,
-    # and must have their code build as PIC.
-    #
-    # At least some versions of Haiku's GCC default to PIC,
-    # with a -fno-pic option for cases where that's not desired.
-    #
-    # Clang hasn't been modified in that fashion, so Clang
-    # builds of tcpdump fail.  This is Haiku bug 18258.
-    #
-    # Force the use of -fPIC (even for GCC; adding -fPIC for GCC
-    # won't break anything).
-    #
-    set(CMAKE_C_FLAGS_INIT "-fPIC")
-endif()
-
 #
 # OK, this is a royal pain.
 #
index e6bf70643369675df42d886ec72c7f8f49e6c244..890e9e0dcfea81828711ad4e9276caa8c3280924 100644 (file)
@@ -19,29 +19,6 @@ AC_CONFIG_SRCDIR(tcpdump.c)
 
 AC_CANONICAL_HOST
 
-case "$host_os" in
-
-haiku*)
-       #
-       # On Haiku, all executables are built as shared objects,
-       # and must have their code build as PIC.  This also
-       # applies to code in static libraries, as well as
-       # shared libraries, as executables may be linked
-       # with that code.
-       #
-       # At least some versions of Haiku's GCC default to PIC,
-       # with a -fno-pic option for cases where that's not desired.
-       #
-       # Clang hasn't been modified in that fashion, so Clang
-       # builds of tcpdump fail.  This is Haiku bug 18258.
-       #
-       # Force the use of -fPIC (even for GCC; adding -fPIC for GCC
-       # won't break anything).
-       #
-       CFLAGS="$CFLAGS -fPIC"
-       ;;
-esac
-
 AC_LBL_C_INIT_BEFORE_CC(V_INCLS)
 #
 # Try to enable as many C99 features as we can.