From 7d8ae2872eac0b55379ced95fbecd453311eac72 Mon Sep 17 00:00:00 2001 From: zhoujiale Date: Sun, 26 Jul 2026 21:58:58 +0800 Subject: [PATCH] [libxml2]Add the libxml2 compilation operation process --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index ffd0187..583a6a1 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,40 @@ ## push git push origin dev_xxx -u + + + +## libxml2 record + +1. Use the autogen.sh script to generate makefile-related files. + autogen.sh +2. Use `make` to execute the `makefile` + make + +### Command operation principle +#### .in file - "Template file" +1. Makefile.in: A template for Makefile. It is filled with placeholder variables such as @srcdir@, @CC@, @prefix@, etc. Configure replaces these variables with actual values, outputting a directly usable Makefile. +2. config.h.in: A header file template. The configure script will generate config.h based on the detection results, which defines macros such as #define HAVE_STDLIB_H 1 for use in the source code. +3. Why is it called .in? It stands for input template, waiting to be filled by configure. +#### .m4 file - "Macro definition file" +1. m4 is an ancient macro processing language used by Autoconf to extend configure.ac. +2. aclocal.m4: Generated by aclocal, it contains macros written by the project itself and macros installed by the system (such as macros for detecting a specific library), intended for use by autoconf. +3. pkg.m4: This is a macro file provided by the pkg-config tool, which defines macros such as PKG_CHECK_MODULES, intended for conveniently detecting dependent libraries in configure.ac. Your script checks for its existence to ensure that the project can correctly detect dependencies. +4. Other .m4 files: They are usually stored in /usr/share/aclocal and are detection macros provided by various third-party libraries. + + Handwritten files: + configure.ac (configuration requirements) + Makefile.am (prototype of build rules) + ... source code .. + ↓ Run autogen.sh (i.e., the script you analyzed) + Generated files: + configure (executable configuration script), + Makefile.in (Makefile template), + aclocal.m4 (macro package), + config.h.in (header file template) + ↓ Run ./configure + Generated files: Makefile (final usable Makefile), + config.h (final header file), + config.status (configuration status script) + +Reference: https://chat.deepseek.com/share/yuz6k3q75v5qqop8h3 \ No newline at end of file