summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL22
-rw-r--r--cmake/LighttpdMacros.cmake6
-rw-r--r--src/CMakeLists.txt12
3 files changed, 39 insertions, 1 deletions
diff --git a/INSTALL b/INSTALL
index c0899a8a..f4aa8f7c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -54,3 +54,25 @@ static build using make
$ LIGHTTPD_STATIC=yes ./configure -C --enable-static=yes
$ make
$ sudo make install
+
+build using CMake and Xcode on Mac OS X with MacPorts
+-----------------------------------------------------
+* upgrade to latest Mac OS X
+* install Xcode from Apple Store (requires latest Mac OS X)
+* install MacPorts from https://www.macports.org/install.php
+
+ $ xcodebuild --license
+ $ xcode-select --install
+ $ sudo port selfupdate
+ $ sudo port install autoconf automake cmake libtool m4 pcre pkgconfig zlib bzip2 openssl libxml sqlite3 openldap fcgi p5-cgi libunwind libunwind-headers mysql57 libev gdbm openldap ossp-uuid
+ # Note: some of the above require more fiddling to configure with CMake...
+
+ # cmake and build
+ # (all -DWITH_... flags below are optional)
+ $ cmake -Wno-dev -DWITH_OPENSSL=1 -DWITH_LUA=1 -DWITH_ZLIB=1 -DWITH_BZIP2=1 -DWITH_WEBDAV_PROPS=1 .
+ $ make -j 4
+ $ make test
+
+ # Note: many tests fail if not built with openssl
+ # lighttpd will not start up with tests/lighttpd.conf
+ # (mod_secdownload fails to configure hmac-sha1 and hmac-sha256)
diff --git a/cmake/LighttpdMacros.cmake b/cmake/LighttpdMacros.cmake
index f3356990..95cab8d9 100644
--- a/cmake/LighttpdMacros.cmake
+++ b/cmake/LighttpdMacros.cmake
@@ -5,7 +5,11 @@ macro(ADD_AND_INSTALL_LIBRARY LIBNAME SRCFILES)
add_library(${LIBNAME} STATIC ${SRCFILES})
target_link_libraries(lighttpd ${LIBNAME})
else()
- add_library(${LIBNAME} SHARED ${SRCFILES})
+ if(APPLE)
+ add_library(${LIBNAME} MODULE ${SRCFILES})
+ else()
+ add_library(${LIBNAME} SHARED ${SRCFILES})
+ endif()
set(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} ${LIBNAME})
## Windows likes to link it this way back to app!
if(WIN32)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b4d0c2cb..b89b2dd7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -45,6 +45,8 @@ option(BUILD_STATIC "build a static lighttpd with all modules added")
if(BUILD_STATIC)
set(LIGHTTPD_STATIC 1)
+elseif(APPLE)
+ set(CMAKE_SHARED_MODULE_PREFIX "")
else()
set(CMAKE_SHARED_LIBRARY_PREFIX "")
endif()
@@ -221,7 +223,13 @@ else()
endif()
if(WITH_OPENSSL)
+ if(APPLE)
+ set(CMAKE_REQUIRED_INCLUDES /opt/local/include)
+ endif()
check_include_files(openssl/ssl.h HAVE_OPENSSL_SSL_H)
+ if(APPLE)
+ set(CMAKE_REQUIRED_INCLUDES)
+ endif()
if(HAVE_OPENSSL_SSL_H)
check_library_exists(crypto BIO_f_base64 "" HAVE_LIBCRYPTO)
if(HAVE_LIBCRYPTO)
@@ -599,6 +607,8 @@ if(HAVE_PCRE_H)
add_target_properties(mod_redirect COMPILE_FLAGS ${PCRE_CFLAGS})
target_link_libraries(mod_trigger_b4_dl ${PCRE_LDFLAGS})
add_target_properties(mod_trigger_b4_dl COMPILE_FLAGS ${PCRE_CFLAGS})
+ target_link_libraries(test_configfile ${PCRE_LDFLAGS})
+ add_target_properties(test_configfile COMPILE_FLAGS ${PCRE_CFLAGS})
endif()
target_link_libraries(mod_magnet ${LUA_LDFLAGS})
@@ -667,7 +677,9 @@ if(CMAKE_COMPILER_IS_GNUCC)
add_definitions(-D_GNU_SOURCE)
endif()
+if((NOT APPLE) OR CMAKE_COMPILER_IS_GNUCC)
add_target_properties(lighttpd LINK_FLAGS "-Wl,-export-dynamic")
+endif()
set_target_properties(lighttpd PROPERTIES CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})