Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ayatoy committed Apr 7, 2012
0 parents commit d151b4a
Show file tree
Hide file tree
Showing 15 changed files with 4,967 additions and 0 deletions.
43 changes: 43 additions & 0 deletions DIST
@@ -0,0 +1,43 @@
#!/bin/sh
#
# A helper script for developers.
# ./DIST gen : runs autoconf to generate 'configure' script.
# ./DIST tgz : creates a tarball.
# Assumes gnu tar.

MODULE=Gauche-mongo

while [ $# -gt 0 ]; do
case $1 in
gen) gen=yes; shift ;;
tgz) tgz=yes; shift ;;
*) echo "DIST gen|tgz"; exit 0;;
esac
done

if [ "$gen" = "yes" ]; then
autoconf
fi

if [ "$tgz" = "yes" ]; then
if [ -f Makefile ]; then make maintainer-clean; fi
./DIST gen
./configure
make distclean

if [ ! -f VERSION ]; then echo "No VERSION; something wrong?"; exit 1; fi
VERSION=`cat VERSION`

rm -f DIST_EXCLUDE_X
echo DIST > DIST_EXCLUDE_X
echo DIST_EXCLUDE_X >> DIST_EXCLUDE_X
if [ -f DIST_EXCLUDE ]; then cat DIST_EXCLUDE >> DIST_EXCLUDE_X; fi
find . \( -name CVS -o -name .svn -o -name .git \) -print -prune >> DIST_EXCLUDE_X

rm -rf ../$MODULE-$VERSION

mkdir ../$MODULE-$VERSION
tar cvfX - DIST_EXCLUDE_X . | (cd ../$MODULE-$VERSION; tar xf -)
(cd ..; tar cvf - $MODULE-$VERSION | gzip -9 > $MODULE-$VERSION.tgz)
(cd ..; rm -rf $MODULE-$VERSION)
fi
67 changes: 67 additions & 0 deletions Makefile.in
@@ -0,0 +1,67 @@
# General info
SHELL = @SHELL@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
datadir = @datadir@
datarootdir = @datarootdir@
srcdir = @srcdir@
VPATH = $(srcdir)

# These may be overridden by make invocators
DESTDIR =
GOSH = "@GOSH@"
GAUCHE_CONFIG = "@GAUCHE_CONFIG@"
GAUCHE_PACKAGE = "@GAUCHE_PACKAGE@"
INSTALL = "@GAUCHE_INSTALL@" -C

# Other parameters
SOEXT = @SOEXT@
OBJEXT = @OBJEXT@
EXEEXT = @EXEEXT@
LOCAL_PATHS = "@LOCAL_PATHS@"

# Module-specific stuff
PACKAGE = Gauche-mongo

ARCHFILES =
SCMFILES = $(srcdir)/mongo.scm $(srcdir)/mongo/util.scm $(srcdir)/mongo/bson.scm $(srcdir)/mongo/wire.scm $(srcdir)/mongo/node.scm $(srcdir)/mongo/core.scm
HEADERS =

TARGET = $(ARCHFILES)
GENERATED =
CONFIG_GENERATED = Makefile config.cache config.log config.status \
configure.lineno autom4te*.cache $(PACKAGE).gpd

GAUCHE_PKGINCDIR = "$(DESTDIR)@GAUCHE_PKGINCDIR@"
GAUCHE_PKGLIBDIR = "$(DESTDIR)@GAUCHE_PKGLIBDIR@"
GAUCHE_PKGARCHDIR = "$(DESTDIR)@GAUCHE_PKGARCHDIR@"

all : $(TARGET)

check : all
@rm -f test.log
$(GOSH) -I. -I$(srcdir) $(srcdir)/test.scm > test.log

install : all
$(INSTALL) -m 444 -T $(GAUCHE_PKGINCDIR) $(HEADERS)
$(INSTALL) -m 444 -T $(GAUCHE_PKGLIBDIR) $(SCMFILES)
$(INSTALL) -m 555 -T $(GAUCHE_PKGARCHDIR) $(ARCHFILES)
$(INSTALL) -m 444 -T $(GAUCHE_PKGLIBDIR)/.packages $(PACKAGE).gpd

uninstall :
$(INSTALL) -U $(GAUCHE_PKGINCDIR) $(HEADERS)
$(INSTALL) -U $(GAUCHE_PKGLIBDIR) $(SCMFILES)
$(INSTALL) -U $(GAUCHE_PKGARCHDIR) $(ARCHFILES)
$(INSTALL) -U $(GAUCHE_PKGLIBDIR)/.packages $(PACKAGE).gpd

