From d550791e7ab492ddc3af6a713d6ab010f78b57a0 Mon Sep 17 00:00:00 2001 From: ellson Date: Sat, 26 Mar 2005 03:37:26 +0000 Subject: [PATCH] autoconf/automake magick for script interfaces --- config_perl.pl | 14 +++++++++ config_python.py | 12 ++++++++ config_ruby.rb | 16 ++++++++++ config_tcl.tcl | 0 configure.ac | 77 +++++++++++++++++++++++++++++++++-------------- lib/Makefile.am | 2 +- lib/common/emit.c | 1 + 7 files changed, 99 insertions(+), 23 deletions(-) create mode 100644 config_perl.pl create mode 100644 config_python.py create mode 100644 config_ruby.rb create mode 100644 config_tcl.tcl diff --git a/config_perl.pl b/config_perl.pl new file mode 100644 index 000000000..a54ecc530 --- /dev/null +++ b/config_perl.pl @@ -0,0 +1,14 @@ +use Config; + +$archlib = $Config{archlib}; + +print $archlib, "\n"; + +# if sys.argv[1] == "archlib": +# print sysconfig.get_python_lib(1,1) +# elif sys.argv[1] == "lib": +# print sysconfig.get_python_lib(0,1) +# elif sys.argv[1] == "archsitelib": +# print sysconfig.get_python_lib(1,0) +# elif sys.argv[1] == "sitelib": +# print sysconfig.get_python_lib(0,0) diff --git a/config_python.py b/config_python.py new file mode 100644 index 000000000..b74704583 --- /dev/null +++ b/config_python.py @@ -0,0 +1,12 @@ +import sys +from distutils import sysconfig + +if sys.argv[1] == "archlib": + print sysconfig.get_python_lib(1,1) +elif sys.argv[1] == "lib": + print sysconfig.get_python_lib(0,1) +elif sys.argv[1] == "archsitelib": + print sysconfig.get_python_lib(1,0) +elif sys.argv[1] == "sitelib": + print sysconfig.get_python_lib(0,0) + diff --git a/config_ruby.rb b/config_ruby.rb new file mode 100644 index 000000000..9211cdd43 --- /dev/null +++ b/config_ruby.rb @@ -0,0 +1,16 @@ +require 'rbconfig' + +CONFIG = Config::MAKEFILE_CONFIG + + +case ARGV[0] +when "INCLUDES" + puts Config::expand(CONFIG["archdir"]) +when "lib" + puts Config::expand(CONFIG["libdir"]) +when "archsitelib" + puts Config::expand(CONFIG["sitearchdir"]) +when "sitelib" + puts Config::expand(CONFIG["sitedir"]) +end + diff --git a/config_tcl.tcl b/config_tcl.tcl new file mode 100644 index 000000000..e69de29bb diff --git a/configure.ac b/configure.ac index 9ec7c8636..f4e5e5de2 100644 --- a/configure.ac +++ b/configure.ac @@ -138,8 +138,6 @@ AC_ISC_POSIX AM_PROG_LEX AC_PROG_YACC AC_PROG_AWK -# AM_PROG_LIBTOOL includes check for ranlib and supercedes AC_CHECK_RANLIB -# AC_PROG_RANLIB AM_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_LN_S @@ -214,6 +212,60 @@ if test "X$no_x" = Xyes; then fi AM_CONDITIONAL(WITH_X, [test "X$no_x" != "Xyes"]) +dnl ----------------------------------- +dnl check for SWIG - needed for script-language bindings + +AC_CHECK_PROG(SWIG,swig,swig) +AM_CONDITIONAL(WITH_SWIG, [test "x$SWIG" != "x"]) + +dnl ----------------------------------- +dnl INCLUDES and LIBS for PERL + +AC_CHECK_PROG(PERL,perl,perl) +AM_CONDITIONAL(WITH_PERL, [test "x$PERL" != "x"]) +if test "x$PERL" = "x"; then + HAVE_PERL=0 +else + HAVE_PERL=1 + PERL_ARCHLIB=`perl -e 'use Config; print $Config{archlib};'` + PERL_INCLUDES=-I$PERL_ARCHLIB/CORE + PERL_LIBS=-L$PERL_ARCHLIB/CORE -lperl +fi +AC_SUBST(HAVE_PERL) +AC_SUBST(PERL_INCLUDES) +AC_SUBST(PERL_LIBS) + +dnl ----------------------------------- +dnl INCLUDES and LIBS for PYTHON + +AC_CHECK_PROG(PYTHON,python,python) +AM_CONDITIONAL(WITH_PYTHON, [test "x$PYTHON" != "x"]) +if test "x$PYTHON" = "x"; then + HAVE_PYTHON=0 +else + HAVE_PYTHON=1 + PYTHON_INCLUDES=-I/usr/include/python2.4 + PYTHON_LIBS=-lpython2.4 +fi +AC_SUBST(HAVE_PYTHON) +AC_SUBST(PYTHON_INCLUDES) +AC_SUBST(PYTHON_LIBS) + +dnl ----------------------------------- +dnl INCLUDES and LIBS for RUBY +AC_CHECK_PROG(RUBY,ruby,ruby) +AM_CONDITIONAL(WITH_RUBY, [test "x$RUBY" != "x"]) +if test "x$RUBY" = "x"; then + HAVE_RUBY=0 +else + HAVE_RUBY=1 + RUBY_INCLUDES=-I`ruby config_ruby.rb INCLUDES` + RUBY_LIBS=-lruby +fi +AC_SUBST(HAVE_RUBY) +AC_SUBST(RUBY_INCLUDES) +AC_SUBST(RUBY_LIBS) + dnl ----------------------------------- dnl INCLUDES and LIBS for TCL @@ -1297,6 +1349,7 @@ AC_CONFIG_FILES(Makefile lib/ingraphs/Makefile lib/gvc/Makefile lib/gvc/libgvc.pc + lib/gvapi/Makefile plugin/Makefile plugin/cairo/Makefile plugin/gd/Makefile @@ -1336,24 +1389,4 @@ AC_CONFIG_FILES(Makefile ast_common.h ) -# ns/Makefile -# dynagraph/Makefile -# dynagraph/common/Makefile -# dynagraph/dynadag/Makefile -# dynagraph/incrface/Makefile -# dynagraph/fdp/Makefile -# dynagraph/shortspline/Makefile -# dynagraph/graphsearch/Makefile -# dynagraph/voronoi/Makefile -# dag/Makefile -# fdp/Makefile -# geo/Makefile -# grid/Makefile -# incr/Makefile -# shape/Makefile -# tcldgr/Makefile -# tcldgr/demo/Makefile -# tcldgl/Makefile -# tcldgl/demo/Makefile - AC_OUTPUT diff --git a/lib/Makefile.am b/lib/Makefile.am index 430ffaccf..f0a6380ff 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in SUBDIRS = cdt graph agraph gd pathplan agutil sfio vmalloc ast circogen \ - dotgen fdpgen neatogen pack twopigen common gvc ingraphs expr + dotgen fdpgen neatogen pack twopigen common gvc ingraphs expr gvapi EXTRA_DIST = Makefile.old diff --git a/lib/common/emit.c b/lib/common/emit.c index 9cda98de6..cb123dfa7 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -803,6 +803,7 @@ fprintf(stderr,"edge_in_layer %s edge_in_pageBox %s\n", numc2 = (2 + numc) / 2.0; for (i = 0; i < offspl.size; i++) { bz = ED_spl(e)->list[i]; +fprintf(stderr,"bz.size %d\n",bz.size); tmpspl.list[i].size = offspl.list[i].size = bz.size; offlist = offspl.list[i].list = malloc(sizeof(pointf) * bz.size); -- 2.40.0