INDEX

SYMBOLS aclocal utility, 23–24, 150 AC_MSG_* macros, 131 *_LIBADD variables, 190 AC_OUTPUT macro, 141–142 @ (at sign), 53 AC_PREREQ macro, 100 \ (backslash), 43 AC_PROG_CC macro, 116–117 ` (backticks), 288 AC_PROG_YACC, 118 : (colon character), 40 AC_SEARCH_LIBS macro, 81, 125, 386 - (dash character), 53 AC_SUBST macro, 114–115 $ (dollar sign), 41 action-if-not-given argument, 134 $? variable, 46 AC_TYPE_UINT16_T, 140 $% variable, 46 --add-missing option, 97 $* variable, 46 addresses, 324 $@ variable, 46 aix-soname=aix|svr4|both option, 192 $< variable, 46 aliases, 518 ! (exclamation mark) modifier, 317 alternatives scripts, 71 ; (semicolon character), 40, 42 AM_CONDITIONAL macro, 380–381, 398 American Standard Code for A Information Interchange (ASCII), 309–311 ABI (application binary interface), 210 American Standards Association absolute addresses, 200–201, 214 (ASA), 309 ac-archive project, 411–412, 528 AM_INIT_AUTOMAKE macro, 148, 150, 356, AC_ARG_ENABLE macro, 133–135, 386 374, 486 AC_ARG_VAR macro, 396 AM_MAINTAINER_MODE macro, 173 AC_ARG_WITH macro, 133–134 AM_PROG_AR macro, 376 AC_CANONICAL_HOST macro, 412 a.out scheme, 210 AC_CANONICAL_TARGET macro, 412 Apple platforms, 15–16 AC_CHECK_HEADERS macro, 127–128 application binary interface (ABI), 210 AC_CHECK_LIB, 386 apt, 461 AC_CHECK_PROG, 119 utility, 168, 206 AC_CONFIG_FILES macro, 87, 90, 102, architectures, 517 104, 242 archives, 166 AC_CONFIG_HEADERS macro, 102–103, 107–110 arguments AC_CONFIG_LINKS macro, 102 action-if-not-given argument, 134 AC_CONFIG_MACRO_DIR macro, 486 bug report argument, 100 AC_CONFIG_MACRO_DIRS macro, 375, 486 commands argument, 104 AC_CONFIG_SRCDIR macro, 101–102 condition argument, 381–382 AC_CONFIG_SUBDIRS macro, 373 init-cmds argument, 106 AC_CONFIG_TESTDIR macro, 241–242 argument, 100 AC_DEFINE macro, 115 tag argument, 106 AC_DEFINE_UNQUOTED macro, 115 url argument, 101 AC_INCLUDES_DEFAULT, 140–141 value argument, 115 AC_INIT macro, 100–101, 508–510 version argument, 101 AC_LANG_CALL macro, 514–515 ASCII table, 309–311 B AS_HELP_STRING macro, 138 backslash (\), 43 async-exec, 134–137 backticks (`), 288 asynchronous processing, 133 base64 module, 358–362 at sign (@), 53 basenames, 125 AT_CHECK macro, 250 binding, 183–184 AT_CLEANUP macro, 251 Boehne, Robert, 180 AT_SETUP macro, 251 bootstrap.sh script, 97–99 Autoconf , 19, 452 building, 4–7 bug report argument, 100 configuration scripts, 80–82 build dependency issues, 272 downloading, 2 build systems, installation process initialization macros, 100–111 of, 9–11 input file, 82 BUILT_SOURCES variable, 529–530 installing, 9–11 byte streams, 91 missing files, 98 overview, 14, 18–19, 79–80 .pc files, 282–286 primary macros, 114–119 C, public interfaces, 501–502 running, 84 C compilers, 116–117, 138–141 testing, 7–9 C locale, 308 unpacking, 3–4 C99 standard, 139, 301 versions of, 96 Canadian cross, 517 autoconfiscating, 88 C_CONFIG_COMMANDS macro, 103–105 autogen.sh script, 97–99 CFLAGS variable, 72 autoheader utility, 19–22, 108–111 ChangeLog files, 147 autom4te utility, 21–22 check prefix, 157 AUTOM4TE variable, 243 check programs, 393 autom4te.cache directory, 84 check target, 7–8, 55–56 check-news option, 148 building, 147–151, 154–162 chunk markers, 254 distribution of, 171–172 .class files, 409–410 maintainer mode, 172–173 --clean , 266–267 noise and, 173 –175 clean interfaces, 499–505 nonrecursive, 175 –177 CLEANFILES variable, 404–405, 417–418 overview, 14, 145–146 CMake, 14 primaries, 158–160 Cocoa user interface, 15–16 purpose of, 22–24 colon (:) character, 40 automatic variables, 46 commands argument, 104 autopoint, 348 committing files, 348–349 autoreconf utility, 19–22, 84 common make rules, 44 autoscan utility, 20, 95–99 Common Object File Format (COFF) Autotest system, 182 overview, 238–241 compilation, 517–523 wiring up, 241–248 compile script, 150 AUTOTEST variable, 243 compilers, checking for, 116–117 autoupdate utility, 20, 97 condition argument, 381–382 awk expressions, 90–91 config.cache, 28 AX_PREFIX_CONFIG_H macro, 505 config.log, 27–28, 85 AX_PTHREAD, 384–385 config.site, 28

