Commit 7eaa16aa authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added ruby and python interfaces

parent e7ac237e
......@@ -19,6 +19,7 @@ config/config.sub -text
config/default -text
config/depcomp -text
config/install-sh -text
config/interface.rb -text
config/missing -text
config/mkinstalldirs -text
/configure -text
......
## Process this file with automake to produce Makefile.in
#
SUBDIRS = src app examples tests
SUBDIRS = src interfaces app examples tests
#
EXTRA_DIST=config/default doc/cdi_cman.pdf doc/cdi_fman.pdf src/cfortran.doc
#
......
......@@ -86,6 +86,9 @@ CFINT = @CFINT@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
......@@ -119,16 +122,21 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PYTHON = @PYTHON@
RANLIB = @RANLIB@
RUBY = @RUBY@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SWIG = @SWIG@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_FC = @ac_ct_FC@
am__include = @am__include@
......@@ -181,7 +189,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
#
SUBDIRS = src app examples tests
SUBDIRS = src interfaces app examples tests
#
EXTRA_DIST = config/default doc/cdi_cman.pdf doc/cdi_fman.pdf src/cfortran.doc
#
......
......@@ -80,6 +80,9 @@ CFINT = @CFINT@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
......@@ -113,16 +116,21 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PYTHON = @PYTHON@
RANLIB = @RANLIB@
RUBY = @RUBY@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SWIG = @SWIG@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_FC = @ac_ct_FC@
am__include = @am__include@
......
require 'rbconfig'
puts Config::expand(Config::MAKEFILE_CONFIG["archdir"])
This diff is collapsed.
......@@ -18,10 +18,13 @@ AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC([gcc c99])
AC_PROG_CC_C99
AC_PROG_CXX
AC_PROG_F77
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_CHECK_PROGS(AR, ar, [ar])
AC_CHECK_PROG(SED,sed,sed,false)
AC_CHECK_PROG(GREP,grep,grep,false)
# Check large file support on 32 bit systems
AC_SYS_LARGEFILE
......@@ -204,6 +207,91 @@ fi
# Check the module extension of the fortran compiler
ACX_SL_FC_MOD_SUFFIX(,[FCMODEXT=mod])
# -----------------------------------
# Check for SWIG - Generator for script-language bindings
AC_ARG_ENABLE(swig,
[AS_HELP_STRING([--enable-swig],[use swig to create extra bindings [default=no]])],
[],[enable_swig=no])
if test "x$enable_swig" != "xyes"; then
use_swig="no (disabled)"
else
AC_CHECK_PROG(SWIG,swig,swig)
if test "x$SWIG" = "x"; then
use_swig="No (swig not available)"
else
use_swig="Yes"
fi
fi
AM_CONDITIONAL(WITH_SWIG, [test "x$SWIG" != "x"])
# ----------------------------------------------------------------------
# Create the Ruby Interface via swig
#
AC_ARG_ENABLE(ruby,
[AS_HELP_STRING([--enable-ruby],[ruby language bindings [default=no]])],
[], [enable_ruby=no])
if test "x$enable_ruby" != "xyes"; then
use_ruby="No (disabled)"
else
AC_CHECK_PROG(RUBY,ruby,ruby)
RUBY_INCLUDES="-I$($RUBY config/interface.rb)"
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $RUBY_INCLUDES"
AC_CHECK_HEADER(ruby.h,,[
use_ruby="No (missing header)"
RUBY=
])
CPPFLAGS=$save_CPPFLAGS
if test "x$RUBY" = "x"; then
use_ruby="No (ruby not available)"
else
use_ruby="Yes"
if test "x$use_swig" != "xYes"; then
echo "Ruby bindings: Swig is disabled, pregenerated files will be used. Use '--enable-swig' for swig usage"
else
if test `$SWIG -help 2>&1 | $GREP -c '\-ruby *- Generate'` = 0; then
use_ruby="No (swig does not support -ruby option)"
fi
fi
fi
fi
AM_CONDITIONAL(WITH_RUBY, [test "x$use_ruby" = "xYes"])
# ----------------------------------------------------------------------
# Create the Ruby Interface via swig
#
AC_ARG_ENABLE(python,
[AS_HELP_STRING([--enable-python],[python language bindings [default=no]])],
[], [enable_python=no])
if test "x$enable_python" != "xyes"; then
use_python="No (disabled)"
else
AC_CHECK_PROG(PYTHON,python,python)
PYTHON_INCLUDES="-I$($PYTHON -c 'from distutils import sysconfig;print sysconfig.get_python_lib(1,1)' | $SED 's/lib/include/')"
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
AC_CHECK_HEADER(Python.h,,[
use_python="No (missing header)"
PYTHON=
])
CPPFLAGS=$save_CPPFLAGS
if test "x$PYTHON" = "x"; then
use_python="No (python not available)"
else
use_python="Yes"
if test "x$use_swig" != "xYes"; then
echo "Python bindings: Swig is disabled, pregenerated files will be used. Use '--enable-swig' for swig usage"
else
if test `$SWIG -help 2>&1 | $GREP -c '\-python *- Generate'` = 0; then
use_python="No (swig does not support -python option)"
fi
fi
fi
fi
AM_CONDITIONAL(WITH_PYTHON, [test "x$use_python" = "xYes"])
# ----------------------------------------------------------------------
# Compile interface with internal EXTRA library
#
......@@ -347,7 +435,7 @@ AC_SUBST([CFINT])
AC_SUBST([CPPFLAGS])
AC_SUBST([AR])
AC_OUTPUT(Makefile src/Makefile app/Makefile tests/Makefile examples/Makefile)
AC_OUTPUT(Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile)
if test "$ac_cv_prog_cc_c99" = "no" ; then
AC_MSG_NOTICE([
......
......@@ -98,6 +98,9 @@ CFINT = @CFINT@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
......@@ -131,16 +134,21 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PYTHON = @PYTHON@
RANLIB = @RANLIB@
RUBY = @RUBY@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SWIG = @SWIG@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_FC = @ac_ct_FC@
am__include = @am__include@
......
......@@ -2,9 +2,7 @@
#
EXTRA_DIST = make_cdilib mo_cdi.f90
#
if CREATE_ISOC
BUILT_SOURCES = cdilib.c
endif
#BUILT_SOURCES = cdilib.c
#
lib_LIBRARIES = libcdi.a
#
......@@ -101,20 +99,18 @@ cdiFortran.o: cdiFortran.c
$(CCDEPMODE) $(depcomp) \
$(COMPILE) $(CFINT) $(REAL4) -c `test -f '$<' || echo '$(srcdir)/'`$<
#
if CREATE_ISOC
cdilib.c:
./make_cdilib
$(top_srcdir)/src/make_cdilib $(top_srcdir)/src
#
cdilib.o: cdilib.c
$(COMPILE) $(CFINT) $(REAL4) -c $<
endif
#
all-local: $(LOCALTARGETS)
LOCALTARGETS =
LOCALTARGETS = cdilib.o
if CREATE_ISOC
LOCALTARGETS += mo_cdi.o cdilib.o
LOCALTARGETS += mo_cdi.o
endif
#
install-data-local: $(LOCALTARGETS)
......@@ -130,6 +126,7 @@ mo_cdi.$(FCMODEXT): mo_cdi.f90
$(FC) $(FCFLAGS) -c $(FCFLAGS_f90) mo_cdi.f90
#
CLEANFILES = `ls *~`
CLEANFILES += cdilib.c
if CREATE_ISOC
CLEANFILES += mo_cdi.$(FCMODEXT)
endif
......@@ -35,7 +35,7 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
@CREATE_ISOC_TRUE@am__append_1 = mo_cdi.$(FCMODEXT)
@CREATE_ISOC_TRUE@am__append_2 = mo_cdi.o cdilib.o
@CREATE_ISOC_TRUE@am__append_2 = mo_cdi.o
@CREATE_ISOC_TRUE@am__append_3 = mo_cdi.$(FCMODEXT)
subdir = src
DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
......@@ -105,6 +105,9 @@ CFINT = @CFINT@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
......@@ -138,16 +141,21 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PYTHON = @PYTHON@
RANLIB = @RANLIB@
RUBY = @RUBY@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SWIG = @SWIG@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_FC = @ac_ct_FC@
am__include = @am__include@
......@@ -202,7 +210,7 @@ top_srcdir = @top_srcdir@
#
EXTRA_DIST = make_cdilib mo_cdi.f90
#
@CREATE_ISOC_TRUE@BUILT_SOURCES = cdilib.c
#BUILT_SOURCES = cdilib.c
#
lib_LIBRARIES = libcdi.a
#
......@@ -290,10 +298,10 @@ libcdi_a_SOURCES = \
util.h \
varscan.h
LOCALTARGETS = $(am__append_2)
LOCALTARGETS = cdilib.o $(am__append_2)
#
CLEANFILES = `ls *~` $(am__append_3)
all: $(BUILT_SOURCES) config.h
CLEANFILES = `ls *~` cdilib.c $(am__append_3)
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
......@@ -550,15 +558,13 @@ distdir: $(DISTFILES)
fi; \
done
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
check: check-am
all-am: Makefile $(LIBRARIES) $(HEADERS) config.h all-local
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
......@@ -583,7 +589,6 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
......@@ -668,11 +673,11 @@ cdiFortran.o: cdiFortran.c
$(CCDEPMODE) $(depcomp) \
$(COMPILE) $(CFINT) $(REAL4) -c `test -f '$<' || echo '$(srcdir)/'`$<
#
@CREATE_ISOC_TRUE@cdilib.c:
@CREATE_ISOC_TRUE@ ./make_cdilib
cdilib.c:
$(top_srcdir)/src/make_cdilib $(top_srcdir)/src
#
@CREATE_ISOC_TRUE@cdilib.o: cdilib.c
@CREATE_ISOC_TRUE@ $(COMPILE) $(CFINT) $(REAL4) -c $<
cdilib.o: cdilib.c
$(COMPILE) $(CFINT) $(REAL4) -c $<
#
all-local: $(LOCALTARGETS)
#
......
......@@ -6,6 +6,10 @@
# pretty generic script -- just echos, cats and greps.
#
#
srcdir=./
if [ ! -z $1 ] ; then
srcdir=$1
fi
PROG=cdilib.c
echo "combining source code into one module"
echo "output is ${PROG}"
......@@ -119,12 +123,21 @@ h="cdi_limits.h taxis.h error.h dtypes.h file.h cgribex.h gribapi.h service.h ex
service.h stream_srv.h stream_ext.h stream_ieg.h cdf_int.h \
cdf.h vlist.h"
cat $h >> ${PROG}
cat $c | grep -v '#include' | grep -v '# include' >> ${PROG}
#cat $h >> ${PROG}
#cat $c | grep -v '#include' | grep -v '# include' >> ${PROG}
if test -f config.h ; then
cpp -P -DHAVE_CONFIG_H version.c >> ${PROG}
CDIVERSION=`grep PACKAGE_VERSION config.h | cut -f3 -d" "`
for hfile in $h ; do
cat $srcdir/$hfile >> ${PROG}
done
for cfile in $c ; do
cat $srcdir/$cfile | grep -v '#include' | grep -v '# include' >> ${PROG}
done
if test -f config.h ; then
cpp -P -DHAVE_CONFIG_H -I./ $srcdir/version.c >> ${PROG}
CDIVERSION=`grep PACKAGE_VERSION config.h | cut -f3 -d" "`
else
echo "error: missing config.h"
fi
......@@ -137,9 +150,9 @@ echo "#undef malloc" >> ${PROG}
echo "#undef calloc" >> ${PROG}
echo "#undef free" >> ${PROG}
echo "#undef DOUBLE_PRECISION" >> ${PROG}
cat cfortran.h >> ${PROG}
cat $srcdir/cfortran.h >> ${PROG}
echo "#endif" >> ${PROG}
cat cdiFortran.c >> ${PROG}
cat $srcdir/cdiFortran.c >> ${PROG}
echo "#undef realloc" >> ${PROG}
echo "#undef malloc" >> ${PROG}
......
......@@ -72,6 +72,9 @@ CFINT = @CFINT@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
......@@ -105,16 +108,21 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PYTHON = @PYTHON@
RANLIB = @RANLIB@
RUBY = @RUBY@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SWIG = @SWIG@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_FC = @ac_ct_FC@
am__include = @am__include@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment