Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to amigaos #297

Merged
merged 19 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,23 @@ Then to build libsmb2, run
The process will copy the resulting libsmb2.a and the include/smb2 headers to your
OpenOrbis SDK include folder.

Amiga (AmigaOS)
----------------------
AmigaOS is Operating system which the main processor is a Microprocessor PowerPC.
There are 3 versions:
AmigaOS4(Makefile.AMIGA)
AmigaOS3(Makefile.AMIGA_OS3)
AmigaAROS(Makefile.AMIGA_AROS)
To compile libsmb2 for the AmigaOS, you need to set newlib.library V53.40 or newer (or V53.30 as included in 4.1 FE) and
filesysbox.library 54.4 or newer to set it up.

Then to build libsmb2, choose the makefile acording your AmigaOS system and hit
$ cd lib
$ make -f Makefile.YOUR_AMIGA_OS_USED clean install

The process will copy the resulting libsmb2.a and the include/smb2 headers in the bin folder inside of the lib folder
NOTE: Amiga AROS is a Open Source version of AmigaOS, So do not build this version unless you are using the AmigaAROS.

Dreamcast (KallistiOS)
----------------------
Hitachi SH4 in little-endian mode is the main CPU for the Dreamcast.
Expand Down
4 changes: 2 additions & 2 deletions Xbox 360/libsmb2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<BufferSecurityCheck>false</BufferSecurityCheck>
<PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>_DEBUG;_XBOX;_LIB;NEED_POLL;NEED_GETPID;NEED_GETLOGIN_R;NEED_RANDOM;NEED_SRANDOM;XBOX_360_PLATFORM;HAVE_CONFIG_H</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_XBOX;_LIB;NEED_POLL;NEED_GETPID;NEED_GETLOGIN_R;NEED_RANDOM;NEED_SRANDOM;NEED_GETADDRINFO;NEED_FREEADDRINFO;XBOX_360_PLATFORM;HAVE_CONFIG_H</PreprocessorDefinitions>
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>..\include\;..\include\smb2;..\include\msvc;..\include\msvc\sys;..\include\xbox 360</AdditionalIncludeDirectories>
Expand Down Expand Up @@ -195,7 +195,7 @@
<BufferSecurityCheck>false</BufferSecurityCheck>
<PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>NDEBUG;_XBOX;_LIB;NEED_POLL;NEED_GETPID;NEED_GETLOGIN_R;NEED_RANDOM;NEED_SRANDOM;XBOX_360_PLATFORM;HAVE_CONFIG_H</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_XBOX;_LIB;NEED_POLL;NEED_GETPID;NEED_GETLOGIN_R;NEED_RANDOM;NEED_SRANDOM;NEED_GETADDRINFO;NEED_FREEADDRINFO;XBOX_360_PLATFORM;HAVE_CONFIG_H</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\include\;..\include\smb2;..\include\msvc;..\include\msvc\sys;..\include\xbox 360</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand Down
4 changes: 2 additions & 2 deletions Xbox/libsmb2.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
InlineFunctionExpansion="2"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="..\include\;..\include\msvc;..\include\xbox;..\include\smb2"
PreprocessorDefinitions="_DEBUG;_XBOX;_LIB;XBOX_PLATFORM;NEED_POLL;NEED_GETPID;NEED_GETLOGIN_R;NEED_RANDOM;NEED_SRANDOM;HAVE_CONFIG_H"
PreprocessorDefinitions="_DEBUG;_XBOX;_LIB;XBOX_PLATFORM;NEED_POLL;NEED_GETADDRINFO;NEED_FREEADDRINFO;NEED_GETPID;NEED_GETLOGIN_R;NEED_RANDOM;NEED_SRANDOM;HAVE_CONFIG_H"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
Expand Down Expand Up @@ -126,7 +126,7 @@
OmitFramePointers="TRUE"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="..\include\;..\include\msvc;..\include\xbox;..\include\smb2"
PreprocessorDefinitions="NDEBUG;_XBOX;_LIB;XBOX_PLATFORM;NEED_POLL;NEED_GETPID;NEED_GETLOGIN_R;NEED_RANDOM;NEED_SRANDOM;HAVE_CONFIG_H"
PreprocessorDefinitions="NDEBUG;_XBOX;_LIB;XBOX_PLATFORM;NEED_POLL;NEED_GETADDRINFO;NEED_FREEADDRINFO;NEED_GETPID;NEED_GETLOGIN_R;NEED_RANDOM;NEED_SRANDOM;HAVE_CONFIG_H"
StringPooling="TRUE"
RuntimeLibrary="0"
BufferSecurityCheck="TRUE"
Expand Down
13 changes: 12 additions & 1 deletion examples/smb2-cat-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#define _GNU_SOURCE

