From 759a3bfc8d65c76860e03f95d88e253cea04ee1c Mon Sep 17 00:00:00 2001 From: begasus Date: Sun, 12 Nov 2017 14:57:47 +0100 Subject: Initial support for Haiku diff --git a/makedefs b/makedefs index 1932e36..4315729 100644 --- a/makedefs +++ b/makedefs @@ -440,6 +440,9 @@ case "$SYSTEM.$RELEASE" in ;; BSD/OS.4*) SYSTYPE=BSDI4 ;; + Haiku*) SYSTYPE=HAIKU + SYSLIBS="-lnetwork -ldb-18.1" + ;; OSF1.V[3-5].*) SYSTYPE=OSF1 # Use the native compiler by default : ${CC=cc} diff --git a/src/util/sys_defs.h b/src/util/sys_defs.h index 62749ab..0392a30 100644 --- a/src/util/sys_defs.h +++ b/src/util/sys_defs.h @@ -39,7 +39,8 @@ || defined(NETBSD4) || defined(NETBSD5) || defined(NETBSD6) \ || defined(NETBSD7) | defined(NETBSD8) || defined(NETBSD9) \ || defined(NETBSD10) \ - || defined(EKKOBSD1) || defined(DRAGONFLY) + || defined(EKKOBSD1) || defined(DRAGONFLY) \ + || defined(HAIKU) #define SUPPORTED #include #define UINT32_TYPE unsigned int @@ -65,7 +66,7 @@ #endif #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin" -#if (defined(__NetBSD_Version__) && __NetBSD_Version__ > 299000900) +#if (defined(__NetBSD_Version__) && __NetBSD_Version__ > 299000900) || defined(HAIKU) #define USE_STATVFS #define STATVFS_IN_SYS_STATVFS_H #else @@ -1260,6 +1261,18 @@ extern int h_errno; #define S_ISSOCK(mode) (((mode) & (S_IFMT)) == (C_ISSOCK)) #define CANT_USE_SEND_RECV_MSG #define DEF_SMTP_CACHE_DEMAND 0 +#endif + +#ifdef HAIKU +#define SUPPORTED +#include +#include +#define SOCKADDR_SIZE socklen_t +#define SOCKOPT_SIZE socklen_t +#define _PATH_BSHELL "/bin/sh" +#define _PATH_DEFPATH "" +#define _PATH_MAILDIR "/var/spool/mail" +#undef HAS_ST_GEN #endif /* -- 2.45.2 From 7f0882ba5d9e07d38d9bede21a807ec941a2e6a8 Mon Sep 17 00:00:00 2001 From: begasus Date: Sun, 12 Nov 2017 15:11:22 +0100 Subject: Don't use hard links diff --git a/Makefile.in b/Makefile.in index 4b1fb33..ebf1371 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,7 +52,7 @@ update printfck tests root_tests: update: $(META) $(LIBEXEC) libexec/post-install: conf/post-install - rm -f $@ && ln -f $? $@ + rm -f $@ && ln -s $? $@ # Censor out build directory information. @@ -84,22 +84,22 @@ meta/postfix-files: conf/postfix-files conf/makedefs.out Makefile esac > $@ libexec/postfix-script: conf/postfix-script - rm -f $@ && ln -f $? $@ + rm -f $@ && ln -s $? $@ libexec/postfix-tls-script: conf/postfix-tls-script - rm -f $@ && ln -f $? $@ + rm -f $@ && ln -s $? $@ libexec/postfix-wrapper: conf/postfix-wrapper - rm -f $@ && ln -f $? $@ + rm -f $@ && ln -s $? $@ meta/main.cf.proto: conf/main.cf - rm -f $@ && ln -f $? $@ + rm -f $@ && ln -s $? $@ meta/master.cf.proto: conf/master.cf - rm -f $@ && ln -f $? $@ + rm -f $@ && ln -s $? $@ libexec/postmulti-script: conf/postmulti-script - rm -f $@ && ln -f $? $@ + rm -f $@ && ln -s $? $@ meta/dynamicmaps.cf: conf/dynamicmaps.cf Makefile rm -f $@ && $(EXPAND) conf/dynamicmaps.cf | $(AWK) ' \ -- 2.45.2 From 3dd1896878b60c01a9cc40a20f37a4f856836266 Mon Sep 17 00:00:00 2001 From: begasus Date: Sun, 12 Nov 2017 15:43:04 +0100 Subject: Define _BSD_SOURCE diff --git a/src/postqueue/postqueue.c b/src/postqueue/postqueue.c index ca8bcd3..4aab38b 100644 --- a/src/postqueue/postqueue.c +++ b/src/postqueue/postqueue.c @@ -239,6 +239,8 @@ /* New York, NY 10011, USA /*--*/ +#define _BSD_SOURCE + /* System library. */ #include diff --git a/src/postqueue/showq_compat.c b/src/postqueue/showq_compat.c index f5ca059..788fce7 100644 --- a/src/postqueue/showq_compat.c +++ b/src/postqueue/showq_compat.c @@ -28,6 +28,8 @@ /* New York, NY 10011, USA /*--*/ +#define _BSD_SOURCE + /* System library. */ #include diff --git a/src/postqueue/showq_json.c b/src/postqueue/showq_json.c index a2820dd..1538a59 100644 --- a/src/postqueue/showq_json.c +++ b/src/postqueue/showq_json.c @@ -26,6 +26,8 @@ /* New York, NY 10011, USA /*--*/ +#define _BSD_SOURCE + /* System library. */ #include diff --git a/src/sendmail/sendmail.c b/src/sendmail/sendmail.c index df052c5..0baf914 100644 --- a/src/sendmail/sendmail.c +++ b/src/sendmail/sendmail.c @@ -475,6 +475,8 @@ /* New York, NY 10011, USA /*--*/ +#define _BSD_SOURCE + /* System library. */ #include -- 2.45.2