From b69226f3519582c9968bcf9db7d02e44257e662b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 14 Jan 2004 18:37:24 +0000 Subject: Moved to autoconf git-svn-id: file:///home/lennart/svn/public/bidilink/trunk@5 9cde1c1d-e4d0-0310-8a68-bf217395ea82 --- Makefile.am | 40 ++++++ bootstrap.sh | 45 ++++++ configure.ac | 102 ++++++++++++++ src/Makefile | 429 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/Makefile.am | 24 ++++ src/bidilink.c | 23 ++- 6 files changed, 653 insertions(+), 10 deletions(-) create mode 100644 Makefile.am create mode 100755 bootstrap.sh create mode 100644 configure.ac create mode 100644 src/Makefile.am diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..87d73dc --- /dev/null +++ b/Makefile.am @@ -0,0 +1,40 @@ +# $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. + +EXTRA_DIST=bootstrap.sh README LICENSE +SUBDIRS=src # doc man + +MAINTAINERCLEANFILES = README +noinst_DATA = README + +README: + rm -f README +#$(MAKE) -C doc README + cd $(srcdir) && ln -s doc/README README + +homepage: + test -d $$HOME/homepage/lennart + mkdir -p $$HOME/homepage/lennart/projects/bidilink + cp *.tar.gz $$HOME/homepage/lennart/projects/bidilink + cp man/bidilink.8.xml man/xmltoman.css man/xmltoman.xsl man/xmltoman.dtd doc/style.css doc/README.html $$HOME/homepage/lennart/projects/aeswepd + cp $$HOME/homepage/lennart/projects/bidilink/README.html $$HOME/homepage/lennart/projects/aeswepd/index.html + +distcleancheck: + @: + +.PHONY: homepage distcleancheck diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..8163d6a --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# $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. + +run_versioned() { + local P + type -p "$1-$2" &> /dev/null && P="$1-$2" || local P="$1" + + shift 2 + "$P" "$@" +} + +if [ "x$1" = "xam" ] ; then + set -ex + run_versioned automake 1.7 -a -c + ./config.status +else + set -ex + rm -rf autom4te.cache + rm -f config.cache + + run_versioned aclocal 1.7 + autoheader + run_versioned automake 1.7 -a -c + autoconf -Wall + + ./configure --sysconfdir=/etc "$@" + + make clean +fi diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..b676d4f --- /dev/null +++ b/configure.ac @@ -0,0 +1,102 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +# $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. + +AC_PREREQ(2.59) +AC_INIT([bidilink], [0.1], [mzovqvyvax (at) 0pointer (dot) de]) +AC_CONFIG_SRCDIR([src/bidilink.c]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE([foreign -Wall]) + +AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/bidilink/]) + +if type -p stow > /dev/null && test -d /usr/local/stow ; then + AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***]) + ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}" +fi + +# Checks for programs. +AC_PROG_CC +AC_PROG_LN_S +AC_PROG_MAKE_SET + +# If using GCC specifiy some additional parameters +if test "x$GCC" = "xyes" ; then + CFLAGS="$CFLAGS -pipe -Wall" +fi + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_C_VOLATILE + +# Checks for library functions. +AC_FUNC_FORK +AC_FUNC_MALLOC +AC_FUNC_SELECT_ARGTYPES +AC_TYPE_SIGNAL +AC_CHECK_FUNCS([dup2 gethostbyname memset select socket strcspn strdup strerror]) + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h termios.h unistd.h]) + +# LYNX documentation generation +AC_ARG_ENABLE(lynx, + AS_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation), +[case "${enableval}" in + yes) lynx=yes ;; + no) lynx=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;; +esac],[lynx=yes]) + +if test x$lynx = xyes ; then + AC_CHECK_PROG(have_lynx, lynx, yes, no) + + if test x$have_lynx = xno ; then + AC_MSG_ERROR([*** Sorry, you have to install lynx or use --disable-lynx ***]) + fi +fi + +AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes]) + +# XMLTOMAN manpage generation +AC_ARG_ENABLE(xmltoman, + AS_HELP_STRING(--disable-xmltoman,Disable rebuilding of man pages with xmltoman), +[case "${enableval}" in + yes) xmltoman=yes ;; + no) xmltoman=no ;; + *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;; +esac],[xmltoman=yes]) + +if test x$xmltoman = xyes ; then + AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no) + + if test x$have_xmltoman = xno ; then + AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***]) + xmltoman=no + fi +fi + +AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes]) + +AC_CONFIG_FILES([src/Makefile Makefile]) # doc/Makefile man/Makefile doc/README.html]) +AC_OUTPUT 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; -- cgit