#include <fcntl.h>
#if !defined(__amigaos4__) && !defined(__AMIGA__) && !defined(__AROS__)
#include <poll.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -27,6 +29,16 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include "libsmb2.h"
#include "libsmb2-raw.h"

#if defined(__amigaos4__) || defined(__AMIGA__) || defined(__AROS__)
struct pollfd {
int fd;
short events;
short revents;
};

int poll(struct pollfd *fds, unsigned int nfds, int timo);
#endif

int is_finished;
uint8_t buf[256 * 1024];
uint32_t pos;
Expand Down Expand Up @@ -137,7 +149,6 @@ int main(int argc, char *argv[])
}

smb2_set_security_mode(smb2, SMB2_NEGOTIATE_SIGNING_ENABLED);

if (smb2_connect_share_async(smb2, url->server, url->share, url->user,
cf_cb, (void *)url->path) != 0) {
printf("smb2_connect_share failed. %s\n", smb2_get_error(smb2));
Expand Down
3 changes: 2 additions & 1 deletion examples/smb2-cat-sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

#include <errno.h>
#include <fcntl.h>
#if !defined(__amigaos4__) && !defined(__AMIGA__) && !defined(__AROS__)
#include <poll.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -66,7 +68,6 @@ int main(int argc, char *argv[])
}

smb2_set_security_mode(smb2, SMB2_NEGOTIATE_SIGNING_ENABLED);

if (smb2_connect_share(smb2, url->server, url->share, url->user) != 0) {
printf("smb2_connect_share failed. %s\n", smb2_get_error(smb2));
exit(10);
Expand Down
24 changes: 19 additions & 5 deletions examples/smb2-ls-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#define _GNU_SOURCE

#include <inttypes.h>
#if !defined(__amigaos4__) && !defined(__AMIGA__) && !defined(__AROS__)
#include <poll.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -25,14 +27,28 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include "libsmb2.h"
#include "libsmb2-raw.h"

#ifdef __AROS__
#include "asprintf.h"
#endif

#if defined(__amigaos4__) || defined(__AMIGA__) || defined(__AROS__)
struct pollfd {
int fd;
short events;
short revents;
};

int poll(struct pollfd *fds, unsigned int nfds, int timo);
#endif

int is_finished;

int usage(void)
{
fprintf(stderr, "Usage:\n"
"smb2-ls-async <smb2-url>\n\n"
"URL format: "
"smb://[<domain;][<username>@]<host>>[:<port>]/<share>/<path>\n");
"smb://[<domain;][<username>@]<host>>[:<port>]/<share>/<path>\n");
exit(1);
}

Expand Down Expand Up @@ -73,7 +89,7 @@ void od_cb(struct smb2_context *smb2, int status,
break;
}
t = (time_t)ent->st.smb2_mtime;
printf("%-20s %-9s %15"PRIu64" %s\n", ent->name, type, ent->st.smb2_size, asctime(localtime(&t)));
printf("%-20s %-9s %15"PRIu64" %s\n", ent->name, type, ent->st.smb2_size, asctime(localtime(&t)));
}

smb2_closedir(smb2, dir);
Expand Down Expand Up @@ -139,9 +155,7 @@ int main(int argc, char *argv[])
}

smb2_set_security_mode(smb2, SMB2_NEGOTIATE_SIGNING_ENABLED);

