From 5dfd8dd432785ca8d8b6d2c11bac9e110feda52b Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Tue, 6 Jan 2015 21:44:01 +0200 Subject: Update for Guile 2.0 * .gitmodules: New file * gint: New module. * Makefile.am (ACLOCAL_AMFLAGS, SUBDIRS): Add gint * autogen.sh: Create a placeholder for ChangeLog. * configure.ac: Add gint. * scm/Makefile.am: Add silent rule magic. * src/cgi-bin/Makefile.am: Likewise. * src/ellinika/Makefile.am: Likewise. * xml/Makefile.am: Likewise. * scm/dictrans.scm: Load (ice-9 syncase) only for Guile 1.x * scm/neatrans.scm: Likewise. * src/ellinika/conjugator.scm: Likewise. * src/ellinika/elmorph.c (elstr): Change type to size_t. * xml/pl/Makefile.am: Force UTF-8 locale when building html. Add silent rule magic. * xml/ru/Makefile.am: Likewise. * xml/uk/Makefile.am: Likewise. --- src/cgi-bin/Makefile.am | 48 ++++++++++++++++++----------------- src/ellinika/Makefile.am | 62 ++++++++++++++++++++++----------------------- src/ellinika/conjugator.scm | 3 ++- src/ellinika/elmorph.c | 10 ++++---- src/ellinika/i18n.scm | 1 - 5 files changed, 63 insertions(+), 61 deletions(-) (limited to 'src') diff --git a/src/cgi-bin/Makefile.am b/src/cgi-bin/Makefile.am index 6b32b42..f085e57 100644 --- a/src/cgi-bin/Makefile.am +++ b/src/cgi-bin/Makefile.am @@ -1,5 +1,5 @@ # This file is part of Ellinika project. -# Copyright (C) 2004, 2005, 2007, 2008 Sergey Poznyakoff +# Copyright (C) 2004, 2005, 2007, 2008, 2015 Sergey Poznyakoff # # Ellinika is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,34 +20,36 @@ EXTRA_DIST=dict.scm4 nea.scm4 conj.scm4 CLEANFILES=dict.m4 dict.scm nea.scm dict.cgi nea.cgi conj.cgi dict.m4: Makefile - echo 'divert(-1)' > $@ - echo 'changequote([,])' >> $@ - echo 'changecom([;],[' >> $@ - echo '])' >> $@ - echo 'undefine([format])' >> $@ - echo 'define([IFACE], [$(APACHE_IFACE)])' >> $@ - echo 'define([SCRIPT_SUFFIX], [@SCRIPT_SUFFIX@])'>>$@ - echo 'define([GUILE_BINDIR], [$(GUILE_BINDIR)])' >> $@ - echo 'define([GUILE_SITE], [@GUILE_SITE@])' >> $@ - echo 'define([PACKAGE], [$(PACKAGE)])'>> $@ - echo 'define([PREFIX], [$(prefix)])' >> $@ - echo 'define([SYSCONFDIR], [$(sysconfdir)])' >> $@ - echo 'define([LOCALEDIR], [$(datadir)/locale])' >> $@ - echo 'define([HTMLDIR], [$(HTMLDIR)])' >> $@ - echo 'divert(0)dnl' >> $@ - echo 'ifelse(IFACE,[CGI],[#! $(GUILE_BINDIR)/guile -s]' >> $@ - echo ')dnl' >> $@ - echo '@AUTOGENERATED@' >> $@ - echo 'ifelse(IFACE,[CGI],!#' >> $@ - echo ')dnl' >> $@ + $(AM_V_GEN){ \ + echo 'divert(-1)'; \ + echo 'changequote([,])'; \ + echo 'changecom([;],['; \ + echo '])'; \ + echo 'undefine([format])'; \ + echo 'define([IFACE], [$(APACHE_IFACE)])'; \ + echo 'define([SCRIPT_SUFFIX], [@SCRIPT_SUFFIX@])'; \ + echo 'define([GUILE_BINDIR], [$(GUILE_BINDIR)])'; \ + echo 'define([GUILE_SITE], [@GUILE_SITE@])'; \ + echo 'define([PACKAGE], [$(PACKAGE)])'; \ + echo 'define([PREFIX], [$(prefix)])'; \ + echo 'define([SYSCONFDIR], [$(sysconfdir)])'; \ + echo 'define([LOCALEDIR], [$(datadir)/locale])'; \ + echo 'define([HTMLDIR], [$(HTMLDIR)])'; \ + echo 'divert(0)dnl'; \ + echo 'ifelse(IFACE,[CGI],[#! $(GUILE_BINDIR)/guile -s]';\ + echo ')dnl'; \ + echo '@AUTOGENERATED@'; \ + echo 'ifelse(IFACE,[CGI],!#'; \ + echo ')dnl'; \ + } > dict.m4 SUFFIXES = .scm4 .scm .cgi .scm4.scm: - m4 dict.m4 $< > $@ + $(AM_V_GEN)m4 dict.m4 $< > $@ .scm.cgi: - cp $< $@ + $(AM_V_GEN)cp $< $@ dict.scm: dict.scm4 dict.m4 nea.scm: nea.scm4 dict.m4 diff --git a/src/ellinika/Makefile.am b/src/ellinika/Makefile.am index 12e0392..5f476ef 100644 --- a/src/ellinika/Makefile.am +++ b/src/ellinika/Makefile.am @@ -1,5 +1,5 @@ # This file is part of Ellinika project. -# Copyright (C) 2004,2006,2007,2008,2011 Sergey Poznyakoff +# Copyright (C) 2004, 2006-2008, 2011, 2015 Sergey Poznyakoff # # Ellinika is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,8 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -guiledir=$(GUILE_SITE)/$(PACKAGE) -guile_DATA=\ +sitedir=$(GUILE_SITE)/$(PACKAGE) +site_DATA=\ xlat.scm\ cgi.scm\ i18n.scm\ @@ -27,29 +27,31 @@ guile_DATA=\ conjugator.scm cgi.m4: Makefile - echo 'divert(-1)' > $@ - echo 'changequote([,])' >> $@ - echo 'changecom([;],[' >> $@ - echo '])' >> $@ - echo 'undefine([format])' >> $@ - echo 'define([IFACE],[$(APACHE_IFACE)])' >> $@ - echo 'define([SCRIPT_SUFFIX], [@SCRIPT_SUFFIX@])'>>$@ - echo 'define([GUILE_BINDIR],[$(GUILE_BINDIR)])' >> $@ - echo 'define([GUILE_SITE],[@GUILE_SITE@])' >> $@ - echo 'define([PACKAGE],[$(PACKAGE)])'>> $@ - echo 'define([PREFIX],[$(prefix)])' >> $@ - echo 'define([SYSCONFDIR],[$(sysconfdir)])' >> $@ - echo 'define([LOCALEDIR],[$(datadir)/locale])' >> $@ - echo 'define([HTMLDIR],[$(HTMLDIR)])' >> $@ - echo 'define([VERSION],[$(VERSION)])' >> $@ - echo 'define([LIBDIR],[$(pkglibdir)])' >> $@ - echo 'divert(0)dnl' >> $@ - echo '@AUTOGENERATED@' >> $@ + $(AM_V_GEN){ \ + echo 'divert(-1)'; \ + echo 'changequote([,])'; \ + echo 'changecom([;],['; \ + echo '])'; \ + echo 'undefine([format])'; \ + echo 'define([IFACE],[$(APACHE_IFACE)])'; \ + echo 'define([SCRIPT_SUFFIX], [@SCRIPT_SUFFIX@])'; \ + echo 'define([GUILE_BINDIR],[$(GUILE_BINDIR)])'; \ + echo 'define([GUILE_SITE],[@GUILE_SITE@])'; \ + echo 'define([PACKAGE],[$(PACKAGE)])'; \ + echo 'define([PREFIX],[$(prefix)])'; \ + echo 'define([SYSCONFDIR],[$(sysconfdir)])'; \ + echo 'define([LOCALEDIR],[$(datadir)/locale])'; \ + echo 'define([HTMLDIR],[$(HTMLDIR)])'; \ + echo 'define([VERSION],[$(VERSION)])'; \ + echo 'define([LIBDIR],[$(pkglibdir)])'; \ + echo 'divert(0)dnl'; \ + echo '@AUTOGENERATED@'; \ + } > cgi.m4 SUFFIXES = .scm4 .scm .x .scm4.scm: - m4 -I$(srcdir) cgi.m4 $< > $@ + $(AM_V_GEN)m4 -I$(srcdir) cgi.m4 $< > $@ cgi.scm: cgi.scm4 cgi.m4 config.scm: config.scm4 cgi.m4 @@ -68,17 +70,9 @@ libelmorph_la_SOURCES = \ syllabificator.c DOT_X_FILES = elmorph.x utf8scm.x - BUILT_SOURCES = $(DOT_X_FILES) - DISTCLEANFILES = $(DOT_X_FILES) -snarfcppopts = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - -.c.x: - AWK=$(AWK) \ - guile-snarf -o $@ $< $(snarfcppopts) - pkglibnames=elmorph install-data-hook: @@ -95,4 +89,10 @@ install-data-hook: AM_YFLAGS = -d YACCCOMPILE = $(srcdir)/yyrename '$(YACC) $(YFLAGS) $(AM_YFLAGS)' -EXTRA_DIST = yyrename elmorph-public.scm \ No newline at end of file +EXTRA_DIST = yyrename elmorph-public.scm + +AM_CPPFLAGS=-I. +CLEANFILES= +MAINTAINERCLEANFILES= +include ../../gint/gint.mk + diff --git a/src/ellinika/conjugator.scm b/src/ellinika/conjugator.scm index eae4ad0..f8b1eb0 100644 --- a/src/ellinika/conjugator.scm +++ b/src/ellinika/conjugator.scm @@ -23,7 +23,8 @@ (ellinika tenses) (ellinika sql)) -(use-syntax (ice-9 syncase)) +(if (= (string->number (major-version)) 1) + (use-modules (ice-9 syncase))) ;; Verb info diff --git a/src/ellinika/elmorph.c b/src/ellinika/elmorph.c index a06d43b..5094db8 100644 --- a/src/ellinika/elmorph.c +++ b/src/ellinika/elmorph.c @@ -1,5 +1,5 @@ /* This file is part of Ellinika project. - Copyright (C) 2011 Sergey Poznyakoff + Copyright (C) 2011, 2015 Sergey Poznyakoff Ellinika is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,10 +28,10 @@ struct elstr { size_t len; /* Its length */ struct phoneme *phoneme; /* Phonetical map*/ - unsigned phoneme_count; /* Number of phonemes */ + size_t phoneme_count; /* Number of phonemes */ struct syllable *sylmap; /* Syllable map (nsyl elements) */ - unsigned nsyl; /* Number of syllables. */ + size_t nsyl; /* Number of syllables. */ unsigned acc_syl; /* Number of the accented syllable (1-based, from the last syllable) */ unsigned acc_pos; /* Number of the accented character @@ -44,7 +44,7 @@ scm_t_bits _elstr_tag; static void _elstr_syllabize(struct elstr *elstr, const char *func_name) { - unsigned i; + size_t i; free(elstr->phoneme); free(elstr->sylmap); @@ -196,7 +196,7 @@ static int _elstr_print(SCM smob, SCM port, scm_print_state *pstate) { struct elstr *elstr = (struct elstr *) SCM_CDR(smob); - int i, j; + size_t i, j; char *s; scm_puts("# ISO 3166 country code ;;; The corresponding country codes where selected using the following ;;; principles: -- cgit v1.2.1