From 0d9b6e6d134917a8fb5cf76ade55dcbaf01acb28 Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Thu, 15 Jun 2000 22:46:10 +0000 Subject: [PATCH] - cint/*: Revamped the launch-scheme for ginaccint.bin. It must be done by a binary executable and not by a script to ensure users can write shebang-scripts. - cint/*: Added a testsuite which hopefully passes (some lucky day). - cint/ginaccint.bin: For this to work we needed a --silent command line switch. - configure.in, Makefile.am, cint/Makefile.am: account for new launchers. - ginac/matrix.cpp, ginac/matrix.h: removed confusing ffe_get() and ffe_set() routines since they counted the non-standard way. - config.guess, config.sub: Updated to new versions from FSF. - others files: Changes triggered. --- INSTALL | 6 +- Makefile.am | 4 +- Makefile.in | 8 +- aclocal.m4 | 13 +- check/Makefile.in | 4 +- cint/Makefile.am | 10 +- cint/Makefile.in | 143 ++++++++++++-------- cint/exam_mansamples.cpp | 15 +++ cint/exam_paranoia.cpp | 23 ++++ cint/ginaccint.bin.cpp | 266 +++++++++++++++++++++----------------- cint/ginaccint.cpp | 43 ++++++ cint/ginaccint.in | 24 ---- cint/launch.h.in | 12 ++ cint/run_exams.cpp | 36 ++++++ config.guess | 5 +- config.sub | 22 ++-- configure | 171 ++++++++++++------------ configure.in | 4 +- doc/Makefile.in | 4 +- doc/reference/Makefile.in | 4 +- doc/tutorial/Makefile.in | 4 +- ginac/Makefile.in | 4 +- ginac/matrix.cpp | 130 +++++++------------ ginac/matrix.h | 4 - ginac/numeric.cpp | 2 +- ginsh/Makefile.in | 4 +- tools/Makefile.in | 4 +- 27 files changed, 550 insertions(+), 419 deletions(-) create mode 100755 cint/exam_mansamples.cpp create mode 100755 cint/exam_paranoia.cpp create mode 100644 cint/ginaccint.cpp delete mode 100644 cint/ginaccint.in create mode 100644 cint/launch.h.in create mode 100644 cint/run_exams.cpp diff --git a/INSTALL b/INSTALL index 0c629b5a..e4da1d79 100644 --- a/INSTALL +++ b/INSTALL @@ -107,7 +107,7 @@ Here is an overview to gives you an idea if you can expect GiNaCcint to compile, install and work properly: Cint version | is known to work with | is known not to work with ---------------+---------------------------+------------------------------ +--------------+---------------------------+------------------------------- < 5.14.39 | `verboten' by license (please bite your favorite lawyer) - 5.14.39 | egcs 1.1.1, gcc.2.95.2 | gcc <= 2.7.2.3 - 5.14.40 | egcs 1.1.1, gcc.2.95.2 | gcc <= 2.7.2.3 + < 5.14.39,40 | egcs 1.1.1, gcc 2.95.2 | COMPILES BUT DOES NOT WORK OK + 5.14.41 | We all wait for it... diff --git a/Makefile.am b/Makefile.am index 82502dbe..192308ce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,8 +15,8 @@ EXTRA_DIST = autogen.sh ginac.m4 m4datadir = $(datadir)/aclocal m4data_DATA = ginac.m4 -# Rule to build tar-gzipped distribution package -$(PACKAGE)-$(VERSION).tar.gz: dist +# Rule to build tar-bzipped distribution package +$(PACKAGE)-$(VERSION).tar.bz2: dist # Rule to build RPM distribution package rpm: $(PACKAGE)-$(VERSION).tar.gz diff --git a/Makefile.in b/Makefile.in index d5088ebb..605257fc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -82,7 +82,6 @@ GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@ GINACLIB_VERSION = @GINACLIB_VERSION@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ -LD = @LD@ LEX = @LEX@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ @@ -95,7 +94,6 @@ MAINT = @MAINT@ MAKECINT = @MAKECINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ -NM = @NM@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ @@ -360,7 +358,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ @@ -455,8 +453,8 @@ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean -# Rule to build tar-gzipped distribution package -$(PACKAGE)-$(VERSION).tar.gz: dist +# Rule to build tar-bzipped distribution package +$(PACKAGE)-$(VERSION).tar.bz2: dist # Rule to build RPM distribution package rpm: $(PACKAGE)-$(VERSION).tar.gz diff --git a/aclocal.m4 b/aclocal.m4 index 85b54087..12c39ff7 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -297,7 +297,7 @@ LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ || AC_MSG_ERROR([libtool configure failed]) # Reload cache, that may have been modified by ltconfig @@ -329,6 +329,11 @@ AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl dnl +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac + # Check for any special flags to pass to ltconfig. libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" @@ -347,7 +352,7 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" # Some flags need to be propagated to the compiler or linker for good # libtool support. -case "$host" in +case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext @@ -563,7 +568,6 @@ else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_SUBST(LD) AC_PROG_LD_GNU ]) @@ -609,14 +613,13 @@ else fi]) NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) -AC_SUBST(NM) ]) # AC_CHECK_LIBM - check for math library AC_DEFUN(AC_CHECK_LIBM, [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= -case "$host" in +case "$lt_target" in *-*-beos* | *-*-cygwin*) # These system don't have libm ;; diff --git a/check/Makefile.in b/check/Makefile.in index a49b71a9..a834eef2 100644 --- a/check/Makefile.in +++ b/check/Makefile.in @@ -82,7 +82,6 @@ GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@ GINACLIB_VERSION = @GINACLIB_VERSION@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ -LD = @LD@ LEX = @LEX@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ @@ -95,7 +94,6 @@ MAINT = @MAINT@ MAKECINT = @MAKECINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ -NM = @NM@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ @@ -287,7 +285,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/cint/Makefile.am b/cint/Makefile.am index 107537f0..5af0bca0 100644 --- a/cint/Makefile.am +++ b/cint/Makefile.am @@ -1,14 +1,18 @@ ## Process this file with automake to produce Makefile.in -bin_PROGRAMS = ginaccint.bin -bin_SCRIPTS = ginaccint +bin_PROGRAMS = ginaccint.bin ginaccint +check_PROGRAMS = run_exams +run_exams_SOURCES = run_exams.cpp +ginaccint_SOURCES = ginaccint.cpp ginaccint_bin_SOURCES = ginaccint.bin.cpp man_MANS = ginaccint.1 ginaccint.bin: ginaccint.bin.cpp (export CINTSYSDIR=$(CINTSYSDIR); $(MAKE) -f Makefile.makecint PATH=$(PATH):$(CINTSYSDIR)) -EXTRA_DIST = $(man_MANS) +TESTS = exam_paranoia.cpp exam_mansamples.cpp + +EXTRA_DIST = $(man_MANS) $(TESTS) # Force targets clean and distclean to call Makecint's own Makefile makecint_clean: diff --git a/cint/Makefile.in b/cint/Makefile.in index 9625ec2f..89fcfce9 100644 --- a/cint/Makefile.in +++ b/cint/Makefile.in @@ -82,7 +82,6 @@ GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@ GINACLIB_VERSION = @GINACLIB_VERSION@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ -LD = @LD@ LEX = @LEX@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ @@ -95,7 +94,6 @@ MAINT = @MAINT@ MAKECINT = @MAKECINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ -NM = @NM@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ @@ -104,15 +102,19 @@ TUTORIAL_TARGETS = @TUTORIAL_TARGETS@ VERSION = @VERSION@ YACC = @YACC@ -bin_PROGRAMS = ginaccint.bin -bin_SCRIPTS = ginaccint +bin_PROGRAMS = ginaccint.bin ginaccint +check_PROGRAMS = run_exams +run_exams_SOURCES = run_exams.cpp +ginaccint_SOURCES = ginaccint.cpp ginaccint_bin_SOURCES = ginaccint.bin.cpp man_MANS = ginaccint.1 -EXTRA_DIST = $(man_MANS) +TESTS = exam_paranoia.cpp exam_mansamples.cpp + +EXTRA_DIST = $(man_MANS) $(TESTS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h -CONFIG_CLEAN_FILES = ginaccint +CONFIG_CLEAN_FILES = launch.h PROGRAMS = $(bin_PROGRAMS) @@ -124,8 +126,14 @@ ginaccint_bin_OBJECTS = ginaccint.bin.o ginaccint_bin_LDADD = $(LDADD) ginaccint_bin_DEPENDENCIES = ginaccint_bin_LDFLAGS = -SCRIPTS = $(bin_SCRIPTS) - +ginaccint_OBJECTS = ginaccint.o +ginaccint_LDADD = $(LDADD) +ginaccint_DEPENDENCIES = +ginaccint_LDFLAGS = +run_exams_OBJECTS = run_exams.o +run_exams_LDADD = $(LDADD) +run_exams_DEPENDENCIES = +run_exams_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) @@ -135,16 +143,16 @@ man1dir = $(mandir)/man1 MANS = $(man_MANS) NROFF = nroff -DIST_COMMON = Makefile.am Makefile.in ginaccint.in +DIST_COMMON = Makefile.am Makefile.in launch.h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best -DEP_FILES = .deps/ginaccint.bin.P -SOURCES = $(ginaccint_bin_SOURCES) -OBJECTS = $(ginaccint_bin_OBJECTS) +DEP_FILES = .deps/ginaccint.P .deps/ginaccint.bin.P .deps/run_exams.P +SOURCES = $(ginaccint_bin_SOURCES) $(ginaccint_SOURCES) $(run_exams_SOURCES) +OBJECTS = $(ginaccint_bin_OBJECTS) $(ginaccint_OBJECTS) $(run_exams_OBJECTS) all: all-redirect .SUFFIXES: @@ -156,7 +164,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -ginaccint: $(top_builddir)/config.status ginaccint.in +launch.h: $(top_builddir)/config.status launch.h.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: @@ -184,6 +192,15 @@ uninstall-binPROGRAMS: rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done +mostlyclean-checkPROGRAMS: + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) + +distclean-checkPROGRAMS: + +maintainer-clean-checkPROGRAMS: + .s.o: $(COMPILE) -c $< @@ -216,24 +233,13 @@ distclean-libtool: maintainer-clean-libtool: -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_SCRIPTS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ - else if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ - else :; fi; fi; \ - done +ginaccint: $(ginaccint_OBJECTS) $(ginaccint_DEPENDENCIES) + @rm -f ginaccint + $(CXXLINK) $(ginaccint_LDFLAGS) $(ginaccint_OBJECTS) $(ginaccint_LDADD) $(LIBS) -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - list='$(bin_SCRIPTS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ - done +run_exams: $(run_exams_OBJECTS) $(run_exams_DEPENDENCIES) + @rm -f run_exams + $(CXXLINK) $(run_exams_LDFLAGS) $(run_exams_OBJECTS) $(run_exams_LDADD) $(LIBS) .cpp.o: $(CXXCOMPILE) -c $< .cpp.lo: @@ -320,7 +326,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ @@ -378,15 +384,42 @@ maintainer-clean-depend: | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ >> .deps/$(*F).P; \ rm -f .deps/$(*F).pp +check-TESTS: $(TESTS) + @failed=0; all=0; \ + srcdir=$(srcdir); export srcdir; \ + for tst in $(TESTS); do \ + if test -f $$tst; then dir=.; \ + else dir="$(srcdir)"; fi; \ + if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ + all=`expr $$all + 1`; \ + echo "PASS: $$tst"; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0 info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am installcheck-am: installcheck: installcheck-am -install-exec-am: install-binPROGRAMS install-binSCRIPTS +install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-man @@ -395,15 +428,14 @@ install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am -uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-man +uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall: uninstall-am -all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) +all-am: Makefile $(PROGRAMS) $(MANS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir) \ - $(DESTDIR)$(mandir)/man1 + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 mostlyclean-generic: @@ -415,28 +447,30 @@ distclean-generic: -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ - mostlyclean-libtool mostlyclean-tags mostlyclean-depend \ - mostlyclean-generic +mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-checkPROGRAMS \ + mostlyclean-compile mostlyclean-libtool \ + mostlyclean-tags mostlyclean-depend mostlyclean-generic mostlyclean: mostlyclean-am -clean-am: clean-binPROGRAMS clean-compile clean-libtool clean-tags \ - clean-depend clean-generic mostlyclean-am +clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-compile \ + clean-libtool clean-tags clean-depend clean-generic \ + mostlyclean-am clean: clean-am -distclean-am: distclean-binPROGRAMS distclean-compile distclean-libtool \ - distclean-tags distclean-depend distclean-generic \ - clean-am +distclean-am: distclean-binPROGRAMS distclean-checkPROGRAMS \ + distclean-compile distclean-libtool distclean-tags \ + distclean-depend distclean-generic clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-binPROGRAMS \ - maintainer-clean-compile maintainer-clean-libtool \ - maintainer-clean-tags maintainer-clean-depend \ - maintainer-clean-generic distclean-am + maintainer-clean-checkPROGRAMS maintainer-clean-compile \ + maintainer-clean-libtool maintainer-clean-tags \ + maintainer-clean-depend maintainer-clean-generic \ + distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." @@ -444,13 +478,14 @@ maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile mostlyclean-libtool distclean-libtool \ -clean-libtool maintainer-clean-libtool uninstall-binSCRIPTS \ -install-binSCRIPTS install-man1 uninstall-man1 install-man \ -uninstall-man tags mostlyclean-tags distclean-tags clean-tags \ -maintainer-clean-tags distdir mostlyclean-depend distclean-depend \ -clean-depend maintainer-clean-depend info-am info dvi-am dvi check \ +mostlyclean-checkPROGRAMS distclean-checkPROGRAMS clean-checkPROGRAMS \ +maintainer-clean-checkPROGRAMS mostlyclean-compile distclean-compile \ +clean-compile maintainer-clean-compile mostlyclean-libtool \ +distclean-libtool clean-libtool maintainer-clean-libtool install-man1 \ +uninstall-man1 install-man uninstall-man tags mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir \ +mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend check-TESTS info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ diff --git a/cint/exam_mansamples.cpp b/cint/exam_mansamples.cpp new file mode 100755 index 00000000..d26ad354 --- /dev/null +++ b/cint/exam_mansamples.cpp @@ -0,0 +1,15 @@ +#! ./run_exams --silent +int result = 0; +symbol x("x"), y("y"), z("z"); +{ + ex a = pow(x,2)-x-2; + ex b = pow(x+1,2); + ex s = a/b; + if (!(s.diff(x)-2*pow(1+x,-3)*(-2-x+pow(x,2))-(-1+2*x)*pow(1+x,-2)).is_zero()) { + ++result; + } + if (!(s.normal()-(-2+x)/(1+x)).is_zero()) { + ++result; + } +} +exit(result); diff --git a/cint/exam_paranoia.cpp b/cint/exam_paranoia.cpp new file mode 100755 index 00000000..4fc7b981 --- /dev/null +++ b/cint/exam_paranoia.cpp @@ -0,0 +1,23 @@ +#! ./run_exams --silent +int result = 0; +/* + * Old Cint versions messed up unary and binary operators: + */ +{ + symbol x; + ex a = x-x; + if (!a.is_zero()) { + ++result; + } +} +/* + * Some problems with objects of class relational when cast to bool: + */ +{ + symbol x; + ex a = x; + if (bool(a != a)) { + ++result; + } +} +exit(result); diff --git a/cint/ginaccint.bin.cpp b/cint/ginaccint.bin.cpp index 065c27c8..db27e2b8 100644 --- a/cint/ginaccint.bin.cpp +++ b/cint/ginaccint.bin.cpp @@ -1,3 +1,6 @@ +/* ginaccint.bin.cpp: Binary depends on CINTSYSDIR, better don't call it + * directly. Use the launcher (compiled from ginaccint.cpp) instead. */ + #include "G__ci.h" /* G__atpause is defined in G__ci.h */ #if (!defined(G__CINTVERSION)) || (G__CINTVERSION < 501438) @@ -56,12 +59,13 @@ void restart(void); bool is_command(string const & command, string & preprocessed, string const & comparevalue, bool substr=false); bool readlines(istream * is, string & allcommands); -bool readfile(string const & filename, string & allcommands); +bool readfile(string const & filename, string & allcommands, bool shutup=false); void savefile(string const & filename, string const & allcommands); typedef list cplist; cplist filenames; -bool redirect_output=false; +bool redirect_output = false; +bool silent = false; G__value exec_tempfile(string const & command) { @@ -119,12 +123,9 @@ void process_tempfile(string const & command) // => this is not a temporary ex, but one that resides safely in memory // cout << "warning: using ex from retval (experimental)" << endl; - ex::dummy_bp=((ex *)(void *)(retval.obj.i))->bp; + ex::dummy_bp = ((ex *)(void *)(retval.obj.i))->bp; exec_tempfile("ex "+varname+"(*ex::dummy_bp);"); } else if (ex::last_created_or_assigned_bp_can_be_converted_to_ex()) { - //string varfill; - //for (int i=4-int(log10(out_count)); i>0; --i) - // varfill += ' '; exec_tempfile("ex "+varname+"(*ex::last_created_or_assigned_bp);"); } else { cout << "warning: last_created_or_assigned_bp modified 0 or not evaluated or not dynallocated" << endl; @@ -163,85 +164,74 @@ void process_tempfile(string const & command) void greeting(void) { - cout << "Welcome to GiNaC-cint (" << PACKAGE << " V" << VERSION << ")" << endl; - cout << " __, _______ GiNaC: (C) 1999-2000 Johannes Gutenberg University Mainz," << endl - << " (__) * | Germany. Cint C/C++ interpreter: (C) 1995-2000 Masaharu" << endl - << " ._) i N a C | Goto and Agilent Technologies, Japan. This is free software" << endl - << "<-------------' with ABSOLUTELY NO WARRANTY. For details, type `.warranty'" << endl - << "Type .help for help." << endl - << endl; + cout << "Welcome to GiNaC-cint (" << PACKAGE << " V" << VERSION + << ", Cint V" << G__CINTVERSION << ")\n"; + cout << " __, _______ GiNaC: (C) 1999-2000 Johannes Gutenberg University Mainz,\n" + << " (__) * | Germany. Cint C/C++ interpreter: (C) 1995-2000 Masaharu\n" + << " ._) i N a C | Goto and Agilent Technologies, Japan. This is free software\n" + << "<-------------' with ABSOLUTELY NO WARRANTY. For details, type `.warranty'\n" + << "Type .help for help.\n\n"; return; } void helpmessage(void) { - cout << "GiNaC-cint recognizes some special commands which start with a dot:" << endl << endl - << " .cint switch to cint interactive mode (see cint" << endl - << " documentation for further details)" << endl - << " .function define the body of a function (necessary due to a" << endl - << " cint limitation)" << endl - << " .help the text you are currently reading" << endl - << " .q, .quit, .exit, .bye quit GiNaC-cint" << endl - << " .read filename read a file from disk and execute it in GiNaC-cint" << endl - << " (recursive call is possible)" << endl - << " .redirect [filename] redirect 'OutXY = ...' output to a file" << endl - << " (.redirect alone redirects output back to console)" << endl - << " .restart restart GiNaC-cint (does not re-read command line" << endl - << " files)" << endl - << " .save filename save the commands you have entered so far in a file" << endl - << " .silent suppress 'OutXY = ...' output (variables are still" << endl - << " accessible)" << endl - << " .warranty information on redistribution and warranty" << endl - << " .> [filename] same as .redirect [filename]" << endl << endl - << "Instead of '.cmd' you can also write '//GiNaC-cint.cmd' to be compatible with" << endl - << "programs that will be compiled later." << endl - << "Additionally you can exit GiNaC-cint with quit; exit; or bye;" << endl - << endl; + cout << "GiNaC-cint recognizes some special commands which start with a dot:\n\n" + << " .cint switch to cint interactive mode (see cint\n" + << " documentation for further details)\n" + << " .function define the body of a function (necessary due to a\n" + << " cint limitation)\n" + << " .help the text you are currently reading\n" + << " .q, .quit, .exit, .bye quit GiNaC-cint\n" + << " .read filename read a file from disk and execute it in GiNaC-cint\n" + << " (recursive call is possible)\n" + << " .redirect [filename] redirect 'OutXY = ...' output to a file\n" + << " (.redirect alone redirects output back to console)\n" + << " .restart restart GiNaC-cint (does not re-read command line\n" + << " files)\n" + << " .save filename save the commands you have entered so far in a file\n" + << " .silent suppress 'OutXY = ...' output (variables are still\n" + << " accessible)\n" + << " .warranty information on redistribution and warranty\n" + << " .> [filename] same as .redirect [filename]\n\n" + << "Instead of '.cmd' you can also write '//GiNaC-cint.cmd' to be compatible with\n" + << "programs that will be compiled later.\n" + << "Additionally you can exit GiNaC-cint with quit; exit; or bye;\n\n"; return; } void warrantymessage(void) { - cout << "GiNaC is free software; you can redistribute it and/or modify it under the" << endl - << "the terms of the GNU General Public License as published by the Free Software" << endl - << "Foundation; either version 2 of the License, or (at your option) any later" << endl - << "version." << endl - << "This program is distributed in the hope that it will be useful, but WITHOUT" << endl - << "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS" << endl - << "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more" << endl - << "details." << endl - << "You should have received a copy of the GNU General Public License along with" << endl - << "this program. If not, write to the Free Software Foundation, 675 Mass Ave," << endl - << "Cambridge, MA 02139, USA." << endl << endl; - cout << "Cint and associated tools are copyright by Agilent Technologies Japan Company" << endl - << "and Masaharu Goto ." << endl - << "Source code, binary executable or library of Cint and associated tools can be" << endl - << "used, modified and distributed with no royalty for any purpose provided that" << endl - << "the copyright notice appear in all copies and that both that copyright notice" << endl - << "and this permission notice appear in supporting documentation." << endl - << "Agilent Technologies Japan and the author make no representations about the" << endl - << "suitability of this software for any purpose. It is provided \"AS IS\"" << endl - << "without express or implied warranty." << endl; + cout << "GiNaC is free software; you can redistribute it and/or modify it under the\n" + << "the terms of the GNU General Public License as published by the Free Software\n" + << "Foundation; either version 2 of the License, or (at your option) any later\n" + << "version.\n" + << "This program is distributed in the hope that it will be useful, but WITHOUT\n" + << "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n" + << "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n" + << "details.\n" + << "You should have received a copy of the GNU General Public License along with\n" + << "this program. If not, write to the Free Software Foundation, 675 Mass Ave,\n" + << "Cambridge, MA 02139, USA.\n\n"; + cout << "Cint and associated tools are copyright by Agilent Technologies Japan Company\n" + << "and Masaharu Goto .\n" + << "Source code, binary executable or library of Cint and associated tools can be\n" + << "used, modified and distributed with no royalty for any purpose provided that\n" + << "the copyright notice appear in all copies and that both that copyright notice\n" + << "and this permission notice appear in supporting documentation.\n" + << "Agilent Technologies Japan and the author make no representations about the\n" + << "suitability of this software for any purpose. It is provided \"AS IS\"\n" + << "without express or implied warranty.\n"; return; } +/** "preprocess" the line entered to be able to decide if the command shall be + * executed directly or more input is needed or this is a special command. + * All whitespace will be removed. All comments will be removed. Open and + * close braces ( { and } ) outside strings will be counted. */ string preprocess(char const * const line, bool & comment, bool & single_quote, bool & double_quote, unsigned & open_braces) { - // "preprocess" the line entered to be able to decide if the command shall be - // executed directly or more input is needed or this is a special command - - // ALL whitespace will be removed - // all comments (/* */ and //) will be removed - // open and close braces ( { and } ) outside strings will be counted - - /* - cout << "line=" << line << endl; - cout << "comment=" << comment << ", single_quote=" << single_quote - << ",double_quote=" << double_quote << ", open_braces=" << open_braces - << endl; - */ - string preprocessed; int pos = 0; bool end = false; @@ -282,7 +272,7 @@ string preprocess(char const * const line, bool & comment, bool & single_quote, break; case '\\': // escape character, ignore next - escape=true; + escape = true; break; case '"': if ((!single_quote)&&(!comment)) { @@ -296,12 +286,12 @@ string preprocess(char const * const line, bool & comment, bool & single_quote, break; case '{': if ((!single_quote)&&(!double_quote)&&(!comment)) { - open_braces++; + ++open_braces; } break; case '}': if ((!single_quote)&&(!double_quote)&&(!comment)&&(open_braces>0)) { - open_braces--; + --open_braces; } break; case '/': @@ -314,15 +304,8 @@ string preprocess(char const * const line, bool & comment, bool & single_quote, preprocessed += line[pos]; } } - pos++; + ++pos; } - - /* - cout << "preprocessed=" << preprocessed << endl; - cout << "comment=" << comment << ", single_quote=" << single_quote - << ",double_quote=" << double_quote << ", open_braces=" << open_braces - << endl; - */ return preprocessed; } @@ -343,9 +326,6 @@ void sigterm_handler(int n) void initialize(void) { - if (isatty(0)) - greeting(); - atexit(cleanup); signal(SIGTERM,sigterm_handler); initialize_cint(); @@ -354,10 +334,7 @@ void initialize(void) void initialize_cint(void) { G__init_cint("cint"); /* initialize cint */ - - // no longer needed as of cint 5.14.31: - // exec_tempfile("#include \n"); - + #ifndef NO_NAMESPACE_GINAC exec_tempfile("using namespace GiNaC;"); #endif // ndef NO_NAMESPACE_GINAC @@ -374,23 +351,54 @@ void restart(void) initialize_cint(); } -void redirect(string const & filename) +void redirect(string const & filename, + bool shutup=false) { if (filename=="") { - cout << "Redirecting output back to console..." << endl; + if (!shutup) + cout << "Redirecting output back to console..." << endl; exec_tempfile( string() +"ginac_cint_internal_redirect_output=false;\n" +"ginac_cint_internal_fout.close();"); } else { - cout << "Redirecting output to " << filename << "..." << endl; + if (!shutup) + cout << "Redirecting output to " << filename << "..." << endl; exec_tempfile( string() +"ginac_cint_internal_redirect_output=true;\n" +"ginac_cint_internal_fout.open(\""+filename+"\");\n"); } } -bool is_command(string const & command, string & preprocessed, - string const & comparevalue, bool substr) +/** Sort out command line options and evaluate them. Returns true if it + * succeeds and false otherwise. */ +bool evaloption(const string & option) +{ + if (option=="--version") { + cout << "GiNaC-cint (" << PACKAGE << " V" << VERSION + << ", Cint V" << G__CINTVERSION << ")\n"; + exit(0); + } + if (option=="--help") { + cout << "GiNaC-cint (" << PACKAGE << " V" << VERSION + << ", Cint V" << G__CINTVERSION << ")\n"; + cout << "usage: ginaccint [option] [file ...]\n"; + cout << " --help print this help message and exit\n" + << " --silent invoke ginaccint in silent mode\n" + << " --version print GiNaC version and Cint version and exit\n"; + exit(0); + } + if (option=="--silent") { + redirect("/dev/null",true); + silent = true; + return true; + } + return false; +} + +bool is_command(string const & command, + string & preprocessed, + string const & comparevalue, + bool substr) { bool single_quote = false; bool double_quote = false; @@ -411,7 +419,8 @@ bool is_command(string const & command, string & preprocessed, return false; } -bool readlines(istream * is, string & allcommands) +bool readlines(istream * is, + string & allcommands) { char const * line; char prompt[G__ONELINE]; @@ -462,7 +471,7 @@ bool readlines(istream * is, string & allcommands) quit = true; } else if (is_command(command,preprocessed,"function")) { cout << "next expression can be a function definition" << endl; - next_command_is_function=true; + next_command_is_function = true; } else if (is_command(command,preprocessed,"cint")) { cout << endl << "switching to cint interactive mode" << endl; cout << "'h' for help, 'q' to quit, '{ statements }' or 'p [expression]' to evaluate" << endl; @@ -471,7 +480,7 @@ bool readlines(istream * is, string & allcommands) } else if (is_command(command,preprocessed,"help")) { helpmessage(); } else if (is_command(command,preprocessed,"read",true)) { - quit=readfile(preprocessed.substr(5),allcommands); + quit = readfile(preprocessed.substr(5),allcommands); } else if (is_command(command,preprocessed,"save",true)) { command = "/* "+command+" */"; // we do not want the .save command itself in saved files savefile(preprocessed.substr(5),allcommands); @@ -482,7 +491,13 @@ bool readlines(istream * is, string & allcommands) } else if (is_command(command,preprocessed,">",true)) { redirect(preprocessed.substr(2)); } else if (is_command(command,preprocessed,"silent")) { - redirect("/dev/null"); + if (!silent) { + redirect("/dev/null"); + silent = true; + } else { + redirect(""); + silent = false; + } } else if (is_command(command,preprocessed,"warranty")) { warrantymessage(); /* test for more special commands @@ -502,7 +517,7 @@ bool readlines(istream * is, string & allcommands) } if (is!=NULL) { // test for end of file if reading from a stream - eof=is->eof(); + eof = is->eof(); } else { // save commands only when reading from keyboard allcommands += command; @@ -512,17 +527,19 @@ bool readlines(istream * is, string & allcommands) return quit; } -bool readfile(string const & filename, string & allcommands) +bool readfile(string const & filename, + string & allcommands, + bool shutup=false) { - cout << "Reading commands from file " << filename << "." << endl; + if (!shutup) + cout << "Reading commands from file " << filename << "." << endl; bool quit = false; ifstream fin; fin.open(filename.c_str()); - if (fin.good()) { + if (fin.good()) quit = readlines(&fin,allcommands); - } else { + else cout << "Cannot open " << filename << " for reading." << endl; - } fin.close(); return quit; } @@ -543,33 +560,40 @@ void savefile(string const & filename, string const & allcommands) fout.close(); } -int main(int argc, char ** argv) +int main(int argc, char * *argv) { string allcommands; initialize(); - + bool quit = false; + // sort out and evaluate recognized options from the argument list + for (int i=1; i1; - - if (argsexist) { - allcommands = "/* Files given as command line arguments:\n"; - } - argc--; argv++; - while (argc && !quit) { - allcommands += *argv; - allcommands += "\n"; - quit=readfile(*argv,allcommands); - argc--; argv++; - } - + // greet the user if it makes sense + if (isatty(0) && !silent) + greeting(); + + // evaluate files given as command line arguments if (argsexist) { + allcommands = "/* Files given as command line arguments:\n"; + --argc; + while (argc && !quit) { + allcommands += string(argv[argc])+'\n'; + quit = readfile(argv[argc], allcommands, silent); + --argc; + } allcommands += "*/\n"; } - - if (!quit) { - readlines(NULL,allcommands); - } - + + // evaluate input from command line or script + if (!quit) + readlines(NULL, allcommands); + return 0; } diff --git a/cint/ginaccint.cpp b/cint/ginaccint.cpp new file mode 100644 index 00000000..4d25c445 --- /dev/null +++ b/cint/ginaccint.cpp @@ -0,0 +1,43 @@ +/* ginaccint.cpp, a launcher that sets variables to start ginaccint.bin. + * This is necessary because Cint is not libtoolized and so may need to have + * LD_LIBRARY_PATH and CINTSYSDIR set. This cannot be done by a shell-script + * because the #!-mechanism works only once and we want to enable the user to + * write scripts using that mechanism. */ + +#include +#include +#include +#include +#include "launch.h" + +extern char **environ; + +int main(int argc, char * *argv) +{ + // manually "expand" autoconf-style variables + if (exec_prefix=="${prefix}") + exec_prefix = prefix; + if (bindir=="${exec_prefix}/bin") + bindir = exec_prefix + "/bin"; + if (libdir=="${exec_prefix}/lib") + libdir = exec_prefix + "/lib"; + // now we can guess what to start + string binprog = bindir + "/ginaccint.bin"; + + // extend LD_LIBRARY_PATH by libdir, so ginaccint.bin really finds libginac + const char * LD_LIBRARY_PATH = getenv("LD_LIBRARY_PATH"); + if (LD_LIBRARY_PATH == NULL) + setenv("LD_LIBRARY_PATH", libdir.c_str(), 1); + else + setenv("LD_LIBRARY_PATH", (string(LD_LIBRARY_PATH)+':'+libdir).c_str(), 1); + + // hard-wire CINTSYSDIR, inherited from configure, if it is not set + setenv("CINTSYSDIR", CINTSYSDIR.c_str(), 0); + + // execute the real thing + int error = execve(binprog.c_str(), argv, environ); + + // only gets here on error + cerr << argv[0] << ": cannot exec " << binprog << endl; + return error; +} diff --git a/cint/ginaccint.in b/cint/ginaccint.in deleted file mode 100644 index b4aed361..00000000 --- a/cint/ginaccint.in +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/sh - -binprog=`basename $0`".bin" -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -libdir=@libdir@ -config_cintsysdir=@CINTSYSDIR@ -program=${bindir}/${binprog} - -# Unless the user doesn't override $CINTSYSDIR, assume the value -# given at configuration time: -CINTSYSDIR=${CINTSYSDIR-$config_cintsysdir} -export CINTSYSDIR - -# Extend LD_LIBRARY_PATH, needed because Cint isn't libtoolized: -LD_LIBRARY_PATH=${libdir}:${LD_LIBRARY_PATH} -export LD_LIBRARY_PATH - -# Execute ginaccint.bin with all arguments given: -exec ${program} ${1+"$@"} - -echo "$0: cannot exec ${program} ${1+"$@"}" -exit 1 diff --git a/cint/launch.h.in b/cint/launch.h.in new file mode 100644 index 00000000..88c33ff4 --- /dev/null +++ b/cint/launch.h.in @@ -0,0 +1,12 @@ +/* config.h.in --> config.h (configure) + * ginaccint.bin shouldn't be invoked directly because CINTSYSDIR or other + * variables might not be in place when some user invokes it. Instead, we need + * a little launcher binary. This file should be included by those launchers + * so they know about some variables. */ + +// set some variables inherited from configure +string prefix = "@prefix@"; +string exec_prefix = "@exec_prefix@"; +string bindir = "@bindir@"; +string libdir = "@libdir@"; +string CINTSYSDIR = "@CINTSYSDIR@"; diff --git a/cint/run_exams.cpp b/cint/run_exams.cpp new file mode 100644 index 00000000..dabf467b --- /dev/null +++ b/cint/run_exams.cpp @@ -0,0 +1,36 @@ +/* run_exams.cpp, a launcher that sets variables to start ginaccint.bin. + * This is necessary because Cint is not libtoolized and so may need to have + * LD_LIBRARY_PATH and CINTSYSDIR set. (This cannot be done by a shell-script + * because the #!-mechanism works only once and we want to enable the user to + * write scripts using that mechanism.) */ + +#include +#include +#include +#include +#include "launch.h" + +extern char **environ; + +int main(int argc, char * *argv) +{ + // what to start + string binprog = "./ginaccint.bin"; + + // extend LD_LIBRARY_PATH by ../ginac/.libs, so ginaccint.bin really finds libginac + const char * LD_LIBRARY_PATH = getenv("LD_LIBRARY_PATH"); + if (LD_LIBRARY_PATH == NULL) + setenv("LD_LIBRARY_PATH", "../ginac/.libs", 1); + else + setenv("LD_LIBRARY_PATH", (string(LD_LIBRARY_PATH)+':'+"../ginac/.libs").c_str(), 1); + + // hard-wire CINTSYSDIR, inherited from configure + setenv("CINTSYSDIR", CINTSYSDIR.c_str(), 1); + + // execute the real thing + int error = execve(binprog.c_str(), argv, environ); + + // only gets here on error + cerr << argv[0] << ": cannot exec " << binprog << endl; + return error; +} diff --git a/config.guess b/config.guess index b4faaedc..49949643 100755 --- a/config.guess +++ b/config.guess @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Free Software Foundation, Inc. -version='2000-05-30' +version='2000-06-13' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -687,6 +687,9 @@ EOF *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; *:Linux:*:*) # The BFD linker knows what the default object file format is, so diff --git a/config.sub b/config.sub index f414a431..8fa14be2 100755 --- a/config.sub +++ b/config.sub @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Free Software Foundation, Inc. -version='2000-05-30' +version='2000-06-13' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -29,7 +29,6 @@ version='2000-05-30' # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Written by Per Bothner . # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. @@ -132,7 +131,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) + -apple | -axis) os= basic_machine=$1 ;; @@ -212,7 +211,8 @@ case $basic_machine in | hppa64 \ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | we32k | ns16k | clipper | i370 | sh | sh[34] \ + | powerpc | powerpcle \ | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ @@ -227,7 +227,7 @@ case $basic_machine in # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[34567]86) + i[234567]86) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -237,7 +237,7 @@ case $basic_machine in ;; # Recognize the basic CPU types with company name. # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ + vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ @@ -355,6 +355,9 @@ case $basic_machine in crds | unos) basic_machine=m68k-crds ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -666,7 +669,7 @@ case $basic_machine in pentium | p5 | k5 | k6 | nexen) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86) + pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) @@ -675,7 +678,7 @@ case $basic_machine in pentium-* | p5-* | k5-* | k6-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-* | 6x86-*) + pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) @@ -891,6 +894,9 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; + sh3 | sh4) + base_machine=sh-unknown + ;; sparc | sparcv9) basic_machine=sparc-sun ;; diff --git a/configure b/configure index fd5f1856..57832950 100755 --- a/configure +++ b/configure @@ -1550,9 +1550,8 @@ else echo "$ac_t""no" 1>&6 fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } - echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1556: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1555: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1568,7 +1567,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1572: checking for BSD-compatible nm" >&5 +echo "configure:1571: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1603,9 +1602,8 @@ fi NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 - echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1609: checking whether ln -s works" >&5 +echo "configure:1607: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1626,6 +1624,11 @@ else fi +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac + # Check for any special flags to pass to ltconfig. libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" @@ -1646,11 +1649,11 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" # Some flags need to be propagated to the compiler or linker for good # libtool support. -case "$host" in +case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1653 "configure"' > conftest.$ac_ext - if { (eval echo configure:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1656 "configure"' > conftest.$ac_ext + if { (eval echo configure:1657: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -1671,19 +1674,19 @@ case "$host" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1675: checking whether the C compiler needs -belf" >&5 +echo "configure:1678: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -1761,7 +1764,7 @@ LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ || { echo "configure: error: libtool configure failed" 1>&2; exit 1; } # Reload cache, that may have been modified by ltconfig @@ -1785,7 +1788,7 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' exec 5>>./config.log echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1789: checking how to run the C preprocessor" >&5 +echo "configure:1792: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1800,13 +1803,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1817,13 +1820,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1834,13 +1837,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1870,7 +1873,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1874: checking for $ac_word" >&5 +echo "configure:1877: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1903,7 +1906,7 @@ test -n "$LEX" || LEX=""$missing_dir/missing flex"" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1907: checking for $ac_word" >&5 +echo "configure:1910: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1937,7 +1940,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1941: checking for yywrap in -l$ac_lib" >&5 +echo "configure:1944: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1945,7 +1948,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1979,7 +1982,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:1983: checking lex output file root" >&5 +echo "configure:1986: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2000,7 +2003,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:2004: checking whether yytext is a pointer" >&5 +echo "configure:2007: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2012,14 +2015,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -2045,7 +2048,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2049: checking for $ac_word" >&5 +echo "configure:2052: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2102,7 +2105,7 @@ fi echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:2106: checking size of long" >&5 +echo "configure:2109: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2110,7 +2113,7 @@ else ac_cv_sizeof_long=4 else cat > conftest.$ac_ext < main() @@ -2121,7 +2124,7 @@ main() exit(0); } EOF -if { (eval echo configure:2125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -2141,7 +2144,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:2145: checking size of long long" >&5 +echo "configure:2148: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2149,7 +2152,7 @@ else ac_cv_sizeof_long_long=8 else cat > conftest.$ac_ext < main() @@ -2160,7 +2163,7 @@ main() exit(0); } EOF -if { (eval echo configure:2164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -2180,7 +2183,7 @@ EOF echo $ac_n "checking size of long double""... $ac_c" 1>&6 -echo "configure:2184: checking size of long double" >&5 +echo "configure:2187: checking size of long double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2188,7 +2191,7 @@ else ac_cv_sizeof_long_double=12 else cat > conftest.$ac_ext < main() @@ -2199,7 +2202,7 @@ main() exit(0); } EOF -if { (eval echo configure:2203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_double=`cat conftestval` else @@ -2231,17 +2234,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2235: checking for $ac_hdr" >&5 +echo "configure:2238: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2271,17 +2274,17 @@ for ac_hdr in readline/readline.h readline/history.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2275: checking for $ac_hdr" >&5 +echo "configure:2278: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2318,12 +2321,12 @@ LIBTERMCAP= for ac_func in tgetent do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2322: checking for $ac_func" >&5 +echo "configure:2325: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2377,7 +2380,7 @@ if test "x$ac_cv_func_tgetent" = "xyes"; then : else echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:2381: checking for tgetent in -lncurses" >&5 +echo "configure:2384: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2385,7 +2388,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2421,7 +2424,7 @@ fi if test -z "$LIBTERMCAP"; then echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:2425: checking for tgetent in -ltermcap" >&5 +echo "configure:2428: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2429,7 +2432,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2470,7 +2473,7 @@ fi save_LIBS=$LIBS LIBS="$LIBTERMCAP $LIBS" echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:2474: checking for readline in -lreadline" >&5 +echo "configure:2477: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2478,7 +2481,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2534,17 +2537,17 @@ for ac_hdr in iostream vector map string list typeinfo iterator stdexcept algori do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2538: checking for $ac_hdr" >&5 +echo "configure:2541: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2575,17 +2578,17 @@ for ac_hdr in sstream strstream do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2579: checking for $ac_hdr" >&5 +echo "configure:2582: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2617,17 +2620,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2621: checking for $ac_hdr" >&5 +echo "configure:2624: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2654,17 +2657,17 @@ for ac_hdr in cln.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2658: checking for $ac_hdr" >&5 +echo "configure:2661: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2699,7 +2702,7 @@ done echo $ac_n "checking for doublefactorial in -lcln""... $ac_c" 1>&6 -echo "configure:2703: checking for doublefactorial in -lcln" >&5 +echo "configure:2706: checking for doublefactorial in -lcln" >&5 saved_LIBS="${LIBS}" if eval "test \"`echo '$''{'ginac_cv_lib_cln_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2708,14 +2711,14 @@ else case "${ac_cv_header_cln_cln_h}" in "yes") cat > conftest.$ac_ext < int main() { doublefactorial(2); ; return 0; } EOF -if { (eval echo configure:2719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ginac_cv_lib_cln_link="-lcln" else @@ -2728,14 +2731,14 @@ rm -f conftest* ;; *) cat > conftest.$ac_ext < int main() { doublefactorial(2); ; return 0; } EOF -if { (eval echo configure:2739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ginac_cv_lib_cln_link="-lcln" else @@ -2776,7 +2779,7 @@ GINACLIB_LIBS=$LIBS # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2780: checking for $ac_word" >&5 +echo "configure:2783: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_DOXYGEN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2812,7 +2815,7 @@ fi # Extract the first word of "latex", so it can be a program name with args. set dummy latex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2816: checking for $ac_word" >&5 +echo "configure:2819: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LATEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2848,7 +2851,7 @@ fi # Extract the first word of "makeindex", so it can be a program name with args. set dummy makeindex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2852: checking for $ac_word" >&5 +echo "configure:2855: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MAKEINDEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2884,7 +2887,7 @@ fi # Extract the first word of "dvips", so it can be a program name with args. set dummy dvips; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2888: checking for $ac_word" >&5 +echo "configure:2891: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_DVIPS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2920,7 +2923,7 @@ fi # Extract the first word of "fig2dev", so it can be a program name with args. set dummy fig2dev; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2924: checking for $ac_word" >&5 +echo "configure:2927: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FIG2DEV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2984,7 +2987,7 @@ if test "x$with_cint" != "xno"; then # Extract the first word of "cint", so it can be a program name with args. set dummy cint; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2988: checking for $ac_word" >&5 +echo "configure:2991: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CINT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3020,7 +3023,7 @@ fi # Extract the first word of "makecint", so it can be a program name with args. set dummy makecint; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3024: checking for $ac_word" >&5 +echo "configure:3027: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MAKECINT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3185,7 +3188,7 @@ doc/Makefile doc/tutorial/Makefile doc/reference/Makefile cint/Makefile -cint/ginaccint +cint/launch.h config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF @@ -3509,7 +3510,7 @@ cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h -chmod +x ginac-config cint/ginaccint +chmod +x ginac-config exit 0 EOF chmod +x $CONFIG_STATUS diff --git a/configure.in b/configure.in index f1212483..a9c3f3bb 100644 --- a/configure.in +++ b/configure.in @@ -192,7 +192,7 @@ doc/Makefile doc/tutorial/Makefile doc/reference/Makefile cint/Makefile -cint/ginaccint -], [chmod +x ginac-config cint/ginaccint]) +cint/launch.h +], [chmod +x ginac-config]) dnl Display a final warning if there has been a GINAC_ERROR or a GINAC_WARNING GINAC_CHECK_ERRORS diff --git a/doc/Makefile.in b/doc/Makefile.in index 79a4760b..5e9d536f 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -82,7 +82,6 @@ GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@ GINACLIB_VERSION = @GINACLIB_VERSION@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ -LD = @LD@ LEX = @LEX@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ @@ -95,7 +94,6 @@ MAINT = @MAINT@ MAKECINT = @MAKECINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ -NM = @NM@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ @@ -274,7 +272,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/doc/reference/Makefile.in b/doc/reference/Makefile.in index 6685e2ee..7d610ec7 100644 --- a/doc/reference/Makefile.in +++ b/doc/reference/Makefile.in @@ -85,7 +85,6 @@ GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@ GINACLIB_VERSION = @GINACLIB_VERSION@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ -LD = @LD@ LEX = @LEX@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ @@ -98,7 +97,6 @@ MAINT = @MAINT@ MAKECINT = @MAKECINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ -NM = @NM@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ @@ -170,7 +168,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/doc/tutorial/Makefile.in b/doc/tutorial/Makefile.in index 25574293..2bad576a 100644 --- a/doc/tutorial/Makefile.in +++ b/doc/tutorial/Makefile.in @@ -84,7 +84,6 @@ GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@ GINACLIB_VERSION = @GINACLIB_VERSION@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ -LD = @LD@ LEX = @LEX@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ @@ -97,7 +96,6 @@ MAINT = @MAINT@ MAKECINT = @MAKECINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ -NM = @NM@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ @@ -327,7 +325,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/ginac/Makefile.in b/ginac/Makefile.in index 1911f6c9..4677e726 100644 --- a/ginac/Makefile.in +++ b/ginac/Makefile.in @@ -82,7 +82,6 @@ GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@ GINACLIB_VERSION = @GINACLIB_VERSION@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ -LD = @LD@ LEX = @LEX@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ @@ -95,7 +94,6 @@ MAINT = @MAINT@ MAKECINT = @MAKECINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ -NM = @NM@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ @@ -316,7 +314,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/ginac/matrix.cpp b/ginac/matrix.cpp index 54917a27..1c4b6dd5 100644 --- a/ginac/matrix.cpp +++ b/ginac/matrix.cpp @@ -649,28 +649,6 @@ matrix matrix::inverse(void) const } -// superfluous helper function, to be removed: -void matrix::ffe_swap(unsigned r1, unsigned c1, unsigned r2 ,unsigned c2) -{ - ensure_if_modifiable(); - - ex tmp = ffe_get(r1,c1); - ffe_set(r1,c1,ffe_get(r2,c2)); - ffe_set(r2,c2,tmp); -} - -// superfluous helper function, to be removed: -void matrix::ffe_set(unsigned r, unsigned c, ex e) -{ - set(r-1,c-1,e); -} - -// superfluous helper function, to be removed: -ex matrix::ffe_get(unsigned r, unsigned c) const -{ - return operator()(r-1,c-1); -} - /** Solve a set of equations for an m x n matrix by fraction-free Gaussian * elimination. Based on algorithm 9.1 from 'Algorithms for Computer Algebra' * by Keith O. Geddes et al. @@ -694,52 +672,46 @@ matrix matrix::fraction_free_elim(const matrix & vars, unsigned n = a.col; int sign = 1; ex divisor = 1; - unsigned r = 1; + unsigned r = 0; // eliminate below row r, with pivot in column k - for (unsigned k=1; (k<=n)&&(r<=m); ++k) { + for (unsigned k=0; (k0; --r) { + for (int r=m-1; r>=0; --r) { unsigned first_non_zero = 1; - while ((first_non_zero<=n)&&(a.ffe_get(r,first_non_zero).is_zero())) + while ((first_non_zero<=n)&&(a.m[r*a.cols()+(first_non_zero-1)].is_zero())) first_non_zero++; if (first_non_zero>n) { // row consists only of zeroes, corresponding rhs must be 0 as well - if (!b.ffe_get(r,1).is_zero()) { + if (!b.m[r*b.cols()].is_zero()) { throw (std::runtime_error("matrix::fraction_free_elim(): singular matrix")); } } else { // assign solutions for vars between first_non_zero+1 and // last_assigned_sol-1: free parameters - for (unsigned c=first_non_zero+1; c<=last_assigned_sol-1; ++c) { - sol.ffe_set(c,1,vars.ffe_get(c,1)); - } - ex e = b.ffe_get(r,1); - for (unsigned c=first_non_zero+1; c<=n; ++c) { - e=e-a.ffe_get(r,c)*sol.ffe_get(c,1); - } - sol.ffe_set(first_non_zero,1, - (e/a.ffe_get(r,first_non_zero)).normal()); + for (unsigned c=first_non_zero; c