]> git.alsa-project.org Git - alsa-tools.git/commitdiff
Use autoconf/automake GNU tools.
authorJaroslav Kysela <perex@perex.cz>
Mon, 20 Aug 2001 11:27:44 +0000 (11:27 +0000)
committerJaroslav Kysela <perex@perex.cz>
Mon, 20 Aug 2001 11:27:44 +0000 (11:27 +0000)
sb16_csp/Makefile [deleted file]
sb16_csp/Makefile.am [new file with mode: 0644]
sb16_csp/configure.in [new file with mode: 0644]
sb16_csp/cspctl.c
sb16_csp/cvscompile [new file with mode: 0644]
sb16_csp/make.conf [deleted file]

diff --git a/sb16_csp/Makefile b/sb16_csp/Makefile
deleted file mode 100644 (file)
index 82768df..0000000
+++ /dev/null
@@ -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
diff --git a/sb16_csp/Makefile.am b/sb16_csp/Makefile.am
new file mode 100644 (file)
index 0000000..5b00c27
--- /dev/null
@@ -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
diff --git a/sb16_csp/configure.in b/sb16_csp/configure.in
new file mode 100644 (file)
index 0000000..d3bf7f2
--- /dev/null
@@ -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)
index be9e2b41a83722fbbf672f76223462f9291ed051..95d4596388782fed6e577437439b6772004be1c9 100644 (file)
@@ -65,6 +65,11 @@ static void help(char *command)
                , command);
 }
 
+static void version(void)
+{
+       printf("Version: " VERSION "\n");
+}
+
 static int csp_command (int idx, int dev, int command, char *filename)
 {
        int fd, err;
@@ -130,14 +135,21 @@ int main(int argc, char *argv[])
                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);
@@ -186,13 +198,13 @@ int main(int argc, char *argv[])
 
        // 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);
        }
diff --git a/sb16_csp/cvscompile b/sb16_csp/cvscompile
new file mode 100644 (file)
index 0000000..01e8151
--- /dev/null
@@ -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
diff --git a/sb16_csp/make.conf b/sb16_csp/make.conf
deleted file mode 100644 (file)
index 74256c6..0000000
+++ /dev/null
@@ -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