summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-01-14 18:37:24 +0000
committerLennart Poettering <lennart@poettering.net>2004-01-14 18:37:24 +0000
commitb69226f3519582c9968bcf9db7d02e44257e662b (patch)
tree0be4f4f65d2580e9f6f7e05fd9b7c4c9193d2f4a /src
parentcbd59a704e3adc48c809f14e2cf793d641dfe7ff (diff)
Moved to autoconf
git-svn-id: file:///home/lennart/svn/public/bidilink/trunk@5 9cde1c1d-e4d0-0310-8a68-bf217395ea82
Diffstat (limited to 'src')
-rw-r--r--src/Makefile429
-rw-r--r--src/Makefile.am24
-rw-r--r--src/bidilink.c23
3 files changed, 466 insertions, 10 deletions
diff --git a/src/Makefile b/src/Makefile
index d4ec88d..cdda62a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,11 +1,426 @@
-CFLAGS=-g -Wall -pipe
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# src/Makefile. Generated from Makefile.in by configure.
-all: bidilink
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-bidilink: bidilink.o std.o exec.o stream.o client-tty.o server-tty.o client-tcp.o server-tcp.o client-unix.o server-unix.o
- $(CC) $^ -o $@
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
-clean:
- rm -f *.o bidilink
-.PHONY: all clean
+
+# $Id$
+
+# This file is part of bidilink.
+#
+# bidilink is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# bidilink is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with bidilink; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+srcdir = .
+top_srcdir = ..
+
+pkgdatadir = $(datadir)/bidilink
+pkglibdir = $(libdir)/bidilink
+pkgincludedir = $(includedir)/bidilink
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = /usr/bin/install -c
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+ACLOCAL = ${SHELL} /home/lennart/projects/bidilink/missing --run aclocal-1.7
+AMDEP_FALSE = #
+AMDEP_TRUE =
+AMTAR = ${SHELL} /home/lennart/projects/bidilink/missing --run tar
+AUTOCONF = ${SHELL} /home/lennart/projects/bidilink/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/lennart/projects/bidilink/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/lennart/projects/bidilink/missing --run automake-1.7
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2 -pipe -Wall
+CPP = gcc -E
+CPPFLAGS =
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = grep -E
+EXEEXT =
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
+LDFLAGS =
+LIBOBJS =
+LIBS =
+LN_S = ln -s
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /home/lennart/projects/bidilink/missing --run makeinfo
+OBJEXT = o
+PACKAGE = bidilink
+PACKAGE_BUGREPORT = mzovqvyvax (at) 0pointer (dot) de
+PACKAGE_NAME = bidilink
+PACKAGE_STRING = bidilink 0.1
+PACKAGE_TARNAME = bidilink
+PACKAGE_URL = http://0pointer.de/lennart/projects/bidilink/
+PACKAGE_VERSION = 0.1
+PATH_SEPARATOR = :
+SET_MAKE =
+SHELL = /bin/sh
+STRIP =
+USE_LYNX_FALSE = #
+USE_LYNX_TRUE =
+USE_XMLTOMAN_FALSE = #
+USE_XMLTOMAN_TRUE =
+VERSION = 0.1
+ac_ct_CC = gcc
+ac_ct_STRIP =
+am__fastdepCC_FALSE = #
+am__fastdepCC_TRUE =
+am__include = include
+am__leading_dot = .
+am__quote =
+bindir = ${exec_prefix}/bin
+build_alias =
+datadir = ${prefix}/share
+exec_prefix = ${prefix}
+have_lynx = yes
+have_xmltoman = yes
+host_alias =
+includedir = ${prefix}/include
+infodir = ${prefix}/info
+install_sh = /home/lennart/projects/bidilink/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localstatedir = ${prefix}/var
+mandir = ${prefix}/man
+oldincludedir = /usr/include
+prefix = /usr/local/stow/bidilink-0.1
+program_transform_name = s,x,x,
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+sysconfdir = /etc
+target_alias =
+
+bin_PROGRAMS = bidilink
+
+bidilink_SOURCES = bidilink.c client-tty.h exec.h server-tty.h std.h \
+ client-tcp.c client-unix.c server-tcp.c server-unix.c stream.c \
+ client-tcp.h client-unix.h server-tcp.h server-unix.h stream.h \
+ client-tty.c exec.c server-tty.c std.c
+
+subdir = src
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+bin_PROGRAMS = bidilink$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS)
+
+am_bidilink_OBJECTS = bidilink.$(OBJEXT) client-tcp.$(OBJEXT) \
+ client-unix.$(OBJEXT) server-tcp.$(OBJEXT) \
+ server-unix.$(OBJEXT) stream.$(OBJEXT) client-tty.$(OBJEXT) \
+ exec.$(OBJEXT) server-tty.$(OBJEXT) std.$(OBJEXT)
+bidilink_OBJECTS = $(am_bidilink_OBJECTS)
+bidilink_LDADD = $(LDADD)
+bidilink_DEPENDENCIES =
+bidilink_LDFLAGS =
+
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+DEP_FILES = ./$(DEPDIR)/bidilink.Po \
+ ./$(DEPDIR)/client-tcp.Po ./$(DEPDIR)/client-tty.Po \
+ ./$(DEPDIR)/client-unix.Po ./$(DEPDIR)/exec.Po \
+ ./$(DEPDIR)/server-tcp.Po ./$(DEPDIR)/server-tty.Po \
+ ./$(DEPDIR)/server-unix.Po ./$(DEPDIR)/std.Po \
+ ./$(DEPDIR)/stream.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(bidilink_SOURCES)
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
+SOURCES = $(bidilink_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
+ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+ rm -f $(DESTDIR)$(bindir)/$$f; \
+ done
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+bidilink$(EXEEXT): $(bidilink_OBJECTS) $(bidilink_DEPENDENCIES)
+ @rm -f bidilink$(EXEEXT)
+ $(LINK) $(bidilink_LDFLAGS) $(bidilink_OBJECTS) $(bidilink_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+ -rm -f *.tab.c
+
+include ./$(DEPDIR)/bidilink.Po
+include ./$(DEPDIR)/client-tcp.Po
+include ./$(DEPDIR)/client-tty.Po
+include ./$(DEPDIR)/client-unix.Po
+include ./$(DEPDIR)/exec.Po
+include ./$(DEPDIR)/server-tcp.Po
+include ./$(DEPDIR)/server-tty.Po
+include ./$(DEPDIR)/server-unix.Po
+include ./$(DEPDIR)/std.Po
+include ./$(DEPDIR)/stream.Po
+
+.c.o:
+ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ fi
+# source='$<' object='$@' libtool=no \
+# depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
+# $(CCDEPMODE) $(depcomp) \
+# $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
+ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ fi
+# source='$<' object='$@' libtool=no \
+# depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
+# $(CCDEPMODE) $(depcomp) \
+# $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+uninstall-info-am:
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic ctags distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am info \
+ info-am install install-am install-binPROGRAMS install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..cc667a2
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,24 @@
+# $Id$
+
+# This file is part of bidilink.
+#
+# bidilink is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# bidilink is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with bidilink; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+bin_PROGRAMS = bidilink
+
+bidilink_SOURCES = bidilink.c client-tty.h exec.h server-tty.h std.h \
+ client-tcp.c client-unix.c server-tcp.c server-unix.c stream.c \
+ client-tcp.h client-unix.h server-tcp.h server-unix.h stream.h \
+ client-tty.c exec.c server-tty.c std.c
diff --git a/src/bidilink.c b/src/bidilink.c
index 8493f41..15e0e4c 100644
--- a/src/bidilink.c
+++ b/src/bidilink.c
@@ -45,7 +45,18 @@ static void signal_handler(int s) {
}
static void usage(FILE *f, const char *argv0) {
- fprintf(f, "%s [STREAM1] [STREAM2]\n", argv0);
+ fprintf(f,
+ "%s [-h|--help] [-v|--verbose] STREAM1 [STREAM2]\n\n"
+ "Supported stream types:\n"
+ "\tstd:\n"
+ "\texec:PROGRAM\n"
+ "\ttty:TTYDEVICE\n"
+ "\tpty:PTYNAME\n"
+ "\ttcp-client:HOSTNAME:PORT\n"
+ "\ttcp-server:[IPADDRESS:]PORT\n"
+ "\tunix-client:SOCKNAME\n"
+ "\tunix-server:SOCKNAME\n",
+ argv0);
}
static int read_fd(struct stream *s, void *buf, size_t *buf_fill, size_t *buf_index) {
@@ -132,11 +143,17 @@ int main(int argc, char *argv[]) {
ai = 1;
- if (!strcmp(argv[ai], "-v")) {
+ if (!strcmp(argv[ai], "-h") || !strcmp(argv[ai], "--help")) {
+ usage(stdout, argv[0]);
+ ret = 0;
+ goto finish;
+ }
+
+ if (!strcmp(argv[ai], "-v") || !strcmp(argv[ai], "--verbose")) {
verbose = 1;
ai++;
}
-
+
if (!(a = stream_open(argv[ai++])))
goto finish;