1
0

INSTALL 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. A quick-and-simple guide to installing musl:
  2. STEP 1: Configuration
  3. Edit config.mak to override installation prefix, compiler options,
  4. target architecture, etc. as needed. Currently supported archs are
  5. i386 and x86_64. Otherwise, the defaults should be okay for trying out
  6. musl with static linking only.
  7. DO NOT set the prefix to /, /usr, or even /usr/local unless you really
  8. know what you're doing! You'll probably break your system such that
  9. you'll no longer be able to compile and link programs against glibc!
  10. This kind of setup should only be used if you're building a system
  11. where musl is the default/primary/only libc.
  12. The default prefix is /usr/local/musl for a reason, but some people
  13. may prefer /opt/musl or $HOME/musl.
  14. STEP 2: Compiling
  15. Run "make". (GNU make is required.)
  16. STEP 3: Installation
  17. With appropriate privileges, run "make install".
  18. STEP 4: Using the gcc wrapper.
  19. musl comes with a script "musl-gcc" (installed in /usr/local/bin by
  20. default) that can be used to compile and link C programs against musl.
  21. It requires a version of gcc with the -wrapper option (gcc 4.x should
  22. work). For example:
  23. cat > hello.c <<EOF
  24. #include <stdio.h>
  25. int main()
  26. {
  27. printf("hello, world!\n");
  28. return 0;
  29. }
  30. EOF
  31. musl-gcc hello.c
  32. ./a.out
  33. For compiling programs that use autoconf, you'll need to configure
  34. them with a command like this:
  35. CC=musl-gcc ./configure
  36. Be aware that (at present) libraries linked against glibc are unlikely
  37. to be usable, and the musl-gcc wrapper inhibits search of the system
  38. library paths in any case. You'll need to compile any prerequisite
  39. libraries (like ncurses, glib, etc.) yourself.