mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-10-27 11:00:32 -04:00 
			
		
		
		
	- Add first rough cut of configure
Note that Makefile should go since it should be rebuilt from Makefile.in by configure. - start_threads now has HAVE_ALSA_ALSASOUND_H - ptt_unix now uses configure HAVE_SYS_PARAM_H Initial *non production* commit I am a little rusty with it, sorry. --db git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@58 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									c6e3d2ec9a
								
							
						
					
					
						commit
						2c36b84bb5
					
				
							
								
								
									
										28
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								Makefile
									
									
									
									
									
								
							| @ -1,22 +1,25 @@ | |||||||
| #
 | #
 | ||||||
| # This part all goes away when configure is written
 | # This part all goes away when configure is written
 | ||||||
|  | # working on it --db
 | ||||||
| #
 | #
 | ||||||
| gcc ?= CC | CC  ?= gcc | ||||||
| CC  ?= cc |  | ||||||
| FC ?= f77 | FC ?= f77 | ||||||
| FC ?= g77 | FFLAGS = -g -O2 | ||||||
| FFLAGS = -O -Wall -fbounds-check | #
 | ||||||
|  | # WSJT specific Fortran flags
 | ||||||
|  | FFLAGS += -Wall -fbounds-check | ||||||
| 
 | 
 | ||||||
| OS=FreeBSD | OS=FreeBSD | ||||||
|  | 
 | ||||||
| G95=/usr/local/bin/g95 | G95=/usr/local/bin/g95 | ||||||
| COMPILER=/usr/local/lib/gcc-lib/i386-unknown-freebsd5.4/4.0.1/ | COMPILER=/usr/local/lib/gcc-lib/i386-unknown-freebsd5.4/4.0.1/ | ||||||
| #OS=Linux
 | #OS=Linux
 | ||||||
| #G95=/usr/bin/g95
 |  | ||||||
| #COMPILER=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/
 | #COMPILER=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/
 | ||||||
| 
 | 
 | ||||||
| PYTHON	?= python | PYTHON	?= /usr/local/bin/python | ||||||
| F2PY	= "f2py.py" | RM	?= /bin/rm | ||||||
| # done to about here (when configure is written)
 | F2PY	= /usr/local/bin/f2py | ||||||
|  | F2PY_PY	= "f2py.py" | ||||||
| 
 | 
 | ||||||
| OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \
 | OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \
 | ||||||
| 	packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \
 | 	packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \
 | ||||||
| @ -30,11 +33,8 @@ SRCS0= 	init_rs.c encode_rs.c decode_rs.c | |||||||
| 
 | 
 | ||||||
| JT65SRCS = JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o | JT65SRCS = JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o | ||||||
| 
 | 
 | ||||||
| #all:	JT65code
 |  | ||||||
| all:	JT65code | all:	JT65code | ||||||
| 
 | 
 | ||||||
| #Audio.so
 |  | ||||||
| 
 |  | ||||||
| JT65code_demo: $(OBJS1) | JT65code_demo: $(OBJS1) | ||||||
| 	$(FC) -o JT65code_demo $(OBJS1) | 	$(FC) -o JT65code_demo $(OBJS1) | ||||||
| 
 | 
 | ||||||
| @ -61,7 +61,7 @@ decode_rs_int.o: decode_rs.c | |||||||
| 	$(CC) -c -DBIGSYM=1 -o decode_rs_int.o decode_rs.c | 	$(CC) -c -DBIGSYM=1 -o decode_rs_int.o decode_rs.c | ||||||
| 
 | 
 | ||||||
| Audio.so: $(OBJS0) | Audio.so: $(OBJS0) | ||||||
| 	 ${PYTHON} ${F2PY} -c --quiet --opt="-O -cpp -D${OS} \
 | 	 ${PYTHON} ${F2PY_PY} -c --quiet --opt="-O -cpp -D${OS} \
 | ||||||
| 	-fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio \
 | 	-fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio \
 | ||||||
| 	--f77exec=${G95} --f90exec=${G95} -L${COMPILER} -lpthread -lg2c \
 | 	--f77exec=${G95} --f90exec=${G95} -L${COMPILER} -lpthread -lg2c \
 | ||||||
| 	only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 \
 | 	only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 \
 | ||||||
| @ -70,9 +70,9 @@ Audio.so: $(OBJS0) | |||||||
| 	ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \
 | 	ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \
 | ||||||
| 	i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \
 | 	i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \
 | ||||||
| 	wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f \
 | 	wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f \
 | ||||||
