diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2007-12-10 22:29:47 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2007-12-10 22:29:47 +0000 |
commit | 72e8535d7a3d85419cc22db44eae481834e69afc (patch) | |
tree | b6cb86094912efd70f4f947b3d2821fb10bad4b8 /audio/sphinx | |
parent | - Fix build with GCC 4.2 (diff) |
- Fix build with gcc 4.2
PR: 118467
Submitted by: Pietro Cerutti <gahr@gahr.ch>
Approved by: portmgr (erwin)
Notes
Notes:
svn path=/head/; revision=202932
Diffstat (limited to 'audio/sphinx')
-rw-r--r-- | audio/sphinx/Makefile | 21 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-examples_clicore.c | 11 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-examples_srvcore.c | 11 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2-include_pconf.h | 8 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2_blk_cdcn_norm.c | 37 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2_cdcn_norm.c | 27 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2_eht_quit.c | 10 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2_err.c | 10 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2_linklist.c | 19 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2_prime.c | 9 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2_r_agc_noise.c | 10 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2_sc_vq.c | 10 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2_search.c | 28 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src-libsphinx2fe_fe_sigproc.c | 11 | ||||
-rw-r--r-- | audio/sphinx/files/patch-src_libsphinx2_cdcn_update.c | 34 |
15 files changed, 235 insertions, 21 deletions
diff --git a/audio/sphinx/Makefile b/audio/sphinx/Makefile index 6dacca1dd414..0b5fade4d2e7 100644 --- a/audio/sphinx/Makefile +++ b/audio/sphinx/Makefile @@ -17,19 +17,22 @@ MAINTAINER= ports@FreeBSD.org COMMENT= Speech recognition system DEST= ${WRKSRC}/src/libsphinx2/ -GNU_CONFIGURE= yes USE_LDCONFIG= yes PKGMESSAGE= ${WRKDIR}/pkg-message USE_GMAKE= yes +USE_AUTOTOOLS=libtool:15 # contains i386 sound code ONLY_FOR_ARCHS= i386 post-patch: -.for ii in CM_funcs.c hash.c linklist.c list.c salloc.c - ${MV} ${DEST}${ii} ${DEST}${ii}.orig - ${SED} -e "s:<malloc.h>:<stdlib.h>:g" < ${DEST}${ii}.orig > ${DEST}${ii} -.endfor + @${REINPLACE_CMD} -e 's:<malloc.h>:<stdlib.h>:g' \ + ${WRKSRC}/src/libsphinx2/CM_funcs.c \ + ${WRKSRC}/src/libsphinx2/hash.c \ + ${WRKSRC}/src/libsphinx2/list.c \ + ${WRKSRC}/src/libsphinx2/salloc.c + @${REINPLACE_CMD} -e 's|echo aout|echo elf|g' \ + ${WRKSRC}/configure post-build: ${ECHO_CMD} "*** WARNING ***" > ${PKGMESSAGE} @@ -40,10 +43,4 @@ post-build: pre-install: ${CAT} ${PKGMESSAGE} -.include <bsd.port.pre.mk> - -.if ${OSVERSION} >= 700042 -BROKEN= Does not compile with GCC 4.2 -.endif - -.include <bsd.port.post.mk> +.include <bsd.port.mk> diff --git a/audio/sphinx/files/patch-src-examples_clicore.c b/audio/sphinx/files/patch-src-examples_clicore.c new file mode 100644 index 000000000000..1013ddc46861 --- /dev/null +++ b/audio/sphinx/files/patch-src-examples_clicore.c @@ -0,0 +1,11 @@ +--- src/examples/clicore.c.orig 2007-12-06 18:36:24.000000000 +0100 ++++ src/examples/clicore.c 2007-12-06 18:36:39.000000000 +0100 +@@ -323,7 +323,7 @@ + memcpy (&addr.sin_addr, hp->h_addr, hp->h_length); + addr.sin_port = htons((u_short) port); + +- if (connect (conn_sd, &addr, sizeof(addr)) == 0) ++ if (connect (conn_sd, (struct sockaddr *)&addr, sizeof(addr)) == 0) + break; + print_errno ("connect"); + cli_close (conn_sd); diff --git a/audio/sphinx/files/patch-src-examples_srvcore.c b/audio/sphinx/files/patch-src-examples_srvcore.c new file mode 100644 index 000000000000..56fc3511d83b --- /dev/null +++ b/audio/sphinx/files/patch-src-examples_srvcore.c @@ -0,0 +1,11 @@ +--- src/examples/srvcore.c.orig 2007-12-06 18:35:25.000000000 +0100 ++++ src/examples/srvcore.c 2007-12-06 18:35:56.000000000 +0100 +@@ -381,7 +381,7 @@ + + ERRLOG((stderr, "%s(%d): Listening at port %d\n", __FILE__, __LINE__, bindport)); + +- if ((conn_sd = accept (listen_sd, &address, &address_len)) == INVALID_SOCKET) { ++ if ((conn_sd = accept (listen_sd, (struct sockaddr *)&address, &address_len)) == INVALID_SOCKET) { + print_errno ("conn_accept"); + return INVALID_SOCKET; + } diff --git a/audio/sphinx/files/patch-src-libsphinx2-include_pconf.h b/audio/sphinx/files/patch-src-libsphinx2-include_pconf.h new file mode 100644 index 000000000000..d7646e067e0c --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2-include_pconf.h @@ -0,0 +1,8 @@ +--- src/libsphinx2/include/pconf.h.orig 2007-12-06 18:24:09.000000000 +0100 ++++ src/libsphinx2/include/pconf.h 2007-12-06 18:24:20.000000000 +0100 +@@ -124,4 +124,4 @@ + char * (*GetDefault)(char const *, char const *), char last); + void pusage(char *prog, Config_t *cp); + +-#endif _PCONF_ ++#endif diff --git a/audio/sphinx/files/patch-src-libsphinx2_blk_cdcn_norm.c b/audio/sphinx/files/patch-src-libsphinx2_blk_cdcn_norm.c new file mode 100644 index 000000000000..90a67a62cf1b --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2_blk_cdcn_norm.c @@ -0,0 +1,37 @@ +--- src/libsphinx2/blk_cdcn_norm.c.orig 2007-12-06 19:23:43.000000000 +0100 ++++ src/libsphinx2/blk_cdcn_norm.c 2007-12-06 19:23:25.000000000 +0100 +@@ -36,6 +36,18 @@ + #include <math.h> + #include "cdcn.h" + ++static void ++block_actual_cdcn_norm(float variance[][NUM_COEFF+1], /* Speech cepstral variances of modes */ ++ float *prob, /* Ratio of a-prori mode probs. to mod variance */ ++ float *tilt, /* Spectral tilt cepstrum */ ++ float *noise, /* Noise estimate */ ++ float means[][NUM_COEFF+1], /* The cepstrum codebook */ ++ float corrbook[][NUM_COEFF+1], /* The correction factor's codebook */ ++ int num_codes, /* Number of codewords in codebook */ ++ float z[][NUM_COEFF+1], /* The input cepstrum */ ++ int num_frames); /* Number of frames in utterance */ ++ ++ + /************************************************************************ + * Dummy routine to convert from suitcase to sane varibles + ***************************************************************************/ +@@ -46,7 +58,6 @@ + { + /* Multidimensional arrays in C suck, so we have to + forward-declare-hack this. */ +- static void block_actual_cdcn_norm(); + float *variance, *prob, *tilt, *noise, *codebook, *corrbook; + int num_codes; + +@@ -88,7 +99,6 @@ + * Coded by Alex Acero (acero@s), November 1989 + * + *************************************************************************/ +- + static void + block_actual_cdcn_norm(float variance[][NUM_COEFF+1], /* Speech cepstral variances of modes */ + float *prob, /* Ratio of a-prori mode probs. to mod variance */ diff --git a/audio/sphinx/files/patch-src-libsphinx2_cdcn_norm.c b/audio/sphinx/files/patch-src-libsphinx2_cdcn_norm.c new file mode 100644 index 000000000000..df6ab3080271 --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2_cdcn_norm.c @@ -0,0 +1,27 @@ +--- src/libsphinx2/cdcn_norm.c.orig 2007-12-06 19:24:33.000000000 +0100 ++++ src/libsphinx2/cdcn_norm.c 2007-12-06 19:26:24.000000000 +0100 +@@ -35,6 +35,15 @@ + */ + #include <math.h> + #include "cdcn.h" ++static void ++actual_cdcn_norm(float variance[][NUM_COEFF+1], /* Speech cepstral variances of modes */ ++ float *prob, /* Ratio of a-prori mode probs. to mod variance */ ++ float *tilt, /* Spectral tilt cepstrum */ ++ float *noise, /* Noise estimate */ ++ float means[][NUM_COEFF+1], /* The cepstrum codebook */ ++ float corrbook[][NUM_COEFF+1], /* The correction factor's codebook */ ++ int num_codes, /* Number of codewords in codebook */ ++ float z[NUM_COEFF+1]); /* The input cepstrum */ + + /************************************************************************ + * Dummy routine to convert from suitcase to sane varibles +@@ -43,8 +52,6 @@ + void cdcn_norm (float z[NUM_COEFF+1], /* The input cepstrum */ + CDCN_type *cdcn_variables) + { +- /* Multidimensional arrays, yuck. */ +- static void actual_cdcn_norm(); + float *variance, *prob, *tilt, *noise, *codebook, *corrbook; + int num_codes; + diff --git a/audio/sphinx/files/patch-src-libsphinx2_eht_quit.c b/audio/sphinx/files/patch-src-libsphinx2_eht_quit.c new file mode 100644 index 000000000000..c3c2650101bb --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2_eht_quit.c @@ -0,0 +1,10 @@ +--- src/libsphinx2/eht_quit.c.orig 2007-12-06 18:21:53.000000000 +0100 ++++ src/libsphinx2/eht_quit.c 2007-12-06 18:22:13.000000000 +0100 +@@ -85,6 +85,7 @@ + */ + + #include <stdio.h> ++#include <stdlib.h> + #include <stdarg.h> + + void diff --git a/audio/sphinx/files/patch-src-libsphinx2_err.c b/audio/sphinx/files/patch-src-libsphinx2_err.c new file mode 100644 index 000000000000..84d9d2fb6aa8 --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2_err.c @@ -0,0 +1,10 @@ +--- src/libsphinx2/err.c.orig 2007-12-06 18:22:49.000000000 +0100 ++++ src/libsphinx2/err.c 2007-12-06 18:23:27.000000000 +0100 +@@ -49,6 +49,7 @@ + */ + + #include <stdio.h> ++#include <stdlib.h> + #if ((! WIN32) && (! _SGI_SOURCE)) + #include <sys/errno.h> + #else diff --git a/audio/sphinx/files/patch-src-libsphinx2_linklist.c b/audio/sphinx/files/patch-src-libsphinx2_linklist.c new file mode 100644 index 000000000000..c6f3eb4c5692 --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2_linklist.c @@ -0,0 +1,19 @@ +--- src/libsphinx2/linklist.c.orig 2007-12-06 18:25:48.000000000 +0100 ++++ src/libsphinx2/linklist.c 2007-12-06 18:27:00.000000000 +0100 +@@ -81,7 +81,6 @@ + + #include <stdio.h> + #include <stdlib.h> +-#include <malloc.h> + + #include "s2types.h" + +@@ -132,7 +131,7 @@ + cpp = list[i].freelist = (void **) malloc (list[i].n_malloc * elem_size); + cp = (void *) cpp; + for (j = list[i].n_malloc-1; j > 0; --j) { +- (char*)cp += elem_size; ++ cp += elem_size; + *cpp = cp; + cpp = (void **)cp; + } diff --git a/audio/sphinx/files/patch-src-libsphinx2_prime.c b/audio/sphinx/files/patch-src-libsphinx2_prime.c new file mode 100644 index 000000000000..824091bf1bbc --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2_prime.c @@ -0,0 +1,9 @@ +--- src/libsphinx2/prime.c.orig 2007-12-06 18:27:41.000000000 +0100 ++++ src/libsphinx2/prime.c 2007-12-06 18:27:51.000000000 +0100 +@@ -75,5 +75,4 @@ + } + } + +-#endif MAIN +- ++#endif diff --git a/audio/sphinx/files/patch-src-libsphinx2_r_agc_noise.c b/audio/sphinx/files/patch-src-libsphinx2_r_agc_noise.c new file mode 100644 index 000000000000..e0465672944a --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2_r_agc_noise.c @@ -0,0 +1,10 @@ +--- src/libsphinx2/r_agc_noise.c.orig 2007-12-06 18:28:21.000000000 +0100 ++++ src/libsphinx2/r_agc_noise.c 2007-12-06 18:28:49.000000000 +0100 +@@ -34,6 +34,7 @@ + * + */ + #include <stdio.h> ++#include <string.h> + + #include "s2types.h" + #include "c.h" diff --git a/audio/sphinx/files/patch-src-libsphinx2_sc_vq.c b/audio/sphinx/files/patch-src-libsphinx2_sc_vq.c new file mode 100644 index 000000000000..07d5965ad3cc --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2_sc_vq.c @@ -0,0 +1,10 @@ +--- src/libsphinx2/sc_vq.c.orig 2007-12-06 18:38:16.000000000 +0100 ++++ src/libsphinx2/sc_vq.c 2007-12-06 18:38:36.000000000 +0100 +@@ -64,6 +64,7 @@ + + #include <stdio.h> + #include <stdlib.h> ++#include <string.h> + #include <assert.h> + #include <limits.h> + diff --git a/audio/sphinx/files/patch-src-libsphinx2_search.c b/audio/sphinx/files/patch-src-libsphinx2_search.c new file mode 100644 index 000000000000..1d6f423d4bcf --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2_search.c @@ -0,0 +1,28 @@ +--- src/libsphinx2/search.c.orig 2007-12-06 18:29:23.000000000 +0100 ++++ src/libsphinx2/search.c 2007-12-06 18:33:21.000000000 +0100 +@@ -2236,6 +2236,9 @@ + lm_next_frame (); + } + ++static void compute_phone_perplexity( void ); ++static search_hyp_t *fwdtree_pscr_path ( void ); ++ + void + search_finish_fwd (void) + { +@@ -2245,7 +2248,6 @@ + CHAN_T *hmm, /* *thmm,*/ **acl; + /* int32 bp, bestbp, bestscore; */ + /* int32 l_scr; */ +- static void compute_phone_perplexity( void ); + + if ((CurrentFrame > 0) && (topsen_window > 1)) { + /* Wind up remaining frames */ +@@ -2306,7 +2308,6 @@ + /* Get pscr-score for fwdtree recognition */ + { + search_hyp_t *pscrpath; +- static search_hyp_t *fwdtree_pscr_path ( void ); + + if (query_phone_conf ()) { + pscrpath = fwdtree_pscr_path (); diff --git a/audio/sphinx/files/patch-src-libsphinx2fe_fe_sigproc.c b/audio/sphinx/files/patch-src-libsphinx2fe_fe_sigproc.c new file mode 100644 index 000000000000..20c16850739b --- /dev/null +++ b/audio/sphinx/files/patch-src-libsphinx2fe_fe_sigproc.c @@ -0,0 +1,11 @@ +--- src/libsphinx2fe/fe_sigproc.c.orig 2007-12-06 18:34:10.000000000 +0100 ++++ src/libsphinx2fe/fe_sigproc.c 2007-12-06 18:34:25.000000000 +0100 +@@ -43,7 +43,7 @@ +
+ #ifndef M_PI
+ #define M_PI (3.14159265358979323846)
+-#endif M_PI
++#endif
+
+ #define FORWARD_FFT 1
+ #define INVERSE_FFT -1
diff --git a/audio/sphinx/files/patch-src_libsphinx2_cdcn_update.c b/audio/sphinx/files/patch-src_libsphinx2_cdcn_update.c index 138111ef6bc6..5d1168421715 100644 --- a/audio/sphinx/files/patch-src_libsphinx2_cdcn_update.c +++ b/audio/sphinx/files/patch-src_libsphinx2_cdcn_update.c @@ -1,13 +1,29 @@ ---- src/libsphinx2/cdcn_update.c.orig Fri Sep 17 14:17:51 2004 -+++ src/libsphinx2/cdcn_update.c Fri Sep 17 14:26:32 2004 -@@ -57,8 +57,8 @@ +--- src/libsphinx2/cdcn_update.c.orig 2001-12-13 22:11:20.000000000 +0100 ++++ src/libsphinx2/cdcn_update.c 2007-12-06 19:40:02.000000000 +0100 +@@ -47,6 +47,11 @@ + * Modified by Uday Jain, June 95 + * + *************************************************************************/ ++static float initialize (float [][NUM_COEFF+1], int, float *, float *, float, ++ float [][NUM_COEFF+1], float *, float [][NUM_COEFF+1], int); ++static void correction(float *, float *, float *, float *, int); ++static float max_q (float *, float *, float *, float *, float *, ++ float *, int, float *, int); + + float + cdcn_update (float *z, /* The observed cepstrum vectors */ +@@ -56,13 +61,7 @@ + float distortion; float *noise, *tilt, *codebook, *prob, *variance, *corrbook; int num_codes; - /* Multidimensional arrays, gar gar gar */ +- /* Multidimensional arrays, gar gar gar */ - static float initialize (float *, int, float *, float *, float, - float *, float *, float *, int); -+ static float initialize (float [][NUM_COEFF+1], int, float *, float *, float, -+ float [][NUM_COEFF+1], float *, float [][NUM_COEFF+1], int); - static void correction(float *, float *, float *, float *, int); - static float max_q (float *, float *, float *, float *, float *, - float *, int, float *, int); +- static void correction(float *, float *, float *, float *, int); +- static float max_q (float *, float *, float *, float *, float *, +- float *, int, float *, int); +- ++ + /* + * If error, dont bother + */ |