Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@KaliAssistant
Copy link

@KaliAssistant KaliAssistant commented Jul 8, 2025

🛠️ Refactor: Transition hping3 to Autotools Build System

Summary

This PR modernizes the build system of hping3 by replacing the legacy hand-written configure + Makefile.in system with a robust GNU Autotools setup.

✅ Changes Overview

  • 🔧 Replaced legacy build system:

    • Removed custom configure, Makefile.in, byteorder.c, systype.h, and related artifacts.
    • Deleted manual dependency generation and install logic.
  • 🏗 Added Autotools integration:

    • Added configure.ac for autoconf with:
      • Static and shared libpcap support via --with-libpcap=PATH
      • Optional Tcl scripting via --enable-tcl + --with-libtcl=PATH
      • Endianness and OS detection
    • Added Makefile.am using Automake for source management and manpage install.
    • Created .gitignore for standard autotools artifacts (e.g., configure, Makefile.in, aclocal.m4, *.o, etc.)
  • 💡 Removed obsolete files:

    • Removed byteorder.c (now handled via AC_C_BIGENDIAN)
    • Removed systype.h (now handled via configure.ac with AC_DEFINE)
    • Removed redundant manual build rules and scripts.
  • 📦 Updated source includes:

    • Replaced byteorder.h and systype.h with config.h detection in source files (ars.h, hping2.h, etc.)
    • Replaced <net/bpf.h> includes with <pcap/bpf.h> for portability.

🔍 Build Instructions

autoreconf -i
./configure --with-libpcap=/path/to/libpcap [--enable-tcl --with-libtcl=/path/to/tcl]
make
sudo make install

🧪 Tested Environments

  • Native Linux (Debian-based)
  • Cross-compilation with uClibc (static)
  • Build with and without --enable-tcl
  • Static and dynamic linking of libpcap

🧹 Benefits

  • Standards-compliant build flow (configure && make && make install)
  • Easier cross-compilation support
  • Clean dependency management
  • Better portability across systems
  • Supports both static and shared builds
  • Optional Tcl scripting support

@KaliAssistant KaliAssistant changed the title Modernize and Cleanup hping3 Build System with Autotools Refactor: Transition hping3 to Autotools Build System Jul 8, 2025
@KaliAssistant
Copy link
Author

@antirez I know hping is an old project (over 13 years now), but I believe switching to Autotools helps modernize and simplify the build process—especially for cross-compilation, static builds, and package maintainers. The original hand-written configure/Makefile.in worked well in the past, but this update makes it easier to maintain and port in today's toolchain landscape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant