From a8d15e1b9979dabb07261204470d91777575712f Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 20 Aug 2001 13:18:40 +0000 Subject: [PATCH] Updated to use GNU autoconf/automake. --- seq/sbiload/Makefile | 27 --------------------------- seq/sbiload/Makefile.am | 11 +++++++++++ seq/sbiload/configure.in | 10 ++++++++++ seq/sbiload/cvscompile | 24 ++++++++++++++++++++++++ seq/sbiload/make.conf | 12 ------------ seq/sbiload/sbiload.c | 18 +++++++++++++++--- 6 files changed, 60 insertions(+), 42 deletions(-) delete mode 100644 seq/sbiload/Makefile create mode 100644 seq/sbiload/Makefile.am create mode 100644 seq/sbiload/configure.in create mode 100644 seq/sbiload/cvscompile delete mode 100644 seq/sbiload/make.conf diff --git a/seq/sbiload/Makefile b/seq/sbiload/Makefile deleted file mode 100644 index 2121d1a..0000000 --- a/seq/sbiload/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -TOP = . -include $(TOP)/make.conf - -CFLAGS = $(COPTS) $(INCLUDES) -LIBS = $(ASOUND) - -OBJS = sbiload.o - - -# Build all the targets. -# -all: $(OBJS) - $(CC) -o sbiload $(CFLAGS) $(OBJS) $(LIBS) - -install: all - $(INSTALL) sbiload $(INSTDIR) - -# Remove all object files and exectutables -# -clean: - rm -f sbiload $(OBJS) core a.out - -# Remove all generated and built files. -# -clobber: clean - -sbiload.o : sbiload.c diff --git a/seq/sbiload/Makefile.am b/seq/sbiload/Makefile.am new file mode 100644 index 0000000..9ea6d65 --- /dev/null +++ b/seq/sbiload/Makefile.am @@ -0,0 +1,11 @@ +# # Process this file with automake to produce Makefile.in. +AUTOMAKE_OPTIONS = 1.3 foreign + +CFLAGS = -Wall -g + +bin_PROGRAMS = sbiload +#man_MANS = sbiload.1 + +sbiload_SOURCES = sbiload.c + +EXTRA_DIST = README COPYING diff --git a/seq/sbiload/configure.in b/seq/sbiload/configure.in new file mode 100644 index 0000000..f0dc206 --- /dev/null +++ b/seq/sbiload/configure.in @@ -0,0 +1,10 @@ +AC_INIT(sbiload.c) +AM_INIT_AUTOMAKE(sbiload, 0.3.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) diff --git a/seq/sbiload/cvscompile b/seq/sbiload/cvscompile new file mode 100644 index 0000000..01e8151 --- /dev/null +++ b/seq/sbiload/cvscompile @@ -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/seq/sbiload/make.conf b/seq/sbiload/make.conf deleted file mode 100644 index 2ac8af7..0000000 --- a/seq/sbiload/make.conf +++ /dev/null @@ -1,12 +0,0 @@ -# Options required by the C compiler -COPTS = -O2 -g - -# Path to include files -INCLUDES = -I . - -# Options to link with alsa sound library -ASOUND = -lasound - -# Installation options -INSTALL = install -s -INSTDIR = /usr/local/bin diff --git a/seq/sbiload/sbiload.c b/seq/sbiload/sbiload.c index 8327dc3..0886cf2 100644 --- a/seq/sbiload/sbiload.c +++ b/seq/sbiload/sbiload.c @@ -81,6 +81,7 @@ static struct option long_opts[] = { {"opl3", 0, NULL, '4'}, {"list", 0, NULL, 'l'}, {"verbose", HAS_ARG, NULL, 'v'}, + {"version", 0, NULL, 'V'}, {0, 0, 0, 0}, }; @@ -130,7 +131,7 @@ error_handler (const char *file, int line, const char *function, int err, const static void show_list () { snd_seq_client_info_t *cinfo; - int client, port, err; + int client, err; snd_lib_error_set_handler (error_handler); if ((err = snd_seq_open (&seq_handle, "hw", SND_SEQ_OPEN_DUPLEX, 0)) < 0) { @@ -175,6 +176,7 @@ show_usage () { " -4 - four operators file type (default = two ops)", " -l - List possible output ports that could be used", " -v level - Verbose level (default = 0)", + " -V - Show version", }; for (cpp = msg; cpp < msg + NELEM (msg); cpp++) { @@ -182,6 +184,14 @@ show_usage () { } } +/* + * Show version + */ +static void +show_version () { + printf("Version: " VERSION "\n"); +} + /* * Show instrument FM operators */ @@ -448,8 +458,7 @@ parse_portdesc (char *portdesc) { char *astr; char *cp; int a[ADDR_PARTS]; - int count, naddr; - int i; + int count; if (portdesc == NULL) return -1; @@ -578,6 +587,9 @@ main (int argc, char **argv) { case 'v': verbose = atoi (optarg); break; + case 'V': + show_version(); + exit (1); case 'l': show_list (); exit (0); -- 2.47.3