542 Index config.status, 85–87 dependency chains, 40–41, 44 configuration scripts, 77–78 dependency rules, 46–47, 151–153, configure 530–533 failure, 6 description parameter, 115 output, 5–7 DESTDIR variable, 68–69, 351 --prefix option, 10 directed acyclic graphs (DAGs), 40–41 purpose of, 18 directives, 51 remote build functionality, 28–29 dirname parameter, 328 running, 26–29, 85–86 --disable-async-exec, 137–138 configure.ac file, 82, 84, 90–91, 287–290 disable-fast-install option, 192–193 configure.scan file, 116 disable-shared option, 186, 193 convenience libraries, 164–169, 204–206 disable-static option, 193 --copy option, 97 display.h, 46–47 COPYING files, 150 dist target, 51, 54 C++, 502–505 dist- option, 148 CPPFLAGS variable, 48, 72 distcheck target, 54–55, 99 C-preprocessor (CPP) macros, 82–83, distdir, 52, 99 108, 115 dist- option, 148 crashes, 183–184, 200–201, 362 distribution archives CreateProcess, 463 clean, 510–511 cross-compilation, 517–523 contents, 171–172 cross-to-native builds, 517 vs. GitHub tarballs, 2 C# native language, 398, 418–422 dist-shar option, 148 curl libraries, 212 DIST_SUBDIRS variable, 505 currency attributes, 301, 316–317 dist-tarZ option, 148 Cygwin, 354, 452, 462–477 dist-xz option, 148 dist- option, 148 D DLLs (dynamic link libraries), 182, 214–215 dash character (-), 53 dlopen option, 192 data flow diagrams dollar sign ($), 41 aclocal utility, 24 domainname parameter, 328 Autoconf, 27 dot-rules, 51 autoheader utility, 27 doxyfile, 427, 506–507 Automake, 26 Doxygen, 369, 396, 424–426 compile and link processes, 44 DOXYGEN variable, 380, 382 configure, 27 Draheim, Guido, 528 Libtool, 26 DRY principle, 194 make, 29 dual-mode builds, 128, 520–521 overview, 21–22 Duret-Lutz, Alexandre, 146 DATA primaries, 159, 527–528 dynamic link libraries (DLLs), 182, datadir, 332 214–215 debug variable, 387 dynamic loader functionality, 110–111 debugging Gnulib, 364 macros, 83, 449–450 E _DEBUG_START_ and _DEBUG_END_ strings, Eclipse, 181 120–122 --enable-async-exec, 137–138 declarative language, 40 --enable-debug option, 387 @DEFS@, 128–129 --enable-shared option, 193 Demaille, Akim, 146 --enable-static option, 193 depcomp script, 150 end user’s systems, 17–18

