Compare commits

..

No commits in common. "master" and "minimodem-0.19-1" have entirely different histories.

71 changed files with 10050 additions and 876 deletions

10
.gitignore vendored
View File

@ -1,17 +1,7 @@
*.o
.deps
Makefile
Makefile.in
/aclocal.m4
/autom4te.cache/
/compile
/config.h.in
/config.h
/config.log
/config.status
/configure
/depcomp
/install-sh
/missing
/stamp-h1
/test-driver

View File

@ -1,3 +1 @@
Kamal Mostafa <kamal@whence.com>
Marcos Vives Del Sol <socram8888@gmail.com> [ UIC-751-3 mode ]
Nick Moriarty <njmoriarty@gmail.com> [ --tx-carrier feature ]

View File

@ -1,5 +1,5 @@
minimodem - software audio Bell-type or RTTY FSK modem
Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
Copyright (C) 2011-2013 Kamal Mostafa <kamal@whence.com>
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

719
Makefile.in Normal file
View File

@ -0,0 +1,719 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
THANKS depcomp install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPS_CFLAGS = @DEPS_CFLAGS@
DEPS_LIBS = @DEPS_LIBS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src tests
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@if test ! -f $@; then rm -f stamp-h1; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod u+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
ctags-recursive install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

6
README
View File

@ -1,11 +1,11 @@
minimodem - general-purpose software audio FSK modem
Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
Copyright (C) 2011-2013 Kamal Mostafa <kamal@whence.com>
Minimodem is a command-line program which decodes (or generates) audio
modem tones at any specified baud rate, using various framing protocols.
It acts a general-purpose software FSK modem, and includes support for
various standard FSK protocols such as Bell103, Bell202, RTTY, TTY/TDD,
NOAA SAME, and Caller-ID.
various standard FSK protocols such as Bell103, Bell202, RTTY, NOAA SAME,
and Caller-ID.
Minimodem can play and capture audio modem tones in real-time via the
system audio device, or in batched mode via audio files.

1131
aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

40
config.h.in Normal file
View File

@ -0,0 +1,40 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 to enable ALSA support */
#undef USE_ALSA
/* Define to 1 to enable internal benchmarks */
#undef USE_BENCHMARKS
/* Define to 1 to enable pulseaudio support */
#undef USE_PULSEAUDIO
/* Define to 1 to enable sndfile support */
#undef USE_SNDFILE
/* Version number of package */
#undef VERSION

5188
configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,79 +1,119 @@
AC_PREREQ([2.64])
AC_INIT([minimodem], [0.24], [kamal@whence.com])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/Makefile.in])
AM_INIT_AUTOMAKE
dnl
dnl configure.ac Generated by project-setup
dnl
VERSION=AC_PACKAGE_VERSION
AC_DEFUN([PKG_NAME], [minimodem])
AC_DEFUN([PKG_VERSION], [0.19])
AC_DEFUN([PKG_AUTHOR], [Kamal Mostafa <kamal@whence.com>])
AC_DEFUN([PKG_BUGS_TO], [kamal@whence.com])
AC_PREREQ([2.64])
AC_INIT(PKG_NAME, PKG_VERSION, PKG_BUGS_TO)
dnl Release versioning info
VERSION=PKG_VERSION
AC_SUBST(VERSION)
# Program Checks
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/Makefile.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CC
# AC_PROG_RANLIB
# Library Checks
AC_SEARCH_LIBS([lroundf], [m])
deps_packages="fftw3f"
# Configure dependency libs
AC_CHECK_LIB([m],[lroundf])
# fftw3f
deps_packages+=" fftw3f"
# ALSA
AC_ARG_WITH([alsa], [AS_HELP_STRING([--without-alsa],
[build without ALSA support])])
AS_IF([test "x$with_alsa" == "xno"], [
use_alsa=0
], [
use_alsa=1
deps_packages="$deps_packages alsa"
])
AC_DEFINE_UNQUOTED([USE_ALSA], [$use_alsa],
[Define to 1 to enable ALSA support])
AC_ARG_WITH([alsa],
AS_HELP_STRING([--without-alsa], [build without ALSA support]))
AS_IF([test "x$with_alsa" == "xno"],
# then
use_alsa=0,
# else
use_alsa=1
deps_packages+=" alsa")
AC_DEFINE_UNQUOTED(USE_ALSA, $use_alsa,
[Define to 1 to enable ALSA support])
# pulseaudio
AC_ARG_WITH([pulseaudio], AS_HELP_STRING([--without-pulseaudio],
[build without pulseaudio support]))
AS_IF([test "x$with_pulseaudio" == "xno"], [
use_pulseaudio=0
], [
use_pulseaudio=1
deps_packages="$deps_packages libpulse-simple"
])
AC_DEFINE_UNQUOTED([USE_PULSEAUDIO], [$use_pulseaudio],
[Define to 1 to enable pulseaudio support])
AC_ARG_WITH([pulseaudio],
AS_HELP_STRING([--without-pulseaudio], [build without pulseaudio support]))
AS_IF([test "x$with_pulseaudio" == "xno"],
# then
use_pulseaudio=0,
# else
use_pulseaudio=1
deps_packages+=" libpulse-simple")
AC_DEFINE_UNQUOTED(USE_PULSEAUDIO, $use_pulseaudio,
[Define to 1 to enable pulseaudio support])
# sndfile
AC_ARG_WITH([sndfile], AS_HELP_STRING([--without-sndfile],
[build without sndfile support]))
AS_IF([test "x$with_sndfile" == "xno"], [
use_sndfile=0
], [
use_sndfile=1
deps_packages="$deps_packages sndfile"
])
AC_DEFINE_UNQUOTED([USE_SNDFILE], [$use_sndfile],
[Define to 1 to enable sndfile support])
AC_ARG_WITH([sndfile],
AS_HELP_STRING([--without-sndfile], [build without sndfile support]))
AS_IF([test "x$with_sndfile" == "xno"],
# then
use_sndfile=0,
# else
use_sndfile=1
deps_packages+=" sndfile")
AC_DEFINE_UNQUOTED(USE_SNDFILE, $use_sndfile,
[Define to 1 to enable sndfile support])
# benchmarks
AC_ARG_WITH([benchmarks], AS_HELP_STRING([--disable-benchmarks],
[build without internal benchmarks]))
AS_IF([test "x$with_benchmarks" == "xno"], [
use_benchmarks=0
], [
use_benchmarks=1
])
AC_DEFINE_UNQUOTED([USE_BENCHMARKS], [$use_benchmarks],
[Define to 1 to enable internal benchmarks])
AC_ARG_WITH([benchmarks],
AS_HELP_STRING([--disable-benchmarks], [build without internal benchmarks]))
AS_IF([test "x$with_benchmarks" == "xno"],
# then
use_benchmarks=0,
# else
use_benchmarks=1)
AC_DEFINE_UNQUOTED(USE_BENCHMARKS, $use_benchmarks,
[Define to 1 to enable internal benchmarks])
AC_MSG_RESULT([
option summary:
alsa $with_alsa ($use_alsa)
benchmarks $with_benchmarks ($use_benchmarks)
pulseaudio $with_pulseaudio ($use_pulseaudio)
sndfile $with_sndfile ($use_sndfile)
PKG_NAME PKG_VERSION configuration summary:
--with-pulseaudio $with_pulseaudio ($use_pulseaudio)
--with-alsa $with_alsa ($use_alsa)
--with-sndfile $with_sndfile ($use_sndfile)
--with-benchmarks $with_benchmarks ($use_benchmarks)
deps_packages: $deps_packages
])
# Checks for libraries.
PKG_CHECK_MODULES(DEPS, [$deps_packages])
PKG_CHECK_MODULES(DEPS, [ $deps_packages ])
AC_SUBST([auto_find_tests], ['$(sort $(wildcard *.test))'])
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
AC_CONFIG_FILES([Makefile src/Makefile src/minimodem.1 tests/Makefile])
# Checks for header files.
# AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
# AC_HEADER_STDBOOL
# AC_TYPE_PID_T
# Checks for library functions.
# AC_FUNC_FORK
AC_CONFIG_FILES([
Makefile
src/Makefile
src/minimodem.1
tests/Makefile
])
# testdata/Makefile
AC_OUTPUT

75
debian/changelog vendored
View File

@ -1,78 +1,3 @@
minimodem (0.24-1) unstable; urgency=medium
[ Chris Osborn ]
* Limit carrier/idle generation for input with delays
[ Kamal Mostafa ]
* Fix --tx float consistency: disable .wav "PEAK chunk" header
* Do not emit 0.5 sec flush for audio file output
* debian: bump standards-version=3.9.7 and debhelper-compat-version=9
[ Colin Ian King ]
* multiple static analysis and warnings fixes
-- Kamal Mostafa <kamal@whence.com> Sat, 23 Apr 2016 10:35:44 -0700
minimodem (0.23-1) unstable; urgency=medium
[ Rodrigo Menezes ]
* TTY/TDD support
-- Kamal Mostafa <kamal@whence.com> Fri, 19 Feb 2016 13:05:07 -0800
minimodem (0.22.1-1) unstable; urgency=medium
* Do not enable tx-carrier for non-interactive --file sessions
-- Kamal Mostafa <kamal@whence.com> Mon, 24 Aug 2015 13:51:57 -0700
minimodem (0.22-1) unstable; urgency=medium
[ Kamal Mostafa ]
* minimodem --binary-raw {nbits}: raw binary bits output mode
* fix non-integer mark/space frequency handling
* eliminate all instances of implicit double-promotion
[Nick Moriarty ]
* minimodem --tx-carrier: output a carrier while waiting for data
* Fix ALSA latency (causing ALSA not to block).
[ Kevin Zheng ]
* Untrack automatically generated files
-- Kamal Mostafa <kamal@whence.com> Sun, 23 Aug 2015 10:34:55 -0700
minimodem (0.21-1) unstable; urgency=medium
[ Marcos Vives Del Sol ]
* UIC-751-3 600 bps train message modes (uic-train, uic-ground)
* minimodem --invert-start-stop option inverts polarity of framing bits
[ Kamal Mostafa ]
* fsk confidence algo: calc separate divergences for mark and space bits
(improves signal demodulation)
-- Kamal Mostafa <kamal@whence.com> Mon, 24 Nov 2014 08:28:06 -0800
minimodem (0.20-1) unstable; urgency=medium
* fix stereo input file crash (thanks goblin@github)
* fix man page URL (thanks David Aitcheson)
* fix caller-id for blocked info (thanks Billseph Gamesh)
* test harness update for automake >= 1.13
* debian/control housekeeping
-- Kamal Mostafa <kamal@whence.com> Thu, 13 Nov 2014 10:31:57 -0800
minimodem (0.19-1) unstable; urgency=low
* minimodem new command line switch: -7 implements 7-bit ASCII