| 	jtaudio.c ptt_unix.c igray.c wrapkarn.c start_threads.c cutil.c \
 | 	jtaudio.c ptt_bsd.c igray.c wrapkarn.c start_threads.c cutil.c \
 | ||||||
| 	fivehz.f90	 | 	fivehz.f90	 | ||||||
| .PHONY : clean | .PHONY : clean | ||||||
| clean: | clean: | ||||||
| 	rm -f *.o *.so JT65code JT65code_demo | 	${RM} -f *.o *.so JT65code JT65code_demo | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										48
									
								
								conf.h.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								conf.h.in
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,48 @@ | |||||||
|  | /* setup.h.in.  Generated from configure.ac by autoheader.  */ | ||||||
|  | 
 | ||||||
|  | /* Define to 1 if you have the ANSI C header files. */ | ||||||
|  | #undef STDC_HEADERS | ||||||
|  | 
 | ||||||
|  | /* Define to 1 if string.h may be included along with strings.h */ | ||||||
|  | #undef STRING_WITH_STRINGS | ||||||
|  | 
 | ||||||
|  | /* Define to 1 if your processor stores words with the most significant byte
 | ||||||
|  |    first (like Motorola and SPARC, unlike Intel and VAX). */ | ||||||
|  | #undef WORDS_BIGENDIAN | ||||||
|  | 
 | ||||||
|  | /* Enable GNU extensions on systems that have them.  */ | ||||||
|  | #ifndef _GNU_SOURCE | ||||||
|  | # undef _GNU_SOURCE | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
|  | /* This is needed to use strtok_r on Solaris. */ | ||||||
|  | #undef __EXTENSIONS__ | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /* Define to `__inline__' or `__inline' if that's what the C compiler
 | ||||||
|  |    calls it, or to nothing if 'inline' is not supported under any name.  */ | ||||||
|  | #ifndef __cplusplus | ||||||
|  | #undef inline | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
|  | /* Define to `long long' if <sys/types.h> does not define. */ | ||||||
|  | #undef int64_t | ||||||
|  | 
 | ||||||
|  | /* If system does not define sa_family_t, define it here. */ | ||||||
|  | #undef sa_family_t | ||||||
|  | 
 | ||||||
|  | /* If we don't have a real socklen_t, unsigned int is good enough. */ | ||||||
|  | #undef socklen_t | ||||||
|  | 
 | ||||||
|  | /* If system does not define u_int16_t, define a usable substitute. */ | ||||||
|  | #undef u_int16_t | ||||||
|  | 
 | ||||||
|  | /* If system does not define u_int32_t, define to unsigned long int here. */ | ||||||
|  | #undef u_int32_t | ||||||
|  | 
 | ||||||
|  | /* Define to `unsigned long long' if <sys/types.h> does not define. */ | ||||||
|  | #undef uint64_t | ||||||
|  | 
 | ||||||
|  | #undef HAVE_ALSA_ALSASOUND_H | ||||||
|  | #undef HAVE_SYS_SOUNDCARD_H | ||||||
|  | #undef HAVE_AUDIOFILE_H | ||||||
							
								
								
									
										167
									
								
								configure.ac
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										167
									
								
								configure.ac
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,167 @@ | |||||||
|  | dnl $Id$ | ||||||
|  | dnl Process this file with autoconf to produce a configure script. | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | dnl AC_PREREQ(2.59) | ||||||
|  | 
 | ||||||
|  | dnl Sneaky way to get an Id tag into the configure script | ||||||
|  | AC_COPYRIGHT([$Id$]) | ||||||
|  | 
 | ||||||
|  | AC_INIT([wsjt],[0.9]) | ||||||
|  | 
 | ||||||
|  | AC_CONFIG_HEADER(conf.h) | ||||||
|  | 
 | ||||||
|  | AC_PREFIX_DEFAULT(/usr/local/) | ||||||
|  | 
 | ||||||
|  | OLD_CFLAGS="$CFLAGS" | ||||||
|  | dnl Checks for programs. | ||||||
|  | AC_PROG_CC | ||||||
|  | AC_LANG(C) | ||||||
|  | AC_PROG_F77 | ||||||
|  | 
 | ||||||
|  | dnl Make sure autoconf doesn't interfere with cflags -jmallett | ||||||
|  | CFLAGS="$OLD_CFLAGS" | ||||||
|  | 
 | ||||||