clean :
rm -rf core $(TARGET) $(GENERATED) *~ test.log so_locations

distclean : clean
rm -rf $(CONFIG_GENERATED)

maintainer-clean : clean
rm -rf $(CONFIG_GENERATED) configure VERSION

14 changes: 14 additions & 0 deletions README
@@ -0,0 +1,14 @@
Simple MongoDB driver for Gauche

Install

$ git clone foo
$ cd Gauche-mongo
$ ./DIST gen
$ ./configure
$ [sudo] make install

Getting Started

gosh> (use mongo)
#<undef>
75 changes: 75 additions & 0 deletions configure.ac
@@ -0,0 +1,75 @@
dnl
dnl Configuring Gauche-mongo
dnl process this file with autoconf to generate 'configure'.
dnl

AC_PREREQ(2.54)
AC_INIT(Gauche-mongo, 0.0, ayatoy@gmail.com)
dnl If you want to use the system name (OS, architecture, etc) in the
dnl configure, uncomment the following line. In such a case, you need
dnl to copy config.guess and config.sub from automake distribution.
dnl AC_CANONICAL_SYSTEM

dnl Replace @LOCAL_PATHS@ by --with-local option.
AC_ARG_WITH(local,
AC_HELP_STRING([--with-local=PATH:PATH...],
[For each PATH, add PATH/include to the include search
paths and PATH/lib to the library search paths. Useful if you have some
libraries installed in non-standard places. ]),
[
case $with_local in
yes|no|"") ;; #no effect
*) LOCAL_PATHS=$with_local ;;
esac
])
AC_SUBST(LOCAL_PATHS)

dnl Set up gauche related commands. The commands are set by scanning
dnl PATH. You can override them by "GOSH=/my/gosh ./configure" etc.
dnl These variables may contain spaces in the pathnames (especially on
dnl Windows); Makefile.ins and other files that refer to those variables
dnl have to quote them properly.
AC_PATH_PROG([GOSH], gosh)
AC_PATH_PROG([GAUCHE_CONFIG], gauche-config)
AC_PATH_PROG([GAUCHE_PACKAGE], gauche-package)
AC_PATH_PROG([GAUCHE_INSTALL], gauche-install)
AC_PATH_PROG([GAUCHE_CESCONV], gauche-cesconv)

dnl Usually these parameters are set by AC_PROG_CC, but we'd rather use
dnl the same one as Gauche has been compiled with.
SOEXT=`"$GAUCHE_CONFIG" --so-suffix`
OBJEXT=`"$GAUCHE_CONFIG" --object-suffix`
EXEEXT=`"$GAUCHE_CONFIG" --executable-suffix`
AC_SUBST(SOEXT)
AC_SUBST(OBJEXT)
AC_SUBST(EXEEXT)

ac_default_prefix=`"$GAUCHE_CONFIG" --prefix`

GAUCHE_PKGINCDIR=`"$GAUCHE_CONFIG" --pkgincdir`
GAUCHE_PKGLIBDIR=`"$GAUCHE_CONFIG" --pkglibdir`
GAUCHE_PKGARCHDIR=`"$GAUCHE_CONFIG" --pkgarchdir`
AC_SUBST(GAUCHE_PKGINCDIR)
AC_SUBST(GAUCHE_PKGLIBDIR)
AC_SUBST(GAUCHE_PKGARCHDIR)

dnl Check for headers.
dnl Add your macro calls to check required headers, if you have any.

dnl Check for other programs.
dnl Add your macro calls to check existence of programs, if you have any.

dnl Check for libraries
dnl Add your macro calls to check required libraries, if you have any.

dnl Creating gpd (gauche package description) file
GAUCHE_PACKAGE_CONFIGURE_ARGS="`echo ""$ac_configure_args"" | sed 's/[\\""\`\$]/\\\&/g'`"
AC_MSG_NOTICE([creating ${PACKAGE_NAME}.gpd])
"$GAUCHE_PACKAGE" make-gpd "$PACKAGE_NAME" \
-version "$PACKAGE_VERSION" \
-configure "./configure $GAUCHE_PACKAGE_CONFIGURE_ARGS"

dnl Output
echo $PACKAGE_VERSION > VERSION
AC_OUTPUT(Makefile)

6 changes: 6 additions & 0 deletions mongo.scm
@@ -0,0 +1,6 @@
(define-module mongo
(extend mongo.util
mongo.bson
mongo.wire
mongo.node
mongo.core))

0 comments on commit d151b4a

Please sign in to comment.