Index 543 English language, 293–294 GNU Autoconf Manual, 97, 118, 238, exclamation mark (!) modifier, 317 517–518 extension targets, 505–508 GNU Automake Manual, 23–24 external reference tables, 182 GNU C Library manual, 298, 328 external versioning, 210 GNU Coding Standards (GCS), 64, 67, EXTRA prefix, 157 77, 85 EXTRA_DIST variable, 171 GNU Compiler for Java (gcj), 408 EXTRA_PROGRAMS variable, 157–158 GNU gettext Utilities Manual, 339 GNU Libtool Manual, 186 F option, 148 GNU Portability Library (Gnulib), factory function, 503–504 353–354, 528 fallback message catalogs, 338 GNU project, INSTALL files, 5 file extensions, source archives, 3 gnulib-tool utility Filesystem Hierarchy Standard (FHS), 63 adding functionality, 355–364 Fink, 16 overview, 353–355 FLAIM (FLexible Adaptable _GNU_SOURCE, 321–322 Information Management) GPLv3+, 354 analyzing, 370–372 grouping field, 301 logistics, 369–370 gunzip program, 4 overview, 368–369 subprojects, 378–394 toolkit library and utilities, 372–376 H xflaim, 394–405 handles, 185 FLM_DEBUG, 387 header files FORCE, 52–53 public, 500 foreign option, 148 templates, 107–108 Foundation (FSF), HEADERS primary, 159–160 36 –37, 79 heap manager, 183 freedesktop.org project, 272 help strings, 137–138 Friesenhahn, Bob, 180 -hook targets, 389–390 FTKINC, 372, 397 HP-UX/AT&T SVR4 library FTKLIB, 372, 397 versioning, 215

G I generated source code, 529–536 i18n. See internationalization gettext IBM AIX library versioning, 212–213 library, 326–327 identification information, 325 localization, 339–351 ifnames program, 21 manual, 295 implicit rules, 47–49 message catalogs, 334–339 include directives, 112 git clean, 146 include directories, 189–192 git repositories, 358 init-cmds argument, 106 GitHub tarballs, vs. distribution INSTALL files, 5, 150 archives, 2 install utility, 117–118 global functions, 511 installation, 56–62, 529 gnits option, 148 installation directory variables, 65–66 -config script, 272 installation location prefixes, 156 GNU Autoconf Archive, 411, 412 install-sh script, 98, 150 integration testing, 257–260

544 Index interfaces LC_COLLATE, 297, 309–314 designing, 499–505 LC_CTYPE, 297, 314–315 plug-in, 181, 221–223 LC_IDENTIFICATION, 325 versioning, 209 LC_MEASUREMENT, 325 internal versioning, 210 LC_MESSAGES, 324, 333 International Components for Unicode LC_MONETARY, 297 (ICU), 315 LC_NAME, 324 internationalization LC_NUMERIC, 297 dynamic messages, 296–325 LC_PAPER, 324 overview, 295–296 LC_TELEPHONE, 324 static messages, 325–329 LC_TIME, 297 intN_t definitions, 139–140 LD_PRELOAD variable, 182–183 -Ipath directives, 112 leading control characters, 53–54 iteration, 450 Lerdorf, Rasmus, 293 LGPLv2+ and LGPLv3+, 354 *_LIBADD variables, 190 J libcrypto.pc files, 289–290 Java libraries Autotools support for, 17, 408–411 building, 169–171 Eclipse and, 181 checking for, 123–125 Java native interface (JNI), 398, 411, convenience libraries, 164–169 415–417 LIBRARIES primary, 158 JAVA primary, 159, 418 library versioning, 216–220 Java virtual machine (JVM), 17, 408 library_LIBADD variable, 168 Jupiter project library-specific macros, 516 adding functionality, 87–90 @LIBS@ substitution variable, 125–126 adding shared libraries, 188–207 libssl.pc files, 288–290 directory structure, 37–38 libthreads library, 123 installation, 56–62 Libtool location variables, 66–67 macros, 374–376 nonrecursive build systems, overview, 14, 179–180 175 –177 purpose of, 24–26 optional features, 132–138 libtoolize shell script, 25 source distribution archive, 50–54 libxyz.so, 81 VPATH build functionality, 91–94 LINGUAS files, 349–350 JVM (Java virtual machine), 17, 408 linker names, 212 links, 181 K distros, 67–69 Linux installations, 452, 454–462 Katz, Phil, 3 Linux versioning, 210–212 Kernighan, Brian, 80 Lirzin, Mathieu, 146 key-value tags, 276–277 LISP primary, 158 --keyword option, 335 localeconv function, 296, 298 LOCALE_DIR variable, 340 L locales generating and installing, 303–307 language packs, 294 LC_COLLATE, 309–314 language selection, 332–334 LC_CTYPE, 314–315 LANGUAGE variable, 332–333 POSIX standard, 315–324 Lattarini, Stefano, 146 setting and using, 298–303 lazy binding, 183–184 time and date, 307–308 LC_ADDRESS, 324 X/Open standard, 315–324 LC_ALL, 297