2
debian/compat vendored
View File

@ -1 +1 @@
9
7

12
debian/control vendored
View File

@ -2,11 +2,11 @@ Source: minimodem
Section: comm
Priority: optional
Maintainer: Kamal Mostafa <kamal@whence.com>
Build-Depends: debhelper (>= 9), libfftw3-dev, libpulse-dev, libasound2-dev [linux-any], libsndfile1-dev
Standards-Version: 3.9.7
Build-Depends: debhelper (>= 7.0.50~), libfftw3-dev, libpulse-dev, libasound2-dev [linux-any], libsndfile1-dev
Standards-Version: 3.9.4
Homepage: http://www.whence.com/minimodem
Vcs-Git: https://github.com/kamalmostafa/minimodem.git
Vcs-Browser: https://github.com/kamalmostafa/minimodem
Vcs-Git: git://git.whence.com/minimodem
Vcs-Browser: http://git.whence.com/?p=minimodem;a=summary
Package: minimodem
Architecture: any
@ -16,8 +16,8 @@ Description: general-purpose software audio FSK modem
Minimodem is a command-line program which decodes (or generates) audio
modem tones at any specified baud rate, using various framing protocols.
It acts a general-purpose software FSK modem, and includes support for
various standard FSK protocols such as Bell103, Bell202, RTTY, TTY/TDD,
NOAA SAME, and Caller-ID.
various standard FSK protocols such as Bell103, Bell202, RTTY, NOAA SAME,
and Caller-ID.
.
Minimodem can play and capture audio modem tones in real-time via the
system audio device, or in batched mode via audio files.

8
debian/copyright vendored
View File

@ -4,15 +4,11 @@ Upstream-Contact: Kamal Mostafa <kamal@whence.com>
Source: http://www.whence.com/minimodem
Files: *
Copyright: 2011-2016 Kamal Mostafa <kamal@whence.com>
License: GPL-3.0+
Files: src/*uic*
Copyright: 2014 Marcos Vives Del Sol <socram8888@gmail.com>
Copyright: 2011-2013 Kamal Mostafa <kamal@whence.com>
License: GPL-3.0+
Files: debian/*
Copyright: 2011-2016 Kamal Mostafa <kamal@whence.com>
Copyright: 2011-2013 Kamal Mostafa <kamal@whence.com>
License: GPL-3.0+
License: GPL-3.0+

630
depcomp Executable file
View File

@ -0,0 +1,630 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
# Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, 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 to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u="sed s,\\\\\\\\,/,g"
depmode=msvisualcpp
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

520
install-sh Executable file
View File

@ -0,0 +1,520 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

376
missing Executable file
View File

@ -0,0 +1,376 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
# 2008, 2009 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# 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, 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 to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
\`g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
tar*)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar*)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

1
src/.gitignore vendored
View File

@ -1,4 +1,3 @@
/minimodem
/minimodem.1
/minimodem.1.html
/minimodem.exe

View File

@ -1,7 +1,7 @@
#
# Makefile.am
#
# Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
# Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
#
# 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
@ -17,9 +17,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
AM_CFLAGS = -Wall # -Werror -Wdouble-promotion
AM_CFLAGS = -Wall # -Werror
AM_CPPFLAGS = $(DEPS_CFLAGS)
INCLUDES = $(DEPS_CFLAGS)
bin_PROGRAMS = minimodem
@ -42,15 +42,12 @@ FSK_SRC = fsk.h fsk.c
BAUDOT_SRC = baudot.h baudot.c
UIC_SRC = uic_codes.h uic_codes.c
DATABITS_SRC = \
databits.h \
databits_ascii.c \
databits_binary.c \
databits_callerid.c \
databits_baudot.c $(BAUDOT_SRC) \
databits_uic.c $(UIC_SRC)
databits_baudot.c $(BAUDOT_SRC)
minimodem_LDADD = $(DEPS_LIBS)
minimodem_SOURCES = minimodem.c $(DATABITS_SRC) $(FSK_SRC) $(SIMPLEAUDIO_SRC)

642
src/Makefile.in Normal file
View File

@ -0,0 +1,642 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am
#
# Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
#
# 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/>.
#
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = minimodem$(EXEEXT)
subdir = src
DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/minimodem.1.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = minimodem.1
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
PROGRAMS = $(bin_PROGRAMS)
am__objects_1 = baudot.$(OBJEXT)
am__objects_2 = databits_ascii.$(OBJEXT) databits_binary.$(OBJEXT) \
databits_callerid.$(OBJEXT) databits_baudot.$(OBJEXT) \
$(am__objects_1)
am__objects_3 = fsk.$(OBJEXT)
am__objects_4 = simpleaudio.$(OBJEXT) simple-tone-generator.$(OBJEXT) \
simpleaudio-pulse.$(OBJEXT) simpleaudio-alsa.$(OBJEXT) \
simpleaudio-benchmark.$(OBJEXT) simpleaudio-sndfile.$(OBJEXT)
am_minimodem_OBJECTS = minimodem.$(OBJEXT) $(am__objects_2) \
$(am__objects_3) $(am__objects_4)
minimodem_OBJECTS = $(am_minimodem_OBJECTS)
am__DEPENDENCIES_1 =
minimodem_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(minimodem_SOURCES)
DIST_SOURCES = $(minimodem_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(dist_man_MANS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPS_CFLAGS = @DEPS_CFLAGS@
DEPS_LIBS = @DEPS_LIBS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = -Wall # -Werror
INCLUDES = $(DEPS_CFLAGS)
dist_man_MANS = minimodem.1
EXTRA_DIST = minimodem.1.html
SIMPLEAUDIO_SRC = \
simpleaudio.h \
simpleaudio_internal.h \
simpleaudio.c \
simple-tone-generator.c \
simpleaudio-pulse.c \
simpleaudio-alsa.c \
simpleaudio-benchmark.c \
simpleaudio-sndfile.c
FSK_SRC = fsk.h fsk.c
BAUDOT_SRC = baudot.h baudot.c
DATABITS_SRC = \
databits.h \
databits_ascii.c \
databits_binary.c \
databits_callerid.c \
databits_baudot.c $(BAUDOT_SRC)
minimodem_LDADD = $(DEPS_LIBS)
minimodem_SOURCES = minimodem.c $(DATABITS_SRC) $(FSK_SRC) $(SIMPLEAUDIO_SRC)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
minimodem.1: $(top_builddir)/config.status $(srcdir)/minimodem.1.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p; \
then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
minimodem$(EXEEXT): $(minimodem_OBJECTS) $(minimodem_DEPENDENCIES) $(EXTRA_minimodem_DEPENDENCIES)
@rm -f minimodem$(EXEEXT)
$(LINK) $(minimodem_OBJECTS) $(minimodem_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/baudot.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/databits_ascii.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/databits_baudot.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/databits_binary.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/databits_callerid.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsk.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minimodem.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-tone-generator.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleaudio-alsa.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleaudio-benchmark.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleaudio-pulse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleaudio-sndfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleaudio.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
install-man1: $(dist_man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(dist_man_MANS)'; \
test -n "$(man1dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.1[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically \`make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(MANS)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-man1 \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-man uninstall-man1
minimodem.1.html: minimodem.1 Makefile
man --html=cat ./minimodem.1 | sed '5,$$ s:\(http\:[^ &]*\):<A HREF="\1">\1</A>:g' > $@
[ -s $@ ] || { rm $@; exit 1; }
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -194,7 +194,7 @@ baudot_encode_table[0x60][2] = {
* 1 LTRS state
* 2 FIGS state
*/
static unsigned int baudot_charset = 0; // FIXME
static int baudot_charset = 0; // FIXME
void

View File

@ -17,38 +17,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Reverses the ordering of the bits on an integer
static inline unsigned long long
bit_reverse(unsigned long long value,
unsigned int bits)
{
unsigned int out = 0;
while (bits--) {
out = (out << 1) | (value & 1);
value >>= 1;
}
return out;
}
// Gets "bits" bits from "value" starting "offset" bits from the start
static inline unsigned long long
bit_window(unsigned long long value,
unsigned int offset,
unsigned int bits)
{
unsigned long long mask = (1ULL << bits) - 1;
value = (value >> offset) & mask;
return value;
}
typedef int (databits_encoder)(
unsigned int *databits_outp, char char_out );
typedef unsigned int (databits_decoder)(
char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits );
unsigned int bits, unsigned int n_databits );
int
@ -56,7 +30,7 @@ databits_encode_ascii8( unsigned int *databits_outp, char char_out );
unsigned int
databits_decode_ascii8( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits );
unsigned int bits, unsigned int n_databits );
#include "baudot.h"
@ -66,7 +40,7 @@ databits_decode_ascii8( char *dataout_p, unsigned int dataout_size,
unsigned int
databits_decode_baudot( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits );
unsigned int bits, unsigned int n_databits );
int
@ -74,17 +48,11 @@ databits_encode_binary( unsigned int *databits_outp, char char_out );
unsigned int
databits_decode_binary( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits );
unsigned int bits, unsigned int n_databits );
unsigned int
databits_decode_callerid( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits );
unsigned int bits, unsigned int n_databits );
unsigned int
databits_decode_uic_ground( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits );
unsigned int
databits_decode_uic_train( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits );

View File

