mirror of
https://github.com/alsa-project/alsa-tools.git
synced 2025-10-31 22:25:34 -04:00
Use autoconf/automake GNU tools.
This commit is contained in:
parent
d8ccbda67e
commit
1a7c2fedf5
6 changed files with 60 additions and 42 deletions
|
|
@ -1,27 +0,0 @@
|
||||||
TOP = .
|
|
||||||
include $(TOP)/make.conf
|
|
||||||
|
|
||||||
CFLAGS = $(COPTS) $(INCLUDES)
|
|
||||||
LIBS = $(ASOUND)
|
|
||||||
|
|
||||||
OBJS = cspctl.o
|
|
||||||
|
|
||||||
|
|
||||||
# Build all the targets.
|
|
||||||
#
|
|
||||||
all: $(OBJS)
|
|
||||||
$(CC) -o cspctl $(CFLAGS) $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
install: all
|
|
||||||
$(INSTALL) cspctl $(INSTDIR)
|
|
||||||
|
|
||||||
# Remove all object files and exectutables
|
|
||||||
#
|
|
||||||
clean:
|
|
||||||
rm -f cspctl $(OBJS) core a.out
|
|
||||||
|
|
||||||
# Remove all generated and built files.
|
|
||||||
#
|
|
||||||
clobber: clean
|
|
||||||
|
|
||||||
cspctl.o : cspctl.c
|
|
||||||
11
sb16_csp/Makefile.am
Normal file
11
sb16_csp/Makefile.am
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# # Process this file with automake to produce Makefile.in.
|
||||||
|
AUTOMAKE_OPTIONS = 1.3 foreign
|
||||||
|
|
||||||
|
CFLAGS = -Wall -g
|
||||||
|
|
||||||
|
bin_PROGRAMS = cspctl
|
||||||
|
man_MANS = cspctl.1
|
||||||
|
|
||||||
|
cspctl_SOURCES = cspctl.c
|
||||||
|
|
||||||
|
EXTRA_DIST = README COPYING
|
||||||
10
sb16_csp/configure.in
Normal file
10
sb16_csp/configure.in
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
AC_INIT(cspctl.c)
|
||||||
|
AM_INIT_AUTOMAKE(cspctl, 0.2.0)
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
AC_HEADER_STDC
|
||||||
|
AM_PATH_ALSA(0.9.0)
|
||||||
|
CFLAGS="$CFLAGS $ALSA_FLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $ALSA_LIBS"
|
||||||
|
|
||||||
|
AC_OUTPUT(Makefile)
|
||||||
|
|
@ -65,6 +65,11 @@ static void help(char *command)
|
||||||
, command);
|
, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void version(void)
|
||||||
|
{
|
||||||
|
printf("Version: " VERSION "\n");
|
||||||
|
}
|
||||||
|
|
||||||
static int csp_command (int idx, int dev, int command, char *filename)
|
static int csp_command (int idx, int dev, int command, char *filename)
|
||||||
{
|
{
|
||||||
int fd, err;
|
int fd, err;
|
||||||
|
|
@ -130,14 +135,21 @@ int main(int argc, char *argv[])
|
||||||
help(argv[0]);
|
help(argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (argc > 1 && !strcmp(argv[1], "--version")) {
|
||||||
|
version();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
strcpy (microcode.info.codec_name, "UNKNOWN");
|
strcpy (microcode.info.codec_name, "UNKNOWN");
|
||||||
microcode.info.func_req = 1;
|
microcode.info.func_req = 1;
|
||||||
while ((c = getopt(argc, argv, "hc:f:d:")) != EOF) {
|
while ((c = getopt(argc, argv, "hvc:f:d:")) != EOF) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
help(argv[0]);
|
help(argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
|
case 'v':
|
||||||
|
version();
|
||||||
|
return 0;
|
||||||
case 'c':
|
case 'c':
|
||||||
{
|
{
|
||||||
card = snd_card_get_index(optarg);
|
card = snd_card_get_index(optarg);
|
||||||
|
|
@ -186,13 +198,13 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Get control handle for selected card
|
// Get control handle for selected card
|
||||||
sprintf(card_id, "hw:%i", card);
|
sprintf(card_id, "hw:%i", card);
|
||||||
if (err = snd_ctl_open(&ctl_handle, card_id, 0) < 0) {
|
if ((err = snd_ctl_open(&ctl_handle, card_id, 0)) < 0) {
|
||||||
error("control open (%s): %s", card_id, snd_strerror(err));
|
error("control open (%s): %s", card_id, snd_strerror(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read control hardware info from card
|
// Read control hardware info from card
|
||||||
if (err = snd_ctl_card_info(ctl_handle, card_info) < 0) {
|
if ((err = snd_ctl_card_info(ctl_handle, card_info)) < 0) {
|
||||||
error("control hardware info (%s): %s", card_id, snd_strerror(err));
|
error("control hardware info (%s): %s", card_id, snd_strerror(err));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
24
sb16_csp/cvscompile
Normal file
24
sb16_csp/cvscompile
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if test "x$AUTOMAKE_DIR" = "x"; then
|
||||||
|
if test -d /usr/local/share/automake; then
|
||||||
|
AUTOMAKE_DIR=/usr/local/share/automake
|
||||||
|
fi
|
||||||
|
if test -d /usr/share/automake; then
|
||||||
|
AUTOMAKE_DIR="/usr/share/automake"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
for f in install-sh mkinstalldirs missing; do
|
||||||
|
cp -av $AUTOMAKE_DIR/$f .
|
||||||
|
done
|
||||||
|
|
||||||
|
aclocal $ACLOCAL_FLAGS
|
||||||
|
automake --foreign --add-missing
|
||||||
|
autoconf
|
||||||
|
export CFLAGS='-O2 -Wall -pipe -g'
|
||||||
|
echo "CFLAGS=$CFLAGS"
|
||||||
|
echo "./configure $@"
|
||||||
|
./configure $@
|
||||||
|
unset CFLAGS
|
||||||
|
make
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
# Options required by the C compiler
|
|
||||||
COPTS = -O
|
|
||||||
|
|
||||||
# Path to include files
|
|
||||||
INCLUDES = -I .
|
|
||||||
|
|
||||||
# Options to link with alsa sound library
|
|
||||||
ASOUND = -lasound
|
|
||||||
|
|
||||||
# Installation options
|
|
||||||
INSTALL = install -s
|
|
||||||
INSTDIR = /usr/local/bin
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue