diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /cmake/external | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/external')
-rw-r--r-- | cmake/external/lua52/0001-Add-an-install-static-target.patch | 28 | ||||
-rw-r--r-- | cmake/external/lua52/Lua52.cmake | 47 |
2 files changed, 75 insertions, 0 deletions
diff --git a/cmake/external/lua52/0001-Add-an-install-static-target.patch b/cmake/external/lua52/0001-Add-an-install-static-target.patch new file mode 100644 index 00000000..0f161925 --- /dev/null +++ b/cmake/external/lua52/0001-Add-an-install-static-target.patch @@ -0,0 +1,28 @@ +From f9430b91ae6957f9b77e03e3ce1edfbce99b5019 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= <j@v6e.pt> +Date: Sat, 10 Jun 2023 19:16:51 +0100 +Subject: [PATCH] Add an install-static target + +--- + Makefile | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Makefile b/Makefile +index b2a62cf..7134775 100644 +--- a/Makefile ++++ b/Makefile +@@ -64,6 +64,11 @@ install: dummy + cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) + cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) + ++install-static: dummy ++ cd src && $(MKDIR) $(INSTALL_INC) $(INSTALL_LIB) ++ cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) ++ cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) ++ + uninstall: + cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN) + cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC) +-- +2.41.0 + diff --git a/cmake/external/lua52/Lua52.cmake b/cmake/external/lua52/Lua52.cmake new file mode 100644 index 00000000..864f2235 --- /dev/null +++ b/cmake/external/lua52/Lua52.cmake @@ -0,0 +1,47 @@ +# +find_program(MAKE_EXE NAMES gmake nmake make) +include(ExternalProject) + +message(DEBUG "Compiler: ${CMAKE_C_COMPILER} Ar: ${CMAKE_AR} Ranlib: ${CMAKE_RANLIB}") + +set(_staging_dir "${CMAKE_BINARY_DIR}/staging") + +if(MINGW) + set(_target mingw) +elseif(APPLE) + set(_target macosx) +elseif(CMAKE_SYSTEM_NAME MATCHES Linux) + set(_target linux) +elseif(UNIX) + set(_target posix) +else() + set(_target generic) +endif() + +set(HAVE_LUA TRUE) +set(LUA_INCLUDE_DIRS "${_staging_dir}/include") +set(LUA_LIBRARIES "${_staging_dir}/lib/liblua.a") +set(LUA_FOUND TRUE CACHE INTERNAL "") +set(Lua_FOUND TRUE CACHE INTERNAL "") + +set(_lua52_cflags "-fPIC") +if(APPLE) + set(_lua52_cflags "${lua52_cflags} -isysroot ${CMAKE_OSX_SYSROOT}") +endif() + +# +# The install patch isn't strictly necessary for Lua but it's cleaner to install +# external projects to a staging directory first, and the normal install target +# does not work with MinGW. +# +ExternalProject_Add(lua52 + URL https://gitlab.com/wireshark/wireshark-development-libraries/-/raw/main/public/src/lua/lua-5.2.4.tar.gz + URL https://www.lua.org/ftp/lua-5.2.4.tar.gz + URL_HASH SHA256=b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b + PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_LIST_DIR}/0001-Add-an-install-static-target.patch + CONFIGURE_COMMAND "" + BUILD_COMMAND ${MAKE_EXE} MYCFLAGS=${_lua52_cflags} CC=${CMAKE_C_COMPILER} AR=${CMAKE_AR}\ rcu RANLIB=${CMAKE_RANLIB} ${_target} + BUILD_IN_SOURCE True + BUILD_BYPRODUCTS ${LUA_LIBRARIES} + INSTALL_COMMAND ${MAKE_EXE} INSTALL_TOP=${_staging_dir} install-static +) |