|  | AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX]) | ||||||
|  | case `uname -s` in | ||||||
|  | 	CYGWIN*) | ||||||
|  | 		AC_MSG_RESULT(Cygwin) | ||||||
|  | 		CYGWIN=yes | ||||||
|  | 	;; | ||||||
|  | 	SunOS*) | ||||||
|  | 		AC_MSG_RESULT(SunOS or Solaris) | ||||||
|  | 		AC_DEFINE(__EXTENSIONS__, 1, [This is needed to use strtok_r on Solaris.]) | ||||||
|  | 	;; | ||||||
|  | 	*) | ||||||
|  | 		AC_MSG_RESULT(no) | ||||||
|  | 	;; | ||||||
|  | esac | ||||||
|  | 
 | ||||||
|  | if test "$ac_cv_c_compiler_gnu" = yes; then | ||||||
|  | 	AC_MSG_CHECKING(if $CC is Apple GCC) | ||||||
|  | 	 | ||||||
|  | 	if expr "`$CC -v 2>&1 | tail -1`" : ".*Apple" >/dev/null; then | ||||||
|  | 		AppleGCC=yes | ||||||
|  | 	else | ||||||
|  | 		AppleGCC=no | ||||||
|  | 	fi | ||||||
|  | 
 | ||||||
|  | 	AC_MSG_RESULT($AppleGCC) | ||||||
|  | 
 | ||||||
|  | 	WSJT_CFLAGS="$WSJT_CFLAGS -Wall -O0" | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | dnl If we support -g, use it! | ||||||
|  | if test "$ac_cv_prog_cc_g" = yes; then | ||||||
|  | 		WSJT_CFLAGS="$WSJT_CFLAGS -g" | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | dnl jdc -- If CFLAGS is defined, best use it everywhere... | ||||||
|  | dnl NOTE: jv says it must be added to the *END*, because things like | ||||||
|  | dnl "gcc -O9 -O2" will result in -O2 getting preference.  How stupid. | ||||||
|  | if test ! -z "$CFLAGS"; then | ||||||
|  | 	WSJT_CFLAGS="$WSJT_CFLAGS $CFLAGS" | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | AC_ISC_POSIX | ||||||
|  | AC_C_INLINE | ||||||
|  | AC_PROG_GCC_TRADITIONAL | ||||||
|  | AC_PROG_MAKE_SET | ||||||
|  | AC_PROG_INSTALL | ||||||
|  | AC_PATH_PROG(RM, rm) | ||||||
|  | AC_PATH_PROG(CP, cp) | ||||||
|  | AC_PATH_PROG(MV, mv) | ||||||
|  | AC_PATH_PROG(LN, ln) | ||||||
|  | AC_PATH_PROG(SED, sed) | ||||||
|  | AC_PATH_PROG(AR, ar) | ||||||
|  | AC_PATH_PROG(LD, ld) | ||||||
|  | AC_PATH_PROG(TEST, [test], [test]) | ||||||
|  | AC_PATH_PROG(PYTHON, python) | ||||||
|  | AC_PATH_PROG(F2PY, f2py) | ||||||
|  | AC_PATH_PROG(G95, g95) | ||||||
|  | 
 | ||||||
|  | dnl Checks for header files. | ||||||
|  | AC_HEADER_STDC | ||||||
|  | 
 | ||||||
|  | AC_CHECK_HEADERS([crypt.h inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h link.h sys/soundcard.h linux/soundcard.h alsa/alsasound.h audiofile.h]) | ||||||
|  | 
 | ||||||
|  | dnl use directory structure of cached as default (hack) | ||||||
|  | if test "$libexecdir" = '${exec_prefix}/libexec' && | ||||||
|  |    test "$localstatedir" = '${prefix}/var'; then | ||||||
|  | 	libexecdir='${bindir}' | ||||||
|  | 	localstatedir='${prefix}' | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | dnl See whether we can include both string.h and strings.h. | ||||||
|  | AC_CACHE_CHECK([whether string.h and strings.h may both be included], | ||||||
|  | gcc_cv_header_string, | ||||||
|  | [ | ||||||
|  | 	AC_COMPILE_IFELSE( | ||||||
|  | 	[#include <string.h> | ||||||
|  | 	#include <strings.h>],  | ||||||
|  | 	[gcc_cv_header_string=yes], | ||||||
|  | 	[gcc_cv_header_string=no]) | ||||||
|  | ]) | ||||||
|  | 
 | ||||||
|  | if test "$gcc_cv_header_string" = "yes"; then | ||||||
|  | 	AC_DEFINE(STRING_WITH_STRINGS, 1, [Define to 1 if string.h may be included along with strings.h]) | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | AC_C_BIGENDIAN | ||||||
|  | 
 | ||||||
|  | dnl Check for stdarg.h - if we can't find it, halt configure | ||||||
|  | AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - wsjt will not compile without it **])]) | ||||||
|  | 
 | ||||||
