Skip to content

Commit

Permalink
Rename libsmb2_ips to rpc and others to libsmb2.
Browse files Browse the repository at this point in the history
@fjtrujy suggestion for ps2sdk-ports.
  • Loading branch information
Wolf3s committed Jul 11, 2024
1 parent e4772ec commit 4497cd4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 41 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ else()
add_compile_options("${CMAKE_C_FLAGS}")
elseif(EE)
add_definitions(-DNEED_BE64TOH -DNEED_POLL -DNEED_WRITEV -DNEED_READV -DNEED_GETLOGIN_R)
if(PLATFORM_PS2 AND EE AND PS2IPS)
add_definitions(-DPS2IPS)
if(EE AND PS2RPC)
add_definitions(-DPS2RPC)
endif()
elseif(IOP)
add_definitions(-DHAVE_CONFIG_H -DNEED_BE64TOH -DNEED_STRDUP -DNEED_READV -DNEED_WRITEV -DNEED_POLL -DNEED_GETPID -DNEED_RANDOM -DNEED_SRANDOM -DNEED_GETLOGIN_R -DHAVE_STRING_H -DHAVE_SYS_FCNTL_H)
if(PLATFORM_PS2 AND IOP AND BUILD_IRX)
if(IOP AND BUILD_IRX)
add_definitions(-D__ps2sdk_iop__)
endif()
set(CMAKE_C_FLAGS "-Wall")
Expand Down
2 changes: 1 addition & 1 deletion Makefile.platform
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ps2_ee_install: ps2_ee_all
cmake --build build --target install

ps2_ips_all:
cmake -S . -B build -DPS2IPS=1 "-DCMAKE_TOOLCHAIN_FILE=${PS2DEV}/share/ps2dev.cmake" "-DCMAKE_INSTALL_PREFIX=${PS2SDK}/ports" "-DCMAKE_INSTALL_PREFIX=${PS2SDK}/ports"
cmake -S . -B build -DPS2RPC=1 "-DCMAKE_TOOLCHAIN_FILE=${PS2DEV}/share/ps2dev.cmake" "-DCMAKE_INSTALL_PREFIX=${PS2SDK}/ports" "-DCMAKE_INSTALL_PREFIX=${PS2SDK}/ports"
cmake --build build

ps2_ips_install: ps2_ips_all
Expand Down
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ EE, Emotion-Engine, is the main CPU for the PS2.
To compile libsmb2 for the PS2 EE, first install the PS2 toolchain and
PS2 SDK and set it up.

To build libsmb2_ip.a, a version of libsmb2 for the EE tcpip stack:
To build libsmb2.a, a version of libsmb2 for the EE tcpip stack:
$ make -f Makefile.platform clean
$ make -f Makefile.platform ps2_ee_install

EE Using IOP Stack, It´s a different of EE
version for when the LWIP stack is running on the IOP (libsmb2_ips and linking
version for when the LWIP stack is running on the IOP (libsmb2_rpc and linking
with -lps2ips)

To build libsmb2_ips.a, a version of libsmb2 for the IOP tcpip stack:
To build libsmb2_rpc.a, a version of libsmb2 for ee with IOP tcpip stack:
$ make -f Makefile.platform clean
$ make -f Makefile.platform ps2_ips_install

Expand Down
42 changes: 9 additions & 33 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,13 @@ set(HEADERS
${SMB2_INCLUDE}/smb2-errors.h
${SMB2_INCLUDE}/smb2.h)

if(EE AND NOT PLATFORM_PS2 AND NOT PS2IPS)
add_library(smb2_ip ${SOURCES} ${HEADERS})
target_link_libraries(smb2_ip PUBLIC ${core_DEPENDS} ${CORE_LIBRARIES})
target_include_directories(smb2_ip PUBLIC ${INCLUDE_PATH})
set_target_properties(smb2_ip PROPERTIES
if(EE AND PS2RPC)
add_library(smb2_rpc ${SOURCES} ${HEADERS})
target_link_libraries(smb2_rpc PUBLIC ${core_DEPENDS} ${CORE_LIBRARIES})
target_include_directories(smb2_rpc PUBLIC ${INCLUDE_PATH})
set_target_properties(smb2_rpc PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${SOVERSION})
elseif(PLATFORM_PS2 AND EE AND PS2IPS)
add_library(smb2_ips ${SOURCES} ${HEADERS})
target_link_libraries(smb2_ips PUBLIC ${core_DEPENDS} ${CORE_LIBRARIES})
target_include_directories(smb2_ips PUBLIC ${INCLUDE_PATH})
set_target_properties(smb2_ips PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${SOVERSION})
elseif(IOP)
add_library(smb2_iop ${SOURCES} ${HEADERS})
target_link_libraries(smb2_iop PUBLIC ${core_DEPENDS} ${CORE_LIBRARIES})
target_include_directories(smb2_iop PUBLIC ${INCLUDE_PATH})
set_target_properties(smb2_iop PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${SOVERSION})
SOVERSION ${SOVERSION})
else()
add_library(smb2 ${SOURCES} ${HEADERS})
target_link_libraries(smb2 PUBLIC ${core_DEPENDS} ${CORE_LIBRARIES})
Expand All @@ -97,21 +83,11 @@ else()
endif()
endif()

if(EE AND NOT PLATFORM_PS2 AND NOT PS2IPS)
install(TARGETS smb2_ip EXPORT smb2_ip
if(EE AND PS2RPC)
install(TARGETS smb2_rpc EXPORT smb2_rpc
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib${LIB_SUFFIX}
LIBRARY DESTINATION lib${LIB_SUFFIX})
elseif(PLATFORM_PS2 AND EE AND PS2IPS)
install(TARGETS smb2_ips EXPORT smb2_ips
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib${LIB_SUFFIX}
LIBRARY DESTINATION lib${LIB_SUFFIX})
elseif(IOP)
install(TARGETS smb2_iop EXPORT smb2_iop
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib${LIB_SUFFIX}
LIBRARY DESTINATION lib${LIB_SUFFIX})
LIBRARY DESTINATION lib${LIB_SUFFIX})
else()
install(TARGETS smb2 EXPORT smb2
RUNTIME DESTINATION bin
Expand Down
2 changes: 1 addition & 1 deletion lib/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ struct sockaddr_storage {
#include <loadcore.h>
#endif

#ifdef PS2IPS
#ifdef PS2RPC
#include <ps2ips.h>
#else
#include <ps2ip.h>
Expand Down

0 comments on commit 4497cd4

Please sign in to comment.