Commit d94c3f8b authored by lsm's avatar lsm

moved linux-specific compilation #defines into mongoose.c. This way we make...

moved linux-specific compilation #defines into mongoose.c. This way we make sure flags are picked up if Makefile is not used.
parent 218cca4a
...@@ -23,8 +23,7 @@ all: ...@@ -23,8 +23,7 @@ all:
CFLAGS= -W -Wall -std=c99 -pedantic -Os -fomit-frame-pointer $(COPT) CFLAGS= -W -Wall -std=c99 -pedantic -Os -fomit-frame-pointer $(COPT)
MAC_SHARED= -flat_namespace -bundle -undefined suppress MAC_SHARED= -flat_namespace -bundle -undefined suppress
LINFLAGS= -D_POSIX_SOURCE -D_BSD_SOURCE -D_FILE_OFFSET_BITS=64 \ LINFLAGS= -ldl -pthread $(CFLAGS)
-D_LARGEFILE_SOURCE -ldl -lpthread $(CFLAGS)
LIB= _$(PROG).so LIB= _$(PROG).so
linux: linux:
...@@ -32,17 +31,17 @@ linux: ...@@ -32,17 +31,17 @@ linux:
$(CC) $(LINFLAGS) mongoose.c main.c -s -o $(PROG) $(CC) $(LINFLAGS) mongoose.c main.c -s -o $(PROG)
bsd: bsd:
$(CC) $(CFLAGS) mongoose.c -shared -lpthread -s -fpic -fPIC -o $(LIB) $(CC) $(CFLAGS) mongoose.c -shared -pthread -s -fpic -fPIC -o $(LIB)
$(CC) $(CFLAGS) mongoose.c main.c -lpthread -s -o $(PROG) $(CC) $(CFLAGS) mongoose.c main.c -pthread -s -o $(PROG)
mac: mac:
$(CC) $(CFLAGS) $(MAC_SHARED) mongoose.c -lpthread -o $(LIB) $(CC) $(CFLAGS) $(MAC_SHARED) mongoose.c -pthread -o $(LIB)
$(CC) $(CFLAGS) mongoose.c main.c -lpthread -o $(PROG) $(CC) $(CFLAGS) mongoose.c main.c -pthread -o $(PROG)
solaris: solaris:
gcc $(CFLAGS) mongoose.c -lpthread -lnsl \ gcc $(CFLAGS) mongoose.c -pthread -lnsl \
-lsocket -s -fpic -fPIC -shared -o $(LIB) -lsocket -s -fpic -fPIC -shared -o $(LIB)
gcc $(CFLAGS) mongoose.c main.c -lpthread -lnsl -lsocket -s -o $(PROG) gcc $(CFLAGS) mongoose.c main.c -pthread -lnsl -lsocket -s -o $(PROG)
########################################################################## ##########################################################################
......
...@@ -25,7 +25,10 @@ ...@@ -25,7 +25,10 @@
#if defined(_WIN32) #if defined(_WIN32)
#define _CRT_SECURE_NO_WARNINGS /* Disable deprecation warning in VS2005 */ #define _CRT_SECURE_NO_WARNINGS /* Disable deprecation warning in VS2005 */
#endif /* _WIN32 */ #else
#define _XOPEN_SOURCE 600 /* Needed for pthread_rwlock on linux */
#define _LARGEFILE_SOURCE /* Enable 64-bit file offsets */
#endif
#ifndef _WIN32_WCE /* Some ANSI #includes are not available on Windows CE */ #ifndef _WIN32_WCE /* Some ANSI #includes are not available on Windows CE */
#include <sys/types.h> #include <sys/types.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment