diff options
author | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-07-29 12:07:54 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-07-29 12:07:54 +0200 |
commit | 4ed70a930202b103e7e80b8dc925e0aaa4622595 (patch) | |
tree | aeed881ce17629f81b7c90f7d675aac8ecf69d4f |
initial commit
125 files changed, 13546 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ChangeLog diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..cc77307 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,4 @@ +include_HEADERS = include/zs.h include/zs.hpp + +SUBDIRS = src examples +DIST_SUBDIRS = src examples diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..19f2174 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# Copyright (c) 2007 FastMQ Inc. +# +# This file is part of 0MQ. +# +# 0MQ is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# 0MQ is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Script to generate all required files from fresh svn checkout. + + + +autoreconf --install --force --verbose -I config + +if [ $? -ne 0 ]; then + echo + echo "Could not run autoreconf, check autotools installation." + echo +fi diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..e75ab11 --- /dev/null +++ b/configure.in @@ -0,0 +1,188 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +AC_PREREQ(2.61) +AC_INIT([zsock],[dev]) +AC_CONFIG_AUX_DIR(config) +AM_CONFIG_HEADER(src/platform.hpp) +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) + +AM_PROG_CC_C_O + +# Checks for programs. +AC_PROG_CXX +AC_PROG_LIBTOOL + +# Checks for libraries. +AC_CHECK_LIB(pthread, pthread_create) + +# Host speciffic checks +AC_CANONICAL_HOST + +case "${host_os}" in + *linux*) + AC_DEFINE(ZS_HAVE_LINUX, 1, [Have Linux OS]) + CPPFLAGS="-D_REENTRANT $CPPFLAGS" + sed < libtool > libtool-2 \ + 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" "/' + mv libtool-2 libtool + chmod 755 libtool + AC_CHECK_LIB(uuid, uuid_generate) + ;; + *solaris*) + AC_DEFINE(ZS_HAVE_SOLARIS, 1, [Have Solaris OS]) + AC_CHECK_LIB(socket, main) + AC_CHECK_LIB(nsl, main) + AC_CHECK_LIB(rt, main) + CPPFLAGS="-D_REENTRANT -D_PTHREADS $CPPFLAGS" + AC_MSG_CHECKING([wheter atomic operations can be used]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include <atomic.h>]], + [[uint32_t value; + atomic_cas_32 (&value, 0, 0); + return 0;]])], + [solaris_has_atomic=yes], + [solaris_has_atomic=no]) + AC_MSG_RESULT([$solaris_has_atomic]) + # Solaris 8 does not have atomic operations exported to user space. + if test "x$solaris_has_atomic" = "xno"; then + AC_DEFINE(ZS_FORCE_MUTEXES, 1, [Force to use mutexes]) + fi + ;; + *freebsd*) + AC_DEFINE(ZS_HAVE_FREEBSD, 1, [Have FreeBSD OS]) + CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS" + LIBS="-pthread" + ;; + *darwin*) + AC_DEFINE(ZS_HAVE_OSX, 1, [Have DarwinOSX OS]) + LIBS="-pthread" + ZS_EXTRA_CXXFLAGS+="-Wno-uninitialized" + ;; + *openbsd*) + AC_DEFINE(ZS_HAVE_OPENBSD, 1, [Have OpenBSD OS]) + CPPFLAGS="-pthread $CPPFLAGS" + LIBS="-pthread" + ;; + *nto-qnx*) + AC_DEFINE(ZS_HAVE_QNXNTO, 1, [Have QNX Neutrino OS]) + CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS" + AC_CHECK_LIB(socket,main) + ;; + *aix*) + AC_DEFINE(ZS_HAVE_AIX, 1, [Have AIX OS]) + if test "x$GXX" = "xyes"; then + CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS" + fi + ;; + *hpux*) + AC_DEFINE(ZS_HAVE_HPUX, 1, [Have HPUX OS]) + if test "x$GXX" = "xyes"; then + CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS" + fi + AC_CHECK_LIB(rt, main) + sed < libtool > libtool-2 \ + 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" "/' + mv libtool-2 libtool + chmod 755 libtool + ;; + *mingw32*) + AC_DEFINE(ZS_HAVE_WINDOWS, 1, [Have Windows OS]) + AC_DEFINE(ZS_HAVE_MINGW32, 1, [Have MinGW32]) + AC_CHECK_HEADERS(windows.h) + LIBS="-lwsock32 -lws2_32 -no-undefined" + CFLAGS="-std=c99" + install_man="no" + ;; + *) + AC_MSG_ERROR([Not supported os: $host.]) + ;; +esac + +# Check if we are running at sparc harware +AC_MSG_CHECKING([wheter __sparc__ is defined]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#if defined __sparc__ + //OK we are on sparc + #else + error: we are not on sparc + #endif + ]])], + [sparc=yes], + [sparc=no]) + +AC_MSG_RESULT([$sparc]) + +if test "x$sparc" = "xyes"; then + CPPFLAGS="$CPPFLAGS -mcpu=v9" |