Skip to content

Commit

Permalink
Build fixes for CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf3s committed Dec 15, 2024
1 parent ce73a29 commit ecfc313
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 33 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,18 @@ jobs:

- name: Create Build Environment
run: >
sudo apt update &&
sudo apt install -y wget cmake git gettext smpq &&
wget https://github.com/PacBrew/pacbrew-pacman/releases/download/v1.1/pacbrew-pacman-1.1.deb &&
sudo dpkg -i pacbrew-pacman-1.1.deb && sudo pacbrew-pacman -Sy &&
sudo pacbrew-pacman --noconfirm -S ps4-openorbis ps4-openorbis-portlibs
sudo apt-get update && \
sudo apt-get install -y pacman-package-manager wget cmake git gettext smpq && \
sudo tee -a /etc/pacman.conf > /dev/null <<TEXT
[pacbrew]
SigLevel = Optional TrustAll
Server = https://pacman.mydedibox.fr/pacbrew/packages/
TEXT
- name: Setup pacman packages
run: |
sudo pacman --noconfirm -Sy && sudo pacman --noconfirm -S ps4-openorbis ps4-openorbis-portlibs
- name: build libsmb2
run: |
make -f Makefile.platform ps4_all clean
Expand Down
45 changes: 22 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ if(NOT ESP_PLATFORM)
if(NOT IOP AND BUILD_IRX)
project(smb2man
LANGUAGES C
VERSION 2.2.0
VERSION 2.3.0
)
set(VERSION 2.2.0)
set(VERSION 2.3.0)
set(PACKAGE "smb2man")
set(PACKAGE_BUGREPORT "[email protected] or [email protected]")
set(PACKAGE_NAME "smb2man")
Expand All @@ -43,23 +43,22 @@ if(NOT ESP_PLATFORM)
configure_file(libsmb2.pc.in libsmb2.pc @ONLY)
endif()


if(NOT PICO_BOARD AND NOT ESP_PLATFORM)
set(SOVERSION 1 CACHE STRING "" FORCE)
if(NOT IOP AND NOT BUILD_IRX)
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "Installation directory for libraries")
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/cmake/libsmb2" CACHE PATH "Installation directory for cmake (.cmake) files")
endif()
if(CMAKE_SYSTEM_NAME MATCHES NintendoSwitch OR CMAKE_SYSTEM_NAME MATCHES Nintendo3DS OR PS4 OR PS2 OR VITA OR CMAKE_SYSTEM_NAME MATCHES Dreamcast OR CMAKE_SYSTEM_NAME MATCHES NintendoGameCube OR CMAKE_SYSTEM_NAME MATCHES NintendoDS OR CMAKE_SYSTEM_NAME MATCHES NintendoWii OR CMAKE_SYSTEM_NAME MATCHES CafeOS)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
else()
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
endif()
option(ENABLE_EXAMPLES "Build example programs" OFF)
if(NOT ESP_PLATFORM)
set(SOVERSION 1 CACHE STRING "" FORCE)
if(NOT IOP AND NOT BUILD_IRX)
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "Installation directory for libraries")
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/cmake/libsmb2" CACHE PATH "Installation directory for cmake (.cmake) files")
endif()
if(CMAKE_SYSTEM_NAME MATCHES NintendoSwitch OR CMAKE_SYSTEM_NAME MATCHES Nintendo3DS OR PS4 OR PS2 OR VITA OR CMAKE_SYSTEM_NAME MATCHES Dreamcast OR CMAKE_SYSTEM_NAME MATCHES NintendoGameCube OR CMAKE_SYSTEM_NAME MATCHES NintendoDS OR CMAKE_SYSTEM_NAME MATCHES NintendoWii OR CMAKE_SYSTEM_NAME MATCHES CafeOS)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
else()
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
endif()
option(ENABLE_EXAMPLES "Build example programs" OFF)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
endif()

if(CMAKE_SYSTEM_NAME MATCHES Linux)
Expand All @@ -68,7 +67,7 @@ endif()
find_package(GSSAPI)
endif()

if(NOT PICO_BOARD AND NOT ESP_PLATFORM)
if(NOT ESP_PLATFORM)
include(cmake/ConfigureChecks.cmake)
endif()

Expand Down Expand Up @@ -119,20 +118,20 @@ endif()
set(ARCH "-march=armv8-a -mtp=soft -fPIE")
set(CMAKE_C_FLAGS "-g -Wall -O2 -ffast-math ${ARCH}")
set(CMAKE_C_FLAGS "-Wno-unused-variable")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -std=gnu++11")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -std=gnu11")
set(CMAKE_C_LDFLAGS "${CMAKE_C_FLAGS} -specs=switch.specs -g ${ARCH} -Wl,-Map,$(notdir $*.map)")
add_compile_options("${CMAKE_C_FLAGS} ${CMAKE_LDFLAGS}")
elseif(CMAKE_SYSTEM_NAME MATCHES Nintendo3DS)
add_definitions(-DARM11 -D_3DS -D__3DS__ -DNEED_READV -DNEED_WRITEV -DNEED_GETLOGIN_R)
set(ARCH "-march=armv6k -mfloat-abi=hard -mtune=mpcore -mtp=soft -fPIE")
set(CMAKE_C_FLAGS "-Wno-unused-variable -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffast-math ${ARCH}")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions -std=gnu++11")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions -std=gnu11")
set(CMAKE_C_LDFLAGS "${CMAKE_C_FLAGS} -specs=3dsx.specs -g ${ARCH} -Wl,-Map,$(notdir $*.map)")
add_compile_options("${CMAKE_C_FLAGS} ${CMAKE_LDFLAGS}")
elseif(CMAKE_SYSTEM_NAME MATCHES NintendoDS)
add_definitions(-DARM9 -D__NDS__ -DNEED_READV -DNEED_WRITEV -DNEED_GETLOGIN_R -DNEED_GETADDRINFO -DNEED_FREEADDRINFO -DNEED_POLL)
add_definitions(-DARM9 -D__NDS__ -DNEED_READV -DHAVE_SOCKADDR_STORAGE -DNEED_WRITEV -DNEED_GETLOGIN_R -DNEED_GETADDRINFO -DNEED_FREEADDRINFO -DNEED_POLL)
set(CMAKE_C_FLAGS "-Wno-format -Wpointer-arith")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions -std=gnu++11")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions -std=gnu11")
set(CMAKE_C_LDFLAGS "${CMAKE_C_FLAGS} -specs=ds_arm9.specs -g")
add_compile_options("${CMAKE_C_FLAGS} ${CMAKE_LDFLAGS}")
elseif(CMAKE_SYSTEM_NAME MATCHES NintendoGameCube)
Expand Down
9 changes: 5 additions & 4 deletions lib/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -634,13 +634,15 @@ struct iovec {
#ifndef __NDS__
#include <network.h>
#endif
#if !defined(HAVE_SOCKADDR_STORAGE)
struct sockaddr_storage {
#ifdef HAVE_SOCKADDR_SA_LEN
unsigned char ss_len;
#endif /* HAVE_SOCKADDR_SA_LEN */
unsigned char ss_family;
unsigned char fill[127];
};
#endif

struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
Expand All @@ -653,10 +655,6 @@ struct addrinfo {
struct addrinfo *ai_next; /* next structure in linked list */
};

#ifdef __NDS__
typedef int socklen_t;
#endif

#endif
#define sockaddr_in6 sockaddr_in
#else
Expand Down Expand Up @@ -732,6 +730,9 @@ void smb2_freeaddrinfo(struct addrinfo *res);
#define setsockopt net_setsockopt
s32 getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen);
#define select net_select
#define accept net_accept
#define listen net_listen
#define bind net_bind
#endif

struct pollfd {
Expand Down
2 changes: 2 additions & 0 deletions lib/ps2/imports.lst
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ sysclib_IMPORTS_end

stdio_IMPORTS_start
I_printf
I_putchar
I_puts
stdio_IMPORTS_end
3 changes: 3 additions & 0 deletions packaging/RPM/libsmb2.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ development libraries for LibSMB2
%{_libdir}/pkgconfig/libsmb2.pc

%changelog
* Sun Dec 15 2024 : Version 6.0.1
- Fix compile for: PS2, Nintendo WII and Gamecube
- Fix cmake logic for PICO_BOARD and ESP_PLATFORM
* Wed Dec 11 2024 : Version 6.0.0
- Major rewrites to DCE-RPC
- Initial support for building servers
Expand Down

0 comments on commit ecfc313

Please sign in to comment.