Commit graph

196 commits

Author SHA1 Message Date
Arokux X
e0b3d13fbf CMAKE help if cwd not git dir
Hi all,

please consider applying the patch below. The git is called in some
different directory and that is why fails. I'm not sure why it was
called in different directory, maybe because I build libwebsockets
with CMake's ExternalProject.

Best,
Arokux

Signed-off-by: Arokux X <arokux@gmail.com>
2013-10-24 21:53:39 +08:00
Erland Isaksson
578a24df3d cmake fix for osx 64 bit
AG tested on 64-bit Fedora no problems

Signed-off-by: Erland Isaksson <erland@isaksson.info>
2013-09-18 09:00:52 +08:00
thinkski
d34bae15d3 trac 27: use fullpath in OSX dynamic libs
Signed-off-by: thinkski <chiszp@gmail.com>
2013-04-16 19:48:05 +08:00
thinkski
dd93a0c416 pkg config avoid hardcoded prefix
Signed-off-by: thinkski <chiszp@gmail.com>
2013-04-12 10:31:46 +08:00
Tomas Cejka
efda177e80 cmake use existing spec file for RPM generation
Signed-off-by: Tomas Cejka <cejkat@cesnet.cz>
2013-04-11 08:38:22 +08:00
Andy Green
5b479ac2f1 cmake improve cross documentation
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-30 10:30:03 +08:00
Peter Pentchev
9a4fef7ed6 Hide private library symbols
Signed-off-by: Peter Pentchev <roam@ringlet.net>
2013-03-30 09:52:21 +08:00
Joakim Soderberg
9c037c05fb BUGFIX: Properly add libcyassl to the lib list.
This would cause failure to build the test apps with CyaSSL.
2013-03-23 08:55:28 +08:00
Joakim Soderberg
c2012e40ed Check for GCC/G++ explicitly instead of simply Unix.
Since we're setting gcc specific build flags.
2013-03-23 08:55:02 +08:00
Andy Green
da3f6ffdbf cmake add gcc compile options
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-16 12:37:40 +08:00
Andy Green
27696f2596 cmake add missing echo test app
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 08:12:06 +08:00
Andy Green
c8c166221d cmake packageconfig installs to lib dir
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 08:12:01 +08:00
Andy Green
2aab3f9513 cmake ignore non source things for make dist
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 08:11:48 +08:00
Andy Green
19c1a99b59 update version 1.3 soname 4
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 07:34:53 +08:00
Edwin van den Oetelaar
15a38a788f cmake some cosmetic improvementss
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
2013-03-10 07:34:53 +08:00
Andy Green
63b3b959fc cmake fix install path
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 12:56:35 +08:00
Andy Green
a83349414f cmake win32 change helper includes to HDR_PUBLIC so they install
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 09:16:41 +08:00
Arokux B
897fec3a89 cmake mingw no need for websock w32
2.  Comment out this line

http://git.warmcat.com/cgi-bin/cgit/libwebsockets/tree/CMakeLists.txt#n279

the file websock-w32.c is already compiled indirectly from libwebsockets.c

Signed-off-by: Arokux B <arokux@gmail.com>
2013-02-28 09:25:02 +08:00
Andy Green
975423c949 cmake lib lib64 problem
As discussed here, there's a semi-standardized way to inform
cmake that the install target wants its libs in .../lib64

https://code.google.com/p/bullet/issues/detail?id=174

