change DATADIR to INSTALL_DATADIR solve mingw conflict
authorAndy Green <andy@warmcat.com>
Thu, 12 Apr 2012 03:06:05 +0000 (11:06 +0800)
committerAndy Green <andy.green@linaro.org>
Thu, 12 Apr 2012 05:31:25 +0000 (13:31 +0800)
Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/Makefile.am
lib/Makefile.in
lib/client-handshake.c
test-server/Makefile.am
test-server/Makefile.in
test-server/test-fraggle.c
test-server/test-server-extpoll.c
test-server/test-server.c
win32port/win32helpers/websock-w32.h

index 60567b9..87c2c43 100644 (file)
@@ -31,7 +31,7 @@ libwebsockets_la_LDFLAGS+=  -version-info 0:3
 endif
 
 libwebsockets_la_CFLAGS+= -c \
-       -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
+       -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 libwebsockets_la_LDFLAGS+= -lz
 
 all-local:
index a0ea159..af1121c 100644 (file)
@@ -240,7 +240,7 @@ dist_libwebsockets_la_SOURCES = libwebsockets.c handshake.c parsers.c \
        extension-deflate-stream.c private-libwebsockets.h \
        $(am__append_1) $(am__append_2)
 libwebsockets_la_CFLAGS := -Wall -std=gnu99 -pedantic $(am__append_3) \
-       $(am__append_5) -c -DDATADIR=\"@datadir@\" \
+       $(am__append_5) -c -DINSTALL_DATADIR=\"@datadir@\" \
        -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 libwebsockets_la_LDFLAGS := $(am__append_4) $(am__append_6) -lz
 all: all-am
index 58761ca..6bff052 100644 (file)
@@ -1,7 +1,6 @@
 #include "private-libwebsockets.h"
 #include <netdb.h>
 
