aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/depends/target/config.site.in8
-rw-r--r--tools/depends/target/samba-gplv3/Makefile12
-rw-r--r--tools/depends/target/samba-gplv3/no_fork_and_exec.patch75
3 files changed, 92 insertions, 3 deletions
diff --git a/tools/depends/target/config.site.in b/tools/depends/target/config.site.in
index 5d1f01d89c..fbdf002318 100644
--- a/tools/depends/target/config.site.in
+++ b/tools/depends/target/config.site.in
@@ -86,8 +86,11 @@ libreplace_cv_HAVE_GETADDRINFO=no
if test "${PACKAGE_NAME}" = "Samba" -a "@platform_os@" = "ios"; then
# disable python support
export PYTHON_VER=0.0
- # ios/osx-10.6 issue with collision of _MD5 exported from a system lib
- export LDFLAGS="${LDFLAGS} -Wl,-unexported_symbol,_MD5* -lc"
+ if test "@use_cpu@" != "arm64"; then
+ # ios/osx-10.6 issue with collision of _MD5 exported from a system lib
+ export LDFLAGS="${LDFLAGS} -Wl,-unexported_symbol,_MD5* -lc"
+ fi
+ samba_cv_HAVE_IFACE_GETIFADDRS=yes
fi
if test "${PACKAGE_NAME}" = "Samba" -a "@platform_os@" = "osx"; then
@@ -102,6 +105,7 @@ if test "${PACKAGE_NAME}" = "Samba" -a "@platform_os@" = "osx"; then
ac_cv_header_execinfo_h=no
# fixes crash on 10.6 if xbmc is built using 10.7 SDK with 10.6 min
ac_cv_func_vdprintf=no
+ samba_cv_HAVE_IFACE_GETIFADDRS=yes
fi
if test "@platform_os@" = "android"; then
diff --git a/tools/depends/target/samba-gplv3/Makefile b/tools/depends/target/samba-gplv3/Makefile
index dabedc4eb3..85ae924fa8 100644
--- a/tools/depends/target/samba-gplv3/Makefile
+++ b/tools/depends/target/samba-gplv3/Makefile
@@ -1,5 +1,5 @@
include ../../Makefile.include
-DEPS= ../../Makefile.include Makefile samba_android.patch
+DEPS= ../../Makefile.include Makefile samba_android.patch no_fork_and_exec.patch
# lib name, version
LIBNAME=samba
@@ -7,6 +7,13 @@ VERSION=3.6.12
SOURCE=$(LIBNAME)-$(VERSION)
ARCHIVE=$(SOURCE).tar.gz
+ifeq ($(OS), ios)
+ifeq ($(CPU), arm64)
+# clang issue with optimizing out functions
+CONFIGURE_EXTRAS= --without-libmsrpc samba_cv_optimize_out_funcation_calls=no ac_cv_func_yp_get_default_domain=no
+endif
+endif
+
CONFIGURE= cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; \
./configure --prefix=$(PREFIX) \
--without-cluster-support --disable-swat --without-ldap \
@@ -42,6 +49,9 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
ifeq ($(OS),android)
cd $(PLATFORM); patch -p0 < ../samba_android.patch
endif
+ifeq ($(TARGET_PLATFORM),appletvos)
+ cd $(PLATFORM); patch -p0 < ../no_fork_and_exec.patch
+endif
cd $(PLATFORM)/source3; $(CONFIGURE)
$(LIBDYLIB): $(PLATFORM)
diff --git a/tools/depends/target/samba-gplv3/no_fork_and_exec.patch b/tools/depends/target/samba-gplv3/no_fork_and_exec.patch
new file mode 100644
index 0000000000..b50f688d45
--- /dev/null
+++ b/tools/depends/target/samba-gplv3/no_fork_and_exec.patch
@@ -0,0 +1,75 @@
+--- lib/util/system.c.orig 2015-12-12 17:56:12.000000000 +0100
++++ lib/util/system.c 2015-12-12 17:56:46.000000000 +0100
+@@ -96,7 +96,7 @@
+
+ _PUBLIC_ pid_t sys_fork(void)
+ {
+- pid_t forkret = fork();
++ pid_t forkret = (pid_t)-1;
+
+ if (forkret == (pid_t)0) {
+ /* Child - reset mypid so sys_getpid does a system call. */
+--- source3/lib/system.orig 2015-12-12 17:58:30.000000000 +0100
++++ source3/lib/system.c 2015-12-12 17:58:45.000000000 +0100
+@@ -1506,7 +1506,7 @@
+ for (p = popen_chain; p; p = p->next)
+ close(p->fd);
+
+- execv(argl[0], argl);
++ //execv(argl[0], argl);
+ _exit (127);
+ }
+
+--- source3/lib/util.c.orig 2015-12-12 18:01:38.000000000 +0100
++++ source3/lib/util.c 2015-12-12 18:01:58.000000000 +0100
+@@ -1120,7 +1120,7 @@
+ cmd = lp_panic_action();
+ if (cmd && *cmd) {
+ DEBUG(0, ("smb_panic(): calling panic action [%s]\n", cmd));
+- result = system(cmd);
++ result = -1;
+
+ if (result == -1)
+ DEBUG(0, ("smb_panic(): fork failed in panic action: %s\n",
+--- source3/lib/sock_exec.c.orig 2015-12-12 18:06:28.000000000 +0100
++++ source3/lib/sock_exec.c 2015-12-12 18:06:41.000000000 +0100
+@@ -101,7 +101,7 @@
+ DEBUG(0,("socketpair_tcp failed (%s)\n", strerror(errno)));
+ return -1;
+ }
+- if (fork() == 0) {
++ if (-1 == 0) {
+ close(fd[0]);
+ close(0);
+ close(1);
+@@ -111,7 +111,7 @@
+ if (dup(fd[1]) == -1) {
+ exit(1);
+ }
+- exit(system(prog));
++ exit(-1);
+ }
+ close(fd[1]);
+ return fd[0];
+--- source3/lib/smbrun.c.orig 2015-12-12 18:00:04.000000000 +0100
++++ source3/lib/smbrun.c 2015-12-12 18:00:57.000000000 +0100
+@@ -192,8 +192,8 @@
+ exit(82);
+ }
+
+- execl("/bin/sh","sh","-c",
+- newcmd ? (const char *)newcmd : cmd, NULL);
++ //execl("/bin/sh","sh","-c",
++ // newcmd ? (const char *)newcmd : cmd, NULL);
+
+ SAFE_FREE(newcmd);
+ }
+@@ -343,7 +343,7 @@
+ }
+ #endif
+
+- execl("/bin/sh", "sh", "-c", cmd, NULL);
++ //execl("/bin/sh", "sh", "-c", cmd, NULL);
+
+ /* not reached */
+ exit(82);