|  | dnl Checks for the existence of strlcat, strlcpy, basename... | ||||||
|  | dnl This more reliable test only works with gcc though. | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | AC_SUBST(SNPRINTF_C) | ||||||
|  | 
 | ||||||
|  | dnl Debug-related options | ||||||
|  | dnl ===================== | ||||||
|  | 
 | ||||||
|  | AC_ARG_ENABLE(clobber, | ||||||
|  | AC_HELP_STRING([--enable-clobber], [Don't preserve old binaries on make install]), | ||||||
|  | [clobber=$enableval], [clobber=no]) | ||||||
|  | 
 | ||||||
|  | if test "$clobber" = yes; then | ||||||
|  | 	AC_SUBST(CLOBBER, yes) | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | AC_ARG_ENABLE(assert, | ||||||
|  | AC_HELP_STRING([--enable-assert],[Enable assert().]), | ||||||
|  | [assert=$enableval], [assert=no]) | ||||||
|  | 
 | ||||||
|  | if test "$assert" = no; then | ||||||
|  | 	AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.]) | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | AC_SUBST(WSJT_CFLAGS) | ||||||
|  | 
 | ||||||
|  | if test "$prefix" = "NONE"; then  | ||||||
|  | 	AC_DEFINE_UNQUOTED(WSJT_PREFIX, "$ac_default_prefix", [Prefix where wsjt is installed.]) | ||||||
|  | 
 | ||||||
|  | else | ||||||
|  | 
 | ||||||
|  | dnl Don't get bitten by Cygwin's stupidity if the user specified | ||||||
|  | dnl a custom prefix with a trailing slash | ||||||
|  | 
 | ||||||
|  | 	prefix=`echo $prefix | sed 's/\/$//'` | ||||||
|  | 	AC_DEFINE_UNQUOTED(WSJT_PREFIX, "$prefix", [Prefix where wsjt is installed.]) | ||||||
|  | 	 | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | AC_CONFIG_FILES(		\ | ||||||
|  | 	Makefile		 | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | AC_OUTPUT | ||||||
|  | 
 | ||||||
|  | echo | ||||||
|  | echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" | ||||||
|  | echo | ||||||
|  | 
 | ||||||
|  | echo "Installing into: $prefix" | ||||||
|  | 
 | ||||||
|  | echo | ||||||
							
								
								
									
										11
									
								
								cutil.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								cutil.c
									
									
									
									
									
								
							| @ -45,11 +45,12 @@ int buf[]; | |||||||
|   return (times(buf)); |   return (times(buf)); | ||||||
| } | } | ||||||
| /* ioperm(2) */ | /* ioperm(2) */ | ||||||
| ioperm_(from,num,turn_on) | //ioperm_(from,num,turn_on)
 | ||||||
| unsigned long *from,*num,*turn_on; | //unsigned long *from,*num,*turn_on;
 | ||||||
| { | //{
 | ||||||
|   return (ioperm(*from,*num,*turn_on)); | //  return (ioperm(*from,*num,*turn_on));
 | ||||||
| } | //   return (i386_get_ioperm(*from,*num,*turn_on));
 | ||||||
|  | //}
 | ||||||
| 
 | 
 | ||||||
| /* usleep(3) */ | /* usleep(3) */ | ||||||
| usleep_(microsec) | usleep_(microsec) | ||||||
|  | |||||||
							
								
								
									
										6
									
								
								g1
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								g1
									
									
									
									
									
								
							| @ -1,5 +1,5 @@ | |||||||
| G95=/usr/bin/g95 | G95=/usr/local/bin/g95 | ||||||
| COMPILER=//usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/ | COMPILER=//usr/local/lib/gcc-lib/i386-unknown-freebsd5.4/4.0.1/ | ||||||
| python f2py.py -c --quiet --opt="-O -cpp -DLinux -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio --f77exec=$G95 --f90exec=$G95 -L$COMPILER -lpthread -lg2c -lasound only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f jtaudio.c ptt_linux.c igray.c wrapkarn.c start_threads.c cutil.c fivehz.f90 | python f2py.py -c --quiet --opt="-O -cpp -DFreeBSD -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio --f77exec=$G95 --f90exec=$G95 -L$COMPILER -lpthread -lg2c only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f jtaudio.c ptt_bsd.c igray.c wrapkarn.c start_threads.c cutil.c fivehz.f90 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go
									
									
									
									
									
								
							| @ -1,3 +1,3 @@ | |||||||
