mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-26 20:38:25 +00:00
fix linux linkage (move compiler flags to the end of compilation string)
This commit is contained in:
1 parent
ac09360430
commit
aef344f0ff
1 file changed
+13
-9
@@ -27,22 +27,26 @@ MAC_SHARED= -flat_namespace -bundle -undefined suppress
|
|||||||
LINFLAGS= -ldl -pthread $(CFLAGS)
|
LINFLAGS= -ldl -pthread $(CFLAGS)
|
||||||
LIB= _$(PROG).so
|
LIB= _$(PROG).so
|
||||||
|
|
||||||
|
# Make sure that the compiler flags come last in the compilation string.
|
||||||
|
# If not so, this can break some on some Linux distros which use
|
||||||
|
# "-Wl,--as-needed" turned on by default in cc command.
|
||||||
|
# Also, this is turned in many other distros in static linkage builds.
|
||||||
linux:
|
linux:
|
||||||
$(CC) $(LINFLAGS) mongoose.c -shared -fPIC -fpic -o $(LIB)
|
$(CC) mongoose.c -shared -fPIC -fpic -o $(LIB) $(LINFLAGS)
|
||||||
$(CC) $(LINFLAGS) mongoose.c main.c -o $(PROG)
|
$(CC) mongoose.c main.c -o $(PROG) $(LINFLAGS)
|
||||||
|
|
||||||
bsd:
|
bsd:
|
||||||
$(CC) $(CFLAGS) mongoose.c -shared -pthread -fpic -fPIC -o $(LIB)
|
$(CC) mongoose.c -shared -pthread -fpic -fPIC -o $(LIB) $(CFLAGS)
|
||||||
$(CC) $(CFLAGS) mongoose.c main.c -pthread -o $(PROG)
|
$(CC) mongoose.c main.c -pthread -o $(PROG) $(CFLAGS)
|
||||||
|
|
||||||
mac:
|
mac:
|
||||||
$(CC) $(CFLAGS) $(MAC_SHARED) mongoose.c -pthread -o $(LIB)
|
$(CC) mongoose.c -pthread -o $(LIB) $(MAC_SHARED) $(CFLAGS)
|
||||||
$(CC) $(CFLAGS) mongoose.c main.c -pthread -o $(PROG)
|
$(CC) mongoose.c main.c -pthread -o $(PROG) $(CFLAGS)
|
||||||
|
|
||||||
solaris:
|
solaris:
|
||||||
gcc $(CFLAGS) mongoose.c -pthread -lnsl \
|
gcc mongoose.c -pthread -lnsl \
|
||||||
-lsocket -fpic -fPIC -shared -o $(LIB)
|
-lsocket -fpic -fPIC -shared -o $(LIB) $(CFLAGS)
|
||||||
gcc $(CFLAGS) mongoose.c main.c -pthread -lnsl -lsocket -o $(PROG)
|
gcc mongoose.c main.c -pthread -lnsl -lsocket -o $(PROG) $(CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|||||||
Reference in new issue
Block a user