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