{"id":40468413,"url":"https://github.com/schierlm/gnu-autogen-bootstrapping","last_synced_at":"2026-01-20T18:14:08.403Z","repository":{"id":59779368,"uuid":"535075024","full_name":"schierlm/gnu-autogen-bootstrapping","owner":"schierlm","description":"Bootstrapping GNU Autogen without relying on pre-expanded code","archived":false,"fork":false,"pushed_at":"2024-01-09T21:52:52.000Z","size":67,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-01-09T22:54:26.827Z","etag":null,"topics":["autogen","bootstrappable","bootstrapping"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schierlm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-10T17:49:24.000Z","updated_at":"2023-05-21T16:04:33.000Z","dependencies_parsed_at":"2023-01-18T21:03:00.517Z","dependency_job_id":null,"html_url":"https://github.com/schierlm/gnu-autogen-bootstrapping","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/schierlm/gnu-autogen-bootstrapping","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schierlm%2Fgnu-autogen-bootstrapping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schierlm%2Fgnu-autogen-bootstrapping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schierlm%2Fgnu-autogen-bootstrapping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schierlm%2Fgnu-autogen-bootstrapping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schierlm","download_url":"https://codeload.github.com/schierlm/gnu-autogen-bootstrapping/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schierlm%2Fgnu-autogen-bootstrapping/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28608427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autogen","bootstrappable","bootstrapping"],"created_at":"2026-01-20T18:14:08.296Z","updated_at":"2026-01-20T18:14:08.387Z","avatar_url":"https://github.com/schierlm.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gnu-autogen-bootstrapping\nBootstrapping GNU Autogen without relying on pre-expanded code\n\nThis code is, as the original project, licensed under GNU General Public Licence, version 3 or later.\n\n## Challenge\n\nGNU Autogen is a template processor which is used extensively for creating its own source code.\nThe included bootstrapping script requires that the binaries `autogen`, `getdefs` and `columns`\n(using an older version is possible), as well as the template library `tpl-config.tlib`, are already present.\n\nThese binaries are then used to bootstrap the source code, which is later packaged to become the\nrelease tarball.\n\nThere are (at least) two files in the source tree (copyright update tool and CGI support), where the output file\nis at the same time one of the input file; tagged lines in the file are copied from the (old) output file\nto the (new) output file during template processing.\n\nAll the programs in the Autogen package use AutoOpts, which is also written in AutoGen, as command line\nparsing library. They also use generated `proto.h` files which include the prototypes extracted from the `.c`\nfiles.\n\nTo complicate matters more, the bootstrap scripts require the current source to be committed to git, with\nan annotated tag attached to the HEAD commit whose name has to follow autogen's version conventions. And\nthe scripts depend on some lines that get generated in the autoconf scripts, which are not there in the same\norder when regenerating those files using the Autoconf versions included in Debian bullseye.\n\nComparably trivial: To build some parts of Autogen, GUILE_VERSION needs to be defined as a decimal constant,\nusing two digits for the minor and three digits for the patch version. Just have a small C program output\nthe required definition after reading the version number from `\u003clibguile/version.h\u003e`.\n\n## Bootstrap binaries\n\nTo work around these challenges, we first build bootstrap versions of the three binaries with reduced\nfunctionality, yet powerful enough to run the bootstrap scripts.\n\nThe initial template library is built using a `sed` script (initial bootstrap does not need many parts of it) and is\nregenerated as soon as the configure scripts have run successfully.\n\nThe source code is patched to work around the autoconf line order issue, and committed to (local) git with tag `v5.18.987`.\n\nAll required `.c` files are all included in one main C file, and prototype headers are written manually (only including those\nprototypes that are actually required as forward declarations)\n\n## `columns`\n\nStarting with the easiest binary, `columns`. This binary \"just\" uses AutoOpts and very few prototypes.\n\n## `getdefs`\n\n`getdefs` also depends on prototypes and AutoOpts (including the streqvcmp function, which fortunately can be `#include`d directly);\nit also uses the Char Mapper, which is a huge lookup table for faster character classification and scanning. As the Char Mapper is\nalso required extensively in `autogen`, its logic has been rewritten in pure C (with some preprocessor magic) without requiring\nany code generation, as `agCharMap.c`. It is obviously slower than the lookup table approach, but in my opinion easier to read than\nthe original templates (and of course easier to read than the generated lookup tables).\n\n## `autogen`\n\nPrototypes and autoopts and streqvcmp and char mapper have to be handled here as well. As prototypes are used a bit more than in the\nprevious programs, they have been put into a separate \"agProto.h\" file, and bootstrap defines (usually coming from autoconf) went\nto `agBootstrap.c` alongside to the definitions used by the remaining parts of AutoOpts. If you are using an unusual setup, you\nmay have to change some defines in there, but the compile errors are obvious enough to find out what to change.\n\n`snprintfv` comes with its own bootstrap script, which fortunately does not depend on the autogen binary.\n\nThen there is `ag-text.[hc]`, a huge string table generated by autogen. The generation has been replaced by a Perl script.\n\nThere are also two state machines (`defParse.def`, `pseudo.def`) containing huge sparse transition arrays. They have been replaced\nby implementing the logic in pure C (like the char mapper).\n\nLast but not least, there are files generated from three generated lists (list of directives, list of functions, list of expressions).\nThe list of expressions is generated by a sed script, the other two are generated by `getdefs` (already bootstrapped).\nThe files generated from these files were bootstrapped by another Perl script.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschierlm%2Fgnu-autogen-bootstrapping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschierlm%2Fgnu-autogen-bootstrapping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschierlm%2Fgnu-autogen-bootstrapping/lists"}