summaryrefslogtreecommitdiff
path: root/build/unix/build.docs
blob: d24620b0320c0b40a918c87ca87798afb7fc9555 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
I've made this build system as a replacement for autoconf, autoheader,
automake, and aclocal as I found them to be too limiting and too slow.
This build system is not as complete as the auto* tools, but it's very
easy to extend.

Some of the most important differences between this system and autoconf:
- it has a menu-driven configuration
- when compiling, the current directory will never change
- the object files are stored in a seperate tree from the source files,
  leaving the latter clean, and easier grep-able.
- multiple object trees can be used, so you can have for instance a
  debugging tree and a release tree side by side.
- it builds faster, mostly because libtool isn't used.


The files
---------

These are the files in the directory with the build script.
Of these files only build.config should be modified for a specific build.
For unknown dependencies, additions to config_proginfo_build or
config_proginfo_host might need to be made. The other files should not
be modified.
Only build.sh is to be called directly.

ansi                   ansi colour definitions.
build.config           configuration options for the program to build.
                       It contains the description of the configuration
                       menu, and specifies the dependencies.
                       The format of the menu description is listed briefly
                       below.
build.sh               the sh script that is to be called for configuration,
                       building, and installation.
build_functions        auxiliary functions to build.sh for building.
config_functions       auxiliary functions to build.sh for configuration.
config_proginfo_build  contains descriptions of dependencies for the
                       system where the code is being built.
                       The information in this file is used in particular
                       for detecting if those libraries and other external
                       programs are present.
config_proginfo_host   contains descriptions of dependencies for the
                       system where the software will eventually be run.
                       The information in this file is used in particular
                       for detecting if those libraries and other external
                       programs are present.
menu_functions         auxiliary functions to build.sh for menus.


The menu (from build.config)
----------------------------

There are three types of menu items.

- Type MENU
  A menu with menu items.
  - Variables:
    - MENU_${NAME}_TITLE
      The title of the menu.
    - MENU_${NAME}_TEXT (optional)
      The text to show with the menu.
    - MENU_${NAME}_ITEMS
      The names of the menu items (space-seperated).
    - MENU_${NAME}_ITEM_${ITEMNAME}_TYPE
      The type of a menu item.
- Type CHOICE:
  A choice between several options.
  - Variables:
    - CHOICE_${NAME}_TITLE
      The title of the choice menu.
    - CHOICE_${NAME}_TEXT (optional)
      The text to show with the choice menu.
    - CHOICE_${NAME}_OPTIONS
      The names of the options (space-seperated).
    - CHOICE_${NAME}_OPTION_${OPTIONNAME}_TITLE
      The title of a menu option.
    - CHOICE_${NAME}_OPTION_${OPTIONNAME}_ACTION
      A command to be evaluated if this option is used.
    - CHOICE_${NAME}_OPTION_${OPTIONNAME}_VALID (set by the config program)
      0 if the choice has been verified to be a valid choice
      1 if the choice has been verified to be not a valid choice
      <empty> if the choice hasn't been verified to be valid
    - CHOICE_${NAME}_DEFAULT (optional)
      The default choice.
    - CHOICE_${NAME}_VALUE (set by the config program)
      The current choice.
- Type INPUT:
  A string that is user-definable.
  - Variables:
    - INPUT_${NAME}_TITLE
      The title of the input field.
    - INPUT_${NAME}_TEXT (optional)
      The text to show with the input field.
    - INPUT_${NAME}_VALIDATOR (optional)
      A function to call after the user supplied a new value which
      checks if the value is allowed. It should accept the new value as
      an argument, and return 1 if the value is not allowed, or return 0
      and output the (possibly modified) value, to accept it.
    - INPUT_${NAME}_DEFAULT (optional)
      The default value.
    - INPUT_${NAME}_VALUE (set by the config program)
      The current value.
    - INPUT_${NAME}_OLD_VALUE (set by the config program)
      The value as it was at the start of the config program.