this patch adds the necessary fiddling

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-26 11:58:45 +08:00
Joakim Soderberg
c7ed2be638 Fix running test programs from within visual studio.
Copy test-server data to a path so that we can run the test-server from
within visual studio without having to copy stuff around.
2013-02-22 09:28:17 +08:00
Joakim Söderberg
51197c0d6f Set the _DEBUG macro for CMake also. 2013-02-22 09:28:13 +08:00
Joakim Soderberg
20aedc89c1 Fixed ssl cert generation on Windows. 2013-02-22 09:28:11 +08:00
Joakim Soderberg
b37827b651 Added CPack support + some more.
- "make dist" will now produce a tar.gz file. This includes everything (not really what we want but a start).
- Got rid of a bunch of defines and variables that aren't used.
- Added the option LINK_TESTAPPS_DYNAMIC that enables linking to the shared library version of the lib for the test apps, instead of doing it statically like the default is.
- Fixed proper support for the --prefix stuff (-DCMAKE_INSTALL_PREFIX for cmake). (Don't specify /usr/local explicitly, that is the default anyway and will break other platforms).

- Note: I noticed a problem with the "INSTALL_DATADIR" define used by the test-apps. Since we hard code the path to the certs using this, doing "DESTDIR=/bla make install" will result in not being able to use the SSL mode for the test-apps since they won't find the certs. (This also applies to the autoconf project). Fixed this by setting "../share" as the default location instead of using the prefix.
2013-02-22 09:28:08 +08:00
Joakim Soderberg
11a8cda204 BUGFIX: Fixed bug for installing test-apps for CMake.
Appending to the TEST_APP_LIST variable function did not work from within the create_test_app function (It would create a function scope variable with the same name and discard it). We instead need to use a macro for this.

The previous commit also removed the duplicate install for the test-apps (because we want all the install steps in one place in the file for clarity). That change made it obvious that the TEST_APP_LIST never gets populated.
2013-02-22 09:28:06 +08:00
Joakim Soderberg
7eadd586b1 Fixed CMake compile options.
Fixed so that the build options for the CMake project works:

- The test apps used the LWS_NO_EXTENSIONS define, so they needed lws_config.h included when building using CMake.
- Rename some options so that individual test apps can be turned off.
- Separate building the test-client/test-server and compiling the server/client parts into the lib.
- Don't include server or client specific sources into the build if they shouldn't be built.
- Added an error if both client and server parts are excluded at the same time (makes no sense).
- Removed duplicate install targets for the test apps.
- Commented out the WITH_LIBCRYPTO option since it isn't used at the moment.
2013-02-22 09:28:04 +08:00
Joakim Soderberg
fcec61c576 getifaddrs missing more user friendly in CMake.
Don't require the user to enable using the built-in BSD getifaddrs implementation on systems such as uclibc that lacks it manually.

Instead if getifaddrs doesn't exist, use the BSD one automatically, except if the user explicitly tells the user not to do this using WITHOUT_BUILTIN_GETIFADDRS (which will result in a compilation error, but at least with a nice error message explaining why).
2013-02-22 09:28:02 +08:00
Joakim Soderberg
fe2dae759d Bugfix compiling for cross compiling.
! does not mean NOT, use NOT instead :)
2013-02-22 09:27:57 +08:00
Edwin van den Oetelaar
d75076eaea cmake fix for older cmake
AG this wasn't needed on cmake 2.8.10.2 but did not make any
problem either

Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
2013-02-20 02:08:51 +08:00
Joakim Söderberg
455e45150a Create the "doc" dir before generating docs.
The documentation wouldn't be generated if the path didn't exist.
2013-02-19 10:14:54 +08:00
Joakim Söderberg
6ac9709790 Added "make install" support to the CMake project.
- Does everything as the autoconf script does (I think).
- Generates SSL certs for the test-server
- Installs all test apps.
- Defaults to /usr/local/
- "DESTDIR=/bla make install" works
- Append "libwebsockets" to start of the test-app names like the autoconf stuff does.
- Only tested on OSX so far...
2013-02-19 10:14:37 +08:00
Edwin van den Oetelaar
d6bf73c224 move cms cmake addition to cmake module paths earlier
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
2013-02-18 20:20:05 +08:00
Joakim Soderberg
f272cb0624 Fixed DLL compilation on Windows for CMake.
- Define LWS_DLL and LWS_INTERNAL when websockets_shared is compiled.

- The websocket_shared target compiles to websocket.lib / websocket.dll
  (websocket.lib contains the exported functions for websocket.dll, and is
  the file that is linked to when a program wants to use the dll)

- The websocket target compiles to websocket_static.lib on windows.

- Replaced any "extern" with "LWS_EXTERN" on libwebsockets.h for proper
  DLL function exports.

- Created a LIB_LIST with all the libwebsocket dependencies, instead of
  multiple calls to target_link_libraries, only one call is made for both
  the static and shared library version. This makes it easy to add other
  variants if wanted in the future.

- Added ZLIB as a dependency for the libs, so that the build order will be
  correct at all times.

- Added a dependency for the websockets lib to the test apps, so it is
  built before them.

- Fixed the test-server-extpoll app to include the emulated_poll, and link
  to winsock on Windows.

- Removed the global export of libwebsocket_internal_extensions, and added
  a function libwebsocket_get_internal_extensions() that returns it
  instead. Using the global would not work with the DLL export on Windows.
