diff options
author | Guy Harris <gharris@sonic.net> | 2023-02-13 21:17:46 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2023-02-13 21:17:46 -0800 |
commit | ec75e5b3e8befef3066a81990fb5ff4c70ae3ce5 (patch) | |
tree | 1273f45b0b0132c3819baf64f6c66f2ab6e6bf25 /configure.ac | |
parent | 93a3b993beeedd5e39d26fb4a99a5fad148f0d8e (diff) | |
download | tcpdump-ec75e5b3e8befef3066a81990fb5ff4c70ae3ce5.tar.gz |
configure: move the addition of -fPIC to CFLAGS on Haiku earlier.
Add it before doing anything about the C compiler, so that all tests
done with the compiler are done with -fPIC, in case any of those tests
involve producing an executable image.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac index ffe0f97e..e6bf7064 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,29 @@ 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. @@ -33,9 +56,6 @@ AC_C_INLINE AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h net/if.h) -# -# Assorted platform checks. -# case "$host_os" in darwin*) @@ -64,23 +84,6 @@ darwin*) esac fi ;; - -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. - # - # Force the use of -fPIC (even for GCC; adding -fPIC for GCC - # won't break anything). - # - CFLAGS="$CFLAGS -fPIC" - ;; esac AC_ARG_WITH([smi], |