- Type CHECK:
  An option that can either be on or off, like a checkbox.
  - Variables:
    - CHECK_${NAME}_TITLE
      The title of the input field.
    - CHECK_${NAME}_DEFAULT (optional)
      The default value, either 'CHECKED' or 'UNCHECKED'.
    - CHECK_${NAME}_VALUE (set by the config program)
      The current value, either 'CHECKED' or 'UNCHECKED'.
    - CHECK_${NAME}_FIXED (optional)
      A string that evaluates to 0 if this checkbox may not be changed.



Program info (from config_proginfo_build)
-----------------------------------------

Information about programs used should be supplied in the following form:
  - PROG_${PROGRAM}_NAME
    A string describing the program.
  - PROG_${PROGRAM}_FILE
    A string that evaluates to the executable that should be present if
    this program is used.
  - PROG_${PROGRAM}_ACTION (optional)
    A command to be executed if this program is used, after the user is
    done configuring.
  - PROG_${PROGRAM}_DETECT (optional)
    A command to be executed which should return 0 if the program is present
    on the system, 1 if it is not present, or 2 to fallback to the default
    detection. If no detect function was set, or it returned 2, 'type' is
    used to check for the program in the path.
    This command may include a shell command that modifies any of the
    variables PROG_${PROGRAM}_FILE, PROG_${PROGRAM}_ACTION, or
    PROG_${PROGRAM}_VERSION.
  - PROG_${LIB}_DEPEND_DETECT_BIN (optional)
    A list of space-separated binaries the detection of this program
    depends on.
  - PROG_${LIB}_DEPEND_DETECT_LIB (optional)
    A list of space-separated libraries the detection of this program
    depends on.
  - PROG_${PROGRAM}_VERSION (optional)
    A string that evaluates to the version of the executable that is
    present, if it is present.
  - PROG_${PROGRAM}_PRESENT (set by the configuration program)
    0 if the program has been verified to be present
    1 if the program has been verified to be not present
    <empty> if presence of the program hasn't been verified

Information about build tools in general (say "a C compiler"), where you're
not interested in what program is actually called, should be supplied in
the following corm:
  - BUILDTOOL_${TOOL}_NAME
    A string describing the build tool.
  - BUILDTOOL_${TOOL}_COMMAND
    The command, with arguments, that is to be executed to run this tool.
  - BUILDTOOL_${TOOL}_DEPEND
    A whitespace separated list of programs (as described above)
    that this tool depends on.
  - BUILDTOOL_${TOOL}_PRESENT (set by the configuration program)
    0 if the tool has been verified to be present
    1 if the tool has been verified to be not present
    <empty> if presence of the tool hasn't been verified
Each tool described, once detected, will be available through the environment
variable with the name as specified in $TOOL.


Library info (from config_proginfo_host)
-----------------------------------------

Information about libraries used should be supplied in the following form:
  - LIB_${LIB}_NAME
    A string describing the program.
  - LIB_${LIB}_CFLAGS
    A string which evaluates to the string to add to CFLAGS if this library
    is used.
  - LIB_${LIB}_LDLAGS
    A string which evaluates to the string to add to LDLAGS if this library
    is used.
  - PROG_${LIB}_DETECT (optional)
    A command to be executed which should return 0 if the library is present
    on the system, 1 if it is not present, or 2 to fallback to the default
    detection. If no detect function was set, or it returned 2,
    an attempt is made to compile and link an empty C program with
    the flags as in LIB_${LIB}_CFLAGS and LIB_${LIB}_LDFLAGS.
    This command may include a shell command that modifies any of the
    variables PROG_${LIB}_CFLAGS, PROG_${LIB}_LDFLAGS, or
    PROG_${LIB}_VERSION.
  - LIB_${LIB}_DEPEND_DETECT_BIN (optional)
    A list of space-separated binaries the detection of this library depends
    on.
  - LIB_${LIB}_DEPEND_DETECT_LIB (optional)
    A list of space-separated libraries the detection of this library depends
    on.
  - LIB_${LIB}_VERSION (optional)
    A string that evaluates to the version of the library that is
    present, if it is present.
  - LIB_${LIB}_PRESENT (set by the configuration program)
    0 if the library has been verified to be present
    1 if the library has been verified to be not present
    <empty> if presence of the library hasn't been verified