+++ /dev/null
-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
, command);
}
+static void version(void)
+{
+ printf("Version: " VERSION "\n");
+}
+
static int csp_command (int idx, int dev, int command, char *filename)
{
int fd, err;
help(argv[0]);
return 0;
}
+ if (argc > 1 && !strcmp(argv[1], "--version")) {
+ version();
+ return 0;
+ }
strcpy (microcode.info.codec_name, "UNKNOWN");
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) {
case 'h':
help(argv[0]);
return 0;
+ case 'v':
+ version();
+ return 0;
case 'c':
{
card = snd_card_get_index(optarg);
// Get control handle for selected 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));
return 1;
}
// 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));
exit(1);
}
--- /dev/null
+#!/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