Skip to content

Commit

Permalink
Here it is.
Browse files Browse the repository at this point in the history
--HG--
extra : convert_revision : svn%3Aaec24677-d710-0410-a355-ac75e2bdf181/trunk%406000
  • Loading branch information
smimram@aec24677-d710-0410-a355-ac75e2bdf181 committed Oct 15, 2008
0 parents commit 2ac6f3e
Show file tree
Hide file tree
Showing 18 changed files with 4,002 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
0.1.2 (01-07-2008)
=====
* Changed logic in shutdown for Async interface:
now [Duppy.Async.shutdown t] also wakes the task if
asleep. Still it can't stop a running task.
* Fixed race conditions when a queue starts the select loop:
a task could be submitted, but no queue would wake up.

0.1.1 (15-04-2008)
=====
* Fixed Conditions usage for non-unix systems
* Fixed typos in the documentation, added some details
* Installs .cmx file

0.1.0 (07-03-2008)
=====
* Initial release
504 changes: 504 additions & 0 deletions COPYING

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# $Id: Makefile.in 2660 2006-07-18 17:23:31Z dbaelde $

PROGNAME := ocaml-duppy
DISTFILES := CHANGES COPYING Makefile.in README \
bootstrap configure configure.ac \
src/*.ml src/*.mli src/Makefile.in src/META.in \
src/OCamlMakefile examples/*.ml examples/Makefile \
examples/Makefile.*.in examples/OCamlMakefile
VERSION = @VERSION@

all clean install uninstall:
$(MAKE) -C src $@

distclean: clean
$(MAKE) -C examples clean

doc:
make -C src htdoc
mkdir -p doc
rm -rf doc/html
mv src/doc/duppy/html doc
rm -rf src/doc

dist:
rm -rf $(PROGNAME)-$(VERSION)
mkdir $(PROGNAME)-$(VERSION)
cp -r --parents $(DISTFILES) $(PROGNAME)-$(VERSION)
tar zcvf ../$(PROGNAME)-$(VERSION).tar.gz $(PROGNAME)-$(VERSION)
rm -rf $(PROGNAME)-$(VERSION)

.PHONY: dist doc
37 changes: 37 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ocaml-duppy


ocaml-duppy is an advanced scheduler for Ocaml programmers.

Please read the COPYING file before using this software.

Prerequisites:
==============

- ocaml >= 3.0.6 (haven't tried earlier versions)

- findlib >= 0.8.1 (haven't tried earlier versions)

- ocaml-pcre >= 5.12.2 (haven't tried earlier versions)

Compilation:
============

$ make all

This should build both the native and the byte-code version of the
extension library.

Installation:
=============

$ make install

This should install the library file (using ocamlfind) in the
appropriate place.

Author:
=======

This author of this software may be contacted by electronic mail
at the following address: [email protected].
7 changes: 7 additions & 0 deletions bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

aclocal
# Doing this only once sometimes yield an error message (AC_MSG_ERROR
# undefined).. I give up understanding that.
autoconf
autoconf
142 changes: 142 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@

# check for one particular file of the sources
AC_INIT(ocaml-duppy, 0.1.2, [email protected])

VERSION=$PACKAGE_VERSION
AC_SUBST(VERSION)
AC_MSG_RESULT([configuring $PACKAGE_STRING])

OCAMLFIND_LDCONF=""
AC_ARG_ENABLE([ldconf], AC_HELP_STRING([--disable-ldconf],[don't modify the dynamic loader configuration file (default is enable)]),[ac_enable_ldconf=$enableval],[ac_enable_ldconf=$enableval],[ac_enable_ldconf=yes])
if test "$ac_enable_ldconf" = no ; then
AC_MSG_RESULT([disabling modification of ld.conf])
OCAMLFIND_LDCONF=dummy
fi

# Check for Ocaml compilers

# we first look for ocamlc in the path; if not present, we fail
AC_CHECK_PROG(OCAMLC,ocamlc,`which ocamlc`,no)
if test "$OCAMLC" = no ; then
AC_MSG_ERROR(Cannot find ocamlc.)
fi

# we look for the directory of ocamlc in $OCAMLC
OCAMLBIN=`dirname $OCAMLC`

# we extract Ocaml version number and library path
OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
echo "ocaml version is $OCAMLVERSION"
OCAMLLIB=`$OCAMLC -v | tail -n 1 | cut -f 4 -d " "`
echo "ocaml library path is $OCAMLLIB"

# then we look for ocamlopt; if not present, we issue a warning
# if the version is not the same, we also discard it
# we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not
AC_PATH_PROG(OCAMLOPT,ocamlopt,no)
OCAMLBEST=byte
if test "$OCAMLOPT" = no ; then
AC_MSG_WARN(Cannot find ocamlopt; bytecode compilation only.)
else
AC_MSG_CHECKING(ocamlopt version)
TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
if test "$TMPVERSION" != "$OCAMLVERSION" ; then
AC_MSG_RESULT(differs from ocamlc; ocamlopt discarded.)
OCAMLOPT=no
else
AC_MSG_RESULT(ok)
OCAMLBEST=opt
fi
fi

# checking for ocamlc.opt
AC_PATH_PROG(OCAMLCDOTOPT,ocamlc.opt,no)
if test "$OCAMLCDOTOPT" != no ; then
AC_MSG_CHECKING(ocamlc.opt version)
TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
if test "$TMPVERSION" != "$OCAMLVERSION" ; then
AC_MSG_RESULT(differs from ocamlc; ocamlc.opt discarded.)
else
AC_MSG_RESULT(ok)
OCAMLC=$OCAMLCDOTOPT
fi
fi

# checking for ocamlopt.opt
if test "$OCAMLOPT" != no ; then
AC_PATH_PROG(OCAMLOPTDOTOPT,ocamlopt.opt,no)
if test "$OCAMLOPTDOTOPT" != no ; then
AC_MSG_CHECKING(ocamlc.opt version)
TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
if test "$TMPVER" != "$OCAMLVERSION" ; then
AC_MSG_RESULT(differs from ocamlc; ocamlopt.opt discarded.)
else
AC_MSG_RESULT(ok)
OCAMLOPT=$OCAMLOPTDOTOPT
fi
fi
fi

AC_PATH_PROG(OCAMLDEP,ocamldep,no)
if test "$OCAMLDEP" = no ; then
AC_MSG_ERROR(Cannot find ocamldep.)
fi

AC_PATH_PROG(OCAMLDOC,ocamldoc,no)

AC_PATH_PROG(OCAMLFIND,ocamlfind,no)
if test "$OCAMLFIND" = no ; then
AC_MSG_ERROR(Cannot find ocamlfind.)
fi

CAMLLIBPATH=`$OCAMLC -where`

AC_PROG_CC()

AC_MSG_CHECKING(for ocaml-pcre)
if ! $OCAMLFIND query pcre > /dev/null 2>&1 ; then
AC_MSG_ERROR(Not found.)
else
INC="$INC `$OCAMLFIND query pcre`"
requires="$requires pcre"
AC_MSG_RESULT(ok)
fi

if test "$OCAMLOPT" = no ; then
BEST=byte
else
BEST="byte opt"
fi

# substitutions to perform
AC_SUBST(VERSION)
AC_SUBST(OCAMLC)
AC_SUBST(OCAMLOPT)
AC_SUBST(OCAMLDEP)
AC_SUBST(OCAMLBEST)
AC_SUBST(OCAMLVERSION)
AC_SUBST(OCAMLLIB)
AC_SUBST(OCAMLBIN)
AC_SUBST(OCAMLDOC)
AC_SUBST(OCAMLFIND)
AC_SUBST(OCAMLFIND_LDCONF)
AC_SUBST(OCAMLCP)
AC_SUBST(CAMLLIBPATH)
AC_SUBST(BEST)
ALL_INC="`ocamlfind query -r -separator " " $requires` $_INC"
INC="$INC $_INC"
AC_SUBST(INC)
AC_SUBST(ALL_INC)
requires="unix threads $requires"
all_requires="`ocamlfind query -r -separator " " -format "%p" $requires` $_requires"
requires="$requires $_requires"
AC_SUBST(requires)
AC_SUBST(all_requires)

# Finally create the Makefile and samples
AC_CONFIG_FILES([Makefile],[chmod a-w Makefile])
AC_CONFIG_FILES([src/META])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([examples/Makefile.telnet])
AC_CONFIG_FILES([examples/Makefile.http])
AC_OUTPUT
12 changes: 12 additions & 0 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OCaml-Lastfm examples.
#
# Copyright 2007 by the Savonet team.
#
# $Id: Makefile 4694 2007-10-23 23:33:11Z smimram $

all clean:
$(MAKE) -f Makefile.telnet $@
$(MAKE) -f Makefile.http $@

distclean: clean
rm -rf autom4te.cache config.log config.status autom4te.cache
10 changes: 10 additions & 0 deletions examples/Makefile.http.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SOURCES = http.ml
RESULT = http
INCDIRS = ../src @ALL_INC@
OCAMLC = @OCAMLC@ -thread
OCAMLOPT = @OCAMLOPT@ -thread
LIBS = @all_requires@ duppy

all: nc

-include OCamlMakefile
10 changes: 10 additions & 0 deletions examples/Makefile.telnet.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SOURCES = telnet.ml
RESULT = telnet
INCDIRS = ../src @ALL_INC@
OCAMLC = @OCAMLC@ -thread
OCAMLOPT = @OCAMLOPT@ -thread
LIBS = @all_requires@ duppy

all: nc

-include OCamlMakefile
Loading

0 comments on commit 2ac6f3e

Please sign in to comment.