| gcc -c wrapkarn.c | gcc -c wrapkarn.c | ||||||
| gcc -c igray.c | gcc -c igray.c | ||||||
| g95 -o JT65code -fno-second-underscore JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o | f77 -o JT65code -fno-second-underscore JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o | ||||||
|  | |||||||
| @ -7,8 +7,9 @@ | |||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <fcntl.h> | #include <fcntl.h> | ||||||
| #include <sys/ioctl.h> | #include <sys/ioctl.h> | ||||||
|  | #include "conf.h"	/* XXX Could use CFLAGS later instead --db */ | ||||||
| 
 | 
 | ||||||
| #if (defined(__unix__) || defined(unix)) && !defined(USG) | #ifdef HAVE_SYS_PARAM_H | ||||||
| #include <sys/param.h> | #include <sys/param.h> | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,10 +1,21 @@ | |||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <stdlib.h> | #include <stdlib.h> | ||||||
| #include <pthread.h> | #include <pthread.h> | ||||||
|  | #include "conf.h" | ||||||
|  | 
 | ||||||
|  | /* XXX Change to 
 | ||||||
|  |  * #if defined(WANT_ALSA) && defined(HAVE_ALSA_ALSASOUND_H) | ||||||
|  |  * when configure is done with options --db | ||||||
|  |  */ | ||||||
|  | #ifdef HAVE_ALSA_ALSASOUND_H | ||||||
| #include <alsa/asoundlib.h> | #include <alsa/asoundlib.h> | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
| #include <inttypes.h> | #include <inttypes.h> | ||||||
| #include <time.h> | #include <time.h> | ||||||
| 
 | 
 | ||||||
|  | #ifdef HAVE_ALSA_ALSASOUND_H | ||||||
|  | 
 | ||||||
| #if 1 | #if 1 | ||||||
| #define ALSA_LOG | #define ALSA_LOG | ||||||
| #define ALSA_LOG_BUFFERS | #define ALSA_LOG_BUFFERS | ||||||
| @ -490,7 +501,7 @@ void ao_alsa_loop(void *iarg) { | |||||||
| 		 | 		 | ||||||
| 	return; | 	return; | ||||||
| } | } | ||||||
| 
 | #endif | ||||||
| 
 | 
 | ||||||
| extern void decode1_(int *iarg); | extern void decode1_(int *iarg); | ||||||
| int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], | int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], | ||||||
| @ -505,6 +516,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], | |||||||
|   int iarg1 = 1,iarg2 = 2; |   int iarg1 = 1,iarg2 = 2; | ||||||
|   //int32_t rate=11025;
 |   //int32_t rate=11025;
 | ||||||
|   int32_t rate=*nfsample; |   int32_t rate=*nfsample; | ||||||
|  | #ifdef HAVE_ALSA_ALSASOUND_H | ||||||
|   alsa_driver_capture.app_buffer_y1 = y1; |   alsa_driver_capture.app_buffer_y1 = y1; | ||||||
|   alsa_driver_capture.app_buffer_y2 = y2; |   alsa_driver_capture.app_buffer_y2 = y2; | ||||||
|   alsa_driver_capture.app_buffer_offset = iwrite; |   alsa_driver_capture.app_buffer_offset = iwrite; | ||||||
| @ -521,9 +533,10 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], | |||||||
|   alsa_driver_playback.nmode = nmode; |   alsa_driver_playback.nmode = nmode; | ||||||
|   alsa_driver_playback.transmitting = Transmitting; |   alsa_driver_playback.transmitting = Transmitting; | ||||||
|   alsa_driver_playback.ndsec = ndsec; |   alsa_driver_playback.ndsec = ndsec; | ||||||
| 
 | #endif | ||||||
|   printf("start threads called\n"); |   printf("start threads called\n"); | ||||||
|   iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); |   iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); | ||||||
|  | #ifdef HAVE_ALSA_ALSASOUND_H | ||||||
| /* Open audio card. */ | /* Open audio card. */ | ||||||
|   ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); |   ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); | ||||||
|   ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); |   ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); | ||||||
| @ -539,5 +552,5 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], | |||||||
| 
 | 
 | ||||||
|  /* snd_pcm_start */ |  /* snd_pcm_start */ | ||||||
|   //iret2 = pthread_create(&thread2,NULL,a2d_,&iarg2);
 |   //iret2 = pthread_create(&thread2,NULL,a2d_,&iarg2);
 | ||||||
| 
 | #endif | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user