2013-02-13 09:29:26 +08:00
Joakim Soderberg
08483536d2 Fixed soname and build shared lib for CMake.
- Build a shared version of the library (used to be only static).
- Set the so version name properly since the ABI has changed for version 1.2
2013-02-13 09:29:17 +08:00
Joakim Soderberg
f83585f4b6 Added so-version information to the lib. 2013-02-13 09:29:09 +08:00
Andy Green
48258817a0 bump version to 1.2 and soname to 3
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-12 10:36:39 +08:00
Joakim Soderberg
7df9908148 Added build instructions for CMake.
Also changed it so that specifying the include directories for CyaSSL is nicer.
2013-02-07 20:24:19 +08:00
Joakim Söderberg
cb4156d437 Cleaned up the CyaSSL linking in the CMake project a bit.
Separated the CyaSSL linking and OpenSSL linking for more clearity.
Now tested on both OSX and Windows as well.
2013-02-06 15:49:13 +09:00
Joakim Soderberg
91de93391c Fixed windows build.
- Fixed the original visual studio project so that inline gets defined.
- Fix error in CMake with zlib.
2013-02-06 15:49:13 +09:00
Joakim Soderberg
e9a42119f6 Added some minor changes to CMake build file.
- Added options for compiling without server/client parts.
- Fixed a syntax error on printing an error on CyaSSL compilation.
- Don't compile server-extpoll either when the server isn't compiled.
2013-02-06 15:49:12 +09:00
Joakim Soderberg
b378ce9d18 Added support for CyaSSL replacement of OpenSSL.
http://www.yassl.com/yaSSL/Products-cyassl.html
- Small Size: 20-100kB
- Runtime Memory:  1-36kB
- 20X smaller than OpenSSL

So far only tested on Linux.

Note that this requires a bugfix in cyassl, otherwise it will crash. Pull request has been made to the official repos, in the meantime the following repos can be used: git://github.com/JoakimSoderberg/cyassl.git
2013-02-06 15:49:12 +09:00
Joakim Soderberg
4f4a38bae0 Added check for inline keyword availability.
Both to CMake project and Autoconf. inline will be defined to whatever inline replacement exists on the system, such as __inline or __inline__
2013-02-06 15:49:12 +09:00
Joakim Söderberg
68e8d730b8 Fixed build on OSX.
- For some reason the "extern int pid_daemon" usage in libwebsockets.c would cause an "undefined symbols" linker error for the test-apps. This only happens with the CMake project, not the normal Makefiles. I have no clue why this is. Fixed it by getting the pid via a function instead.

- Added test-server-extpoll

- Renamed the library from libwebsocket -> libwebsockets
2013-02-06 15:49:12 +09:00
Joakim Soderberg
d2edfec5fa Fixed linux compilation and added more compile options.
- Tested and works on Linux now also, including SSL support.
- Look for ZLIB not zlib.
- Added CMake options for setting all LWS_ defines.
2013-02-06 15:49:12 +09:00
Joakim Soderberg
4c53123677 CMake support + fixed windows build.
- Finalized CMake support (tested on windows only so far).
  - Uses a generated lws_config.h that is included in
  private-libwebsocket to pass defines, only used if CMAKE_BUILD is set.
  - Support for SSL on Windows.
  - Initial support for CyaSSL replacement of OpenSSL (This has been added
    to my older CMake-fork but haven't been tested on this version yet).
- Fixed windows build (see below for details).
- Fixed at least the 32-bit Debug build for the existing Visual Studio
  Project. (Not to keen fixing all the others when we have CMake support
  anyway (which can generate much better project files)...)
- BUGFIXES:
  - handshake.c
    - used C99 definition of handshake_0405 function
  - libwebsocket.c
    - syslog not available on windows, put in ifdefs.
    - Fixed previous known crash bug on Windows where WSAPoll in
      Ws2_32.dll would not be present, causing the poll function pointer
      being set to NULL.
    - Uninitialized variable context->listen_service_extraseen would
      result in stack overflow because of infinite recursion. Fixed by
      initializing in libwebsocket_create_context
    - SO_REUSADDR means something different on Windows compared to Unix.
    - Setting a socket to nonblocking is done differently on Windows.
      (This should probably broken out into a helper function instead)
    - lwsl_emit_syslog -> lwsl_emit_stderr on Windows.
  - private-libwebsocket.h
    - PATH_MAX is not available on Windows, define as MAX_PATH
    - Always define LWS_NO_DAEMONIZE on windows.
    - Don't define lws_latency as inline that does nothing. inline is not
      support by the Microsoft compiler, replaced with an empty define
      instead. (It's __inline in MSVC)
  - server.c
    - Fixed nonblock call on windows
  - test-ping.c
    - Don't use C99 features (Microsoft compiler does not support it).
    - Move non-win32 headers into ifdefs.
    - Skip use of sighandler on Windows.
  - test-server.c
    - ifdef syslog parts on Windows.
2013-02-06 15:49:12 +09:00
Joakim Soderberg
add3926b17 Some more Cmake stuff. 2013-02-06 15:49:12 +09:00
Joakim Soderberg
08e434eb66 Started redoing CMake support based on the up to date repos 2013-02-06 15:49:12 +09:00