Index 545 localization, 331 memchr module, 358 location variables, 66–67 message catalogs, 327–329, 334–339 ltdl library, 25, 221–234 messages, 131–132, 324 LT_INIT macro, 192, 374 Meyering, Jim, 146 LTLIBRARIES primary, 158, 186, 188 ltlibrary_LIBADD variable, 168–169 Autotools support for, 14–15 CreateProcess, 463 M Cygwin and, 462–477 dynamic link libraries (DLLs), 182, -M options, 151–152 214–215 M4 utility, 6–7, 80, 82–83, 358, 432–440 Git for Windows, 453–454 M4sh macro library, 382 Linux and, 454–462 Mac OS X, 15–16 MinGW and, 477–487 MacKenzie, David, 18, 145 MSys2 and, 452, 487–497 MacPorts, 16 MinGW, 452, 477–487 macros. See also specific macros mingw-w64, 455–457 C-preprocessor (CPP) macros, -MMD GNU extension compiler, 533 82–83, 108, 115 modules, 358 debugging, 81–83, 449–450 mon_grouping field, 301 hacking, 511–516 msginit, 349 library-specific, 516 MSys2, 452, 487–497 Libtool, 374–376 multiple modules, 232–233 M4sh macro library, 382 multiple targets, 49 troubleshooting, 449–450 multithreading, 123–124, 129–130, 385 writing, 441–448 maintainer mode, 172–173 make N automatic variables, 46 name tokens, 436–437 dependency rules, 46–47 naming projects, 37 implicit rules, 47–49 Native Language Support (NLS) multiple targets, 49 functionality, 339 phony targets, 49 native support, 16–17 rule definitions, 39–41 ncurses library, 386 running, 7–9, 29 NetWare build, 392 shell commands, 42–43 nl_langinfo function, 317–321 variable binding, 43–44 noinst prefix, 157 make distclean, 146 nonrecursive build systems, 73–77, Makefile.am files, 153–154, 283–285, 175 –177 376–378, 388–390 nonshared objects, 182 Makefile.in template, 99 nonstandard targets, 426–428 makefiles no-pic option, 193–194 Automake, 22–24 --no-translator option, 349 functionality and, 87–90 nonrecursive build systems, 73–77 O resources for, 50 variable assignments, 41–42 objects, 181–182 MANS primary, 160 OBS (openSUSE Build Service), 427 Matsumoto, Yukihiro, 293 O’Gorman, Peter, 180 Matzigkeit, Gordon, 180 Oliva, Alexandre, 180 McKenzie, David, 79 Othman, Ossama, 180 measurement, 325 OUTER_LIMITS, 321–322

546 Index P preorder_commands macro, 506 preprocessor directives, 82 package argument, 100 preprocessor-defined variables, package maintainers, 539 524–525 @PACKAGE_BUGREPORT@, 100 primaries, 158–160 paper sizes, 324 print.h, 46–47 parallel make, 74 product list variables (PLVs), 155 parallel-tests option, 149 product option variables pattern rules, 531 (POVs), 167–169 .pc.in templates, 282–283 product_CFLAGS, 168 per-makefile option variables, 169 product_CPPFLAGS, 168 .PHONY rule, 51 product_CXXFLAGS, 168 phony targets, 49, 54–55 product_LDFLAGS, 168 PIC (position-independent code), program, 44–45 200–204 program_LDADD, 168 pic-only option, 193–194 programming languages, choice of, PIMPL (Private IMPLementation) 16 –17 pattern, 502–503 PROGRAMS primary, 158 pkg prefix, 156 prog-to-check-for program, 119–120, 122 pkgconf project, 273 project names, 37 pkg-config PSV modifiers, 161–162 Autoconf macros, 290–292 pthread libraries, 123–131, 384 clones, 273 public interfaces, 499–505 configure.ac, 287–290 pure virtual interface, 503 functional fields, 279–282 PYTHON primary, 158–159 --help option, 274 informational fields, 278–279 key-value tags, 277–278 Q M4 utility, 274 quadrigraphs, 143 metadata files, 276–282 quiet build systems, 54, 173 --modversion option, 279 overview, 272–276 .pc files, 282–286 Requires and Requires.private readme-alpha option, 148 fields, 281 recursive build systems, 38 --variable option, 276 recursive extension targets, 505–508 platforms, targeting, 36 Red Hat Package Manager (RPM), 67, plug-in interfaces, 181, 221–223 70, 101, 377, 428 PLV modifiers, 161–162 redundancy, 47 po directory, 334–337 reject parameter, 122 portable object template (.pot) files, Remnant, Scott James, 180 334–337 remote build functionality, 28–29, POSIX standard, 315–324, 452 111–112 POSIX threads (pthread) library, repository revision numbers, 508–510 123–131 Ritchie, Dennis, 80 POSIX-compliant platforms, 15 root permissions, 71 postorder_commands macro, 506 Rossum, Guido van, 293 --prefix option, 10 RPM (Red Hat Package Manager), 67, prefix overrides, 69–71 70, 101, 377, 428 prefix variables, 65–66, 156 runtime directories, 70