-
 struct libwebsocket *__libwebsocket_client_connect_2(
        struct libwebsocket_context *context,
        struct libwebsocket *wsi
index cfbeacc..09da2e9 100644 (file)
@@ -26,10 +26,10 @@ libwebsockets_test_server_extpoll_CFLAGS:= -Werror
 libwebsockets_test_fraggle_CFLAGS:= -Werror
 endif   
 
-libwebsockets_test_server_CFLAGS+= -Wall -std=gnu99 -pedantic -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
-libwebsockets_test_client_CFLAGS+= -Wall -std=gnu99 -pedantic -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
-libwebsockets_test_server_extpoll_CFLAGS+= -Wall -std=gnu99 -pedantic -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
-libwebsockets_test_fraggle_CFLAGS+= -Wall -std=gnu99 -pedantic -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
+libwebsockets_test_server_CFLAGS+= -Wall -std=gnu99 -pedantic -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
+libwebsockets_test_client_CFLAGS+= -Wall -std=gnu99 -pedantic -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
+libwebsockets_test_server_extpoll_CFLAGS+= -Wall -std=gnu99 -pedantic -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
+libwebsockets_test_fraggle_CFLAGS+= -Wall -std=gnu99 -pedantic -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 
 
 if NOPING
@@ -37,7 +37,7 @@ else
 bin_PROGRAMS+=libwebsockets-test-ping
 libwebsockets_test_ping_SOURCES=test-ping.c
 libwebsockets_test_ping_LDADD=-L../lib -lwebsockets
-libwebsockets_test_ping_CFLAGS:= -Wall -Werror -std=gnu99 -pedantic -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
+libwebsockets_test_ping_CFLAGS:= -Wall -Werror -std=gnu99 -pedantic -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 endif
 
 
index f13f9de..5beb753 100644 (file)
@@ -256,36 +256,40 @@ libwebsockets_test_fraggle_SOURCES = test-fraggle.c
 libwebsockets_test_fraggle_LDADD = -L../lib -lwebsockets \
        $(am__append_4)
 @MINGW_FALSE@libwebsockets_test_server_CFLAGS := -Werror -Wall \
-@MINGW_FALSE@  -std=gnu99 -pedantic -DDATADIR=\"@datadir@\" \
+@MINGW_FALSE@  -std=gnu99 -pedantic \
+@MINGW_FALSE@  -DINSTALL_DATADIR=\"@datadir@\" \
 @MINGW_FALSE@  -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 @MINGW_TRUE@libwebsockets_test_server_CFLAGS := -w \
 @MINGW_TRUE@   -I../win32port/win32helpers -Wall -std=gnu99 \
-@MINGW_TRUE@   -pedantic -DDATADIR=\"@datadir@\" \
+@MINGW_TRUE@   -pedantic -DINSTALL_DATADIR=\"@datadir@\" \
 @MINGW_TRUE@   -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 @MINGW_FALSE@libwebsockets_test_client_CFLAGS := -Werror -Wall \
-@MINGW_FALSE@  -std=gnu99 -pedantic -DDATADIR=\"@datadir@\" \
+@MINGW_FALSE@  -std=gnu99 -pedantic \
+@MINGW_FALSE@  -DINSTALL_DATADIR=\"@datadir@\" \
 @MINGW_FALSE@  -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 @MINGW_TRUE@libwebsockets_test_client_CFLAGS := -w \
 @MINGW_TRUE@   -I../win32port/win32helpers -Wall -std=gnu99 \
-@MINGW_TRUE@   -pedantic -DDATADIR=\"@datadir@\" \
+@MINGW_TRUE@   -pedantic -DINSTALL_DATADIR=\"@datadir@\" \
 @MINGW_TRUE@   -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 @MINGW_FALSE@libwebsockets_test_server_extpoll_CFLAGS := -Werror -Wall \
-@MINGW_FALSE@  -std=gnu99 -pedantic -DDATADIR=\"@datadir@\" \
+@MINGW_FALSE@  -std=gnu99 -pedantic \
+@MINGW_FALSE@  -DINSTALL_DATADIR=\"@datadir@\" \
 @MINGW_FALSE@  -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 @MINGW_TRUE@libwebsockets_test_server_extpoll_CFLAGS := -w \
 @MINGW_TRUE@   -I../win32port/win32helpers -Wall -std=gnu99 \
-@MINGW_TRUE@   -pedantic -DDATADIR=\"@datadir@\" \
+@MINGW_TRUE@   -pedantic -DINSTALL_DATADIR=\"@datadir@\" \
 @MINGW_TRUE@   -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 @MINGW_FALSE@libwebsockets_test_fraggle_CFLAGS := -Werror -Wall \
-@MINGW_FALSE@  -std=gnu99 -pedantic -DDATADIR=\"@datadir@\" \
+@MINGW_FALSE@  -std=gnu99 -pedantic \
+@MINGW_FALSE@  -DINSTALL_DATADIR=\"@datadir@\" \
 @MINGW_FALSE@  -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 @MINGW_TRUE@libwebsockets_test_fraggle_CFLAGS := -w \
 @MINGW_TRUE@   -I../win32port/win32helpers -Wall -std=gnu99 \
-@MINGW_TRUE@   -pedantic -DDATADIR=\"@datadir@\" \
+@MINGW_TRUE@   -pedantic -DINSTALL_DATADIR=\"@datadir@\" \
 @MINGW_TRUE@   -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 @NOPING_FALSE@libwebsockets_test_ping_SOURCES = test-ping.c
 @NOPING_FALSE@libwebsockets_test_ping_LDADD = -L../lib -lwebsockets
-@NOPING_FALSE@libwebsockets_test_ping_CFLAGS := -Wall -Werror -std=gnu99 -pedantic -DDATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
+@NOPING_FALSE@libwebsockets_test_ping_CFLAGS := -Wall -Werror -std=gnu99 -pedantic -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
 all: all-am
 
 .SUFFIXES:
index 873bee3..1c77d59 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "../lib/libwebsockets.h"
 
-#define LOCAL_RESOURCE_PATH DATADIR"/libwebsockets-test-server"
+#define LOCAL_RESOURCE_PATH INSTALL_DATADIR"/libwebsockets-test-server"
 
 static int client;
 static int terminate;
index f550ff6..1ad3fb5 100644 (file)
@@ -68,7 +68,7 @@ enum demo_protocols {
 };
 
 
-#define LOCAL_RESOURCE_PATH DATADIR"/libwebsockets-test-server"
+#define LOCAL_RESOURCE_PATH INSTALL_DATADIR"/libwebsockets-test-server"
 
 /* this protocol server (always the first one) just knows how to do HTTP */
 
index f054b16..dae0a8d 100644 (file)
@@ -57,7 +57,7 @@ enum demo_protocols {
 };
 
 
-#define LOCAL_RESOURCE_PATH DATADIR"/libwebsockets-test-server"
+#define LOCAL_RESOURCE_PATH INSTALL_DATADIR"/libwebsockets-test-server"
 
 /* this protocol server (always the first one) just knows how to do HTTP */
 
index 2d2bb4a..2483a8f 100644 (file)
@@ -50,6 +50,13 @@ extern INT WSAAPI emulated_poll(LPWSAPOLLFD fdarray, ULONG nfds, INT timeout);
 /* override configure because we are not using Makefiles */\r
 \r
 #define LWS_NO_FORK\r
-#define DATADIR "."\r
+\r
+/* windows can't cope with this idea, needs assets in cwd */\r
+\r
+#ifdef INSTALL_DATADIR\r
+#undef INSTALL_DATADIR\r
+#endif\r
+\r
+#define INSTALL_DATADIR "."\r
 \r
 #endif\r