From a64c59b46d9a7789092ceece625a88a6ae75e223 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Thu, 8 Jan 2004 03:10:32 +0000 Subject: [PATCH] make cvs checkout compilable by people without swig --- configure.ac | 5 +++-- swig/python/Makefile.am | 13 +++++++++---- swig/ruby/Makefile.am | 7 ++++++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 0805aea..dc4f93c 100644 --- a/configure.ac +++ b/configure.ac @@ -29,9 +29,10 @@ AC_SUBST(COMEDILIB_CFLAGS) AC_SUBST(COMEDILIB_LIBS) AC_PATH_PROG(SWIG, swig, no) -if test x$SWIG = xno ; then +if test "x$SWIG" == xno ; then AC_MSG_WARN([swig not found, will not be able to regenerate code for swig bindings]) fi +AM_CONDITIONAL(HAVE_SWIG, [test "x$SWIG" != xno]) AM_PATH_PYTHON AM_CHECK_PYTHON_HEADERS(HAVE_PYTHON=yes,[HAVE_PYTHON=no;AC_MSG_WARN([python headers not found, disabling python binding])]) @@ -42,7 +43,7 @@ AS_COMPILER_FLAG([-Wno-unused-function],[PYTHON_QUIET="$PYTHON_QUIET -Wno-unused AC_SUBST(PYTHON_QUIET) AC_PATH_PROG(RUBY, ruby, no) -if test x$RUBY = xno ; then +if test "x$RUBY" == xno ; then AC_MSG_WARN([ruby not found, disabling ruby binding]) fi AM_CONDITIONAL(HAVE_RUBY, [test "x$RUBY" != xno]) diff --git a/swig/python/Makefile.am b/swig/python/Makefile.am index 99786bd..8930933 100644 --- a/swig/python/Makefile.am +++ b/swig/python/Makefile.am @@ -2,19 +2,24 @@ if HAVE_PYTHON pyexec_LTLIBRARIES = _comedi.la else -pyexec_LTLIBRARIES = +pyexec_LTLIBRARIES = endif +BUILT_SOURCES = comedi_python_wrap.c + _comedi_la_SOURCES = comedi_python_wrap.c _comedi_la_CFLAGS = $(COMEDILIB_CFLAGS) $(PYTHON_INCLUDES) $(PYTHON_QUIET) _comedi_la_LDFLAGS = -module -avoid-version $(COMEDILIB_LIBS) pyexec_SCRIPTS = comedi.py -BUILT_SOURCES = comedi_python_wrap.c - EXTRA_DIST = README.txt comedi.py setup.py test_comedi.py +if HAVE_SWIG comedi_python_wrap.c: ../comedi.i $(SWIG) -python -o ./comedi_python_wrap.c ../comedi.i - +else +comedi_python_wrap.c: + echo WARNING: creating bogus comedi_python_wrap.c because you don\'t have swig. + touch comedi_python_wrap.c +endif diff --git a/swig/ruby/Makefile.am b/swig/ruby/Makefile.am index 2d29bdd..22c5ec4 100644 --- a/swig/ruby/Makefile.am +++ b/swig/ruby/Makefile.am @@ -3,6 +3,11 @@ EXTRA_DIST = examples BUILT_SOURCES = comedi_ruby_wrap.c +if HAVE_SWIG comedi_ruby_wrap.c: ../comedi.i $(SWIG) -ruby -o ./comedi_ruby_wrap.c ../comedi.i - +else +comedi_ruby_wrap.c: + echo WARNING: creating bogus comedi_ruby_wrap.c because you don\'t have swig. + touch comedi_ruby_wrap.c +endif