Files

50 lines
2.2 KiB
Markdown

# template
## GIT
### clone
git clone http://sethub.club/sethub/XML_Data_Parsing.git
git checkout -b dev_xxx origin/dev
### pull
git pull origin dev
## 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