]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Solaris compilation/build changes
authorRohan Mars <code@rohanmars.com>
Tue, 27 Oct 2015 04:50:30 +0000 (21:50 -0700)
committerRohan Mars <code@rohanmars.com>
Fri, 13 Nov 2015 01:30:49 +0000 (17:30 -0800)
Signed-off-by: Rohan Mars <code@rohanmars.com>
README.solaris [new file with mode: 0644]
configure.ac
src/Makefile-env.am
src/common/sctp_crc32.c
src/global/signal_handler.cc
src/include/assert.h
src/include/compat.h
src/include/encoding.h
src/include/types.h
src/os/ObjectStore.h
src/test/Makefile.am

diff --git a/README.solaris b/README.solaris
new file mode 100644 (file)
index 0000000..1d82d49
--- /dev/null
@@ -0,0 +1,30 @@
+
+The Solaris build will only build the librados library.
+
+Build Prerequisites
+===================
+
+The following Solaris packages are required for compilation:
+
+        git
+        autoconf
+        libtool
+        automake
+        gcc-c++-48
+        gnu-make
+
+        (use the "pkg install <packagename>" command to install, as root)
+
+Download and Compile Boost 1.59 (or higher)
+
+Building Ceph
+=============
+
+        export LDFLAGS="-L<pathtoboost>/boost_1_59_0/stage/lib"
+        export CPPFLAGS="-I<pathtoboost>/boost/boost_1_59_0"
+
+        ./autogen.sh
+        ./configure --disable-server --without-fuse --without-tcmalloc --without-libatomic-ops --without-libaio --without-libxfs
+       cd src
+        gmake librados.la
+
index 7a8b39311178ad2daa160f1b5557a20384b1ebba..ee769af5763be5f2af61c0ee9fa57f65dd28d120 100644 (file)
@@ -67,10 +67,14 @@ linux*)
 freebsd*)
        freebsd="yes"
        ;;
+solaris*)
+       solaris="yes"
+       ;;
 esac
 AM_CONDITIONAL(LINUX, test x"$linux" = x"yes")
 AM_CONDITIONAL(FREEBSD, test x"$freebsd" = x"yes")
 AM_CONDITIONAL(DARWIN, test x"$darwin" = x"yes")
+AM_CONDITIONAL(SOLARIS, test x"$solaris" = x"yes")
 
 # Checks for programs.
 AC_PROG_CXX
@@ -956,6 +960,7 @@ AC_CHECK_HEADERS([ \
        sys/time.h \
        sys/vfs.h \
        sys/xattr.h \
+       sys/cdefs.h \
        syslog.h \
        utime.h \
 ])
index 625e4621f70ac0783195ed04e6869da181910d36..e3b6935bbc8ec8c83b16a81687e4cda7f534ab44 100644 (file)
@@ -120,6 +120,9 @@ AM_COMMON_CFLAGS = \
 if !CLANG
        AM_COMMON_CFLAGS += -rdynamic
 endif
+if SOLARIS
+       AM_COMMON_CFLAGS += -Wno-unused-local-typedefs
+endif
 
 AM_CFLAGS = $(AM_COMMON_CFLAGS) $(HARDENING_CFLAGS)
 AM_CPPFLAGS = $(AM_COMMON_CPPFLAGS)
@@ -133,6 +136,11 @@ if !CLANG
        AM_CXXFLAGS += -Wstrict-null-sentinel
 endif
 
+# solaris harding
+if SOLARIS
+       AM_CXXFLAGS += -lssp_nonshared
+endif
+
 # note: this is position dependant, it affects the -l options that
 # come after it on the command line. when you use ${AM_LDFLAGS} in
 # later rules, take care where you place it. for more information, see
index 4acf5298510ab871e897f74ec775de2bde0a383a..2fa26afecc5cd34288af0e4c690336fdc7993d12 100644 (file)
@@ -30,8 +30,9 @@
 
 /* $KAME: sctp_crc32.c,v 1.12 2005/03/06 16:04:17 itojun Exp $  */
 
-
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/cdefs.h>
+#endif
 #if 0
 __FBSDID("$FreeBSD: src/sys/netinet/sctp_crc32.c,v 1.8 2007/05/08 17:01:10 rrs Exp $");
 
