shithub: sox

Download patch

ref: 1b54416708f1fa59434574c85c5bfecf8d309b9d
parent: 682f27118bb80696ac29f5051e51685ecd067576
author: cbagwell <cbagwell>
date: Mon Sep 3 14:43:44 EDT 2007

Have autoconf invoke internal libgsm.  Needed for "make dist" to work.

--- a/Makefile.am
+++ b/Makefile.am
@@ -2,11 +2,11 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = lpc10 @LIBGSM_SUBDIR@ src
+SUBDIRS = lpc10 @LIBGSM_SUBDIR@ src/libgsm src
 if HAVE_LIBLTDL
 SUBDIRS += libltdl
 endif
-DIST_SUBDIRS = libltdl lpc10 src
+DIST_SUBDIRS = libltdl lpc10 src/libgsm src
 
 RM = rm -f
 
--- a/configure.ac
+++ b/configure.ac
@@ -189,7 +189,8 @@
 AC_SUBST(LIBGSM_SUBDIR)
 AC_SUBST(LIBGSM_LIBADD)
 AC_SUBST(GSM_LIBS)
-     
+AM_CONDITIONAL(EXTERNAL_GSM, test x$found_libgsm = xyes)
+
 dnl Check for libsndfile
 AC_ARG_WITH(sndfile, AC_HELP_STRING([--with-sndfile],
     [Use libsndfile if present (default is yes)]),
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -280,13 +280,10 @@
 #end !HAVE_LIBLTDL
 endif
 
-EXTRA_DIST = tests.sh testall.sh tests.bat testall.bat monkey.au monkey.wav libgsm sox_sample_test.c
+EXTRA_DIST = tests.sh testall.sh tests.bat testall.bat monkey.au monkey.wav sox_sample_test.c
 
 all: sox$(EXEEXT) play rec
 
-libgsm/libgsm.la:
-	$(MAKE) -C libgsm
-
 play rec: sox$(EXEEXT)
 	./sox --help > /dev/null
 	test -f .libs/lt-sox && ( $(RM) $@ && $(LN_S) .libs/lt-sox $@ ) || $(LN_S) sox$(EXEEXT) $@
@@ -298,9 +295,6 @@
 
 clean-local:
 	$(RM) play rec
-	cd libgsm && $(MAKE) clean
 
 distclean-local:
 	$(RM) soxstdint.h
-	cd libgsm && $(MAKE) distclean
-
--- a/src/libgsm/Makefile.am
+++ b/src/libgsm/Makefile.am
@@ -26,8 +26,14 @@
 
 AM_CFLAGS = $(SASR) $(MULHAC) $(FAST) $(LTP_CUT) $(WAV49) 
 
+if EXTERNAL_GSM
+EXTRA_DIST = add.c code.c decode.c long_term.c lpc.c preprocess.c \
+	     rpe.c gsm_destroy.c gsm_decode.c gsm_encode.c gsm_create.c \
+	     gsm_option.c short_term.c table.c private.h gsm.h
+else
 noinst_LTLIBRARIES = libgsm.la
 noinst_HEADERS = gsm.h
-libgsm_la_SOURCES = add.c code.c decode.c long_term.c lpc.c preprocess.c	\
+libgsm_la_SOURCES = add.c code.c decode.c long_term.c lpc.c preprocess.c \
 		rpe.c gsm_destroy.c gsm_decode.c gsm_encode.c gsm_create.c \
 		gsm_option.c short_term.c table.c private.h
+endif