Permalink
Browse files

Merge pull request #12 from fishkingsin/raspberrypi-develop

added linuxarmv6l(raspberrypi) binary and example
  • Loading branch information...
2 parents 53d3481 + 78ca1f7 commit b14b5b355c5b96affbf66d7868ceccf7147a4911 @robotconscience committed Feb 20, 2013
View
@@ -46,7 +46,6 @@ obj/
#eclipse build folders
#Mac OS X
-xcuserdata
project.xcworkspace
.DS_Store
*.pyc
View
@@ -4,6 +4,58 @@ ofxLibwebsockets
* implements both client and server functionality of libwebsockets
* based on Paul Reimer's work on ofxWebUI (https://github.com/paulreimer/ofxWebUI) and jason vancleave's ofxLibWebSockets (https://github.com/jvcleave/ofxLibWebSockets)
+ADDING TO PROJECTS
+------------
+* OS X
+ * Via OF Project Generator:
+ 1. Delete ofxLibwebsockets/libs/libwebsockets/include/win32port
+ 2. Add ofxLibwebsockets to your addons via the projectGenerator
+ 3. That's it!
+ * Adding to a new/existing project:
+ * Include ofxLibwebsockets' xcconfig file via your project's Project.xcconfig file:
+ 1. Define where it lives:
+ ```OFX_LWS_PATH = "$(OF_PATH)/addons/ofxLibwebsockets"```
+ 2. Include ofxLibwebsockets xcconfig
+ ```#include "../../../addons/ofxLibwebsockets/ofxLibwebsockets.xcconfig"```
+ 2. Add to existing vars in Project.xcconfig:
+
+ ```
+ OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OFX_LWS_LIBS)
+ HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) $(OFX_LWS_INCLUDES)
+ LIBRARY_SEARCH_PATHS = $(inherited) $(OFX_LWS_SEARCH)
+ ```
+
+* Windows
+ * Adding to new/existing project:
+ 1. Add the ofxLibwebsockets source files to the C++ Linker
+ * right click on project in the solution explorer, click "Properties", Go down to C++ > General
+ * click the arrow at the right of "Additional include directories" and select "edit"
+ * add the ofxLibwebsockets source files:
+
+ ```
+ ..\..\..\addons\ofxLibwebsockets\libs\jsonpp
+ ..\..\..\addons\ofxLibwebsockets\libs\jsonpp\json
+ ..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include
+ ..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port
+ ..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\include
+ ..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\src
+ ..\..\..\addons\ofxLibwebsockets\libs\openssl\openssl
+ ..\..\..\addons\ofxLibwebsockets\src
+```
+
+
+ 2. Add the ofxLibwebsockets paths to the "Additional Library Directories":
+ * right click on project in the solution explorer, click "Properties", Go down to Linker > General
+ * click the arrow at the right of "Additional Library Directories" and select "edit"
+ * add ```..\..\..\addons/ofxLibwebsockets\libs\libwebsockets\libs\libwebsockets\lib\win32``` and ```..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\libs\openssl\lib\win32```
+ 3. Now go down to Linker > Input; open the editor "Additional dependencies" the same way
+ * In your debug scheme, add libwebsocketswin32d.lib, libeay32.lib, and ssleay32.lib
+ * In your release scheme, add libwebsocketswin32.lib, libeay32.lib, and ssleay32.lib
+
+* Linux
+ * Delete the entire directory at ofxLibwebsockets/libs/libwebsockets/include/win32port
+ * 64-bit static version of libwebsockets is included; please let us know if you can contribute a 32 bit version!
+
STATUS
------------
* Server example currently works with Chrome, and Safari (need to test FF)
@@ -14,6 +66,4 @@ TO-DO
------------
* Add functionality to examples
* More fun examples
-* Try to add binary sending/receiving
-* More testing of JSON parsing with jsoncpp (seems to be working)
-* Compile for linux
+* Compile for 32-bit linux
View
@@ -0,0 +1,80 @@
+meta:
+ ADDON_NAME = ofxLibwebsockets
+ ADDON_DESCRIPTION = Addon for websocket library
+ ADDON_AUTHOR = James Kong
+ ADDON_TAGS = "websocket" "libwebsocket" "networking"
+ ADDON_URL =
+
+common:
+ # dependencies with other addons, a list of them separated by spaces
+ # or use += in several lines
+ ADDON_DEPENDENCIES =
+
+ # include search paths, this will be usually parsed from the file system
+ # but if the addon or addon libraries need special search paths they can be
+ # specified here separated by spaces or one per line using +=
+ ADDON_INCLUDES = libs/openssl/openssl
+ ADDON_INCLUDES += src
+ ADDON_INCLUDES += libs/ofxLibwebsockets/include
+ ADDON_INCLUDES += libs/libwebsockets/include/
+ ADDON_INCLUDES += libs/jsoncpp/json
+
+ ADDON_INCLUDES += libs/ofxLibwebsockets/src
+ ADDON_INCLUDES += libs/ofxLibwebsockets/include/ofxLibwebsockets
+ # any special flag that should be passed to the compiler when using this
+ # addon
+ ADDON_CFLAGS =
+
+ # any special flag that should be passed to the linker when using this
+ # addon, also used for system libraries with -lname
+ ADDON_LDFLAGS =
+
+ # linux only, any library that should be included in the project using
+ # pkg-config
+ ADDON_PKG_CONFIG_LIBRARIES =
+
+ # osx/iOS only, any framework that should be included in the project
+ ADDON_FRAMEWORKS =
+
+ # source files, these will be usually parsed from the file system looking
+ # in the src folders in libs and the root of the addon. if your addon needs
+ # to include files in different places or a different set of files per platform
+ # they can be specified here
+ ADDON_SOURCES = libs/jsoncpp/jsoncpp.cpp
+ ADDON_SOURCES += libs/ofxLibwebsockets/src/Server.cpp
+ ADDON_SOURCES += libs/ofxLibwebsockets/src/Reactor.cpp
+ ADDON_SOURCES += libs/ofxLibwebsockets/src/Protocol.cpp
+ ADDON_SOURCES += libs/ofxLibwebsockets/src/Events.cpp
+ ADDON_SOURCES += libs/ofxLibwebsockets/src/Connection.cpp
+ ADDON_SOURCES += libs/ofxLibwebsockets/src/Client.cpp
+
+ # some addons need resources to be copied to the bin/data folder of the project
+ # specify here any files that need to be copied, you can use wildcards like * and ?
+ ADDON_DATA =
+
+ # when parsing the file system looking for libraries exclude this for all or
+ # a specific platform
+ ADDON_LIBS_EXCLUDE =
+
+linux64:
+ # binary libraries, these will be usually parsed from the file system but some
+ # libraries need to passed to the linker in a specific order
+ #nothing yet
+
+linux:
+ #nothing yet
+
+win_cb:
+ #nothing yet
+linuxarmv6l:
+ ADDON_LDFLAGS = -lssl
+
+ ADDON_LIBS = libs/libwebsockets/lib/linuxarmv6l/libwebsockets.a
+linuxarmv7l:
+ #nothing yet
+
+android/armeabi:
+ #nothing yet
+
+android/armeabi-v7a:
+ #nothing yet
@@ -5,14 +5,14 @@ OF_PATH = ../../..
//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
-LIB_SSL = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/lib/osx/libssl.a"
-LIB_CRYPTO = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/lib/osx/libcrypto.a"
-SSL_INC = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/"
-LWS = "$(OF_PATH)/addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a"
-OFX_LWS_INCLUDE = "$(OF_PATH)/addons/ofxLibwebsockets/libs/ofxLibwebsockets/include"
+// INCLUDE OFX_LIBWEBSOCKETS
+// 1: DEFINE WHERE IT LIVES; only change this if you have installed elsewhere or changed the name!
+OFX_LWS_PATH = "$(OF_PATH)/addons/ofxLibwebsockets"
-LIBWEBSOCKETS_LIBS = $(LIB_CRYPTO) $(LIB_SSL) $(LWS)
-LIBWEBSOCKETS_INCLUDES= $(SSL_INC)
+// 2: INCLUDE OFX_LIBWEBSOCKETS XCCONFIG (make sure you change the path if you've installed elsewhere!)
+#include "../../../addons/ofxLibwebsockets/ofxLibwebsockets.xcconfig"
-OTHER_LDFLAGS = $(OF_CORE_LIBS) $(LIBWEBSOCKETS_LIBS)
-HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) $(SSL_INC) $(OFX_LWS_INCLUDE)
+// 3: ADD TO OR REPLACE EXISTING VARS
+
+OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OFX_LWS_LIBS)
+HEADER_SEARCH_PATHS = $(OF_CORE_HE
@rc1

rc1 Apr 17, 2013

Contributor

These files seem to be chopped!

@rc1

rc1 Apr 17, 2013

Contributor

But it doesn't appear to make any difference :)

@@ -0,0 +1,13 @@
+# Attempt to load a config.make file.
+# If none is found, project defaults in config.project.make will be used.
+ifneq ($(wildcard config.make),)
+ include config.make
+endif
+
+# make sure the the OF_ROOT location is defined
+ifndef OF_ROOT
+ OF_ROOT=../../..
+endif
+
+# call the project makefile!
+include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk
@@ -5,14 +5,14 @@ OF_PATH = ../../..
//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
-LIB_SSL = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/lib/osx/libssl.a"
-LIB_CRYPTO = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/lib/osx/libcrypto.a"
-SSL_INC = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/"
-LWS = "$(OF_PATH)/addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a"
-OFX_LWS_INCLUDE = "$(OF_PATH)/addons/ofxLibwebsockets/libs/ofxLibwebsockets/include"
+// INCLUDE OFX_LIBWEBSOCKETS
+// 1: DEFINE WHERE IT LIVES; only change this if you have installed elsewhere or changed the name!
+OFX_LWS_PATH = "$(OF_PATH)/addons/ofxLibwebsockets"
-LIBWEBSOCKETS_LIBS = $(LIB_CRYPTO) $(LIB_SSL) $(LWS)
-LIBWEBSOCKETS_INCLUDES= $(SSL_INC)
+// 2: INCLUDE OFX_LIBWEBSOCKETS XCCONFIG (make sure you change the path if you've installed elsewhere!)
+#include "../../../addons/ofxLibwebsockets/ofxLibwebsockets.xcconfig"
-OTHER_LDFLAGS = $(OF_CORE_LIBS) $(LIBWEBSOCKETS_LIBS)
-HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) $(SSL_INC) $(OFX_LWS_INCLUDE)
+// 3: ADD TO OR REPLACE EXISTING VARS
+
+OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OFX_LWS_LIBS)
+HEADER_SEARCH_PATHS = $(OF_CORE_HE
@rc1

rc1 Apr 17, 2013

Contributor

And again here.

No changes.
@@ -0,0 +1,17 @@
+
+OF linux:
+
+this folder contains necessary components that need to be exported with the application:
+
+libs
+------ contains .so (shared objects) that the app needs to run against
+------ this allows OF linux apps to be released in a very portable way
+------ users of the apps shouldn't need to install anything besides glut
+------ (which should be installed in most cases)
+
+clickToLaunchApp.sh
+------ a shell script which runs the exe and set this variable:
+------ LD_LIBRARY_PATH, so that the app looks locally for the .so
+------ (shared objects) to run
+
+
@@ -1,13 +1,16 @@
#include "ofMain.h"
#include "testApp.h"
+#ifndef TARGET_LINUX_ARM
#include "ofAppGlutWindow.h"
-
+#endif
//========================================================================
int main( ){
-
+#ifndef TARGET_LINUX_ARM
ofAppGlutWindow window;
ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // <-------- setup the GL context
-
+#else
+ ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context
+#endif
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
@@ -5,14 +5,14 @@ OF_PATH = ../../..
//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
-LIB_SSL = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/lib/osx/libssl.a"
-LIB_CRYPTO = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/lib/osx/libcrypto.a"
-SSL_INC = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/"
-LWS = "$(OF_PATH)/addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a"
-OFX_LWS_INCLUDE = "$(OF_PATH)/addons/ofxLibwebsockets/libs/ofxLibwebsockets/include"
+// INCLUDE OFX_LIBWEBSOCKETS
+// 1: DEFINE WHERE IT LIVES; only change this if you have installed elsewhere or changed the name!
+OFX_LWS_PATH = "$(OF_PATH)/addons/ofxLibwebsockets"
-LIBWEBSOCKETS_LIBS = $(LIB_CRYPTO) $(LIB_SSL) $(LWS)
-LIBWEBSOCKETS_INCLUDES= $(SSL_INC)
+// 2: INCLUDE OFX_LIBWEBSOCKETS XCCONFIG (make sure you change the path if you've installed elsewhere!)
+#include "../../../addons/ofxLibwebsockets/ofxLibwebsockets.xcconfig"
-OTHER_LDFLAGS = $(OF_CORE_LIBS) $(LIBWEBSOCKETS_LIBS)
-HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) $(SSL_INC) $(OFX_LWS_INCLUDE)
+// 3: ADD TO OR REPLACE EXISTING VARS
+
+OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OFX_LWS_LIBS)
+HEADER_SEARCH_PATHS = $(OF_CORE_HE
@@ -5,14 +5,15 @@ OF_PATH = ../../..
//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
-LIB_SSL = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/lib/osx/libssl.a"
-LIB_CRYPTO = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/lib/osx/libcrypto.a"
-SSL_INC = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/"
-LWS = "$(OF_PATH)/addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a"
-OFX_LWS_INCLUDE = "$(OF_PATH)/addons/ofxLibwebsockets/libs/ofxLibwebsockets/include"
+// INCLUDE OFX_LIBWEBSOCKETS
+// 1: DEFINE WHERE IT LIVES; only change this if you have installed elsewhere or changed the name!
+OFX_LWS_PATH = "$(OF_PATH)/addons/ofxLibwebsockets"
-LIBWEBSOCKETS_LIBS = $(LIB_CRYPTO) $(LIB_SSL) $(LWS)
-LIBWEBSOCKETS_INCLUDES= $(SSL_INC)
+// 2: INCLUDE OFX_LIBWEBSOCKETS XCCONFIG
+#include "$(OFX_LWS_PATH)/ofxLibwebsockets.xcconfig"
-OTHER_LDFLAGS = $(OF_CORE_LIBS) $(LIBWEBSOCKETS_LIBS)
-HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) $(SSL_INC) $(OFX_LWS_INCLUDE)
+// 3: ADD TO OR REPLACE EXISTING VARS
+
+OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OFX_LWS_LIBS)
+HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) $(OFX_LWS_INCLUDES)
+LIBRARY_SEARCH_PATHS = $(inherited) $(OFX_LWS_SEARCH)
@@ -5,14 +5,15 @@ OF_PATH = ../../..
//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
-LIB_SSL = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/lib/osx/libssl.a"
-LIB_CRYPTO = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/lib/osx/libcrypto.a"
-SSL_INC = "$(OF_PATH)/addons/ofxLibwebsockets/libs/openssl/"
-LWS = "$(OF_PATH)/addons/ofxLibwebsockets/libs/libwebsockets/lib/osx/libwebsockets.a"
-OFX_LWS_INCLUDE = "$(OF_PATH)/addons/ofxLibwebsockets/libs/ofxLibwebsockets/include"
+// INCLUDE OFX_LIBWEBSOCKETS
+// 1: DEFINE WHERE IT LIVES; only change this if you have installed elsewhere or changed the name!
+OFX_LWS_PATH = "$(OF_PATH)/addons/ofxLibwebsockets"
-LIBWEBSOCKETS_LIBS = $(LIB_CRYPTO) $(LIB_SSL) $(LWS)
-LIBWEBSOCKETS_INCLUDES= $(SSL_INC)
+// 2: INCLUDE OFX_LIBWEBSOCKETS XCCONFIG (make sure you change the path if you've installed elsewhere!)
+#include "../../../addons/ofxLibwebsockets/ofxLibwebsockets.xcconfig"
-OTHER_LDFLAGS = $(OF_CORE_LIBS) $(LIBWEBSOCKETS_LIBS)
-HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) $(SSL_INC) $(OFX_LWS_INCLUDE)
+// 3: ADD TO OR REPLACE EXISTING VARS
+
+OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OFX_LWS_LIBS)
+HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) $(OFX_LWS_INCLUDES)
+LIBRARY_SEARCH_PATHS = $(inherited) $(OFX_LWS_SEARCH)
Oops, something went wrong.

0 comments on commit b14b5b3

Please sign in to comment.