@ -34,7 +34,7 @@ databits_encode_ascii8( unsigned int *databits_outp, char char_out )
/* returns nbytes decoded */
unsigned int
databits_decode_ascii8( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits )
unsigned int bits, unsigned int n_databits )
{
if ( ! dataout_p ) // databits processor reset: noop
return 0;

View File

@ -28,7 +28,7 @@
/* returns nbytes decoded */
unsigned int
databits_decode_baudot( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits )
unsigned int bits, unsigned int n_databits )
{
if ( ! dataout_p ) { // databits processor reset: reset Baudot state
baudot_reset();

View File

@ -28,7 +28,7 @@
// returns nbytes decoded
unsigned int
databits_decode_binary( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits )
unsigned int bits, unsigned int n_databits )
{
if ( ! dataout_p ) // databits processor reset: noop
return 0;

View File

@ -58,7 +58,7 @@ decode_mdmf_callerid( char *dataout_p, unsigned int dataout_size )
while ( cid_i < cid_msglen ) {
unsigned int cid_datatype = *m++;
if ( cid_datatype > CID_DATA_NAME_NA ) {
if ( cid_datatype >= CID_DATA_NAME_NA ) {
// FIXME: bad datastream -- print something here
return 0;
}
@ -74,41 +74,15 @@ decode_mdmf_callerid( char *dataout_p, unsigned int dataout_size )
dataout_n += sprintf(dataout_p+dataout_n, "%-6s ",
cid_datatype_names[cid_datatype]);
int prlen = 0;
char *prdata = NULL;
switch ( cid_datatype ) {
case CID_DATA_DATETIME:
dataout_n += sprintf(dataout_p+dataout_n,
"%.2s/%.2s %.2s:%.2s\n", m+0, m+2, m+4, m+6);
break;
case CID_DATA_PHONE:
if ( cid_datalen == 10 ) {
dataout_n += sprintf(dataout_p+dataout_n,
"%.3s-%.3s-%.4s\n", m+0, m+3, m+6);
break;
} else {
// fallthrough
}
case CID_DATA_NAME:
prdata = (char *)m;
prlen = cid_datalen;
break;
case CID_DATA_PHONE_NA:
case CID_DATA_NAME_NA:
if ( cid_datalen == 1 && *m == 'O' ) {
prdata = "[N/A]";
prlen = 5;
} else if ( cid_datalen == 1 && *m == 'P' ) {
prdata = "[blocked]";
prlen = 9;
}
break;
default:
// FIXME: warning here?
break;
}
if ( prdata )
dataout_n += sprintf(dataout_p+dataout_n, "%.*s\n", prlen, prdata);
if ( cid_datatype == CID_DATA_DATETIME )
dataout_n += sprintf(dataout_p+dataout_n, "%.2s/%.2s %.2s:%.2s\n",
m+0, m+2, m+4, m+6);
else if ( cid_datatype == CID_DATA_PHONE && cid_datalen == 10 )
dataout_n += sprintf(dataout_p+dataout_n, "%.3s-%.3s-%.4s\n",
m+0, m+3, m+6);
else
dataout_n += sprintf(dataout_p+dataout_n, "%.*s\n",
cid_datalen, m);
m += cid_datalen;
cid_i += cid_datalen + 2;
@ -157,7 +131,7 @@ decode_cid_reset()
/* returns nbytes decoded */
unsigned int
databits_decode_callerid( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits )
unsigned int bits, unsigned int n_databits )
{
if ( ! dataout_p ) // databits processor reset
return decode_cid_reset();
@ -183,7 +157,7 @@ databits_decode_callerid( char *dataout_p, unsigned int dataout_size,
// Collect input bytes until we've collected as many as the message
// length byte says there will be, plus two (the message type byte
// and the checksum byte)
unsigned long long cid_msglen = cid_buf[1];
unsigned int cid_msglen = cid_buf[1];
if ( cid_ndata < cid_msglen + 2)
return 0;

View File

@ -1,74 +0,0 @@
/*
* databits_uic.c
*
* Copyright (C) 2014 Marcos Vives Del Sol <socram8888@gmail.com>
*
* 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/>.
*/
#include <stdio.h>
#include "databits.h"
#include "uic_codes.h"
/*
* UIC-751-3 Ground-train decoder
*/
unsigned int
databits_decode_uic(char *output,
unsigned long long input,
unsigned int type)
{
int written;
if (!output) {
return 0;
}
unsigned int code = (unsigned int) bit_reverse(bit_window(input, 24, 8), 8);
written = sprintf(output, "Train ID: %X%X%X%X%X%X - Message: %02X (%s)\n",
(unsigned int) bit_window(input, 0, 4),
(unsigned int) bit_window(input, 4, 4),
(unsigned int) bit_window(input, 8, 4),
(unsigned int) bit_window(input, 12, 4),
(unsigned int) bit_window(input, 16, 4),
(unsigned int) bit_window(input, 20, 4),
code,
uic_message_meaning(code, type)
);
return written;
}
unsigned int
databits_decode_uic_ground(char *output,
unsigned int outputSize,
unsigned long long input,
unsigned int inputSize)
{
return databits_decode_uic(output,
input,
UIC_TYPE_GROUNDTRAIN);
}
unsigned int
databits_decode_uic_train(char *output,
unsigned int outputSize,
unsigned long long input,
unsigned int inputSize)
{
return databits_decode_uic(output,
input,
UIC_TYPE_TRAINGROUND);
}

View File

@ -1,7 +1,7 @@
/*
* fsk.c
*
* Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
* Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
*
* 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
@ -20,7 +20,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h> // fabsf, hypotf
#include <math.h> // fabs, hypotf
#include <float.h> // FLT_EPSILON
#include <errno.h>
#include <stdio.h>
@ -49,7 +49,7 @@ fsk_plan_new(
#ifdef USE_FFT
fskp->band_width = filter_bw;
float fft_half_bw = fskp->band_width / 2.0f;
float fft_half_bw = fskp->band_width / 2.0;
fskp->fftsize = (sample_rate + fft_half_bw) / fskp->band_width;
fskp->nbands = fskp->fftsize / 2 + 1;
@ -62,7 +62,7 @@ fsk_plan_new(
errno = EINVAL;
return NULL;
}
debug_log("### b_mark=%u b_space=%u fftsize=%d\n",
debug_log("### b_mark=%u b_space=%u fftsize=%u\n",
fskp->b_mark, fskp->b_space, fskp->fftsize);
@ -129,7 +129,7 @@ fsk_bit_analyze( fsk_plan *fskp, float *samples, unsigned int bit_nsamples,
memcpy(fskp->fftin, samples, bit_nsamples * sizeof(float));
float magscalar = 2.0f / (float)bit_nsamples;
float magscalar = 2.0 / (float)bit_nsamples;
#if 0
//// apodization window
@ -148,7 +148,7 @@ fsk_bit_analyze( fsk_plan *fskp, float *samples, unsigned int bit_nsamples,
float zoff = 0.0; // 0.5 // FIXME which is it??
unsigned int z = bit_nsamples /* not -1 ... explain */;
float w = a0
- a1 * cosf((2.0*M_PI*((float)i+zoff)) / z);
- a1 * cos((2.0*M_PI*((float)i+zoff)) / z);
fskp->fftin[i] *= w;
}
#endif
@ -178,13 +178,13 @@ fsk_bit_analyze( fsk_plan *fskp, float *samples, unsigned int bit_nsamples,
static float
fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
int n_bits, const char *expect_bits_string,
unsigned long long *bits_outp, float *ampl_outp )
unsigned int *bits_outp, float *ampl_outp )
{
unsigned int bit_nsamples = (float)(samples_per_bit + 0.5f);
unsigned int bit_nsamples = (float)(samples_per_bit + 0.5);
unsigned int bit_values[64];
float bit_sig_mags[64];
float bit_noise_mags[64];
unsigned int bit_values[32];
float bit_sig_mags[32];
float bit_noise_mags[32];
unsigned int bit_begin_sample;
int bitnum;
@ -201,8 +201,8 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
continue;
assert( expect_bits[bitnum] == '1' || expect_bits[bitnum] == '0' );
bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5f);
debug_log( " bit# %2d @ %7u: ", bitnum, bit_begin_sample);
bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5);
debug_log( " bit# %2u @ %7u: ", bitnum, bit_begin_sample);
fsk_bit_analyze(fskp, samples+bit_begin_sample, bit_nsamples,
&bit_values[bitnum],
&bit_sig_mags[bitnum],
@ -236,7 +236,7 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
* diff between start bit and stop bit strength not be "large". */
float s_mag = bit_sig_mags[1]; // start bit
float p_mag = bit_sig_mags[n_bits-1]; // stop bit
if ( fabsf(s_mag-p_mag) > (s_mag * FSK_AVOID_TRANSIENTS) ) {
if ( fabs(s_mag-p_mag) > (s_mag * FSK_AVOID_TRANSIENTS) ) {
debug_log(" avoid transient\n");
return 0.0;
}
@ -246,8 +246,8 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
for ( bitnum=0; bitnum<n_bits; bitnum++ ) {
if ( expect_bits[bitnum] != 'd' )
continue;
bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5f);
debug_log( " bit# %2d @ %7u: ", bitnum, bit_begin_sample);
bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5);
debug_log( " bit# %2u @ %7u: ", bitnum, bit_begin_sample);
fsk_bit_analyze(fskp, samples+bit_begin_sample, bit_nsamples,
&bit_values[bitnum],
&bit_sig_mags[bitnum],
@ -269,8 +269,6 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
#if CONFIDENCE_ALGO == 5 || CONFIDENCE_ALGO == 6
float total_bit_sig = 0.0, total_bit_noise = 0.0;
float avg_mark_sig = 0.0, avg_space_sig = 0.0;
unsigned int n_mark = 0, n_space = 0;
for ( bitnum=0; bitnum<n_bits; bitnum++ ) {
// Deal with floating point data type quantization noise...
// If total_bit_noise <= FLT_EPSILON, then assume it to be 0.0,
@ -278,14 +276,6 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
total_bit_sig += bit_sig_mags[bitnum];
if ( bit_noise_mags[bitnum] > FLT_EPSILON )
total_bit_noise += bit_noise_mags[bitnum];
if ( bit_values[bitnum] == 1 ) {
avg_mark_sig += bit_sig_mags[bitnum];
n_mark++;
} else {
avg_space_sig += bit_sig_mags[bitnum];
n_space++;
}
}
// Compute the "frame SNR"
@ -294,19 +284,13 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
// Compute avg bit sig and noise magnitudes
float avg_bit_sig = total_bit_sig / n_bits;
// Compute separate avg bit sig for mark and space
if ( n_mark )
avg_mark_sig /= n_mark;
if ( n_space )
avg_space_sig /= n_space;
#if CONFIDENCE_ALGO == 6
// Compute average "divergence": bit_mag_divergence / other_bits_mag
float divergence = 0.0;
for ( bitnum=0; bitnum<n_bits; bitnum++ ) {
float avg_bit_sig_other;
avg_bit_sig_other = bit_values[bitnum] ? avg_mark_sig : avg_space_sig;
divergence += fabsf(bit_sig_mags[bitnum] - avg_bit_sig_other)
float avg_bit_sig_other = (total_bit_sig - fabs(bit_sig_mags[bitnum]))
/ (n_bits - 1);
divergence += fabs(bit_sig_mags[bitnum] - avg_bit_sig_other)
/ avg_bit_sig_other;
}
divergence *= 2;
@ -333,7 +317,7 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
#if CONFIDENCE_ALGO == 6
// Frame confidence is the frame ( SNR * consistency )
confidence = snr * (1.0f - divergence);
confidence = snr * (1.0 - divergence);
#else
// Frame confidence is the frame SNR
confidence = snr;
@ -388,8 +372,8 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
else
normalized_bit_str = bit_strengths[bitnum] - v_space;
debug_log("%.2f ", normalized_bit_str);
// float divergence = fabsf(1.0 - normalized_bit_str);
float divergence = fabsf(normalized_bit_str);
// float divergence = fabs(1.0 - normalized_bit_str);
float divergence = fabs(normalized_bit_str);
if ( worst_divergence < divergence )
worst_divergence = divergence;
}
@ -423,7 +407,7 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
for ( bitnum=0; bitnum<n_bits-1; bitnum++ )
{
float normalized_bit_str = bit_strengths[bitnum] / v;
float divergence = fabsf(1.0 - normalized_bit_str);
float divergence = fabs(1.0 - normalized_bit_str);
if ( worst_divergence < divergence )
worst_divergence = divergence;
}
@ -438,9 +422,9 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
// into the bits_outp word.
*bits_outp = 0;
for ( bitnum=0; bitnum<n_bits; bitnum++ )
*bits_outp |= (unsigned long long) bit_values[bitnum] << bitnum;
*bits_outp |= bit_values[bitnum] << bitnum;
debug_log(" frame algo=%d confidence=%f ampl=%f\n",
debug_log(" frame algo=%u confidence=%f ampl=%f\n",
CONFIDENCE_ALGO, confidence, *ampl_outp);
return confidence;
}
@ -453,7 +437,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
unsigned int try_step_nsamples,
float try_confidence_search_limit,
const char *expect_bits_string,
unsigned long long *bits_outp,
unsigned int *bits_outp,
float *ampl_outp,
unsigned int *frame_start_outp
)
@ -466,7 +450,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
unsigned int best_t = 0;
float best_c = 0.0, best_a = 0.0;
unsigned long long best_bits = 0;
unsigned int best_bits = 0;
// Scan the frame positions starting with the one try_first_sample,
// alternating between a step above that, a step below that, above, below,
@ -474,15 +458,15 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
int j;
for ( j=0; ; j++ )
{
int up = ( j % 2 ) ? 1 : -1;
int up = j%2 ? 1 : -1;
int t = try_first_sample + up*((j+1)/2)*try_step_nsamples;
if ( t >= (int)try_max_nsamples )
break;
if ( t < 0 )
continue;
float c, ampl_out = 0.0;
unsigned long long bits_out = 0;
float c, ampl_out;
unsigned int bits_out = 0;
debug_log("try fsk_frame_analyze at t=%d\n", t);
c = fsk_frame_analyze(fskp, samples+t, samples_per_bit,
expect_n_bits, expect_bits_string,
@ -525,8 +509,8 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
debug_log("FSK_FRAME bits='");
for ( j=0; j<expect_n_bits; j++ )
debug_log("%c", ( ( *bits_outp >> j ) & 1 ) ? '1' : '0' );
debug_log("' datum='%c' (0x%02x) c=%f a=%f t=%u\n",
debug_log("%c", ( *bits_outp >> j ) & 1 ? '1' : '0' );
debug_log("' datum='%c' (0x%02x) c=%f a=%f t=%d\n",
isprint(bitchar)||isspace(bitchar) ? bitchar : '.',
bitchar,
confidence, best_a, best_t);
@ -548,7 +532,7 @@ fsk_detect_carrier(fsk_plan *fskp, float *samples, unsigned int nsamples,
bzero(fskp->fftin, (fskp->fftsize * sizeof(float) * pa_nchannels));
memcpy(fskp->fftin, samples, nsamples * sizeof(float));
fftwf_execute(fskp->fftplan);
float magscalar = 1.0f / ((float)nsamples/2.0f);
float magscalar = 1.0 / ((float)nsamples/2.0);
float max_mag = 0.0;
int max_mag_band = -1;
int i = 1; /* start detection at the first non-DC band */

View File

@ -65,7 +65,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
unsigned int try_step_nsamples,
float try_confidence_search_limit,
const char *expect_bits_string,
unsigned long long *bits_outp,
unsigned int *bits_outp,
float *ampl_outp,
unsigned int *frame_start_outp
);

View File

@ -30,8 +30,8 @@ minimodem \- general-purpose software audio FSK modem
is a command-line program which decodes (or generates) audio
modem tones at any specified baud rate, using various framing protocols.
It acts a general-purpose software FSK modem, and includes support for
various standard FSK protocols such as Bell103, Bell202, RTTY, TTY/TDD,
NOAA SAME, and Caller-ID.
various standard FSK protocols such as Bell103, Bell202, RTTY, NOAA SAME,
and Caller-ID.
.PP
.B Minimodem
can play and capture audio modem tones in real-time via the system
@ -67,9 +67,6 @@ default mark and space tone frequencies.
.B rtty
: RTTY 45.45 bps \-\-baudot \-\-stopbits 1.5
.TP
.B tdd
: TTY/TDD 45.45 bps \-\-baudot \-\-stopbits 2.0
.TP
.B same
: SAME 520.83 bps \-\-startbits 0 \-\-stopbits 0 \-\-sync-byte 0xAB
.br
@ -77,12 +74,6 @@ default mark and space tone frequencies.
.TP
.B callerid
: Bell202 1200 bps Caller-ID (MDMF or SDMF) protocol
.TP
.B uic-train
: UIC-751-3 600 bps train-to-ground message protocol
.TP
.B uic-ground
: UIC-751-3 600 bps ground-to-train message protocol
.SH OPTIONS
.TP
.B \-a, \-\-auto-carrier
@ -176,27 +167,11 @@ The bits are printed in the order they are received. Framing bits (start
and stop bits) are omitted from the output.
(This option applies to \-\-rx mode only).
.TP
.B \-\-binary-raw {nbits}
Print all received bits (data bits and any framing bits) as raw binary output
using characters '0' and '1'. Framing bits are not interpreted, but simply
passed through to the output. The bits are printed in the order they are
received, in lines {nbits} wide. So in order to display a standard 8-N-1
bitstream (8 databits + 1 start bit + 1 stop bit), use "--binary-raw 10"
or a multiple of 10.
(This option applies to \-\-rx mode only).
.TP
.B \-\-print-filter
Filter the received text output, replacing any "non-printable" bytes
with a '.' character.
(This option applies to \-\-rx mode only).
.TP
.B \-\-print-eot
Print "### EOT" to stderr after each transmit completes.
.TP
.B \-\-tx-carrier
When transmitting from a blocking source, keep a carrier going while waiting
for more data.
.TP
.B \-\-benchmarks
Run and report internal performance tests (all other flags are ignored).
.TP
@ -216,7 +191,7 @@ Decode amateur radio RTTY signals (listen near 14.085 MHz).
.B minimodem --rx same
Decode NOAA SAME protocol emergency alert transmissions, e.g.
.br
<http://en.wikipedia.org/wiki/Specific_Area_Message_Encoding>.
http://en.wikipedia.org/wiki/Specific_Area_Message_Encoding
.TP
.B minimodem --tx 0.5
Experiment with very low baud rates (works in noisy conditions).
@ -239,7 +214,7 @@ The latest version is available at <http://www.whence.com/minimodem>.
.B minimodem
was written by Kamal Mostafa <kamal@whence.com>.
.SH COPYRIGHT
Copyright \(co 2011-2016 by Kamal Mostafa <kamal@whence.com>.
Copyright \(co 2011-2013 by Kamal Mostafa <kamal@whence.com>.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it.

View File

@ -3,7 +3,7 @@
*
* minimodem - software audio Bell-type or RTTY FSK modem
*
* Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
* Copyright (C) 2011-2013 Kamal Mostafa <kamal@whence.com>
*
* 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
@ -31,7 +31,6 @@
#include <assert.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/select.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
@ -46,14 +45,12 @@
char *program_name = "";
int tx_transmitting = 0;
int tx_print_eot = 0;
int tx_leader_bits_len = 2;
int tx_trailer_bits_len = 2;
simpleaudio *tx_sa_out;
float tx_bfsk_mark_f;
unsigned int tx_bit_nsamples;
unsigned int tx_flush_nsamples;
void
tx_stop_transmit_sighandler( int sig )
@ -64,12 +61,11 @@ tx_stop_transmit_sighandler( int sig )
for ( j=0; j<tx_trailer_bits_len; j++ )
simpleaudio_tone(tx_sa_out, tx_bfsk_mark_f, tx_bit_nsamples);
if ( tx_flush_nsamples )
simpleaudio_tone(tx_sa_out, 0, tx_flush_nsamples);
// 0.5 sec of zero samples to flush - FIXME lame
size_t sample_rate = simpleaudio_get_rate(tx_sa_out);
simpleaudio_tone(tx_sa_out, 0, sample_rate/2);
tx_transmitting = 0;
if ( tx_print_eot )
fprintf(stderr, "### EOT\n");
}
@ -85,28 +81,20 @@ static void fsk_transmit_frame(
float bfsk_mark_f,
float bfsk_space_f,
float bfsk_nstartbits,
float bfsk_nstopbits,
int invert_start_stop,
int bfsk_msb_first
float bfsk_nstopbits
)
{
int i;
if ( bfsk_nstartbits > 0 )
simpleaudio_tone(sa_out, invert_start_stop ? bfsk_mark_f : bfsk_space_f,
simpleaudio_tone(sa_out, bfsk_space_f,
bit_nsamples * bfsk_nstartbits); // start
for ( i=0; i<n_data_bits; i++ ) { // data
unsigned int bit;
if (bfsk_msb_first) {
bit = ( bits >> (n_data_bits - i - 1) ) & 1;
} else {
bit = ( bits >> i ) & 1;
}
unsigned int bit = ( bits >> i ) & 1;
float tone_freq = bit == 1 ? bfsk_mark_f : bfsk_space_f;
simpleaudio_tone(sa_out, tone_freq, bit_nsamples);
}
if ( bfsk_nstopbits > 0 )
simpleaudio_tone(sa_out, invert_start_stop ? bfsk_space_f : bfsk_mark_f,
simpleaudio_tone(sa_out, bfsk_mark_f,
bit_nsamples * bfsk_nstopbits); // stop
}
@ -119,29 +107,23 @@ static void fsk_transmit_stdin(
int n_data_bits,
float bfsk_nstartbits,
float bfsk_nstopbits,
int invert_start_stop,
int bfsk_msb_first,
unsigned int bfsk_do_tx_sync_bytes,
unsigned int bfsk_sync_byte,
databits_encoder encode,
int txcarrier
databits_encoder encode
)
{
size_t sample_rate = simpleaudio_get_rate(sa_out);
size_t bit_nsamples = sample_rate / data_rate + 0.5f;
size_t bit_nsamples = sample_rate / data_rate + 0.5;
int c;
tx_sa_out = sa_out;
tx_bfsk_mark_f = bfsk_mark_f;
tx_bit_nsamples = bit_nsamples;
if ( tx_interactive )
tx_flush_nsamples = sample_rate/2; // 0.5 sec of zero samples to flush
else
tx_flush_nsamples = 0;
// one-shot
struct itimerval itv = {
{0, 0}, // it_interval
{0, 1000000/(float)(data_rate+data_rate*0.03f)} // it_value
{0, 1000000/(float)(data_rate+data_rate*0.03) } // it_value
};
struct itimerval itv_zero = {
@ -149,96 +131,44 @@ static void fsk_transmit_stdin(
{0, 0} // it_value
};
// arbitrary chosen timeout value: 1/25 of a second
unsigned int idle_carrier_usec = (1000000/25);
int block_input = tx_interactive && !txcarrier;
if ( block_input )
if ( tx_interactive )
signal(SIGALRM, tx_stop_transmit_sighandler);
// Set up for select() should we need it
int fd = fileno(stdin);
fd_set fdset;
tx_transmitting = 0;
int end_of_file = 0;
unsigned char buf;
int n_read = 0;
int idle = 0;
while ( !end_of_file )
while ( (c = getchar()) != EOF )
{
FD_ZERO(&fdset);
FD_SET(fd, &fdset);
struct timeval tv_idletimeout = { 0, 0 };
if ( !tx_interactive ) {
// When stdin blocks we "emit idle tone", for a duration of
// idle_carrier_usec. If !tx_interactive (i.e. writing to an
// audio file) make the select timeout the same duration.
tv_idletimeout.tv_usec = idle_carrier_usec;
}
if( block_input || select(fd+1, &fdset, NULL, NULL, &tv_idletimeout) )
{
n_read = read(fd, &buf, sizeof(buf));
if( n_read <= 0 ) //Includes EOF (0) and errors (-1)
{
end_of_file = 1;
continue; //Do nothing else
}
idle = 0;
}
else
idle = 1;
// Cause any running timer to immediately trigger
if ( block_input )
if ( tx_interactive )
setitimer(ITIMER_REAL, &itv_zero, NULL);
if( !idle )
// fprintf(stderr, "<c=%d>", c);
unsigned int nwords;
unsigned int bits[2];
unsigned int j;
nwords = encode(bits, c);
if ( !tx_transmitting )
{
// fprintf(stderr, "<c=%d>", c);
unsigned int nwords;
unsigned int bits[2];
unsigned int j;
nwords = encode(bits, buf);
if ( !tx_transmitting )
{
tx_transmitting = 1;
/* emit leader tone (mark) */
for ( j=0; j<tx_leader_bits_len; j++ )
simpleaudio_tone(sa_out, invert_start_stop ? bfsk_space_f : bfsk_mark_f, bit_nsamples);
}
if ( tx_transmitting < 2)
{
tx_transmitting = 2;
/* emit "preamble" of sync bytes */
for ( j=0; j<bfsk_do_tx_sync_bytes; j++ )
fsk_transmit_frame(sa_out, bfsk_sync_byte, n_data_bits,
bit_nsamples, bfsk_mark_f, bfsk_space_f,
bfsk_nstartbits, bfsk_nstopbits, invert_start_stop, 0);
}
/* emit data bits */
for ( j=0; j<nwords; j++ )
fsk_transmit_frame(sa_out, bits[j], n_data_bits,
bit_nsamples, bfsk_mark_f, bfsk_space_f,
bfsk_nstartbits, bfsk_nstopbits, invert_start_stop, bfsk_msb_first);
}
else
{
tx_transmitting = 1;
/* emit idle tone (mark) */
simpleaudio_tone(sa_out,
invert_start_stop ? bfsk_space_f : bfsk_mark_f,
idle_carrier_usec * sample_rate / 1000000);
/* emit leader tone (mark) */
for ( j=0; j<tx_leader_bits_len; j++ )
simpleaudio_tone(sa_out, bfsk_mark_f, bit_nsamples);
/* emit "preamble" of sync bytes */
for ( j=0; j<bfsk_do_tx_sync_bytes; j++ )
fsk_transmit_frame(sa_out, bfsk_sync_byte, n_data_bits,
bit_nsamples, bfsk_mark_f, bfsk_space_f,
bfsk_nstartbits, bfsk_nstopbits);
}
if ( block_input )
/* emit data bits */
for ( j=0; j<nwords; j++ )
fsk_transmit_frame(sa_out, bits[j], n_data_bits,
bit_nsamples, bfsk_mark_f, bfsk_space_f,
bfsk_nstartbits, bfsk_nstopbits);
if ( tx_interactive )
setitimer(ITIMER_REAL, &itv, NULL);
}
if ( block_input ) {
if ( tx_interactive ) {
setitimer(ITIMER_REAL, &itv_zero, NULL);
signal(SIGALRM, SIG_DFL);
}
@ -269,21 +199,21 @@ report_no_carrier( fsk_plan *fskp,
nbits_decoded * sample_rate / (float)carrier_nsamples;
fprintf(stderr, "\n### NOCARRIER ndata=%u confidence=%.3f ampl=%.3f bps=%.2f",
nframes_decoded,
(double)(confidence_total / nframes_decoded),
(double)(amplitude_total / nframes_decoded),
(double)(throughput_rate));
confidence_total / nframes_decoded,
amplitude_total / nframes_decoded,
throughput_rate);
#if 0
fprintf(stderr, " bits*sr=%llu rate*nsamp=%llu",
(unsigned long long)(nbits_decoded * sample_rate + 0.5),
(unsigned long long)(bfsk_data_rate * carrier_nsamples) );
#endif
if ( (unsigned long long)(nbits_decoded * sample_rate + 0.5f) == (unsigned long long)(bfsk_data_rate * carrier_nsamples) ) {
if ( (unsigned long long)(nbits_decoded * sample_rate + 0.5) == (unsigned long long)(bfsk_data_rate * carrier_nsamples) ) {
fprintf(stderr, " (rate perfect) ###\n");
} else {
float throughput_skew = (throughput_rate - bfsk_data_rate)
/ bfsk_data_rate;
fprintf(stderr, " (%.1f%% %s) ###\n",
(double)(fabsf(throughput_skew) * 100.0f),
fabs(throughput_skew) * 100.0,
signbit(throughput_skew) ? "slow" : "fast"
);
}
@ -308,8 +238,7 @@ benchmarks()
int ret;
ret = system("sed -n -e '/^model name/{p;q}' -e '/^cpu model/{p;q}' /proc/cpuinfo");
if ( ret )
; // don't care, hush compiler.
ret = ret; // don't care, hush compiler.
fflush(stdout);
@ -378,7 +307,7 @@ version()
{
printf(
"minimodem %s\n"
"Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>\n"
"Copyright (C) 2011-2013 Kamal Mostafa <kamal@whence.com>\n"
"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n\n"
@ -408,7 +337,6 @@ usage()
" -S, --space {space_freq}\n"
" --startbits {n}\n"
" --stopbits {n.n}\n"
" --invert-start-stop\n"
" --sync-byte {0xXX}\n"
" -q, --quiet\n"
" -R, --samplerate {rate}\n"
@ -419,70 +347,18 @@ usage()
" --rx-one\n"
" --benchmarks\n"
" --binary-output\n"
" --binary-raw {nbits}\n"
" --print-filter\n"
" --print-eot\n"
" --tx-carrier\n"
" {baudmode}\n"
" any_number_N Bell-like N bps --ascii\n"
" 1200 Bell202 1200 bps --ascii\n"
" 300 Bell103 300 bps --ascii\n"
" rtty RTTY 45.45 bps --baudot --stopbits=1.5\n"
" tdd TTY/TDD 45.45 bps --baudot --stopbits=2.0\n"
" same NOAA SAME 520.83 bps --sync-byte=0xAB ...\n"
" callerid Bell202 CID 1200 bps\n"
" uic{-train,-ground} UIC-751-3 Train/Ground 600 bps\n"
);
exit(1);
}
int
build_expect_bits_string( char *expect_bits_string,
int bfsk_nstartbits,
int bfsk_n_data_bits,
float bfsk_nstopbits,
int invert_start_stop,
int use_expect_bits,
unsigned long long expect_bits )
{
// example expect_bits_string
// 0123456789A
// isddddddddp i == idle bit (a.k.a. prev_stop bit)
// s == start bit d == data bits p == stop bit
// ebs = "10dddddddd1" <-- expected mark/space framing pattern
//
// NOTE! expect_n_bits ends up being (frame_n_bits+1), because
// we expect the prev_stop bit in addition to this frame's own
// (start + n_data_bits + stop) bits. But for each decoded frame,
// we will advance just frame_n_bits worth of samples, leaving us
// pointing at our stop bit -- it becomes the next frame's prev_stop.
//
// prev_stop--v
// start--v v--stop
// char *expect_bits_string = "10dddddddd1";
//
char start_bit_value = invert_start_stop ? '1' : '0';
char stop_bit_value = invert_start_stop ? '0' : '1';
int j = 0;
if ( bfsk_nstopbits != 0.0f )
expect_bits_string[j++] = stop_bit_value;
int i;
// Nb. only integer number of start bits works (for rx)
for ( i=0; i<bfsk_nstartbits; i++ )
expect_bits_string[j++] = start_bit_value;
for ( i=0; i<bfsk_n_data_bits; i++,j++ ) {
if ( use_expect_bits )
expect_bits_string[j] = ( (expect_bits>>i)&1 ) + '0';
else
expect_bits_string[j] = 'd';
}
if ( bfsk_nstopbits != 0.0f )
expect_bits_string[j++] = stop_bit_value;
expect_bits_string[j] = 0;
return j;
}
int
main( int argc, char*argv[] )
{
@ -491,20 +367,15 @@ main( int argc, char*argv[] )
int quiet_mode = 0;
int output_print_filter = 0;
float band_width = 0;
float bfsk_mark_f = 0;
float bfsk_space_f = 0;
unsigned int bfsk_mark_f = 0;
unsigned int bfsk_space_f = 0;
unsigned int bfsk_inverted_freqs = 0;
int bfsk_nstartbits = -1;
float bfsk_nstopbits = -1;
unsigned int bfsk_do_rx_sync = 0;
unsigned int bfsk_do_tx_sync_bytes = 0;
unsigned long long bfsk_sync_byte = -1;
unsigned int bfsk_sync_byte = -1;
unsigned int bfsk_n_data_bits = 0;
int bfsk_msb_first = 0;
char *expect_data_string = NULL;
char *expect_sync_string = NULL;
unsigned int expect_n_bits;
int invert_start_stop = 0;
int autodetect_shift;
char *filename = NULL;
@ -537,10 +408,7 @@ main( int argc, char*argv[] )
unsigned int rx_one = 0;
float rxnoise_factor = 0.0;
int txcarrier = 0;
int output_mode_binary = 0;
int output_mode_raw_nbits = 0;
float bfsk_data_rate = 0.0;
databits_encoder *bfsk_databits_encode;
@ -568,21 +436,16 @@ main( int argc, char*argv[] )
enum {
MINIMODEM_OPT_UNUSED=256, // placeholder
MINIMODEM_OPT_MSBFIRST,
MINIMODEM_OPT_STARTBITS,
MINIMODEM_OPT_STOPBITS,
MINIMODEM_OPT_INVERT_START_STOP,
MINIMODEM_OPT_SYNC_BYTE,
MINIMODEM_OPT_LUT,
MINIMODEM_OPT_FLOAT_SAMPLES,
MINIMODEM_OPT_RX_ONE,
MINIMODEM_OPT_BENCHMARKS,
MINIMODEM_OPT_BINARY_OUTPUT,
MINIMODEM_OPT_BINARY_RAW,
MINIMODEM_OPT_PRINT_FILTER,
MINIMODEM_OPT_XRXNOISE,
MINIMODEM_OPT_PRINT_EOT,
MINIMODEM_OPT_TXCARRIER
};
while ( 1 ) {
@ -601,7 +464,6 @@ main( int argc, char*argv[] )
{ "ascii", 0, 0, '8' },
{ "", 0, 0, '7' },
{ "baudot", 0, 0, '5' },
{ "msb-first", 0, 0, MINIMODEM_OPT_MSBFIRST },
{ "file", 1, 0, 'f' },
{ "bandwidth", 1, 0, 'b' },
{ "volume", 1, 0, 'v' },
@ -609,7 +471,6 @@ main( int argc, char*argv[] )
{ "space", 1, 0, 'S' },
{ "startbits", 1, 0, MINIMODEM_OPT_STARTBITS },
{ "stopbits", 1, 0, MINIMODEM_OPT_STOPBITS },
{ "invert-start-stop", 0, 0, MINIMODEM_OPT_INVERT_START_STOP },
{ "sync-byte", 1, 0, MINIMODEM_OPT_SYNC_BYTE },
{ "quiet", 0, 0, 'q' },
{ "alsa", 2, 0, 'A' },
@ -619,11 +480,8 @@ main( int argc, char*argv[] )
{ "rx-one", 0, 0, MINIMODEM_OPT_RX_ONE },
{ "benchmarks", 0, 0, MINIMODEM_OPT_BENCHMARKS },
{ "binary-output", 0, 0, MINIMODEM_OPT_BINARY_OUTPUT },
{ "binary-raw", 1, 0, MINIMODEM_OPT_BINARY_RAW },
{ "print-filter", 0, 0, MINIMODEM_OPT_PRINT_FILTER },
{ "print-eot", 0, 0, MINIMODEM_OPT_PRINT_EOT },
{ "Xrxnoise", 1, 0, MINIMODEM_OPT_XRXNOISE },
{ "tx-carrier", 0, 0, MINIMODEM_OPT_TXCARRIER },
{ 0 }
};
c = getopt_long(argc, argv, "Vtrc:l:ai875f:b:v:M:S:T:qA::R:",
@ -670,9 +528,6 @@ main( int argc, char*argv[] )
bfsk_databits_decode = databits_decode_baudot;
bfsk_databits_encode = databits_encode_baudot;
break;
case MINIMODEM_OPT_MSBFIRST:
bfsk_msb_first = 1;
break;
case 'b':
band_width = atof(optarg);
assert( band_width != 0 );
@ -682,14 +537,14 @@ main( int argc, char*argv[] )
tx_amplitude = FLT_EPSILON;
else
tx_amplitude = atof(optarg);
assert( tx_amplitude > 0.0f );
assert( tx_amplitude > 0.0 );
break;
case 'M':
bfsk_mark_f = atof(optarg);
bfsk_mark_f = atoi(optarg);
assert( bfsk_mark_f > 0 );
break;
case 'S':
bfsk_space_f = atof(optarg);
bfsk_space_f = atoi(optarg);
assert( bfsk_space_f > 0 );
break;
case MINIMODEM_OPT_STARTBITS:
@ -702,9 +557,6 @@ main( int argc, char*argv[] )
bfsk_nstopbits = atof(optarg);
assert( bfsk_nstopbits >= 0 );
break;
case MINIMODEM_OPT_INVERT_START_STOP:
invert_start_stop = 1;
break;
case MINIMODEM_OPT_SYNC_BYTE:
bfsk_do_rx_sync = 1;
bfsk_do_tx_sync_bytes = 16;
@ -743,21 +595,12 @@ main( int argc, char*argv[] )
case MINIMODEM_OPT_BINARY_OUTPUT:
output_mode_binary = 1;
break;
case MINIMODEM_OPT_BINARY_RAW:
output_mode_raw_nbits = atoi(optarg);
break;
case MINIMODEM_OPT_PRINT_FILTER:
output_print_filter = 1;
break;
case MINIMODEM_OPT_XRXNOISE:
rxnoise_factor = atof(optarg);
break;
case MINIMODEM_OPT_TXCARRIER:
txcarrier = 1;
break;
case MINIMODEM_OPT_PRINT_EOT:
tx_print_eot = 1;
break;
default:
usage();
}
@ -806,16 +649,6 @@ main( int argc, char*argv[] )
bfsk_n_data_bits = 5;
if ( bfsk_nstopbits < 0 )
bfsk_nstopbits = 1.5;
} else if ( strncasecmp(modem_mode, "tdd",4)==0 ) {
bfsk_databits_decode = databits_decode_baudot;
bfsk_databits_encode = databits_encode_baudot;
bfsk_data_rate = 45.45;
if ( bfsk_n_data_bits == 0 )
bfsk_n_data_bits = 5;
if ( bfsk_nstopbits < 0 )
bfsk_nstopbits = 2.0;
bfsk_mark_f = 1400;
bfsk_space_f = 1800;
} else if ( strncasecmp(modem_mode, "same",5)==0 ) {
// http://www.nws.noaa.gov/nwr/nwrsame.htm
bfsk_data_rate = 520.0 + 5/6.0;
@ -833,47 +666,21 @@ main( int argc, char*argv[] )
fprintf(stderr, "E: callerid --tx mode is not supported.\n");
return 1;
}
if ( carrier_autodetect_threshold > 0.0f )
fprintf(stderr, "W: callerid with --auto-carrier is not recommended.\n");
bfsk_databits_decode = databits_decode_callerid;
bfsk_data_rate = 1200;
bfsk_n_data_bits = 8;
} else if ( strncasecmp(modem_mode, "uic", 3) == 0 ) {
if ( TX_mode ) {
fprintf(stderr, "E: uic-751-3 --tx mode is not supported.\n");
return 1;
}
// http://ec.europa.eu/transport/rail/interoperability/doc/ccs-tsi-en-annex.pdf
if (tolower(modem_mode[4]) == 't')
bfsk_databits_decode = databits_decode_uic_train;
else
bfsk_databits_decode = databits_decode_uic_ground;
bfsk_data_rate = 600;
bfsk_n_data_bits = 39;
bfsk_mark_f = 1300;
bfsk_space_f = 1700;
bfsk_nstartbits = 8;
bfsk_nstopbits = 0;
expect_data_string = "11110010ddddddddddddddddddddddddddddddddddddddd";
expect_n_bits = 47;
} else {
bfsk_data_rate = atof(modem_mode);
if ( bfsk_n_data_bits == 0 )
bfsk_n_data_bits = 8;
}
if ( bfsk_data_rate == 0.0f )
if ( bfsk_data_rate == 0.0 )
usage();
if ( output_mode_binary || output_mode_raw_nbits )
if ( output_mode_binary )
bfsk_databits_decode = databits_decode_binary;
if ( output_mode_raw_nbits ) {
bfsk_nstartbits = 0;
bfsk_nstopbits = 0;
bfsk_n_data_bits = output_mode_raw_nbits;
}
if ( bfsk_data_rate >= 400 ) {
/*
* Bell 202: baud=1200 mark=1200 space=2200
@ -969,12 +776,9 @@ main( int argc, char*argv[] )
bfsk_n_data_bits,
bfsk_nstartbits,
bfsk_nstopbits,
invert_start_stop,
bfsk_msb_first,
bfsk_do_tx_sync_bytes,
bfsk_sync_byte,
bfsk_databits_encode,
txcarrier
bfsk_databits_encode
);
simpleaudio_close(sa_out);
@ -982,6 +786,7 @@ main( int argc, char*argv[] )
return 0;
}
/*
* Open the input audio stream
*/
@ -999,7 +804,7 @@ main( int argc, char*argv[] )
sample_rate = simpleaudio_get_rate(sa);
if ( rxnoise_factor != 0.0f )
if ( rxnoise_factor != 0.0 )
simpleaudio_set_rxnoise(sa, rxnoise_factor);
/*
@ -1070,37 +875,20 @@ main( int argc, char*argv[] )
// for encodings without start/stop bits:
// MUST be <= 0.5 or we may accidentally skip a bit
//
assert( fsk_frame_overscan >= 0.0f && fsk_frame_overscan < 1.0f );
assert( fsk_frame_overscan >= 0.0 && fsk_frame_overscan < 1.0 );
// ensure that we overscan at least a single sample
unsigned int nsamples_overscan
= nsamples_per_bit * fsk_frame_overscan + 0.5f;
if ( fsk_frame_overscan > 0.0f && nsamples_overscan == 0 )
= nsamples_per_bit * fsk_frame_overscan + 0.5;
if ( fsk_frame_overscan > 0.0 && nsamples_overscan == 0 )
nsamples_overscan = 1;
debug_log("fsk_frame_overscan=%f nsamples_overscan=%u\n",
fsk_frame_overscan, nsamples_overscan);
// n databits plus bfsk_startbit start bits plus bfsk_nstopbit stop bits:
float frame_n_bits = bfsk_n_data_bits + bfsk_nstartbits + bfsk_nstopbits;
unsigned int frame_nsamples = nsamples_per_bit * frame_n_bits + 0.5f;
unsigned int frame_nsamples = nsamples_per_bit * frame_n_bits + 0.5;
char expect_data_string_buffer[64];
if (expect_data_string == NULL) {
expect_data_string = expect_data_string_buffer;
expect_n_bits = build_expect_bits_string(expect_data_string, bfsk_nstartbits, bfsk_n_data_bits, bfsk_nstopbits, invert_start_stop, 0, 0);
}
debug_log("eds = '%s' (%lu)\n", expect_data_string, strlen(expect_data_string));
char expect_sync_string_buffer[64];
if (expect_sync_string == NULL && bfsk_do_rx_sync && (long long) bfsk_sync_byte >= 0) {
expect_sync_string = expect_sync_string_buffer;
build_expect_bits_string(expect_sync_string, bfsk_nstartbits, bfsk_n_data_bits, bfsk_nstopbits, invert_start_stop, 1, bfsk_sync_byte);
} else {
expect_sync_string = expect_data_string;
}
debug_log("ess = '%s' (%lu)\n", expect_sync_string, strlen(expect_sync_string));
unsigned int expect_nsamples = nsamples_per_bit * expect_n_bits;
float track_amplitude = 0.0;
float peak_confidence = 0.0;
@ -1135,7 +923,7 @@ main( int argc, char*argv[] )
assert ( samples_nvalid + read_nsamples <= samplebuf_size );
ssize_t r;
r = simpleaudio_read(sa, samples_readptr, read_nsamples);
debug_log("simpleaudio_read(samplebuf+%td, n=%zu) returns %zd\n",
debug_log("simpleaudio_read(samplebuf+%zd, n=%zu) returns %zd\n",
samples_readptr - samplebuf, read_nsamples, r);
if ( r < 0 ) {
fprintf(stderr, "simpleaudio_read: error\n");
@ -1150,7 +938,7 @@ main( int argc, char*argv[] )
/* Auto-detect carrier frequency */
static int carrier_band = -1;
if ( carrier_autodetect_threshold > 0.0f && carrier_band < 0 ) {
if ( carrier_autodetect_threshold > 0.0 && carrier_band < 0 ) {
unsigned int i;
float nsamples_per_scan = nsamples_per_bit;
if ( nsamples_per_scan > fskp->fftsize )
@ -1172,7 +960,7 @@ main( int argc, char*argv[] )
}
// default negative shift -- reasonable?
int b_shift = - (float)(autodetect_shift + fskp->band_width/2.0f)
int b_shift = - (float)(autodetect_shift + fskp->band_width/2.0)
/ fskp->band_width;
if ( bfsk_inverted_freqs )
b_shift *= -1;
@ -1198,6 +986,46 @@ main( int argc, char*argv[] )
debug_log( "--------------------------\n");
// example expect_bits_string
// 0123456789A
// isddddddddp i == idle bit (a.k.a. prev_stop bit)
// s == start bit d == data bits p == stop bit
// ebs = "10dddddddd1" <-- expected mark/space framing pattern
//
// NOTE! expect_n_bits ends up being (frame_n_bits+1), because
// we expect the prev_stop bit in addition to this frame's own
// (start + n_data_bits + stop) bits. But for each decoded frame,
// we will advance just frame_n_bits worth of samples, leaving us
// pointing at our stop bit -- it becomes the next frame's prev_stop.
//
// prev_stop--v
// start--v v--stop
// char *expect_bits_string = "10dddddddd1";
//
char expect_bits_string[32];
int j = 0;
if ( bfsk_nstopbits != 0.0 )
expect_bits_string[j++] = '1';
int i;
// Nb. only integer number of start bits works (for rx)
for ( i=0; i<bfsk_nstartbits; i++ )
expect_bits_string[j++] = '0';
for ( i=0; i<bfsk_n_data_bits; i++,j++ ) {
if ( ! carrier && bfsk_do_rx_sync )
expect_bits_string[j] = ( (bfsk_sync_byte>>i)&1 ) + '0';
else
expect_bits_string[j] = 'd';
}
if ( bfsk_nstopbits != 0.0 )
expect_bits_string[j++] = '1';
expect_bits_string[j++] = 0;
unsigned int expect_n_bits = strlen(expect_bits_string);
unsigned int expect_nsamples = nsamples_per_bit * expect_n_bits;
// fprintf(stderr, "ebs = '%s' (%lu) ; expect_nsamples=%u samples_nvalid=%lu\n", expect_bits_string, strlen(expect_bits_string), expect_nsamples, samples_nvalid);
if ( samples_nvalid < expect_nsamples )
break;
@ -1207,7 +1035,7 @@ main( int argc, char*argv[] )
// 2. allows us to track slightly slow signals
unsigned int try_max_nsamples;
if ( carrier )
try_max_nsamples = nsamples_per_bit * 0.75f + 0.5f;
try_max_nsamples = nsamples_per_bit * 0.75 + 0.5;
else
try_max_nsamples = nsamples_per_bit;
try_max_nsamples += nsamples_overscan;
@ -1223,7 +1051,7 @@ main( int argc, char*argv[] )
try_step_nsamples = 1;
float confidence, amplitude;
unsigned long long bits = 0;
unsigned int bits = 0;
/* Note: frame_start_sample is actually the sample where the
* prev_stop bit begins (since the "frame" includes the prev_stop). */
unsigned int frame_start_sample = 0;
@ -1239,7 +1067,7 @@ main( int argc, char*argv[] )
try_max_nsamples,
try_step_nsamples,
try_confidence_search_limit,
carrier ? expect_data_string : expect_sync_string,
expect_bits_string,
&bits,
&amplitude,
&frame_start_sample
@ -1247,7 +1075,7 @@ main( int argc, char*argv[] )
int do_refine_frame = 0;
if ( confidence < peak_confidence * 0.75f ) {
if ( confidence < peak_confidence * 0.75 ) {
do_refine_frame = 1;
debug_log(" ... do_refine_frame rescan (confidence %.3f << %.3f peak)\n", confidence, peak_confidence);
peak_confidence = 0;
@ -1255,7 +1083,7 @@ main( int argc, char*argv[] )
// no-confidence if amplitude drops abruptly to < 25% of the
// track_amplitude, which follows amplitude with hysteresis
if ( amplitude < track_amplitude * 0.25f ) {
if ( amplitude < track_amplitude * 0.25 ) {
confidence = 0;
}
@ -1308,12 +1136,12 @@ main( int argc, char*argv[] )
if ( !quiet_mode ) {
if ( bfsk_data_rate >= 100 )
fprintf(stderr, "### CARRIER %u @ %.1f Hz ",
(unsigned int)(bfsk_data_rate + 0.5f),
(double)(fskp->b_mark * fskp->band_width));
(unsigned int)(bfsk_data_rate + 0.5),
fskp->b_mark * fskp->band_width);
else
fprintf(stderr, "### CARRIER %.2f @ %.1f Hz ",
(double)(bfsk_data_rate),
(double)(fskp->b_mark * fskp->band_width));
bfsk_data_rate,
fskp->b_mark * fskp->band_width);
}
if ( !quiet_mode )
@ -1340,14 +1168,14 @@ main( int argc, char*argv[] )
try_step_nsamples = 1;
try_confidence_search_limit = INFINITY;
float confidence2, amplitude2;
unsigned long long bits2;
unsigned int bits2;
unsigned int frame_start_sample2;
confidence2 = fsk_find_frame(fskp, samplebuf, expect_nsamples,
try_first_sample,
try_max_nsamples,
try_step_nsamples,
try_confidence_search_limit,
carrier ? expect_data_string : expect_sync_string,
expect_bits_string,
&bits2,
&amplitude2,
&frame_start_sample2
@ -1384,7 +1212,7 @@ main( int argc, char*argv[] )
frame_start_sample, advance);
// chop off the prev_stop bit
if ( bfsk_nstopbits != 0.0f )
if ( bfsk_nstopbits != 0.0 )
bits = bits >> 1;
@ -1394,11 +1222,9 @@ main( int argc, char*argv[] )
*/
// chop off framing bits
bits = bit_window(bits, bfsk_nstartbits, bfsk_n_data_bits);
if (bfsk_msb_first) {
bits = bit_reverse(bits, bfsk_n_data_bits);
}
debug_log("Input: %08x%08x - Databits: %u - Shift: %i\n", (unsigned int)(bits >> 32), (unsigned int)bits, bfsk_n_data_bits, bfsk_nstartbits);
unsigned int frame_bits_shift = bfsk_nstartbits;
unsigned int frame_bits_mask = (int)(1<<bfsk_n_data_bits) - 1;
bits = ( bits >> frame_bits_shift ) & frame_bits_mask;
unsigned int dataout_size = 4096;
char dataoutbuf[4096];
@ -1434,8 +1260,6 @@ main( int argc, char*argv[] )
} /* end of the main loop */
free(samplebuf);
signal(SIGINT, SIG_DFL);
if ( carrier ) {

View File

@ -1,7 +1,7 @@
/*
* simple-tone-generator.c
*
* Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
* Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
*
* 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
@ -49,15 +49,15 @@ simpleaudio_tone_init( unsigned int new_sin_table_len, float mag )
}
unsigned int i;
unsigned short mag_s = 32767.0f * tone_mag + 0.5f;
unsigned short mag_s = 32767.0 * tone_mag + 0.5f;
if ( tone_mag > 1.0f ) // clamp to 1.0 to avoid overflow
mag_s = 32767;
if ( mag_s < 1 ) // "short epsilon"
mag_s = 1;
for ( i=0; i<sin_table_len; i++ )
sin_table_short[i] = lroundf( mag_s * sinf((float)M_PI*2*i/sin_table_len) );
sin_table_short[i] = lroundf( mag_s * sin(M_PI*2.0*(float)i/sin_table_len) );
for ( i=0; i<sin_table_len; i++ )
sin_table_float[i] = tone_mag * sinf((float)M_PI*2*i/sin_table_len);
sin_table_float[i] = tone_mag * sinf(M_PI*2.0*(float)i/sin_table_len);
} else {
if ( sin_table_short ) {
@ -116,7 +116,7 @@ simpleaudio_tone(simpleaudio *sa_out, float tone_freq, size_t nsamples_dur)
float wave_nsamples = simpleaudio_get_rate(sa_out) / tone_freq;
size_t i;
#define TURNS_TO_RADIANS(t) ( (float)M_PI*2 * (t) )
#define TURNS_TO_RADIANS(t) ( M_PI*2.0 * (t) )
#define SINE_PHASE_TURNS ( (float)i/wave_nsamples + sa_tone_cphase )
#define SINE_PHASE_RADIANS TURNS_TO_RADIANS(SINE_PHASE_TURNS)
@ -143,7 +143,7 @@ simpleaudio_tone(simpleaudio *sa_out, float tone_freq, size_t nsamples_dur)
for ( i=0; i<nsamples_dur; i++ )
short_buf[i] = sin_lu_short(SINE_PHASE_TURNS);
} else {
unsigned short mag_s = 32767.0f * tone_mag + 0.5f;
unsigned short mag_s = 32767.0 * tone_mag + 0.5f;
if ( tone_mag > 1.0f ) // clamp to 1.0 to avoid overflow
mag_s = 32767;
if ( mag_s < 1 ) // "short epsilon"

View File

@ -155,7 +155,7 @@ sa_alsa_open_stream(
channels,
rate,
1 /* soft_resample (allow) */,
100000 /* latency (us) */);
(unsigned int)-1 /* latency (allow max to avoid underruns) */);
if (error) {
fprintf(stderr, "E: %s\n", snd_strerror(error));
snd_pcm_close(pcm);

View File

@ -61,12 +61,12 @@ sa_sndfile_read( simpleaudio *sa, void *buf, size_t nframes )
return -1;
}
if ( sa->rxnoise != 0.0f ) {
if ( sa->rxnoise != 0.0 ) {
int i;
float *fbuf = buf;
float f = sa->rxnoise * 2;
for ( i=0; i<nframes; i++ )
fbuf[i] += (rand()/RAND_MAX - 0.5f) * f;
fbuf[i] += (drand48() - 0.5) * f;
}
// fprintf(stderr, "sf_read: nframes=%ld n=%d\n", nframes, n);
@ -200,15 +200,6 @@ sa_sndfile_open_stream(
return 0;
}
// Disable the insertion of this questionable "PEAK chunk" header thing.
// Relates only to writing SF_FORMAT_FLOAT .wav and .aiff files
// (minimodem --tx --float-samples). When left enabled, this adds some
// wonky bytes to the header which change from run to run (different every
// wall-clock second. WTF?
// http://www.mega-nerd.com/libsndfile/command.html#SFC_SET_ADD_PEAK_CHUNK
/* Turn off the PEAK chunk. */
sf_command(s, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE);
/* good or bad to override these? */
sa->rate = sfinfo.samplerate;
sa->channels = sfinfo.channels;

View File

@ -111,13 +111,6 @@ simpleaudio_open_stream(
backend_device, sa_stream_direction, sa_format,
rate, channels, app_name, stream_name);
if ( sa->channels != channels ) {
fprintf(stderr, "%s: input stream must be %u-channel (not %u)\n",
stream_name, channels, sa->channels);
simpleaudio_close(sa);
return 0;
}
if ( ok ) {
assert( sa->backend_framesize == sa->channels * sa->samplesize );
return sa;

View File

@ -1,68 +0,0 @@
/*
* uic_codes.c
*
* Copyright (C) 2014 Marcos Vives Del Sol <socram8888@gmail.com>
*
* 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/>.
*/
#include <stdlib.h>
#include <assert.h>
#include "uic_codes.h"
uic_message uic_ground_to_train_messages[] = {
{ 0x00, "Test" },
{ 0x02, "Run slower" },
{ 0x03, "Extension of telegram" },
{ 0x04, "Run faster" },
{ 0x06, "Written order" },
{ 0x08, "Speech" },
{ 0x09, "Emergency stop" },
{ 0x0C, "Announcem. by loudspeaker" },
{ 0x55, "Idle" },
{ -1, NULL }
};
uic_message uic_train_to_ground_messages[] = {
{ 0x08, "Communic. desired" },
{ 0x0A, "Acknowl. of order" },
{ 0x06, "Advice" },
{ 0x00, "Test" },
{ 0x09, "Train staff wish to comm." },
{ 0x0C, "Telephone link desired" },
{ 0x03, "Extension of telegram" },
{ -1, NULL }
};
const char * uic_message_meaning(unsigned int code,
unsigned int type)
{
uic_message * messages;
if (type == UIC_TYPE_GROUNDTRAIN) {
messages = uic_ground_to_train_messages;
} else if (type == UIC_TYPE_TRAINGROUND) {
messages = uic_train_to_ground_messages;
} else {
assert(0);
}
while (messages->code != -1) {
if (messages->code == code) {
return messages->meaning;
}
messages++;
}
return "Unknown";
}

View File

@ -1,34 +0,0 @@
/*
* uic_codes.h
*
* Copyright (C) 2014 Marcos Vives Del Sol <socram8888@gmail.com>
*
* 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/>.
*/
typedef struct {
unsigned int code;
char * meaning;
} uic_message;
enum {
UIC_TYPE_GROUNDTRAIN,
UIC_TYPE_TRAINGROUND,
};
extern uic_message uic_ground_to_train_messages[];
extern uic_message uic_train_to_ground_messages[];
const char * uic_message_meaning(unsigned int code,
unsigned int type);

View File

@ -1,44 +0,0 @@
#!/bin/bash
MINIMODEM="${MINIMODEM-./minimodem}"
[ -f "$MINIMODEM" ] || {
MINIMODEM="../src/minimodem"
[ -f "$MINIMODEM" ] || {
echo "E: cannot find minimodem in ./ or ../src/" 1>&2
exit 1
}
}
minimodem_tx_args="1200 $1"
textfile="testdata-ascii.txt"
TMPF="/tmp/minimodem-test-$$"
trap "rm -f $TMPF.*" 0
set -e
$MINIMODEM --tx --file $TMPF.1.wav $minimodem_tx_args < "$textfile"
sleep 1
$MINIMODEM --tx --file $TMPF.2.wav $minimodem_tx_args < "$textfile"
sleep 1
$MINIMODEM --tx --file $TMPF.3.wav $minimodem_tx_args < "$textfile"
cmp -s $TMPF.1.wav $TMPF.2.wav || {
echo -e "TX-NOT-CONSISTENT"
exit 1
}
cmp -s $TMPF.1.wav $TMPF.3.wav || {
echo -e "TX-NOT-CONSISTENT"
exit 1
}
stats="three runs of '--tx $minimodem_tx_args' created identical output"
result="OK "
exitcode=0
echo -e "$result $stats"
exit $exitcode

View File

@ -1 +0,0 @@
exec ./16-verify-tx-consistent.test --float-samples

View File

@ -1,2 +0,0 @@
#!/bin/bash
exec ./30-amplitude.test --float

View File

@ -1 +0,0 @@
exec ./40-noise.test 1200 -M 1200 -S 2400

View File

@ -1,2 +0,0 @@
#!/bin/bash
exec ./70-callerid-mdmf.test testdata-callerid-sdmf.bytes

View File

@ -1 +0,0 @@
exec ./self-test testdata-baudot.txt tdd

View File

@ -20,8 +20,8 @@
EXTRA_DIST = \
run-self-tests \
self-test \
*.test \
test-* \
testdata-*
TESTS = @auto_find_tests@
TESTS = test-*

465
tests/Makefile.in Normal file
View File

@ -0,0 +1,465 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am
#
# Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
#
# 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/>.
#
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tty_colors = \
red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPS_CFLAGS = @DEPS_CFLAGS@
DEPS_LIBS = @DEPS_LIBS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
run-self-tests \
self-test \
test-* \
testdata-*
TESTS = test-*
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu tests/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list=' $(TESTS) '; \
$(am__tty_colors); \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
col=$$red; res=XPASS; \
;; \
*) \
col=$$grn; res=PASS; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xfail=`expr $$xfail + 1`; \
col=$$lgn; res=XFAIL; \
;; \
*) \
failed=`expr $$failed + 1`; \
col=$$red; res=FAIL; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
col=$$blu; res=SKIP; \
fi; \
echo "$${col}$$res$${std}: $$tst"; \
done; \
if test "$$all" -eq 1; then \
tests="test"; \
All=""; \
else \
tests="tests"; \
All="All "; \
fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="$$All$$all $$tests passed"; \
else \
if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all $$tests failed"; \
else \
if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
if test "$$skip" -eq 1; then \
skipped="($$skip test was not run)"; \
else \
skipped="($$skip tests were not run)"; \
fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
if test "$$failed" -eq 0; then \
col="$$grn"; \
else \
col="$$red"; \
fi; \
echo "$${col}$$dashes$${std}"; \
echo "$${col}$$banner$${std}"; \
test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
test -z "$$report" || echo "$${col}$$report$${std}"; \
echo "$${col}$$dashes$${std}"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: all all-am check check-TESTS check-am clean clean-generic \
distclean distclean-generic distdir dvi dvi-am html html-am \
info info-am install install-am install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,6 +1,6 @@
#!/bin/bash
for testcase in ./*.test
for testcase in ./test-*
do
$testcase
if [ $? -eq 0 ]

2
tests/test-31-amplitude-float Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
exec ./test-30-amplitude --float

1
tests/test-41-noise-purefreqs Executable file
View File

@ -0,0 +1 @@
exec ./test-40-noise 1200 -M 1200 -S 2400

2
tests/test-71-callerid-sdmf Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
exec ./test-70-callerid-mdmf testdata-callerid-sdmf.bytes

View File

@ -15,3 +15,34 @@ the quick brown fox jumps over the lazy dog
Earning our SkyMiles
----------------------------------------------------------------------------
minimodem - software audio Bell-type or RTTY FSK modem
Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
Minimodem is a command-line program which generates (or decodes) audio
modem tones at any specified baud rate, emulating an old Bell-type or
radio-teletype FSK modem. The tones can be played to (or recorded from)
the system audio (PulseAudio or ALSA) or to an audio file.
Minimodem can be used to transfer data between nearby computers using an
audio cable (or just via sound waves), or between remote computers using
radio, telephone, or another audio communications medium.
----------------------------------------------------------------------------
minimodem - software audio Bell-type or RTTY FSK modem
Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
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/>.