if (smb2_connect_share_async(smb2, url->server, url->share, url->user,
cf_cb, (void *)url->path) != 0) {
if (smb2_connect_share_async(smb2, url->server, url->share, url->user, cf_cb, (void *)url->path) != 0) {
printf("smb2_connect_share failed. %s\n", smb2_get_error(smb2));
exit(10);
}
Expand Down
7 changes: 6 additions & 1 deletion examples/smb2-ls-sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#define _GNU_SOURCE

#include <inttypes.h>
#if !defined(__amigaos4__) && !defined(__AMIGA__) && !defined(__AROS__)
#include <poll.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -25,6 +27,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include "libsmb2.h"
#include "libsmb2-raw.h"

#ifdef __AROS__
#include "asprintf.h"
#endif

int usage(void)
{
fprintf(stderr, "Usage:\n"
Expand Down Expand Up @@ -60,7 +66,6 @@ int main(int argc, char *argv[])
}

smb2_set_security_mode(smb2, SMB2_NEGOTIATE_SIGNING_ENABLED);

if (smb2_connect_share(smb2, url->server, url->share, url->user) < 0) {
printf("smb2_connect_share failed. %s\n", smb2_get_error(smb2));
exit(10);
Expand Down
13 changes: 12 additions & 1 deletion examples/smb2-put-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

#include <errno.h>
#include <fcntl.h>
#if !defined(__amigaos4__) && !defined(__AMIGA__) && !defined(__AROS__)
#include <poll.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -28,6 +30,16 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include "libsmb2.h"
#include "libsmb2-raw.h"

#if defined(__amigaos4__) || defined(__AMIGA__) || defined(__AROS__)
struct pollfd {
int fd;
short events;
short revents;
};

int poll(struct pollfd *fds, unsigned int nfds, int timo);
#endif

uint8_t buf[256 * 1024];

int usage(void)
Expand Down Expand Up @@ -114,7 +126,6 @@ int main(int argc, char *argv[])
}

smb2_set_security_mode(smb2, SMB2_NEGOTIATE_SIGNING_ENABLED);

if (smb2_connect_share(smb2, url->server, url->share, url->user) != 0) {
printf("smb2_connect_share failed. %s\n", smb2_get_error(smb2));
exit(10);
Expand Down
3 changes: 2 additions & 1 deletion examples/smb2-put-sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

#include <errno.h>
#include <fcntl.h>
#if !defined(__amigaos4__) && !defined(__AMIGA__) && !defined(__AROS__)
#include <poll.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -73,7 +75,6 @@ int main(int argc, char *argv[])
}

smb2_set_security_mode(smb2, SMB2_NEGOTIATE_SIGNING_ENABLED);

if (smb2_connect_share(smb2, url->server, url->share, url->user) != 0) {
printf("smb2_connect_share failed. %s\n", smb2_get_error(smb2));
exit(10);
Expand Down
12 changes: 12 additions & 0 deletions examples/smb2-share-enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#define _GNU_SOURCE

#include <inttypes.h>
#if !defined(__amigaos4__) && !defined(__AMIGA__) && !defined(__AROS__)
#include <poll.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -25,6 +27,16 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include "libsmb2.h"
#include "libsmb2-raw.h"

#if defined(__amigaos4__) || defined(__AMIGA__) || defined(__AROS__)
struct pollfd {
int fd;
short events;
short revents;
};

int poll(struct pollfd *fds, unsigned int nfds, int timo);
#endif

int is_finished;

int usage(void)
Expand Down
4 changes: 3 additions & 1 deletion examples/smb2-statvfs-sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

#include <fcntl.h>
#include <inttypes.h>
#if !defined(__amigaos4__) && !defined(__AMIGA__) && !defined(__AROS__)
#include <poll.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -32,7 +34,7 @@ int usage(void)
{
fprintf(stderr, "Usage:\n"
"smb2-statvfs-sync <smb2-url>\n\n"
"URL format: "
"URL format: "
"smb://[<domain;][<username>@]<host>[:<port>]/<share>/<path>\n");
exit(1);
}
Expand Down
Loading
Loading