diff options
author | fluffy <fluffy@FreeBSD.org> | 2010-01-18 11:40:48 +0800 |
---|---|---|
committer | fluffy <fluffy@FreeBSD.org> | 2010-01-18 11:40:48 +0800 |
commit | add65bf2f016780b89cc51baff7e049c6beed0ed (patch) | |
tree | 3c355e5b1fd2ba98bb763b192ef6f824ad5e1b59 /accessibility/speech-dispatcher | |
parent | de7a83e4fd07adae97a67dd55f826a67f7ffc0f4 (diff) | |
download | freebsd-ports-gnome-add65bf2f016780b89cc51baff7e049c6beed0ed.tar.gz freebsd-ports-gnome-add65bf2f016780b89cc51baff7e049c6beed0ed.tar.zst freebsd-ports-gnome-add65bf2f016780b89cc51baff7e049c6beed0ed.zip |
- speech-dispatcher: try fix building on FreeBSD < 8.0
PR: 142869
Submitted by: Alberto Villa (maintainer)
Approved by: miwi, tabthorpe (mentors implicit)
Diffstat (limited to 'accessibility/speech-dispatcher')
8 files changed, 301 insertions, 1 deletions
diff --git a/accessibility/speech-dispatcher/Makefile b/accessibility/speech-dispatcher/Makefile index bb6fa63c0eeb..d3e1295d82d5 100644 --- a/accessibility/speech-dispatcher/Makefile +++ b/accessibility/speech-dispatcher/Makefile @@ -84,7 +84,16 @@ CONFIGURE_ARGS+= --with-pulseaudio CONFIGURE_ARGS+= --without-pulseaudio .endif -pre-patch: +.if ${OSVERSION} < 800000 +EXTRA_PATCHES= ${FILESDIR}/extrapatch-* +.endif + +post-extract: +.if ${OSVERSION} < 800000 + ${CP} ${FILESDIR}/getline.* ${WRKSRC}/src +.endif + +post-patch: @${REINPLACE_CMD} -e 's/-pthread/${PTHREAD_LIBS}/g' \ ${WRKSRC}/ltmain.sh @${REINPLACE_CMD} -e 's/-lpthread/${PTHREAD_LIBS}/g' \ diff --git a/accessibility/speech-dispatcher/files/extrapatch-src-c-api-Makefile.in b/accessibility/speech-dispatcher/files/extrapatch-src-c-api-Makefile.in new file mode 100644 index 000000000000..8e2c746da1e8 --- /dev/null +++ b/accessibility/speech-dispatcher/files/extrapatch-src-c-api-Makefile.in @@ -0,0 +1,11 @@ +--- src/c/api/Makefile.in.orig 2010-01-15 19:51:09.284466853 +0100 ++++ src/c/api/Makefile.in 2010-01-15 19:51:42.602485219 +0100 +@@ -54,7 +54,7 @@ + libLTLIBRARIES_INSTALL = $(INSTALL) + LTLIBRARIES = $(lib_LTLIBRARIES) + libspeechd_la_DEPENDENCIES = +-am_libspeechd_la_OBJECTS = libspeechd.lo ++am_libspeechd_la_OBJECTS = libspeechd.lo ../../getline.$(OBJEXT) + libspeechd_la_OBJECTS = $(am_libspeechd_la_OBJECTS) + libspeechd_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ diff --git a/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-say-Makefile.in b/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-say-Makefile.in new file mode 100644 index 000000000000..c6f47f19e91b --- /dev/null +++ b/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-say-Makefile.in @@ -0,0 +1,11 @@ +--- src/c/clients/say/Makefile.in.orig 2010-01-15 19:45:48.339555703 +0100 ++++ src/c/clients/say/Makefile.in 2010-01-15 19:46:05.488979035 +0100 +@@ -45,7 +45,7 @@ + am__installdirs = "$(DESTDIR)$(bindir)" + binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) + PROGRAMS = $(bin_PROGRAMS) +-am_spd_say_OBJECTS = say.$(OBJEXT) options.$(OBJEXT) ++am_spd_say_OBJECTS = say.$(OBJEXT) options.$(OBJEXT) ../../../getline.$(OBJEXT) + spd_say_OBJECTS = $(am_spd_say_OBJECTS) + spd_say_DEPENDENCIES = $(c_api)/libspeechd.la + DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) diff --git a/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-spdsend-Makefile.in b/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-spdsend-Makefile.in new file mode 100644 index 000000000000..d341bef54366 --- /dev/null +++ b/accessibility/speech-dispatcher/files/extrapatch-src-c-clients-spdsend-Makefile.in @@ -0,0 +1,11 @@ +--- src/c/clients/spdsend/Makefile.in.orig 2010-01-15 19:46:14.737593506 +0100 ++++ src/c/clients/spdsend/Makefile.in 2010-01-15 19:46:29.284418153 +0100 +@@ -47,7 +47,7 @@ + binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) + PROGRAMS = $(bin_PROGRAMS) + am_spdsend_OBJECTS = spdsend.$(OBJEXT) server.$(OBJEXT) \ +- client.$(OBJEXT) common.$(OBJEXT) ++ client.$(OBJEXT) common.$(OBJEXT) ../../../getline.$(OBJEXT) + spdsend_OBJECTS = $(am_spdsend_OBJECTS) + spdsend_DEPENDENCIES = + DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) diff --git a/accessibility/speech-dispatcher/files/extrapatch-src-modules-Makefile.in b/accessibility/speech-dispatcher/files/extrapatch-src-modules-Makefile.in new file mode 100644 index 000000000000..244e2c80f004 --- /dev/null +++ b/accessibility/speech-dispatcher/files/extrapatch-src-modules-Makefile.in @@ -0,0 +1,55 @@ +--- src/modules/Makefile.in.orig 2010-01-15 19:47:30.277280590 +0100 ++++ src/modules/Makefile.in 2010-01-15 19:49:05.729978711 +0100 +@@ -57,44 +57,44 @@ + "$(DESTDIR)$(snddatadir)" + modulebinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) + PROGRAMS = $(modulebin_PROGRAMS) +-am_sd_cicero_OBJECTS = cicero.$(OBJEXT) module_utils.$(OBJEXT) ++am_sd_cicero_OBJECTS = cicero.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT) + sd_cicero_OBJECTS = $(am_sd_cicero_OBJECTS) + sd_cicero_DEPENDENCIES = +-am_sd_dummy_OBJECTS = dummy.$(OBJEXT) module_utils.$(OBJEXT) ++am_sd_dummy_OBJECTS = dummy.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT) + sd_dummy_OBJECTS = $(am_sd_dummy_OBJECTS) + sd_dummy_DEPENDENCIES = + sd_dummy_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(sd_dummy_LDFLAGS) \ + $(LDFLAGS) -o $@ +-am_sd_espeak_OBJECTS = espeak.$(OBJEXT) module_utils.$(OBJEXT) ++am_sd_espeak_OBJECTS = espeak.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT) + sd_espeak_OBJECTS = $(am_sd_espeak_OBJECTS) + sd_espeak_DEPENDENCIES = + sd_espeak_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(sd_espeak_LDFLAGS) $(LDFLAGS) -o $@ +-am_sd_festival_OBJECTS = festival.$(OBJEXT) module_utils.$(OBJEXT) ++am_sd_festival_OBJECTS = festival.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT) + sd_festival_OBJECTS = $(am_sd_festival_OBJECTS) + sd_festival_DEPENDENCIES = + sd_festival_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(sd_festival_LDFLAGS) $(LDFLAGS) -o $@ +-am_sd_flite_OBJECTS = flite.$(OBJEXT) module_utils.$(OBJEXT) ++am_sd_flite_OBJECTS = flite.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT) + sd_flite_OBJECTS = $(am_sd_flite_OBJECTS) + am__DEPENDENCIES_1 = + sd_flite_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + sd_flite_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(sd_flite_LDFLAGS) \ + $(LDFLAGS) -o $@ +-am_sd_generic_OBJECTS = generic.$(OBJEXT) module_utils.$(OBJEXT) ++am_sd_generic_OBJECTS = generic.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT) + sd_generic_OBJECTS = $(am_sd_generic_OBJECTS) + sd_generic_DEPENDENCIES = +-am_sd_ibmtts_OBJECTS = ibmtts.$(OBJEXT) module_utils.$(OBJEXT) ++am_sd_ibmtts_OBJECTS = ibmtts.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT) + sd_ibmtts_OBJECTS = $(am_sd_ibmtts_OBJECTS) + sd_ibmtts_DEPENDENCIES = + sd_ibmtts_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(sd_ibmtts_LDFLAGS) $(LDFLAGS) -o $@ +-am_sd_ivona_OBJECTS = ivona.$(OBJEXT) module_utils.$(OBJEXT) ++am_sd_ivona_OBJECTS = ivona.$(OBJEXT) module_utils.$(OBJEXT) ../getline.$(OBJEXT) + sd_ivona_OBJECTS = $(am_sd_ivona_OBJECTS) + sd_ivona_DEPENDENCIES = + sd_ivona_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ diff --git a/accessibility/speech-dispatcher/files/extrapatch-src-server-Makefile.in b/accessibility/speech-dispatcher/files/extrapatch-src-server-Makefile.in new file mode 100644 index 000000000000..dab5b4e2c802 --- /dev/null +++ b/accessibility/speech-dispatcher/files/extrapatch-src-server-Makefile.in @@ -0,0 +1,11 @@ +--- src/server/Makefile.in.orig 2010-01-15 19:44:32.014987477 +0100 ++++ src/server/Makefile.in 2010-01-15 19:44:56.313346422 +0100 +@@ -50,7 +50,7 @@ + parse.$(OBJEXT) set.$(OBJEXT) alloc.$(OBJEXT) \ + compare.$(OBJEXT) speaking.$(OBJEXT) options.$(OBJEXT) \ + output.$(OBJEXT) sem_functions.$(OBJEXT) \ +- index_marking.$(OBJEXT) ++ index_marking.$(OBJEXT) ../getline.$(OBJEXT) + speech_dispatcher_OBJECTS = $(am_speech_dispatcher_OBJECTS) + speech_dispatcher_DEPENDENCIES = + speech_dispatcher_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ diff --git a/accessibility/speech-dispatcher/files/getline.c b/accessibility/speech-dispatcher/files/getline.c new file mode 100644 index 000000000000..8a38b2e9df7a --- /dev/null +++ b/accessibility/speech-dispatcher/files/getline.c @@ -0,0 +1,169 @@ +/* getline.c -- Replacement for GNU C library function getline + +Copyright (C) 1993 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. */ + +/* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <sys/types.h> +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> +#include <errno.h> +#include "getline.h" + +/* Always add at least this many bytes when extending the buffer. */ +#define MIN_CHUNK 64 + +/* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR + + OFFSET (and null-terminate it). If LIMIT is non-negative, then + read no more than LIMIT chars. + + *LINEPTR is a pointer returned from malloc (or NULL), pointing to + *N characters of space. It is realloc'd as necessary. + + Return the number of characters read (not including the null + terminator), or -1 on error or EOF. On a -1 return, the caller + should check feof(), if not then errno has been set to indicate the + error. */ + +int +getstr (lineptr, n, stream, terminator, offset, limit) + char **lineptr; + size_t *n; + FILE *stream; + int terminator; + int offset; + int limit; +{ + int nchars_avail; /* Allocated but unused chars in *LINEPTR. */ + char *read_pos; /* Where we're reading into *LINEPTR. */ + int ret; + + if (!lineptr || !n || !stream) + { + errno = EINVAL; + return -1; + } + + if (!*lineptr) + { + *n = MIN_CHUNK; + *lineptr = malloc (*n); + if (!*lineptr) + { + errno = ENOMEM; + return -1; + } + *lineptr[0] = '\0'; + } + + nchars_avail = *n - offset; + read_pos = *lineptr + offset; + + for (;;) + { + int save_errno; + register int c; + + if (limit == 0) + break; + else + { + c = getc (stream); + + /* If limit is negative, then we shouldn't pay attention to + it, so decrement only if positive. */ + if (limit > 0) + limit--; + } + + save_errno = errno; + + /* We always want at least one char left in the buffer, since we + always (unless we get an error while reading the first char) + NUL-terminate the line buffer. */ + + assert((*lineptr + *n) == (read_pos + nchars_avail)); + if (nchars_avail < 2) + { + if (*n > MIN_CHUNK) + *n *= 2; + else + *n += MIN_CHUNK; + + nchars_avail = *n + *lineptr - read_pos; + *lineptr = realloc (*lineptr, *n); + if (!*lineptr) + { + errno = ENOMEM; + return -1; + } + read_pos = *n - nchars_avail + *lineptr; + assert((*lineptr + *n) == (read_pos + nchars_avail)); + } + + if (ferror (stream)) + { + /* Might like to return partial line, but there is no + place for us to store errno. And we don't want to just + lose errno. */ + errno = save_errno; + return -1; + } + + if (c == EOF) + { + /* Return partial line, if any. */ + if (read_pos == *lineptr) + return -1; + else + break; + } + + *read_pos++ = c; + nchars_avail--; + + if (c == terminator) + /* Return the line. */ + break; + } + + /* Done - NUL terminate and return the number of chars read. */ + *read_pos = '\0'; + + ret = read_pos - (*lineptr + offset); + return ret; +} + +int +getline (lineptr, n, stream) + char **lineptr; + size_t *n; + FILE *stream; +{ + return getstr (lineptr, n, stream, '\n', 0, GETLINE_NO_LIMIT); +} + +int +getline_safe (lineptr, n, stream, limit) + char **lineptr; + size_t *n; + FILE *stream; + int limit; +{ + return getstr (lineptr, n, stream, '\n', 0, limit); +} diff --git a/accessibility/speech-dispatcher/files/getline.h b/accessibility/speech-dispatcher/files/getline.h new file mode 100644 index 000000000000..3bbad5698eb3 --- /dev/null +++ b/accessibility/speech-dispatcher/files/getline.h @@ -0,0 +1,23 @@ +#ifndef _getline_h_ +#define _getline_h_ 1 + +#include <stdio.h> + +#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) +#define __PROTO(args) args +#else +#define __PROTO(args) () +#endif /* GCC. */ + +#define GETLINE_NO_LIMIT -1 + +int + getline __PROTO ((char **_lineptr, size_t *_n, FILE *_stream)); +int + getline_safe __PROTO ((char **_lineptr, size_t *_n, FILE *_stream, + int limit)); +int + getstr __PROTO ((char **_lineptr, size_t *_n, FILE *_stream, + int _terminator, int _offset, int limit)); + +#endif /* _getline_h_ */ |