Thread: [Libxtract-commits] SF.net SVN: libxtract:[121] trunk
Status: Alpha
Brought to you by:
postlude
From: <pos...@us...> - 2008-09-12 13:52:22
|
Revision: 121 http://libxtract.svn.sourceforge.net/libxtract/?rev=121&view=rev Author: postlude Date: 2008-09-12 13:52:20 +0000 (Fri, 12 Sep 2008) Log Message: ----------- - Committing ancient change left on HD. Relates to FFTW fft type Modified Paths: -------------- trunk/configure.in trunk/src/init.c Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2008-05-04 11:02:40 UTC (rev 120) +++ trunk/configure.in 2008-09-12 13:52:20 UTC (rev 121) @@ -5,6 +5,8 @@ m4_define(libxtract_minor_version, 6) # Increment for fixes m4_define(libxtract_fix_version, 1) +# Development status +m4_define(libIntegra_dev_status, [beta]) m4_define(libxtract_version, libxtract_major_version.libxtract_minor_version.libxtract_fix_version) Modified: trunk/src/init.c =================================================================== --- trunk/src/init.c 2008-05-04 11:02:40 UTC (rev 120) +++ trunk/src/init.c 2008-09-12 13:52:20 UTC (rev 121) @@ -187,7 +187,7 @@ if(fft_plans.dct_plan != NULL) fftwf_destroy_plan(fft_plans.dct_plan); fft_plans.dct_plan = - fftwf_plan_r2r_1d(N, input, output, FFTW_REDFT00, optimisation); + fftwf_plan_r2r_1d(N, input, output, FFTW_REDFT10, optimisation); case XTRACT_MFCC: if(fft_plans.dct_plan != NULL) fftwf_destroy_plan(fft_plans.dct_plan); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pos...@us...> - 2010-02-03 22:37:20
|
Revision: 123 http://libxtract.svn.sourceforge.net/libxtract/?rev=123&view=rev Author: postlude Date: 2010-02-03 22:35:13 +0000 (Wed, 03 Feb 2010) Log Message: ----------- - fixed DC/Nyquist inclusion bug in xtract_spectrum() and refactored a bit Modified Paths: -------------- trunk/examples/simpletest/simpletest.c trunk/src/vector.c trunk/src/xtract_macros_private.h trunk/xtract/xtract_helper.h Modified: trunk/examples/simpletest/simpletest.c =================================================================== --- trunk/examples/simpletest/simpletest.c 2008-11-11 11:55:55 UTC (rev 122) +++ trunk/examples/simpletest/simpletest.c 2010-02-03 22:35:13 UTC (rev 123) @@ -23,12 +23,28 @@ int main(void) { - float mean = 0, vector[] = {1, 2, 3}; + float mean = 0, vector[] = {.1, .2, .3, .4, -.5, -.4, -.3, -.2, -.1}, + spectrum[10]; + int n, N = 9; + float argf[4]; + + argf[0] = 8000.f; + argf[1] = XTRACT_MAGNITUDE_SPECTRUM; + argf[2] = 0.f; + argf[3] = 0.f; - xtract[XTRACT_MEAN]((void *)&vector, 3, NULL, (void *)&mean); + xtract[XTRACT_MEAN]((void *)&vector, N, NULL, (void *)&mean); + xtract_init_fft(N, XTRACT_SPECTRUM); + xtract[XTRACT_SPECTRUM]((void *)&vector, N, &argf[0], (void *)&spectrum[0]); - printf("\nThe mean of [1, 2, 3] = %.1f\n\n", mean); - + printf("\nThe mean of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] = %.1f\n\n", mean); + printf("\nResults of xtract_spectrum():\n"); + + for(n = 0; n < N; n++){ + printf("%.3f\t", spectrum[n]); + } + printf("\n"); + return 0; } Modified: trunk/src/vector.c =================================================================== --- trunk/src/vector.c 2008-11-11 11:55:55 UTC (rev 122) +++ trunk/src/vector.c 2010-02-03 22:35:13 UTC (rev 123) @@ -30,27 +30,27 @@ #ifndef roundf float roundf(float f){ - if (f - (int)f >= 0.5) - return (float)((int)f + 1); - else - return (float)((int)f); + if (f - (int)f >= 0.5) + return (float)((int)f + 1); + else + return (float)((int)f); } #endif #ifndef powf - #define powf pow +#define powf pow #endif #ifndef expf - #define expf exp +#define expf exp #endif #ifndef sqrtf - #define sqrtf sqrt +#define sqrtf sqrt #endif #ifndef fabsf - #define fabsf fabs +#define fabsf fabs #endif #ifdef XTRACT_FFT @@ -100,105 +100,70 @@ switch(vector){ - case XTRACT_LOG_MAGNITUDE_SPECTRUM: - for(n = 1; n < M; n++){ - if ((temp = XTRACT_SQ(rfft[n]) + - XTRACT_SQ(rfft[N - n])) > XTRACT_LOG_LIMIT) - temp = logf(sqrtf(temp) / (float)N); - else - temp = XTRACT_LOG_LIMIT_DB; - - if(withDC){ - m = n; - result[M + m + 1] = n * q; + case XTRACT_LOG_MAGNITUDE_SPECTRUM: + for(n = 0, m = 0; m < M; ++n, ++m){ + if(!withDC && n == 0){ + ++n; } - else{ - m = n - 1; - result[M + m] = n * q; - } - - result[m] = + if ((temp = XTRACT_SQ(rfft[n]) + + XTRACT_SQ(rfft[N - n])) > XTRACT_LOG_LIMIT) + temp = logf(sqrtf(temp) / (float)N); + else + temp = XTRACT_LOG_LIMIT_DB; + + result[m] = /* Scaling */ - (temp + XTRACT_DB_SCALE_OFFSET) / - XTRACT_DB_SCALE_OFFSET; - - max = result[m] > max ? result[m] : max; - } - break; + (temp + XTRACT_DB_SCALE_OFFSET) / + XTRACT_DB_SCALE_OFFSET; - case XTRACT_POWER_SPECTRUM: - for(n = 1; n < M; n++){ - if(withDC){ - m = n; - result[M + m + 1] = n * q; + XTRACT_SET_FREQUENCY; + XTRACT_GET_MAX; + } + break; + + case XTRACT_POWER_SPECTRUM: + for(n = 0, m = 0; m < M; ++n, ++m){ + if(!withDC && n == 0){ + ++n; } - else{ - m = n - 1; - result[M + m] = n * q; - } result[m] = (XTRACT_SQ(rfft[n]) + XTRACT_SQ(rfft[N - n])) / NxN; - max = result[m] > max ? result[m] : max; - } - break; + XTRACT_SET_FREQUENCY; + XTRACT_GET_MAX; + } + break; - case XTRACT_LOG_POWER_SPECTRUM: - for(n = 1; n < M; n++){ - if ((temp = XTRACT_SQ(rfft[n]) + XTRACT_SQ(rfft[N - n])) > - XTRACT_LOG_LIMIT) - temp = logf(temp / NxN); - else - temp = XTRACT_LOG_LIMIT_DB; - - if(withDC){ - m = n; - result[M + m + 1] = n * q; + case XTRACT_LOG_POWER_SPECTRUM: + for(n = 0, m = 0; m < M; ++n, ++m){ + if(!withDC && n == 0){ + ++n; } - else{ - m = n - 1; - result[M + m] = n * q; - } + if ((temp = XTRACT_SQ(rfft[n]) + XTRACT_SQ(rfft[N - n])) > + XTRACT_LOG_LIMIT) + temp = logf(temp / NxN); + else + temp = XTRACT_LOG_LIMIT_DB; - result[m] = (temp + XTRACT_DB_SCALE_OFFSET) / - XTRACT_DB_SCALE_OFFSET; - max = result[m] > max ? result[m] : max; - } - break; + result[m] = (temp + XTRACT_DB_SCALE_OFFSET) / + XTRACT_DB_SCALE_OFFSET; + XTRACT_SET_FREQUENCY; + XTRACT_GET_MAX; + } + break; - default: - /* MAGNITUDE_SPECTRUM */ - for(n = 1; n < M; n++){ - if(withDC){ - m = n; - result[M + m + 1] = n * q; + default: + /* MAGNITUDE_SPECTRUM */ + for(n = 0, m = 0; m < M; ++n, ++m){ + if(!withDC && n == 0){ + ++n; } - else{ - m = n - 1; - result[M + m] = n * q; - } - result[m] = sqrtf(XTRACT_SQ(rfft[n]) + - XTRACT_SQ(rfft[N - n])) / (float)N; - max = result[m] > max ? result[m] : max; - } - break; + XTRACT_SQ(rfft[N - n])) / (float)N; + XTRACT_SET_FREQUENCY; + XTRACT_GET_MAX; + } + break; + } - - if(withDC){ - /* The DC component */ - result[0] = XTRACT_SQ(rfft[0]); - result[M + 1] = 0.f; - max = result[0] > max ? result[0] : max; - /* The Nyquist */ - result[M] = XTRACT_SQ(rfft[M]); - result[N + 1] = q * M; - max = result[M] > max ? result[M] : max; - } - else { - /* The Nyquist */ - result[M - 1] = (float)XTRACT_SQ(rfft[M]); - result[N - 1] = q * M; - max = result[M - 1] > max ? result[M - 1] : max; - } if(normalise){ for(n = 0; n < M; n++) @@ -207,12 +172,12 @@ fftwf_free(rfft); free(input); - + return XTRACT_SUCCESS; } int xtract_autocorrelation_fft(const float *data, const int N, const void *argv, float *result){ - + float *freq, *time; int n, M; //fftwf_plan plan; @@ -231,9 +196,9 @@ for(n = 1; n < N; n++){ freq[n] = XTRACT_SQ(freq[n]) + XTRACT_SQ(freq[M - n]); - freq[M - n] = 0.f; + freq[M - n] = 0.f; } - + freq[0] = XTRACT_SQ(freq[0]); freq[N] = XTRACT_SQ(freq[N]); @@ -242,13 +207,13 @@ //fftwf_execute(plan); fftwf_execute_r2r(fft_plans.autocorrelation_fft_plan_2, freq, time); - + /* Normalisation factor */ M = M * N; for(n = 0; n < N; n++) - result[n] = time[n] / (float)M; - /* result[n] = time[n+1] / (float)M; */ + result[n] = time[n] / (float)M; + /* result[n] = time[n+1] / (float)M; */ //fftwf_destroy_plan(plan); fftwf_free(freq); @@ -263,7 +228,7 @@ int n, filter; f = (xtract_mel_filter *)argv; - + for(filter = 0; filter < f->n_filters; filter++){ result[filter] = 0.f; for(n = 0; n < N; n++){ @@ -273,17 +238,17 @@ } xtract_dct(result, f->n_filters, NULL, result); - + return XTRACT_SUCCESS; } int xtract_dct(const float *data, const int N, const void *argv, float *result){ - + //fftwf_plan plan; - + //plan = - // fftwf_plan_r2r_1d(N, (float *) data, result, FFTW_REDFT00, FFTW_ESTIMATE); - + // fftwf_plan_r2r_1d(N, (float *) data, result, FFTW_REDFT00, FFTW_ESTIMATE); + fftwf_execute_r2r(fft_plans.dct_plan, (float *)data, result); //fftwf_execute(plan); //fftwf_destroy_plan(plan); @@ -326,13 +291,13 @@ int xtract_autocorrelation(const float *data, const int N, const void *argv, float *result){ /* Naive time domain implementation */ - + int n = N, i; - + float corr; while(n--){ - corr = 0; + corr = 0; for(i = 0; i < N - n; i++){ corr += data[i] * data[i + n]; } @@ -345,15 +310,15 @@ int xtract_amdf(const float *data, const int N, const void *argv, float *result){ int n = N, i; - + float md, temp; while(n--){ - md = 0.f; + md = 0.f; for(i = 0; i < N - n; i++){ temp = data[i] - data[i + n]; - temp = (temp < 0 ? -temp : temp); - md += temp; + temp = (temp < 0 ? -temp : temp); + md += temp; } result[n] = md / (float)N; } @@ -362,13 +327,13 @@ } int xtract_asdf(const float *data, const int N, const void *argv, float *result){ - + int n = N, i; - + float sd; while(n--){ - sd = 0.f; + sd = 0.f; for(i = 0; i < N - n; i++){ /*sd = 1;*/ sd += XTRACT_SQ(data[i] - data[i + n]); @@ -384,7 +349,7 @@ int *limits, band, n; limits = (int *)argv; - + for(band = 0; band < XTRACT_BARK_BANDS - 1; band++){ result[band] = 0.f; for(n = limits[band]; n < limits[band + 1]; n++) @@ -401,7 +366,7 @@ int n = N, rv = XTRACT_SUCCESS; threshold = max = y = y2 = y3 = p = q = 0.f; - + if(argv != NULL){ q = ((float *)argv)[0]; threshold = ((float *)argv)[1]; @@ -421,13 +386,13 @@ bytes = N * sizeof(float); if(input != NULL) - input = memcpy(input, data, bytes); + input = memcpy(input, data, bytes); else - return XTRACT_MALLOC_FAILED; + return XTRACT_MALLOC_FAILED; while(n--) max = XTRACT_MAX(max, input[n]); - + threshold *= .01 * max; result[0] = 0; @@ -437,8 +402,8 @@ if(input[n] >= threshold){ if(input[n] > input[n - 1] && n + 1 < N && input[n] > input[n + 1]){ result[N + n] = q * (n + (p = .5 * ((y = input[n-1]) - - (y3 = input[n+1])) / (input[n - 1] - 2 * - (y2 = input[n]) + input[n + 1]))); + (y3 = input[n+1])) / (input[n - 1] - 2 * + (y2 = input[n]) + input[n + 1]))); result[n] = y2 - .25 * (y - y3) * p; } else{ @@ -451,13 +416,13 @@ result[N + n] = 0; } } - + free(input); return (rv ? rv : XTRACT_SUCCESS); } - + int xtract_harmonic_spectrum(const float *data, const int N, const void *argv, float *result){ - + int n = (N >> 1), M = n; const float *freqs, *amps; @@ -471,23 +436,23 @@ ratio = nearest = distance = 0.f; while(n--){ - if(freqs[n]){ - ratio = freqs[n] / f0; - nearest = roundf(ratio); - distance = fabs(nearest - ratio); - if(distance > threshold) - result[n] = result[M + n] = 0.f; - else { - result[n] = amps[n]; - result[M + n] = freqs[n]; - } - } - else - result[n] = result[M + n] = 0.f; + if(freqs[n]){ + ratio = freqs[n] / f0; + nearest = roundf(ratio); + distance = fabs(nearest - ratio); + if(distance > threshold) + result[n] = result[M + n] = 0.f; + else { + result[n] = amps[n]; + result[M + n] = freqs[n]; + } + } + else + result[n] = result[M + n] = 0.f; } return XTRACT_SUCCESS; } - + int xtract_lpc(const float *data, const int N, const void *argv, float *result){ int i, j, k, M, L; @@ -543,12 +508,12 @@ float sum; int order = N - 1; /* Eventually change this to Q = 3/2 p as suggested in Rabiner */ int cep_length; - + if(argv == NULL) cep_length = N - 1; /* FIX: if we're going to have default values, they should come from the descriptor */ else cep_length = *(int *)argv; - //cep_length = (int)((float *)argv)[0]; + //cep_length = (int)((float *)argv)[0]; memset(result, 0, cep_length * sizeof(float)); @@ -597,7 +562,7 @@ /* Bounds sanity check */ if(lower >= N || lower + bw >= N){ - // printf("n: %d\n", n); + // printf("n: %d\n", n); result[n] = 0.f; continue; } Modified: trunk/src/xtract_macros_private.h =================================================================== --- trunk/src/xtract_macros_private.h 2008-11-11 11:55:55 UTC (rev 122) +++ trunk/src/xtract_macros_private.h 2010-02-03 22:35:13 UTC (rev 123) @@ -40,6 +40,8 @@ #define XTRACT_FUNDAMENTAL_DEFAULT 440.0 #define XTRACT_CHECK_nyquist if(!nyquist) nyquist = XTRACT_SR_DEFAULT / 2 #define XTRACT_CHECK_q if(!q) q = XTRACT_SR_DEFAULT / N +#define XTRACT_GET_MAX max = result[m] > max ? result[m] : max +#define XTRACT_SET_FREQUENCY result[M + m] = n * q #define XTRACT_IS_ODD(x) (x % 2 != 0 ? 1 : 0) #define XTRACT_SR_LIMIT SR_UPPER_LIMIT #define XTRACT_FFT_BANDS_MIN 16 Modified: trunk/xtract/xtract_helper.h =================================================================== --- trunk/xtract/xtract_helper.h 2008-11-11 11:55:55 UTC (rev 122) +++ trunk/xtract/xtract_helper.h 2010-02-03 22:35:13 UTC (rev 123) @@ -64,7 +64,7 @@ int xtract_features_from_subframes(const float *data, const int N, const int feature, const void *argv, float *result); /** \brief Test whether a number is denormal */ -inline int xtract_is_denormal(double const d); +int xtract_is_denormal(double const d); /** @} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pos...@us...> - 2011-03-30 10:51:46
|
Revision: 126 http://libxtract.svn.sourceforge.net/libxtract/?rev=126&view=rev Author: postlude Date: 2011-03-30 10:51:39 +0000 (Wed, 30 Mar 2011) Log Message: ----------- - reimplemented xtract_spectral_variance() xtract_spectral_skewness() and xtract_spectral_kurtosis() using correct maths - removed xtract_spectral_average_deviation() Modified Paths: -------------- trunk/Makefile.am trunk/configure.in trunk/doc/Makefile.am trunk/src/descriptors.c trunk/src/libxtract.c trunk/src/scalar.c trunk/xtract/libxtract.h trunk/xtract/xtract_scalar.h Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2011-03-30 10:05:07 UTC (rev 125) +++ trunk/Makefile.am 2011-03-30 10:51:39 UTC (rev 126) @@ -11,4 +11,4 @@ ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = bootstrap autogen.sh README TODO +EXTRA_DIST = examples/MSP bootstrap autogen.sh README TODO Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2011-03-30 10:05:07 UTC (rev 125) +++ trunk/configure.in 2011-03-30 10:51:39 UTC (rev 126) @@ -4,18 +4,20 @@ # Increment for feature additions and enhancements m4_define(libxtract_minor_version, 6) # Increment for fixes -m4_define(libxtract_fix_version, 1) +m4_define(libxtract_fix_version, 4) # Development status m4_define(libIntegra_dev_status, [beta]) m4_define(libxtract_version, libxtract_major_version.libxtract_minor_version.libxtract_fix_version) - + PACKAGE=libxtract -AC_INIT(libxtract, libxtract_version, lib...@li...) +AC_INIT([libxtract], [libxtract_version], [lib...@li...]) AC_DEFINE(LIBXTRACT_VERSION, libxtract_version, [LibXtract Version]) -AM_INIT_AUTOMAKE($PACKAGE, $LIBXTRACT_VERSION) +dnl AM_INIT_AUTOMAKE($PACKAGE, $LIBXTRACT_VERSION) +AM_INIT_AUTOMAKE(1.6) AM_CONFIG_HEADER(config.h) +AC_CONFIG_MACRO_DIR([m4]) AC_PROG_CC AC_PROG_LIBTOOL AC_PROG_INSTALL @@ -240,57 +242,57 @@ if test -z "$GCC"; then case $host in *-*-irix*) - dnl If we're on IRIX, we wanna use cc even if gcc - dnl is there (unless the user has overriden us)... - if test -z "$CC"; then - CC=cc - fi + dnl If we're on IRIX, we wanna use cc even if gcc + dnl is there (unless the user has overriden us)... + if test -z "$CC"; then + CC=cc + fi ;; sparc-sun-solaris*) - PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92" + PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92" ;; *) - PD_CFLAGS="-O" + PD_CFLAGS="-O" ;; esac else case $host in *86-*-linux*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused" - PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic" - dnl we could test for bad glibc here, but don't - PD_SUFFIX=pd_linux + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused" + PD_LDFLAGS="$PD_LDFLAGS -shared" + dnl we could test for bad glibc here, but don't + PD_SUFFIX=pd_linux ;; powerpc-*-linux*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - PD_LDFLAGS="$PD_LDFLAGS -shared" - PD_SUFFIX=pd_linux + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" + PD_LDFLAGS="$PD_LDFLAGS -shared" + PD_SUFFIX=pd_linux ;; *-*-linux*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC" - PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic" - PD_SUFFIX=pd_linux + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC" + PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic" + PD_SUFFIX=pd_linux ;; sparc-sun-*) - echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet" + echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet" ;; *86-*-darwin*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.3 -undefined dynamic_lookup -single_module" - PD_SUFFIX=pd_darwin + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" + PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.3 -undefined dynamic_lookup -single_module" + PD_SUFFIX=pd_darwin ;; *-*-darwin*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - PD_LDFLAGS="$PD_LDFLAGS -bundle -arch ppc -undefined suppress -flat_namespace" - PD_SUFFIX=pd_darwin + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" + PD_LDFLAGS="$PD_LDFLAGS -bundle -arch ppc -undefined suppress -flat_namespace" + PD_SUFFIX=pd_darwin ;; *) dnl assume unix - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" - PD_LDFLAGS="$PD_LDFLAGS -shared" - PD_SUFFIX=pd_linux + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" + PD_LDFLAGS="$PD_LDFLAGS -shared" + PD_SUFFIX=pd_linux ;; esac fi Modified: trunk/doc/Makefile.am =================================================================== --- trunk/doc/Makefile.am 2011-03-30 10:05:07 UTC (rev 125) +++ trunk/doc/Makefile.am 2011-03-30 10:51:39 UTC (rev 126) @@ -6,8 +6,6 @@ DOX=documentation.doxygen -EXTRA_DIST= - INSTIMAGES=html/doxygen.png DOC_STAMPS=html-build.stamp Modified: trunk/src/descriptors.c =================================================================== --- trunk/src/descriptors.c 2011-03-30 10:05:07 UTC (rev 125) +++ trunk/src/descriptors.c 2011-03-30 10:51:39 UTC (rev 126) @@ -62,7 +62,7 @@ case XTRACT_DIFFERENCE_VECTOR: case XTRACT_AVERAGE_DEVIATION: case XTRACT_SPECTRAL_STANDARD_DEVIATION: - case XTRACT_SPECTRAL_AVERAGE_DEVIATION: + /* case XTRACT_SPECTRAL_AVERAGE_DEVIATION: */ case XTRACT_LOWEST_VALUE: case XTRACT_TONALITY: case XTRACT_MFCC: @@ -206,9 +206,9 @@ case XTRACT_SPECTRAL_STANDARD_DEVIATION: *argv_donor = XTRACT_SPECTRAL_VARIANCE; break; - case XTRACT_SPECTRAL_AVERAGE_DEVIATION: + /* case XTRACT_SPECTRAL_AVERAGE_DEVIATION: *argv_donor = XTRACT_SPECTRAL_MEAN; - break; + break; */ case XTRACT_SPECTRAL_INHARMONICITY: *argv_donor = XTRACT_FAILSAFE_F0; break; @@ -300,7 +300,7 @@ case XTRACT_SPECTRAL_MEAN: case XTRACT_SPECTRAL_VARIANCE: case XTRACT_SPECTRAL_STANDARD_DEVIATION: - case XTRACT_SPECTRAL_AVERAGE_DEVIATION: + /* case XTRACT_SPECTRAL_AVERAGE_DEVIATION: */ case XTRACT_SPECTRAL_SKEWNESS: case XTRACT_SPECTRAL_KURTOSIS: case XTRACT_SPECTRAL_CENTROID: @@ -432,7 +432,7 @@ case XTRACT_SPECTRAL_MEAN: case XTRACT_SPECTRAL_VARIANCE: case XTRACT_SPECTRAL_STANDARD_DEVIATION: - case XTRACT_SPECTRAL_AVERAGE_DEVIATION: + /* case XTRACT_SPECTRAL_AVERAGE_DEVIATION: */ case XTRACT_SPECTRAL_SKEWNESS: case XTRACT_SPECTRAL_KURTOSIS: case XTRACT_SPECTRAL_CENTROID: @@ -530,7 +530,7 @@ "Extract the standard deviation of an audio spectrum"); strcpy(author, ""); break; - case XTRACT_SPECTRAL_AVERAGE_DEVIATION: + /* case XTRACT_SPECTRAL_AVERAGE_DEVIATION: strcpy(name, "spectral_average_deviation"); strcpy(p_name, "Spectral Average Deviation"); strcpy(desc, @@ -539,6 +539,7 @@ "Extract the average deviation of an audio spectrum"); strcpy(author, ""); break; + */ case XTRACT_ROLLOFF: strcpy(name, "rolloff"); strcpy(p_name, "Spectral Rolloff"); @@ -963,7 +964,7 @@ case XTRACT_AVERAGE_DEVIATION: case XTRACT_SPECTRAL_VARIANCE: case XTRACT_SPECTRAL_STANDARD_DEVIATION: - case XTRACT_SPECTRAL_AVERAGE_DEVIATION: + /* case XTRACT_SPECTRAL_AVERAGE_DEVIATION: */ case XTRACT_SPECTRAL_INHARMONICITY: case XTRACT_LOWEST_VALUE: case XTRACT_F0: @@ -1059,7 +1060,7 @@ case XTRACT_SPECTRAL_MEAN: case XTRACT_SPECTRAL_VARIANCE: case XTRACT_SPECTRAL_STANDARD_DEVIATION: - case XTRACT_SPECTRAL_AVERAGE_DEVIATION: + /* case XTRACT_SPECTRAL_AVERAGE_DEVIATION: */ case XTRACT_SPECTRAL_SKEWNESS: case XTRACT_SPECTRAL_KURTOSIS: case XTRACT_SPECTRAL_CENTROID: @@ -1135,7 +1136,7 @@ case XTRACT_SPECTRAL_MEAN: case XTRACT_SPECTRAL_VARIANCE: case XTRACT_SPECTRAL_STANDARD_DEVIATION: - case XTRACT_SPECTRAL_AVERAGE_DEVIATION: + /* case XTRACT_SPECTRAL_AVERAGE_DEVIATION: */ case XTRACT_SPECTRAL_SKEWNESS: case XTRACT_SPECTRAL_KURTOSIS: case XTRACT_SPECTRAL_CENTROID: @@ -1227,7 +1228,7 @@ case XTRACT_SPECTRAL_MEAN: case XTRACT_SPECTRAL_VARIANCE: case XTRACT_SPECTRAL_STANDARD_DEVIATION: - case XTRACT_SPECTRAL_AVERAGE_DEVIATION: + /* case XTRACT_SPECTRAL_AVERAGE_DEVIATION: */ case XTRACT_SPECTRAL_CENTROID: case XTRACT_SPREAD: case XTRACT_F0: Modified: trunk/src/libxtract.c =================================================================== --- trunk/src/libxtract.c 2011-03-30 10:05:07 UTC (rev 125) +++ trunk/src/libxtract.c 2011-03-30 10:51:39 UTC (rev 126) @@ -27,7 +27,7 @@ xtract_mean, xtract_variance, xtract_standard_deviation, - xtract_average_deviation, + /* xtract_average_deviation, */ xtract_skewness, xtract_kurtosis, xtract_spectral_mean, Modified: trunk/src/scalar.c =================================================================== --- trunk/src/scalar.c 2011-03-30 10:05:07 UTC (rev 125) +++ trunk/src/scalar.c 2011-03-30 10:51:39 UTC (rev 126) @@ -186,11 +186,11 @@ *result = 0.f; while(m--){ - A += amps[m]; - *result += powf((freqs[m] - *(float *)argv) * amps[m], 2); + A += amps[m]; + *result += powf(freqs[m] - ((float *)argv)[0], 2) * amps[m]; } - *result = *result / (A /*- 1*/); + *result = *result / A; return XTRACT_SUCCESS; } @@ -202,7 +202,7 @@ return XTRACT_SUCCESS; } -int xtract_spectral_average_deviation(const float *data, const int N, const void *argv, float *result){ +/*int xtract_spectral_average_deviation(const float *data, const int N, const void *argv, float *result){ int m; float A = 0.f; @@ -216,19 +216,18 @@ *result = 0.f; while(m--){ - A += amps[m]; - *result += fabsf((amps[m] * freqs[m]) - *(float *)argv); + A += amps[m]; + *result += fabsf((amps[m] * freqs[m]) - *(float *)argv); } *result /= A; return XTRACT_SUCCESS; -} +}*/ int xtract_spectral_skewness(const float *data, const int N, const void *argv, float *result){ int m; - float temp, A = 0.f; const float *freqs, *amps; m = N >> 1; @@ -238,14 +237,10 @@ *result = 0.f; - while(m--){ - A += amps[m]; - temp = ((amps[m] * freqs[m]) - - ((float *)argv)[0]) / ((float *)argv)[1]; - *result += powf(temp, 3); - } + while(m--) + *result += powf(freqs[m] - ((float *)argv)[0], 3) * amps[m]; - *result /= A; + *result /= powf(((float *)argv)[1], 3); return XTRACT_SUCCESS; } @@ -253,7 +248,6 @@ int xtract_spectral_kurtosis(const float *data, const int N, const void *argv, float *result){ int m; - float temp, A = 0.f; const float *freqs, *amps; m = N >> 1; @@ -263,14 +257,10 @@ *result = 0.f; - while(m--){ - A += amps[m]; - temp = ((amps[m] * freqs[m]) - - ((float *)argv)[0]) / ((float *)argv)[1]; - *result += powf(temp, 4); - } + while(m--) + *result += powf(freqs[m] - ((float *)argv)[0], 4) * amps[m]; - *result /= A; + *result /= powf(((float *)argv)[1], 4); *result -= 3.0f; return XTRACT_SUCCESS; Modified: trunk/xtract/libxtract.h =================================================================== --- trunk/xtract/libxtract.h 2011-03-30 10:05:07 UTC (rev 125) +++ trunk/xtract/libxtract.h 2011-03-30 10:51:39 UTC (rev 126) @@ -68,7 +68,7 @@ * @{ */ -#define XTRACT_FEATURES 60 +#define XTRACT_FEATURES 59 /** \brief Enumeration of features, elements are used as indixes to an array of pointers to feature extracton functions */ enum xtract_features_ { @@ -81,7 +81,7 @@ XTRACT_SPECTRAL_MEAN, XTRACT_SPECTRAL_VARIANCE, XTRACT_SPECTRAL_STANDARD_DEVIATION, - XTRACT_SPECTRAL_AVERAGE_DEVIATION, + /*XTRACT_SPECTRAL_AVERAGE_DEVIATION, */ XTRACT_SPECTRAL_SKEWNESS, XTRACT_SPECTRAL_KURTOSIS, XTRACT_SPECTRAL_CENTROID, Modified: trunk/xtract/xtract_scalar.h =================================================================== --- trunk/xtract/xtract_scalar.h 2011-03-30 10:05:07 UTC (rev 125) +++ trunk/xtract/xtract_scalar.h 2011-03-30 10:51:39 UTC (rev 126) @@ -71,7 +71,8 @@ * \param *argv: a pointer to a float representing the mean of the input vector * \param *result: the average deviation of N values from the array pointed to by *data */ -int xtract_average_deviation(const float *data, const int N, const void *argv, float *result); +/*int xtract_average_deviation(const float *data, const int N, const void *argv, float *result); + */ /** \brief Extract the skewness of an input vector * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pos...@us...> - 2012-03-29 12:23:14
|
Revision: 128 http://libxtract.svn.sourceforge.net/libxtract/?rev=128&view=rev Author: postlude Date: 2012-03-29 12:23:04 +0000 (Thu, 29 Mar 2012) Log Message: ----------- - fixed build-time bug. in some cases average_deviation was commented out instead of spectral_average_deviation Modified Paths: -------------- trunk/src/libxtract.c trunk/xtract/xtract_scalar.h Modified: trunk/src/libxtract.c =================================================================== --- trunk/src/libxtract.c 2011-03-31 12:22:29 UTC (rev 127) +++ trunk/src/libxtract.c 2012-03-29 12:23:04 UTC (rev 128) @@ -27,13 +27,13 @@ xtract_mean, xtract_variance, xtract_standard_deviation, - /* xtract_average_deviation, */ + xtract_average_deviation, xtract_skewness, xtract_kurtosis, xtract_spectral_mean, xtract_spectral_variance, xtract_spectral_standard_deviation, - xtract_spectral_average_deviation, + /* xtract_spectral_average_deviation, */ xtract_spectral_skewness, xtract_spectral_kurtosis, xtract_spectral_centroid, Modified: trunk/xtract/xtract_scalar.h =================================================================== --- trunk/xtract/xtract_scalar.h 2011-03-31 12:22:29 UTC (rev 127) +++ trunk/xtract/xtract_scalar.h 2012-03-29 12:23:04 UTC (rev 128) @@ -71,9 +71,9 @@ * \param *argv: a pointer to a float representing the mean of the input vector * \param *result: the average deviation of N values from the array pointed to by *data */ -/*int xtract_average_deviation(const float *data, const int N, const void *argv, float *result); - */ +int xtract_average_deviation(const float *data, const int N, const void *argv, float *result); + /** \brief Extract the skewness of an input vector * * \param *data: a pointer to the first element in an array of floats @@ -127,7 +127,9 @@ * \param *argv: a pointer to a float representing the spectral mean of the input spectrum * \param *result: the average deviation of the spectrum pointed to by *data */ +/* int xtract_spectral_average_deviation(const float *data, const int N, const void *argv, float *result); +*/ /** \brief Extract the skewness of an input spectrum * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pos...@us...> - 2012-03-29 17:24:53
|
Revision: 129 http://libxtract.svn.sourceforge.net/libxtract/?rev=129&view=rev Author: postlude Date: 2012-03-29 17:24:45 +0000 (Thu, 29 Mar 2012) Log Message: ----------- - updated to latest SWIG macros - added __init__.py so generated python module loads Modified Paths: -------------- trunk/README trunk/configure.in trunk/swig/python/Makefile.am Added Paths: ----------- trunk/m4/ax_pkg_swig.m4 trunk/m4/ax_python_devel.m4 trunk/m4/ax_swig_enable_cxx.m4 trunk/m4/ax_swig_multi_module_support.m4 trunk/m4/ax_swig_python.m4 trunk/swig/python/__init__.py Removed Paths: ------------- trunk/m4/ac_pkg_swig.m4 trunk/m4/ac_python_devel.m4 trunk/m4/swig_multi_module_support.m4 trunk/m4/swig_python.m4 Modified: trunk/README =================================================================== --- trunk/README 2012-03-29 12:23:04 UTC (rev 128) +++ trunk/README 2012-03-29 17:24:45 UTC (rev 129) @@ -73,10 +73,14 @@ ./configure --your-flags LDFLAGS="-L/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/" -to find your Python library type: +To find your Python library type: -locate libpython + locate libpython +NOTE: The python module will get installed under the main install prefix, so if your install prefix is set to /usr/local, then the python module will get installed to /usr/local/lib/python2.5/site-packages/libxtract/xtract. You may need to add this to your PYTHONPATH environment variable. For example in ~/.bash_profile add: + export PYTHONPATH=/usr/local/lib/python2.7/site-packages + + Building the Java bindings -------------------------- Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2012-03-29 12:23:04 UTC (rev 128) +++ trunk/configure.in 2012-03-29 17:24:45 UTC (rev 129) @@ -195,7 +195,7 @@ dnl SWIG stuff if [[ "$swig" = "true" ]] ; then - AC_PROG_SWIG(1.3.21) + AX_PKG_SWIG(1.3.21) AC_DEFINE([BUILD_SWIG], [1], [Build the swig bindings]) fi Deleted: trunk/m4/ac_pkg_swig.m4 =================================================================== --- trunk/m4/ac_pkg_swig.m4 2012-03-29 12:23:04 UTC (rev 128) +++ trunk/m4/ac_pkg_swig.m4 2012-03-29 17:24:45 UTC (rev 129) @@ -1,125 +0,0 @@ -##### http://autoconf-archive.cryp.to/ac_pkg_swig.html -# -# SYNOPSIS -# -# AC_PROG_SWIG([major.minor.micro]) -# -# DESCRIPTION -# -# This macro searches for a SWIG installation on your system. If -# found you should call SWIG via $(SWIG). You can use the optional -# first argument to check if the version of the available SWIG is -# greater than or equal to the value of the argument. It should have -# the format: N[.N[.N]] (N is a number between 0 and 999. Only the -# first N is mandatory.) -# -# If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks -# that the swig package is this version number or higher. -# -# In configure.in, use as: -# -# AC_PROG_SWIG(1.3.17) -# SWIG_ENABLE_CXX -# SWIG_MULTI_MODULE_SUPPORT -# SWIG_PYTHON -# -# LAST MODIFICATION -# -# 2006-10-22 -# -# COPYLEFT -# -# Copyright (c) 2006 Sebastian Huber <seb...@we...> -# Copyright (c) 2006 Alan W. Irwin <ir...@be...> -# Copyright (c) 2006 Rafael Laboissiere <ra...@la...> -# Copyright (c) 2006 Andrew Collier <col...@uk...> -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. -# -# As a special exception, the respective Autoconf Macro's copyright -# owner gives unlimited permission to copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts, even though -# portions of the text of the Macro appear in them. The GNU General -# Public License (GPL) does govern all other use of the material that -# constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the -# Autoconf Macro released by the Autoconf Macro Archive. When you -# make and distribute a modified version of the Autoconf Macro, you -# may extend this special exception to the GPL to apply to your -# modified version as well. - -AC_DEFUN([AC_PROG_SWIG],[ - AC_PATH_PROG([SWIG],[swig]) - if test -z "$SWIG" ; then - AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org]) - SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false' - elif test -n "$1" ; then - AC_MSG_CHECKING([for SWIG version]) - [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] - AC_MSG_RESULT([$swig_version]) - if test -n "$swig_version" ; then - # Calculate the required version number components - [required=$1] - [required_major=`echo $required | sed 's/[^0-9].*//'`] - if test -z "$required_major" ; then - [required_major=0] - fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] - [required_minor=`echo $required | sed 's/[^0-9].*//'`] - if test -z "$required_minor" ; then - [required_minor=0] - fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] - [required_patch=`echo $required | sed 's/[^0-9].*//'`] - if test -z "$required_patch" ; then - [required_patch=0] - fi - # Calculate the available version number components - [available=$swig_version] - [available_major=`echo $available | sed 's/[^0-9].*//'`] - if test -z "$available_major" ; then - [available_major=0] - fi - [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] - [available_minor=`echo $available | sed 's/[^0-9].*//'`] - if test -z "$available_minor" ; then - [available_minor=0] - fi - [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] - [available_patch=`echo $available | sed 's/[^0-9].*//'`] - if test -z "$available_patch" ; then - [available_patch=0] - fi - if test $available_major -ne $required_major \ - -o $available_minor -ne $required_minor \ - -o $available_patch -lt $required_patch ; then - AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org]) - SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' - else - AC_MSG_NOTICE([SWIG executable is '$SWIG']) - SWIG_LIB=`$SWIG -swiglib` - AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB']) - fi - else - AC_MSG_WARN([cannot determine SWIG version]) - SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' - fi - fi - AC_SUBST([SWIG_LIB]) -]) Deleted: trunk/m4/ac_python_devel.m4 =================================================================== --- trunk/m4/ac_python_devel.m4 2012-03-29 12:23:04 UTC (rev 128) +++ trunk/m4/ac_python_devel.m4 2012-03-29 17:24:45 UTC (rev 129) @@ -1,269 +0,0 @@ -##### http://autoconf-archive.cryp.to/ac_python_devel.html -# -# SYNOPSIS -# -# AC_PYTHON_DEVEL([version]) -# -# DESCRIPTION -# -# Note: Defines as a precious variable "PYTHON_VERSION". Don't -# override it in your configure.ac. -# -# This macro checks for Python and tries to get the include path to -# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and -# $(PYTHON_LDFLAGS) output variables. It also exports -# $(PYTHON_EXTRA_LIBS) and $(PYTHON_EXTRA_LDFLAGS) for embedding -# Python in your code. -# -# You can search for some particular version of Python by passing a -# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". -# Please note that you *have* to pass also an operator along with the -# version to match, and pay special attention to the single quotes -# surrounding the version number. Don't use "PYTHON_VERSION" for -# this: that environment variable is declared as precious and thus -# reserved for the end-user. -# -# This macro should work for all versions of Python >= 2.1.0. As an -# end user, you can disable the check for the python version by -# setting the PYTHON_NOVERSIONCHECK environment variable to something -# else than the empty string. -# -# If you need to use this macro for an older Python version, please -# contact the authors. We're always open for feedback. -# -# LAST MODIFICATION -# -# 2006-10-22 -# -# COPYLEFT -# -# Copyright (c) 2006 Sebastian Huber <seb...@we...> -# Copyright (c) 2006 Alan W. Irwin <ir...@be...> -# Copyright (c) 2006 Rafael Laboissiere <ra...@la...> -# Copyright (c) 2006 Andrew Collier <col...@uk...> -# Copyright (c) 2006 Matteo Settenvini <ma...@me...> -# Copyright (c) 2006 Horst Knorr <hk_...@kn...> -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. -# -# As a special exception, the respective Autoconf Macro's copyright -# owner gives unlimited permission to copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts, even though -# portions of the text of the Macro appear in them. The GNU General -# Public License (GPL) does govern all other use of the material that -# constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the -# Autoconf Macro released by the Autoconf Macro Archive. When you -# make and distribute a modified version of the Autoconf Macro, you -# may extend this special exception to the GPL to apply to your -# modified version as well. - -AC_DEFUN([AC_PYTHON_DEVEL],[ - # - # Allow the use of a (user set) custom python version - # - AC_ARG_VAR([PYTHON_VERSION],[The installed Python - version to use, for example '2.3'. This string - will be appended to the Python interpreter - canonical name.]) - - AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) - if test -z "$PYTHON"; then - AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) - PYTHON_VERSION="" - fi - - # - # Check for a version of Python >= 2.1.0 - # - AC_MSG_CHECKING([for a version of Python >= '2.1.0']) - ac_supports_python_ver=`$PYTHON -c "import sys, string; \ - ver = string.split(sys.version)[[0]]; \ - print ver >= '2.1.0'"` - if test "$ac_supports_python_ver" != "True"; then - if test -z "$PYTHON_NOVERSIONCHECK"; then - AC_MSG_RESULT([no]) - AC_MSG_FAILURE([ -This version of the AC@&t@_PYTHON_DEVEL macro -doesn't work properly with versions of Python before -2.1.0. You may need to re-run configure, setting the -variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, -PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. -Moreover, to disable this check, set PYTHON_NOVERSIONCHECK -to something else than an empty string. -]) - else - AC_MSG_RESULT([skip at user request]) - fi - else - AC_MSG_RESULT([yes]) - fi - - # - # if the macro parameter ``version'' is set, honour it - # - if test -n "$1"; then - AC_MSG_CHECKING([for a version of Python $1]) - ac_supports_python_ver=`$PYTHON -c "import sys, string; \ - ver = string.split(sys.version)[[0]]; \ - print ver $1"` - if test "$ac_supports_python_ver" = "True"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([this package requires Python $1. -If you have it installed, but it isn't the default Python -interpreter in your system path, please pass the PYTHON_VERSION -variable to configure. See ``configure --help'' for reference. -]) - PYTHON_VERSION="" - fi - fi - - # - # Check if you have distutils, else fail - # - AC_MSG_CHECKING([for the distutils Python package]) - ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` - if test -z "$ac_distutils_result"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([cannot import Python module "distutils". -Please check your Python installation. The error was: -$ac_distutils_result]) - PYTHON_VERSION="" - fi - - # - # Check for Python include path - # - AC_MSG_CHECKING([for Python include path]) - if test -z "$PYTHON_CPPFLAGS"; then - python_path=`$PYTHON -c "import distutils.sysconfig; \ - print distutils.sysconfig.get_python_inc();"` - if test -n "${python_path}"; then - python_path="-I$python_path" - fi - PYTHON_CPPFLAGS=$python_path - fi - AC_MSG_RESULT([$PYTHON_CPPFLAGS]) - AC_SUBST([PYTHON_CPPFLAGS]) - - # - # Check for Python library path - # - AC_MSG_CHECKING([for Python library path]) - if test -z "$PYTHON_LDFLAGS"; then - # (makes two attempts to ensure we've got a version number - # from the interpreter) - py_version=`$PYTHON -c "from distutils.sysconfig import *; \ - from string import join; \ - print join(get_config_vars('VERSION'))"` - if test "$py_version" == "[None]"; then - if test -n "$PYTHON_VERSION"; then - py_version=$PYTHON_VERSION - else - py_version=`$PYTHON -c "import sys; \ - print sys.version[[:3]]"` - fi - fi - - PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \ - from string import join; \ - print '-L' + get_python_lib(0,1), \ - '-lpython';"`$py_version - fi - AC_MSG_RESULT([$PYTHON_LDFLAGS]) - AC_SUBST([PYTHON_LDFLAGS]) - - # - # Check for site packages - # - AC_MSG_CHECKING([for Python site-packages path]) - if test -z "$PYTHON_SITE_PKG"; then - PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ - print distutils.sysconfig.get_python_lib(0,0);"` - fi - AC_MSG_RESULT([$PYTHON_SITE_PKG]) - AC_SUBST([PYTHON_SITE_PKG]) - - # - # libraries which must be linked in when embedding - # - AC_MSG_CHECKING(python extra libraries) - if test -z "$PYTHON_EXTRA_LIBS"; then - PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ - conf = distutils.sysconfig.get_config_var; \ - print conf('LOCALMODLIBS'), conf('LIBS')"` - fi - AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) - AC_SUBST(PYTHON_EXTRA_LIBS) - - # - # linking flags needed when embedding - # - AC_MSG_CHECKING(python extra linking flags) - if test -z "$PYTHON_EXTRA_LDFLAGS"; then - PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ - conf = distutils.sysconfig.get_config_var; \ - print conf('LINKFORSHARED')"` - fi - AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) - AC_SUBST(PYTHON_EXTRA_LDFLAGS) - - # - # final check to see if everything compiles alright - # - AC_MSG_CHECKING([consistency of all components of python development environment]) - AC_LANG_PUSH([C]) - # save current global flags - LIBS="$ac_save_LIBS $PYTHON_LDFLAGS" - CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" - AC_TRY_LINK([ - #include <Python.h> - ],[ - Py_Initialize(); - ],[pythonexists=yes],[pythonexists=no]) - - AC_MSG_RESULT([$pythonexists]) - - if test ! "$pythonexists" = "yes"; then - AC_MSG_ERROR([ - Could not link test program to Python. Maybe the main Python library has been - installed in some non-standard library path. If so, pass it to configure, - via the LDFLAGS environment variable. - Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" - ============================================================================ - ERROR! - You probably have to install the development version of the Python package - for your distribution. The exact name of this package varies among them. - ============================================================================ - ]) - PYTHON_VERSION="" - fi - AC_LANG_POP - # turn back to default flags - CPPFLAGS="$ac_save_CPPFLAGS" - LIBS="$ac_save_LIBS" - - # - # all done! - # -]) Added: trunk/m4/ax_pkg_swig.m4 =================================================================== --- trunk/m4/ax_pkg_swig.m4 (rev 0) +++ trunk/m4/ax_pkg_swig.m4 2012-03-29 17:24:45 UTC (rev 129) @@ -0,0 +1,135 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found]) +# +# DESCRIPTION +# +# This macro searches for a SWIG installation on your system. If found, +# then SWIG is AC_SUBST'd; if not found, then $SWIG is empty. If SWIG is +# found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd. +# +# You can use the optional first argument to check if the version of the +# available SWIG is greater than or equal to the value of the argument. It +# should have the format: N[.N[.N]] (N is a number between 0 and 999. Only +# the first N is mandatory.) If the version argument is given (e.g. +# 1.3.17), AX_PKG_SWIG checks that the swig package is this version number +# or higher. +# +# As usual, action-if-found is executed if SWIG is found, otherwise +# action-if-not-found is executed. +# +# In configure.in, use as: +# +# AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ]) +# AX_SWIG_ENABLE_CXX +# AX_SWIG_MULTI_MODULE_SUPPORT +# AX_SWIG_PYTHON +# +# LICENSE +# +# Copyright (c) 2008 Sebastian Huber <seb...@we...> +# Copyright (c) 2008 Alan W. Irwin <ir...@be...> +# Copyright (c) 2008 Rafael Laboissiere <ra...@la...> +# Copyright (c) 2008 Andrew Collier <col...@uk...> +# Copyright (c) 2011 Murray Cumming <mu...@op...> +# +# 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. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 8 + +AC_DEFUN([AX_PKG_SWIG],[ + # Ubuntu has swig 2.0 as /usr/bin/swig2.0 + AC_PATH_PROGS([SWIG],[swig swig2.0]) + if test -z "$SWIG" ; then + m4_ifval([$3],[$3],[:]) + elif test -n "$1" ; then + AC_MSG_CHECKING([SWIG version]) + [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] + AC_MSG_RESULT([$swig_version]) + if test -n "$swig_version" ; then + # Calculate the required version number components + [required=$1] + [required_major=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_major" ; then + [required_major=0] + fi + [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required_minor=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_minor" ; then + [required_minor=0] + fi + [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required_patch=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_patch" ; then + [required_patch=0] + fi + # Calculate the available version number components + [available=$swig_version] + [available_major=`echo $available | sed 's/[^0-9].*//'`] + if test -z "$available_major" ; then + [available_major=0] + fi + [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] + [available_minor=`echo $available | sed 's/[^0-9].*//'`] + if test -z "$available_minor" ; then + [available_minor=0] + fi + [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] + [available_patch=`echo $available | sed 's/[^0-9].*//'`] + if test -z "$available_patch" ; then + [available_patch=0] + fi + # Convert the version tuple into a single number for easier comparison. + # Using base 100 should be safe since SWIG internally uses BCD values + # to encode its version number. + required_swig_vernum=`expr $required_major \* 10000 \ + \+ $required_minor \* 100 \+ $required_patch` + available_swig_vernum=`expr $available_major \* 10000 \ + \+ $available_minor \* 100 \+ $available_patch` + + if test $available_swig_vernum -lt $required_swig_vernum; then + AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version.]) + SWIG='' + m4_ifval([$3],[$3],[]) + else + AC_MSG_CHECKING([for SWIG library]) + SWIG_LIB=`$SWIG -swiglib` + AC_MSG_RESULT([$SWIG_LIB]) + m4_ifval([$2],[$2],[]) + fi + else + AC_MSG_WARN([cannot determine SWIG version]) + SWIG='' + m4_ifval([$3],[$3],[]) + fi + fi + AC_SUBST([SWIG_LIB]) +]) Added: trunk/m4/ax_python_devel.m4 =================================================================== --- trunk/m4/ax_python_devel.m4 (rev 0) +++ trunk/m4/ax_python_devel.m4 2012-03-29 17:24:45 UTC (rev 129) @@ -0,0 +1,325 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PYTHON_DEVEL([version]) +# +# DESCRIPTION +# +# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it +# in your configure.ac. +# +# This macro checks for Python and tries to get the include path to +# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) +# output variables. It also exports $(PYTHON_EXTRA_LIBS) and +# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. +# +# You can search for some particular version of Python by passing a +# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please +# note that you *have* to pass also an operator along with the version to +# match, and pay special attention to the single quotes surrounding the +# version number. Don't use "PYTHON_VERSION" for this: that environment +# variable is declared as precious and thus reserved for the end-user. +# +# This macro should work for all versions of Python >= 2.1.0. As an end +# user, you can disable the check for the python version by setting the +# PYTHON_NOVERSIONCHECK environment variable to something else than the +# empty string. +# +# If you need to use this macro for an older Python version, please +# contact the authors. We're always open for feedback. +# +# LICENSE +# +# Copyright (c) 2009 Sebastian Huber <seb...@we...> +# Copyright (c) 2009 Alan W. Irwin <ir...@be...> +# Copyright (c) 2009 Rafael Laboissiere <ra...@la...> +# Copyright (c) 2009 Andrew Collier <col...@uk...> +# Copyright (c) 2009 Matteo Settenvini <ma...@me...> +# Copyright (c) 2009 Horst Knorr <hk_...@kn...> +# +# 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 3 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. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 8 + +AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) +AC_DEFUN([AX_PYTHON_DEVEL],[ + # + # Allow the use of a (user set) custom python version + # + AC_ARG_VAR([PYTHON_VERSION],[The installed Python + version to use, for example '2.3'. This string + will be appended to the Python interpreter + canonical name.]) + + AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) + if test -z "$PYTHON"; then + AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) + PYTHON_VERSION="" + fi + + # + # Check for a version of Python >= 2.1.0 + # + AC_MSG_CHECKING([for a version of Python >= '2.1.0']) + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()[[0]]; \ + print (ver >= '2.1.0')"` + if test "$ac_supports_python_ver" != "True"; then + if test -z "$PYTHON_NOVERSIONCHECK"; then + AC_MSG_RESULT([no]) + AC_MSG_FAILURE([ +This version of the AC@&t@_PYTHON_DEVEL macro +doesn't work properly with versions of Python before +2.1.0. You may need to re-run configure, setting the +variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, +PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. +Moreover, to disable this check, set PYTHON_NOVERSIONCHECK +to something else than an empty string. +]) + else + AC_MSG_RESULT([skip at user request]) + fi + else + AC_MSG_RESULT([yes]) + fi + + # + # if the macro parameter ``version'' is set, honour it + # + if test -n "$1"; then + AC_MSG_CHECKING([for a version of Python $1]) + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()[[0]]; \ + print (ver $1)"` + if test "$ac_supports_python_ver" = "True"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([this package requires Python $1. +If you have it installed, but it isn't the default Python +interpreter in your system path, please pass the PYTHON_VERSION +variable to configure. See ``configure --help'' for reference. +]) + PYTHON_VERSION="" + fi + fi + + # + # Check if you have distutils, else fail + # + AC_MSG_CHECKING([for the distutils Python package]) + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` + if test -z "$ac_distutils_result"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot import Python module "distutils". +Please check your Python installation. The error was: +$ac_distutils_result]) + PYTHON_VERSION="" + fi + + # + # Check for Python include path + # + AC_MSG_CHECKING([for Python include path]) + if test -z "$PYTHON_CPPFLAGS"; then + python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc ());"` + if test -n "${python_path}"; then + python_path="-I$python_path" + fi + PYTHON_CPPFLAGS=$python_path + fi + AC_MSG_RESULT([$PYTHON_CPPFLAGS]) + AC_SUBST([PYTHON_CPPFLAGS]) + + # + # Check for Python library path + # + AC_MSG_CHECKING([for Python library path]) + if test -z "$PYTHON_LDFLAGS"; then + # (makes two attempts to ensure we've got a version number + # from the interpreter) + ac_python_version=`cat<<EOD | $PYTHON - + +# join all versioning strings, on some systems +# major/minor numbers could be in different list elements +from distutils.sysconfig import * +ret = '' +for e in get_config_vars ('VERSION'): + if (e != None): + ret += e +print (ret) +EOD` + + if test -z "$ac_python_version"; then + if test -n "$PYTHON_VERSION"; then + ac_python_version=$PYTHON_VERSION + else + ac_python_version=`$PYTHON -c "import sys; \ + print (sys.version[[:3]])"` + fi + fi + + # Make the versioning information available to the compiler + AC_DEFINE_UNQUOTED([HAVE_PYTHON], ["$ac_python_version"], + [If available, contains the Python version number currently in use.]) + + # First, the library directory: + ac_python_libdir=`cat<<EOD | $PYTHON - + +# There should be only one +import distutils.sysconfig +for e in distutils.sysconfig.get_config_vars ('LIBDIR'): + if e != None: + print (e) + break +EOD` + + # Before checking for libpythonX.Y, we need to know + # the extension the OS we're on uses for libraries + # (we take the first one, if there's more than one fix me!): + ac_python_soext=`$PYTHON -c \ + "import distutils.sysconfig; \ + print (distutils.sysconfig.get_config_vars('SO')[[0]])"` + + # Now, for the library: + ac_python_soname=`$PYTHON -c \ + "import distutils.sysconfig; \ + print (distutils.sysconfig.get_config_vars('LDLIBRARY')[[0]])"` + + # Strip away extension from the end to canonicalize its name: + ac_python_library=`echo "$ac_python_soname" | sed "s/${ac_python_soext}$//"` + + # This small piece shamelessly adapted from PostgreSQL python macro; + # credits goes to momjian, I think. I'd like to put the right name + # in the credits, if someone can point me in the right direction... ? + # + if test -n "$ac_python_libdir" -a -n "$ac_python_library" \ + -a x"$ac_python_library" != x"$ac_python_soname" + then + # use the official shared library + ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"` + PYTHON_LDFLAGS="-L$ac_python_libdir -l$ac_python_library" + else + # old way: use libpython from python_configdir + ac_python_libdir=`$PYTHON -c \ + "from distutils.sysconfig import get_python_lib as f; \ + import os; \ + print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"` + PYTHON_LDFLAGS="-L$ac_python_libdir -lpython$ac_python_version" + fi + + if test -z "PYTHON_LDFLAGS"; then + AC_MSG_ERROR([ + Cannot determine location of your Python DSO. Please check it was installed with + dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand. + ]) + fi + fi + AC_MSG_RESULT([$PYTHON_LDFLAGS]) + AC_SUBST([PYTHON_LDFLAGS]) + + # + # Check for site packages + # + AC_MSG_CHECKING([for Python site-packages path]) + if test -z "$PYTHON_SITE_PKG"; then + PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_lib(0,0));"` + fi + AC_MSG_RESULT([$PYTHON_SITE_PKG]) + AC_SUBST([PYTHON_SITE_PKG]) + + # + # libraries which must be linked in when embedding + # + AC_MSG_CHECKING(python extra libraries) + if test -z "$PYTHON_EXTRA_LIBS"; then + PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ + conf = distutils.sysconfig.get_config_var; \ + print (conf('LOCALMODLIBS') + ' ' + conf('LIBS'))"` + fi + AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) + AC_SUBST(PYTHON_EXTRA_LIBS) + + # + # linking flags needed when embedding + # + AC_MSG_CHECKING(python extra linking flags) + if test -z "$PYTHON_EXTRA_LDFLAGS"; then + PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ + conf = distutils.sysconfig.get_config_var; \ + print (conf('LINKFORSHARED'))"` + fi + AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) + AC_SUBST(PYTHON_EXTRA_LDFLAGS) + + # + # final check to see if everything compiles alright + # + AC_MSG_CHECKING([consistency of all components of python development environment]) + # save current global flags + ac_save_LIBS="$LIBS" + ac_save_CPPFLAGS="$CPPFLAGS" + LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS" + CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" + AC_LANG_PUSH([C]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[#include <Python.h>]], + [[Py_Initialize();]]) + ],[pythonexists=yes],[pythonexists=no]) + AC_LANG_POP([C]) + # turn back to default flags + CPPFLAGS="$ac_save_CPPFLAGS" + LIBS="$ac_save_LIBS" + + AC_MSG_RESULT([$pythonexists]) + + if test ! "x$pythonexists" = "xyes"; then + AC_MSG_FAILURE([ + Could not link test program to Python. Maybe the main Python library has been + installed in some non-standard library path. If so, pass it to configure, + via the LDFLAGS environment variable. + Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" + ============================================================================ + ERROR! + You probably have to install the development version of the Python package + for your distribution. The exact name of this package varies among them. + ============================================================================ + ]) + PYTHON_VERSION="" + fi + + # + # all done! + # +]) Added: trunk/m4/ax_swig_enable_cxx.m4 =================================================================== --- trunk/m4/ax_swig_enable_cxx.m4 (rev 0) +++ trunk/m4/ax_swig_enable_cxx.m4 2012-03-29 17:24:45 UTC (rev 129) @@ -0,0 +1,53 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_swig_enable_cxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_SWIG_ENABLE_CXX +# +# DESCRIPTION +# +# Enable SWIG C++ support. This affects all invocations of $(SWIG). +# +# LICENSE +# +# Copyright (c) 2008 Sebastian Huber <seb...@we...> +# Copyright (c) 2008 Alan W. Irwin <ir...@be...> +# Copyright (c) 2008 Rafael Laboissiere <ra...@la...> +# Copyright (c) 2008 Andrew Collier <col...@uk...> +# +# 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. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 6 + +AU_ALIAS([SWIG_ENABLE_CXX], [AX_SWIG_ENABLE_CXX]) +AC_DEFUN([AX_SWIG_ENABLE_CXX],[ + AC_REQUIRE([AX_PKG_SWIG]) + AC_REQUIRE([AC_PROG_CXX]) + SWIG="$SWIG -c++" +]) Added: trunk/m4/ax_swig_multi_module_support.m4 =================================================================== --- trunk/m4/ax_swig_multi_module_support.m4 (rev 0) +++ trunk/m4/ax_swig_multi_module_support.m4 2012-03-29 17:24:45 UTC (rev 129) @@ -0,0 +1,56 @@ +# ================================================================================ +# http://www.gnu.org/software/autoconf-archive/ax_swig_multi_module_support.html +# ================================================================================ +# +# SYNOPSIS +# +# AX_SWIG_MULTI_MODULE_SUPPORT +# +# DESCRIPTION +# +# Enable support for multiple modules. This effects all invocations of +# $(SWIG). You have to link all generated modules against the appropriate +# SWIG runtime library. If you want to build Python modules for example, +# use the AX_SWIG_PYTHON macro and link the modules against +# $(AX_SWIG_PYTHON_LIBS). +# +# LICENSE +# +# Copyright (c) 2008 Sebastian Huber <seb...@we...> +# Copyright (c) 2008 Alan W. Irwin <ir...@be...> +# Copyright (c) 2008 Rafael Laboissiere <ra...@la...> +# Copyright (c) 2008 Andrew Collier <col...@uk...> +# +# 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. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 7 + +AU_ALIAS([SWIG_MULTI_MODULE_SUPPORT], [AX_SWIG_MULTI_MODULE_SUPPORT]) +AC_DEFUN([AX_SWIG_MULTI_MODULE_SUPPORT],[ + AC_REQUIRE([AX_PKG_SWIG]) + SWIG="$SWIG -noruntime" +]) Added: trunk/m4/ax_swig_python.m4 =================================================================== --- trunk/m4/ax_swig_python.m4 (rev 0) +++ trunk/m4/ax_swig_python.m4 2012-03-29 17:24:45 UTC (rev 129) @@ -0,0 +1,64 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_swig_python.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_SWIG_PYTHON([use-shadow-classes = {no, yes}]) +# +# DESCRIPTION +# +# Checks for Python and provides the $(AX_SWIG_PYTHON_CPPFLAGS), and +# $(AX_SWIG_PYTHON_OPT) output variables. +# +# $(AX_SWIG_PYTHON_OPT) contains all necessary SWIG options to generate +# code for Python. Shadow classes are enabled unless the value of the +# optional first argument is exactly 'no'. If you need multi module +# support (provided by the AX_SWIG_MULTI_MODULE_SUPPORT macro) use +# $(AX_SWIG_PYTHON_LIBS) to link against the appropriate library. It +# contains the SWIG Python runtime library that is needed by the type +# check system for example. +# +# LICENSE +# +# Copyright (c) 2008 Sebastian Huber <seb...@we...> +# Copyright (c) 2008 Alan W. Irwin <ir...@be...> +# Copyright (c) 2008 Rafael Laboissiere <ra...@la...> +# Copyright (c) 2008 Andrew Collier <col...@uk...> +# +# 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. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 7 + +AU_ALIAS([SWIG_PYTHON], [AX_SWIG_PYTHON]) +AC_DEFUN([AX_SWIG_PYTHON],[ + AC_REQUIRE([AX_PKG_SWIG]) + AC_REQUIRE([AX_PYTHON_DEVEL]) + test "x$1" != "xno" || swig_shadow=" -noproxy" + AC_SUBST([AX_SWIG_PYTHON_OPT],[-python$swig_shadow]) + AC_SUBST([AX_SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS]) +]) Deleted: trunk/m4/swig_multi_module_support.m4 =================================================================== --- trunk/m4/swig_multi_module_support.m4 2012-03-29 12:23:04 UTC (rev 128) +++ trunk/m4/swig_multi_module_support.m4 2012-03-29 17:24:45 UTC (rev 129) @@ -1,59 +0,0 @@ -##### http://autoconf-archive.cryp.to/swig_multi_module_support.html -# -# SYNOPSIS -# -# SWIG_MULTI_MODULE_SUPPORT -# -# DESCRIPTION -# -# Enable support for multiple modules. This effects all invocations -# of $(SWIG). You have to link all generated modules against the -# appropriate SWIG runtime library. If you want to build Python -# modules for example, use the SWIG_PYTHON macro and link the modules -# against $(SWIG_PYTHON_LIBS). -# -# LAST MODIFICATION -# -# 2006-10-22 -# -# COPYLEFT -# -# Copyright (c) 2006 Sebastian Huber <seb...@we...> -# Copyright (c) 2006 Alan W. Irwin <ir...@be...> -# Copyright (c) 2006 Rafael Laboissiere <ra...@la...> -# Copyright (c) 2006 Andrew Collier <col...@uk...> -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. -# -# As a special exception, the respective Autoconf Macro's copyright -# owner gives unlimited permission to copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts, even though -# portions of the text of the Macro appear in them. The GNU General -# Public License (GPL) does govern all other use of the material that -# constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the -# Autoconf Macro released by the Autoconf Macro Archive. When you -# make and distribute a modified version of the Autoconf Macro, you -# may extend this special exception to the GPL to apply to your -# modified version as well. - -AC_DEFUN([SWIG_MULTI_MODULE_SUPPORT],[ - AC_REQUIRE([AC_PROG_SWIG]) - SWIG="$SWIG -noruntime" -]) Deleted: trunk/m4/swig_python.m4 =================================================================== --- trunk/m4/swig_python.m4 2012-03-29 12:23:04 UTC (rev 128) +++ trunk/m4/swig_python.m4 2012-03-29 17:24:45 UTC (rev 129) @@ -1,67 +0,0 @@ -##### http://autoconf-archive.cryp.to/swig_python.html -# -# SYNOPSIS -# -# SWIG_PYTHON([use-shadow-classes = {no, yes}]) -# -# DESCRIPTION -# -# Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS), and -# $(SWIG_PYTHON_OPT) output variables. -# -# $(SWIG_PYTHON_OPT) contains all necessary SWIG options to generate -# code for Python. Shadow classes are enabled unless the value of the -# optional first argument is exactly 'no'. If you need multi module -# support (provided by the SWIG_MULTI_MODULE_SUPPORT macro) use -# $(SWIG_PYTHON_LIBS) to link against the appropriate library. It -# contains the SWIG Python runtime library that is needed by the type -# check system for example. -# -# LAST MODIFICATION -# -# 2006-10-22 -# -# COPYLEFT -# -# Copyright (c) 2006 Sebastian Huber <seb...@we...> -# Copyright (c) 2006 Alan W. Irwin <ir...@be...> -# Copyright (c) 2006 Rafael Laboissiere <ra...@la...> -# Copyright (c) 2006 Andrew Collier <col...@uk...> -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. -# -# As a special exception, the respective Autoconf Macro's copyright -# owner gives unlimited permission to copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts, even though -# portions of the text of the Macro appear in them. The GNU General -# Public License (GPL) does govern all other use of the material that -# constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the -# Autoconf Macro released by the Autoconf Macro Archive. When you -# make and distribute a modified version of the Autoconf Macro, you -# may extend this special exception to the GPL to apply to your -# modified version as well. - -AC_DEFUN([SWIG_PYTHON],[ - AC_REQUIRE([AC_PROG_SWIG]) - AC_REQUIRE([AC_PYTHON_DEVEL]) - test "x$1" != "xno" || swig_shadow=" -noproxy" - AC_SUBST([SWIG_PYTHON_OPT],[-python$swig_shadow]) - AC_SUBST([SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS]) -]) Modified: trunk/swig/python/Makefile.am =================================================================== --- trunk/swig/python/Makefile.am 2012-03-29 12:23:04 UTC (rev 128) +++ trunk/swig/python/Makefile.am 2012-03-29 17:24:45 UTC (rev 129) @@ -3,15 +3,15 @@ BUILT_SOURCES = $(srcdir)/xtract_wrap.c SWIG_SOURCES = ../xtract.i -pkgpython_PYTHON = xtract.py +pkgpython_PYTHON = xtract.py __init__.py pkgpyexec_LTLIBRARIES = _xtract.la _xtract_la_SOURCES = $(srcdir)/xtract_wrap.c $(SWIG_SOURCES) _xtract_la_CFLAGS = $(SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir)/src _xtract_la_LDFLAGS = -module -lxtract _xtract_la_LIBADD = $(top_srcdir)/src/libxtract.la -xtract_wrap.c : $(SWIG_SOURCES) - $(SWIG) $(SWIG_PYTHON_OPT) -I$(top_srcdir) -o $@ $< +$(srcdir)/xtract_wrap.c : $(SWIG_SOURCES) + $(SWIG) $(AX_SWIG_PYTHON_OPT) -I$(top_srcdir) -o $@ $< clean-local: -rm -f _xtract.so xtract.py xtract_wrap.c xtract.pyc Added: trunk/swig/python/__init__.py =================================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pos...@us...> - 2012-03-30 13:26:51
|
Revision: 131 http://libxtract.svn.sourceforge.net/libxtract/?rev=131&view=rev Author: postlude Date: 2012-03-30 13:26:41 +0000 (Fri, 30 Mar 2012) Log Message: ----------- - minor SWIG fix - renamed configure.in to configure.ac - increment fix number Modified Paths: -------------- trunk/swig/python/Makefile.am Added Paths: ----------- trunk/configure.ac Removed Paths: ------------- trunk/configure.in Copied: trunk/configure.ac (from rev 129, trunk/configure.in) =================================================================== --- trunk/configure.ac (rev 0) +++ trunk/configure.ac 2012-03-30 13:26:41 UTC (rev 131) @@ -0,0 +1,355 @@ +AC_PREREQ(2.13) +# Increment for major API changes, release status changes +m4_define(libxtract_major_version, 0) +# Increment for feature additions and enhancements +m4_define(libxtract_minor_version, 6) +# Increment for fixes +m4_define(libxtract_fix_version, 5) +# Development status +m4_define(libIntegra_dev_status, [beta]) + +m4_define(libxtract_version, libxtract_major_version.libxtract_minor_version.libxtract_fix_version) + +PACKAGE=libxtract + +AC_INIT([libxtract], [libxtract_version], [lib...@li...]) +AC_DEFINE(LIBXTRACT_VERSION, libxtract_version, [LibXtract Version]) +dnl AM_INIT_AUTOMAKE($PACKAGE, $LIBXTRACT_VERSION) +AM_INIT_AUTOMAKE(1.6) +AM_CONFIG_HEADER(config.h) +AC_CONFIG_MACRO_DIR([m4]) +AC_PROG_CC +AC_PROG_LIBTOOL +AC_PROG_INSTALL +AC_C_BIGENDIAN +AC_PATH_PROG(PKG_CONFIG, pkg-config, no) +AC_ENABLE_STATIC(no) +AC_ENABLE_SHARED(yes) +AC_PROG_LIBTOOL +AC_CHECK_HEADERS([math.h, stdlib.h, stdio.h]) +AC_CHECK_PROG([DOXYGEN], [doxygen], [doc], []) +AC_SUBST(DOXYGEN) + +AC_ARG_ENABLE(fft, + [ --enable-fft Turn fft-based fft processing on], + [case "${enableval}" in + yes) fft=true ;; + no) fft=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-fft) ;; + esac],[fft=false]) + +AC_ARG_ENABLE(pd_example, + [ --enable-pd_example Compile the Pure Data external example], + [case "${enableval}" in + yes) pd_example=true ;; + no) pd_example=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;; + esac],[pd_example=false]) + +AC_ARG_ENABLE(simpletest, + [ --enable-simpletest Compile the 'simpletest' example], + [case "${enableval}" in + yes) simpletest=true ;; + no) simpletest=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-simpletest) ;; + esac],[simpletest=false]) + +# libtool version: current:revision:age +# +# If the library source code has changed at all since the last update, then +# increment revision (`c:r:a' becomes `c:r+1:a'). +# +# If any interfaces have been added, removed, or changed since the last update, +# increment current, and set revision to 0. +# +# If any interfaces have been added since the last public release, then +# increment age. +# +# If any interfaces have been removed since the last public release, then set +# age to 0. +XTRACT_SO_VERSION=0:0:0 + +CFLAGS="$CFLAGS -pedantic -ansi -fno-strict-aliasing -Wall -std=c99 -I/usr/local/include" +LDFLAGS="$LDFLAGS -lm" + +AC_ARG_WITH(pd_dir, + [ --with-pd-dir=path pd header path (default=/usr/local/include) ], + [ + CFLAGS="$CFLAGS -I$withval" + echo + echo "pd dir is $withval" + echo + ]) + +AC_ARG_WITH(fftw3_dir, + [ --with-fftw3-dir=path fftw3 header path (default=/usr/local/include) ], + [ + CFLAGS="$CFLAGS -I$withval" + echo + echo "fftw3 dir is $withval" + echo + ]) + +dnl Set FFT optimisation level +AC_ARG_WITH(fft_optimisation, + [ --with-fft_optimisation=level set fft optimistaion level (default=1)], + [ + FFT_OPTIMISATION="$withval" + echo + echo "fft optimisation level is $withval" + echo + ]) + +dnl set a specific java compiler +AC_ARG_WITH(javac, + [ --with-javac=compiler set a specific java compiler (determined automatically if not set) ], + [JAVAC="$withval" + echo + echo "JAVAC is set to $withval" + echo + ]) + +dnl If --enable-swig, make with java bindings +AC_ARG_WITH(java, + [ --with-java If --enable-swig - make with java bindings (default=no) ], + [with_java=true]) + +AM_CONDITIONAL(BUILD_JAVA, test "x${with_java}" = 'xtrue') + +dnl If --enable-swig, make with java bindings +AC_ARG_WITH(python, + [ --with-python If --enable-swig - make with python bindings (default=no) ], [with_python=true]) + +AM_CONDITIONAL(BUILD_PYTHON, test "x${with_python}" = 'xtrue') + + +dnl are we building the simpletest example +if [[ "$simpletest" = "true" ]] ; then + AC_DEFINE([BUILD_SIMPLETEST], [1], [Build the simpletest example]) +fi + +AM_CONDITIONAL(BUILD_SIMPLETEST, test "x${simpletest}" = 'xtrue') + +dnl Are we building the PD examples? +if [[ "$pd_example" = "true" ]] ; then + PD_SOURCES="xtract~.c" + AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example]) + AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [ + have_pd_hdr=no + echo + echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src" + echo + exit + ]) +fi + +AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue') + + +dnl Enable debugging (no) +AC_ARG_ENABLE(debug, + [ --enable-debug[[=value]] compile with debug [[default=no]]], + with_debug="yes", + with_debug="no") +if test "$with_debug" = "yes" +then + AC_DEFINE(DEBUG,1,[Define to enable debug]) + CFLAGS="$CFLAGS -O0 -ggdb -g -Werror" +fi + +AC_ARG_ENABLE(swig, + [ --enable-swig Generate swig bindings], + [case "${enableval}" in + yes) swig=true ;; + no) swig=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-swig) ;; + esac],[swig=false]) + + + +if [[ "$with_java" = "true" ]] ; then + if test "$JAVAC" = "" + then + AC_PROG_JAVAC + fi + if test "$JAVAC" = "javac" + then + AC_JNI_INCLUDE_DIR + + for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS + do + CFLAGS="$CFLAGS -I$JNI_INCLUDE_DIR" + done + fi + dnl AC_PROG_JAVAH + dnl AC_PATH_PROG(JAVAH,javah) +fi + +if [[ "$with_python" = "true" ]] ; then + AM_PATH_PYTHON + SWIG_PYTHON +fi + + +AM_CONDITIONAL(BUILD_SWIG, test "x${swig}" = 'xtrue') + +dnl SWIG stuff +if [[ "$swig" = "true" ]] ; then + AX_PKG_SWIG(1.3.21) + AC_DEFINE([BUILD_SWIG], [1], [Build the swig bindings]) +fi + +dnl Are we building with fftw? +if [[ "$fft" = "true" ]] ; then + LDFLAGS="$LDFLAGS -lfftw3f" + AC_DEFINE([BUILD_FFT], [1], [Build the fft functions]) + if test "$FFT_OPTIMISATION" = "" + then + AC_DEFINE([XTRACT_FFT_OPTIMISATION_LEVEL], [1], [fft optimisation 1]) + else + # AC_SUBST(OPTIMISATION_LEVEL, "$FFT_OPTIMISATION") + AC_DEFINE_UNQUOTED(XTRACT_FFT_OPTIMISATION_LEVEL, ${FFT_OPTIMISATION}) + fi + AC_CHECK_HEADER(fftw3.h, [have_fftw3_hdr=yes ], [ + have_pd_hdr=no + echo + echo "no fftw3.h header found. try with option --with-fftw3-dir=/path/to/fftw3/header" + echo + exit + ]) +fi + +AM_CONDITIONAL(BUILD_FFT, test "x${fft}" = 'xtrue') + +dnl Check for architecture endian-ness +#AC_C_BIGENDIAN(bigendian=true, bigendian=false, bigendian=undefined) +#if [[ "$is_bigendian" = "false" ]] ; then +# AC_DEFINE([WORDS_BIGENDIAN], [0], [Architecture is big endian]) +#else +# AC_DEFINE([WORDS_BIGENDIAN], [1], [Architecture is not big endian]) +#fi + + +dnl ------------------------------------------ +dnl ---- do some magic to gues the host opsys +dnl ---- taken from libvorbis configure.in +dnl ------------------------------------------ +dnl AC_CANONICAL_HOST + +dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1") +dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared") +dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl" +if test -z "$GCC"; then + case $host in + *-*-irix*) + dnl If we're on IRIX, we wanna use cc even if gcc + dnl is there (unless the user has overriden us)... + if test -z "$CC"; then + CC=cc + fi + ;; + sparc-sun-solaris*) + PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92" + ;; + *) + PD_CFLAGS="-O" + ;; + esac +else + + case $host in + *86-*-linux*) + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused" + PD_LDFLAGS="$PD_LDFLAGS -shared" + dnl we could test for bad glibc here, but don't + PD_SUFFIX=pd_linux + ;; + powerpc-*-linux*) + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" + PD_LDFLAGS="$PD_LDFLAGS -shared" + PD_SUFFIX=pd_linux + ;; + *-*-linux*) + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC" + PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic" + PD_SUFFIX=pd_linux + ;; + sparc-sun-*) + echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet" + ;; + *86-*-darwin*) + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" + PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.3 -undefined dynamic_lookup -single_module" + PD_SUFFIX=pd_darwin + ;; + *-*-darwin*) + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" + PD_LDFLAGS="$PD_LDFLAGS -bundle -arch ppc -undefined suppress -flat_namespace" + PD_SUFFIX=pd_darwin + ;; + + *) + dnl assume unix + PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" + PD_LDFLAGS="$PD_LDFLAGS -shared" + PD_SUFFIX=pd_linux + ;; + esac +fi + +PD_CFLAGS="$PD_CFLAGS -DPD" + +AC_SUBST(PD_CFLAGS) +AC_SUBST(PD_LDFLAGS) +AC_SUBST(PD_SUFFIX) +AC_SUBST(PD_SOURCES) + +AC_CONFIG_FILES([doc/documentation.doxygen + libxtract.pc]) + +dnl There must be a better way to do this... +AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/Makefile examples/puredata/Makefile examples/simpletest/Makefile swig/Makefile swig/python/Makefile swig/java/Makefile) + +echo +echo "**************************************************************" +echo +echo "Summary:" +echo +dnl echo you are using the ${host} architecture + +if test "$fft" = "true"; then + echo "fft: yes (using fftw3f)" +else + echo "fft: no (not using fftw3, no fft functions)" +fi +if test "$simpletest" = "true"; then + echo "simpletest example: yes" +else + echo "simpletest example: no" +fi +if test "$pd_example" = "true"; then + echo "PD external: yes" + echo + echo "The PD help files will be installed in:" + echo ${prefix}"/lib/doc/5.reference/xtract/" + echo "You must make sure that this is in your PD help path" +else + echo "PD external: no" +fi +if test "$swig" == "true"; then + echo "SWIG bindings: yes" +else + echo "SWIG bindings: no" +fi +if test "$with_java" == "true"; then + echo "with JAVA module: yes" +else + echo "with JAVA module: no" +fi +echo +echo "**************************************************************" +echo +echo Configuration completed successfully. Type \'make\' to build ${PACKAGE} +echo + + Deleted: trunk/configure.in =================================================================== --- trunk/configure.in 2012-03-30 13:13:52 UTC (rev 130) +++ trunk/configure.in 2012-03-30 13:26:41 UTC (rev 131) @@ -1,355 +0,0 @@ -AC_PREREQ(2.13) -# Increment for major API changes, release status changes -m4_define(libxtract_major_version, 0) -# Increment for feature additions and enhancements -m4_define(libxtract_minor_version, 6) -# Increment for fixes -m4_define(libxtract_fix_version, 4) -# Development status -m4_define(libIntegra_dev_status, [beta]) - -m4_define(libxtract_version, libxtract_major_version.libxtract_minor_version.libxtract_fix_version) - -PACKAGE=libxtract - -AC_INIT([libxtract], [libxtract_version], [lib...@li...]) -AC_DEFINE(LIBXTRACT_VERSION, libxtract_version, [LibXtract Version]) -dnl AM_INIT_AUTOMAKE($PACKAGE, $LIBXTRACT_VERSION) -AM_INIT_AUTOMAKE(1.6) -AM_CONFIG_HEADER(config.h) -AC_CONFIG_MACRO_DIR([m4]) -AC_PROG_CC -AC_PROG_LIBTOOL -AC_PROG_INSTALL -AC_C_BIGENDIAN -AC_PATH_PROG(PKG_CONFIG, pkg-config, no) -AC_ENABLE_STATIC(no) -AC_ENABLE_SHARED(yes) -AC_PROG_LIBTOOL -AC_CHECK_HEADERS([math.h, stdlib.h, stdio.h]) -AC_CHECK_PROG([DOXYGEN], [doxygen], [doc], []) -AC_SUBST(DOXYGEN) - -AC_ARG_ENABLE(fft, - [ --enable-fft Turn fft-based fft processing on], - [case "${enableval}" in - yes) fft=true ;; - no) fft=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-fft) ;; - esac],[fft=false]) - -AC_ARG_ENABLE(pd_example, - [ --enable-pd_example Compile the Pure Data external example], - [case "${enableval}" in - yes) pd_example=true ;; - no) pd_example=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;; - esac],[pd_example=false]) - -AC_ARG_ENABLE(simpletest, - [ --enable-simpletest Compile the 'simpletest' example], - [case "${enableval}" in - yes) simpletest=true ;; - no) simpletest=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-simpletest) ;; - esac],[simpletest=false]) - -# libtool version: current:revision:age -# -# If the library source code has changed at all since the last update, then -# increment revision (`c:r:a' becomes `c:r+1:a'). -# -# If any interfaces have been added, removed, or changed since the last update, -# increment current, and set revision to 0. -# -# If any interfaces have been added since the last public release, then -# increment age. -# -# If any interfaces have been removed since the last public release, then set -# age to 0. -XTRACT_SO_VERSION=0:0:0 - -CFLAGS="$CFLAGS -pedantic -ansi -fno-strict-aliasing -Wall -std=c99 -I/usr/local/include" -LDFLAGS="$LDFLAGS -lm" - -AC_ARG_WITH(pd_dir, - [ --with-pd-dir=path pd header path (default=/usr/local/include) ], - [ - CFLAGS="$CFLAGS -I$withval" - echo - echo "pd dir is $withval" - echo - ]) - -AC_ARG_WITH(fftw3_dir, - [ --with-fftw3-dir=path fftw3 header path (default=/usr/local/include) ], - [ - CFLAGS="$CFLAGS -I$withval" - echo - echo "fftw3 dir is $withval" - echo - ]) - -dnl Set FFT optimisation level -AC_ARG_WITH(fft_optimisation, - [ --with-fft_optimisation=level set fft optimistaion level (default=1)], - [ - FFT_OPTIMISATION="$withval" - echo - echo "fft optimisation level is $withval" - echo - ]) - -dnl set a specific java compiler -AC_ARG_WITH(javac, - [ --with-javac=compiler set a specific java compiler (determined automatically if not set) ], - [JAVAC="$withval" - echo - echo "JAVAC is set to $withval" - echo - ]) - -dnl If --enable-swig, make with java bindings -AC_ARG_WITH(java, - [ --with-java If --enable-swig - make with java bindings (default=no) ], - [with_java=true]) - -AM_CONDITIONAL(BUILD_JAVA, test "x${with_java}" = 'xtrue') - -dnl If --enable-swig, make with java bindings -AC_ARG_WITH(python, - [ --with-python If --enable-swig - make with python bindings (default=no) ], [with_python=true]) - -AM_CONDITIONAL(BUILD_PYTHON, test "x${with_python}" = 'xtrue') - - -dnl are we building the simpletest example -if [[ "$simpletest" = "true" ]] ; then - AC_DEFINE([BUILD_SIMPLETEST], [1], [Build the simpletest example]) -fi - -AM_CONDITIONAL(BUILD_SIMPLETEST, test "x${simpletest}" = 'xtrue') - -dnl Are we building the PD examples? -if [[ "$pd_example" = "true" ]] ; then - PD_SOURCES="xtract~.c" - AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example]) - AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [ - have_pd_hdr=no - echo - echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src" - echo - exit - ]) -fi - -AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue') - - -dnl Enable debugging (no) -AC_ARG_ENABLE(debug, - [ --enable-debug[[=value]] compile with debug [[default=no]]], - with_debug="yes", - with_debug="no") -if test "$with_debug" = "yes" -then - AC_DEFINE(DEBUG,1,[Define to enable debug]) - CFLAGS="$CFLAGS -O0 -ggdb -g -Werror" -fi - -AC_ARG_ENABLE(swig, - [ --enable-swig Generate swig bindings], - [case "${enableval}" in - yes) swig=true ;; - no) swig=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-swig) ;; - esac],[swig=false]) - - - -if [[ "$with_java" = "true" ]] ; then - if test "$JAVAC" = "" - then - AC_PROG_JAVAC - fi - if test "$JAVAC" = "javac" - then - AC_JNI_INCLUDE_DIR - - for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS - do - CFLAGS="$CFLAGS -I$JNI_INCLUDE_DIR" - done - fi - dnl AC_PROG_JAVAH - dnl AC_PATH_PROG(JAVAH,javah) -fi - -if [[ "$with_python" = "true" ]] ; then - AM_PATH_PYTHON - SWIG_PYTHON -fi - - -AM_CONDITIONAL(BUILD_SWIG, test "x${swig}" = 'xtrue') - -dnl SWIG stuff -if [[ "$swig" = "true" ]] ; then - AX_PKG_SWIG(1.3.21) - AC_DEFINE([BUILD_SWIG], [1], [Build the swig bindings]) -fi - -dnl Are we building with fftw? -if [[ "$fft" = "true" ]] ; then - LDFLAGS="$LDFLAGS -lfftw3f" - AC_DEFINE([BUILD_FFT], [1], [Build the fft functions]) - if test "$FFT_OPTIMISATION" = "" - then - AC_DEFINE([XTRACT_FFT_OPTIMISATION_LEVEL], [1], [fft optimisation 1]) - else - # AC_SUBST(OPTIMISATION_LEVEL, "$FFT_OPTIMISATION") - AC_DEFINE_UNQUOTED(XTRACT_FFT_OPTIMISATION_LEVEL, ${FFT_OPTIMISATION}) - fi - AC_CHECK_HEADER(fftw3.h, [have_fftw3_hdr=yes ], [ - have_pd_hdr=no - echo - echo "no fftw3.h header found. try with option --with-fftw3-dir=/path/to/fftw3/header" - echo - exit - ]) -fi - -AM_CONDITIONAL(BUILD_FFT, test "x${fft}" = 'xtrue') - -dnl Check for architecture endian-ness -#AC_C_BIGENDIAN(bigendian=true, bigendian=false, bigendian=undefined) -#if [[ "$is_bigendian" = "false" ]] ; then -# AC_DEFINE([WORDS_BIGENDIAN], [0], [Architecture is big endian]) -#else -# AC_DEFINE([WORDS_BIGENDIAN], [1], [Architecture is not big endian]) -#fi - - -dnl ------------------------------------------ -dnl ---- do some magic to gues the host opsys -dnl ---- taken from libvorbis configure.in -dnl ------------------------------------------ -dnl AC_CANONICAL_HOST - -dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1") -dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared") -dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl" -if test -z "$GCC"; then - case $host in - *-*-irix*) - dnl If we're on IRIX, we wanna use cc even if gcc - dnl is there (unless the user has overriden us)... - if test -z "$CC"; then - CC=cc - fi - ;; - sparc-sun-solaris*) - PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92" - ;; - *) - PD_CFLAGS="-O" - ;; - esac -else - - case $host in - *86-*-linux*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused" - PD_LDFLAGS="$PD_LDFLAGS -shared" - dnl we could test for bad glibc here, but don't - PD_SUFFIX=pd_linux - ;; - powerpc-*-linux*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - PD_LDFLAGS="$PD_LDFLAGS -shared" - PD_SUFFIX=pd_linux - ;; - *-*-linux*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC" - PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic" - PD_SUFFIX=pd_linux - ;; - sparc-sun-*) - echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet" - ;; - *86-*-darwin*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.3 -undefined dynamic_lookup -single_module" - PD_SUFFIX=pd_darwin - ;; - *-*-darwin*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - PD_LDFLAGS="$PD_LDFLAGS -bundle -arch ppc -undefined suppress -flat_namespace" - PD_SUFFIX=pd_darwin - ;; - - *) - dnl assume unix - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" - PD_LDFLAGS="$PD_LDFLAGS -shared" - PD_SUFFIX=pd_linux - ;; - esac -fi - -PD_CFLAGS="$PD_CFLAGS -DPD" - -AC_SUBST(PD_CFLAGS) -AC_SUBST(PD_LDFLAGS) -AC_SUBST(PD_SUFFIX) -AC_SUBST(PD_SOURCES) - -AC_CONFIG_FILES([doc/documentation.doxygen - libxtract.pc]) - -dnl There must be a better way to do this... -AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/Makefile examples/puredata/Makefile examples/simpletest/Makefile swig/Makefile swig/python/Makefile swig/java/Makefile) - -echo -echo "**************************************************************" -echo -echo "Summary:" -echo -dnl echo you are using the ${host} architecture - -if test "$fft" = "true"; then - echo "fft: yes (using fftw3f)" -else - echo "fft: no (not using fftw3, no fft functions)" -fi -if test "$simpletest" = "true"; then - echo "simpletest example: yes" -else - echo "simpletest example: no" -fi -if test "$pd_example" = "true"; then - echo "PD external: yes" - echo - echo "The PD help files will be installed in:" - echo ${prefix}"/lib/doc/5.reference/xtract/" - echo "You must make sure that this is in your PD help path" -else - echo "PD external: no" -fi -if test "$swig" == "true"; then - echo "SWIG bindings: yes" -else - echo "SWIG bindings: no" -fi -if test "$with_java" == "true"; then - echo "with JAVA module: yes" -else - echo "with JAVA module: no" -fi -echo -echo "**************************************************************" -echo -echo Configuration completed successfully. Type \'make\' to build ${PACKAGE} -echo - - Modified: trunk/swig/python/Makefile.am =================================================================== --- trunk/swig/python/Makefile.am 2012-03-30 13:13:52 UTC (rev 130) +++ trunk/swig/python/Makefile.am 2012-03-30 13:26:41 UTC (rev 131) @@ -6,7 +6,7 @@ pkgpython_PYTHON = xtract.py __init__.py pkgpyexec_LTLIBRARIES = _xtract.la _xtract_la_SOURCES = $(srcdir)/xtract_wrap.c $(SWIG_SOURCES) -_xtract_la_CFLAGS = $(SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir)/src +_xtract_la_CFLAGS = $(AX_SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir)/src _xtract_la_LDFLAGS = -module -lxtract _xtract_la_LIBADD = $(top_srcdir)/src/libxtract.la This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pos...@us...> - 2012-05-31 18:35:23
|
Revision: 132 http://libxtract.svn.sourceforge.net/libxtract/?rev=132&view=rev Author: postlude Date: 2012-05-31 18:35:17 +0000 (Thu, 31 May 2012) Log Message: ----------- - added "README.MOVED" - don't support PPC any more Modified Paths: -------------- trunk/configure.ac trunk/examples/MSP/Makefile Added Paths: ----------- README.MOVED Added: README.MOVED =================================================================== --- README.MOVED (rev 0) +++ README.MOVED 2012-05-31 18:35:17 UTC (rev 132) @@ -0,0 +1,3 @@ +This project has now moved to http://github.com/jamiebullock/LibXtract. + +Please update your links. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2012-03-30 13:26:41 UTC (rev 131) +++ trunk/configure.ac 2012-05-31 18:35:17 UTC (rev 132) @@ -277,14 +277,14 @@ sparc-sun-*) echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet" ;; - *86-*-darwin*) - PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.3 -undefined dynamic_lookup -single_module" - PD_SUFFIX=pd_darwin - ;; + dnl *86-*-darwin*) + dnl PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" + dnl PD_LDFLAGS="$PD_LDFLAGS -dynamiclib -mmacosx-version-min=10.5 -undefined dynamic_lookup -single_module" + dnl PD_SUFFIX=pd_darwin + dnl ;; *-*-darwin*) PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes" - PD_LDFLAGS="$PD_LDFLAGS -bundle -arch ppc -undefined suppress -flat_namespace" + PD_LDFLAGS="$PD_LDFLAGS -bundle -undefined dynamic_lookup -flat_namespace" PD_SUFFIX=pd_darwin ;; Modified: trunk/examples/MSP/Makefile =================================================================== --- trunk/examples/MSP/Makefile 2012-03-30 13:26:41 UTC (rev 131) +++ trunk/examples/MSP/Makefile 2012-05-31 18:35:17 UTC (rev 132) @@ -16,35 +16,24 @@ #DEBUG_FLAGS = -Werror -Wall -CFLAGS = -F$(FRAMEWORKS) -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -x c -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -fmessage-length=0 -I$(MAXINCLUDE) -I$(MSPINCLUDE) -include macho-prefix.pch $(DEBUG_FLAGS) -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -I$(XTRACT_HEADERS) +CFLAGS = -F$(FRAMEWORKS) -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -x c -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -fmessage-length=0 -I$(MAXINCLUDE) -I$(MSPINCLUDE) $(DEBUG_FLAGS) -I$(XTRACT_HEADERS) I386CFLAGS = -arch i386 IX86_64CFLAGS = -arch x86_64 -PPCCFLAGS = -arch ppc -faltivec -fasm-blocks -Wno-unused LDFLAGS = -F$(FRAMEWORKS) -L$(MAXINCLUDE) -L$(MSPINCLUDE) -framework Carbon -framework MaxAPI -framework MaxAudioAPI -Wl,-Y,1455 -bundle -L/usr/local/lib -lxtract $(FFTW_LIBS) I386LDFLAGS = -arch i386 IX86_64CFLAGS = -arch x86_64 -PPCLDFLAGS = -arch ppc universal: $(CC) $(CFLAGS) $(I386CFLAGS) -o $(NAME)-i386.o -c $(NAME).c - $(CC) $(CFLAGS) $(PPCCFLAGS) -o $(NAME)-ppc.o -c $(NAME).c $(CC) $(LDFLAGS) $(I386LDFLAGS) -o $(NAME)-i386 $(NAME)-i386.o - $(CC) $(LDFLAGS) $(PPCLDFLAGS) -o $(NAME)-ppc $(NAME)-ppc.o - $(LIPO) -create $(NAME)-ppc $(NAME)-i386 -output $(NAME) + $(LIPO) -create $(NAME)-i386 -output $(NAME) mkdir -p $(NAME).mxo/Contents/MacOS cp Info.plist PkgInfo $(NAME).mxo/Contents/ cp $(NAME) $(NAME).mxo/Contents/MacOS -ppc: - $(CC) $(CFLAGS) $(PPCCFLAGS) -o $(NAME)-ppc.o -c $(NAME).c - $(CC) $(LDFLAGS) $(PPCLDFLAGS) -o $(NAME)-ppc $(NAME)-ppc.o - $(LIPO) -create $(NAME)-ppc -output $(NAME) - mkdir -p $(NAME).mxo/Contents/MacOS - cp Info.plist PkgInfo $(NAME).mxo/Contents/ - cp $(NAME) $(NAME).mxo/Contents/MacOS intel: $(CC) $(CFLAGS) $(I386CFLAGS) -o $(NAME)-i386.o -c $(NAME).c @@ -65,7 +54,7 @@ clean: - rm -rf *64* *i386* *ppc* xtract~ *.mxo + rm -rf *64* *i386* xtract~ *.mxo install: $(INSTALL) cp -r $(NAME).mxo $(INSTALLDIR) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |