MKC_CHECK_HEADER(1)
π MKC_CHECK_HEADER(1) β the header-detector page, bestie edition π
okay so real talk, this is mkc_check_header from section 1 of the manual, and it's genuinely one of those tiny tools that just works. let me walk you through it π«Ά
β¨ NAME β¨
mkc_check_header β it detects the presense of a header file. that's the whole job. icon behaviour honestly π
πΈ SYNOPSIS πΈ
mkc_check_header [OPTIONS] <headers>
π¦ DESCRIPTION π¦
mkc_check_header detects presense of header file. that's it, that's the vibe.
as a result it prints either 1 (true) or 0 (false) to stdout β so yes, you can literally just check the output and move on with your life β¨
headers may be either a single header file or a list of headers separated by comma. and if you go the list route, all mentioned headers are put into a single .c file and ${CC} is run. one file, one compile, no drama π
by default $CC -c is used for checking. by default, temporary and cache files _mkc_header_lheader_h.{c,err,res} are created under the MKC_CACHEDIR directory. here, lheader_h is the last header from the comma-separated list headers β yeah, the last one gets the naming honour, that's just how it is π
π OPTIONS π
-hβ display the help message. love a self-aware king π-eβ use$CC -Efor checking instead of$CC -c. preprocessor mode, slay β¨-dβ delete cache and temporary files. full reset, no crumbs π§Ή-Dβ delete cache files. just the cache, not the temp files β read the difference carefully bestie, they are not the same flag π
π ENVIRONMENT π
CCβ the compiler. by defaultccis used.CPPFLAGS,CFLAGSβ options passed to the compiler. your flags, your rules πMKC_VERBOSEβ if set to1, verbose messages are output to stderr. set it and suddenly everything is narrating itself π£οΈMKC_SHOW_CACHEDβ if set to1andMKC_VERBOSEis set to1, cached results are output to stderr. note the and β both, or it does nothing, periodt πMKC_CACHEDIRβ directory where temporary and cache files are created. if unset, they are created in a current directory.MKC_NOCACHEβ all results are cached unlessMKC_NOCACHEvariable is set to1. yes, that's the direction it goes, don't invert it in your head, i've seen people do it πMKC_DELETE_TMPFILESβ if set to1, temporary files are removed.
β EXAMPLES β
mkc_check_header stdint.h
mkc_check_header getopt.h
mkc_check_header sys/types.h,sys/stat.h,fts.h
see that last one? comma-separated list, three headers, one compile. ate and left no crumbs π₯
π C FILE CONTENT π
this is what actually gets generated and fed to the compiler, verbatim:
#include <header1.h>
...
#include <headerN.h>
int __fake_variable;
yes, __fake_variable is doing absolutely nothing and yet it's the main character of this file. respect the process π
π§ AUTHOR π§
Aleksey Cheusov <vle@gmx.net> β legend, icon, and the reason this page exists π
okay that's the whole page bestie, you're basically an expert now πΈ and yeah β this was the MKC_CHECK_HEADER(1) page, dated Dec 2, 2023, from the MKC_CHECK_HEADER(1) manual, same name top and bottom because consistency is sexy β¨ bye ily π«Ά
π¦ where this page comes from
- alpine 3.24: mk-configure-doc 0.40.0-r1 Β· BSD-2-Clause
- arch rolling: mk-configure 0.40.3-1 Β· BSD
- opensuse-leap 16.0: mk-configure 0.39.3-bp160.1.12 Β· BSD-2-Clause AND MIT AND ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms