Git Product home page Git Product logo

gnu-autogen-bootstrapping's Introduction

gnu-autogen-bootstrapping

Bootstrapping GNU Autogen without relying on pre-expanded code

This code is, as the original project, licensed under GNU General Public Licence, version 3 or later.

Challenge

GNU Autogen is a template processor which is used extensively for creating its own source code. The included bootstrapping script requires that the binaries autogen, getdefs and columns (using an older version is possible), as well as the template library tpl-config.tlib, are already present.

These binaries are then used to bootstrap the source code, which is later packaged to become the release tarball.

There are (at least) two files in the source tree (copyright update tool and CGI support), where the output file is at the same time one of the input file; tagged lines in the file are copied from the (old) output file to the (new) output file during template processing.

All the programs in the Autogen package use AutoOpts, which is also written in AutoGen, as command line parsing library. They also use generated proto.h files which include the prototypes extracted from the .c files.

To complicate matters more, the bootstrap scripts require the current source to be committed to git, with an annotated tag attached to the HEAD commit whose name has to follow autogen's version conventions. And the scripts depend on some lines that get generated in the autoconf scripts, which are not there in the same order when regenerating those files using the Autoconf versions included in Debian bullseye.

Comparably trivial: To build some parts of Autogen, GUILE_VERSION needs to be defined as a decimal constant, using two digits for the minor and three digits for the patch version. Just have a small C program output the required definition after reading the version number from <libguile/version.h>.

Bootstrap binaries

To work around these challenges, we first build bootstrap versions of the three binaries with reduced functionality, yet powerful enough to run the bootstrap scripts.

The initial template library is built using a sed script (initial bootstrap does not need many parts of it) and is regenerated as soon as the configure scripts have run successfully.

The source code is patched to work around the autoconf line order issue, and committed to (local) git with tag v5.18.987.

All required .c files are all included in one main C file, and prototype headers are written manually (only including those prototypes that are actually required as forward declarations)

columns

Starting with the easiest binary, columns. This binary "just" uses AutoOpts and very few prototypes.

getdefs

