README 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. Intro
  2. =====
  3. This directory contains a few sets of files that are used for
  4. configuration in diverse ways:
  5. *.conf Target platform configurations, please read
  6. 'Configurations of OpenSSL target platforms' for more
  7. information.
  8. *.tmpl Build file templates, please read 'Build-file
  9. programming with the "unified" build system' as well
  10. as 'Build info files' for more information.
  11. *.pm Helper scripts / modules for the main `Configure`
  12. script. See 'Configure helper scripts for more
  13. information.
  14. Configurations of OpenSSL target platforms
  15. ==========================================
  16. Configuration targets are a collection of facts that we know about
  17. different platforms and their capabilities. We organise them in a
  18. hash table, where each entry represent a specific target.
  19. Note that configuration target names must be unique across all config
  20. files. The Configure script does check that a config file doesn't
  21. have config targets that shadow config targets from other files.
  22. In each table entry, the following keys are significant:
  23. inherit_from => Other targets to inherit values from.
  24. Explained further below. [1]
  25. template => Set to 1 if this isn't really a platform
  26. target. Instead, this target is a template
  27. upon which other targets can be built.
  28. Explained further below. [1]
  29. sys_id => System identity for systems where that
  30. is difficult to determine automatically.
  31. enable => Enable specific configuration features.
  32. This MUST be an array of words.
  33. disable => Disable specific configuration features.
  34. This MUST be an array of words.
  35. Note: if the same feature is both enabled
  36. and disabled, disable wins.
  37. as => The assembler command. This is not always
  38. used (for example on Unix, where the C
  39. compiler is used instead).
  40. asflags => Default assembler command flags [4].
  41. cpp => The C preprocessor command, normally not
  42. given, as the build file defaults are
  43. usually good enough.
  44. cppflags => Default C preprocessor flags [4].
  45. defines => As an alternative, macro definitions may be
  46. given here instead of in `cppflags' [4].
  47. If given here, they MUST be as an array of
  48. the string such as "MACRO=value", or just
  49. "MACRO" for definitions without value.
  50. includes => As an alternative, inclusion directories
  51. may be given here instead of in `cppflags'
  52. [4]. If given here, the MUST be an array
  53. of strings, one directory specification
  54. each.
  55. cc => The C compiler command, usually one of "cc",
  56. "gcc" or "clang". This command is normally
  57. also used to link object files and
  58. libraries into the final program.
  59. cxx => The C++ compiler command, usually one of
  60. "c++", "g++" or "clang++". This command is
  61. also used when linking a program where at
  62. least one of the object file is made from
  63. C++ source.
  64. cflags => Defaults C compiler flags [4].
  65. cxxflags => Default C++ compiler flags [4]. If unset,
  66. it gets the same value as cflags.
  67. (linking is a complex thing, see [3] below)
  68. ld => Linker command, usually not defined
  69. (meaning the compiler command is used
  70. instead).
  71. (NOTE: this is here for future use, it's
  72. not implemented yet)
  73. lflags => Default flags used when linking apps,
  74. shared libraries or DSOs [4].
  75. ex_libs => Extra libraries that are needed when
  76. linking shared libraries, DSOs or programs.
  77. The value is also assigned to Libs.private
  78. in $(libdir)/pkgconfig/libcrypto.pc.
  79. shared_cppflags => Extra C preprocessor flags used when
  80. processing C files for shared libraries.
  81. shared_cflag => Extra C compiler flags used when compiling
  82. for shared libraries, typically something
  83. like "-fPIC".
  84. shared_ldflag => Extra linking flags used when linking
  85. shared libraries.
  86. module_cppflags
  87. module_cflags
  88. module_ldflags => Has the same function as the corresponding
  89. `shared_' attributes, but for building DSOs.
  90. When unset, they get the same values as the
  91. corresponding `shared_' attributes.
  92. ar => The library archive command, the default is
  93. "ar".
  94. (NOTE: this is here for future use, it's
  95. not implemented yet)
  96. arflags => Flags to be used with the library archive
  97. command. On Unix, this includes the
  98. command letter, 'r' by default.
  99. ranlib => The library archive indexing command, the
  100. default is 'ranlib' it it exists.
  101. unistd => An alternative header to the typical
  102. '<unistd.h>'. This is very rarely needed.
  103. shared_extension => File name extension used for shared
  104. libraries.
  105. obj_extension => File name extension used for object files.
  106. On unix, this defaults to ".o" (NOTE: this
  107. is here for future use, it's not
  108. implemented yet)
  109. exe_extension => File name extension used for executable
  110. files. On unix, this defaults to "" (NOTE:
  111. this is here for future use, it's not
  112. implemented yet)
  113. shlib_variant => A "variant" identifier inserted between the base
  114. shared library name and the extension. On "unixy"
  115. platforms (BSD, Linux, Solaris, MacOS/X, ...) this
  116. supports installation of custom OpenSSL libraries
  117. that don't conflict with other builds of OpenSSL
  118. installed on the system. The variant identifier
  119. becomes part of the SONAME of the library and also
  120. any symbol versions (symbol versions are not used or
  121. needed with MacOS/X). For example, on a system
  122. where a default build would normally create the SSL
  123. shared library as 'libssl.so -> libssl.so.1.1' with
  124. the value of the symlink as the SONAME, a target
  125. definition that sets 'shlib_variant => "-abc"' will
  126. create 'libssl.so -> libssl-abc.so.1.1', again with
  127. an SONAME equal to the value of the symlink. The
  128. symbol versions associated with the variant library
  129. would then be 'OPENSSL_ABC_<version>' rather than
  130. the default 'OPENSSL_<version>'. The string inserted
  131. into symbol versions is obtained by mapping all
  132. letters in the "variant" identifier to upper case
  133. and all non-alphanumeric characters to '_'.
  134. thread_scheme => The type of threads is used on the
  135. configured platform. Currently known
  136. values are "(unknown)", "pthreads",
  137. "uithreads" (a.k.a solaris threads) and
  138. "winthreads". Except for "(unknown)", the
  139. actual value is currently ignored but may
  140. be used in the future. See further notes
  141. below [2].
  142. dso_scheme => The type of dynamic shared objects to build
  143. for. This mostly comes into play with
  144. engines, but can be used for other purposes
  145. as well. Valid values are "DLFCN"
  146. (dlopen() et al), "DLFCN_NO_H" (for systems
  147. that use dlopen() et al but do not have
  148. fcntl.h), "DL" (shl_load() et al), "WIN32"
  149. and "VMS".
  150. perlasm_scheme => The perlasm method used to create the
  151. assembler files used when compiling with
  152. assembler implementations.
  153. shared_target => The shared library building method used.
  154. This serves multiple purposes:
  155. - as index for targets found in shared_info.pl.
  156. - as linker script generation selector.
  157. To serve both purposes, the index for shared_info.pl
  158. should end with '-shared', and this suffix will be
  159. removed for use as a linker script generation
  160. selector. Note that the latter is only used if
  161. 'shared_defflag' is defined.
  162. build_scheme => The scheme used to build up a Makefile.
  163. In its simplest form, the value is a string
  164. with the name of the build scheme.
  165. The value may also take the form of a list
  166. of strings, if the build_scheme is to have
  167. some options. In this case, the first
  168. string in the list is the name of the build
  169. scheme.
  170. Currently recognised build scheme is "unified".
  171. For the "unified" build scheme, this item
  172. *must* be an array with the first being the
  173. word "unified" and the second being a word
  174. to identify the platform family.
  175. multilib => On systems that support having multiple
  176. implementations of a library (typically a
  177. 32-bit and a 64-bit variant), this is used
  178. to have the different variants in different
  179. directories.
  180. bn_ops => Building options (was just bignum options in
  181. the earlier history of this option, hence the
  182. name). This is a string of words that describe
  183. algorithms' implementation parameters that
  184. are optimal for the designated target platform,
  185. such as the type of integers used to build up
  186. the bignum, different ways to implement certain
  187. ciphers and so on. To fully comprehend the
  188. meaning, the best is to read the affected
  189. source.
  190. The valid words are:
  191. THIRTY_TWO_BIT bignum limbs are 32 bits,
  192. this is default if no
  193. option is specified, it
  194. works on any supported
  195. system [unless "wider"
  196. limb size is implied in
  197. assembly code];
  198. BN_LLONG bignum limbs are 32 bits,
  199. but 64-bit 'unsigned long
  200. long' is used internally
  201. in calculations;
  202. SIXTY_FOUR_BIT_LONG bignum limbs are 64 bits
  203. and sizeof(long) is 8;
  204. SIXTY_FOUR_BIT bignums limbs are 64 bits,
  205. but execution environment
  206. is ILP32;
  207. RC4_CHAR RC4 key schedule is made
  208. up of 'unsigned char's;
  209. RC4_INT RC4 key schedule is made
  210. up of 'unsigned int's;
  211. EXPORT_VAR_AS_FN for shared libraries,
  212. export vars as
  213. accessor functions.
  214. apps_aux_src => Extra source to build apps/openssl and other
  215. apps, as needed by the target and that can be
  216. collected in a library.
  217. apps_init_src => Init source to build apps/openssl and other
  218. apps, as needed by the target. This code
  219. cannot be placed in a library, as the rest
  220. of the code isn't expected to link to it
  221. explicitly.
  222. cpuid_asm_src => assembler implementation of cpuid code as
  223. well as OPENSSL_cleanse().
  224. Default to mem_clr.c
  225. bn_asm_src => Assembler implementation of core bignum
  226. functions.
  227. Defaults to bn_asm.c
  228. ec_asm_src => Assembler implementation of core EC
  229. functions.
  230. des_asm_src => Assembler implementation of core DES
  231. encryption functions.
  232. Defaults to 'des_enc.c fcrypt_b.c'
  233. aes_asm_src => Assembler implementation of core AES
  234. functions.
  235. Defaults to 'aes_core.c aes_cbc.c'
  236. bf_asm_src => Assembler implementation of core BlowFish
  237. functions.
  238. Defaults to 'bf_enc.c'
  239. md5_asm_src => Assembler implementation of core MD5
  240. functions.
  241. sha1_asm_src => Assembler implementation of core SHA1,
  242. functions, and also possibly SHA256 and
  243. SHA512 ones.
  244. cast_asm_src => Assembler implementation of core CAST
  245. functions.
  246. Defaults to 'c_enc.c'
  247. rc4_asm_src => Assembler implementation of core RC4
  248. functions.
  249. Defaults to 'rc4_enc.c rc4_skey.c'
  250. rmd160_asm_src => Assembler implementation of core RMD160
  251. functions.
  252. rc5_asm_src => Assembler implementation of core RC5
  253. functions.
  254. Defaults to 'rc5_enc.c'
  255. wp_asm_src => Assembler implementation of core WHIRLPOOL
  256. functions.
  257. cmll_asm_src => Assembler implementation of core CAMELLIA
  258. functions.
  259. Defaults to 'camellia.c cmll_misc.c cmll_cbc.c'
  260. modes_asm_src => Assembler implementation of cipher modes,
  261. currently the functions gcm_gmult_4bit and
  262. gcm_ghash_4bit.
  263. padlock_asm_src => Assembler implementation of core parts of
  264. the padlock engine. This is mandatory on
  265. any platform where the padlock engine might
  266. actually be built.
  267. [1] as part of the target configuration, one can have a key called
  268. 'inherit_from' that indicate what other configurations to inherit
  269. data from. These are resolved recursively.
  270. Inheritance works as a set of default values that can be overridden
  271. by corresponding key values in the inheriting configuration.
  272. Note 1: any configuration table can be used as a template.
  273. Note 2: pure templates have the attribute 'template => 1' and
  274. cannot be used as build targets.
  275. If several configurations are given in the 'inherit_from' array,
  276. the values of same attribute are concatenated with space
  277. separation. With this, it's possible to have several smaller
  278. templates for different configuration aspects that can be combined
  279. into a complete configuration.
  280. instead of a scalar value or an array, a value can be a code block
  281. of the form 'sub { /* your code here */ }'. This code block will
  282. be called with the list of inherited values for that key as
  283. arguments. In fact, the concatenation of strings is really done
  284. by using 'sub { join(" ",@_) }' on the list of inherited values.
  285. An example:
  286. "foo" => {
  287. template => 1,
  288. haha => "ha ha",
  289. hoho => "ho",
  290. ignored => "This should not appear in the end result",
  291. },
  292. "bar" => {
  293. template => 1,
  294. haha => "ah",
  295. hoho => "haho",
  296. hehe => "hehe"
  297. },
  298. "laughter" => {
  299. inherit_from => [ "foo", "bar" ],
  300. hehe => sub { join(" ",(@_,"!!!")) },
  301. ignored => "",
  302. }
  303. The entry for "laughter" will become as follows after processing:
  304. "laughter" => {
  305. haha => "ha ha ah",
  306. hoho => "ho haho",
  307. hehe => "hehe !!!",
  308. ignored => ""
  309. }
  310. [2] OpenSSL is built with threading capabilities unless the user
  311. specifies 'no-threads'. The value of the key 'thread_scheme' may
  312. be "(unknown)", in which case the user MUST give some compilation
  313. flags to Configure.
  314. [3] OpenSSL has three types of things to link from object files or
  315. static libraries:
  316. - shared libraries; that would be libcrypto and libssl.
  317. - shared objects (sometimes called dynamic libraries); that would
  318. be the engines.
  319. - applications; those are apps/openssl and all the test apps.
  320. Very roughly speaking, linking is done like this (words in braces
  321. represent the configuration settings documented at the beginning
  322. of this file):
  323. shared libraries:
  324. {ld} $(CFLAGS) {lflags} {shared_ldflag} -o libfoo.so \
  325. foo/something.o foo/somethingelse.o {ex_libs}
  326. shared objects:
  327. {ld} $(CFLAGS) {lflags} {module_ldflags} -o libeng.so \
  328. blah1.o blah2.o -lcrypto {ex_libs}
  329. applications:
  330. {ld} $(CFLAGS) {lflags} -o app \
  331. app1.o utils.o -lssl -lcrypto {ex_libs}
  332. [4] There are variants of these attribute, prefixed with `lib_',
  333. `dso_' or `bin_'. Those variants replace the unprefixed attribute
  334. when building library, DSO or program modules specifically.
  335. Historically, the target configurations came in form of a string with
  336. values separated by colons. This use is deprecated. The string form
  337. looked like this:
  338. "target" => "{cc}:{cflags}:{unistd}:{thread_cflag}:{sys_id}:{lflags}:{bn_ops}:{cpuid_obj}:{bn_obj}:{ec_obj}:{des_obj}:{aes_obj}:{bf_obj}:{md5_obj}:{sha1_obj}:{cast_obj}:{rc4_obj}:{rmd160_obj}:{rc5_obj}:{wp_obj}:{cmll_obj}:{modes_obj}:{padlock_obj}:{perlasm_scheme}:{dso_scheme}:{shared_target}:{shared_cflag}:{shared_ldflag}:{shared_extension}:{ranlib}:{arflags}:{multilib}"
  339. Build info files
  340. ================
  341. The build.info files that are spread over the source tree contain the
  342. minimum information needed to build and distribute OpenSSL. It uses a
  343. simple and yet fairly powerful language to determine what needs to be
  344. built, from what sources, and other relationships between files.
  345. For every build.info file, all file references are relative to the
  346. directory of the build.info file for source files, and the
  347. corresponding build directory for built files if the build tree
  348. differs from the source tree.
  349. When processed, every line is processed with the perl module
  350. Text::Template, using the delimiters "{-" and "-}". The hashes
  351. %config and %target are passed to the perl fragments, along with
  352. $sourcedir and $builddir, which are the locations of the source
  353. directory for the current build.info file and the corresponding build
  354. directory, all relative to the top of the build tree.
  355. 'Configure' only knows inherently about the top build.info file. For
  356. any other directory that has one, further directories to look into
  357. must be indicated like this:
  358. SUBDIRS=something someelse
  359. On to things to be built; they are declared by setting specific
  360. variables:
  361. PROGRAMS=foo bar
  362. LIBS=libsomething
  363. ENGINES=libeng
  364. SCRIPTS=myhack
  365. EXTRA=file1 file2
  366. Note that the files mentioned for PROGRAMS, LIBS and ENGINES *must* be
  367. without extensions. The build file templates will figure them out.
  368. For each thing to be built, it is then possible to say what sources
  369. they are built from:
  370. PROGRAMS=foo bar
  371. SOURCE[foo]=foo.c common.c
  372. SOURCE[bar]=bar.c extra.c common.c
  373. It's also possible to tell some other dependencies:
  374. DEPEND[foo]=libsomething
  375. DEPEND[libbar]=libsomethingelse
  376. (it could be argued that 'libsomething' and 'libsomethingelse' are
  377. source as well. However, the files given through SOURCE are expected
  378. to be located in the source tree while files given through DEPEND are
  379. expected to be located in the build tree)
  380. It's also possible to depend on static libraries explicitly:
  381. DEPEND[foo]=libsomething.a
  382. DEPEND[libbar]=libsomethingelse.a
  383. This should be rarely used, and care should be taken to make sure it's
  384. only used when supported. For example, native Windows build doesn't
  385. support building static libraries and DLLs at the same time, so using
  386. static libraries on Windows can only be done when configured
  387. 'no-shared'.
  388. One some platforms, shared libraries come with a name that's different
  389. from their static counterpart. That's declared as follows:
  390. SHARED_NAME[libfoo]=cygfoo-{- $config{shlibver} -}
  391. The example is from Cygwin, which has a required naming convention.
  392. Sometimes, it makes sense to rename an output file, for example a
  393. library:
  394. RENAME[libfoo]=libbar
  395. That line has "libfoo" renamed to "libbar". While it makes no
  396. sense at all to just have a rename like that (why not just use
  397. "libbar" everywhere?), it does make sense when it can be used
  398. conditionally. See a little further below for an example.
  399. In some cases, it's desirable to include some source files in the
  400. shared form of a library only:
  401. SHARED_SOURCE[libfoo]=dllmain.c
  402. For any file to be built, it's also possible to tell what extra
  403. include paths the build of their source files should use:
  404. INCLUDE[foo]=include
  405. It's also possible to specify C macros that should be defined:
  406. DEFINE[foo]=FOO BAR=1
  407. In some cases, one might want to generate some source files from
  408. others, that's done as follows:
  409. GENERATE[foo.s]=asm/something.pl $(CFLAGS)
  410. GENERATE[bar.s]=asm/bar.S
  411. The value of each GENERATE line is a command line or part of it.
  412. Configure places no rules on the command line, except that the first
  413. item must be the generator file. It is, however, entirely up to the
  414. build file template to define exactly how those command lines should
  415. be handled, how the output is captured and so on.
  416. Sometimes, the generator file itself depends on other files, for
  417. example if it is a perl script that depends on other perl modules.
  418. This can be expressed using DEPEND like this:
  419. DEPEND[asm/something.pl]=../perlasm/Foo.pm
  420. There may also be cases where the exact file isn't easily specified,
  421. but an inclusion directory still needs to be specified. INCLUDE can
  422. be used in that case:
  423. INCLUDE[asm/something.pl]=../perlasm
  424. NOTE: GENERATE lines are limited to one command only per GENERATE.
  425. As a last resort, it's possible to have raw build file lines, between
  426. BEGINRAW and ENDRAW lines as follows:
  427. BEGINRAW[Makefile(unix)]
  428. haha.h: {- $builddir -}/Makefile
  429. echo "/* haha */" > haha.h
  430. ENDRAW[Makefile(unix)]
  431. The word within square brackets is the build_file configuration item
  432. or the build_file configuration item followed by the second word in the
  433. build_scheme configuration item for the configured target within
  434. parenthesis as shown above. For example, with the following relevant
  435. configuration items:
  436. build_file => "build.ninja"
  437. build_scheme => [ "unified", "unix" ]
  438. ... these lines will be considered:
  439. BEGINRAW[build.ninja]
  440. build haha.h: echo "/* haha */" > haha.h
  441. ENDRAW[build.ninja]
  442. BEGINRAW[build.ninja(unix)]
  443. build hoho.h: echo "/* hoho */" > hoho.h
  444. ENDRAW[build.ninja(unix)]
  445. Should it be needed because the recipes within a RAW section might
  446. clash with those generated by Configure, it's possible to tell it
  447. not to generate them with the use of OVERRIDES, for example:
  448. SOURCE[libfoo]=foo.c bar.c
  449. OVERRIDES=bar.o
  450. BEGINRAW[Makefile(unix)]
  451. bar.o: bar.c
  452. $(CC) $(CFLAGS) -DSPECIAL -c -o $@ $<
  453. ENDRAW[Makefile(unix)]
  454. See the documentation further up for more information on configuration
  455. items.
  456. Finally, you can have some simple conditional use of the build.info
  457. information, looking like this:
  458. IF[1]
  459. something
  460. ELSIF[2]
  461. something other
  462. ELSE
  463. something else
  464. ENDIF
  465. The expression in square brackets is interpreted as a string in perl,
  466. and will be seen as true if perl thinks it is, otherwise false. For
  467. example, the above would have "something" used, since 1 is true.
  468. Together with the use of Text::Template, this can be used as
  469. conditions based on something in the passed variables, for example:
  470. IF[{- $disabled{shared} -}]
  471. LIBS=libcrypto
  472. SOURCE[libcrypto]=...
  473. ELSE
  474. LIBS=libfoo
  475. SOURCE[libfoo]=...
  476. ENDIF
  477. or:
  478. # VMS has a cultural standard where all libraries are prefixed.
  479. # For OpenSSL, the choice is 'ossl_'
  480. IF[{- $config{target} =~ /^vms/ -}]
  481. RENAME[libcrypto]=ossl_libcrypto
  482. RENAME[libssl]=ossl_libssl
  483. ENDIF
  484. Build-file programming with the "unified" build system
  485. ======================================================
  486. "Build files" are called "Makefile" on Unix-like operating systems,
  487. "descrip.mms" for MMS on VMS, "makefile" for nmake on Windows, etc.
  488. To use the "unified" build system, the target configuration needs to
  489. set the three items 'build_scheme', 'build_file' and 'build_command'.
  490. In the rest of this section, we will assume that 'build_scheme' is set
  491. to "unified" (see the configurations documentation above for the
  492. details).
  493. For any name given by 'build_file', the "unified" system expects a
  494. template file in Configurations/ named like the build file, with
  495. ".tmpl" appended, or in case of possible ambiguity, a combination of
  496. the second 'build_scheme' list item and the 'build_file' name. For
  497. example, if 'build_file' is set to "Makefile", the template could be
  498. Configurations/Makefile.tmpl or Configurations/unix-Makefile.tmpl.
  499. In case both Configurations/unix-Makefile.tmpl and
  500. Configurations/Makefile.tmpl are present, the former takes
  501. precedence.
  502. The build-file template is processed with the perl module
  503. Text::Template, using "{-" and "-}" as delimiters that enclose the
  504. perl code fragments that generate configuration-dependent content.
  505. Those perl fragments have access to all the hash variables from
  506. configdata.pem.
  507. The build-file template is expected to define at least the following
  508. perl functions in a perl code fragment enclosed with "{-" and "-}".
  509. They are all expected to return a string with the lines they produce.
  510. generatesrc - function that produces build file lines to generate
  511. a source file from some input.
  512. It's called like this:
  513. generatesrc(src => "PATH/TO/tobegenerated",
  514. generator => [ "generatingfile", ... ]
  515. generator_incs => [ "INCL/PATH", ... ]
  516. generator_deps => [ "dep1", ... ]
  517. generator => [ "generatingfile", ... ]
  518. incs => [ "INCL/PATH", ... ],
  519. deps => [ "dep1", ... ],
  520. intent => one of "libs", "dso", "bin" );
  521. 'src' has the name of the file to be generated.
  522. 'generator' is the command or part of command to
  523. generate the file, of which the first item is
  524. expected to be the file to generate from.
  525. generatesrc() is expected to analyse and figure out
  526. exactly how to apply that file and how to capture
  527. the result. 'generator_incs' and 'generator_deps'
  528. are include directories and files that the generator
  529. file itself depends on. 'incs' and 'deps' are
  530. include directories and files that are used if $(CC)
  531. is used as an intermediary step when generating the
  532. end product (the file indicated by 'src'). 'intent'
  533. indicates what the generated file is going to be
  534. used for.
  535. src2obj - function that produces build file lines to build an
  536. object file from source files and associated data.
  537. It's called like this:
  538. src2obj(obj => "PATH/TO/objectfile",
  539. srcs => [ "PATH/TO/sourcefile", ... ],
  540. deps => [ "dep1", ... ],
  541. incs => [ "INCL/PATH", ... ]
  542. intent => one of "lib", "dso", "bin" );
  543. 'obj' has the intended object file with '.o'
  544. extension, src2obj() is expected to change it to
  545. something more suitable for the platform.
  546. 'srcs' has the list of source files to build the
  547. object file, with the first item being the source
  548. file that directly corresponds to the object file.
  549. 'deps' is a list of explicit dependencies. 'incs'
  550. is a list of include file directories. Finally,
  551. 'intent' indicates what this object file is going
  552. to be used for.
  553. obj2lib - function that produces build file lines to build a
  554. static library file ("libfoo.a" in Unix terms) from
  555. object files.
  556. called like this:
  557. obj2lib(lib => "PATH/TO/libfile",
  558. objs => [ "PATH/TO/objectfile", ... ]);
  559. 'lib' has the intended library file name *without*
  560. extension, obj2lib is expected to add that. 'objs'
  561. has the list of object files to build this library.
  562. libobj2shlib - backward compatibility function that's used the
  563. same way as obj2shlib (described next), and was
  564. expected to build the shared library from the
  565. corresponding static library when that was suitable.
  566. NOTE: building a shared library from a static
  567. library is now DEPRECATED, as they no longer share
  568. object files. Attempting to do this will fail.
  569. obj2shlib - function that produces build file lines to build a
  570. shareable object library file ("libfoo.so" in Unix
  571. terms) from the corresponding object files.
  572. called like this:
  573. obj2shlib(shlib => "PATH/TO/shlibfile",
  574. lib => "PATH/TO/libfile",
  575. objs => [ "PATH/TO/objectfile", ... ],
  576. deps => [ "PATH/TO/otherlibfile", ... ]);
  577. 'lib' has the base (static) library ffile name
  578. *without* extension. This is useful in case
  579. supporting files are needed (such as import
  580. libraries on Windows).
  581. 'shlib' has the corresponding shared library name
  582. *without* extension. 'deps' has the list of other
  583. libraries (also *without* extension) this library
  584. needs to be linked with. 'objs' has the list of
  585. object files to build this library.
  586. obj2dso - function that produces build file lines to build a
  587. dynamic shared object file from object files.
  588. called like this:
  589. obj2dso(lib => "PATH/TO/libfile",
  590. objs => [ "PATH/TO/objectfile", ... ],
  591. deps => [ "PATH/TO/otherlibfile",
  592. ... ]);
  593. This is almost the same as obj2shlib, but the
  594. intent is to build a shareable library that can be
  595. loaded in runtime (a "plugin"...).
  596. obj2bin - function that produces build file lines to build an
  597. executable file from object files.
  598. called like this:
  599. obj2bin(bin => "PATH/TO/binfile",
  600. objs => [ "PATH/TO/objectfile", ... ],
  601. deps => [ "PATH/TO/libfile", ... ]);
  602. 'bin' has the intended executable file name
  603. *without* extension, obj2bin is expected to add
  604. that. 'objs' has the list of object files to build
  605. this library. 'deps' has the list of library files
  606. (also *without* extension) that the programs needs
  607. to be linked with.
  608. in2script - function that produces build file lines to build a
  609. script file from some input.
  610. called like this:
  611. in2script(script => "PATH/TO/scriptfile",
  612. sources => [ "PATH/TO/infile", ... ]);
  613. 'script' has the intended script file name.
  614. 'sources' has the list of source files to build the
  615. resulting script from.
  616. In all cases, file file paths are relative to the build tree top, and
  617. the build file actions run with the build tree top as current working
  618. directory.
  619. Make sure to end the section with these functions with a string that
  620. you thing is appropriate for the resulting build file. If nothing
  621. else, end it like this:
  622. ""; # Make sure no lingering values end up in the Makefile
  623. -}
  624. Configure helper scripts
  625. ========================
  626. Configure uses helper scripts in this directory:
  627. Checker scripts
  628. ---------------
  629. These scripts are per platform family, to check the integrity of the
  630. tools used for configuration and building. The checker script used is
  631. either {build_platform}-{build_file}-checker.pm or
  632. {build_platform}-checker.pm, where {build_platform} is the second
  633. 'build_scheme' list element from the configuration target data, and
  634. {build_file} is 'build_file' from the same target data.
  635. If the check succeeds, the script is expected to end with a non-zero
  636. expression. If the check fails, the script can end with a zero, or
  637. with a `die`.