From ccdd979a690f5d0172f22b821f31672063629a31 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 29 Oct 2010 23:49:39 +0000 Subject: [PATCH] Changes to compile on solaris --- Makefile | 14 ++++++++++++-- config.mak.in | 3 ++- configure | 2 +- configure.ac | 7 +++++++ src/{platform_sunos.cc => platform_solaris.cc} | 0 5 files changed, 22 insertions(+), 4 deletions(-) rename src/{platform_sunos.cc => platform_solaris.cc} (100%) diff --git a/Makefile b/Makefile index dcd1b13726..b62132daff 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,10 @@ ifeq ($(platform),linux) LINKFLAGS += -pthread -lrt endif +ifeq ($(platform),solaris) + WANT_SOCKET = 1 +endif + ifdef WANT_OPENSSL HAVE_OPENSSL = 1 HAVE_CRYPTO = 1 @@ -35,6 +39,10 @@ ifdef WANT_OPENSSL OPENSSL_LINKFLAGS += -lssl -lcrypto endif +ifdef WANT_SOCKET + LINKFLAGS += -lsocket -lnsl +endif + ifneq (,$(findstring build/libnode.so,$(MAKEFLAGS))) CFLAGS += -shared -fPIC #else @@ -44,6 +52,7 @@ endif cflags += -pedantic + debug_CPPDEFINES = -DDEBUG $(CFLAGS) debug_CFLAGS = -Wall -O0 -ggdb $(CFLAGS) debug_CXXFLAGS = $(debug_CFLAGS) @@ -384,8 +393,9 @@ docclean: clean: -rm -f node node_g $(builddir)/node $(builddir)/node_g - -find $(builddir) -name "*.o" -or -name "*.a" \ - -or -name "*.so" -or -name "*.dylib" | xargs rm -f + -find $(builddir) -name "*.o" | xargs rm -f + -find $(builddir) -name "*.so" | xargs rm -f + -find $(builddir) -name "*.dylib" | xargs rm -f -find . -name "*.pyc" | xargs rm -f distclean: docclean diff --git a/config.mak.in b/config.mak.in index a492adc2fa..9ffe36b026 100644 --- a/config.mak.in +++ b/config.mak.in @@ -29,4 +29,5 @@ export srcdir VPATH PREFIX -HAVE_OPENSSL=@HAVE_OPENSSL@ \ No newline at end of file +HAVE_OPENSSL=@HAVE_OPENSSL@ +WANT_SOCKET=@WANT_SOCKET@ diff --git a/configure b/configure index 009f4f954d..a62c184ea5 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #!/bin/sh -cd $(dirname "$0") +cd `dirname "$0"` autoconf --output configure.real exec ./configure.real "$@" diff --git a/configure.ac b/configure.ac index a169e55ea6..2995942d88 100644 --- a/configure.ac +++ b/configure.ac @@ -116,6 +116,13 @@ AC_SEARCH_LIBS([dlopen], [dl dld], [], [ # TODO FIXME: Check for OpenSSL -- expect it to exist for now AC_SUBST([HAVE_OPENSSL],[1]) + +# check for -lsocket on solaris +AC_CHECK_LIB([c], [socket], [WANT_SOCKET=], [WANT_SOCKET=1]) +AC_SUBST(WANT_SOCKET) + + + # ------------------------------------------------------------------------------ # Embedded dependencies diff --git a/src/platform_sunos.cc b/src/platform_solaris.cc similarity index 100% rename from src/platform_sunos.cc rename to src/platform_solaris.cc