From 1714312f07978719507703e9eff8e0dc3d0c1d71 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 13 Nov 2007 23:55:01 +0000 Subject: [PATCH] * Autotoolified the Ruby bindings. Use --enable-ruby. --- Makefile.am | 2 +- configure.ac | 19 +++++++++++++++++++ ruby/.gitignore | 2 ++ ruby/Makefile | 15 --------------- ruby/Makefile.am | 29 +++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 ruby/.gitignore delete mode 100644 ruby/Makefile create mode 100644 ruby/Makefile.am diff --git a/Makefile.am b/Makefile.am index f997ac3..e8bed60 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ # $Id$ -SUBDIRS = kernel cucul caca src test tools cxx doc +SUBDIRS = kernel cucul caca src test tools cxx ruby doc DIST_SUBDIRS = $(SUBDIRS) msvc EXTRA_DIST = NOTES COPYING.GPL COPYING.LGPL bootstrap build-dos build-kernel build-win32 caca-config.in common.h libcaca.spec diff --git a/configure.ac b/configure.ac index 14ed70f..1685f81 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,8 @@ AC_ARG_ENABLE(vga, dnl language bindings AC_ARG_ENABLE(cxx, [ --enable-cxx C++ bindings (default disabled)]) +AC_ARG_ENABLE(ruby, + [ --enable-ruby Ruby bindings (default disabled)]) dnl example programs features AC_ARG_ENABLE(imlib2, @@ -317,6 +319,22 @@ if test "${enable_cxx}" = "yes"; then fi AM_CONDITIONAL(USE_CXX, test "${ac_cv_my_have_cxx}" = "yes") +# Build the Ruby bindings? +ac_cv_my_have_ruby="no" +if test "${enable_ruby}" = "yes"; then + AC_PATH_PROG(RUBY, ruby, no) + if test "${RUBY}" != "no"; then + AC_MSG_CHECKING(for mkmf.rb) + if "${RUBY}" -e 'require "mkmf"' >/dev/null 2>&1; then + AC_MSG_RESULT(yes) + ac_cv_my_have_ruby="yes" + else + AC_MSG_RESULT(no) + fi + fi +fi +AM_CONDITIONAL(USE_RUBY, test "${ac_cv_my_have_ruby}" = "yes") + # Build cacaserver? ac_cv_my_have_network="no" AC_CHECK_HEADERS(sys/socket.h, @@ -378,6 +396,7 @@ AC_CONFIG_FILES([ test/Makefile tools/Makefile cxx/Makefile + ruby/Makefile doc/Makefile msvc/Makefile ]) diff --git a/ruby/.gitignore b/ruby/.gitignore new file mode 100644 index 0000000..5b790cd --- /dev/null +++ b/ruby/.gitignore @@ -0,0 +1,2 @@ +*/mkmf.log +*/*.so diff --git a/ruby/Makefile b/ruby/Makefile deleted file mode 100644 index 6bbea89..0000000 --- a/ruby/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -all: cucul/cucul.so caca/caca.so - -caca/caca.so: cucul/cucul.so - cd caca && \ - ruby extconf.rb && \ - make - -cucul/cucul.so: - cd cucul && \ - ruby extconf.rb && \ - make - -clean: - make -C caca clean - make -C cucul clean diff --git a/ruby/Makefile.am b/ruby/Makefile.am new file mode 100644 index 0000000..24341db --- /dev/null +++ b/ruby/Makefile.am @@ -0,0 +1,29 @@ +# $Id: $ + +if USE_RUBY +noinst_DATA = cucul/cucul.so caca/caca.so +endif + +EXTRA_DIST = cucul/extconf.rb \ + cucul/cucul.c \ + cucul/cucul-canvas.c \ + cucul/test.rb \ + cucul/t/tc_frame.rb \ + caca/extconf.rb + +DISTCLEANFILES = cucul/Makefile caca/Makefile + +cucul/cucul.so: + ruby -C cucul extconf.rb + make -C cucul + +caca/caca.so: cucul/cucul.so + ruby -C caca extconf.rb + make -C caca + +clean-local: + make -C cucul clean + make -C caca clean + +distclean-local: + rm -f cucul/Makefile caca/Makefile