bzip2-exp.xml 1.3 KB

123456789101112131415161718192021222324252627
  1. <sect2>
  2. <title>Command explanations</title>
  3. <para><userinput>sed: </userinput> The sed command here searches for the
  4. string "$(CC) $(CFLAGS) -o" and replaces it by "$(CC) $(CFLAGS)
  5. $(LDFLAGS) -o" in the Makefile file. We make that modification so it
  6. will be easier to link bzip2 statically.</para>
  7. <para><userinput>...Makefile | make -f -:</userinput> Makefile
  8. is the last parameter of the sed command which indicates the file to
  9. search and replace in. Sed normally sends the modified file to stdout
  10. (standard output), which will be the console. With the construction we
  11. use, sed's output will be piped to the make program. Normally, when make
  12. is started, it tries to find a number of files like Makefile. But we have
  13. modified the Makefile file so we don't want make to use it. The "-f -"
  14. parameter tells make to read it's input from another file, or from stdin
  15. (standard input) which the dash (-) implies. This is one way to do it.
  16. Another way would be to have sed write the output to a different file
  17. and tell make with the -f parameter to read that alternate file.</para>
  18. <para><userinput>LDFLAGS=-static:</userinput> This is the second way we use to
  19. link a package statically. This is also the most common way.
  20. The -all-static value is only used with the binutils package and won't
  21. be used throughout the rest of this book.</para>
  22. </sect2>