Add autotools.
authorDavid Thompson <dthompson2@worcester.edu>
Sat, 12 Jul 2014 01:57:25 +0000 (21:57 -0400)
committerDavid Thompson <dthompson2@worcester.edu>
Sat, 12 Jul 2014 01:58:15 +0000 (21:58 -0400)
* .gitignore, Makefile.am, autogen.sh, configure.ac, env.in, guile.am: New
  files.

.gitignore [new file with mode: 0644]
Makefile.am [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
configure.ac [new file with mode: 0644]
env.in [new file with mode: 0644]
guile.am [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..15a8561
--- /dev/null
@@ -0,0 +1,12 @@
+*~
+.#*
+*.go
+/Makefile
+/Makefile.in
+/aclocal.m4
+/autom4te.cache/
+/build-aux/
+/config.log
+/config.status
+/configure
+/env
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..90b4515
--- /dev/null
@@ -0,0 +1,27 @@
+## guile-toxcore
+## Copyright © 2014 David Thompson <davet@gnu.org>
+##
+## guile-toxcore 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.
+##
+## guile-toxcore 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/>.
+
+include guile.am
+
+moddir=$(prefix)/share/guile/site/2.0
+godir=$(libdir)/guile/2.0/ccache
+
+SOURCES =                                      \
+  tox/util.scm                                 \
+  tox/bindings.scm                             \
+  tox.scm
+
+EXTRA_DIST += env.in
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..e756b42
--- /dev/null
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+autoreconf -vif
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..810f8b5
--- /dev/null
@@ -0,0 +1,24 @@
+dnl -*- Autoconf -*-
+
+AC_INIT(guile-toxcore, 0.1.0)
+AC_CONFIG_SRCDIR(tox)
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE([color-tests -Wall -Wno-portability foreign])
+AM_SILENT_RULES([yes])
+
+GUILE_PROGS
+
+if $GUILE_TOOLS | grep -q compile; then
+   # everything cool
+   true
+else
+   AC_MSG_ERROR([Guile 2.0 required.])
+fi
+
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([env], [chmod +x env])
+
+PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5])
+PKG_CHECK_MODULES([TOXCORE], [libtoxcore])
+
+AC_OUTPUT
diff --git a/env.in b/env.in
new file mode 100644 (file)
index 0000000..8f48a9b
--- /dev/null
+++ b/env.in
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+GUILE_LOAD_PATH=/home/dave/Code/sly:$GUILE_LOAD_PATH
+if test "/home/dave/Code/sly" != "/home/dave/Code/sly"; then
+    GUILE_LOAD_PATH=/home/dave/Code/sly:$GUILE_LOAD_PATH
+fi
+GUILE_LOAD_COMPILED_PATH=/home/dave/Code/sly:$GUILE_LOAD_PATH
+PATH=/home/dave/Code/sly/bin:$PATH
+
+export GUILE_LOAD_PATH
+export GUILE_LOAD_COMPILED_PATH
+export PATH
+
+exec "$@"
diff --git a/guile.am b/guile.am
new file mode 100644 (file)
index 0000000..dc1e63f
--- /dev/null
+++ b/guile.am
@@ -0,0 +1,19 @@
+GOBJECTS = $(SOURCES:%.scm=%.go)
+
+nobase_mod_DATA = $(SOURCES) $(NOCOMP_SOURCES)
+nobase_go_DATA = $(GOBJECTS)
+
+# Make sure source files are installed first, so that the mtime of
+# installed compiled files is greater than that of installed source
+# files.  See
+# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
+# for details.
+guile_install_go_files = install-nobase_goDATA
+$(guile_install_go_files): install-nobase_modDATA
+
+CLEANFILES = $(GOBJECTS)
+EXTRA_DIST = $(SOURCES) $(NOCOMP_SOURCES)
+GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
+SUFFIXES = .scm .go
+.scm.go:
+       $(AM_V_GEN)$(top_builddir)/env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<"