+++ /dev/null
-#
-# Makefile for ALSA Utilities
-# Copyright (c) 1994-98 by Jaroslav Kysela <perex@jcu.cz>
-#
-
-ifeq (Makefile.conf,$(wildcard Makefile.conf))
-include Makefile.conf
-else
-dummy:
- @echo
- @echo "Please, run configure script as first..."
- @echo
-endif
-
-
-all:
- $(MAKE) -C alsactl
- $(MAKE) -C aplay
- $(MAKE) -C amixer
- $(MAKE) -C alsamixer
- @echo
- @echo "ALSA Utilities were sucessfully compiled."
- @echo
-
-install: all
- $(INSTALL) -m 755 -o root -g root -d ${sbindir}
- $(INSTALL) -s -m 755 -o root -g root alsactl/alsactl ${sbindir}
- $(INSTALL) -m 644 -o root -g root alsactl/alsactl.1 ${mandir}/man1
- $(INSTALL) -m 755 -o root -g root -d ${bindir}
- $(INSTALL) -s -m 755 -o root -g root aplay/aplay ${bindir}
- ln -sf aplay ${bindir}/arecord
- $(INSTALL) -s -m 755 -o root -g root amixer/amixer ${bindir}
- $(INSTALL) -d -m 755 -o root -g root ${mandir}/man1
- $(INSTALL) -m 644 -o root -g root amixer/amixer.1 ${mandir}/man1
- $(INSTALL) -s -m 755 -o root -g root alsamixer/alsamixer ${bindir}
- $(INSTALL) -m 644 -o root -g root alsamixer/alsamixer.1 ${mandir}/man1
- $(INSTALL) -m 644 -o root -g root aplay/arecord.1 ${mandir}/man1
- ln -sf arecord.1 ${mandir}/man1/aplay.1
-
-clean:
- $(MAKE) -C include clean
- $(MAKE) -C alsactl clean
- $(MAKE) -C aplay clean
- $(MAKE) -C amixer clean
- $(MAKE) -C alsamixer clean
- $(MAKE) -C utils clean
- rm -f core .depend *.o *.orig *~
- rm -f `find . -name "out.txt"`
-
-mrproper: clean
- rm -f config.cache config.log config.status Makefile.conf \
- include/aconfig.h utils/alsa-utils.spec
-
-cvsclean: mrproper
- rm -f configure
-
-pack: mrproper
- chown -R root.root ../alsa-utils
- mv ../alsa-utils ../alsa-utils-$(SND_UTIL_VERSION)
- tar --exclude=CVS -cvz -C .. -f ../alsa-utils-$(SND_UTIL_VERSION).tar.gz alsa-utils-$(SND_UTIL_VERSION)
- mv ../alsa-utils-$(SND_UTIL_VERSION) ../alsa-utils
--- /dev/null
+INCLUDES=-I$(top_srcdir)/include
+SUBDIRS=include alsactl alsamixer amixer aplay utils
+
+rpm: dist
+ $(MAKE) -C $@
+++ /dev/null
-#
-# Configuration Makefile for ALSA Utilities
-# Copyright (c) 1994-98 by Jaroslav Kysela <perex@jcu.cz>
-#
-
-srcdir=@srcdir@
-VPATH=@srcdir@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-includedir=@includedir@
-bindir=@bindir@
-sbindir=@sbindir@
-libdir=@libdir@
-mandir=@mandir@
-c_opts=@CFLAGS@
-INSTALL=@INSTALL@
-SND_UTIL_VERSION=@SND_UTIL_VERSION@
-SND_UTIL_MAJOR=@SND_UTIL_MAJOR@
-SND_UTIL_MINOR=@SND_UTIL_MINOR@
-SND_UTIL_SUBMINOR=@SND_UTIL_SUBMINOR@
-
-CC=gcc
-CPP=gcc
-INCLUDE=-I/usr/local/include -I$(TOPDIR)/include
-COPTS = $(c_opts)
-COPTS += -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe
-LINKER=ld
-FLEX=@LEX@
-BISON=@YACC@
-SNDLIB=-lasound
-NCURSESINC="<ncurses.h>"
-NCURSESLIB=-lncurses
-LN_S=@LN_S@
--- /dev/null
+/* Package name */
+#undef PACKAGE
+
+/* Package version */
+#undef VERSION
+++ /dev/null
-#
-# Makefile for alsactl program
-# Copyright (c) 1994-98 by Jaroslav Kysela <perex@jcu.cz>
-#
-
-TOPDIR=..
-
-include $(TOPDIR)/Makefile.conf
-
-CFLAGS=
-TARGET=alsactl
-OBJECTS=alsactl.o setup.o alsactl_parser.o alsactl_lexer.o
-
-# parser / lexer debug
-#CFLAGS += -DYYDEBUG
-#FLEXFLAGS = -d
-#BISONFLAGS = -v
-
-.c.o:
- $(CC) $(COPTS) $(CFLAGS) $(INCLUDE) -c -o $*.o $<
-
-all: $(TARGET)
-
-$(TARGET): .depend $(OBJECTS)
- $(CC) $(SNDLIB) $(OBJECTS) -o $(TARGET)
-
-alsactl_lexer.c: alsactl_lexer.l
- $(FLEX) $(FLEXFLAGS) -i -o$@ $<
-
-alsactl_parser.c: alsactl_parser.y
- $(BISON) $(BISONFLAGS) -do $@ $<
-
-clean:
- rm -f core alsactl .depend *.o *.orig *~ \
- alsactl_lexer.c alsactl_parser.[ch] alsactl_parser.output
-
-.depend:
- $(CPP) $(COPTS) $(INCLUDE) -M *.c > .depend
-
-#
-# include a dependency file if one exists
-#
-ifeq (.depend,$(wildcard .depend))
-include .depend
-endif
--- /dev/null
+bin_PROGRAMS=alsactl
+noinst_HEADERS=alsactl.h
+man_MANS=alsactl.1
+
+alsactl_SOURCES=alsactl.c alsactl_parser.y setup.c alsactl_lexer.l
+YFLAGS=-d
#include "alsactl.h"
#include "aconfig.h"
+#include "version.h"
#include <getopt.h>
#include <stdarg.h>
break;
case 'v':
case HELPID_VERSION:
- printf("alsactl version " SND_UTIL_VERSION "\n");
+ printf("alsactl version " SND_UTIL_VERSION_STR "\n");
return 1;
default:
fprintf(stderr, "\07Invalid switch or option needs an argument.\n");
return 0;
}
+
+
+++ /dev/null
-#
-# Makefile for Alsa Mixer
-#
-
-TOPDIR = ..
-
-include $(TOPDIR)/Makefile.conf
-
-OBJECTS = alsamixer.o
-
-.SUFFIXES:
-.SUFFIXES: .o .cpp .c .s .S
-
-.c.o:
- $(CC) $(COPTS) $(INCLUDE) -DNCURSESINC=$(NCURSESINC) -c -o $*.o $<
-
-all: alsamixer
-
-alsamixer: $(OBJECTS)
- $(CPP) -o alsamixer $(OBJECTS) $(SNDLIB) $(NCURSESLIB)
-
-clean:
- rm -f *.o alsamixer *~
--- /dev/null
+LDADD = $(CURSESLIB) -lasound
+
+bin_PROGRAMS = alsamixer
+man_MANS = alsamixer.1
+alsamixer_INCLUDES = -I$(top_srcdir)/include -DCURSESINC="$(CURSESINC)"
#include <unistd.h>
#include <sys/signal.h>
-#ifndef NCURSESINC
+#ifndef CURSESINC
#include <ncurses.h>
#else
-#include NCURSESINC
+#include CURSESINC
#endif
#include <time.h>
+++ /dev/null
-#
-# Makefile for Mixer
-#
-
-TOPDIR = ..
-
-include $(TOPDIR)/Makefile.conf
-
-OBJECTS = amixer.o amain.o
-
-.SUFFIXES:
-.SUFFIXES: .o .cpp .c .s .S
-
-.cpp.o:
- $(CXX) $(COPTS) $(INCLUDE) -c -o $*.o $<
-
-all: amixer
-
-amixer.o: amixer.cpp
- $(CXX) $(COPTS) $(INCLUDE) -c -o amixer.o amixer.cpp
-amain.o: amain.cpp
- $(CXX) $(COPTS) $(INCLUDE) -c -o amain.o amain.cpp
-
-amixer: $(OBJECTS)
- $(CXX) -o amixer $(SNDLIB) $(OBJECTS)
-
-clean:
- rm -f *.o amixer *~
-
--- /dev/null
+INCLUDES = -I$(top_srcdir)/include
+LDADD = -lasound
+EXTRA_DIST = README.first
+
+bin_PROGRAMS = amixer
+amixer_SOURCES = amain.cpp amixer.cpp
+noinst_HEADERS = amixer.h atypes.h
+man_MANS = amixer.1
+++ /dev/null
-#
-# Makefile for aplay program
-# Copyright (c) 1994-98 by Jaroslav Kysela <perex@jcu.cz>
-#
-
-TOPDIR=..
-
-include $(TOPDIR)/Makefile.conf
-
-TARGET=aplay
-TARGET1=arecord
-OBJECTS=aplay.o
-
-.c.o:
- $(CC) $(COPTS) $(INCLUDE) -c -o $*.o $<
-
-all: $(TARGET)
-
-$(TARGET): .depend $(OBJECTS)
- $(CC) $(SNDLIB) $(OBJECTS) -o $(TARGET)
- ln -sf $(TARGET) $(TARGET1)
-
-clean:
- rm -f core aplay .depend *.o *.orig *~
-
-.depend:
- $(CPP) $(COPTS) $(INCLUDE) -M *.c > .depend
-
-#
-# include a dependency file if one exists
-#
-ifeq (.depend,$(wildcard .depend))
-include .depend
-endif
--- /dev/null
+INCLUDES = -I$(top_srcdir)/include
+LDADD = -lasound
+
+bin_PROGRAMS = aplay
+man_MANS = aplay.1
+noinst_HEADERS = formats.h
+
+EXTRA_CLEAN = arecord
+
+arecord: aplay
+ rm -f arecord
+ $(LN_S) $< $@
+
+arecord.1: aplay.1
+ rm -f arecord.1
+ $(LN_S) $< $@
+
+install-exec-hook:
+ rm -f $(bindir)/arecord
+ (cd $(bindir) && $(LN_S) aplay arecord)
+
+install-data-hook:
+ rm -f $(mandir)/man1/arecord.1
+ (cd $(mandir)/man1 && $(LN_S) aplay.1 arecord.1)
#include <sys/asoundlib.h>
#include "aconfig.h"
#include "formats.h"
+#include "version.h"
#define DEFAULT_SPEED 8000
static void version(void)
{
- printf("%s: version " SND_UTIL_VERSION " by Jaroslav Kysela <perex@jcu.cz>\n", command);
+ printf("%s: version " SND_UTIL_VERSION_STR " by Jaroslav Kysela <perex@jcu.cz>\n", command);
}
int main(int argc, char *argv[])
dnl Process this file with autoconf to produce a configure script.
-
-AC_INIT(Makefile.conf.in)
+AC_INIT(alsamixer/alsamixer.c)
AC_PREFIX_DEFAULT(/usr)
+AM_INIT_AUTOMAKE(alsa-utils, 0.3.0-pre3)
dnl Checks for programs.
AC_PROG_CC
-AC_PROG_RANLIB
+AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
-AC_PROG_LEX
AC_PROG_YACC
+AM_PROG_LEX
+AM_PATH_ALSA(0.1.1)
dnl Checks for header files.
AC_HEADER_STDC
-AC_CONFIG_HEADER(include/aconfig.h)
-AC_CHECK_HEADERS(linux/asound.h sys/asoundlib.h)
+AC_CHECK_LIB(ncurses, initscr,
+ [ CURSESINC='<ncurses.h>'; CURSESLIB='-lncurses'; ], [
+ AC_CHECK_LIB(curses, initscr,
+ [ CURSESINC='<curses.h>'; CURSESLIB='-lcurses'; ])
+])
+
+AC_SUBST(CURSESINC)
+AC_SUBST(CURSESLIB)
+
+AM_CONFIG_HEADER(include/aconfig.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
-dnl Check for ALSA library package.
-myprefix=$prefix
-if test "$myprefix" = "NONE"; then
- myprefix=$ac_default_prefix
-fi
-CFLAGS="-I$myprefix/include"
-LIBS="-L$myprefix/lib -lasound"
-#echo "CFLAGS=$CFLAGS"
-#echo "LIBS=$LIBS"
-AC_MSG_CHECKING(for alsa-lib package)
-AC_TRY_RUN([
-#include <sys/asoundlib.h>
-void main(void)
-{
- snd_cards();
- exit(0);
-}
-],
- AC_MSG_RESULT("present"),
- AC_MSG_RESULT("not found"); echo "Fatal error: Install alsa-lib package at first..."; exit 1;,
- AC_MSG_RESULT("not supported"); echo "Fatal error: Cross-compiling isn't supported..."; exit 1;
-)
-
-dnl Check for version...
-AC_MSG_CHECKING(for alsa-utils version)
-SND_UTIL_VERSION=`cat $srcdir/version`
-AC_DEFINE_UNQUOTED(SND_UTIL_VERSION, "$SND_UTIL_VERSION")
-AC_SUBST(SND_UTIL_VERSION)
-SND_UTIL_MAJOR=`echo $SND_UTIL_VERSION | cut -d . -f 1`
-AC_SUBST(SND_UTIL_MAJOR)
-SND_UTIL_MINOR=`echo $SND_UTIL_VERSION | cut -d . -f 2`
-AC_SUBST(SND_UTIL_MINOR)
-SND_UTIL_SUBMINOR=`echo $SND_UTIL_VERSION | cut -d . -f 3`
-AC_SUBST(SND_UTIL_SUBMINOR)
-AC_MSG_RESULT($SND_UTIL_VERSION)
-
-AC_OUTPUT(Makefile.conf utils/alsa-utils.spec)
+AC_OUTPUT(Makefile alsactl/Makefile alsamixer/Makefile amixer/Makefile aplay/Makefile \
+ include/Makefile utils/Makefile utils/alsa-utils.spec)
--- /dev/null
+#!/bin/bash
+
+aclocal
+automake --foreign
+autoconf
+export CFLAGS='-O2 -fomit-frame-pointer -Wall -pipe -g'
+./configure
+unset CFLAGS
+make
+++ /dev/null
-#
-# Makefile for ALSA utils package
-# Copyright (c) 1994-98 by Jaroslav Kysela <perex@jcu.cz>
-#
-
-include ../Makefile.conf
-
-clean:
- rm -f core .depend *.o *.orig *~
-
--- /dev/null
+noinst_HEADERS=version.h
+
+version.h: stamp-vh
+ @:
+
+stamp-vh: $(top_builddir)/configure.in
+ @echo "/*" > ver.tmp
+ @echo " * version.h" >> ver.tmp
+ @echo " */" >> ver.tmp
+ @echo "" >> ver.tmp
+ @echo "#define SND_UTIL_MAJOR $(SND_UTIL_MAJOR)" >> ver.tmp
+ @echo "#define SND_UTIL_MINOR $(SND_UTIL_MINOR)" >> ver.tmp
+ @echo "#define SND_UTIL_SUBMINOR $(SND_UTIL_SUBMINOR)" >> ver.tmp
+ @echo "#define SND_UTIL_VERSION ((SND_UTIL_MAJOR<<16)|\\" >> ver.tmp
+ @echo " (SND_UTIL_MINOR<<8)|\\" >> ver.tmp
+ @echo " SND_UTIL_SUBMINOR)" >> ver.tmp
+ @echo "#define SND_UTIL_VERSION_STR \"$(SND_UTIL_VERSION)\"" >> ver.tmp
+ @echo >> ver.tmp
+ @cmp -s version.h ver.tmp \
+ || (echo "Updating version.h"; \
+ cp ver.tmp version.h; \
+ echo timestamp > stamp-vh)
+ -@rm -f ver.tmp
+
+INCLUDES=-I$(top_srcdir)/include
-/*
- * Configuration header file for compilation of the ALSA utilities
- */
+/* include/aconfig.h.in. Generated automatically from configure.in by autoheader. */
-#undef SND_UTIL_VERSION
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define as __inline if that's what the C compiler calls it. */
+#undef inline
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if lex declares yytext as a char * by default, not a char[]. */
+#undef YYTEXT_POINTER
+
+/* Package name */
+#undef PACKAGE
+
+/* Package version */
+#undef VERSION
+
+/* Define if you have the asound library (-lasound). */
+#undef HAVE_LIBASOUND
+++ /dev/null
-#
-# Makefile for ALSA utils package
-# Copyright (c) 1994-98 by Jaroslav Kysela <perex@jcu.cz>
-#
-
-include ../Makefile.conf
-
-clean:
- rm -f core .depend *.o *.orig *~
-
--- /dev/null
+EXTRA_DIST = buildrpm
+
+rpm: buildrpm alsa-lib.spec
+ VERSION=$(VERSION) $(srcdir)/buildrpm
version=`cat $source/../version`
package=$source/../../alsa-utils-$version.tar.gz
-make -C .. pack
+make -C .. dist
if [ ! -r $package ]; then
echo "Error: wrong package: $package"