Index 547 S sudo, 11 suffix rules, 47–49 salutations, 324 SVNREV variable, 509–510 Savannah Gnulib git repository, SxS (side-by-side cache), 214–215 354–355, 528–529 SCons, 14 SCRIPTS primary, 159 T sed expressions, 90–91 TAB characters, 39–40, 537–538 semicolon (;) character, 40, 42 tag argument, 106 setlocale function, 296–297 Tanner, Thomas, 180 shared libraries utility, 3–4 benefits of, 180–181 tarballs, 50–54 installing, 187 target systems, 517 interfaces, 209 targets, 40, 44, 64–65, 536–537 pthread libraries, 126–131 TDs (transitive dependencies), 401–403 tables, 182 telephone numbers, 324 use of, 181–187 templates shared object name (soname), 211 header files, 107–108 shared option, 193 Makefile.in template, 99 shell commands, 42–43 .pc.in templates, 282–283 shell condition, 381 portable object template (.pot) files, shell variables, 114 334–337 side-by-side cache (SxS), 214–215 test groups, 248–249 Simon, Peter, 528 TESTS variable, 236–237 Solaris systems, 122 TESTSOURCES variable, 243 Solaris Versioning, 210–212 testsuite program, 240–241 source archives TESTSUITE variable, 243–247 building, 4–7 TEXINFOS primary, 160, 537 downloading, 2 text replacement, 523–528 installing, 9–11 thesaurus library, 184–185 testing, 7–9 time and date, 307–308 unpacking, 3–4 tool chain options, 452–453 source distribution archives, 50–54 transitive dependencies (TDs), spec files, 70 401–403 src_b64_CPPFLAGS directive, 363 translation units, 195 $(srcdir), 93 transparency, 14 staged installations, 67 Tromey, Tom, 145 stamp targets, 403–404 troubleshooting, 449–450 standard C library, 296–297 two-pass systems, 531–533 standard targets and variables, type and structure definitions, 138–141 64–66, 389 static option, 193 stdbool module, 358 U strfmon function, 315–316 Ubuntu, 461 strftime function, 307–308 uintN_t definitions, 139–140 string module, 358 uninstallation, 60–62, 285–286 strip program, 458 unit testing, 55–56, 162–164, 257–260 Stroustrup, Bjarne, 293 compilers, 45 strxfrm function, 311–314 UNQUOTED versions of macros, 115 subdir-objects option, 149 unzip utility, 3 SUBDIRS variable, 224–225, 343, 505 --update option, 364 substitution variables, 114 url argument, 101 Subversion project, 509, 539

548 Index user expectations, 36 W user variables, 71–73, 116 -W category option, 149 /usr/local directory tree, 9 --warnings=category option, 149 utility scripts, 118, 172 Wildenhues, Ralf, 146, 180 win32-dll option, 192 V Windows. See Microsoft Windows value argument, 115 Windows Subsystem for Linux value-if-found variable, 119–120 (WSL), 460–462 Van der Heijden, Jan-Jaap, 477 Wirth, Niklaus, 293 variable binding, 43–44 wrapper directories, 413–414 variables, 65–66, 276 Vaughn, Gary V., 180 X --verbose option, 84 x2nrealloc, 362 version argument, 101 xalloc functionality, 362 version control, 508–510 xflaim, 394–405, 408 version option, 149 xgettext utility, 334–335 version-check commands, 30–33, 279 X/Open standard, 315–324 VPATH build functionality, 91–94

Z ZIP files, 3

Index 549