index edca694f1c082a450dacba51fb9bf3d6cb30bff7..9e699ad8d88d14fa167a333fece78c32f47089dc 100644 (file)
@@ -40,9 +40,17 @@ void install_sighandler(int signum, signal_handler_t handler, int flags)
   ret = sigaction(signum, &act, &oldact);
   if (ret != 0) {
     char buf[1024];
+#if defined(__sun) 
+    char message[SIG2STR_MAX];
+    sig2str(signum,message);
+    snprintf(buf, sizeof(buf), "install_sighandler: sigaction returned "
+           "%d when trying to install a signal handler for %s\n",
+            ret, message);
+#else
     snprintf(buf, sizeof(buf), "install_sighandler: sigaction returned "
            "%d when trying to install a signal handler for %s\n",
             ret, sys_siglist[signum]);
+#endif
     dout_emergency(buf);
     exit(1);
   }
@@ -79,8 +87,15 @@ static void handle_fatal_signal(int signum)
   // case, SA_RESETHAND specifies that the default signal handler--
   // presumably dump core-- will handle it.
   char buf[1024];
+#if defined(__sun)
+  char message[SIG2STR_MAX];
+  sig2str(signum,message);
+  snprintf(buf, sizeof(buf), "*** Caught signal (%s) **\n "
+           "in thread %llx\n", message, (unsigned long long)pthread_self());
+#else
   snprintf(buf, sizeof(buf), "*** Caught signal (%s) **\n "
            "in thread %llx\n", sys_siglist[signum], (unsigned long long)pthread_self());
+#endif
   dout_emergency(buf);
   pidfile_remove();
 
index 707cce0b3980d72064fc0bc5610a755c2f66c872..89e875392c23e477fdef5efee3f9f262cb41cd86 100644 (file)
@@ -11,6 +11,9 @@
 #elif defined(__FreeBSD__)
 #include <sys/cdefs.h>
 #define        __GNUC_PREREQ(minor, major)     __GNUC_PREREQ__(minor, major)
+#elif defined(__sun)
+#include "include/compat.h"
+#include <assert.h>
 #endif
 
 #ifdef __CEPH__
index a533b3a71272aeb8e94c9615b332f4ae0e4c6309..dcb5f6f28423741029454c71f99969766a828df5 100644 (file)
 #define lseek64(fd, offset, whence) lseek(fd, offset, whence)
 #endif
 
+#if defined(__sun)
+#define LOG_AUTHPRIV    (10<<3)
+#define LOG_FTP         (11<<3)
+#define __STRING(x)     "x"
+#define IFTODT(mode)   (((mode) & 0170000) >> 12)
+#endif
+
 #endif /* !CEPH_COMPAT_H */
index 6fa12f90925c6f831ff2b1b1b38c4ae5edc35acd..3ba53274bd2aabe9d7a3f8b30fdec41392edc995 100644 (file)
@@ -62,7 +62,9 @@ inline void decode_raw(T& t, bufferlist::iterator &p)
   inline void decode(type &v, bufferlist::iterator& p) { __ASSERT_FUNCTION decode_raw(v, p); }
 
 WRITE_RAW_ENCODER(__u8)
+#ifndef _CHAR_IS_SIGNED
 WRITE_RAW_ENCODER(__s8)
+#endif
 WRITE_RAW_ENCODER(char)
 WRITE_RAW_ENCODER(ceph_le64)
 WRITE_RAW_ENCODER(ceph_le32)
index f913af6df4ec8f91b531b530828a9dd4a50401ca..33e85437b11a27e3dc9c64ea49ae6c0d6dfbd88d 100644 (file)
@@ -83,6 +83,11 @@ typedef off_t loff_t;
 typedef off_t off64_t;
 #endif
 
+#ifdef __sun
+typedef off_t loff_t;
+#endif
+
+
 // -- io helpers --
 
 template<class A, class B>
index 3d49e1199a7aa543c73b918ec92c08af12584321..3b00ac73ebe8fefb3fe455e78a5068f3a0fadb69 100644 (file)
@@ -27,7 +27,7 @@
 #include <vector>
 #include <map>
 
-#if defined(DARWIN) || defined(__FreeBSD__)
+#if defined(DARWIN) || defined(__FreeBSD__) || defined(__sun)
 #include <sys/statvfs.h>
 #else
 #include <sys/vfs.h>    /* or <sys/statfs.h> */
index 448c9b46609b3d9417606daf7d25dc34fa29e850..3d6353534d14c5db1827d42a3257e88cd9f6ce13 100644 (file)
@@ -136,6 +136,11 @@ UNITTEST_LDADD = \
        $(top_builddir)/src/gmock/gtest/lib/libgtest.la \
        $(PTHREAD_LIBS)
 
+if SOLARIS
+UNITTEST_LDADD += \
+       -lsocket -lnsl
+endif
+
 unittest_addrs_SOURCES = test/test_addrs.cc
 unittest_addrs_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 unittest_addrs_LDADD = $(UNITTEST_LDADD) $(CEPH_GLOBAL)