The player application now has its own buildsystem separated from the library buildsystem. Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>master
parent
aa112da191
commit
adfc0c5f54
43 changed files with 1218 additions and 24 deletions
@ -1,24 +0,0 @@ |
||||
|
||||
#MAIN_OBJS = getopt.o getopt1.o options.o drivers.o main.o
|
||||
MAIN_OBJS = sound_alsa.o terminal.o info.o options.o main.o
|
||||
MAIN_DFILES = Makefile $(MAIN_OBJS:.o=.c)
|
||||
MAIN_PATH = players/xmp
|
||||
|
||||
dist-main: |
||||
mkdir -p $(DIST)/$(MAIN_PATH)
|
||||
cp -RPp $(addprefix $(MAIN_PATH)/,$(MAIN_DFILES)) $(DIST)/$(MAIN_PATH)
|
||||
|
||||
$(MAIN_PATH)/options.o: Makefile |
||||
|
||||
M_OBJS = $(addprefix $(MAIN_PATH)/,$(MAIN_OBJS))
|
||||
|
||||
$(MAIN_PATH)/xmp: $(M_OBJS) |
||||
@CMD='$(LD) -o $@ $(LDFLAGS) $(M_OBJS) -Llib -lxmp -lm -lasound'; \
|
||||
if [ "$(V)" -gt 0 ]; then echo $$CMD; else echo LD $@ ; fi; \
|
||||
eval $$CMD
|
||||
|
||||
install-xmp: $(MAIN_PATH)/xmp |
||||
@echo Installing xmp in $(DESTDIR)$(BINDIR)
|
||||
@[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
|
||||
@$(INSTALL_PROGRAM) $+ $(DESTDIR)$(BINDIR)
|
||||
|
||||
@ -0,0 +1,70 @@ |
||||
VERSION = 3.9.0
|
||||
|
||||
CC = @CC@
|
||||
CFLAGS = -c @CFLAGS@ @DEFS@ @CPPFLAGS@
|
||||
LD = @CC@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
DESTDIR =
|
||||
prefix = @prefix@
|
||||
exec_prefix = @prefix@
|
||||
datarootdir = @datarootdir@
|
||||
BINDIR = @bindir@
|
||||
LIBDIR = @libdir@
|
||||
MANDIR = @mandir@/man1
|
||||
SYSCONFDIR = @sysconfdir@/xmp
|
||||
SHELL = /bin/sh
|
||||
|
||||
DIST = xmp-$(VERSION)
|
||||
DFILES = README INSTALL configure configure.ac Makefile.in
|
||||
DDIRS = src drivers
|
||||
V = 0
|
||||
|
||||
all: binaries |
||||
|
||||
include src/Makefile |
||||
include src/drivers/Makefile |
||||
|
||||
CFLAGS += -I. -DVERSION=\"$(VERSION)\"
|
||||
|
||||
.SUFFIXES: .c .o .lo .a .so .dll |
||||
|
||||
.c.o: |
||||
@CMD='$(CC) $(CFLAGS) -o $*.o $<'; \
|
||||
if [ "$(V)" -gt 0 ]; then echo $$CMD; else echo CC $*.o ; fi; \
|
||||
eval $$CMD
|
||||
|
||||
binaries: src/xmp |
||||
|
||||
clean: |
||||
@rm -f $(OBJS)
|
||||
|
||||
install: install-xmp install-docs |
||||
|
||||
depend: |
||||
@echo Building dependencies...
|
||||
@echo > $@
|
||||
@for i in $(OBJS) do \
|
||||
c="$${i%.o}.c"; l="$${i%.o}.lo"; \
|
||||
$(CC) $(CFLAGS) -MM $$c | \
|
||||
sed "s!^.*\.o:!$$i $$l:!" >> $@ ; \
|
||||
done
|
||||
|
||||
dist: dist-prepare dist-subdirs |
||||
|
||||
dist-prepare: |
||||
rm -Rf $(DIST) $(DIST).tar.gz
|
||||
mkdir -p $(DIST)
|
||||
cp -RPp $(DFILES) $(DIST)/
|
||||
|
||||
dist-subdirs: $(addprefix dist-,$(DDIRS)) |
||||
chmod -R u+w $(DIST)/*
|
||||
tar cvf - $(DIST) | gzip -9c > $(DIST).tar.gz
|
||||
rm -Rf $(DIST)
|
||||
ls -l $(DIST).tar.gz
|
||||
|
||||
$(OBJS): Makefile |
||||
|
||||
sinclude depend |
||||
|
||||
@ -0,0 +1,27 @@ |
||||
dnl AC_CONFIG_AUX_DIR(./scripts) |
||||
AC_INIT |
||||
0>confdefs.h |
||||
|
||||
AC_ARG_WITH(libxmp, [ --with-libxmp=<path> libxmp prefix (optional)], |
||||
libxmp_path="$withval") |
||||
|
||||
AC_PROG_CC |
||||
|
||||
if test "$libxmp_path" != ""; then |
||||
CINCS="${CINCS} -I${libxmp_path}/include" |
||||
LIBS="${LIBS} -L${libxmp_path}/lib" |
||||
fi |
||||
CPPFLAGS="${CINCS}" |
||||
|
||||
AC_CHECK_HEADER(xmp.h) |
||||
if test "${ac_cv_header_xmp_h}" = "yes"; then |
||||
AC_CHECK_LIB(xmp,xmp_player_start,, |
||||
AC_MSG_ERROR(Can't find libxmp)) |
||||
else |
||||
AC_MSG_ERROR(Can't find libxmp header files) |
||||
fi |
||||
|
||||
|
||||
AC_PROG_INSTALL |
||||
AC_CONFIG_FILES([Makefile]) |
||||
AC_OUTPUT |
||||
@ -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: |
||||
@ -0,0 +1,22 @@ |
||||
|
||||
#SRC_OBJS = getopt.o getopt1.o options.o drivers.o main.o
|
||||
SRC_OBJS = sound_alsa.o terminal.o info.o options.o main.o
|
||||
SRC_DFILES = Makefile xmp.1 $(SRC_OBJS:.o=.c) common.h
|
||||
SRC_PATH = src
|
||||
|
||||
OBJS += $(addprefix $(SRC_PATH)/,$(SRC_OBJS))
|
||||
|
||||
dist-src: |
||||
mkdir -p $(DIST)/$(SRC_PATH)
|
||||
cp -RPp $(addprefix $(SRC_PATH)/,$(SRC_DFILES)) $(DIST)/$(SRC_PATH)
|
||||
|
||||
$(SRC_PATH)/xmp: $(OBJS) |
||||
@CMD='$(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS) -lasound'; \
|
||||
if [ "$(V)" -gt 0 ]; then echo $$CMD; else echo LD $@ ; fi; \
|
||||
eval $$CMD
|
||||
|
||||
install-xmp: $(SRC_PATH)/xmp |
||||
@echo Installing xmp in $(DESTDIR)$(BINDIR)
|
||||
@[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
|
||||
@$(INSTALL_PROGRAM) $+ $(DESTDIR)$(BINDIR)
|
||||
|
||||
@ -0,0 +1,239 @@ |
||||
.TH "XMP" "1" "Version 3\&.5\&.0" "Jan 2012" "Extended Module Player" |
||||
.PP |
||||
.SH "NAME" |
||||
xmp - Extended Module Player |
||||
.PP |
||||
.SH "SYNOPSIS" |
||||
\fBxmp\fP |
||||
[\fB-8, --8bit\fP] |
||||
[\fB-a, --amplify\fP \fIfactor\fP] |
||||
[\fB-b, --bits\fP \fIbits\fP] |
||||
[\fB-c, --stdout\fP] |
||||
[\fB-D\fP \fIdevice-specific parameters\fP] |
||||
[\fB-d, --driver\fP \fIdriver\fP] |
||||
[\fB--fix-sample-loop\fP] |
||||
[\fB-F, --click-filter\fP] |
||||
[\fB-f, --frequency\fP \fIrate\fP] |
||||
[\fB-h, --help\fP] |
||||
[\fB-I, --instrument-path\fP] |
||||
[\fB-i, --interpolate\fP] |
||||
[\fB--load-only\fP] |
||||
[\fB-l, --loop\fP] |
||||
[\fB-M, --mute\fP \fIchannel-list\fP] |
||||
[\fB-m, --mono\fP] |
||||
[\fB--nocmd\fP] |
||||
[\fB--nofilter\fP] |
||||
[\fB-n, --nearest\fP] |
||||
[\fB--nopan\fP] |
||||
[\fB--norc\fP] |
||||
[\fB-o, --output-file\fP \fIfilename\fP] |
||||
[\fB-P, --pan\fP \fIpan\fP] |
||||
[\fB--probe-only\fP] |
||||
[\fB-R --random\fP] |
||||
[\fB--realtime\fP] |
||||
[\fB-r --reverse\fP] |
||||
[\fB--show-time\fP] |
||||
[\fB-S, --solo\fP \fIchannel-list\fP] |
||||
[\fB-s, --start\fP \fIpos\fP] |
||||
[\fB--stereo\fP] |
||||
[\fB-T, --tempo\fP \fIbpm\fP] |
||||
[\fB-t, --time\fP \fItime\fP] |
||||
[\fB-u, --unsigned\fP] |
||||
[\fB-V, --version\fP] |
||||
[\fB-v, --verbose\fP] |
||||
\fImodules\fP |
||||
.PP |
||||
.SH "DESCRIPTION" |
||||
\fBxmp\fP is a tracked music module player\&. It plays many |
||||
module formats including Fasttracker II (XM), Noise/Fast/Protracker (MOD), |
||||
Scream Tracker 3 (S3M) and Impulse Tracker (IT)\&. Use \f(CWxmp --help\fP |
||||
for a complete list of supported formats\&. |
||||
.PP |
||||
\fBxmp\fP can play through several output devices including the Open |
||||
Sound System sequencer, linear and ulaw PCM audio devices or mixing |
||||
to a raw or WAV file\&. |
||||
.PP |
||||
.SH "OPTIONS" |
||||
.IP "\fB-8, --8bit\fP" |
||||
Convert 16 bit samples to 8 bit\&. You may want to use this mode to |
||||
save memory in the sound device (AWE cards will ignore this mode and |
||||
always work with 16 bit samples)\&. |
||||
.IP "\fB-a, --amplify\fP \fIfactor\fP" |
||||
Amplification factor for the software mixer\&. Valid amplification factors |
||||
are 0 (normal), 1 (x2), 2 (x4) and 3 (x8)\&. Warning\&: amplification |
||||
factors higher than 0 may cause distorted or noisy output\&. |
||||
.IP "\fB-b, --bits\fP \fIbits\fP" |
||||
Set the software mixer resolution (8 or 16 bits)\&. If ommited, |
||||
The audio device will be opened at the highest resolution available\&. |
||||
.IP "\fB-c, --stdout\fP" |
||||
Mix the module to stdout\&. |
||||
.IP "\fB-D\fP \fIdevice-specific parameter\fP" |
||||
Pass a configuration parameter to the device driver\&. See the |
||||
\fBDEVICE DRIVER PARAMETERS\fP section below for a |
||||
list of known parameters\&. |
||||
.IP "\fB-d, --driver\fP \fIdriver\fP" |
||||
Select the output driver\&. If not specified, \fBxmp\fP will try to |
||||
probe each available driver\&. |
||||
.IP "\fB--fix-sample-loop\fP" |
||||
Force sample loop start in samples instead of 16-bit words\&. This |
||||
option affects only MOD files\&. |
||||
.IP "\fB-F, --click-filter\fP" |
||||
Use the LPF filter to remove clicks from the software mixer output\&. |
||||
.IP "\fB-f, --frequency\fP \fIrate\fP" |
||||
Set the software mixer sampling rate in hertz\&. |
||||
.IP "\fB-h, --help\fP" |
||||
Show a short summary of command-line options\&. |
||||
.IP "\fB-I, --instrument-path\fP \fIpath\fP" |
||||
Set the pathname to the directory containing external samples\&. |
||||
.IP "\fB-i, --interpolate\fP" |
||||
Enable software mixer linear interpolation\&. |
||||
.IP "\fB--load-only\fP" |
||||
Exit after loading the module\&. |
||||
.IP "\fB-l, --loop\fP" |
||||
Enable module looping and backward pattern jumps\&. |
||||
.IP "\fB-M, --mute\fP \fIchannel-list\fP" |
||||
Mute the specified channels\&. \fIchannel-list\fP is a comma-separated |
||||
list of decimal channel ranges\&. Example: 0,2-4,8-16\&. |
||||
.IP "\fB-m, --mono\fP" |
||||
Force mono output (default is stereo in stereo-capable devices)\&. |
||||
.IP "\fB--nocmd\fP" |
||||
Disable interactive commands\&. |
||||
.IP "\fB--nofilter\fP" |
||||
Disable IT filters\&. When using the software mixer, IT filters can |
||||
significantly increase CPU usage on slow machines\&. In this case, |
||||
disable filtering with this option\&. |
||||
.IP "\fB-n, --nearest\fP" |
||||
Enable software mixer nearest neighbor interpolation\&. |
||||
.IP "\fB--nopan\fP" |
||||
Disable dynamic panning\&. This option can be used to prevent |
||||
clicking when playing in AWE32 cards\&. Module formats that rely only |
||||
in dynamic pan setting to produce stereo output (e\&.g\&. XM) will use |
||||
the MOD channel panning (LRRL)\&. |
||||
.IP "\fB--norc\fP" |
||||
Don't read the configuration files\&. |
||||
.IP "\fB-o, --output-file\fP \fIfilename\fP" |
||||
Set the output file name when mixing to raw or WAV files\&. If \'-\' is |
||||
given as the file name, the output will be sent to stdout\&. |
||||
.IP "\fB-P, --pan\fP \fInum\fP" |
||||
Set the percentual panning amplitude\&. |
||||
.IP "\fB--probe-only\fP" |
||||
Exit after probing the audio device\&. |
||||
.IP "\fB-R, --random\fP" |
||||
Play modules in random order\&. |
||||
.IP "\fB--realtime\fP" |
||||
Play modules in realtime priority (available for FreeBSD)\&. |
||||
.IP "\fB-r, --reverse\fP" |
||||
Reverse the left/right stereo channels\&. |
||||
.IP "\fB--show-time\fP" |
||||
Display elapsed and remaining time\&. |
||||
.IP "\fB-S, --solo\fP \fIchannel-list\fP" |
||||
Play only the specified channels\&. \fIchannel-list\fP is a |
||||
comma-separated list of decimal channel ranges\&. Example: 0,2-4,8-16\&. |
||||
.IP "\fB-s, --start\fP \fIpos\fP" |
||||
Start playing the module from the position \fIpos\fP\&. |
||||
.IP "\fB--stereo\fP" |
||||
Force stereo output\&. |
||||
.IP "\fB-T, --tempo\fP \fIbpm\fP" |
||||
Set the initial tempo in beats per minute (default is 125)\&. |
||||
.IP "\fB-t, --time\fP \fItime\fP" |
||||
Specifies the maximum playing time to \fItime\fP seconds\&. |
||||
.IP "\fB-u, --unsigned\fP" |
||||
Tell the software mixer to use unsigned samples when mixing to |
||||
a file (default is signed)\&. |
||||
.IP "\fB-V, --version\fP" |
||||
Print version information\&. |
||||
.IP "\fB-v, --verbose\fP" |
||||
Verbose mode (incremental)\&. If specified more than once, the |
||||
verbosity level will be increased (no messages will be displayed |
||||
when the player runs in background)\&. |
||||
.PP |
||||
.SH "DEVICE DRIVER PARAMETERS" |
||||
Use the option \fB-D\fP to send parameters directly to the device |
||||
drivers\&. Multiple \fB-D\fP options can be specified in the command line\&. |
||||
.PP |
||||
OSS software mixing: |
||||
.IP "\fB-D\fP \fIfrag=num,size\fP" |
||||
Set the maximum number of fragments to \fInum\fP and the size of |
||||
each fragment to \fIsize\fP bytes (must be a power of two)\&. |
||||
The number and size of fragments set a tradeoff between the buffering |
||||
latency and sensibility to system load\&. To get better synchronization, |
||||
reduce the values\&. To avoid gaps in the sound playback, increase |
||||
the values\&. |
||||
.IP "\fB-D\fP \fIdev=device_name\fP" |
||||
Set the audio device to open\&. Default is /dev/dsp\&. |
||||
.IP "\fB-D\fP \fInosync\fP" |
||||
Don\'t sync the OSS audio device between modules\&. |
||||
.PP |
||||
HP-UX and Solaris audio: |
||||
.IP "\fB-D\fP \fIgain=value\fP" |
||||
Set the audio gain\&. Valid \fIvalue\fP goes from 0 to 255\&. |
||||
The default is 128\&. |
||||
.IP "\fB-D\fP \fIport={s|h|l}\fP" |
||||
Set the audio port\&. Valid arguments are \fIs\fP for the internal |
||||
speaker, \fIh\fP for headphones and \fIl\fP for line out\&. The default |
||||
is the internal speaker\&. |
||||
.IP "\fB-D\fP \fIbuffer=size\fP" |
||||
Set the size in bytes of the audio buffer\&. The default value is 32 Kb\&. |
||||
.PP |
||||
File output: |
||||
.IP "\fB-D\fP \fIbig-endian\fP" |
||||
Generate big-endian 16-bit samples (default is the machine byte ordering)\&. |
||||
.IP "\fB-D\fP \fIlittle-endian\fP" |
||||
Generate little-endian 16-bit samples (default is the machine byte ordering)\&. |
||||
.PP |
||||
.SH "INTERACTIVE COMMANDS" |
||||
The following single key commands can be used when playing modules: |
||||
.IP "\fBq\fP" |
||||
Stop the currently playing module and quit the player\&. |
||||
.IP "\fBf\fP" |
||||
Jump to the next pattern\&. |
||||
.IP "\fBb\fP" |
||||
Jump to the previous pattern\&. |
||||
.IP "\fBn\fP" |
||||
Jump to the next module\&. |
||||
.IP "\fBp\fP" |
||||
Jump to the previous module\&. |
||||
.IP "\fBSPACE\fP" |
||||
Pause the module\&. |
||||
.IP "\fB1\fP, \fB2\fP, \fB3\fP, \fB4\fP, \fB5\fP, \fB6\fP, \fB7\fP, \fB8\fP, \fB9\fP, \fB0\fP" |
||||
Mute/unmute channels 1 to 10\&. |
||||
.IP "\fB!\fP" |
||||
Unmute all channels\&. |
||||
.PP |
||||
Interactive mode can be disabled using the \fB--nocmd\fP command |
||||
line option\&. |
||||
.PP |
||||
.SH "NOTES" |
||||
When using the OSS sequencer with an AWE card, xmp will wipe out any |
||||
soundfonts already loaded in the card\&. |
||||
.PP |
||||
.SH "EXAMPLES" |
||||
Play module muting channels 0 to 3 and 6\&: |
||||
.IP "" |
||||
\f(CWxmp --mute=0-3,6 module\&.mod\&.gz\fP |
||||
.PP |
||||
Play modules in /dev/dsp using the default device settings (unsigned 8bit, |
||||
8 kHz mono): |
||||
.IP "" |
||||
\f(CWxmp -o/dev/dsp -f8000 -m -b8 -u module\&.lha\fP |
||||
.PP |
||||
Play all XM modules in the /mod directory and all subdirectories in |
||||
random order, ignoring any configuration set in the xmp\&.conf file\&: |
||||
.IP "" |
||||
\f(CWxmp --norc -R `find /mod -name "*\&.xm*" -print`\fP |
||||
.PP |
||||
.SH "ENVIRONMENT" |
||||
.IP "\fBXMP_INSTRUMENT_PATH\fP" |
||||
Pathname to directory containing samples if not contained in the module\&. |
||||
.PP |
||||
.IP "\fBXMP_MED2_INSTRUMENT_PATH\fP" |
||||
Overrides samples directory for the MED2 loader\&. |
||||
.PP |
||||
.SH "FILES" |
||||
\f(CW/etc/xmp/xmp\&.conf\&, $HOME/\&.xmp/xmp\&.conf\&, /etc/xmp/modules\&.conf\&, $HOME/\&.xmp/modules\&.conf\fP |
||||
.PP |
||||
.SH "AUTHOR" |
||||
Claudio Matsuoka and Hipolito Carraro Jr. Portions of code |
||||
used in xmp have been contributed by several other authors, |
||||
see docs/CREDITS for the complete list. |
||||
.PP |
||||
Loading…
Reference in new issue