getdefs also depends on prototypes and AutoOpts (including the streqvcmp function, which fortunately can be #included directly); it also uses the Char Mapper, which is a huge lookup table for faster character classification and scanning. As the Char Mapper is also required extensively in autogen, its logic has been rewritten in pure C (with some preprocessor magic) without requiring any code generation, as agCharMap.c. It is obviously slower than the lookup table approach, but in my opinion easier to read than the original templates (and of course easier to read than the generated lookup tables).

autogen

Prototypes and autoopts and streqvcmp and char mapper have to be handled here as well. As prototypes are used a bit more than in the previous programs, they have been put into a separate "agProto.h" file, and bootstrap defines (usually coming from autoconf) went to agBootstrap.c alongside to the definitions used by the remaining parts of AutoOpts. If you are using an unusual setup, you may have to change some defines in there, but the compile errors are obvious enough to find out what to change.

snprintfv comes with its own bootstrap script, which fortunately does not depend on the autogen binary.

Then there is ag-text.[hc], a huge string table generated by autogen. The generation has been replaced by a Perl script.

There are also two state machines (defParse.def, pseudo.def) containing huge sparse transition arrays. They have been replaced by implementing the logic in pure C (like the char mapper).

Last but not least, there are files generated from three generated lists (list of directives, list of functions, list of expressions). The list of expressions is generated by a sed script, the other two are generated by getdefs (already bootstrapped). The files generated from these files were bootstrapped by another Perl script.

gnu-autogen-bootstrapping's People

Contributors

googulator avatar schierlm avatar stikonas avatar

Stargazers

 avatar

Watchers

 avatar  avatar

gnu-autogen-bootstrapping's Issues

Examples uses of this tool

Hey.

I've just found this tool after looking into this issue my self during work.

We build packages in Sailfish OS usually from version control sources where we would autogen without autogen if possible to not have a circular dependency.

Is there any project that shows this project in action or will maybe even be submitted to autogen itself?

Reproducible build

I can now run this in live-bootstrap. However builds seed to be non-reproducible. It's probably best to fix them here.

│ ├── ./usr/share/man/man3/strtransform.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH strtransform 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH strtransform 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (strtransform.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  strtransform - convert a string into its mapped-to value
│ ├── ./usr/share/man/man3/strneqvcmp.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH strneqvcmp 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH strneqvcmp 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (strneqvcmp.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  strneqvcmp - compare two strings with an equivalence mapping
│ ├── ./usr/share/man/man3/streqvmap.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH streqvmap 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH streqvmap 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (streqvmap.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  streqvmap - Set the character mappings for the streqv functions
│ ├── ./usr/share/man/man3/streqvcmp.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH streqvcmp 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH streqvcmp 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (streqvcmp.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  streqvcmp - compare two strings with an equivalence mapping
│ ├── ./usr/share/man/man3/strequate.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH strequate 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH strequate 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (strequate.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  strequate - map a list of characters to the same value
│ ├── ./usr/share/man/man3/optionVersion.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionVersion 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionVersion 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionVersion.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionVersion - return the compiled AutoOpts version number
│ ├── ./usr/share/man/man3/optionUnloadNested.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionUnloadNested 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionUnloadNested 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionUnloadNested.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionUnloadNested - Deallocate the memory for a nested value
│ ├── ./usr/share/man/man3/optionSaveState.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionSaveState 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionSaveState 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionSaveState.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionSaveState - saves the option state to memory
│ ├── ./usr/share/man/man3/optionSaveFile.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionSaveFile 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionSaveFile 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionSaveFile.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionSaveFile - saves the option state to a file
│ ├── ./usr/share/man/man3/optionRestore.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionRestore 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionRestore 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionRestore.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionRestore - restore option state from memory copy
│ ├── ./usr/share/man/man3/optionProcess.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionProcess 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionProcess 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionProcess.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionProcess - this is the main option processing routine
│ ├── ./usr/share/man/man3/optionPrintVersionAndReturn.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionPrintVersionAndReturn 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionPrintVersionAndReturn 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionPrintVersionAndReturn.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionPrintVersionAndReturn - Print the program version
│ ├── ./usr/share/man/man3/optionPrintVersion.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionPrintVersion 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionPrintVersion 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionPrintVersion.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionPrintVersion - Print the program version
│ ├── ./usr/share/man/man3/optionOnlyUsage.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionOnlyUsage 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionOnlyUsage 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionOnlyUsage.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionOnlyUsage - Print usage text for just the options
│ ├── ./usr/share/man/man3/optionNextValue.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionNextValue 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionNextValue 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionNextValue.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionNextValue - get the next value from a hierarchical list
│ ├── ./usr/share/man/man3/optionMemberList.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionMemberList 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionMemberList 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionMemberList.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionMemberList - Get the list of members of a bit mask set
│ ├── ./usr/share/man/man3/optionLoadLine.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionLoadLine 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionLoadLine 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionLoadLine.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionLoadLine - process a string for an option name and value
│ ├── ./usr/share/man/man3/optionGetValue.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionGetValue 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionGetValue 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionGetValue.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionGetValue - get a specific value from a hierarcical list
│ ├── ./usr/share/man/man3/optionFree.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionFree 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionFree 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionFree.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionFree - free allocated option processing memory
│ ├── ./usr/share/man/man3/optionFindValue.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionFindValue 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionFindValue 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionFindValue.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionFindValue - find a hierarcicaly valued option instance
│ ├── ./usr/share/man/man3/optionFindNextValue.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionFindNextValue 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionFindNextValue 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionFindNextValue.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionFindNextValue - find a hierarcicaly valued option instance
│ ├── ./usr/share/man/man3/optionFileLoad.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH optionFileLoad 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH optionFileLoad 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (optionFileLoad.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  optionFileLoad - Load the locatable config files, in order
│ ├── ./usr/share/man/man3/configFileLoad.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH configFileLoad 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH configFileLoad 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (configFileLoad.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  configFileLoad - parse a configuration file
│ ├── ./usr/share/man/man3/ao_string_tokenize.3
│ │ @@ -1,8 +1,8 @@
│ │ -.TH ao_string_tokenize 3 2022-09-24 "" "Programmer's Manual"
│ │ +.TH ao_string_tokenize 3 2022-09-25 "" "Programmer's Manual"
│ │  .\"  DO NOT EDIT THIS FILE   (ao_string_tokenize.3)
│ │  .\"
│ │  .\"  It has been AutoGen-ed
│ │  .\"  From the definitions    ./funcs.def
│ │  .\"  and the template file   agman3.tpl
│ │  .SH NAME
│ │  ao_string_tokenize - tokenize an input string
│ ├── ./usr/share/man/man1/getdefs.1
│ │ @@ -6,15 +6,15 @@
│ │  .ds B-Font [CB]
│ │  .ds I-Font [CI]
│ │  .ds R-Font [CR]
│ │  .el \
│ │  .ds B-Font B
│ │  .ds I-Font I
│ │  .ds R-Font R
│ │ -.TH getdefs 1 "24 Sep 2022" "GNU AutoGen (1.5)" "User Commands"
│ │ +.TH getdefs 1 "25 Sep 2022" "GNU AutoGen (1.5)" "User Commands"
│ │  .\"
│ │  .\" DO NOT EDIT THIS FILE (in-mem file)
│ │  .\"
│ │  .\" It has been AutoGen-ed
│ │  .\" From the definitions ./opts.def
│ │  .\" and the template file agman-cmd
│ │  .SH NAME
│ ├── ./usr/share/man/man1/columns.1
│ │ @@ -6,15 +6,15 @@
│ │  .ds B-Font [CB]
│ │  .ds I-Font [CI]
│ │  .ds R-Font [CR]
│ │  .el \
│ │  .ds B-Font B
│ │  .ds I-Font I
│ │  .ds R-Font R
│ │ -.TH columns 1 "24 Sep 2022" "GNU AutoGen (1.2)" "User Commands"
│ │ +.TH columns 1 "25 Sep 2022" "GNU AutoGen (1.2)" "User Commands"
│ │  .\"
│ │  .\" DO NOT EDIT THIS FILE (in-mem file)
│ │  .\"
│ │  .\" It has been AutoGen-ed
│ │  .\" From the definitions ./opts.def
│ │  .\" and the template file agman-cmd.tpl
│ │  .SH NAME
│ ├── ./usr/share/man/man1/autoopts-config.1
│ │ @@ -2,15 +2,15 @@
│ │  \"
│ │  \" DO NOT EDIT THIS FILE   (autoopts-config.1)
│ │  \"
│ │  \" It has been AutoGen-ed
│ │  \" From the definitions    aoconf.def
│ │  \" and the template file   aoconf.tpl
│ │  \"
│ │ -.TH autoopts-config 1 2022-09-24 "" "Programmer's Manual"
│ │ +.TH autoopts-config 1 2022-09-25 "" "Programmer's Manual"
│ │  .SH NAME
│ │  autoopts-config \- script to get information about installed version of
│ │  autoopts
│ │  .SH SYNOPSIS
│ │  .B autoopts-config
│ │  .B { <value-name> [...] | everything }
│ │  .PP
│ ├── ./usr/share/man/man1/autogen.1
│ │ @@ -6,17 +6,17 @@
│ │  .ds B-Font [CB]
│ │  .ds I-Font [CI]
│ │  .ds R-Font [CR]
│ │  .el \
│ │  .ds B-Font B
│ │  .ds I-Font I
│ │  .ds R-Font R
│ │ -.TH autogen 1 "24 Sep 2022" "GNU AutoGen (5.18.987)" "User Commands"
│ │ +.TH autogen 1 "25 Sep 2022" "GNU AutoGen (5.18.987)" "User Commands"
│ │  .\"
│ │ -.\" DO NOT EDIT THIS FILE (/tmp/.ag-y9RbGU/ag-noigLJ)
│ │ +.\" DO NOT EDIT THIS FILE (/tmp/.ag-j5fNBt/ag-obBogn)
│ │  .\"
│ │  .\" It has been AutoGen-ed
│ │  .\" From the definitions /usr/src/autogen-5.18.16/build/gnu-autogen-bootstrapping-autogen-5.18.16-v1.0/build/tarball/agen5/opts.def
│ │  .\" and the template file agman-cmd
│ │  .SH NAME
│ │  \f\*[B-Font]autogen\fP
│ │  \- The Automated Program Generator
│ ├── ./usr/share/autogen/libopts-42.1.17.tar.gz
│ │ ├── libopts-42.1.17.tar
│ │ │ ├── libopts-42.1.17/ag-char-map.h
│ │ │ │ @@ -1,10 +1,10 @@
│ │ │ │  /*
│ │ │ │   *  29 bits for 46 character classifications
│ │ │ │ - *  generated by char-mapper on 09/24/22 at 22:38:49
│ │ │ │ + *  generated by char-mapper on 09/25/22 at 10:17:59
│ │ │ │   *
│ │ │ │   *  This file contains the character classifications
│ │ │ │   *  used by AutoGen and AutoOpts for identifying tokens.
│ │ │ │   *  The table is static scope, so %guard is empty.
│ │ │ │   *
│ │ │ │   *  This file is part of AutoOpts, a companion to AutoGen.
│ │ │ │   *  AutoOpts is free software.
│ │ │ ├── libopts-42.1.17/proto.h
│ │ │ │ @@ -1,11 +1,11 @@
│ │ │ │  /* -*- buffer-read-only: t -*- vi: set ro:
│ │ │ │   *
│ │ │ │   * Prototypes for autoopts
│ │ │ │ - * Generated Sat Sep 24 22:39:04 UTC 2022
│ │ │ │ + * Generated Sun Sep 25 10:18:16 UTC 2022
│ │ │ │   */
│ │ │ │  #ifndef AUTOOPTS_PROTO_H_GUARD
│ │ │ │  #define AUTOOPTS_PROTO_H_GUARD 1
│ │ │ │  
│ │ │ │  
│ │ │ │  /*
│ │ │ │   * Static declarations from alias.c
│ │ │ ├── libopts-42.1.17/save-flags.c
│ │ │ │ @@ -1,13 +1,13 @@
│ │ │ │  /*   -*- buffer-read-only: t -*- vi: set ro:
│ │ │ │   *
│ │ │ │   *  DO NOT EDIT THIS FILE   (save-flags.c)
│ │ │ │   *
│ │ │ │   *  It has been AutoGen-ed
│ │ │ │ - *  From the definitions    /tmp/.ag-Y9GvMW/save-flags.def
│ │ │ │ + *  From the definitions    /tmp/.ag-6n5Voa/save-flags.def
│ │ │ │   *  and the template file   str2enum
│ │ │ │   *
│ │ │ │   * Redistribution and use in source and binary forms, with or without
│ │ │ │   * modification, are permitted provided that the following conditions
│ │ │ │   * are met:
│ │ │ │   * 1. Redistributions of source code must retain the above copyright
│ │ │ │   *    notice, this list of conditions and the following disclaimer.
│ │ │ ├── libopts-42.1.17/save-flags.h
│ │ │ │ @@ -1,13 +1,13 @@
│ │ │ │  /*   -*- buffer-read-only: t -*- vi: set ro:
│ │ │ │   *
│ │ │ │   *  DO NOT EDIT THIS FILE   (save-flags.h)
│ │ │ │   *
│ │ │ │   *  It has been AutoGen-ed
│ │ │ │ - *  From the definitions    /tmp/.ag-Y9GvMW/save-flags.def
│ │ │ │ + *  From the definitions    /tmp/.ag-6n5Voa/save-flags.def
│ │ │ │   *  and the template file   str2enum
│ │ │ │   *
│ │ │ │   * Redistribution and use in source and binary forms, with or without
│ │ │ │   * modification, are permitted provided that the following conditions
│ │ │ │   * are met:
│ │ │ │   * 1. Redistributions of source code must retain the above copyright
│ │ │ │   *    notice, this list of conditions and the following disclaimer.
│ ├── ./usr/bin/autogen
│ │ ├── objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text {}
│ │ │ @@ -24874,15 +24874,15 @@
│ │ │   add    $0x340,%eax
│ │ │   mov    0x10(%eax),%eax
│ │ │   and    $0xf,%eax
│ │ │   test   %eax,%eax
│ │ │   jne    8089015 <process_ag_opts+0x128>
│ │ │   mov    0x81a21a4,%eax
│ │ │   add    $0x340,%eax
│ │ │ - movl   $0x5,0x18(%eax)
│ │ │ + movl   $0x6,0x18(%eax)
│ │ │   mov    0x81a21a4,%eax
│ │ │   add    $0xc0,%eax
│ │ │   mov    0x10(%eax),%eax
│ │ │   and    $0x20,%eax
│ │ │   test   %eax,%eax
│ │ │   je     8089047 <process_ag_opts+0x15a>
│ │ │   mov    0x81a21a4,%eax

So a few different issues:

  • Date in manpages: a simple patch in autoopts/tpl/agman3.tpl should fix that.
  • Temp file path in generated text. We can either remove it completely from agen5/ag-text.def (probably easier) or stabilize path of temp file. Or possibly just remove them after generation in save-flags.c and proto.h. That has a benefit of still printing original .def file in all other cases where it might be desirable.
  • Some difference in autogen binary itself. I haven't debugged this yet., though it seems to be coming from:
    OPT_ARG(TIMEOUT) = (char const *)AG_DEFAULT_TIMEOUT; line in agUtils.c
    I think it eventually comes from configure.ac.pre where there is this block exists
time_delta=`expr ${config_end_time} - ${config_start_time} 2>/dev/null
if test -z "${AG_TIMEOUT}"
then
  if test -z "${time_delta}"
  then time_delta=10
  elif test ${time_delta} -lt 5
  then time_delta=5 ; fi

  AG_TIMEOUT=${time_delta}
fi

Let's split into two stages

I suggest that we have an option to exit bootstrapping script once columns, getdefs, autogen and config-tpl.tlib are built.

So then stage1 would be bootstrapping and stage2 is just a normal build.

Add an option to build with statically linked Guile

gcc -std=gnu99 -DGUILE_VERSION=$(./getGuileVersion) -DLIBDATADIR=\"$PREFIX/lib/autogen\" ../../../agBootstrap.c -I . -I .. -I ../../.. $(pkg-config guile-"${GUILE_VERSION}" --cflags) -o $PREFIX/bin/autogen $(pkg-config guile-"${GUILE_VERSION}" --libs)

Should be as simple as adding variable
$(pkg-config guile-"${GUILE_VERSION}" --libs ${STATIC})
where STATIC="--static" for static build or empty for dynamic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.