ebnetd-1.0.dfsg.1/0000755000175000017500000000000007773515160013225 5ustar mhattamhattaebnetd-1.0.dfsg.1/ebnetd/0000755000175000017500000000000007773515157014474 5ustar mhattamhattaebnetd-1.0.dfsg.1/ebnetd/fdcache.h0000644000175000017500000000403007731211710016175 0ustar mhattamhatta/* * Copyright) 2003 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef FDCACHE_H #define FDCACHE_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* * File cache entry. */ typedef struct FDCache_Entry_Struct FDCache_Entry; struct FDCache_Entry_Struct { /* * File Descriptor */ int fd; /* * File name. */ char *path; /* * Hash value of `path'. */ unsigned int path_hash; /* * Next and previous entry. */ FDCache_Entry *next; FDCache_Entry *back; }; /* * File cache table. */ typedef struct FDCache_Table_Struct FDCache_Table; struct FDCache_Table_Struct { /* * First entry. */ FDCache_Entry *head; /* * Last entry. */ FDCache_Entry *tail; /* * The number of entries in the cache table. */ int entry_count; /* * The maximum number of entries in the cache table. */ int max_entry_count; /* * flags and mode for open(). */ int open_flags; mode_t open_mode; }; #ifdef __STDC__ void fdcache_initialize_table(FDCache_Table *, int, ...); void fdcache_finalize_table(FDCache_Table *); void fdcache_set_max_entry_count(FDCache_Table *, int); int fdcache_max_entry_count(FDCache_Table *); int fdcache_entry_count(FDCache_Table *); int fdcache_open(FDCache_Table *, const char *); #else void fdcache_initialize_table(); void fdcache_finalize_table(); void fdcache_set_max_entry_count(); int fdcache_max_entry_count(); int fdcache_entry_count(); int fdcache_open(); #endif #endif /* FDCACHE_H */ ebnetd-1.0.dfsg.1/ebnetd/Makefile.am0000644000175000017500000000624107737407040016522 0ustar mhattamhattapkglocalstatedir = $(localstatedir)/$(PACKAGE) logdir = @logdir@ LIBEBNETD = $(top_builddir)/lib/libebnetd.a LIBEBTINY = $(top_builddir)/ebtiny/libebtiny.a sbin_PROGRAMS = ebnetd ebncheck ebncontrol sbin_SCRIPTS = ebndaily ebnupgrade libexec_SCRIPTS = ebnstat ebnetd_SOURCES = book.c config.c global.c misc.c ebnetd.c \ ebnet.c fdcache.c ebnetd_LDADD = $(LIBEBNETD) $(LIBEBTINY) ebnetd_DEPENDENCIES = $(LIBEBNETD) $(LIBEBTINY) ebncheck_SOURCES = book.c config.c global.c misc.c ebncheck.c ebncheck_LDADD = $(LIBEBNETD) $(LIBEBTINY) ebncheck_DEPENDENCIES = $(LIBEBNETD) $(LIBEBTINY) ebncontrol_SOURCES = book.c config.c global.c misc.c ebncontrol.c ebncontrol_LDADD = $(LIBEBNETD) $(LIBEBTINY) ebncontrol_DEPENDENCIES = $(LIBEBNETD) $(LIBEBTINY) INCLUDES = -DUSE_FAKELOG -DEBNETD -I$(top_srcdir) -I$(top_srcdir)/lib \ $(EBCONF_EBINCS) EXTRA_DIST = ebndaily.in ebnstat.in ebnupgrade.in defs.h.in getopt_long.pl CLEANFILES = defs.h stamp-defs-h defs.h.tmp ebnstat ebnstat.tmp \ ebndaily ebndaily.tmp ebnupgrade ebnupgrade.tmp BUILT_SOURCES = defs.h noinst_HEADERS = fdcache.h defs.h: stamp-defs-h stamp-defs-h: defs.h.in Makefile rm -f defs.h.tmp echo '/* automatically generated from defs.h.in. */' \ > defs.h.tmp sed -e 's;\@sysconfdir\@;$(sysconfdir);' \ -e 's;\@pkglocalstatedir\@;$(pkglocalstatedir);' \ $(srcdir)/defs.h.in >> defs.h.tmp $(top_srcdir)/move-if-change defs.h.tmp defs.h @echo timestamp > stamp-defs-h ebnstat: getopt_long.pl ebnstat.in Makefile rm -f ebnstat sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/ebnstat.in | sed '/^$$/q' > ebnstat.tmp cat $(srcdir)/getopt_long.pl >> ebnstat.tmp sed -e 's;\@VERSION\@;$(VERSION);' \ -e 's;\@MAILING_ADDRESS\@;$(MAILING_ADDRESS);' \ $(srcdir)/ebnstat.in | sed '1,/^$$/d' >> ebnstat.tmp cp ebnstat.tmp ebnstat chmod +x ebnstat rm -f ebnstat.tmp ebndaily: getopt_long.pl ebndaily.in Makefile rm -f ebndaily sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/ebndaily.in | sed '/^$$/q' > ebndaily.tmp cat $(srcdir)/getopt_long.pl >> ebndaily.tmp EBNSTAT="`echo ebnstat | sed '$(transform)'`"; \ NDTPSTAT="`echo ndtpstat | sed '$(transform)'`"; \ EBHTSTAT="`echo ebhtstat | sed '$(transform)'`"; \ sed -e 's;\@logdir\@;$(logdir);' \ -e 's;\@libexecdir\@;$(libexecdir);' \ -e 's;\@VERSION\@;$(VERSION);' \ -e 's;\@MAILX\@;$(MAILX);' \ -e 's;\@COMPRESS\@;$(COMPRESS);' \ -e 's;\@GZIPCMD\@;$(GZIPCMD);' \ -e 's;\@BZIP2\@;$(BZIP2);' \ -e 's;\@MAILING_ADDRESS\@;$(MAILING_ADDRESS);' \ -e 's;\@EBNSTAT\@;'$$EBNSTAT';' \ -e 's;\@NDTPSTAT\@;'$$NDTPSTAT';' \ -e 's;\@EBHTSTAT\@;'$$EBHTSTAT';' \ $(srcdir)/ebndaily.in | sed '1,/^$$/d' >> ebndaily.tmp cp ebndaily.tmp ebndaily chmod +x ebndaily rm -f ebndaily.tmp ebnupgrade: getopt_long.pl ebnupgrade.in Makefile rm -f ebnupgrade sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/ebnupgrade.in | sed '/^$$/q' > ebnupgrade.tmp cat $(srcdir)/getopt_long.pl >> ebnupgrade.tmp sed -e 's;\@VERSION\@;$(VERSION);' \ -e 's;\@MAILING_ADDRESS\@;$(MAILING_ADDRESS);' \ -e 's;\@sysconfdir\@;$(sysconfdir);' \ $(srcdir)/ebnupgrade.in | sed '1,/^$$/d' >> ebnupgrade.tmp cp ebnupgrade.tmp ebnupgrade chmod +x ebnupgrade rm -f ebnupgrade.tmp ebnetd-1.0.dfsg.1/ebnetd/Makefile.in0000644000175000017500000005251107773515023016535 0ustar mhattamhatta# Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ # Copyright (C) 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. # 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. @SET_MAKE@ SOURCES = $(ebncheck_SOURCES) $(ebncontrol_SOURCES) $(ebnetd_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ sbin_PROGRAMS = ebnetd$(EXEEXT) ebncheck$(EXEEXT) ebncontrol$(EXEEXT) subdir = ebnetd DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/book.c $(srcdir)/config.c \ $(srcdir)/defs.h.in $(srcdir)/ebncheck.c \ $(srcdir)/ebncontrol.c $(srcdir)/ebnetd.c \ $(srcdir)/getopt_long.pl $(srcdir)/global.c $(srcdir)/misc.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/eb4.m4 \ $(top_srcdir)/m4/herrno.m4 $(top_srcdir)/m4/in6addr.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/sockaddrin6.m4 \ $(top_srcdir)/m4/sockinttypes.m4 $(top_srcdir)/m4/unionwait.m4 \ $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = $(DESTDIR)$(sbindir) $(DESTDIR)$(libexecdir) $(DESTDIR)$(sbindir) sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_ebncheck_OBJECTS = book.$(OBJEXT) config.$(OBJEXT) global.$(OBJEXT) \ misc.$(OBJEXT) ebncheck.$(OBJEXT) ebncheck_OBJECTS = $(am_ebncheck_OBJECTS) am__DEPENDENCIES_1 = $(top_builddir)/lib/libebnetd.a am__DEPENDENCIES_2 = $(top_builddir)/ebtiny/libebtiny.a am_ebncontrol_OBJECTS = book.$(OBJEXT) config.$(OBJEXT) \ global.$(OBJEXT) misc.$(OBJEXT) ebncontrol.$(OBJEXT) ebncontrol_OBJECTS = $(am_ebncontrol_OBJECTS) am_ebnetd_OBJECTS = book.$(OBJEXT) config.$(OBJEXT) global.$(OBJEXT) \ misc.$(OBJEXT) ebnetd.$(OBJEXT) ebnet.$(OBJEXT) \ fdcache.$(OBJEXT) ebnetd_OBJECTS = $(am_ebnetd_OBJECTS) libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(libexec_SCRIPTS) $(sbin_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/book.Po ./$(DEPDIR)/config.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/ebncheck.Po ./$(DEPDIR)/ebncontrol.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/ebnet.Po ./$(DEPDIR)/ebnetd.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/fdcache.Po ./$(DEPDIR)/global.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/misc.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(ebncheck_SOURCES) $(ebncontrol_SOURCES) $(ebnetd_SOURCES) DIST_SOURCES = $(ebncheck_SOURCES) $(ebncontrol_SOURCES) \ $(ebnetd_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS = @COMPRESS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ EBCONF_EBINCS = @EBCONF_EBINCS@ EBCONF_EBLIBS = @EBCONF_EBLIBS@ EBCONF_INTLINCS = @EBCONF_INTLINCS@ EBCONF_INTLLIBS = @EBCONF_INTLLIBS@ EBCONF_PTHREAD_CFLAGS = @EBCONF_PTHREAD_CFLAGS@ EBCONF_PTHREAD_CPPFLAGS = @EBCONF_PTHREAD_CPPFLAGS@ EBCONF_PTHREAD_LDFLAGS = @EBCONF_PTHREAD_LDFLAGS@ EBCONF_ZLIBINCS = @EBCONF_ZLIBINCS@ EBCONF_ZLIBLIBS = @EBCONF_ZLIBLIBS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GZIPCMD = @GZIPCMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAILING_ADDRESS = @MAILING_ADDRESS@ MAILX = @MAILX@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ pkglocalstatedir = $(localstatedir)/$(PACKAGE) LIBEBNETD = $(top_builddir)/lib/libebnetd.a LIBEBTINY = $(top_builddir)/ebtiny/libebtiny.a sbin_SCRIPTS = ebndaily ebnupgrade libexec_SCRIPTS = ebnstat ebnetd_SOURCES = book.c config.c global.c misc.c ebnetd.c \ ebnet.c fdcache.c ebnetd_LDADD = $(LIBEBNETD) $(LIBEBTINY) ebnetd_DEPENDENCIES = $(LIBEBNETD) $(LIBEBTINY) ebncheck_SOURCES = book.c config.c global.c misc.c ebncheck.c ebncheck_LDADD = $(LIBEBNETD) $(LIBEBTINY) ebncheck_DEPENDENCIES = $(LIBEBNETD) $(LIBEBTINY) ebncontrol_SOURCES = book.c config.c global.c misc.c ebncontrol.c ebncontrol_LDADD = $(LIBEBNETD) $(LIBEBTINY) ebncontrol_DEPENDENCIES = $(LIBEBNETD) $(LIBEBTINY) INCLUDES = -DUSE_FAKELOG -DEBNETD -I$(top_srcdir) -I$(top_srcdir)/lib \ $(EBCONF_EBINCS) EXTRA_DIST = ebndaily.in ebnstat.in ebnupgrade.in defs.h.in getopt_long.pl CLEANFILES = defs.h stamp-defs-h defs.h.tmp ebnstat ebnstat.tmp \ ebndaily ebndaily.tmp ebnupgrade ebnupgrade.tmp BUILT_SOURCES = defs.h noinst_HEADERS = fdcache.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ebnetd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu ebnetd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ rm -f $(DESTDIR)$(sbindir)/$$f; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done ebncheck$(EXEEXT): $(ebncheck_OBJECTS) $(ebncheck_DEPENDENCIES) @rm -f ebncheck$(EXEEXT) $(LINK) $(ebncheck_LDFLAGS) $(ebncheck_OBJECTS) $(ebncheck_LDADD) $(LIBS) ebncontrol$(EXEEXT): $(ebncontrol_OBJECTS) $(ebncontrol_DEPENDENCIES) @rm -f ebncontrol$(EXEEXT) $(LINK) $(ebncontrol_LDFLAGS) $(ebncontrol_OBJECTS) $(ebncontrol_LDADD) $(LIBS) ebnetd$(EXEEXT): $(ebnetd_OBJECTS) $(ebnetd_DEPENDENCIES) @rm -f ebnetd$(EXEEXT) $(LINK) $(ebnetd_LDFLAGS) $(ebnetd_OBJECTS) $(ebnetd_LDADD) $(LIBS) install-libexecSCRIPTS: $(libexec_SCRIPTS) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(libexecdir) @list='$(libexec_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(libexecSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(libexecdir)/$$f"; \ $(libexecSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(libexecdir)/$$f; \ else :; fi; \ done uninstall-libexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(libexec_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f $(DESTDIR)$(libexecdir)/$$f"; \ rm -f $(DESTDIR)$(libexecdir)/$$f; \ done install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(sbindir) @list='$(sbin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(sbinSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(sbindir)/$$f"; \ $(sbinSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(sbindir)/$$f; \ else :; fi; \ done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ rm -f $(DESTDIR)$(sbindir)/$$f; \ done mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/book.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebncheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebncontrol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebnet.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebnetd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdcache.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: 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: TAGS 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 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"; \ $(mkdir_p) "$(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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(HEADERS) installdirs: $(mkdir_p) $(DESTDIR)$(sbindir) $(DESTDIR)$(libexecdir) $(DESTDIR)$(sbindir) install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-libexecSCRIPTS install-sbinPROGRAMS \ install-sbinSCRIPTS 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-libexecSCRIPTS \ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libexecSCRIPTS install-man install-sbinPROGRAMS \ install-sbinSCRIPTS install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am uninstall-libexecSCRIPTS \ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS defs.h: stamp-defs-h stamp-defs-h: defs.h.in Makefile rm -f defs.h.tmp echo '/* automatically generated from defs.h.in. */' \ > defs.h.tmp sed -e 's;\@sysconfdir\@;$(sysconfdir);' \ -e 's;\@pkglocalstatedir\@;$(pkglocalstatedir);' \ $(srcdir)/defs.h.in >> defs.h.tmp $(top_srcdir)/move-if-change defs.h.tmp defs.h @echo timestamp > stamp-defs-h ebnstat: getopt_long.pl ebnstat.in Makefile rm -f ebnstat sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/ebnstat.in | sed '/^$$/q' > ebnstat.tmp cat $(srcdir)/getopt_long.pl >> ebnstat.tmp sed -e 's;\@VERSION\@;$(VERSION);' \ -e 's;\@MAILING_ADDRESS\@;$(MAILING_ADDRESS);' \ $(srcdir)/ebnstat.in | sed '1,/^$$/d' >> ebnstat.tmp cp ebnstat.tmp ebnstat chmod +x ebnstat rm -f ebnstat.tmp ebndaily: getopt_long.pl ebndaily.in Makefile rm -f ebndaily sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/ebndaily.in | sed '/^$$/q' > ebndaily.tmp cat $(srcdir)/getopt_long.pl >> ebndaily.tmp EBNSTAT="`echo ebnstat | sed '$(transform)'`"; \ NDTPSTAT="`echo ndtpstat | sed '$(transform)'`"; \ EBHTSTAT="`echo ebhtstat | sed '$(transform)'`"; \ sed -e 's;\@logdir\@;$(logdir);' \ -e 's;\@libexecdir\@;$(libexecdir);' \ -e 's;\@VERSION\@;$(VERSION);' \ -e 's;\@MAILX\@;$(MAILX);' \ -e 's;\@COMPRESS\@;$(COMPRESS);' \ -e 's;\@GZIPCMD\@;$(GZIPCMD);' \ -e 's;\@BZIP2\@;$(BZIP2);' \ -e 's;\@MAILING_ADDRESS\@;$(MAILING_ADDRESS);' \ -e 's;\@EBNSTAT\@;'$$EBNSTAT';' \ -e 's;\@NDTPSTAT\@;'$$NDTPSTAT';' \ -e 's;\@EBHTSTAT\@;'$$EBHTSTAT';' \ $(srcdir)/ebndaily.in | sed '1,/^$$/d' >> ebndaily.tmp cp ebndaily.tmp ebndaily chmod +x ebndaily rm -f ebndaily.tmp ebnupgrade: getopt_long.pl ebnupgrade.in Makefile rm -f ebnupgrade sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/ebnupgrade.in | sed '/^$$/q' > ebnupgrade.tmp cat $(srcdir)/getopt_long.pl >> ebnupgrade.tmp sed -e 's;\@VERSION\@;$(VERSION);' \ -e 's;\@MAILING_ADDRESS\@;$(MAILING_ADDRESS);' \ -e 's;\@sysconfdir\@;$(sysconfdir);' \ $(srcdir)/ebnupgrade.in | sed '1,/^$$/d' >> ebnupgrade.tmp cp ebnupgrade.tmp ebnupgrade chmod +x ebnupgrade rm -f ebnupgrade.tmp # 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: ebnetd-1.0.dfsg.1/ebnetd/book.c0000644000175000017500000002143207673055357015574 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #if defined(NDTPD) || defined(EBHTTPD) #include #include #endif #if defined(EBNETD) #include "ebtiny/eb.h" #include "ebtiny/appendix.h" #endif #include "fakelog.h" #include "permission.h" #include "ticket.h" #include "wildcard.h" #include "defs.h" /* * Initialize the book list `book_registry'. */ void initialize_book_registry() { book_registry = NULL; book_count = 0; } /* * Clear the book list `book_registry'. * Free all nodes and allocated memories in `book_registry', * and then set it to NULL. */ void finalize_book_registry() { Book *book = book_registry; Book *next; /* * Reset books list. Free all malloced memories. */ while (book != NULL) { next = book->next; delete_book(book); book = next; } book_registry = NULL; book_count = 0; } /* * Count books in `book_registry'. */ int count_book_registry() { Book *book; int count; for (book = book_registry, count = 0; book != NULL; book = book->next, count++) ; return count; } /* * Bind all books and appendixes in `book_registry'. */ int activate_book_registry() { Book *book; EB_Error_Code error_code; int available_count = 0; char lock_file_name[PATH_MAX + 1]; /* * If there is no book in the registry, do nothing. */ if (book_registry == NULL) return 0; for (book = book_registry; book != NULL; book = book->next) { /* * Bind a book. */ error_code = eb_bind(&book->book, book->path); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "the book is not available, %s: %s", eb_error_message(error_code), book->path); delete_book(book); continue; } available_count++; /* * Initialize all subbooks when running as a standalone daemon. */ if (server_mode == SERVER_MODE_STANDALONE) eb_load_all_subbooks(&book->book); /* * Bind a ticket stock for the book. */ if (book->max_clients != 0) { sprintf(lock_file_name, "%s/%s.%s", work_path, book->name, BOOK_LOCK_SUFFIX); if (bind_ticket_stock(&book->ticket_stock, lock_file_name, book->max_clients) < 0) return -1; } if (book->appendix_path != NULL) { /* * Bind an appendix. */ error_code = eb_bind_appendix(&book->appendix, book->appendix_path); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "the appendix is not available, %s: %s", eb_error_message(error_code), book->appendix_path); continue; } /* * Initialize all subbooks when running as a standalone daemon. */ if (server_mode == SERVER_MODE_STANDALONE) eb_load_all_appendix_subbooks(&book->appendix); } } return available_count; } /* * Add a new book to `book_registry'. * Upon successful, a pointer to the added book is returned. * Otherwise NULL is returned. */ Book * add_book() { Book *new_book; Book *book; int i; new_book = (Book *)malloc(sizeof(Book)); if (new_book == NULL) { syslog(LOG_ERR, "memory exhausted"); return NULL; } /* * Set initial values to the new book. */ eb_initialize_book(&new_book->book); eb_initialize_appendix(&new_book->appendix); new_book->path = NULL; new_book->appendix_path = NULL; new_book->name[0] = '\0'; new_book->title[0] = '\0'; new_book->max_clients = DEFAULT_BOOK_MAX_CLIENTS; initialize_permission(&new_book->permissions); initialize_ticket_stock(&new_book->ticket_stock); new_book->next = NULL; if (book_count == 0) book_registry = new_book; else { book = book_registry; for (i = 1; i < book_count; i++) book = book->next; book->next = new_book; } book_count++; return new_book; } /* * Delete `target_book' from `book_registry'. * Return 0 upon success, -1 otherwise. */ int delete_book(target_book) Book *target_book; { Book *book; if (book_registry == target_book) book_registry = target_book->next; else { for (book = book_registry; book != NULL; book = book->next) { if (book->next == target_book) { book->next = target_book->next; break; } } if (book == NULL) return -1; } finalize_permission(&target_book->permissions); finalize_ticket_stock(&target_book->ticket_stock); eb_finalize_book(&target_book->book); eb_finalize_appendix(&target_book->appendix); if (target_book->path != NULL) free(target_book->path); if (target_book->appendix_path != NULL) free(target_book->appendix_path); free(target_book); return 0; } /* * Find the bound book with `name' in `book_regitry'. * * If found, the pointer to the book is returned. * Otherwise NULL is returned. */ Book * find_book(name) const char *name; { Book *book; /* * Find the bound book. */ for (book = book_registry; book != NULL; book = book->next) { if (strcasecmp(book->name, name) == 0) return book; } return NULL; } /* * Search `book' for the subbook whose directory name is * `directory'. * If found, the subbook-code of the subbook is returned. * Otherwise, -1 is returned. */ EB_Subbook_Code find_subbook(book, directory) Book *book; const char *directory; { EB_Error_Code error_code; EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS]; char directory2[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; int subbook_count; int i; /* * Find the subbook in the current book. */ error_code = eb_subbook_list(&book->book, subbook_list, &subbook_count); if (error_code != EB_SUCCESS) return EB_SUBBOOK_INVALID; for (i = 0; i < subbook_count; i++) { error_code = eb_subbook_directory2(&book->book, subbook_list[i], directory2); if (error_code != EB_SUCCESS) continue; if (strcasecmp(directory, directory2) == 0) return subbook_list[i]; } return EB_SUBBOOK_INVALID; } /* * Search `book' for the subbook whose directory name of an appendix * is `directory'. * If found, the subbook-code of the subbook is returned. * Otherwise, -1 is returned. */ EB_Subbook_Code find_appendix_subbook(book, directory) Book *book; const char *directory; { EB_Error_Code error_code; EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS]; char directory2[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; int subbook_count; int i; /* * Find the subbook in the current appendix. */ error_code = eb_appendix_subbook_list(&book->appendix, subbook_list, &subbook_count); if (error_code != EB_SUCCESS) return EB_SUBBOOK_INVALID; for (i = 0; i < subbook_count; i++) { error_code = eb_appendix_subbook_directory2(&book->appendix, subbook_list[i], directory2); if (error_code != EB_SUCCESS) continue; if (strcasecmp(directory, directory2) == 0) return subbook_list[i]; } return EB_SUBBOOK_INVALID; } /* * For the current client, * check permission flags to the books in `book_registry'. */ void check_book_permissions() { Book *book; for (book = book_registry; book != NULL; book = book->next) { book->permission_flag = test_permission(&book->permissions, client_host_name, client_address, match_wildcard); } } /* * For the current client, * set permission flags to all books in `book_registry'. */ void set_all_book_permissions() { Book *book; for (book = book_registry; book != NULL; book = book->next) book->permission_flag = 1; } ebnetd-1.0.dfsg.1/ebnetd/config.c0000644000175000017500000005243307673055355016112 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #if defined(NDTPD) || defined(EBHTTPD) #include #include #endif #if defined(EBNETD) #include "ebtiny/eb.h" #include "ebtiny/appendix.h" #endif #include "confutil.h" #include "fakelog.h" #include "filename.h" #include "hostname.h" #include "readconf.h" #include "permission.h" #include "defs.h" /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) /* * Unexported functions. */ static int cf_begin EBNETD_P((const char *, const char *, int)); static int cf_end EBNETD_P((const char *, const char *, int)); static int cf_ebnet_port EBNETD_P((const char *, const char *, int)); static int cf_ndtp_port EBNETD_P((const char *, const char *, int)); static int cf_http_port EBNETD_P((const char *, const char *, int)); static int cf_user EBNETD_P((const char *, const char *, int)); static int cf_group EBNETD_P((const char *, const char *, int)); static int cf_max_clients EBNETD_P((const char *, const char *, int)); static int cf_hosts EBNETD_P((const char *, const char *, int)); static int cf_timeout EBNETD_P((const char *, const char *, int)); static int cf_work_path EBNETD_P((const char *, const char *, int)); static int cf_max_hits EBNETD_P((const char *, const char *, int)); static int cf_max_text_size EBNETD_P((const char *, const char *, int)); static int cf_syslog_facility EBNETD_P((const char *, const char *, int)); static int cf_begin_book EBNETD_P((const char *, const char *, int)); static int cf_end_book EBNETD_P((const char *, const char *, int)); static int cf_book_name EBNETD_P((const char *, const char *, int)); static int cf_book_title EBNETD_P((const char *, const char *, int)); static int cf_book_path EBNETD_P((const char *, const char *, int)); static int cf_appendix_path EBNETD_P((const char *, const char *, int)); static int cf_book_max_clients EBNETD_P((const char *, const char *, int)); static int cf_book_hosts EBNETD_P((const char *, const char *, int)); /* * Syntax of the configuration file. */ Configuration configuration_table[] = { {"", "begin", cf_begin, READCONF_ZERO_OR_ONCE, 0}, {"", "end", cf_end, READCONF_ZERO_OR_ONCE, 0}, /* single directives. */ {"", "ebnet-port", cf_ebnet_port, READCONF_ZERO_OR_ONCE, 0}, {"", "ndtp-port", cf_ndtp_port, READCONF_ZERO_OR_ONCE, 0}, {"", "http-port", cf_http_port, READCONF_ZERO_OR_ONCE, 0}, {"", "user", cf_user, READCONF_ZERO_OR_ONCE, 0}, {"", "group", cf_group, READCONF_ZERO_OR_ONCE, 0}, {"", "max-clients", cf_max_clients, READCONF_ZERO_OR_ONCE, 0}, {"", "hosts", cf_hosts, READCONF_ZERO_OR_MORE, 0}, {"", "timeout", cf_timeout, READCONF_ZERO_OR_ONCE, 0}, {"", "work-path", cf_work_path, READCONF_ZERO_OR_ONCE, 0}, {"", "max-hits", cf_max_hits, READCONF_ZERO_OR_ONCE, 0}, {"", "max-text-size", cf_max_text_size, READCONF_ZERO_OR_ONCE, 0}, {"", "syslog-facility", cf_syslog_facility, READCONF_ZERO_OR_ONCE, 0}, /* book group directive. */ {"", "begin book", cf_begin_book, READCONF_ZERO_OR_MORE, 0}, {"book", "name", cf_book_name, READCONF_ONCE, 0}, {"book", "title", cf_book_title, READCONF_ONCE, 0}, {"book", "path", cf_book_path, READCONF_ONCE, 0}, {"book", "appendix-path", cf_appendix_path, READCONF_ZERO_OR_ONCE, 0}, {"book", "max-clients", cf_book_max_clients, READCONF_ZERO_OR_ONCE, 0}, {"book", "hosts", cf_book_hosts, READCONF_ZERO_OR_MORE, 0}, {"", "end book", cf_end_book, READCONF_ZERO_OR_MORE, 0}, {"", NULL, NULL, READCONF_ONCE, 0} }; /* * The current configuring book. */ static Book *cf_book; /* * The hook is called before reading a configuration file. */ static int cf_begin(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * The length of the file_name "/" * must not exceed PATH_MAX. */ if (PATH_MAX < strlen(DEFAULT_WORK_PATH) + 1 + MAX_WORK_PATH_BASE_NAME_LENGTH) { syslog(LOG_ERR, "internal error, too long DEFAULT_WORK_PATH"); return -1; } strcpy(work_path, DEFAULT_WORK_PATH); /* * Debugging information. */ syslog(LOG_DEBUG, "%s: debug: beginning of the configuration", file_name); return 0; } /* * The hook is called just after reading a configuration file. */ static int cf_end(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * If the configuration file has no `hosts' directive, and if * the mode is SERVER_MODE_CHECK, then output a warning message. */ if (server_mode == SERVER_MODE_CHECK && count_permission(&permissions) == 0) { syslog(LOG_ERR, "warning: nobody can connect to the server \ because the configuration file has no `hosts' directive"); } /* * If the configuration file has no `book' group directive, and if * the mode is SERVER_MODE_CHECK, then output a warning message. */ if (server_mode == SERVER_MODE_CHECK && count_book_registry() == 0) syslog(LOG_ERR, "warning: no book definition"); /* * Set the pid file_name. */ sprintf(pid_file_name, "%s/%s", work_path, PID_BASE_NAME); if (canonicalize_file_name(pid_file_name) < 0) return -1; /* * Set the connection lock file_name. */ sprintf(connection_lock_file_name, "%s/%s", work_path, LOCK_BASE_NAME); /* * debugging information. */ syslog(LOG_DEBUG, "%s: debug: end of the configuration", file_name); return 0; } /* * `ebnet-port' directive. */ static int cf_ebnet_port(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { in_port_t port; /* * Parse the port number. */ if (parse_tcp_port(argument, &port) < 0) { syslog(LOG_ERR, "%s:%d: unknown service: %s", file_name, line_number, argument); return -1; } /* * Set the port number, if this is EBNETD. */ #ifdef EBNETD listening_port = port; #endif /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set ebnet-port: %d", file_name, line_number, (int)port); return 0; } /* * `ndtp-port' directive. */ static int cf_ndtp_port(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { in_port_t port; /* * Parse the port number. */ if (parse_tcp_port(argument, &port) < 0) { syslog(LOG_ERR, "%s:%d: unknown service: %s", file_name, line_number, argument); return -1; } /* * Set the port number, if this is NDTPD. */ #ifdef NDTPD listening_port = port; #endif /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set ndtp-port: %d", file_name, line_number, (int)port); return 0; } /* * `http-port' directive. */ static int cf_http_port(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { in_port_t port; /* * Parse the port number. */ if (parse_tcp_port(argument, &port) < 0) { syslog(LOG_ERR, "%s:%d: unknown service: %s", file_name, line_number, argument); return -1; } /* * Set the port number, if this is ebHTTPD. */ #ifdef EBHTTPD listening_port = port; #endif /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set http-port: %d", file_name, line_number, (int)port); return 0; } /* * `user' directive. */ static int cf_user(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the user ID. */ if (parse_user(argument, &user_id) < 0) { syslog(LOG_ERR, "%s:%d: unknown user: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set user: %d", file_name, line_number, (int)user_id); return 0; } /* * `group' directive. */ static int cf_group(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the group ID. */ if (parse_group(argument, &group_id) < 0) { syslog(LOG_ERR, "%s:%d: unknown group: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set group: %d", file_name, line_number, (int)group_id); return 0; } /* * `max-clients' directive. */ static int cf_max_clients(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the max-clients. */ if (parse_integer(argument, &max_clients) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set max-clients: %d", file_name, line_number, max_clients); return 0; } /* * `hosts' directive. */ static int cf_hosts(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Add `argument' to the host permission list. */ if (add_permission(&permissions, argument) < 0) { syslog(LOG_ERR, "%s:%d: invalid host, IP address or IP prefix: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: add hosts: %s", file_name, line_number, argument); return 0; } /* * `timeout' directive. */ static int cf_timeout(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the timeout. */ if (parse_integer(argument, &idle_timeout) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set timeout: %d", file_name, line_number, idle_timeout); return 0; } /* * `work-path' directive. */ static int cf_work_path(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Check for the length of the path. * The length of `/' must not exceed PATH_MAX. */ if (PATH_MAX < strlen(argument) + 1 + MAX_WORK_PATH_BASE_NAME_LENGTH) { syslog(LOG_ERR, "%s:%d: too long path", file_name, line_number); return -1; } /* * The file_name must be an absolute path. */ if (*argument != '/') { syslog(LOG_ERR, "%s:%d: not an absolute path: %s", file_name, line_number, argument); return -1; } /* * Set the working directory path. */ strcpy(work_path, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set work-path: %s", file_name, line_number, work_path); return 0; } /* * `max-hits' directive. */ static int cf_max_hits(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the max hits. */ if (parse_integer(argument, &max_hits) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set max-hits: %d", file_name, line_number, max_hits); return 0; } /* * `max-text-size' directive. */ static int cf_max_text_size(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { int size; /* * Parse and set the max text size. */ if (parse_integer(argument, &size) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } max_text_size = size; /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set max-text-size: %d", file_name, line_number, max_text_size); return 0; } /* * `syslog-facility' directive. */ static int cf_syslog_facility(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set a syslog facility. */ if (parse_syslog_facility(argument, &syslog_facility) < 0) { syslog(LOG_ERR, "%s:%d: unknown syslog facility: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set syslog-facility: %s", file_name, line_number, argument); return 0; } /* * `begin book' sequence. */ static int cf_begin_book(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Create a new book node. */ cf_book = add_book(); if (cf_book == NULL) { syslog(LOG_ERR, "%s:%d: memory exhausted", file_name, line_number); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: beginning of the book definition", file_name, line_number); return 0; } /* * `end book' sequence. */ static int cf_end_book(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * If the group directive has no `hosts' sub-directive, and if * the mode is SERVER_MODE_CHECK, then output a warning message. */ if (server_mode == SERVER_MODE_CHECK && count_permission(&cf_book->permissions) == 0) { syslog(LOG_ERR, "%s:%d: warning: nobody can access the book \ because the book definition has no `hosts' sub-directive", file_name, line_number); } /* * Set `max-clients' for the book to 0 when test mode. */ if (server_mode == SERVER_MODE_TEST) { cf_book->max_clients = 0; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: end of the book definition", file_name, line_number); return 0; } /* * `name' directive (in book structure). */ static int cf_book_name(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { const char *p; /* * Check for the length of the book name. */ if (MAX_BOOK_NAME_LENGTH < strlen(argument)) { syslog(LOG_ERR, "%s:%d: too long book name", file_name, line_number); return -1; } /* * The tagname must consist of upper letters, digit, '_', and '-'. */ for (p = argument; *p != '\0'; p++) { if (!islower(*p) && !isdigit(*p) && *p != '_' && *p != '-') { syslog(LOG_ERR, "%s:%d: the book name contains invalid character: %s", file_name, line_number, argument); return -1; } } /* * Check for uniqness of book names. */ if (find_book(argument) != NULL) { syslog(LOG_ERR, "%s:%d: the book name redefined: %s", file_name, line_number, argument); return -1; } /* * Set the book name. */ strcpy(cf_book->name, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-name: %s", file_name, line_number, cf_book->name); return 0; } /* * `title' directive (in book structure). */ static int cf_book_title(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Check for the length of the title. */ if (MAX_BOOK_TITLE_LENGTH < strlen(argument)) { syslog(LOG_ERR, "%s:%d: too long book title", file_name, line_number); return -1; } /* * Set the title. */ strcpy(cf_book->title, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-title: %s", file_name, line_number, cf_book->title); return 0; } /* * `path' directive (in book structure). */ static int cf_book_path(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { size_t argument_length; /* * Check for the length of the path. */ argument_length = strlen(argument); if (PATH_MAX < argument_length) { syslog(LOG_ERR, "%s:%d: too long path", file_name, line_number); return -1; } /* * The path must be an absolute path. */ if (*argument != '/') { syslog(LOG_ERR, "%s:%d: not an absolute path: %s", file_name, line_number, argument); return -1; } /* * Set the book path. */ cf_book->path = (char *)malloc(argument_length + 1); if (cf_book->path == NULL) { syslog(LOG_ERR, "%s:%d: memory exhausted", file_name, line_number); return -1; } strcpy(cf_book->path, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-path: %s", file_name, line_number, argument); return 0; } /* * `appendix-path' directive. */ static int cf_appendix_path(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { size_t argument_length; /* * Check for the length of the path. */ argument_length = strlen(argument); if (PATH_MAX < argument_length) { syslog(LOG_ERR, "%s:%d: too long appendix path", file_name); return -1; } /* * The path must be an absolute path. */ if (*argument != '/') { syslog(LOG_ERR, "%s:%d: not an absolute path: %s", file_name, line_number, argument); return -1; } /* * Set the book path. */ cf_book->appendix_path = (char *)malloc(argument_length + 1); if (cf_book->appendix_path == NULL) { syslog(LOG_ERR, "%s:%d: memory exhausted", file_name, line_number); return -1; } strcpy(cf_book->appendix_path, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set appendix-path: %s", file_name, line_number, argument); return 0; } /* * `max-clients' directive (in book structure). */ static int cf_book_max_clients(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * An argumentument represents a remote host name or address. */ if (parse_integer(argument, &cf_book->max_clients) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-max-clients: %d", file_name, line_number, cf_book->max_clients); return 0; } /* * `hosts' directive (in book structure). */ static int cf_book_hosts(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Add `argument' to the permission list. */ if (add_permission(&cf_book->permissions, argument) < 0) { syslog(LOG_ERR, "%s:%d: invalid host, IP address or IP prefix: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: add book-hosts: %s", file_name, line_number, argument); return 0; } ebnetd-1.0.dfsg.1/ebnetd/defs.h.in0000644000175000017500000001664707673055357016211 0ustar mhattamhatta/* -*- C -*- * Copyright (c) 1997, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef DEFS_H #define DEFS_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if defined(EBNETD) || defined(USE_TINYEB) #include "ebtiny/eb.h" #include "ebtiny/error.h" #else #if defined(NDTPD) || defined(EBHTTPD) #include #include #endif #endif #include "readconf.h" #include "permission.h" #include "ticket.h" /* * Software name and program names. */ #ifdef EBNETD #define SOFTWARE_NAME "EBNETD" #define SERVER_PROGRAM_NAME "ebnetd" #define CHECK_PROGRAM_NAME "ebncheck" #define CONTROL_PROGRAM_NAME "ebncontrol" #endif #ifdef NDTPD #define SOFTWARE_NAME "NDTPD" #define SERVER_PROGRAM_NAME "ndtpd" #define CHECK_PROGRAM_NAME "ndtpcheck" #define CONTROL_PROGRAM_NAME "ndtpcontorl" #endif #ifdef EBHTTPD #define SOFTWARE_NAME "ebHTTPD" #define SERVER_PROGRAM_NAME "ebhttpd" #define CHECK_PROGRAM_NAME "ebhtcheck" #define CONTROL_PROGRAM_NAME "ebhtcontrol" #endif /* * Configuration filename. */ #define DEFAULT_CONFIGURATION_FILE_NAME "@sysconfdir@/ebnetd.conf" /* * Path to a working directory. */ #define DEFAULT_WORK_PATH "@pkglocalstatedir@" /* * Basename of the file on which the sever writes its process ID. * (Its length must not exceed MAX_WORK_PATH_BASE_NAME_LENGTH characters.) */ #ifdef EBNETD #define PID_BASE_NAME "ebnd.pid" #endif #ifdef NDTPD #define PID_BASE_NAME "ndtpd.pid" #endif #ifdef EBHTTPD #define PID_BASE_NAME "ebhttpd.pid" #endif /* * Basename of the lock file that records the number of running * server processes invoked by inetd. * (Its length must not exceed MAX_WORK_PATH_BASE_NAME_LENGTH characters. * It must not conflict with ".".) */ #ifdef EBNETD #define LOCK_BASE_NAME "ebnetd.lock" #endif #ifdef NDTPD #define LOCK_BASE_NAME "ndtpd.lock" #endif #ifdef EBHTTPD #define LOCK_BASE_NAME "ebhttpd.lock" #endif /* * Base name of the mtime file. * Last modified time of this file becomes last modified time of all * contents on the server. */ #ifdef EBHTTPD #define MTIME_BASE_NAME "ebhttpd.mtime" #endif /* * Port number on which the server listens. * It must be a TCP protocol name or a port number. */ #ifdef EBNETD #define SERVICE_NAME "ebnet" #define DEFAULT_PORT 22010 #endif #ifdef NDTPD #define SERVICE_NAME "ndtp" #define DEFAULT_PORT 2010 #endif #ifdef EBHTTPD #define SERVICE_NAME "http" #define DEFAULT_PORT 80 #endif /* * Suffix of the lock file. * (The length of the "." file must not exceed * MAX_WORK_PATH_BASE_NAME_LENGTH characters.) */ #define BOOK_LOCK_SUFFIX "lock" /* * How many connections the server accepts at the same time. */ #define DEFAULT_MAX_CLIENTS 1 /* * How many clients can use a book at the same time. */ #define DEFAULT_BOOK_MAX_CLIENTS 1 /* * Seconds until the server closes a idle connection. */ #define DEFAULT_IDLE_TIMEOUT 900 /* * Syslog facility. */ #define DEFAULT_SYSLOG_FACILITY LOG_DAEMON /* * The number of hit entries the server give up searching. */ #define DEFAULT_MAX_HITS 50 /* * The default maximum size of text the server may send as a response to * a client. */ #define DEFAULT_MAX_TEXT_SIZE 32768 /* * The umask value of the server. */ #define SERVER_UMASK 022 /* * Maximum lengh of a generic string. */ #define MAX_STRING_LENGTH 511 /* * Maximum lengh of a book name. */ #define MAX_BOOK_NAME_LENGTH 14 /* * Maximum lengh of a book title. */ #define MAX_BOOK_TITLE_LENGTH 80 /* * Maximum length of a basename written in the work-path directory. */ #define MAX_WORK_PATH_BASE_NAME_LENGTH 32 /* * Backlog for listen(). */ #define LISTENING_BACKLOG 5 /* * Running modes of the server. */ #define SERVER_MODE_STANDALONE 0 #define SERVER_MODE_INETD 1 #define SERVER_MODE_TEST 2 #define SERVER_MODE_CHECK 3 #define SERVER_MODE_CONTROL 4 /* * Book -- represents a book. */ typedef struct Book_Struct Book; struct Book_Struct { /* * Path of the book. */ char *path; /* * Path of the book. */ char *appendix_path; /* * Name of the book. */ char name[MAX_BOOK_NAME_LENGTH + 1]; /* * Access permission to the current client. */ int permission_flag; /* * Title of the book. */ char title[MAX_BOOK_TITLE_LENGTH + 1]; /* * The maximum number of connections to the book. */ int max_clients; /* * Access permission list to the book. */ Permission permissions; /* * Ticket stock (`max-clients' controler). */ Ticket_Stock ticket_stock; /* * Entity of the CD-ROM book. */ EB_Book book; /* * Appendix entitiy of the CD-ROM book. */ EB_Appendix appendix; /* * Refer to a next book. * Set to NULL when there is no more book. */ Book *next; }; /* * Trick for function protypes. */ #ifndef EBNETD_P #ifdef __STDC__ #define EBNETD_P(p) p #else /* not __STDC__ */ #define EBNETD_P(p) () #endif /* not __STDC__ */ #endif /* EBNETD_P */ /* * Function declarations. */ /* book.c */ void initialize_book_registry EBNETD_P((void)); void finalize_book_registry EBNETD_P((void)); void terminate_book_registry EBNETD_P((void)); int count_book_registry EBNETD_P((void)); int activate_book_registry EBNETD_P((void)); Book *add_book EBNETD_P((void)); int delete_book EBNETD_P((Book *)); Book *find_book EBNETD_P((const char *)); EB_Subbook_Code find_subbook EBNETD_P((Book *, const char *)); EB_Subbook_Code find_appendix_subbook EBNETD_P((Book *, const char *)); void check_book_permissions EBNETD_P((void)); void set_all_book_permissions EBNETD_P((void)); /* global.c */ int initialize_global_variables EBNETD_P((void)); void finalize_global_variables EBNETD_P((void)); /* misc.c */ void output_version EBNETD_P((void)); void output_try_help EBNETD_P((void)); /* ndtp.c */ int protocol_main EBNETD_P((void)); /* * Global variables. */ extern Configuration configuration_table[]; extern const char *invoked_name; extern const char *program_name; extern const char *program_version; extern char work_path[]; extern char configuration_file_name[]; extern in_port_t listening_port; extern in_port_t old_listening_port; fd_set listening_files; int max_listening_file; extern int accepted_in_file; extern int accepted_out_file; extern uid_t user_id; extern gid_t group_id; extern char pid_file_name[]; extern char old_pid_file_name[]; extern char connection_lock_file_name[]; extern Ticket_Stock connection_ticket_stock; extern int max_clients; extern int connection_count; extern int idle_timeout; extern Permission permissions; extern Book *book_registry; extern Book *book_registry_tail; extern int book_count; extern int max_hits; extern size_t max_text_size; extern char client_host_name[]; extern char client_address[]; extern int server_mode; extern int syslog_facility; #endif /* not DEFS_H */ ebnetd-1.0.dfsg.1/ebnetd/ebncheck.c0000644000175000017500000001257707673055354016413 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #include "fakelog.h" #include "getopt.h" #include "hostname.h" #include "permission.h" #include "readconf.h" #include "wildcard.h" #include "defs.h" /* * Unexported functions. */ static void output_help EBNETD_P((void)); /* * Command line options. */ static const char *short_options = "c:dhv"; static struct option long_options[] = { {"configuration-file", required_argument, NULL, 'c'}, {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {"verbose", no_argument, NULL, 'd'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; int main(argc, argv) int argc; char *argv[]; { EB_Error_Code error_code; int ch; /* * We must output US-ASCII syslog messages. */ #ifdef HAVE_SETLOCALE setlocale(LC_ALL, "C"); #endif /* * Set program name and version. */ invoked_name = argv[0]; program_name = CHECK_PROGRAM_NAME; program_version = VERSION; /* * Initialize EB Library. */ error_code = eb_initialize_library(); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "%s\n", eb_error_message(error_code)); exit(1); } /* * Initialize global and static variables. */ server_mode = SERVER_MODE_CHECK; initialize_global_variables(); if (PATH_MAX < strlen(DEFAULT_CONFIGURATION_FILE_NAME)) { fprintf(stderr, "%s: internal error, too long DEFAULT_CONFIGURATION_FILE_NAME\n", invoked_name); exit(1); } strcpy(configuration_file_name, DEFAULT_CONFIGURATION_FILE_NAME); /* * Set fakelog behavior. */ set_fakelog_name(invoked_name); set_fakelog_mode(FAKELOG_TO_STDERR); set_fakelog_level(LOG_ERR); /* * Parse command line options. */ for (;;) { ch = getopt_long(argc, argv, short_options, long_options, NULL); if (ch == -1) break; switch (ch) { case 'c': /* * Option `-c file'. Specify a configuration file name. */ if (PATH_MAX < strlen(optarg)) { fprintf(stderr, "%s: too long configuration file_name\n", invoked_name); fflush(stderr); exit(1); } strcpy(configuration_file_name, optarg); break; case 'd': /* * Option `-d'. Debug mode. */ set_fakelog_level(LOG_DEBUG); break; case 'h': /* * Option `-h'. Help. */ output_help(); exit(0); case 'v': /* * Option `-v'. Show the version number. */ output_version(); exit(0); default: output_try_help(); exit(1); } } /* * Check for the number of rest arguments. */ if (0 < argc - optind) { fprintf(stderr, "%s: too many arguments\n", invoked_name); output_try_help(); exit(1); } /* * Read the configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { fprintf(stderr, "%s: configuration failure\n", invoked_name); fflush(stderr); exit(1); } /* * Finalize global and static variables. */ finalize_global_variables(); /* * Finalize EB Library. */ eb_finalize_library(); return 0; } /* * Output the usage to standard out. */ static void output_help() { printf("Usage: %s [option...]\n", program_name); printf("Options:\n"); printf(" -c FILE --configuration-file FILE\n"); printf(" specify a configuration file\n"); printf(" (default: %s)\n", DEFAULT_CONFIGURATION_FILE_NAME); printf(" -d --debug --verbose degug mode\n"); printf(" -h --help display this help, then exit\n"); printf(" -v --version display version number, then exit\n"); printf("\nDefault value used in a configuration file:\n"); printf(" work-path %s\n", DEFAULT_WORK_PATH); printf("\nReport bugs to %s.\n", MAILING_ADDRESS); fflush(stdout); } ebnetd-1.0.dfsg.1/ebnetd/ebncontrol.c0000644000175000017500000002133307673055355017005 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ #ifndef HAVE_STRERROR #ifdef __STDC__ char *strerror(int); #else /* not __STDC__ */ char *strerror(); #endif /* not __STDC__ */ #endif /* HAVE_STRERROR */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #include "fakelog.h" #include "getopt.h" #include "hostname.h" #include "logpid.h" #include "permission.h" #include "readconf.h" #include "wildcard.h" #include "defs.h" /* * Unexported functions. */ static void output_help EBNETD_P((void)); /* * Command line options. */ static const char *short_options = "c:hv"; static struct option long_options[] = { {"configuration-file", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /* * Sub-commands. */ #define SUB_COMMAND_STATUS 0 #define SUB_COMMAND_RESTART 1 #define SUB_COMMAND_TERMINATE 2 #define SUB_COMMAND_KILL 3 typedef struct { const char *name; int id; int signal; } Sub_Command; static const Sub_Command command_table[] = { {"status", SUB_COMMAND_STATUS, -1}, {"restart", SUB_COMMAND_RESTART, SIGHUP}, {"terminate", SUB_COMMAND_TERMINATE, SIGTERM}, {"kill", SUB_COMMAND_KILL, SIGKILL}, {NULL, 0} }; /* * Unexported functions. */ #ifdef __STDC__ static const Sub_Command *get_sub_command(const char *); #else static const Sub_Command *get_sub_command(); #endif int main(argc, argv) int argc; char *argv[]; { EB_Error_Code error_code; const Sub_Command *command; pid_t pid; int ch; /* * We must output US-ASCII syslog messages. */ #ifdef HAVE_SETLOCALE setlocale(LC_ALL, "C"); #endif /* * Set program name and version. */ invoked_name = argv[0]; program_name = CONTROL_PROGRAM_NAME; program_version = VERSION; /* * Initialize EB Library. */ error_code = eb_initialize_library(); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "%s\n", eb_error_message(error_code)); exit(1); } /* * Initialize global and static variables. */ server_mode = SERVER_MODE_CONTROL; initialize_global_variables(); if (PATH_MAX < strlen(DEFAULT_CONFIGURATION_FILE_NAME)) { fprintf(stderr, "%s: internal error, too long DEFAULT_CONFIGURATION_FILE_NAME\n", invoked_name); exit(1); } strcpy(configuration_file_name, DEFAULT_CONFIGURATION_FILE_NAME); /* * Set fakelog behavior. */ set_fakelog_name(invoked_name); set_fakelog_mode(FAKELOG_TO_STDERR); set_fakelog_level(LOG_ERR); /* * Parse command line options. */ for (;;) { ch = getopt_long(argc, argv, short_options, long_options, NULL); if (ch == -1) break; switch (ch) { case 'c': /* * Option `-c file'. Specify a configuration file_name. */ if (PATH_MAX < strlen(optarg)) { fprintf(stderr, "%s: too long configuration file_name\n", invoked_name); fflush(stderr); exit(1); } strcpy(configuration_file_name, optarg); break; case 'h': /* * Option `-h'. Help. */ output_help(); exit(0); case 'v': /* * Option `-v'. Show the version number. */ output_version(); exit(0); default: output_try_help(); exit(1); } } /* * Check for the number of rest arguments. */ if (argc - optind == 0) { fprintf(stderr, "%s: too few argument\n", invoked_name); output_try_help(); exit(1); } if (1 < argc - optind) { fprintf(stderr, "%s: too many arguments\n", invoked_name); output_try_help(); exit(1); } /* * Check for sub-command. */ command = get_sub_command(argv[optind]); if (command == NULL) { output_try_help(); exit(1); } /* * Read the configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { fprintf(stderr, "%s: configuration failure\n", invoked_name); fflush(stderr); exit(1); } /* * Read PID from the pid-file. */ if (probe_pid_file(pid_file_name) < 0) { fprintf(stderr, "%s: PID file not found: %s\n", invoked_name, pid_file_name); fprintf(stderr, "%s: server not running\n", invoked_name); fflush(stderr); exit(1); } if (read_pid_file(pid_file_name, &pid) < 0) exit(1); /* * When sub-command is `status', output a message and exit. */ if (command->id == SUB_COMMAND_STATUS) { fprintf(stderr, "%s: PID file found: %s\n", invoked_name, pid_file_name); fprintf(stderr, "%s: ndtpd is running (PID = %u)\n", invoked_name, (unsigned)pid); fflush(stderr); exit(0); } /* * Send a signal to the running `ndtpd'. */ if (kill(pid, command->signal) < 0) { fprintf(stderr, "%s: %s\n", invoked_name, strerror(errno)); fflush(stderr); exit(1); } /* * When ndtpd is killed (send SIGKILL), ndtpd failed to remove * the pid file ndtpd. The command try to remove it. */ if (command->id == SUB_COMMAND_KILL) { if (remove_pid_file(pid_file_name) < 0) exit(1); } /* * Finalize global and static variables. */ finalize_global_variables(); /* * Finalize EB Library. */ eb_finalize_library(); return 0; } /* * Parse sub-command. */ static const Sub_Command * get_sub_command(name) const char *name; { size_t name_length; const Sub_Command *command; const Sub_Command *candidate = NULL; int matches; name_length = strlen(name); matches = 0; for (command = command_table; command->name != NULL; command++) { if (strcasecmp(name, command->name) == 0) return command; else if (strncasecmp(name, command->name, name_length) == 0) { candidate = command; matches++; } } if (matches == 0) { fprintf(stderr, "%s: unknown command `%s'\n", invoked_name, name); fflush(stderr); return NULL; } else if (1 < matches) { fprintf(stderr, "%s: command `%s' is ambigous\n", invoked_name, name); fflush(stderr); return NULL; } return candidate; } /* * Output the usage to standard out. */ static void output_help() { printf("Usage: %s [option...] sub-command\n", program_name); printf("Options:\n"); printf(" -c FILE --configuration-file FILE\n"); printf(" specify a configuration file\n"); printf(" (default: %s)\n", DEFAULT_CONFIGURATION_FILE_NAME); printf(" -h --help display this help, then exit\n"); printf(" -v --version display version number, then exit\n"); printf("\nSub-commands:\n"); printf(" kill kill ndtpd (send SIGKILL)\n"); printf(" restart restart ndtpd (send SIGHUP)\n"); printf(" status output status of ndtpd\n"); printf(" terminate terminate ndtpd (send SIGTERM)\n"); printf("\nDefault value used in a configuration file:\n"); printf(" work-path %s\n", DEFAULT_WORK_PATH); printf("\nReport bugs to %s.\n", MAILING_ADDRESS); fflush(stdout); } ebnetd-1.0.dfsg.1/ebnetd/ebnetd.c0000644000175000017500000006434607673055354016113 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01, 02 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #if defined(HAVE_SYS_WAIT_H) || defined(HAVE_UNION_WAIT) #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_GETCWD #define getcwd(d,n) getwd(d) #endif #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #ifdef HAVE_UNION_WAIT #ifndef WTERMSIG #define WTERMSIG(x) ((x).w_termsig) #endif #ifndef WCOREDUMP #define WCOREDUMP(x) ((x).w_coredump) #endif #ifndef WEXITSTATUS #define WEXITSTATUS(x) ((x).w_retcode) #endif #ifndef WIFSIGNALED #define WIFSIGNALED(x) (WTERMSIG(x) != 0) #endif #ifndef WIFEXITED #define WIFEXITED(x) (WTERMSIG(x) == 0) #endif #else /* not HAVE_UNION_WAIT */ #ifndef WTERMSIG #define WTERMSIG(x) ((x) & 0x7f) #endif #ifndef WCOREDUMP #define WCOREDUMP(x) ((x) & 0x80) #endif #ifndef WEXITSTATUS #define WEXITSTATUS(x) (((x) >> 8) & 0xff) #endif #ifndef WIFSIGNALED #define WIFSIGNALED(x) (WTERMSIG (x) != 0) #endif #ifndef WIFEXITED #define WIFEXITED(x) (WTERMSIG (x) == 0) #endif #endif /* not HAVE_UNION_WAIT */ #ifndef SHUT_RD #define SHUT_RD 0 #endif #ifndef SHUT_WR #define SHUT_WR 1 #endif #ifndef SHUT_RDWR #define SHUT_RDWR 2 #endif #include "confutil.h" #include "daemon.h" #include "fakelog.h" #include "fdset.h" #include "filename.h" #include "getopt.h" #include "hostname.h" #include "linebuf.h" #include "logpid.h" #include "openmax.h" #include "permission.h" #include "privilege.h" #include "serverport.h" #include "signame.h" #include "ticket.h" #include "wildcard.h" #include "defs.h" /* * Unexported functions. */ static void standalone_main EBNETD_P((void)); static void inetd_main EBNETD_P((void)); static void test_main EBNETD_P((void)); static void output_help EBNETD_P((void)); static void set_signal_handler EBNETD_P((int, RETSIGTYPE (*)(int))); static void block_signal EBNETD_P((int)); static void unblock_signal EBNETD_P((int)); static RETSIGTYPE abort_parent EBNETD_P((int)); static RETSIGTYPE abort_child EBNETD_P((int)); static RETSIGTYPE terminate_parent EBNETD_P((int)); static RETSIGTYPE terminate_child EBNETD_P((int)); static RETSIGTYPE restart_parent EBNETD_P((int)); static RETSIGTYPE wait_child EBNETD_P((int)); /* * Command line options. */ static const char *short_options = "c:hitv"; static struct option long_options[] = { {"configuration-file", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"inetd", no_argument, NULL, 'i'}, {"test", no_argument, NULL, 't'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /* * The flag is set when the server is started. */ static int once_started; /* * The flag is set if SIGHUP is received. */ static int restart_trigger; /* * Process group ID of the server. */ pid_t process_group_id; /* * Signal mask. */ #if !defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSETMASK) static int signal_mask = 0; #endif int main(argc, argv) int argc; char *argv[]; { EB_Error_Code error_code; int ch; /* * We must output US-ASCII syslog messages. */ #ifdef HAVE_SETENV setenv("LC_ALL", "C", 1); setenv("LANGUAGE", "C", 1); #else putenv("LC_ALL=C"); putenv("LANGUAGE=C"); #endif #ifdef HAVE_SETLOCALE setlocale(LC_ALL, "C"); #endif /* * Set program name and version. */ invoked_name = argv[0]; program_name = SERVER_PROGRAM_NAME; program_version = VERSION; /* * Set umask. */ umask(SERVER_UMASK); /* * Set fakelog behavior. */ set_fakelog_name(invoked_name); set_fakelog_mode(FAKELOG_TO_SYSLOG); set_fakelog_level(LOG_DEBUG); /* * Open syslog. * If LOG_DAEMON is not defined, it assumes old style syslog * It doesn't have facility. */ syslog_facility = DEFAULT_SYSLOG_FACILITY; #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif syslog(LOG_DEBUG, "debug: open syslog"); /* * Initialize EB Library. */ error_code = eb_initialize_library(); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "%s\n", eb_error_message(error_code)); exit(1); } /* * Initialize variables. */ once_started = 0; initialize_fdset(&listening_files, &max_listening_file); server_mode = SERVER_MODE_STANDALONE; if (PATH_MAX < strlen(DEFAULT_CONFIGURATION_FILE_NAME)) { syslog(LOG_ERR, "internal error, too long DEFAULT_CONFIGURATION_FILE_NAME"); goto die; } strcpy(configuration_file_name, DEFAULT_CONFIGURATION_FILE_NAME); initialize_global_variables(); /* * Parse command line options. */ for (;;) { ch = getopt_long(argc, argv, short_options, long_options, NULL); if (ch == -1) break; switch (ch) { case 'c': /* * Option `-c file'. Specify the configuration file name. */ if (PATH_MAX < strlen(optarg)) { fprintf(stderr, "%s: too long configuration file name\n", invoked_name); goto die; } strcpy(configuration_file_name, optarg); if (canonicalize_file_name(configuration_file_name) < 0) goto die; break; case 'h': /* * Option `-h'. Help. */ output_help(); exit(0); case 'i': /* * Option `-i'. Inetd mode. */ server_mode = SERVER_MODE_INETD; break; case 't': /* * Option `-t'. Test mode. */ server_mode = SERVER_MODE_TEST; break; case 'v': /* * Option `-v'. Show version and exit immediately. */ output_version(); exit(0); default: output_try_help(); exit(1); } } /* * Check for the number of rest arguments. */ if (0 < argc - optind) { fprintf(stderr, "%s: too many arguments\n", invoked_name); output_try_help(); exit(1); } /* * Main routine for each server mode. */ switch (server_mode) { case SERVER_MODE_STANDALONE: for (;;) standalone_main(); break; case SERVER_MODE_INETD: inetd_main(); break; case SERVER_MODE_TEST: test_main(); break; } return 0; /* * A fatal error occurrs... */ die: if (server_mode == SERVER_MODE_STANDALONE) syslog(LOG_CRIT, "the server exits"); else if (server_mode == SERVER_MODE_INETD) syslog(LOG_INFO, "the server exits"); exit(1); } /* * Main routine for standalone mode. */ static void standalone_main() { #if defined(ENABLE_IPV6) struct sockaddr_storage address; #else struct sockaddr_in address; #endif socklen_t address_length; int fd; int pid = -1; fd_set select_files; int i; /* * Block signals. */ #if !defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSETMASK) signal_mask = 0; #endif block_signal(SIGHUP); block_signal(SIGINT); block_signal(SIGTERM); /* * Reset restart trigger. */ restart_trigger = 0; /* * Kill child processes. */ if (once_started) { #ifdef HAVE_KILLPG killpg(process_group_id, SIGINT); #else kill(-process_group_id, SIGINT); #endif syslog(LOG_DEBUG, "debug: kill all child processes"); } /* * Close unwanted files. */ if (!once_started) { closelog(); for (fd = get_open_max() - 1; 0 <= fd; fd--) close(fd); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif syslog(LOG_DEBUG, "debug: reopen syslog"); } /* * Re-initinalize variables. */ if (once_started) { finalize_global_variables(); initialize_global_variables(); } /* * Read a configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { syslog(LOG_ERR, "configuration failure"); goto die; } /* * Reopen syslog. */ closelog(); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif /* * Run as standalone daemon. */ if (!once_started) { if (daemonize() < 0) goto die; #ifdef GETPGRP_VOID process_group_id = getpgrp(); #else process_group_id = getpgrp(getpid()); #endif } /* * Change the current working directory. */ if (chdir(work_path) < 0) { syslog(LOG_ERR, "failed to change the directory, %s: %s", strerror(errno), work_path); goto die; } /* * Shutdown old connections if the server port is changed. */ if (once_started && listening_port != old_listening_port) { /* shutdown multi sockets */ if (shutdown_fdset(&listening_files, &max_listening_file, SHUT_RDWR) < 0) { syslog(LOG_ERR, "shutdown() failed, %s", strerror(errno)); goto die; } /* close multi sockets */ close_fdset(&listening_files, &max_listening_file); syslog(LOG_DEBUG, "debug: shutdown the old socket: %d/tcp", listening_port); } /* * Bind and listen to the server port. */ if (max_listening_file < 0) { if (set_server_ports(listening_port, LISTENING_BACKLOG, &listening_files, &max_listening_file) < 0) goto die; old_listening_port = listening_port; } /* * Set UID and GID. */ if (set_privilege(user_id, group_id) < 0) goto die; /* * Activate all books. */ if (activate_book_registry() == 0) syslog(LOG_ERR, "no book is available"); /* * Unlink an old PID file if exists. */ if (once_started) remove_pid_file(old_pid_file_name); strcpy(old_pid_file_name, pid_file_name); /* * Bind a ticket stock. */ if (max_clients != 0 && bind_ticket_stock(&connection_ticket_stock, connection_lock_file_name, max_clients) < 0) goto die; /* * Log pid to the file. */ if (log_pid_file(pid_file_name) < 0) goto die; /* * Set signal handlers. */ set_signal_handler(SIGBUS, abort_parent); set_signal_handler(SIGSEGV, abort_parent); set_signal_handler(SIGINT, SIG_IGN); set_signal_handler(SIGQUIT, SIG_IGN); set_signal_handler(SIGTERM, terminate_parent); set_signal_handler(SIGCHLD, wait_child); set_signal_handler(SIGHUP, restart_parent); /* * Set `once_started' flag. */ if (once_started) syslog(LOG_NOTICE, "server restarted"); else syslog(LOG_NOTICE, "server started"); once_started = 1; /* * Main loop for the parent process. */ for (;;) { /* * Unblock fatal signals. */ unblock_signal(SIGHUP); unblock_signal(SIGINT); unblock_signal(SIGTERM); unblock_signal(SIGCHLD); /* * Wait a connection from a client. */ if (wait_server_ports(&listening_files, &select_files, &max_listening_file) < 0) { if (errno != EINTR) { syslog(LOG_DEBUG, "failed to wait a connection, %s", strerror(errno)); goto die; } else if (restart_trigger) { return; } else { continue; } } /* * Block fatal signals. */ block_signal(SIGHUP); block_signal(SIGINT); block_signal(SIGTERM); block_signal(SIGCHLD); /* * Accept a connection. */ #if defined(ENABLE_IPV6) address_length = sizeof(struct sockaddr_storage); #else address_length = sizeof(struct sockaddr_in); #endif /* * TODO: nonblocking I/O (not yet) */ for (i = 0; i <= max_listening_file; i++) { if (FD_ISSET(i, &select_files)) { accepted_in_file = accept(i, (struct sockaddr *)&address, &address_length); accepted_out_file = accepted_in_file; if (accepted_in_file < 0) { syslog(LOG_ERR, "accept() failed, %s", strerror(errno)); continue; } syslog(LOG_DEBUG, "debug: accept the connection"); /* * Fork. The child process talk to the client. */ pid = fork(); if (pid < 0) { syslog(LOG_ERR, "fork() failed, %s", strerror(errno)); continue; } else if (pid == 0) { syslog(LOG_DEBUG, "debug: forked"); break; } /* * Close an accepted socket (at the parent process). */ if (close(accepted_in_file) < 0) { syslog(LOG_ERR, "close() failed, %s", strerror(errno)); goto die; } } } if (pid == 0) { break; } } /* * Set signal handlers. */ set_signal_handler(SIGBUS, abort_child); set_signal_handler(SIGSEGV, abort_child); set_signal_handler(SIGINT, terminate_child); set_signal_handler(SIGTERM, terminate_child); set_signal_handler(SIGCHLD, SIG_IGN); set_signal_handler(SIGHUP, terminate_child); set_signal_handler(SIGPIPE, SIG_IGN); /* * Unblock fatal signals. */ unblock_signal(SIGHUP); unblock_signal(SIGINT); unblock_signal(SIGTERM); unblock_signal(SIGCHLD); /* * Close the file to listen to the server port. */ close_fdset(&listening_files, &max_listening_file); /* * Get the client host name and address. */ if (identify_remote_host(accepted_in_file, client_host_name, client_address) < 0) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); shutdown(accepted_in_file, SHUT_RDWR); exit(1); } /* * Check for the access permission to the client. */ if (!test_permission(&permissions, client_host_name, client_address, match_wildcard)) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); shutdown(accepted_in_file, SHUT_RDWR); exit(0); } /* * Get a ticket for the client. */ if (max_clients != 0) { if (get_ticket(&connection_ticket_stock) < 0) { syslog(LOG_INFO, "full of clients"); shutdown(accepted_in_file, SHUT_RDWR); exit(0); } } syslog(LOG_INFO, "connected: host=%s(%s)", client_host_name, client_address); /* * Set book permissions to the current client. */ check_book_permissions(); /* * Communicate with the client. */ protocol_main(); shutdown(accepted_in_file, SHUT_RDWR); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); syslog(LOG_INFO, "the child server process exits"); exit(0); /* * A fatal error occurrs on a parent... */ die: shutdown_fdset(&listening_files, &max_listening_file, SHUT_RDWR); close_fdset(&listening_files, &max_listening_file); if (once_started) remove_pid_file(old_pid_file_name); if (once_started) { set_signal_handler(SIGINT, SIG_IGN); #ifdef HAVE_KILLPG killpg(process_group_id, SIGINT); #else kill(-process_group_id, SIGINT); #endif } finalize_global_variables(); eb_finalize_library(); syslog(LOG_CRIT, "the server exits"); exit(1); } /* * Main routine for inetd mode. */ static void inetd_main() { accepted_in_file = 0; accepted_out_file = 1; /* * Set signal handlers. */ set_signal_handler(SIGBUS, abort_parent); set_signal_handler(SIGSEGV, abort_parent); set_signal_handler(SIGINT, SIG_IGN); set_signal_handler(SIGQUIT, SIG_IGN); set_signal_handler(SIGTERM, terminate_parent); set_signal_handler(SIGHUP, terminate_parent); set_signal_handler(SIGPIPE, SIG_IGN); /* * Read a configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { syslog(LOG_ERR, "configuration failure"); goto die; } /* * Reopen syslog. */ closelog(); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif /* * Change the current working directory. */ if (chdir(work_path) < 0) { syslog(LOG_ERR, "failed to change the directory, %s: %s", strerror(errno), work_path); goto die; } /* * Set UID and GID. */ if (set_privilege(user_id, group_id) < 0) { syslog(LOG_ERR, "failed to set owner and group of the process"); goto die; } /* * Get the client host name and address. */ if (identify_remote_host(accepted_in_file, client_host_name, client_address) < 0) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); goto die; } /* * Check for the access permission to the client. */ if (!test_permission(&permissions, client_host_name, client_address, match_wildcard)) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); shutdown(accepted_in_file, SHUT_RDWR); exit(0); } /* * Get a ticket for the client. */ if (max_clients != 0) { bind_ticket_stock(&connection_ticket_stock, connection_lock_file_name, max_clients); if (get_ticket(&connection_ticket_stock) < 0) { syslog(LOG_INFO, "full of clients"); goto die; } } syslog(LOG_INFO, "connected: host=%s(%s)", client_host_name, client_address); /* * Activate all books. */ if (activate_book_registry() == 0) syslog(LOG_ERR, "no book is available"); /* * Check book permissions to the current client. */ check_book_permissions(); /* * Communicate with the client. */ protocol_main(); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); syslog(LOG_INFO, "the server exits"); exit(0); /* * A fatal error occurrs... */ die: fflush(stderr); shutdown(accepted_in_file, SHUT_RDWR); finalize_global_variables(); eb_finalize_library(); syslog(LOG_INFO, "the server exits"); exit(1); } /* * Main routine for inetd mode. */ static void test_main() { accepted_in_file = 0; accepted_out_file = 1; /* * Read a configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { fprintf(stderr, "configuration failure\n"); syslog(LOG_ERR, "configuration failure"); exit(1); } /* * Activate all books. */ if (activate_book_registry() == 0) syslog(LOG_ERR, "no book is available"); /* * Set dummy host name and address. */ strcpy(client_address, "test-mode"); if (isatty(0)) strncpy(client_host_name, ttyname(0), MAX_HOST_NAME_LENGTH); else strncpy(client_host_name, "stdin", MAX_HOST_NAME_LENGTH); *(client_host_name + MAX_HOST_NAME_LENGTH) = '\0'; idle_timeout = 0; /* * Reopen syslog. */ closelog(); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif syslog(LOG_INFO, "connected: host=%s(%s)", client_host_name, client_address); /* * Set book permissions. */ set_all_book_permissions(); /* * Communicate with the client. */ printf("# %s version %s\n", program_name, program_version); printf("# test mode\n"); fflush(stdout); protocol_main(); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); exit(0); } /* * Output usage to standard out. */ static void output_help() { printf("Usage: %s [option...]\n", program_name); printf("Options:\n"); printf(" -c FILE --configuration-file FILE\n"); printf(" specify a configuration file\n"); printf(" (default: %s)\n", DEFAULT_CONFIGURATION_FILE_NAME); printf(" -h --help display this help, then exit\n"); printf(" -i --inetd inetd mode\n"); printf(" -t --test test mode\n"); printf(" -v --version display version number, then exit\n"); printf("\nDefault value used in a configuration file:\n"); printf(" work-path %s\n", DEFAULT_WORK_PATH); printf("\nOptional feature:\n"); #ifdef ENABLE_IPV6 printf(" IPv6 support enabled\n"); #else printf(" IPv6 disabled\n\n"); #endif printf("\nReport bugs to %s.\n", MAILING_ADDRESS); fflush(stdout); } /* * Set a signal handler. * `signal' on some SystemV based systems is not reliable. * We use `sigaction' if available. */ static void set_signal_handler(signal_number, function) int signal_number; RETSIGTYPE (*function) EBNETD_P((int)); { #ifdef HAVE_SIGPROCMASK struct sigaction action; action.sa_handler = function; sigemptyset(&action.sa_mask); action.sa_flags = SA_NOCLDSTOP; if (signal_number == SIGALRM) { #ifdef SA_INTERRUPT action.sa_flags |= SA_INTERRUPT; #endif } else { #ifdef SA_RESTART action.sa_flags |= SA_RESTART; #endif } sigaction(signal_number, &action, NULL); #else /* not HAVE_SIGPROCMASK */ signal(signal_number, function); #endif /* not HAVE_SIGPROCMASK */ } /* * Block signals of `signal_number' type (SIGHUP, SIGINT, ...). * * `sigprocmask' is used, if available. * Otherwise, `sigsetmask' is used if the system has it. * If neither `sigprocmask' nor `sigsetmask' is available, we give up * blocking a signal. */ static void block_signal(signal_number) int signal_number; { #ifdef HAVE_SIGPROCMASK sigset_t signal_set; #endif #ifdef HAVE_SIGPROCMASK sigemptyset(&signal_set); sigaddset(&signal_set, signal_number); sigprocmask(SIG_BLOCK, &signal_set, NULL); #else /* not HAVE_SIGPROCMASK */ #ifdef HAVE_SIGSETMASK signal_mask |= sigmask(signal_number); sigsetmask(signal_mask); #endif /* HAVE_SIGSETMASK */ #endif /* not HAVE_SIGPROCMASK */ } /* * Block signals of `signal_number' type (SIGHUP, SIGINT, ...). * * `sigprocmask' is used, if available. * Otherwise, `sigsetmask' is used if the system has it. * If neither `sigprocmask' nor `sigsetmask' is available, we give up * blocking a signal. */ static void unblock_signal(signal_number) int signal_number; { #ifdef HAVE_SIGPROCMASK sigset_t signal_set; #endif #ifdef HAVE_SIGPROCMASK sigemptyset(&signal_set); sigaddset(&signal_set, signal_number); sigprocmask (SIG_UNBLOCK, &signal_set, NULL); #else /* not HAVE_SIGPROCMASK */ #ifdef HAVE_SIGSETMASK signal_mask = (signal_mask | sigmask(signal_number)) ^ sigmask(signal_number); sigsetmask(signal_mask); #endif /* HAVE_SIGSETMASK */ #endif /* not HAVE_SIGPROCMASK */ } /* * Signal handler for SIGBUS and SIGSEGV. (for parent) */ static RETSIGTYPE abort_parent(signal_number) int signal_number; { if (server_mode == SERVER_MODE_STANDALONE) { syslog(LOG_CRIT, "the server process aborts, receives SIG%s", signal_name(signal_number)); } else { syslog(LOG_ERR, "the server process aborts, receives SIG%s", signal_name(signal_number)); } abort(); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGBUS and SIGSEGV. (for child) */ static RETSIGTYPE abort_child(signal_number) int signal_number; { syslog(LOG_ERR, "the child server process aborts, receives SIG%s", signal_name(signal_number)); abort(); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGTERM, SIGINT SIGQUIT, and SIGHUP. (for parent) */ static RETSIGTYPE terminate_parent(signal_number) int signal_number; { if (server_mode == SERVER_MODE_STANDALONE) { syslog(LOG_CRIT, "the server process exits, receives SIG%s", signal_name(signal_number)); } else { syslog(LOG_ERR, "the server process exits, receives SIG%s", signal_name(signal_number)); } /* * Kill child processes. */ set_signal_handler(SIGINT, SIG_IGN); if (server_mode == SERVER_MODE_STANDALONE) { #ifdef HAVE_KILLPG killpg(process_group_id, SIGINT); #else kill(-process_group_id, SIGINT); #endif } /* * Shutdown a server port. */ shutdown_fdset(&listening_files, &max_listening_file, SHUT_RDWR); close_fdset(&listening_files, &max_listening_file); /* * Remove a PID file. */ if (server_mode == SERVER_MODE_STANDALONE) remove_pid_file(old_pid_file_name); _exit(1); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGHUP, SIGINT, SIGQUIT and SIGTERM. (for child) */ static RETSIGTYPE terminate_child(signal_number) int signal_number; { syslog(LOG_ERR, "the child server process exits, receives SIG%s", signal_name(signal_number)); shutdown(accepted_in_file, SHUT_RDWR); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); _exit(0); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGCHLD. */ static RETSIGTYPE wait_child(signal_number) int signal_number; { #ifdef HAVE_UNION_WAIT union wait status; #else int status; #endif syslog(LOG_INFO, "receives SIGCHLD"); #ifdef HAVE_WAITPID while (0 < waitpid(-1, &status, WNOHANG)) ; #else /* not HAVE WAITPID */ while (0 < wait3(&status, WNOHANG, NULL)) ; #endif /* not HAVE WAITPID */ /* * Set a signal handler again. */ set_signal_handler(SIGCHLD, wait_child); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGHUP (for parent). */ static RETSIGTYPE restart_parent(signal_number) int signal_number; { syslog(LOG_ERR, "the server restart, receives SIGHUP"); restart_trigger++; #ifndef RETSIGTYPE_VOID return 0; #endif } ebnetd-1.0.dfsg.1/ebnetd/getopt_long.pl0000644000175000017500000002430007673055356017350 0ustar mhattamhatta# -*- Perl -*- # Copyright (c) 1997, 98, 2000, 01 # Motoyuki Kasahara # # This program 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, or (at your option) # any later version. # # This program 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. # # This program is a Perl package running on Perl 4.036 or later. # The package provides routines to process command line options like # as GNU getopt_long(). # # Version: # 2.0.2 # # Interface: # # &getopt_initialize(LIST) # Set a list of command line options and initialize internal data # for &getopt_long. # You must call the routine before calling &getopt_long. # Format of each element in the LIST is: # # `CANONICAL-OPTION-NAME [ALIAS-OPTION-NAME...] ARGUMENT-FLAG' # # CANONICAL-OPTION-NAME, ALIAS-OPTION-NAME and ARGUMENT-FLAG fields # are separated by spaces or tabs. # # CANONICAL-OPTION-NAME and ALIAS-OPTION-NAME must be either a single # character option including preceding `-' (e.g. `-v'), or a long # name option including preceding `--' (e.g. `--version'). Whether # CANONICAL-OPTION-NAME is single character option or long name # option is not significant. # # ARGUMENT-FLAG must be `no-argument', `required-argument' or # `optional-argument'. If it is set to `required-argument', the # option always takes an argument. If set to `optional-argument', # an argument to the option is optional. # # You can put a special element `+' or `-' at the first element in # LIST. See `Details about Option Processing:' for details. # If succeeded to initialize, 1 is returned. Otherwise 0 is # returned. # # &getopt_long # Get a option name, and if exists, its argument of the leftmost # option in @ARGV. # # An option name and its argument are returned as a list with two # elements; the first element is CANONICAL-OPTION-NAME of the option, # and second is its argument. # Upon return, the option and its argument are removed from @ARGV. # When you have already got all options in @ARGV, an empty list is # returned. In this case, only non-option elements are left in # @ARGV. # # When an error occurs, an error message is output to standard # error, and the option name in a returned list is set to `?'. # # Example: # # &getopt_intialize('--help -h no-argument', '--version -v no-argument') # || die; # # while (($name, $arg) = &getopt_long) { # die "For help, type \`$0 --help\'\n" if ($name eq '?'); # $opts{$name} = $arg; # } # # Details about Option Processing: # # * There are three processing modes: # 1. PERMUTE # It permutes the contents of ARGV as it scans, so that all the # non-option ARGV-elements are at the end. This mode is default. # 2. REQUIRE_ORDER # It stops option processing when the first non-option is seen. # This mode is chosen if the environment variable POSIXLY_CORRECT # is defined, or the first element in the option list is `+'. # 3. RETURN_IN_ORDER # It describes each non-option ARGV-element as if it were the # argument of an option with an empty name. # This mode is chosen if the first element in the option list is # `-'. # # * An argument starting with `-' and not exactly `-', is a single # character option. # If the option takes an argument, it must be specified at just # behind the option name (e.g. `-f/tmp/file'), or at the next # ARGV-element of the option name (e.g. `-f /tmp/file'). # If the option doesn't have an argument, other single character # options can be followed within an ARGV-element. For example, # `-l -g -d' is identical to `-lgd'. # # * An argument starting with `--' and not exactly `--', is a long # name option. # If the option has an argument, it can be specified at behind the # option name preceded by `=' (e.g. `--option=argument'), or at the # next ARGV-element of the option name (e.g. `--option argument'). # Long name options can be abbreviated as long as the abbreviation # is unique. # # * The special argument `--' forces an end of option processing. # { package getopt_long; $initflag = 0; $REQUIRE_ORDER = 0; $PERMUTE = 1; $RETURN_IN_ORDER = 2; } # # Initialize the internal data. # sub getopt_initialize { local(@fields); local($name, $flag, $canon); local($_); # # Determine odering. # if ($_[$[] eq '+') { $getopt_long'ordering = $getopt_long'REQUIRE_ORDER; shift(@_); } elsif ($_[$[] eq '-') { $getopt_long'ordering = $getopt_long'RETURN_IN_ORDER; shift(@_); } elsif (defined($ENV{'POSIXLY_CORRECT'})) { $getopt_long'ordering = $getopt_long'REQUIRE_ORDER; } else { $getopt_long'ordering = $getopt_long'PERMUTE; } # # Parse an option list. # %getopt_long'optnames = (); %getopt_long'argflags = (); foreach (@_) { @fields = split(/[ \t]+/, $_); if (@fields < 2) { warn "$0: (getopt_initialize) too few fields \`$arg\'\n"; return 0; } $flag = pop(@fields); if ($flag ne 'no-argument' && $flag ne 'required-argument' && $flag ne 'optional-argument') { warn "$0: (getopt_initialize) invalid argument flag \`$flag\'\n"; return 0; } $canon = ''; foreach $name (@fields) { if ($name !~ /^-([^-]|-.+)$/) { warn "$0: (getopt_initialize) invalid option name \`$name\'\n"; return 0; } elsif (defined($getopt_long'optnames{$name})) { warn "$0: (getopt_initialize) redefined option \`$name\'\n"; return 0; } $canon = $name if ($canon eq ''); $getopt_long'optnames{$name} = $canon; $getopt_long'argflags{$name} = $flag; } } $getopt_long'endflag = 0; $getopt_long'shortrest = ''; @getopt_long'nonopts = (); $getopt_long'initflag = 1; } # # When it comes to the end of options, restore PERMUTEd non-option # arguments to @ARGV. # sub getopt_end { $getopt_long'endflag = 1; unshift(@ARGV, @getopt_long'nonopts); } # # Scan elements of @ARGV for getting an option. # sub getopt_long { local($name, $arg) = ('?', ''); local($key, $pattern, $match_count, $ch); local($_); &getopt_initialize(@_) if (!$getopt_long'initflag); return () if ($getopt_long'endflag); # # Get next option argument. # if ($getopt_long'shortrest ne '') { $_ = '-'.$getopt_long'shortrest; } elsif (@ARGV == 0) { &getopt_end; return (); } elsif ($getopt_long'ordering == $getopt_long'PERMUTE) { while (0 < @ARGV && $ARGV[$[] !~ /^-./) { push(@getopt_long'nonopts, shift(@ARGV)); } if (@ARGV == 0) { &getopt_end; return (); } $_ = shift(@ARGV); } elsif ($getopt_long'ordering == $getopt_long'REQUIRE_ORDER) { $_ = shift(@ARGV); if (!/^-./) { push(@getopt_long'nonopts, $_); &getopt_end; return (); } } else { # $getopt_long'ordering == RETURN_IN_ORDER $_ = shift(@ARGV); } # # Check the special argument `--'. # `--' indicates the end of the option list. # if ($_ eq '--' && $getopt_long'shortrest eq '') { # # `--' indicates the end of the option list. # &getopt_end; return (); } # # Check for long and short options. # if (/^(--[^=]+)/ && $getopt_long'shortrest eq '') { # # This is a long style option, which start with `--'. # $pattern = $1; if (defined($getopt_long'optnames{$pattern})) { $name = $pattern; } else { # # The option `name' is not registered in `@optnames'. # It may be an abbreviated # $match_count = 0; foreach $key (keys(%getopt_long'optnames)) { if (index($key, $pattern) == 0) { $name = $key; $match_count++; } } if (2 <= $match_count) { warn "$0: option \`$_\' is ambiguous\n"; return ('?', ''); } elsif ($match_count == 0) { warn "$0: unrecognized option \`$_\'\n"; return ('?', ''); } } # # Check an argument to the option. # if ($getopt_long'argflags{$name} eq 'required-argument') { if (/=(.*)$/) { $arg = $1; } elsif (0 < @ARGV) { $arg = shift(@ARGV); } else { warn "$0: option \`$_\' requires an argument\n"; return ('?', ''); } } elsif ($getopt_long'argflags{$name} eq 'optional-argument') { if (/=(.*)$/) { $arg = $1; } elsif (0 < @ARGV && $ARGV[$[] !~ /^-./) { $arg = shift(@ARGV); } else { $arg = ''; } } elsif (/=(.*)$/) { warn "$0: option \`$name\' doesn't allow an argument\n"; return ('?', ''); } } elsif (/^(-(.))(.*)/) { # # This is a short style option, which start with `-' (not `--'). # Short options may be catinated (e.g. `-l -g' is equivalent to # `-lg'). # ($name, $ch, $getopt_long'shortrest) = ($1, $2, $3); if (defined($getopt_long'optnames{$name})) { # # The option `name' is found in `@optnames'. # Check its argument. # if ($getopt_long'argflags{$name} eq 'required-argument') { if ($getopt_long'shortrest ne '') { $arg = $getopt_long'shortrest; $getopt_long'shortrest = ''; } elsif (0 < @ARGV) { $arg = shift(@ARGV); } else { # 1003.2 specifies the format of this message. warn "$0: option requires an argument -- $ch\n"; return ('?', ''); } } elsif ($getopt_long'argflags{$name} eq 'optional-argument') { if ($getopt_long'shortrest ne '') { $arg = $getopt_long'shortrest; $getopt_long'shortrest = ''; } elsif (0 < @ARGV && $ARGV[$[] !~ /^-./) { $arg = shift(@ARGV); } else { $arg = ''; } } } else { # # This is an invalid option. # 1003.2 specifies the format of this message. # if (defined($ENV{'POSIXLY_CORRECT'})) { warn "$0: illegal option -- $ch\n"; return ('?', ''); } else { warn "$0: invalid option -- $ch\n"; return ('?', ''); } } } else { # # This is a non-option argument. # Only RETURN_IN_ORDER falled into here. # return ('', $_); } return ($getopt_long'optnames{$name}, $arg); } 1; ebnetd-1.0.dfsg.1/ebnetd/global.c0000644000175000017500000001030707673055353016075 0ustar mhattamhatta/* * Copyright (c) 1997, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef TIME_WITH_SYS_TIME #include #include #else /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ #if defined(NDTPD) || defined(EBHTTPD) #include #endif #if defined(EBNETD) #include "ebtiny/eb.h" #endif #include "confutil.h" #include "hostname.h" #include "linebuf.h" #include "permission.h" #include "defs.h" /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ /* * Actual program name (argv[0]). */ const char *invoked_name; /* * Generic name of the program. */ const char *program_name; /* * Program version. */ const char *program_version; /* * Path to a working directory. */ char work_path[PATH_MAX + 1]; /* * Configuration file name. */ char configuration_file_name[PATH_MAX + 1]; /* * Port number the server listens to. */ in_port_t listening_port; in_port_t old_listening_port; /* * File descriptors for the server to listen to the port. */ fd_set listening_files; int max_listening_file; /* * File descriptor to communicate with a client. */ int accepted_in_file; int accepted_out_file; /* * User ID of the server process. */ uid_t user_id; /* * Group ID of the server process. */ gid_t group_id; /* * Filename to log the process ID of the server. */ char pid_file_name[PATH_MAX + 1]; char old_pid_file_name[PATH_MAX + 1]; /* * Lock file_name and ticket stock to count connections to the server. */ char connection_lock_file_name[PATH_MAX + 1]; Ticket_Stock connection_ticket_stock; /* * The maximum number of connections to the server at once. */ int max_clients; /* * The number of the current connections. */ int connection_count; /* * Seconds the server closes an idle connection. */ int idle_timeout; /* * Host permission list. */ Permission permissions; /* * Book registry. */ Book *book_registry; int book_count; /* * The number of hit entries the server give up searching. */ int max_hits; /* * The maximum size of text the server may send as a response to a client. */ size_t max_text_size; /* * Hostname of the client. */ char client_host_name[MAX_HOST_NAME_LENGTH + 1]; /* * Address of the client. */ char client_address[MAX_HOST_NAME_LENGTH + 1]; /* * Running mode of the server. * (standalone, inetd, test, check or control) */ int server_mode; /* * Syslog facility. */ int syslog_facility; /* * Client sockaddr */ #if defined(ENABLE_IPV6) struct sockaddr_storage client_sockaddr; #else struct sockaddr_in client_sockaddr; #endif /* * Initialize global variables. */ int initialize_global_variables() { initialize_permission(&permissions); initialize_ticket_stock(&connection_ticket_stock); initialize_book_registry(); user_id = getuid(); group_id = getgid(); max_clients = DEFAULT_MAX_CLIENTS; idle_timeout = DEFAULT_IDLE_TIMEOUT; max_hits = DEFAULT_MAX_HITS; max_text_size = DEFAULT_MAX_TEXT_SIZE; if (parse_tcp_port(SERVICE_NAME, &listening_port) < 0) listening_port = DEFAULT_PORT; return 0; } /* * Finalize global variables. */ void finalize_global_variables() { finalize_permission(&permissions); finalize_ticket_stock(&connection_ticket_stock); finalize_book_registry(); } ebnetd-1.0.dfsg.1/ebnetd/misc.c0000644000175000017500000000212607673055357015574 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01, 02 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "defs.h" /* * Output the version number to standard out. */ void output_version() { printf("%s (EBNETD) version %s\n", program_name, program_version); printf("Copyright (c) 1997 - 2003\n"); printf(" Motoyuki Kasahara\n"); fflush(stdout); } /* * Output ``try ...'' message to standard error. */ void output_try_help() { fprintf(stderr, "try `%s --help' for more information\n", invoked_name); fflush(stderr); } ebnetd-1.0.dfsg.1/ebnetd/ebnet.c0000644000175000017500000010042407733271564015733 0ustar mhattamhatta/* * Copyright) 2003 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_FCNTL_H #include #else #include #endif #if HAVE_DIRENT_H #include #define NAMLEN(dirent) strlen((dirent)->d_name) #else /* not HAVE_DIRENT_H */ #define dirent direct #define NAMLEN(dirent) (dirent)->d_namlen #if HAVE_SYS_NDIR_H #include #endif /* HAVE_SYS_NDIR_H */ #if HAVE_SYS_DIR_H #include #endif /* HAVE_SYS_DIR_H */ #if HAVE_NDIR_H #include #endif /* HAVE_NDIR_H */ #endif /* not HAVE_DIRENT_H */ #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif #ifndef HAVE_STRTOL #ifdef __STDC__ long strtol(const char *, char **, int); #else /* not __STDC__ */ long strtol(); #endif /* not __STDC__ */ #endif /* not HAVE_STRTOL */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) #include "defs.h" #include "fakelog.h" #include "fdcache.h" #include "ioall.h" #include "linebuf.h" #include "ticket.h" #include "ebtiny/eb.h" #include "ebtiny/error.h" /* * Maximum length of a line. */ #define EBNET_MAX_LINE_LENGTH 511 /* * The maximum number of arguments in a line. */ #define EBNET_MAX_LINE_ARGUMENTS 5 /* * The maximum length of the argument. */ #define EBNET_MAX_PATH_LENGTH 33 /* * The maximum length of the argument. */ #define EBNET_MAX_READ_LENGTH 65536 /* * Suffix for appendix. */ #define EBNET_APPENDIX_SUFFIX "app" /* * The maximum number of file descriptors to be cached. */ #define EBNET_MAX_FDCACHE 20 /* * Error codes. */ typedef int EBNet_Error_Code; #define EBNET_ERROR_OK 0 #define EBNET_ERROR_FAIL_OPEN_FILE 1 #define EBNET_ERROR_FAIL_SEEK_FILE 2 #define EBNET_ERROR_FAIL_READ_FILE 3 #define EBNET_ERROR_BAD_BOOK_NAME 4 #define EBNET_ERROR_BAD_READ_LENGTH 5 #define EBNET_ERROR_BAD_READ_OFFSET 6 #define EBNET_ERROR_BAD_PATH 7 #define EBNET_ERROR_BAD_SUBBOOK_NAME 8 #define EBNET_ERROR_NO_APPENDIX 10 #define EBNET_ERROR_BUSY 11 #define EBNET_ERROR_NO_PERMISSION 12 /* * Error response categories for the error codes. */ static const char *error_categories[] = { "OK", "ERROR", "ERROR", "ERROR", "ERROR", "ERROR", "ERROR", "ERROR", "ERROR", "ERROR", "BUSY", "DENY" }; /* * Error descriptions for the error codes. */ static const char *error_messages[] = { "accepted", "failed to open the file", "failed to seek the file", "failed to read the file", "invalid book name", "invalid read length", "invalid read offset", "invalid file or directory name", "invalid subbook name", "the book doesn't have appendix", "full of clients", "permission denied" }; /* * Book name type -- book or appendix. */ typedef int EBNet_Content_Type; #define EBNET_CONTENT_TYPE_BOOK 0 #define EBNET_CONTENT_TYPE_APPENDIX 1 /* * Pointer to data buffer for the READ command. * * For efficiency, we prepare buffer for the READ command statically. * Memory allocation to `read_buffer' is done by protocol_main(). */ static char *read_buffer = NULL; /* * File descriptor cache for the READ command. */ static FDCache_Table fdcache_table; /* * Unexported functions. */ static void split_line EBNETD_P((char *, int, int *, char *[])); static int command_booklist EBNETD_P((int, char *[])); static int command_book EBNETD_P((int, char *[])); static int command_dir EBNETD_P((int, char *[])); static int command_file EBNETD_P((int, char *[])); static int command_filesize EBNETD_P((int, char *[])); static int command_read EBNETD_P((int, char *[])); static EBNet_Error_Code parse_and_check_book_name EBNETD_P((const char *, Book **, EBNet_Content_Type *)); static EBNet_Error_Code check_file_path EBNETD_P((Book *, EBNet_Content_Type, const char *)); static EBNet_Error_Code check_directory_path EBNETD_P((Book *, EBNet_Content_Type, const char *)); static EBNet_Error_Code check_path_parent_directory EBNETD_P((const char *)); static EBNet_Error_Code check_subbook_name EBNETD_P((Book *, EBNet_Content_Type, const char *)); static EBNet_Error_Code check_root_file_name EBNETD_P((const char *)); static void truncate_string EBNETD_P((char *, size_t)); /* * EBNet command table. * Note that the "QUIT" command is not listed here. */ typedef struct { char *name; int (*function) EBNETD_P((int, char *[])); int argument_count; } EBNet_Command; static const EBNet_Command ebnet_commands[] = { {"BOOKLIST", command_booklist, 1}, {"BOOK", command_book, 2}, {"DIR", command_dir, 4}, {"FILE", command_file, 4}, {"FILESIZE", command_filesize, 3}, {"READ", command_read, 5}, {NULL, NULL, 0} }; /* * Communicate with a client by EBNet. */ int protocol_main() { Line_Buffer line_buffer; char line[EBNET_MAX_LINE_LENGTH + 1]; ssize_t line_length; char *arguments[EBNET_MAX_LINE_ARGUMENTS + 2]; int argument_count; const EBNet_Command *command; fdcache_initialize_table(&fdcache_table, O_RDONLY); fdcache_set_max_entry_count(&fdcache_table, EBNET_MAX_FDCACHE); initialize_line_buffer(&line_buffer); bind_file_to_line_buffer(&line_buffer, accepted_in_file); set_line_buffer_timeout(&line_buffer, idle_timeout); /* * Initialize `read_buffer'. */ read_buffer = malloc(EBNET_MAX_READ_LENGTH); if (read_buffer == NULL) { syslog(LOG_ERR, "memory exhausted"); goto die; } for (;;) { /* * Read a line received from the client. */ line_length = read_line_buffer(&line_buffer, line, EBNET_MAX_LINE_LENGTH); if (line_length < 0) goto die; else if (line_length == 0) continue; /* * Check for the line length. */ if (EBNET_MAX_LINE_LENGTH <= line_length) { if (skip_line_buffer(&line_buffer) < 0) goto die; *(line + 30) = '\0'; syslog(LOG_INFO, "too long request line: line=%s..., host=%s(%s)", line, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "!ERROR; too long request line\r\n") <= 0) { goto die; } continue; } syslog(LOG_DEBUG, "debug: received line: %s", line); /* * Split the request line into an array of arguments. */ split_line(line, EBNET_MAX_LINE_ARGUMENTS + 1, &argument_count, arguments); if (argument_count == 0) continue; if (strcasecmp(arguments[0], "QUIT") == 0) break; /* * Scan the command table. */ for (command = ebnet_commands; command->name != NULL; command++) { if (strcasecmp(command->name, arguments[0]) == 0) break; } if (command->name == NULL) { syslog(LOG_INFO, "invalid command: cmd=%s, host=%s(%s)", arguments[0], client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "!ERROR; invalid command\r\n") <= 0) { syslog(LOG_INFO, "failed to send message: host=%s(%s)", client_host_name, client_address); goto die; } continue; } /* * Check the number of arguments to the command. */ if (argument_count != command->argument_count) { syslog(LOG_INFO, "the wrong number of arguments: cmd=%s, host=%s(%s)", command->name, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "!ERROR; the wrong number of arguments\r\n") <= 0) { syslog(LOG_INFO, "failed to send message: host=%s(%s)", client_host_name, client_address); goto die; } continue; } /* * Dispatch. */ if ((command->function)(argument_count, arguments) < 0) { syslog(LOG_INFO, "failed to send message: host=%s(%s)", client_host_name, client_address); goto die; } } free(read_buffer); read_buffer = NULL; fdcache_finalize_table(&fdcache_table); finalize_line_buffer(&line_buffer); return 0; die: if (read_buffer != NULL) { free(read_buffer); read_buffer = NULL; } fdcache_finalize_table(&fdcache_table); finalize_line_buffer(&line_buffer); return -1; } /* * Split a request line into an array of arguments. * * Each argument is separated by a tab or a space. `line' is a request * line. The function splits no more than `max_argument_count' arguments. * The result is put into `arguments[]' as an array of arguments, and the * length of the array is put into `*argument_count'. */ static void split_line(line, max_argument_count, argument_count, arguments) char *line; int max_argument_count; int *argument_count; char *arguments[]; { char *p = line; int i; i = 0; for (;;) { while (*p == ' ' || *p == '\t') p++; if (*p == '\0' || max_argument_count <= i) break; arguments[i++] = p++; while (*p != ' ' && *p != '\t' && *p != '\0') p++; if (*p != '\0') *p++ = '\0'; } arguments[i] = NULL; *argument_count = i; } /* * Perform the BOOKLIST command. * * Syntax: * BOOKLIST */ static int command_booklist(argument_count, arguments) int argument_count; char *arguments[]; { Book *book; char message[MAX_BOOK_NAME_LENGTH + MAX_BOOK_TITLE_LENGTH + 8]; syslog(LOG_INFO, "%s: cmd=BOOKLIST, host=%s(%s)", "ok", client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "!OK; book names and an empty line follows\r\n") <= 0) return -1; for (book = book_registry; book != NULL; book = book->next) { if (!book->permission_flag) continue; sprintf(message, "%s %s\r\n", book->name, book->title); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; if (book->appendix_path != NULL) { sprintf(message, "%s.app %s\r\n", book->name, book->title); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) { return -1; } } } if (write_string_all(accepted_out_file, idle_timeout, "\r\n") <= 0) return -1; return 0; } /* * Perform the BOOK command. * * Syntax: * BOOK */ static int command_book(argument_count, arguments) int argument_count; char *arguments[]; { Book *book; EBNet_Content_Type content_type; char message[EBNET_MAX_LINE_LENGTH + 1]; EBNet_Error_Code error_code; /* * Parse and check arguments. */ error_code = parse_and_check_book_name(arguments[1], &book, &content_type); if (error_code != EBNET_ERROR_OK) goto error; /* * Get a ticket to access the book. */ if (book->max_clients != 0 && get_ticket(&book->ticket_stock) < 0) { error_code = EBNET_ERROR_BUSY; goto error; } /* * Send a response message. */ syslog(LOG_INFO, "%s: cmd=BOOK, book=%s, host=%s(%s)", "ok", arguments[1], client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "!OK; accepted\r\n") <= 0) return -1; return 0; /* * An error occurs... */ error: /* +4 for ".app" */ truncate_string(arguments[1], MAX_BOOK_NAME_LENGTH + 4); syslog(LOG_INFO, "%s: cmd=BOOK, book=%s, host=%s(%s)", error_messages[error_code], arguments[1], client_host_name, client_address); sprintf(message, "!%s; %s\r\n", error_categories[error_code], error_messages[error_code]); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; return 0; } /* * Perform the DIR command. * * Syntax: * DIR */ static int command_dir(argument_count, arguments) int argument_count; char *arguments[]; { Book *book; char absolute_path[PATH_MAX + 1]; EBNet_Content_Type content_type; const char *prefix; char actual_directory_name[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; char message[EBNET_MAX_LINE_LENGTH + 1]; EBNet_Error_Code error_code; /* * Parse and check arguments. */ error_code = parse_and_check_book_name(arguments[1], &book, &content_type); if (error_code != EBNET_ERROR_OK) goto error; error_code = check_directory_path(book, content_type, arguments[2]); if (error_code != EBNET_ERROR_OK) goto error; if (EB_MAX_DIRECTORY_NAME_LENGTH < strlen(arguments[3])) { error_code = EBNET_ERROR_BAD_PATH; goto error; } if (strcmp(arguments[2], "/") == 0) { error_code = check_subbook_name(book, content_type, arguments[3]); if (error_code != EBNET_ERROR_OK) goto error; } else { error_code = check_path_parent_directory(arguments[3]); if (error_code != EBNET_ERROR_OK) goto error; } /* * Get an actual directory name. */ if (content_type == EBNET_CONTENT_TYPE_BOOK) prefix = book->path; else prefix = book->appendix_path; if (PATH_MAX < strlen(prefix) + 1 + strlen(arguments[2])) { error_code = EBNET_ERROR_BAD_PATH; goto error; } sprintf(absolute_path, "%s%s", prefix, arguments[2]); strcpy(actual_directory_name, arguments[3]); if (eb_fix_directory_name(absolute_path, actual_directory_name) != EB_SUCCESS) { error_code = EBNET_ERROR_BAD_PATH; goto error; } /* * Send a response message. */ syslog(LOG_INFO, "%s: cmd=DIR, book=%s, path=%s, dir=%s, host=%s(%s)", "ok", arguments[1], arguments[2], arguments[3], client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "!OK; actual directory name follows\r\n") <= 0) return -1; if (write_string_all(accepted_out_file, idle_timeout, actual_directory_name) <= 0) return -1; if (write_string_all(accepted_out_file, idle_timeout, "\r\n") <= 0) return -1; return 0; /* * An error occurs... */ error: /* +4 for ".app" */ truncate_string(arguments[1], MAX_BOOK_NAME_LENGTH + 4); truncate_string(arguments[2], EBNET_MAX_PATH_LENGTH); truncate_string(arguments[3], EB_MAX_DIRECTORY_NAME_LENGTH); syslog(LOG_INFO, "%s: cmd=DIR, book=%s, path=%s, dir=%s, host=%s(%s)", error_messages[error_code], arguments[1], arguments[2], arguments[3], client_host_name, client_address); sprintf(message, "!%s; %s\r\n", error_categories[error_code], error_messages[error_code]); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; return 0; } /* * Perform the FILE command. * * Syntax: * FILE */ static int command_file(argument_count, arguments) int argument_count; char *arguments[]; { Book *book; char absolute_path[PATH_MAX + 1]; EBNet_Content_Type content_type; const char *prefix; char actual_file_name[EB_MAX_FILE_NAME_LENGTH + 1]; char message[EBNET_MAX_LINE_LENGTH + 1]; EBNet_Error_Code error_code; /* * Check arguments. */ error_code = parse_and_check_book_name(arguments[1], &book, &content_type); if (error_code != EBNET_ERROR_OK) goto error; error_code = check_directory_path(book, content_type, arguments[2]); if (error_code != EBNET_ERROR_OK) goto error; if (EB_MAX_FILE_NAME_LENGTH < strlen(arguments[3])) { error_code = EBNET_ERROR_BAD_PATH; goto error; } if (strcmp(arguments[2], "/") == 0) { error_code = check_root_file_name(arguments[3]); if (error_code != EBNET_ERROR_OK) goto error; } else { error_code = check_path_parent_directory(arguments[3]); if (error_code != EBNET_ERROR_OK) goto error; } /* * Get an actual file name. */ if (content_type == EBNET_CONTENT_TYPE_BOOK) prefix = book->path; else prefix = book->appendix_path; if (PATH_MAX < strlen(prefix) + 1 + strlen(arguments[2])) { error_code = EBNET_ERROR_BAD_PATH; goto error; } sprintf(absolute_path, "%s%s", prefix, arguments[2]); if (eb_find_file_name(absolute_path, arguments[3], actual_file_name) != EB_SUCCESS) { error_code = EBNET_ERROR_BAD_PATH; goto error; } /* * Send a response message. */ syslog(LOG_INFO, "%s: cmd=FILE, book=%s, path=%s, file=%s, host=%s(%s)", "ok", arguments[1], arguments[2], arguments[3], client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "!OK; actual file name follows\r\n") <= 0) return -1; if (write_string_all(accepted_out_file, idle_timeout, actual_file_name) <= 0) return -1; if (write_string_all(accepted_out_file, idle_timeout, "\r\n") <= 0) return -1; return 0; /* * An error occurs... */ error: /* +4 for ".app" */ truncate_string(arguments[1], MAX_BOOK_NAME_LENGTH + 4); truncate_string(arguments[2], EBNET_MAX_PATH_LENGTH); truncate_string(arguments[3], EB_MAX_FILE_NAME_LENGTH); syslog(LOG_INFO, "%s: cmd=FILE, book=%s, path=%s, file=%s, host=%s(%s)", error_messages[error_code], arguments[1], arguments[2], arguments[3], client_host_name, client_address); sprintf(message, "!%s; %s\r\n", error_categories[error_code], error_messages[error_code]); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; return 0; } /* * Perform the FILESIZE command. * * Syntax: * FILESIZE */ static int command_filesize(argument_count, arguments) int argument_count; char *arguments[]; { Book *book; char absolute_path[PATH_MAX + 1]; EBNet_Content_Type content_type; const char *prefix; char message[EBNET_MAX_LINE_LENGTH + 1]; EBNet_Error_Code error_code; struct stat st; /* * Check arguments. */ error_code = parse_and_check_book_name(arguments[1], &book, &content_type); if (error_code != EBNET_ERROR_OK) goto error; error_code = check_file_path(book, content_type, arguments[2]); if (error_code != EBNET_ERROR_OK) goto error; /* * Get an actual file name. */ if (content_type == EBNET_CONTENT_TYPE_BOOK) prefix = book->path; else prefix = book->appendix_path; if (PATH_MAX < strlen(prefix) + 1 + strlen(arguments[2])) { error_code = EBNET_ERROR_BAD_PATH; goto error; } sprintf(absolute_path, "%s%s", prefix, arguments[2]); /* * Get file size. */ if (stat(absolute_path, &st) < 0 || (st.st_mode & S_IFMT) != S_IFREG) { error_code = EBNET_ERROR_BAD_PATH; goto error; } /* * Send a response message. */ syslog(LOG_INFO, "%s: cmd=FILESIZE, book=%s, path=%s, host=%s(%s)", "ok", arguments[1], arguments[2], client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "!OK; file size follows\r\n") <= 0) return -1; sprintf(message, "%ld\r\n", (long)st.st_size); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; return 0; /* * An error occurs... */ error: /* +4 for ".app" */ truncate_string(arguments[1], MAX_BOOK_NAME_LENGTH + 4); truncate_string(arguments[2], EBNET_MAX_PATH_LENGTH); syslog(LOG_INFO, "%s: cmd=FILESIZE, book=%s, path=%s, host=%s(%s)", error_messages[error_code], arguments[1], arguments[2], client_host_name, client_address); sprintf(message, "!%s; %s\r\n", error_categories[error_code], error_messages[error_code]); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; return 0; } /* * Perform the READ command. * * Syntax: * READ */ static int command_read(argument_count, arguments) int argument_count; char *arguments[]; { Book *book; char absolute_path[PATH_MAX + 1]; EBNet_Content_Type content_type; const char *prefix; char message[EBNET_MAX_LINE_LENGTH + 1]; EBNet_Error_Code error_code; off_t offset; ssize_t data_length; char *end_p; int file = -1; size_t total_sent_length; /* * Check arguments. */ error_code = parse_and_check_book_name(arguments[1], &book, &content_type); if (error_code != EBNET_ERROR_OK) goto error; if (book->max_clients != 0 && get_ticket(&book->ticket_stock) < 0) { error_code = EBNET_ERROR_BUSY; goto error; } error_code = check_file_path(book, content_type, arguments[2]); if (error_code != EBNET_ERROR_OK) goto error; offset = (off_t)strtol(arguments[3], &end_p, 10); if (!isdigit(*(arguments[3])) || *end_p != '\0' || offset < 0) { error_code = EBNET_ERROR_BAD_READ_OFFSET; goto error; } data_length = (off_t)strtol(arguments[4], &end_p, 10); if (!isdigit(*(arguments[4])) || *end_p != '\0' || data_length <= 0) { error_code = EBNET_ERROR_BAD_READ_LENGTH; goto error; } /* * Get an actual file name. */ if (content_type == EBNET_CONTENT_TYPE_BOOK) prefix = book->path; else prefix = book->appendix_path; if (PATH_MAX < strlen(prefix) + 1 + strlen(arguments[2])) { error_code = EBNET_ERROR_BAD_PATH; goto error; } sprintf(absolute_path, "%s%s", prefix, arguments[2]); /* * Open and seek the file. */ file = fdcache_open(&fdcache_table, absolute_path); if (file < 0) { error_code = EBNET_ERROR_FAIL_OPEN_FILE; goto error; } if (lseek(file, offset, SEEK_SET) < 0) { error_code = EBNET_ERROR_FAIL_SEEK_FILE; goto error; } /* * Send a response message. */ syslog(LOG_INFO, "%s: cmd=READ, book=%s, file=%s, offset=%ld, length=%ld, host=%s(%s)", "ok", arguments[1], arguments[2], (long)offset, (long)data_length, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "!OK; read data follows\r\n") <= 0) { return -1; } total_sent_length = 0; while (total_sent_length < data_length) { /* * Read data from the file. */ ssize_t read_result; ssize_t n; if (data_length - total_sent_length < EBNET_MAX_READ_LENGTH) n = data_length - total_sent_length; else n = EBNET_MAX_READ_LENGTH; errno = 0; read_result = read(file, read_buffer, n); if (read_result < 0) { if (errno == EINTR) continue; if (write_string_all(accepted_out_file, idle_timeout, "*-1\r\n") <= 0) { return -1; } break; } else if (read_result == 0) { if (write_string_all(accepted_out_file, idle_timeout, "*0\r\n") <= 0) { return -1; } break; } /* * Send data to client. */ sprintf(message, "*%ld\r\n", (long)read_result); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; if (write_all(accepted_out_file, idle_timeout, read_buffer, read_result) <= 0) return -1; total_sent_length += read_result; } return 0; /* * An error occurs... */ error: /* +4 for ".app" */ truncate_string(arguments[1], MAX_BOOK_NAME_LENGTH + 4); truncate_string(arguments[2], EBNET_MAX_PATH_LENGTH); truncate_string(arguments[3], 10); truncate_string(arguments[4], 10); syslog(LOG_INFO, "%s: cmd=READ, book=%s, file=%s, offset=%s, length=%s, host=%s(%s)", error_messages[error_code], arguments[1], arguments[2], arguments[3], arguments[4], client_host_name, client_address); sprintf(message, "!%s; %s\r\n", error_categories[error_code], error_messages[error_code]); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; return 0; } /* * Parse and check a book name. * Book name must be either form: * * BOOK_NAME -- book * BOOK_NAME ".app" -- appendix * * If a book name given as `name' is valid, then `Book' information of * BOOK_NAME is put into `*book' and its content type (book or appendix) * into `content_type'. Otherwise `*book' is set to NULL. * * Upon success, this function returns EB_ERROR_OK, otherwise it returns * an error code. */ static EBNet_Error_Code parse_and_check_book_name(name, book, content_type) const char *name; Book **book; EBNet_Content_Type *content_type; { const char *dot; char book_name[MAX_BOOK_NAME_LENGTH + 1]; size_t book_name_length; Book *book_temporary; *book = NULL; /* * Parse a book name. */ dot = strchr(name, '.'); if (dot == NULL) book_name_length = strlen(name); else book_name_length = dot - name; if (book_name_length == 0 || MAX_BOOK_NAME_LENGTH < book_name_length) return EBNET_ERROR_BAD_BOOK_NAME; memcpy(book_name, name, book_name_length); *(book_name + book_name_length) = '\0'; if (dot == NULL) *content_type = EBNET_CONTENT_TYPE_BOOK; else if (strcmp(dot + 1, EBNET_APPENDIX_SUFFIX) == 0) *content_type = EBNET_CONTENT_TYPE_APPENDIX; else return EBNET_ERROR_BAD_BOOK_NAME; /* * Check the book name. */ book_temporary = find_book(book_name); if (book_temporary == NULL) return EBNET_ERROR_BAD_BOOK_NAME; if (!book_temporary->permission_flag) return EBNET_ERROR_NO_PERMISSION; if (*content_type == EBNET_CONTENT_TYPE_APPENDIX && book_temporary->appendix_path == NULL) return EBNET_ERROR_NO_APPENDIX; *book = book_temporary; return EBNET_ERROR_OK; } /* * Check a file-path arugment in a request line. * Book name must be either form: * * "/" SUBBOOK_NAME *( "/" DIRECTORY_NAME ) "/" FILE_NAME * "/" ROOT_FILE_NAME * * `book' and `content_type' is the parse result of book name in the * request, set by parse_and_check_book_name(). * * If the arguments are valid, the function returns EB_ERROR_OK, * otherwise it returns an error code. */ static EBNet_Error_Code check_file_path(book, content_type, path) Book *book; EBNet_Content_Type content_type; const char *path; { char subbook_name[EB_MAX_FILE_NAME_LENGTH + 1]; size_t subbook_name_length; EBNet_Error_Code error_code; char *slash; if (*path != '/') return EBNET_ERROR_BAD_PATH; slash = strchr(path + 1, '/'); if (slash == NULL) { /* * Check root file name. */ error_code = check_root_file_name(path + 1); if (error_code != EBNET_ERROR_OK) return error_code; } else { /* * Get a subbook name and check whether `book' has a subbook * with that name. */ subbook_name_length = slash - (path + 1); if (subbook_name_length == 0 || EB_MAX_DIRECTORY_NAME_LENGTH < subbook_name_length) return EBNET_ERROR_BAD_SUBBOOK_NAME; memcpy(subbook_name, path + 1, subbook_name_length); *(subbook_name + subbook_name_length) = '\0'; error_code = check_subbook_name(book, content_type, subbook_name); if (error_code != EBNET_ERROR_OK) return error_code; /* * Check rest of the path. */ error_code = check_path_parent_directory(slash); if (error_code != EBNET_ERROR_OK) return error_code; } return EBNET_ERROR_OK; } /* * Check a directory-path arugment in a request line. * Book name must be either form: * * "/" SUBBOOK_NAME *( "/" DIRECTORY_NAME ) * "/" * * `book' and `content_type' is the parse result of book name in the * request, set by parse_and_check_book_name(). * * If the arguments are valid, the function returns EB_ERROR_OK, * otherwise it returns an error code. */ static EBNet_Error_Code check_directory_path(book, content_type, path) Book *book; EBNet_Content_Type content_type; const char *path; { char subbook_name[EB_MAX_FILE_NAME_LENGTH + 1]; size_t subbook_name_length; EBNet_Error_Code error_code; char *slash; if (*path != '/') return EBNET_ERROR_BAD_PATH; if (*(path + 1) != '\0') { /* * Get a subbook name and check whether `book' has a subbook * with that name. */ slash = strchr(path + 1, '/'); if (slash == NULL) subbook_name_length = strlen(path + 1); else subbook_name_length = slash - (path + 1); if (subbook_name_length == 0 || EB_MAX_DIRECTORY_NAME_LENGTH < subbook_name_length) return EBNET_ERROR_BAD_SUBBOOK_NAME; memcpy(subbook_name, path + 1, subbook_name_length); *(subbook_name + subbook_name_length) = '\0'; error_code = check_subbook_name(book, content_type, subbook_name); if (error_code != EBNET_ERROR_OK) return error_code; /* * Check rest of the path, if exists. */ if (slash != NULL) { error_code = check_path_parent_directory(slash); if (error_code != EBNET_ERROR_OK) return error_code; } } return EBNET_ERROR_OK; } /* * Perform subbook name check on `subbook_name'. * * `book' and `content_type' is the parse result of book name in the * request, set by parse_and_check_book_name(). * * If the arguments are valid, the function returns EB_ERROR_OK, * otherwise it returns an error code. */ static EBNet_Error_Code check_subbook_name(book, content_type, subbook_name) Book *book; EBNet_Content_Type content_type; const char *subbook_name; { EB_Subbook_Code subbook; EBNet_Error_Code error_code; error_code = check_path_parent_directory(subbook_name); if (error_code != EBNET_ERROR_OK) return error_code; if (content_type == EBNET_CONTENT_TYPE_BOOK) subbook = find_subbook(book, subbook_name); else subbook = find_appendix_subbook(book, subbook_name); if (subbook == EB_SUBBOOK_INVALID) return EBNET_ERROR_BAD_SUBBOOK_NAME; return EBNET_ERROR_OK; } /* * Perform root file check on `file_name'. * * `file_name' must be "catalog", "catalogs" or "language". * The file name is case insensitive and it may have the suffix ".", * ".ebz" or ".org" and a version number ";DIGIT". * * If the file name is valid, the function returns EB_ERROR_OK, * otherwise it returns an error code. */ static EBNet_Error_Code check_root_file_name(file_name) const char *file_name; { size_t file_name_length; EBNet_Error_Code error_code; error_code = check_path_parent_directory(file_name); if (error_code != EBNET_ERROR_OK) return error_code; file_name_length = strlen(file_name); if (2 <= file_name_length && *(file_name + file_name_length - 2) == ';' && isdigit(*(file_name + file_name_length - 1))) { file_name_length -= 2; } if (1 <= file_name_length && *(file_name + file_name_length - 1) == '.') { file_name_length -= 1; } if (strncasecmp(file_name, "catalog", file_name_length) != 0 && strncasecmp(file_name, "catalogs", file_name_length) != 0 && strncasecmp(file_name, "language", file_name_length) != 0) return EBNET_ERROR_BAD_PATH; return EBNET_ERROR_OK; } /* * Perform security check on `path'. * * If `path' contains "/..", the function returns EBNET_ERROR_BAD_PATH, * otherwise it returns EB_ERROR_OK. */ static EBNet_Error_Code check_path_parent_directory(path) const char *path; { const char *slash; const char *p = path; for (;;) { slash = strchr(p, '/'); if (slash == NULL) break; if (*(slash + 1) == '.' && *(slash + 2) == '.') return EBNET_ERROR_BAD_PATH; p = slash + 1; } return EBNET_ERROR_OK; } /* * Truncate a string to a specified length. */ static void truncate_string(string, length) char *string; size_t length; { char *s; size_t i; for (i = 0, s = string; i < length && *s != '\0'; i++, s++) ; /* nothing to do */ *s = '\0'; } ebnetd-1.0.dfsg.1/ebnetd/fdcache.c0000644000175000017500000001637207731213463016213 0ustar mhattamhatta/* * Copyright) 2003 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_FCNTL_H #include #else #include #endif #ifdef __STDC__ #include #else #include #endif #include "fdcache.h" /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ /* * Unexported functions. */ #ifdef __STDC__ static unsigned int fdcache_compute_path_hash(const char *); static FDCache_Entry *fdcache_create_entry(const char *, int); static void fdcache_destroy_entry(FDCache_Entry *); static FDCache_Entry *fdcache_find_entry(FDCache_Table *, const char *); static void fdcache_insert_entry(FDCache_Table *, FDCache_Entry *); static void fdcache_purge_entry(FDCache_Table *, FDCache_Entry *); #else static unsigned int fdcache_compute_path_hash(); static FDCache_Entry *fdcache_create_entry(); static void fdcache_destroy_entry(); static FDCache_Entry *fdcache_find_entry(); static void fdcache_insert_entry(); static void fdcache_purge_entry(); #endif /* * Compute hash value for `path'. */ static unsigned int fdcache_compute_path_hash(path) const char *path; { const unsigned char *p = (const unsigned char *)path; unsigned int value = 0; while (*p != '\0') value = (value << 3) + value + *p++; return value; } /* * Create a new cache entry. */ static FDCache_Entry * fdcache_create_entry(path, fd) const char *path; int fd; { FDCache_Entry *new_entry; char cwd[PATH_MAX + 1]; int saved_errno; new_entry = (FDCache_Entry *)malloc(sizeof(FDCache_Entry)); if (new_entry == NULL) goto failed; new_entry->fd = fd; new_entry->path_hash = fdcache_compute_path_hash(path); if (*path == '/') { new_entry->path = malloc(strlen(path) + 1); if (new_entry->path == NULL) goto failed; strcpy(new_entry->path, path); } else { if (getcwd(cwd, PATH_MAX + 1) == NULL) goto failed; new_entry->path = malloc(strlen(cwd) + 1 + strlen(path) + 1); if (new_entry->path == NULL) goto failed; sprintf("%s/%s", cwd, path); } return new_entry; failed: saved_errno = errno; if (new_entry != NULL) fdcache_destroy_entry(new_entry); errno = saved_errno; return NULL; } /* * Destroy an entry created by fdcache_create_entry(). */ static void fdcache_destroy_entry(entry) FDCache_Entry *entry; { if (entry->path != NULL) free(entry->path); free(entry); } /* * Search the cache table for an entry with `path'. */ static FDCache_Entry * fdcache_find_entry(table, path) FDCache_Table *table; const char *path; { FDCache_Entry *entry; unsigned int path_hash; path_hash = fdcache_compute_path_hash(path); for (entry = table->head; entry != NULL; entry = entry->next) { if (entry->path_hash == path_hash && strcmp(entry->path, path) == 0) return entry; } return NULL; } /* * Insert `entry' into the head of the cache table. */ static void fdcache_insert_entry(table, entry) FDCache_Table *table; FDCache_Entry *entry; { if (table->entry_count == 0) { table->tail = entry; table->head = entry; entry->next = NULL; entry->back = NULL; } else { entry->next = table->head; table->head->back = entry; entry->back = NULL; table->head = entry; } table->entry_count++; } /* * Delete `entry' from the cache table. */ static void fdcache_purge_entry(table, entry) FDCache_Table *table; FDCache_Entry *entry; { if (entry->next != NULL) entry->next->back = entry->back; if (entry->back != NULL) entry->back->next = entry->next; if (entry == table->tail) table->tail = entry->back; if (entry == table->head) table->head = entry->next; table->entry_count--; } /* * Initialize the cache table. */ void #ifdef __STDC__ fdcache_initialize_table(FDCache_Table *table, int flags, ...) #else fdcache_initialize_table(table, flags, va_alist) FDCache_Table *table; int flags; va_dcl #endif { va_list ap; mode_t mode; if ((flags & O_CREAT) == 0) mode = 0; else { #ifdef __STDC__ va_start(ap, flags); #else va_start(ap); #endif mode = va_arg(ap, int); va_end(ap); } table->head = NULL; table->tail = NULL; table->entry_count = 0; table->open_flags = flags; table->open_mode = mode; table->max_entry_count = 0; } /* * Finalize the cache table. * Close all file descritors in the cache Table. */ void fdcache_finalize_table(table) FDCache_Table *table; { FDCache_Entry *entry; for (;;) { entry = table->head; if (entry == NULL) break; close(entry->fd); fdcache_purge_entry(table, entry); fdcache_destroy_entry(entry); } } /* * Set `max_entry_count'. */ void fdcache_set_max_entry_count(table, count) FDCache_Table *table; int count; { table->max_entry_count = count; } /* * Return `max_entry_count'. */ int fdcache_max_entry_count(table) FDCache_Table *table; { return table->max_entry_count; } /* * Return `entry_count'. */ int fdcache_entry_count(table) FDCache_Table *table; { return table->entry_count; } /* * Open the file specified by `path'. */ int fdcache_open(table, path) FDCache_Table *table; const char *path; { FDCache_Entry *entry; FDCache_Entry *lru_entry; int saved_errno; int fd; entry = fdcache_find_entry(table, path); if (entry != NULL) { fdcache_purge_entry(table, entry); fdcache_insert_entry(table, entry); return entry->fd; } /* * Open the file. */ if ((table->open_flags & O_CREAT) == 0) fd = open(path, table->open_flags); else fd = open(path, table->open_flags, table->open_mode); if (fd < 0) return -1; /* * Create a cache entry and insert it into the cache table. */ entry = fdcache_create_entry(path, fd); if (entry == NULL) { saved_errno = errno; close(fd); errno = saved_errno; return -1; } fdcache_insert_entry(table, entry); /* * Delete an LRU (least recently used) entry. */ if (0 < table->max_entry_count && table->max_entry_count < table->entry_count) { lru_entry = table->tail; close(lru_entry->fd); fdcache_purge_entry(table, lru_entry); fdcache_destroy_entry(lru_entry); } return entry->fd; } ebnetd-1.0.dfsg.1/ebnetd/ebndaily.in0000644000175000017500000002021007673055360016600 0ustar mhattamhatta#! @PERL@ eval 'exec @PERL@ -S $0 ${1+"$@"}' if 0; # -*- Perl -*- # Copyright (c) 1997 - 2003 # Motoyuki Kasahara # # This program 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, or (at your option) # any later version. # # This program 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. # # Set output record separator to ' '. $, = ' '; # Set umask umask(022); # PATH $ENV{'PATH'} = '/usr/bin:/bin'; $ENV{'PATH'} .= ':/usr/ucb' if (-d '/usr/ucb'); # Program name, program version and mailing address. $program_name = 'ebndaily'; $program_version = '@VERSION@'; $mailing_address = '@MAILING_ADDRESS@'; # Statistics commands. $ebnstat = '@libexecdir@/@EBNSTAT@'; $ndtpstat = '@libexecdir@/@NDTPSTAT@'; $ebhtstat = '@libexecdir@/@EBHTSTAT@'; # Log file. $log_file = '@logdir@/ebnetd.log'; # How many generataions of syslog files are kept. $ages = 7; # `commpress' and `gzip' Command. $compress = '@COMPRESS@'; $gzip = '@GZIPCMD@'; $bzip2 = '@BZIP2@'; $gzip_options = ''; # How to compress old logs; `gzip', `compress', or `none'. $compressor = 'none'; # Compression programs and suffixes they usually add to the filename. %compressors = ('gzip', '.gz', 'bzip2', '.bz2', 'compress', '.Z', 'none', ''); # Command to send mail which accepts "-s subject" option. $mailx = '@MAILX@'; # Whether to send a report mail or not. $report_mail_flag = 1; # Usage $help_message = "Usage: $program_name [option...] mail-address... Options: -a INTEGER --ages INTEGER keep INTEGER ages of old syslog files (default: $ages) -c TYPE --compressor TYPE how to compress old syslog files; compress, gzip, bzip2 or none (default: $compressor) -h --help display this help, then exit -l FILE --log-file FILE specify a syslog file (default: $log_file) -n --no-mail do not send report mail -v --version display version number, then exit -1 --fast compress faster when using gzip or bzip2 -9 --best compress better when using gzip or bzip2 Arguemnts: mail-address receipient of a report from $program_name. Report bugs to $mailing_address. "; # Copyright message. $copyright = "Copyright (c) 1997 - 2003 Motoyuki Kasahara "; # `try ...' message. $try_help_message = "try \`$0 --help\' for more information\n"; # Command line options. @long_options = ('-a --ages required-argument', '-c --compressor required-argument', '-h --help no-argument', '-l --log-file required-argument', '-n --no-mail no-argument', '-v --version no-argument', '-1 --fast no-argument', '-2 no-argument', '-3 no-argument', '-4 no-argument', '-5 no-argument', '-6 no-argument', '-7 no-argument', '-8 no-argument', '-9 --best no-argument'); # # Parse command line options. # &getopt_initialize(@long_options); while (($option_name, $option_argument) = &getopt_long) { if ($option_name eq '-a') { if ($option_argument !~ /^\d+$/ || $option_argument <= 0) { warn "$0: ages must be an integral number and greater than 0.\n"; exit(1); } $ages = $option_argument; } elsif ($option_name eq '-c') { if ($option_argument !~ /^(compress|gzip|bzip2|none)$/i) { warn "$0: unknown compressor \`$option_argument\'\n"; warn $try_help_message; exit(1); } $compressor = "\L$option_argument"; } elsif ($option_name eq '-h') { print $help_message; exit(0); } elsif ($option_name eq '-l') { $log_file = $option_argument; } elsif ($option_name eq '-n') { $report_mail_flag = 0; } elsif ($option_name eq '-v') { print "$program_name (EBNETD) version $program_version\n"; print $copyright; exit(0); } elsif ($option_name =~ /^-[1-9]$/) { $gzip_options = $option_argument; } else { warn $try_help_message; exit(1); } } if (@ARGV == 0) { warn "$0: too few argument\n"; warn $try_help_message; exit(1); } die "$0: gzip not found.\n" if ($compressor eq 'gzip' && $gzip eq 'no'); die "$0: bzip2 not found.\n" if ($compressor eq 'bzip2' && $bzip2 eq 'no'); # # Set signal handlers. # $SIG{'HUP'} = 'signal_handler'; $SIG{'INT'} = 'signal_handler'; $SIG{'QUIT'} = 'signal_handler'; $SIG{'TERM'} = 'signal_handler'; sub signal_handler { close(SAVEOUT); close(SAVEERR); if (-f $errfile && !unlink("$errfile")) { warn "$0: cannot unlink the file, $!: $errfile\n"; } if (-f $statfile && !unlink("$statfile")) { warn "$0: cannot unlink the file, $!: $statfile\n"; } exit(1); } # # Redirect STDOUT and STDERR to temporary files. # $error_file = "/tmp/ebndaye$$"; $stat_file = "/tmp/ebndays$$"; if (-f $error_file && !unlink("$error_file")) { warn "$0: cannot unlink the file, $!: $error_file\n"; } if (-f $stat_file && !unlink("$stat_file")) { warn "$0: cannot unlink the file, $!: $stat_file\n"; } open(SAVEERR, ">&STDERR"); open(SAVEOUT, ">&STDOUT"); if (!open(STDERR, ">$error_file")) { print SAVEERR "cannot open the file $error_file, $!\n"; exit 1; } if (!open(STDOUT, ">$stat_file")) { print SAVEERR "cannot open the file $stat_file, $!\n"; exit 1; } select(STDOUT); $| = 1; # # Get statistics. # warn "failed to execute \`$ebnstat $log_file\'\n" if (system("$ebnstat $log_file") >> 8 != 0); warn "failed to execute \`$ndtpstat $log_file\'\n" if (system("$ndtpstat $log_file") >> 8 != 0); warn "failed to execute \`$ebhtstat $log_file\'\n" if (system("$ebhtstat $log_file") >> 8 != 0); # # Rotate old logs. # $suffix = $compressors{$compressor}; $i = $ages - 1; warn "$0: cannot remove $log_file.$i$suffix\n" if (-f "$log_file.$i$suffix" && !unlink("$log_file.$i$suffix")); while (0 < $i) { $j = $i--; warn "$0: cannot move $log_file.$i$suffix to $log_file.$j$suffix\n" if (-f "$log_file.$i$suffix" && !rename("$log_file.$i$suffix", "$log_file.$j$suffix")); } warn "$0: cannot remove $log_file.0\n" if (-f "$log_file.0" && !unlink("$log_file.0")); # # Copy `ebnetd.log' to `ebnetd.log.0'. # warn "$0: failed to execute \`cp $log_file $log_file.0\'\n" if (system("cp $log_file $log_file.0") >> 8 != 0); # # Make a new log file. # warn "$0: cannot create new $log_file\n" unless (open(LOGFILE, ">$log_file") && close(LOGFILE)); # # Compress the last log. # if ($compressor eq 'gzip') { if (system("$gzip $gzip_options $log_file.0") >> 8 != 0) { warn "$0: failed to execute \`$gzip $gzip_options $log_file.0\'\n"; } } elsif ($compressor eq 'bzip2') { if (system("$bzip2 $gzip_options $log_file.0") >> 8 != 0) { warn "$0: failed to execute \`$bzip2 $gzip_options $log_file.0\'\n"; } } elsif ($compressor eq 'compress') { # It doesn't examine exit code. In some systems, `compress' returns # with exit code 1 when an file is larger after compression. system("$compress -c $log_file.0 > $log_file.0$suffix"); warn "$0: cannot compress $log_file.0\n" if (! -f "$log_file.0$suffix"); warn "$0: cannot remove $log_file.0\n" if (-f "$log_file.0" && !unlink("$log_file.0")); } # # Output log sizes. # print "Log Size:\n"; warn "$0: failed to execute \`ls -l $log_file*\'\n" if (system("ls -l $log_file*") >> 8 != 0); print "\n\n\n"; # # Error messages at executing ebndaily. # print "Error Messages at Executing $0:\n" if (-f $error_file && -s $error_file); # # Send the report via mail. # if ($report_mail_flag && system("cat $stat_file $error_file | $mailx -s \'ebnetd/ndtpd/ebhttpd daily log\' @ARGV") >> 8 != 0) { print SAVEERR "failed to execute \`$mailx -s ... @ARGV\'\n"; exit 1; } # # Remove temorary files. # unlink($stat_file, $error_file); exit; # Local Variables: # mode: perl # End: ebnetd-1.0.dfsg.1/ebnetd/ebnstat.in0000644000175000017500000001173407673055355016470 0ustar mhattamhatta#! @PERL@ eval 'exec @PERL@ -S $0 ${1+"$@"}' if 0; # -*- Perl -*- # Copyright (c) 2003 # Motoyuki Kasahara # # This program 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, or (at your option) # any later version. # # This program 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. # # Program name, program version and mailing address. $progname ='ebnstat'; $version = '@VERSION@'; $mailing_address = '@MAILING_ADDRESS@'; $help = "Usage: $progname [option...] [syslog-file...] Options: -h --help display this help, then exit -v --version display version number, then exit Arguments: syslog-file syslog file Report bugs to $mailing_address. "; # Copyright message. $copyright = "Copyright (c) 1997 - 2003 Motoyuki Kasahara "; $tryhelp = "try \`$0 --help\' for more information\n"; @option_list = ('-h --help no-argument', '-v --version no-argument'); # # Parse command line options. # &getopt_initialize(@option_list); while (($opt, $arg) = &getopt_long) { if ($opt eq '-h') { print $help; exit(0); } elsif ($opt eq '-v') { print "$progname (EBNETD) version $version\n"; print $copyright; exit(0); } else { die $tryhelp; } } # # Scan logs. # while (<>) { next unless (s/^.* ebnetd\[\d+\]: ([^:]+): //); $status = $1; foreach $i (split(/, /)) { next unless (($name, $value) = ($i =~ /^([^=]+)=(.*)$/)); if ($name eq 'host') { $value =~ s/^\?\((.*)\)$/$1/; $value =~ s/^(.*)\(.*\)$/$1/; $value = '(test-mode)' if ($value =~ /^\//); } $field{$name} = $value; } if ($status =~ /connected$/) { $permconn{$field{'host'}}++; $permconn_total++; } elsif ($status =~ /connection denied$/) { $denyconn{$field{'host'}}++; $denyconn_total++; } elsif ($status =~ /ok$/) { if ($field{'cmd'} eq 'BOOK') { $set{$field{'book'}}++; $access{$field{'book'}}++; $set_total++; $access_total++; } elsif ($field{'cmd'} eq 'READ') { $sendtext{$field{'book'}}++; $access{$field{'book'}}++; $sendtext_total++; $access_total++; } elsif ($field{'cmd'} eq 'FILE' || $field{'cmd'} eq 'DIR' || $field{'cmd'} eq 'FILESIZE') { $others{$field{'book'}}++; $access{$field{'book'}}++; $others_total++; $access_total++; } } elsif ($status =~ /permission denied$/) { $denybook{$field{'host'}}++; $denybook_total++; } } # # Output header. # print "############################################################################\n"; print "# EBNETD statistics\n"; print "############################################################################\n\n"; if ($permconn_total == 0 && $denyconn_total == 0 && $access_total == 0 && $denybook_total == 0) { print "(no access from client)\n"; exit; } # # Output the `Permitted Connections to the server' list. # print "Permitted Connections to the server:\n\n"; printf "%-32s %7s\n", 'client', 'counts'; print "-----------------------------------------\n"; foreach $i (sort {$permconn{$b} <=> $permconn{$a}} keys(%permconn)) { printf "%-32s %7d\n", $i, $permconn{$i}; } print "-----------------------------------------\n"; printf "%-32s %7d\n\n\n", 'total', $permconn_total; # # Output the `Denied connections to the server' list. # print "Denied connections to the server:\n\n"; printf "%-32s %7s\n", 'client', 'counts'; print "-----------------------------------------\n"; foreach $i (sort {$denyconn{$b} <=> $denyconn{$a}} keys(%denyconn)) { printf "%-32s %7d\n", $i, $denyconn{$i}; } print "-----------------------------------------\n"; printf "%-32s %7d\n\n\n", 'total', $denyconn_total; # # Output the `Accesses to book' list. # print "Accesses to book:\n\n"; printf "%-24s %8s (= %6s + %7s + %7s)\n", 'book', 'access', 'set', 'read', 'others'; print "------------------------------------------------------------------\n"; foreach $i (sort {$access{$b} <=> $access{$a}} keys(%access)) { printf "%-24s %8d (= %6d + %7d + %7d)\n", $i, $access{$i}, $set{$i}, $sendtext{$i}, $others{$i}; } print "------------------------------------------------------------------\n"; printf "%-24s %8d (= %6d + %7d + %7d)\n\n\n", 'total', $access_total, $set_total, $sendtext_total, $others_total; # # Output the `Denied accesses to book' list. # print "Denied accesses to book:\n\n"; printf "%-32s %7s\n", 'client', 'counts'; print "-----------------------------------------\n"; foreach $i (sort {$denybook{$b} <=> $denybook{$a}} keys(%denybook)) { printf "%-32s %7d\n", $i, $denybook{$i}; } print "-----------------------------------------\n"; printf "%-32s %7d\n\n\n", 'total', $denybook_total; # Local Variables: # mode: perl # End: ebnetd-1.0.dfsg.1/ebnetd/ebnupgrade.in0000644000175000017500000001473707673055353017150 0ustar mhattamhatta#! @PERL@ eval 'exec @PERL@ -S $0 ${1+"$@"}' if 0; # -*- Perl -*- # Copyright (c) 2000 - 2003 Motoyuki Kasahara # # This program 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, or (at your option) # any later version. # # This program 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. # # Program name, program version and mailing address. $progname ='ebnupgrade'; $version = '@VERSION@'; $mailing_address = '@MAILING_ADDRESS@'; # Default configuration files. $old_file = '@sysconfdir@/ebnetd.conf'; $new_file = ''; # Test mode flag. $test_mode = 0; # Quiet mode flag. $quiet_mode = 0; # Help message. $help = "Usage: $progname [option...] Options: -c FILE --configuration-file FILE input old configuration from FILE (default: $old_file) -h --help display this help, then exit -o FILE --output-file FILE output new configuration to FILE (default: $old_file.new) -q --quiet --silence suppress report messages -t --test only check for input file -v --version display version number, then exit Report bugs to $mailing_address. "; # Copyright message. $copyright = "Copyright (c) 2000 - 2003 Motoyuki Kasahara "; $tryhelp = "try \`$0 --help\' for more information\n"; # Command line options. @long_options = ('-c --configuration-file required-argument', '-o --output-file required-argument', '-h --help no-argument', '-q --quiet --silence no-argument', '-t --test no-argument', '-v --version no-argument'); # Netmask conversion table. %netmask_table = ('0.0.0.0', 0, '128.0.0.0', 1, '192.0.0.0', 2, '224.0.0.0', 3, '240.0.0.0', 4, '248.0.0.0', 5, '252.0.0.0', 6, '254.0.0.0', 7, '255.0.0.0', 8, '128.128.0.0', 9, '192.192.0.0', 10, '224.224.0.0', 11, '240.240.0.0', 12, '248.248.0.0', 13, '252.252.0.0', 14, '254.254.0.0', 15, '255.255.0.0', 16, '128.255.128.0', 17, '192.255.192.0', 18, '224.255.224.0', 19, '240.255.240.0', 20, '248.255.248.0', 21, '252.255.252.0', 22, '254.255.254.0', 23, '255.255.255.0', 24, '128.255.255.128', 25, '192.255.255.192', 26, '224.255.255.224', 27, '240.255.255.240', 28, '248.255.255.248', 29, '252.255.255.252', 30, '254.255.255.254', 31, '255.255.255.255', 32); # # Parse command line options. # &getopt_initialize(@long_options); while (($option_name, $option_argument) = &getopt_long) { if ($option_name eq '-c') { $old_file = $option_argument; } elsif ($option_name eq '-h') { print $help; exit(0); } elsif ($option_name eq '-o') { $new_file = $option_argument; } elsif ($option_name eq '-q') { $quiet_mode = 1; } elsif ($option_name eq '-t') { $test_mode = 1; } elsif ($option_name eq '-v') { print "$progname (EBNETD) version $version\n"; print $copyright; exit(0); } else { die $tryhelp; } } if (@ARGV != 0) { warn "$0: too many arguments\n"; die $tryhelp; } # # Open a configuration file. # if ($new_file eq '') { if ($old_file eq '' || $old_file eq '-') { $new_file = "ebnetd.conf.new"; } else { $new_file = "$old_file.new"; } } if ($old_file eq '-') { if (!open(OLD_FILE, "<& STDIN")) { die "$0: failed to duplicate standard in, $!\n"; } $old_file = '(stdin)'; } else { if (!open(OLD_FILE, "< $old_file")) { die "$0: failed to open the file, $!: $old_file\n"; } } if (!$test_mode) { if ($new_file eq '-') { if (!open(NEW_FILE, ">& STDOUT")) { die "$0: failed to duplicate standard in, $!\n"; } } else { if (!open(NEW_FILE, "> $new_file")) { die "$0: failed to open the file, $!: $new_file\n"; } } } # # Add a header. # print NEW_FILE "\#\# Converted by $progname $version\n\n" if (!$test_mode); while () { # # Remove spaces in the head and tail of the line. # chop if (/\n/); s/\s*$//; s/^(\s*)//; $indent = $1; # # Skip the line if it is empty or comment line. # if (/^\#/ || /^$/) { print NEW_FILE "$indent$_\n" if (!$test_mode); next; } # # Rewrite the line. # ($directive_name, $separator, $directive_value) = /^(\S+)(\s+)(\S.*)$/; if ($directive_name eq 'pid-file' || $directive_name eq 'server-name' || $directive_name eq 'ident-hosts' || $directive_name eq 'ident-timeout' || $directive_name =~ /^alias-/) { # # They are obsolete directives. Comment out. # printf(STDERR "%s: %d: $directive_name' is obsoleted (comment out)\n", $old_file, $.) if (!$quiet_mode); print NEW_FILE "$indent\# $_\n" if (!$test_mode); } elsif ($directive_name eq 'hosts' && $directive_value =~ /^([0-9.]+)\/(\d+\.\d+\.\d+\.\d+)$/) { # # Substitute a netmask notation. # $network = $1; $netmask = $2; printf(STDERR "%s: %d: netmask must be an integer (fixed)\n", $old_file, $.) if (!$quiet_mode); if (defined($netmask_table{$netmask})) { $directive_value = "$network/$netmask_table{$netmask}"; printf(NEW_FILE "%s%s%s%s\n", $indent, $directive_name, $separator, $directive_value) if (!$test_mode); } else { printf(STDERR "%s: %d: cannot convert the netmask (comment out)\n", $old_file, $.) if (!$quiet_mode); print NEW_FILE "$indent\# $_\n" if (!$test_mode); } } elsif ($directive_name eq 'name' && $directive_value =~ /[A-Z]/) { # # Covert upper letters in a book name to lower letters. # printf(STDERR "%s: %d: letters in book name must be lower case (fixed)\n", $old_file, $.) if (!$quiet_mode); $directive_value = "\L$directive_value"; printf(NEW_FILE "%s%s%s%s\n", $indent, $directive_name, $separator, $directive_value) if (!$test_mode); } else { # # Other lines are output as it is. # print NEW_FILE "$indent$_\n" if (!$test_mode); } } # # Close the configuration file. # close(OLD_FILE); close(NEW_FILE); # Local Variables: # mode: perl # End: ebnetd-1.0.dfsg.1/m4/0000755000175000017500000000000007773515160013545 5ustar mhattamhattaebnetd-1.0.dfsg.1/m4/eb4.m40000644000175000017500000000545707771716474014505 0ustar mhattamhattadnl * dnl * Make ready to link EB Library 3.x or 4.x. dnl * dnl * Copyright (c) 2000 - 2003 dnl * Motoyuki Kasahara dnl * dnl * This program is free software; you can redistribute it and/or modify dnl * it under the terms of the GNU General Public License as published by dnl * the Free Software Foundation; either version 2, or (at your option) dnl * any later version. dnl * dnl * This program is distributed in the hope that it will be useful, dnl * but WITHOUT ANY WARRANTY; without even the implied warranty of dnl * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl * GNU General Public License for more details. dnl * AC_DEFUN([eb_LIB_EB4], [dnl dnl * dnl * Requirements. dnl * AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_LIBTOOL]) AC_REQUIRE([AC_C_CONST]) AC_REQUIRE([AC_C_PROTOTYPES]) AC_REQUIRE([AC_TYPE_OFF_T]) AC_REQUIRE([AC_TYPE_SIZE_T]) AC_REQUIRE([AC_HEADER_TIME]) AC_CHECK_HEADERS(limits.h) AC_CHECK_TYPE(ssize_t, int) dnl * dnl * --with-eb-conf option. dnl * AC_ARG_WITH(eb-conf, AC_HELP_STRING([--with-eb-conf=FILE], [eb.conf file is FILE [[SYSCONFDIR/eb.conf]]]), [ebconf="${withval}"], [ebconf=$sysconfdir/eb.conf]) if test X$prefix = XNONE ; then PREFIX=$ac_default_prefix else PREFIX=$prefix fi ebconf=`echo X$ebconf | sed -e 's/^X//' -e 's;\${prefix};'"$PREFIX;g" \ -e 's;\$(prefix);'"$PREFIX;g"` dnl * dnl * Read eb.conf dnl * AC_MSG_CHECKING(for eb.conf) AC_MSG_RESULT($ebconf) if test -f ${ebconf} ; then . ${ebconf} else AC_MSG_ERROR($ebconf not found) fi if test X$EBCONF_ENABLE_PTHREAD = Xyes ; then AC_DEFINE(EBCONF_ENABLE_PTHREAD, 1, [Define if EB Library supports pthread.]) fi if test X$EBCONF_ENABLE_NLS = Xyes ; then AC_DEFINE(EBCONF_ENABLE_NLS, 1, [Define if EB Library supports native language.]) fi if test X$EBCONF_ENABLE_EBNET = Xyes ; then AC_DEFINE(EBCONF_ENABLE_EBNET, 1, [Define if EB Library supports remote access.]) fi AC_SUBST(EBCONF_EBINCS) AC_SUBST(EBCONF_EBLIBS) AC_SUBST(EBCONF_ZLIBINCS) AC_SUBST(EBCONF_ZLIBLIBS) AC_SUBST(EBCONF_PTHREAD_CPPFLAGS) AC_SUBST(EBCONF_PTHREAD_CFLAGS) AC_SUBST(EBCONF_PTHREAD_LDFLAGS) AC_SUBST(EBCONF_INTLINCS) AC_SUBST(EBCONF_INTLLIBS) dnl * dnl * Check for EB Library. dnl * AC_MSG_CHECKING(for EB Library) save_CPPFLAGS=$CPPFLAGS save_CFLAGS=$CFLAGS save_LDFLAGS=$LDFLAGS save_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $EBCONF_PTHREAD_CPPFLAGS $EBCONF_EBINCS $EBCONF_ZLIBINCS $EBCONF_INTLINCS" CFLAGS="$CFLAGS $EBCONF_PTHREAD_CFLAGS" LDFLAGS="$LDFAGS $EBCONF_PTHREAD_LDFLAGS" LIBS="$LIBS $EBCONF_EBLIBS $EBCONF_ZLIBLIBS $EBCONF_INTLLIBS" AC_TRY_LINK([#include ], [eb_initialize_library(); return 0;], try_eb=yes, try_eb=no) CPPFLAGS=$save_CPPFLAGS CFLAGS=$save_CFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS AC_MSG_RESULT($try_eb) if test ${try_eb} != yes ; then AC_MSG_ERROR(EB Library not available) fi ]) ebnetd-1.0.dfsg.1/m4/herrno.m40000644000175000017500000000371507771714276015321 0ustar mhattamhattadnl * dnl * Copyright (c) 2001 Motoyuki Kasahara dnl * dnl * Redistribution and use in source and binary forms, with or without dnl * modification, are permitted provided that the following conditions dnl * are met: dnl * 1. Redistributions of source code must retain the above copyright dnl * notice, this list of conditions and the following disclaimer. dnl * 2. Redistributions in binary form must reproduce the above copyright dnl * notice, this list of conditions and the following disclaimer in the dnl * documentation and/or other materials provided with the distribution. dnl * 3. Neither the name of the project nor the names of its contributors dnl * may be used to endorse or promote products derived from this software dnl * without specific prior written permission. dnl * dnl * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND dnl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE dnl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR dnl * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORSBE dnl * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR dnl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF dnl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS dnl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN dnl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) dnl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF dnl * THE POSSIBILITY OF SUCH DAMAGE. dnl * dnl * dnl * Check for h_errno. dnl * AC_DEFUN([AC_DECL_H_ERRNO], [AC_CACHE_CHECK(for h_errno declaration in netdb.h, ac_cv_decl_h_errno, [AC_TRY_COMPILE([ #include ],[ h_errno = 0; ], [ac_cv_decl_h_errno=yes], [ac_cv_decl_h_errno=no])]) if test "$ac_cv_decl_h_errno" = yes; then AC_DEFINE(H_ERRNO_DECLARED, 1, [Define to 1 if `h_errno' is declared by ]) fi]) ebnetd-1.0.dfsg.1/m4/in6addr.m40000644000175000017500000000660107771714317015344 0ustar mhattamhattadnl * dnl * Copyright (c) 2001 Motoyuki Kasahara dnl * dnl * Redistribution and use in source and binary forms, with or without dnl * modification, are permitted provided that the following conditions dnl * are met: dnl * 1. Redistributions of source code must retain the above copyright dnl * notice, this list of conditions and the following disclaimer. dnl * 2. Redistributions in binary form must reproduce the above copyright dnl * notice, this list of conditions and the following disclaimer in the dnl * documentation and/or other materials provided with the distribution. dnl * 3. Neither the name of the project nor the names of its contributors dnl * may be used to endorse or promote products derived from this software dnl * without specific prior written permission. dnl * dnl * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND dnl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE dnl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR dnl * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORSBE dnl * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR dnl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF dnl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS dnl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN dnl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) dnl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF dnl * THE POSSIBILITY OF SUCH DAMAGE. dnl * dnl * dnl * Check for struct in6_addr dnl * AC_DEFUN([AC_STRUCT_IN6_ADDR], [AC_CACHE_CHECK(for struct in6_addr, ac_cv_struct_in6_addr, [AC_TRY_COMPILE([ #include #include #include ],[ struct in6_addr address; ], [ac_cv_struct_in6_addr=yes], [ac_cv_struct_in6_addr=no])]) if test "$ac_cv_struct_in6_addr" = yes; then AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [Define to 1 if defines `struct in6_addr']) fi]) dnl * dnl * Check for in6addr_any. dnl * AC_DEFUN([AC_DECL_IN6ADDR_ANY], [AC_REQUIRE([AC_STRUCT_IN6_ADDR]) if test $ac_cv_struct_in6_addr = no ; then ac_cv_decl_in6addr_any=no else AC_CACHE_CHECK(for in6addr_any declaration in netinet/in.h, ac_cv_decl_in6addr_any, [AC_TRY_COMPILE([ #include #include #include ],[ unsigned char *address; address = (char *)&in6addr_any; ], [ac_cv_decl_in6addr_any=yes], [ac_cv_decl_in6addr_any=no])]) if test "$ac_cv_decl_in6addr_any" = yes; then AC_DEFINE(IN6ADDR_ANY_DECLARED, 1, [Define to 1 if `in6addr_any' is declared by ]) fi fi]) dnl * dnl * Check for in6addr_loopback. dnl * AC_DEFUN([AC_DECL_IN6ADDR_LOOPBACK], [AC_REQUIRE([AC_STRUCT_IN6_ADDR]) if test $ac_cv_struct_in6_addr = no ; then ac_cv_decl_in6addr_loopback=no else AC_CACHE_CHECK(for in6addr_loopback declaration in netinet/in.h, ac_cv_decl_in6addr_loopback, [AC_TRY_COMPILE([ #include #include #include ],[ unsigned char *address; address = (char *)&in6addr_loopback; ], [ac_cv_decl_in6addr_loopback=yes], [ac_cv_decl_in6addr_loopback=no])]) if test "$ac_cv_decl_in6addr_loopback" = yes; then AC_DEFINE(IN6ADDR_LOOPBACK_DECLARED, 1, [Define to 1 if `in6addr_loopback' is declared by ]) fi fi]) ebnetd-1.0.dfsg.1/m4/libtool.m40000644000175000017500000062566607771714430015477 0ustar mhattamhatta# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- ## Copyright 1996, 1997, 1998, 1999, 2000, 2001 ## Free Software Foundation, Inc. ## Originally by Gordon Matzigkeit , 1996 ## ## This program 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. ## ## This program 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 this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## ## As a special exception to the GNU General Public License, if you ## distribute this file as part of a program that contains a ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. # serial 47 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 testring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ = "XX$testring") >/dev/null 2>&1 && new_result=`expr "X$testring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` testring=$testring$testring done testring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- #- set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the path to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $host_os in irix5* | nonstopux*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) case $host_cpu in alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the path to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided and an installed libltdl is not found, it is # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_builddir and top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`]) ])# _LT_AC_LANG_CXX # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # -------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # # Check for any special shared library compilation flags. # _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= if test "$GCC" = no; then case $host_os in sco3.2v5*) _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' ;; esac fi if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : else AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no fi fi # # Check to make sure the static flag actually works. # AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_DLOPEN_SELF($1) # Report which librarie types wil actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sco*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program 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. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris* | sysv5*) symcode='[[BDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGISTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $CC in icc|ecc) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; ccc) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; sco3.2v5*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi4*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; sco3.2v5*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4.2uw2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv5*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED ]) AC_MSG_RESULT([$SED]) ]) ebnetd-1.0.dfsg.1/m4/sockaddrin6.m40000644000175000017500000000515007771714342016220 0ustar mhattamhattadnl * dnl * Copyright (c) 2001 Motoyuki Kasahara dnl * dnl * Redistribution and use in source and binary forms, with or without dnl * modification, are permitted provided that the following conditions dnl * are met: dnl * 1. Redistributions of source code must retain the above copyright dnl * notice, this list of conditions and the following disclaimer. dnl * 2. Redistributions in binary form must reproduce the above copyright dnl * notice, this list of conditions and the following disclaimer in the dnl * documentation and/or other materials provided with the distribution. dnl * 3. Neither the name of the project nor the names of its contributors dnl * may be used to endorse or promote products derived from this software dnl * without specific prior written permission. dnl * dnl * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND dnl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE dnl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR dnl * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORSBE dnl * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR dnl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF dnl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS dnl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN dnl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) dnl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF dnl * THE POSSIBILITY OF SUCH DAMAGE. dnl * dnl * dnl * Check for struct sockaddr_in6 dnl * AC_DEFUN([AC_STRUCT_SOCKADDR_IN6], [AC_CACHE_CHECK(for struct sockaddr_in6, ac_cv_struct_sockaddr_in6, [AC_TRY_COMPILE([ #include #include #include ],[ struct sockaddr_in6 address; ], [ac_cv_struct_sockaddr_in6=yes], [ac_cv_struct_sockaddr_in6=no])]) if test "$ac_cv_struct_sockaddr_in6" = yes; then AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [Define to 1 if defines `struct sockaddr_in6']) fi]) dnl * dnl * Check for struct sockaddr_storage dnl * AC_DEFUN([AC_STRUCT_SOCKADDR_STORAGE], [AC_CACHE_CHECK(for struct sockaddr_storage, ac_cv_struct_sockaddr_storage, [AC_TRY_COMPILE([ #include #include #include ],[ struct sockaddr_storage address; ], [ac_cv_struct_sockaddr_storage=yes], [ac_cv_struct_sockaddr_storage=no])]) if test "$ac_cv_struct_sockaddr_storage" = yes; then AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Define to 1 if defines `struct sockaddr_storage']) fi]) ebnetd-1.0.dfsg.1/m4/sockinttypes.m40000644000175000017500000001246707701433552016553 0ustar mhattamhattadnl * dnl * Copyright (c) 2001, 2003 Motoyuki Kasahara dnl * dnl * Redistribution and use in source and binary forms, with or without dnl * modification, are permitted provided that the following conditions dnl * are met: dnl * 1. Redistributions of source code must retain the above copyright dnl * notice, this list of conditions and the following disclaimer. dnl * 2. Redistributions in binary form must reproduce the above copyright dnl * notice, this list of conditions and the following disclaimer in the dnl * documentation and/or other materials provided with the distribution. dnl * 3. Neither the name of the project nor the names of its contributors dnl * may be used to endorse or promote products derived from this software dnl * without specific prior written permission. dnl * dnl * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND dnl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE dnl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR dnl * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORSBE dnl * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR dnl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF dnl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS dnl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN dnl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) dnl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF dnl * THE POSSIBILITY OF SUCH DAMAGE. dnl * dnl * dnl * Check for socklen_t. dnl * AC_DEFUN([AC_TYPE_SOCKLEN_T], [AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, [AC_TRY_COMPILE([ #include #include ], [ socklen_t socklen; ], [ac_cv_type_socklen_t=yes], [ac_cv_type_socklen_t=no])]) if test "$ac_cv_type_socklen_t" != yes; then AC_DEFINE(socklen_t, int, [Define to `int' if or does not define.]) fi]) dnl * dnl * Check for in_port_t. dnl * AC_DEFUN([AC_TYPE_IN_PORT_T], [AC_CACHE_CHECK([for in_port_t], ac_cv_type_in_port_t, [AC_TRY_COMPILE([ #include #include #include ], [ in_port_t in_port; ], [ac_cv_type_in_port_t=yes], [ac_cv_type_in_port_t=no])]) if test "$ac_cv_type_in_port_t" != yes; then ac_cv_sin_port_size=unknown AC_TRY_RUN([ #include #include #include int main() { struct sockaddr_in addr; return (sizeof(addr.sin_port) == sizeof(long)) ? 0 : 1; } ], [ac_cv_sin_port_size=long]) AC_TRY_RUN([ #include #include #include int main() { struct sockaddr_in addr; return (sizeof(addr.sin_port) == sizeof(int)) ? 0 : 1; } ], [ac_cv_sin_port_size=int]) AC_TRY_RUN([ #include #include #include int main() { struct sockaddr_in addr; return (sizeof(addr.sin_port) == sizeof(short)) ? 0 : 1; } ], [ac_cv_sin_port_size=short]) AC_TRY_RUN([ #include #include #include int main() { struct sockaddr_in addr; return (sizeof(addr.sin_port) == sizeof(char)) ? 0 : 1; } ], [ac_cv_sin_port_size=char]) if test "$ac_cv_sin_port_size" = unknown; then AC_MSG_ERROR([Failed to get size of sin_port in struct sockaddr_in.]) fi AC_DEFINE_UNQUOTED(in_port_t, unsigned $ac_cv_sin_port_size, [Define to `unsigned char', `unsigned short', `unsigned int' or `unsigned long' according with size of `sin_port' in `struct sockaddr_in', if , or does not define `in_port_t'.]) fi]) dnl * dnl * Check for sa_family_t. dnl * AC_DEFUN([AC_TYPE_SA_FAMILY_T], [AC_CACHE_CHECK([for sa_family_t], ac_cv_type_sa_family_t, [AC_TRY_COMPILE([ #include #include ], [ sa_family_t sa_family; ], [ac_cv_type_sa_family_t=yes], [ac_cv_type_sa_family_t=no])]) if test "$ac_cv_type_sa_family_t" != yes; then ac_cv_sa_family_size=unknown AC_TRY_RUN([ #include #include int main() { struct sockaddr addr; return (sizeof(addr.sa_family) == sizeof(long)) ? 0 : 1; } ], [ac_cv_sa_family_size=long]) AC_TRY_RUN([ #include #include int main() { struct sockaddr addr; return (sizeof(addr.sa_family) == sizeof(int)) ? 0 : 1; } ], [ac_cv_sa_family_size=int]) AC_TRY_RUN([ #include #include int main() { struct sockaddr addr; return (sizeof(addr.sa_family) == sizeof(short)) ? 0 : 1; } ], [ac_cv_sa_family_size=short]) AC_TRY_RUN([ #include #include int main() { struct sockaddr addr; return (sizeof(addr.sa_family) == sizeof(char)) ? 0 : 1; } ], [ac_cv_sa_family_size=char]) if test "$ac_cv_sa_family_size" = unknown; then AC_MSG_ERROR([Failed to get size of sa_family in struct sockaddr.]) fi AC_DEFINE_UNQUOTED(sa_family_t, unsigned $ac_cv_sa_family_size, [Define to `unsigned char', `unsigned short', `unsigned int' or `unsigned long' according with size of `sa_family' in `struct sockaddr', if or does not define `sa_family_t'.]) fi]) ebnetd-1.0.dfsg.1/m4/unionwait.m40000644000175000017500000000171207771714361016027 0ustar mhattamhattadnl * dnl * Check for union wait (taken from GNU make 3.75). dnl * AC_DEFUN([AC_UNION_WAIT], [AC_CHECK_FUNCS(waitpid) AC_CACHE_CHECK(for union wait, ac_cv_union_wait, [AC_TRY_LINK([ #include #include ],[ union wait status; int pid; pid = wait (&status); #ifdef WEXITSTATUS /* Some POSIXoid systems have both the new-style macros and the old union wait type, and they do not work together. If union wait conflicts with WEXITSTATUS et al, we don't want to use it at all. */ if (WEXITSTATUS (status) != 0) pid = -1; #ifdef WTERMSIG /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */ -- blow chunks here -- #endif #endif #ifdef HAVE_WAITPID /* Make sure union wait works with waitpid. */ pid = waitpid (-1, &status, 0); #endif ], [ac_cv_union_wait=yes], [ac_cv_union_wait=no])]) if test "$ac_cv_union_wait" = yes; then AC_DEFINE(HAVE_UNION_WAIT, 1, [Define to 1 if you have the `union wait' type in .]) fi]) ebnetd-1.0.dfsg.1/m4/utimbuf.m40000644000175000017500000000131007771714371015460 0ustar mhattamhattadnl * dnl * Check for struct utimbuf (taken from GNU fileutils 3.16). dnl * AC_DEFUN([AC_STRUCT_UTIMBUF], [AC_HEADER_TIME AC_CHECK_HEADERS(utime.h) AC_CACHE_CHECK(for struct utimbuf, ac_cv_have_struct_utimbuf, [AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME #include #include #else #ifdef HAVE_SYS_TIME_H #include #else #include #endif #endif #ifdef HAVE_UTIME_H #include #endif], [static struct utimbuf x; x.actime = x.modtime; ], [ac_cv_have_struct_utimbuf=yes], [ac_cv_have_struct_utimbuf=no])]) if test $ac_cv_have_struct_utimbuf = yes; then AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared -- usually in .]) fi ]) ebnetd-1.0.dfsg.1/m4/Makefile.am0000644000175000017500000000015607771712136015603 0ustar mhattamhattaEXTRA_DIST = eb4.m4 herrno.m4 libtool.m4 sockaddrin6.m4 sockinttypes.m4 \ in6addr.m4 unionwait.m4 utimbuf.m4 ebnetd-1.0.dfsg.1/m4/Makefile.in0000644000175000017500000002162507773515024015617 0ustar mhattamhatta# Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ # Copyright (C) 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. # 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ subdir = m4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/eb4.m4 \ $(top_srcdir)/m4/herrno.m4 $(top_srcdir)/m4/in6addr.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/sockaddrin6.m4 \ $(top_srcdir)/m4/sockinttypes.m4 $(top_srcdir)/m4/unionwait.m4 \ $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS = @COMPRESS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ EBCONF_EBINCS = @EBCONF_EBINCS@ EBCONF_EBLIBS = @EBCONF_EBLIBS@ EBCONF_INTLINCS = @EBCONF_INTLINCS@ EBCONF_INTLLIBS = @EBCONF_INTLLIBS@ EBCONF_PTHREAD_CFLAGS = @EBCONF_PTHREAD_CFLAGS@ EBCONF_PTHREAD_CPPFLAGS = @EBCONF_PTHREAD_CPPFLAGS@ EBCONF_PTHREAD_LDFLAGS = @EBCONF_PTHREAD_LDFLAGS@ EBCONF_ZLIBINCS = @EBCONF_ZLIBINCS@ EBCONF_ZLIBLIBS = @EBCONF_ZLIBLIBS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GZIPCMD = @GZIPCMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAILING_ADDRESS = @MAILING_ADDRESS@ MAILX = @MAILX@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = eb4.m4 herrno.m4 libtool.m4 sockaddrin6.m4 sockinttypes.m4 \ in6addr.m4 unionwait.m4 utimbuf.m4 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: 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"; \ $(mkdir_p) "$(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 installdirs: 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-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ 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: ebnetd-1.0.dfsg.1/README0000644000175000017500000000513207760002640014074 0ustar mhattamhatta EBNETD CD-ROM book servers This EBNETD distribution contains three server commands: ebnetd, ndtpd and ebhttpd. They are servers for accessing CD-ROM book on remote host via TCP/IP. They can run on UNIX derived systems. * ebnetd ebnetd is a server of EBNET protocol which is designed to communicate with EB Library. EB Library is a C library for accessing CD-ROM book. Also ndtpd and ebhttpd use EB Library. Using ebnetd, EB Library applications can access CD-ROM books on a remote server. For more details about EB Library, see: http://www.sra.co.jp/m-kasahr/eb/. * ndtpd ndtpd is an NDTP (Network Dictionary Transfer Protocol) server. The first implementation of the NDTP esrver is `dserver'. ndtpd has upper compatibility with dserver-2.2. The web page http://www.sra.co.jp/people/m-kasahr/ebnetd/ndtp-clients.html lists NDTP clients which can talk with ndtpd. * ebhttpd ebhttpd is a WWW (World Wide Web) server. It supprts HTTP/1.0 and HTTP/1.1 (Hypertext Transfer Protocol version 1.0 and 1.1). The servers support CD-ROM books of EB, EBG, EBXA, EBXA-C, S-EBXA and EPWING formats. CD-ROM books of those formats are popular in Japan. Since CD-ROM books themseves are stands on the ISO 9660 format, you can mount the discs by the same way as other ISO 9660 discs. The servers can run as a standalone daemons by default, but can also run as children of `inetd'. EBNETD uses EB Library to access CD-ROM book. Before install EBNETD, you have to install EB Library into your machine. EBNETD 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, or (at your option) any later version. EBNETD 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. In addition, you must follow the licenses of your CD-ROM books. Though EBNETD is free software, your books may not be free. Don't open your books to unlicensed hosts nor users. See the file NEWS for a list of major changes in the current release. See the file INSTALL for compilation and installation instructions. See also the file UPGRADE for upgrading from an earlier version. You can get the latest EBNETD from ftp://ftp.sra.co.jp/pub/misc/eb/ You can get information about EBNETD from http://www.sra.co.jp/people/m-kasahr/ebnetd/ Mail comments and bug reports to m-kasahr@sra.co.jp in Japanese or English. ebnetd-1.0.dfsg.1/configure.ac0000644000175000017500000001121507771712136015513 0ustar mhattamhattadnl * dnl * Process this file with autoconf to produce a configure script. dnl * AC_INIT(ebnetd, 1.0) AC_CONFIG_SRCDIR(ebnetd/ebnetd.c) AC_PREREQ(2.54) AM_INIT_AUTOMAKE dnl * dnl * Set mailing address. dnl * MAILING_ADDRESS='m-kasahr@sra.co.jp' AC_SUBST(MAILING_ADDRESS) AC_DEFINE_UNQUOTED(MAILING_ADDRESS, "$MAILING_ADDRESS", [Mailing address]) dnl * dnl * C Compiler dnl * AC_PROG_CC dnl * dnl * UNIX Variants dnl * AC_AIX AC_MINIX dnl * dnl * GNU libtool dnl * AC_PROG_LIBTOOL dnl * dnl * --enable-ipv6 option. dnl * AC_ARG_ENABLE(ipv6, AC_HELP_STRING([--enable-ipv6], [IPv6 support [[yes]] (if the system supports IPv6)]), [ENABLE_IPV6="${enableval}"], [ENABLE_IPV6='auto']) dnl * dnl * --with-logdir option. dnl * AC_ARG_WITH(logdir, AC_HELP_STRING([--with-logdir=DIR], [syslog files that ndtpdaily rotates by default are placed on DIR [[LOCALSTATEDIR/ndtpd/log]]]), [logdir="${withval}"], [logdir='$(localstatedir)/ndtpd/log']) AC_SUBST(logdir) dnl * dnl * EB Library 4.x. dnl * eb_LIB_EB4 dnl * dnl * Alternative Programs. dnl * AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_LN_S AC_PATH_PROG(PERL, perl, no) if test "$PERL" = no ; then AC_MSG_WARN(perl not found) PERL=/usr/bin/perl fi AC_PATH_PROGS(MAILX, Mail mailx, no, $PATH /usr/sbin) if test "$MAILX" = no ; then AC_MSG_WARN(neither Mail nor mailx found) MAILX=true fi AC_PATH_PROG(COMPRESS, compress, no) AC_PATH_PROG(GZIPCMD, gzip, no) AC_PATH_PROG(BZIP2, bzip2, no) dnl * dnl * Compiler Characteristics. dnl * AC_C_CONST dnl * dnl * Libraries. dnl * AC_CHECK_LIB(resolv, res_query) if test "$ac_cv_lib_resolv_res_query" = no ; then AC_CHECK_LIB(bind, res_query) fi AC_CHECK_LIB(nsl, gethostname) AC_CHECK_LIB(socket, socket) dnl * dnl * Library Functions. dnl * AC_FUNC_VPRINTF AC_FUNC_GETPGRP AC_FUNC_SETPGRP dnl AC_FUNC_SELECT_ARGTYPES AC_CHECK_FUNCS(getcwd getdtablesize getrlimit killpg memcpy psignal setenv \ setlocale setsid sigsetjmp sigsetmask sigprocmask strchr sysconf \ strsignal syslog utime vsyslog waitpid wait3) AC_REPLACE_FUNCS(memchr memmove memset strcasecmp strerror strtol) dnl * dnl * Header Files. dnl * AC_DECL_SYS_SIGLIST AC_DECL_H_ERRNO AC_HEADER_STDC AC_HEADER_DIRENT AC_CHECK_HEADERS(fcntl.h limits.h locale.h memory.h stdlib.h string.h \ sys/time.h sys/wait.h syslog.h unistd.h utime.h) dnl * dnl * Structures. dnl * AC_HEADER_TIME AC_HEADER_STAT AC_UNION_WAIT AC_STRUCT_UTIMBUF dnl * dnl * Typedefs and macros. dnl * AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_TYPE_UID_T AC_TYPE_PID_T AC_TYPE_MODE_T AC_TYPE_IN_PORT_T AC_TYPE_SA_FAMILY_T AC_TYPE_SOCKLEN_T AC_CHECK_TYPE(ssize_t, int) AC_TYPE_SIGNAL if test "$ac_cv_type_signal" = void; then AC_DEFINE(RETSIGTYPE_VOID, 1, [Define if the signal function returns void.]) fi dnl * dnl * Check for IPv6. dnl * AC_STRUCT_IN6_ADDR AC_STRUCT_SOCKADDR_IN6 AC_STRUCT_SOCKADDR_STORAGE AC_DECL_IN6ADDR_ANY AC_DECL_IN6ADDR_LOOPBACK AC_CHECK_FUNCS(getaddrinfo getnameinfo) if test "$ac_cv_func_getaddrinfo$ac_cv_func_getnameinfo" != yesyes ; then AC_LIBOBJ(getaddrinfo) fi AC_CHECK_FUNCS(inet_pton) if test "$ac_cv_struct_in6_addr$ac_cv_func_inet_pton" != yesyes ; then AC_LIBOBJ(inet_pton) fi if test "$ac_cv_decl_in6addr_any$ac_cv_decl_in6addr_loopback" != yesyes ; then AC_LIBOBJ(dummyin6) fi if test "$ENABLE_IPV6" = auto ; then if test "$ac_cv_struct_in6_addr$ac_cv_func_getaddrinfo" = yesyes ; then ENABLE_IPV6=yes else ENABLE_IPV6=no fi fi AC_MSG_CHECKING(for IPv6 support) if test "$ENABLE_IPV6" = yes ; then if test "$ac_cv_struct_in6_addr" = no ; then AC_MSG_ERROR(IPv6 not available) fi if test "${ac_cv_func_getaddrinfo}" = no ; then AC_MSG_ERROR(IPv6 not available) fi AC_DEFINE(ENABLE_IPV6, 1, [Define if build with IPv6 support]) fi AC_MSG_RESULT($ENABLE_IPV6) dnl * dnl * Output Files. dnl * AC_CONFIG_HEADER(config.h) AC_CONFIG_LINKS([ndtpd/book.c:ebnetd/book.c ebhttpd/book.c:ebnetd/book.c ndtpd/config.c:ebnetd/config.c ebhttpd/config.c:ebnetd/config.c ndtpd/defs.h.in:ebnetd/defs.h.in ebhttpd/defs.h.in:ebnetd/defs.h.in ndtpd/ndtpcheck.c:ebnetd/ebncheck.c ebhttpd/ebhtcheck.c:ebnetd/ebncheck.c ndtpd/ndtpcontrol.c:ebnetd/ebncontrol.c ebhttpd/ebhtcontrol.c:ebnetd/ebncontrol.c ndtpd/ndtpd.c:ebnetd/ebnetd.c ebhttpd/ebhttpd.c:ebnetd/ebnetd.c ndtpd/global.c:ebnetd/global.c ebhttpd/global.c:ebnetd/global.c ndtpd/misc.c:ebnetd/misc.c ebhttpd/misc.c:ebnetd/misc.c ndtpd/getopt_long.pl:ebnetd/getopt_long.pl ebhttpd/getopt_long.pl:ebnetd/getopt_long.pl]) AC_CONFIG_FILES([Makefile lib/Makefile ebtiny/Makefile ebnetd/Makefile ndtpd/Makefile ebhttpd/Makefile doc/Makefile doc-ja/Makefile m4/Makefile]) AC_OUTPUT ebnetd-1.0.dfsg.1/aclocal.m40000644000175000017500000010021407773514774015075 0ustar mhattamhatta# generated automatically by aclocal 1.8 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This file 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. # 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. # -*- Autoconf -*- # Copyright (C) 2002, 2003 Free Software Foundation, Inc. # Generated from amversion.in; do not edit by hand. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.8])]) # AM_AUX_DIR_EXPAND # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 6 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]) fi])]) # serial 5 -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # This macro actually does too much some checks are only needed if # your package does certain things. But this isn't really a big deal. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 11 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # -*- Autoconf -*- # Copyright (C) 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # Copyright (C) 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -m 0755 -p -- . 2>/dev/null; then mkdir_p='mkdir -m 0755 -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-m ./0755 ./-p ./--; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs) -m 0755' else mkdir_p='$(install_sh) -m 0755 -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # # Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # AM_PROG_INSTALL_STRIP # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) m4_include([m4/eb4.m4]) m4_include([m4/herrno.m4]) m4_include([m4/in6addr.m4]) m4_include([m4/libtool.m4]) m4_include([m4/sockaddrin6.m4]) m4_include([m4/sockinttypes.m4]) m4_include([m4/unionwait.m4]) m4_include([m4/utimbuf.m4]) ebnetd-1.0.dfsg.1/Makefile.am0000644000175000017500000000120207673055410015250 0ustar mhattamhattaACLOCAL_AMFLAGS = -I m4 SUBDIRS = lib ebtiny ebnetd ndtpd ebhttpd doc doc-ja m4 pkglocalstatedir = $(localstatedir)/$(PACKAGE) sysconf_DATA = ebnetd.conf.sample pkglocalstate_DATA = EXTRA_DIST = INSTALL-ja README-ja UPGRADE UPGRADE-ja \ ebnetd.conf.sample.in move-if-change CLEANFILES = ebnetd.conf.sample ebnetd.conf.sample.tmp ebnetd.conf.sample: ebnetd.conf.sample.in Makefile rm -f ebnetd.conf.sample sed -e 's;\@pkglocalstatedir\@;$(pkglocalstatedir);' \ -e 's;\@datadir\@;$(datadir);' \ $(srcdir)/ebnetd.conf.sample.in > ebnetd.conf.sample.tmp cp ebnetd.conf.sample.tmp ebnetd.conf.sample rm -f ebnetd.conf.sample.tmp ebnetd-1.0.dfsg.1/Makefile.in0000644000175000017500000005220507773515022015273 0ustar mhattamhatta# Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ # Copyright (C) 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. # 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ config.guess config.sub configure configure.ac depcomp \ install-sh ltmain.sh missing mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/eb4.m4 \ $(top_srcdir)/m4/herrno.m4 $(top_srcdir)/m4/in6addr.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/sockaddrin6.m4 \ $(top_srcdir)/m4/sockinttypes.m4 $(top_srcdir)/m4/unionwait.m4 \ $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive am__installdirs = $(DESTDIR)$(pkglocalstatedir) $(DESTDIR)$(sysconfdir) pkglocalstateDATA_INSTALL = $(INSTALL_DATA) sysconfDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkglocalstate_DATA) $(sysconf_DATA) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS = @COMPRESS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ EBCONF_EBINCS = @EBCONF_EBINCS@ EBCONF_EBLIBS = @EBCONF_EBLIBS@ EBCONF_INTLINCS = @EBCONF_INTLINCS@ EBCONF_INTLLIBS = @EBCONF_INTLLIBS@ EBCONF_PTHREAD_CFLAGS = @EBCONF_PTHREAD_CFLAGS@ EBCONF_PTHREAD_CPPFLAGS = @EBCONF_PTHREAD_CPPFLAGS@ EBCONF_PTHREAD_LDFLAGS = @EBCONF_PTHREAD_LDFLAGS@ EBCONF_ZLIBINCS = @EBCONF_ZLIBINCS@ EBCONF_ZLIBLIBS = @EBCONF_ZLIBLIBS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GZIPCMD = @GZIPCMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAILING_ADDRESS = @MAILING_ADDRESS@ MAILX = @MAILX@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = lib ebtiny ebnetd ndtpd ebhttpd doc doc-ja m4 pkglocalstatedir = $(localstatedir)/$(PACKAGE) sysconf_DATA = ebnetd.conf.sample pkglocalstate_DATA = EXTRA_DIST = INSTALL-ja README-ja UPGRADE UPGRADE-ja \ ebnetd.conf.sample.in move-if-change CLEANFILES = ebnetd.conf.sample ebnetd.conf.sample.tmp all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-pkglocalstateDATA: $(pkglocalstate_DATA) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(pkglocalstatedir) @list='$(pkglocalstate_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(pkglocalstateDATA_INSTALL) $$d$$p $(DESTDIR)$(pkglocalstatedir)/$$f"; \ $(pkglocalstateDATA_INSTALL) $$d$$p $(DESTDIR)$(pkglocalstatedir)/$$f; \ done uninstall-pkglocalstateDATA: @$(NORMAL_UNINSTALL) @list='$(pkglocalstate_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(pkglocalstatedir)/$$f"; \ rm -f $(DESTDIR)$(pkglocalstatedir)/$$f; \ done install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(sysconfdir) @list='$(sysconf_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(sysconfDATA_INSTALL) $$d$$p $(DESTDIR)$(sysconfdir)/$$f"; \ $(sysconfDATA_INSTALL) $$d$$p $(DESTDIR)$(sysconfdir)/$$f; \ done uninstall-sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(sysconfdir)/$$f"; \ rm -f $(DESTDIR)$(sysconfdir)/$$f; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if (etags --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ else \ include_option=--include; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(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: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(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 distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/ebnetd $(distdir)/m4 @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"; \ $(mkdir_p) "$(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 list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || mkdir "$(distdir)/$$subdir" \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="../$(top_distdir)" \ distdir="../$(distdir)/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && $(mkdir_p) "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: $(mkdir_p) $(DESTDIR)$(pkglocalstatedir) $(DESTDIR)$(sysconfdir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-pkglocalstateDATA install-exec-am: install-sysconfDATA install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-pkglocalstateDATA \ uninstall-sysconfDATA uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool clean-recursive \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-pkglocalstateDATA install-strip install-sysconfDATA \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-pkglocalstateDATA uninstall-sysconfDATA ebnetd.conf.sample: ebnetd.conf.sample.in Makefile rm -f ebnetd.conf.sample sed -e 's;\@pkglocalstatedir\@;$(pkglocalstatedir);' \ -e 's;\@datadir\@;$(datadir);' \ $(srcdir)/ebnetd.conf.sample.in > ebnetd.conf.sample.tmp cp ebnetd.conf.sample.tmp ebnetd.conf.sample rm -f ebnetd.conf.sample.tmp # 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: ebnetd-1.0.dfsg.1/config.h.in0000644000175000017500000002075007773515112015251 0ustar mhattamhatta/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if EB Library supports remote access. */ #undef EBCONF_ENABLE_EBNET /* Define if EB Library supports native language. */ #undef EBCONF_ENABLE_NLS /* Define if EB Library supports pthread. */ #undef EBCONF_ENABLE_PTHREAD /* Define if build with IPv6 support */ #undef ENABLE_IPV6 /* Define to 1 if the `getpgrp' function requires zero arguments. */ #undef GETPGRP_VOID /* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you don't. */ #undef HAVE_DECL_SYS_SIGLIST /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getdtablesize' function. */ #undef HAVE_GETDTABLESIZE /* Define to 1 if you have the `getnameinfo' function. */ #undef HAVE_GETNAMEINFO /* Define to 1 if you have the `getrlimit' function. */ #undef HAVE_GETRLIMIT /* Define to 1 if you have the `inet_pton' function. */ #undef HAVE_INET_PTON /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `killpg' function. */ #undef HAVE_KILLPG /* Define to 1 if you have the `bind' library (-lbind). */ #undef HAVE_LIBBIND /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the `memchr' function. */ #undef HAVE_MEMCHR /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `psignal' function. */ #undef HAVE_PSIGNAL /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `setsid' function. */ #undef HAVE_SETSID /* Define to 1 if you have the `sigprocmask' function. */ #undef HAVE_SIGPROCMASK /* Define to 1 if you have the `sigsetjmp' function. */ #undef HAVE_SIGSETJMP /* Define to 1 if you have the `sigsetmask' function. */ #undef HAVE_SIGSETMASK /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if defines `struct in6_addr' */ #undef HAVE_STRUCT_IN6_ADDR /* Define to 1 if defines `struct sockaddr_in6' */ #undef HAVE_STRUCT_SOCKADDR_IN6 /* Define to 1 if defines `struct sockaddr_storage' */ #undef HAVE_STRUCT_SOCKADDR_STORAGE /* Define to 1 if `struct utimbuf' is declared -- usually in . */ #undef HAVE_STRUCT_UTIMBUF /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF /* Define to 1 if you have the `syslog' function. */ #undef HAVE_SYSLOG /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the `union wait' type in . */ #undef HAVE_UNION_WAIT /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vsyslog' function. */ #undef HAVE_VSYSLOG /* Define to 1 if you have the `wait3' function. */ #undef HAVE_WAIT3 /* Define to 1 if you have the `waitpid' function. */ #undef HAVE_WAITPID /* Define to 1 if `h_errno' is declared by */ #undef H_ERRNO_DECLARED /* Define to 1 if `in6addr_any' is declared by */ #undef IN6ADDR_ANY_DECLARED /* Define to 1 if `in6addr_loopback' is declared by */ #undef IN6ADDR_LOOPBACK_DECLARED /* Mailing address */ #undef MAILING_ADDRESS /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if the C compiler supports function prototypes. */ #undef PROTOTYPES /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define if the signal function returns void. */ #undef RETSIGTYPE_VOID /* Define to 1 if the `setpgrp' function takes no argument. */ #undef SETPGRP_VOID /* Define to 1 if the `S_IS*' macros in do not work properly. */ #undef STAT_MACROS_BROKEN /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define like PROTOTYPES; this can be used by system headers. */ #undef __PROTOTYPES /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `unsigned char', `unsigned short', `unsigned int' or `unsigned long' according with size of `sin_port' in `struct sockaddr_in', if , or does not define `in_port_t'. */ #undef in_port_t /* Define to `int' if does not define. */ #undef mode_t /* Define to `long' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned char', `unsigned short', `unsigned int' or `unsigned long' according with size of `sa_family' in `struct sockaddr', if or does not define `sa_family_t'. */ #undef sa_family_t /* Define to `unsigned' if does not define. */ #undef size_t /* Define to `int' if or does not define. */ #undef socklen_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to `int' if doesn't define. */ #undef uid_t ebnetd-1.0.dfsg.1/configure0000755000175000017500000303674207773515012015147 0ustar mhattamhatta#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for ebnetd 1.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=`echo "$tagnames,CXX" | sed 's/^,//'` tagnames=`echo "$tagnames,F77" | sed 's/^,//'` # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='ebnetd' PACKAGE_TARNAME='ebnetd' PACKAGE_VERSION='1.0' PACKAGE_STRING='ebnetd 1.0' PACKAGE_BUGREPORT='' ac_unique_file="ebnetd/ebnetd.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAILING_ADDRESS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL logdir EBCONF_EBINCS EBCONF_EBLIBS EBCONF_ZLIBINCS EBCONF_ZLIBLIBS EBCONF_PTHREAD_CPPFLAGS EBCONF_PTHREAD_CFLAGS EBCONF_PTHREAD_LDFLAGS EBCONF_INTLINCS EBCONF_INTLLIBS PERL MAILX COMPRESS GZIPCMD BZIP2 LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures ebnetd 1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of ebnetd 1.0:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-ipv6 IPv6 support [yes] (if the system supports IPv6) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-logdir=DIR syslog files that ndtpdaily rotates by default are placed on DIR [LOCALSTATEDIR/ndtpd/log] --with-eb-conf=FILE eb.conf file is FILE [SYSCONFDIR/eb.conf] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF ebnetd configure 1.0 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by ebnetd $as_me 1.0, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version="1.8" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -m 0755 -p -- . 2>/dev/null; then mkdir_p='mkdir -m 0755 -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-m ./0755 ./-p ./--; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs) -m 0755' else mkdir_p='$(install_sh) -m 0755 -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='ebnetd' VERSION='1.0' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. MAILING_ADDRESS='m-kasahr@sra.co.jp' cat >>confdefs.h <<_ACEOF #define MAILING_ADDRESS "$MAILING_ADDRESS" _ACEOF ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_minix_config_h+set}" = set; then echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking minix/config.h usability" >&5 echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking minix/config.h presence" >&5 echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to the ebnetd lists. ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 fi if test $ac_cv_header_minix_config_h = yes; then MINIX=yes else MINIX= fi if test "$MINIX" = yes; then cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_1_SOURCE 2 _ACEOF cat >>confdefs.h <<\_ACEOF #define _MINIX 1 _ACEOF fi # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi; # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED fi echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `"$LD" -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) # win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='win32_libid' ;; darwin* | rhapsody*) # this will be overwritten by pass_all, but leave it in just in case lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.[012]) lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac lt_cv_deplibs_check_method=pass_all ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $host_os in irix5* | nonstopux*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) case $host_cpu in alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4331 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac need_locks="$enable_libtool_lock" for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to the ebnetd lists. ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:5423:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 testring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ = "XX$testring") >/dev/null 2>&1 && new_result=`expr "X$testring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` testring=$testring$testring done testring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris* | sysv5*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGISTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # # Check for any special shared library compilation flags. # lt_prog_cc_shlib= if test "$GCC" = no; then case $host_os in sco3.2v5*) lt_prog_cc_shlib='-belf' ;; esac fi if test -n "$lt_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_prog_compiler_static" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6454: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6458: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $CC in icc|ecc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; ccc) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic='-Kpic' lt_prog_compiler_static='-dn' ;; solaris*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6686: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6690: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6753: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:6757: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi4*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=no hardcode_shlibpath_var=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_shlibpath_var=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var " || \ test "X$hardcode_automatic"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which librarie types wil actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program 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. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `"$LD" -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_CXX=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX=' ' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then archive_cmds_need_lc_CXX=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='-undefined suppress' ;; *) # Darwin 1.3 on test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_CXX='-flat_namespace -undefined suppress' ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='-all_load $convenience' link_all_deplibs_CXX=yes fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd12*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_CXX='+b $libdir' hardcode_libdir_separator_CXX=: ;; ia64*) hardcode_libdir_flag_spec_CXX='-L$libdir' ;; *) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes archive_cmds_need_lc_CXX=no archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sco*) archive_cmds_need_lc_CXX=no case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.0-5 | solaris2.0-5.*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) archive_cmds_need_lc_CXX=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) lt_prog_compiler_pic_CXX='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11125: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11129: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11192: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11196: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var CXX" || \ test "X$hardcode_automatic_CXX"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $CC in icc|ecc) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; ccc) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_F77='-Kpic' lt_prog_compiler_static_F77='-dn' ;; solaris*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13441: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13445: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13508: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13512: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_F77=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi4*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then archive_cmds_need_lc_F77=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='-undefined suppress' ;; *) # Darwin 1.3 on test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_F77='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_F77='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='-all_load $convenience' link_all_deplibs_F77=yes fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; ia64*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; *) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; sco3.2v5*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4.2uw2*) archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_F77='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv5*) no_undefined_flag_F77=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var F77" || \ test "X$hardcode_automatic_F77"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15474: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15478: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $CC in icc|ecc) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; ccc) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_GCJ='-Kpic' lt_prog_compiler_static_GCJ='-dn' ;; solaris*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15706: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15710: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15773: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15777: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_GCJ=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi4*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then archive_cmds_need_lc_GCJ=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='-undefined suppress' ;; *) # Darwin 1.3 on test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_GCJ='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='-all_load $convenience' link_all_deplibs_GCJ=yes fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; ia64*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; *) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; sco3.2v5*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4.2uw2*) archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_GCJ='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv5*) no_undefined_flag_GCJ=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var GCJ" || \ test "X$hardcode_automatic_GCJ"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion # Check whether --enable-ipv6 or --disable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval="$enable_ipv6" ENABLE_IPV6="${enableval}" else ENABLE_IPV6='auto' fi; # Check whether --with-logdir or --without-logdir was given. if test "${with_logdir+set}" = set; then withval="$with_logdir" logdir="${withval}" else logdir='$(localstatedir)/ndtpd/log' fi; echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for function prototypes" >&5 echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6 if test "$ac_cv_prog_cc_stdc" != no; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define PROTOTYPES 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define __PROTOTYPES 1 _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi for ac_header in limits.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to the ebnetd lists. ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 if test "${ac_cv_type_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((ssize_t *) 0) return 0; if (sizeof (ssize_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_ssize_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ssize_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 if test $ac_cv_type_ssize_t = yes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi # Check whether --with-eb-conf or --without-eb-conf was given. if test "${with_eb_conf+set}" = set; then withval="$with_eb_conf" ebconf="${withval}" else ebconf=$sysconfdir/eb.conf fi; if test X$prefix = XNONE ; then PREFIX=$ac_default_prefix else PREFIX=$prefix fi ebconf=`echo X$ebconf | sed -e 's/^X//' -e 's;\${prefix};'"$PREFIX;g" \ -e 's;\$(prefix);'"$PREFIX;g"` echo "$as_me:$LINENO: checking for eb.conf" >&5 echo $ECHO_N "checking for eb.conf... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $ebconf" >&5 echo "${ECHO_T}$ebconf" >&6 if test -f ${ebconf} ; then . ${ebconf} else { { echo "$as_me:$LINENO: error: $ebconf not found" >&5 echo "$as_me: error: $ebconf not found" >&2;} { (exit 1); exit 1; }; } fi if test X$EBCONF_ENABLE_PTHREAD = Xyes ; then cat >>confdefs.h <<\_ACEOF #define EBCONF_ENABLE_PTHREAD 1 _ACEOF fi if test X$EBCONF_ENABLE_NLS = Xyes ; then cat >>confdefs.h <<\_ACEOF #define EBCONF_ENABLE_NLS 1 _ACEOF fi if test X$EBCONF_ENABLE_EBNET = Xyes ; then cat >>confdefs.h <<\_ACEOF #define EBCONF_ENABLE_EBNET 1 _ACEOF fi echo "$as_me:$LINENO: checking for EB Library" >&5 echo $ECHO_N "checking for EB Library... $ECHO_C" >&6 save_CPPFLAGS=$CPPFLAGS save_CFLAGS=$CFLAGS save_LDFLAGS=$LDFLAGS save_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $EBCONF_PTHREAD_CPPFLAGS $EBCONF_EBINCS $EBCONF_ZLIBINCS $EBCONF_INTLINCS" CFLAGS="$CFLAGS $EBCONF_PTHREAD_CFLAGS" LDFLAGS="$LDFAGS $EBCONF_PTHREAD_LDFLAGS" LIBS="$LIBS $EBCONF_EBLIBS $EBCONF_ZLIBLIBS $EBCONF_INTLLIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { eb_initialize_library(); return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then try_eb=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 try_eb=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS=$save_CPPFLAGS CFLAGS=$save_CFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS echo "$as_me:$LINENO: result: $try_eb" >&5 echo "${ECHO_T}$try_eb" >&6 if test ${try_eb} != yes ; then { { echo "$as_me:$LINENO: error: EB Library not available" >&5 echo "$as_me: error: EB Library not available" >&2;} { (exit 1); exit 1; }; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$PERL" = no ; then { echo "$as_me:$LINENO: WARNING: perl not found" >&5 echo "$as_me: WARNING: perl not found" >&2;} PERL=/usr/bin/perl fi for ac_prog in Mail mailx do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MAILX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAILX in [\\/]* | ?:[\\/]*) ac_cv_path_MAILX="$MAILX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH /usr/sbin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MAILX="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi MAILX=$ac_cv_path_MAILX if test -n "$MAILX"; then echo "$as_me:$LINENO: result: $MAILX" >&5 echo "${ECHO_T}$MAILX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$MAILX" && break done test -n "$MAILX" || MAILX="no" if test "$MAILX" = no ; then { echo "$as_me:$LINENO: WARNING: neither Mail nor mailx found" >&5 echo "$as_me: WARNING: neither Mail nor mailx found" >&2;} MAILX=true fi # Extract the first word of "compress", so it can be a program name with args. set dummy compress; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_COMPRESS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $COMPRESS in [\\/]* | ?:[\\/]*) ac_cv_path_COMPRESS="$COMPRESS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_COMPRESS="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_COMPRESS" && ac_cv_path_COMPRESS="no" ;; esac fi COMPRESS=$ac_cv_path_COMPRESS if test -n "$COMPRESS"; then echo "$as_me:$LINENO: result: $COMPRESS" >&5 echo "${ECHO_T}$COMPRESS" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GZIPCMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GZIPCMD in [\\/]* | ?:[\\/]*) ac_cv_path_GZIPCMD="$GZIPCMD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GZIPCMD="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GZIPCMD" && ac_cv_path_GZIPCMD="no" ;; esac fi GZIPCMD=$ac_cv_path_GZIPCMD if test -n "$GZIPCMD"; then echo "$as_me:$LINENO: result: $GZIPCMD" >&5 echo "${ECHO_T}$GZIPCMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "bzip2", so it can be a program name with args. set dummy bzip2; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_BZIP2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $BZIP2 in [\\/]* | ?:[\\/]*) ac_cv_path_BZIP2="$BZIP2" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_BZIP2="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_BZIP2" && ac_cv_path_BZIP2="no" ;; esac fi BZIP2=$ac_cv_path_BZIP2 if test -n "$BZIP2"; then echo "$as_me:$LINENO: result: $BZIP2" >&5 echo "${ECHO_T}$BZIP2" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for res_query in -lresolv" >&5 echo $ECHO_N "checking for res_query in -lresolv... $ECHO_C" >&6 if test "${ac_cv_lib_resolv_res_query+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char res_query (); int main () { res_query (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_resolv_res_query=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_res_query=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_query" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_res_query" >&6 if test $ac_cv_lib_resolv_res_query = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi if test "$ac_cv_lib_resolv_res_query" = no ; then echo "$as_me:$LINENO: checking for res_query in -lbind" >&5 echo $ECHO_N "checking for res_query in -lbind... $ECHO_C" >&6 if test "${ac_cv_lib_bind_res_query+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char res_query (); int main () { res_query (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bind_res_query=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bind_res_query=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bind_res_query" >&5 echo "${ECHO_T}$ac_cv_lib_bind_res_query" >&6 if test $ac_cv_lib_bind_res_query = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBBIND 1 _ACEOF LIBS="-lbind $LIBS" fi fi echo "$as_me:$LINENO: checking for gethostname in -lnsl" >&5 echo $ECHO_N "checking for gethostname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostname (); int main () { gethostname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostname" >&6 if test $ac_cv_lib_nsl_gethostname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi for ac_func in vprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define _doprnt to an innocuous variant, in case declares _doprnt. For example, HP-UX 11i declares gettimeofday. */ #define _doprnt innocuous__doprnt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _doprnt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub__doprnt) || defined (__stub____doprnt) choke me #else char (*f) () = _doprnt; #endif #ifdef __cplusplus } #endif int main () { return f != _doprnt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5 echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6 if test "${ac_cv_func_getpgrp_void+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use it with a single arg. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { getpgrp (0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_getpgrp_void=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_getpgrp_void=yes fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5 echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6 if test $ac_cv_func_getpgrp_void = yes; then cat >>confdefs.h <<\_ACEOF #define GETPGRP_VOID 1 _ACEOF fi echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5 echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6 if test "${ac_cv_func_setpgrp_void+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5 echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_UNISTD_H # include #endif int main () { /* If this system has a BSD-style setpgrp which takes arguments, setpgrp(1, 1) will fail with ESRCH and return -1, in that case exit successfully. */ exit (setpgrp (1,1) == -1 ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setpgrp_void=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_setpgrp_void=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5 echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6 if test $ac_cv_func_setpgrp_void = yes; then cat >>confdefs.h <<\_ACEOF #define SETPGRP_VOID 1 _ACEOF fi for ac_func in getcwd getdtablesize getrlimit killpg memcpy psignal setenv \ setlocale setsid sigsetjmp sigsetmask sigprocmask strchr sysconf \ strsignal syslog utime vsyslog waitpid wait3 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in memchr memmove memset strcasecmp strerror strtol do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case $LIBOBJS in "$ac_func.$ac_objext" | \ *" $ac_func.$ac_objext" | \ "$ac_func.$ac_objext "* | \ *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5 echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_sys_siglist+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* NetBSD declares sys_siglist in unistd.h. */ #if HAVE_UNISTD_H # include #endif int main () { #ifndef sys_siglist char *p = (char *) sys_siglist; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_sys_siglist=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_sys_siglist=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5 echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6 if test $ac_cv_have_decl_sys_siglist = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SYS_SIGLIST 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SYS_SIGLIST 0 _ACEOF fi echo "$as_me:$LINENO: checking for h_errno declaration in netdb.h" >&5 echo $ECHO_N "checking for h_errno declaration in netdb.h... $ECHO_C" >&6 if test "${ac_cv_decl_h_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { h_errno = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_decl_h_errno=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_decl_h_errno=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_decl_h_errno" >&5 echo "${ECHO_T}$ac_cv_decl_h_errno" >&6 if test "$ac_cv_decl_h_errno" = yes; then cat >>confdefs.h <<\_ACEOF #define H_ERRNO_DECLARED 1 _ACEOF fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in dir; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in x; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi fi for ac_header in fcntl.h limits.h locale.h memory.h stdlib.h string.h \ sys/time.h sys/wait.h syslog.h unistd.h utime.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to the ebnetd lists. ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 if test "${ac_cv_header_stat_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if defined(S_ISBLK) && defined(S_IFDIR) # if S_ISBLK (S_IFDIR) You lose. # endif #endif #if defined(S_ISBLK) && defined(S_IFCHR) # if S_ISBLK (S_IFCHR) You lose. # endif #endif #if defined(S_ISLNK) && defined(S_IFREG) # if S_ISLNK (S_IFREG) You lose. # endif #endif #if defined(S_ISSOCK) && defined(S_IFREG) # if S_ISSOCK (S_IFREG) You lose. # endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "You lose" >/dev/null 2>&1; then ac_cv_header_stat_broken=yes else ac_cv_header_stat_broken=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 echo "${ECHO_T}$ac_cv_header_stat_broken" >&6 if test $ac_cv_header_stat_broken = yes; then cat >>confdefs.h <<\_ACEOF #define STAT_MACROS_BROKEN 1 _ACEOF fi for ac_func in waitpid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for union wait" >&5 echo $ECHO_N "checking for union wait... $ECHO_C" >&6 if test "${ac_cv_union_wait+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { union wait status; int pid; pid = wait (&status); #ifdef WEXITSTATUS /* Some POSIXoid systems have both the new-style macros and the old union wait type, and they do not work together. If union wait conflicts with WEXITSTATUS et al, we don't want to use it at all. */ if (WEXITSTATUS (status) != 0) pid = -1; #ifdef WTERMSIG /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */ -- blow chunks here -- #endif #endif #ifdef HAVE_WAITPID /* Make sure union wait works with waitpid. */ pid = waitpid (-1, &status, 0); #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_union_wait=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_union_wait=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_union_wait" >&5 echo "${ECHO_T}$ac_cv_union_wait" >&6 if test "$ac_cv_union_wait" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNION_WAIT 1 _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi for ac_header in utime.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to the ebnetd lists. ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for struct utimbuf" >&5 echo $ECHO_N "checking for struct utimbuf... $ECHO_C" >&6 if test "${ac_cv_have_struct_utimbuf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef TIME_WITH_SYS_TIME #include #include #else #ifdef HAVE_SYS_TIME_H #include #else #include #endif #endif #ifdef HAVE_UTIME_H #include #endif int main () { static struct utimbuf x; x.actime = x.modtime; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_struct_utimbuf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_struct_utimbuf=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_struct_utimbuf" >&5 echo "${ECHO_T}$ac_cv_have_struct_utimbuf" >&6 if test $ac_cv_have_struct_utimbuf = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_UTIMBUF 1 _ACEOF fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((mode_t *) 0) return 0; if (sizeof (mode_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi echo "$as_me:$LINENO: checking for in_port_t" >&5 echo $ECHO_N "checking for in_port_t... $ECHO_C" >&6 if test "${ac_cv_type_in_port_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { in_port_t in_port; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_in_port_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_in_port_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_in_port_t" >&5 echo "${ECHO_T}$ac_cv_type_in_port_t" >&6 if test "$ac_cv_type_in_port_t" != yes; then ac_cv_sin_port_size=unknown if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main() { struct sockaddr_in addr; return (sizeof(addr.sin_port) == sizeof(long)) ? 0 : 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sin_port_size=long else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main() { struct sockaddr_in addr; return (sizeof(addr.sin_port) == sizeof(int)) ? 0 : 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sin_port_size=int else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main() { struct sockaddr_in addr; return (sizeof(addr.sin_port) == sizeof(short)) ? 0 : 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sin_port_size=short else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main() { struct sockaddr_in addr; return (sizeof(addr.sin_port) == sizeof(char)) ? 0 : 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sin_port_size=char else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cv_sin_port_size" = unknown; then { { echo "$as_me:$LINENO: error: Failed to get size of sin_port in struct sockaddr_in." >&5 echo "$as_me: error: Failed to get size of sin_port in struct sockaddr_in." >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define in_port_t unsigned $ac_cv_sin_port_size _ACEOF fi echo "$as_me:$LINENO: checking for sa_family_t" >&5 echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6 if test "${ac_cv_type_sa_family_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { sa_family_t sa_family; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_sa_family_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_sa_family_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5 echo "${ECHO_T}$ac_cv_type_sa_family_t" >&6 if test "$ac_cv_type_sa_family_t" != yes; then ac_cv_sa_family_size=unknown if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main() { struct sockaddr addr; return (sizeof(addr.sa_family) == sizeof(long)) ? 0 : 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sa_family_size=long else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main() { struct sockaddr addr; return (sizeof(addr.sa_family) == sizeof(int)) ? 0 : 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sa_family_size=int else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main() { struct sockaddr addr; return (sizeof(addr.sa_family) == sizeof(short)) ? 0 : 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sa_family_size=short else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main() { struct sockaddr addr; return (sizeof(addr.sa_family) == sizeof(char)) ? 0 : 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sa_family_size=char else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cv_sa_family_size" = unknown; then { { echo "$as_me:$LINENO: error: Failed to get size of sa_family in struct sockaddr." >&5 echo "$as_me: error: Failed to get size of sa_family in struct sockaddr." >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define sa_family_t unsigned $ac_cv_sa_family_size _ACEOF fi echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { socklen_t socklen; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test "$ac_cv_type_socklen_t" != yes; then cat >>confdefs.h <<\_ACEOF #define socklen_t int _ACEOF fi echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 if test "${ac_cv_type_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((ssize_t *) 0) return 0; if (sizeof (ssize_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_ssize_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ssize_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 if test $ac_cv_type_ssize_t = yes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF if test "$ac_cv_type_signal" = void; then cat >>confdefs.h <<\_ACEOF #define RETSIGTYPE_VOID 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct in6_addr" >&5 echo $ECHO_N "checking for struct in6_addr... $ECHO_C" >&6 if test "${ac_cv_struct_in6_addr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { struct in6_addr address; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_struct_in6_addr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_in6_addr=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_in6_addr" >&5 echo "${ECHO_T}$ac_cv_struct_in6_addr" >&6 if test "$ac_cv_struct_in6_addr" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_IN6_ADDR 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5 echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6 if test "${ac_cv_struct_sockaddr_in6+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { struct sockaddr_in6 address; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_struct_sockaddr_in6=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_sockaddr_in6=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_in6" >&5 echo "${ECHO_T}$ac_cv_struct_sockaddr_in6" >&6 if test "$ac_cv_struct_sockaddr_in6" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_SOCKADDR_IN6 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5 echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6 if test "${ac_cv_struct_sockaddr_storage+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { struct sockaddr_storage address; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_struct_sockaddr_storage=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_sockaddr_storage=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 echo "${ECHO_T}$ac_cv_struct_sockaddr_storage" >&6 if test "$ac_cv_struct_sockaddr_storage" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_SOCKADDR_STORAGE 1 _ACEOF fi if test $ac_cv_struct_in6_addr = no ; then ac_cv_decl_in6addr_any=no else echo "$as_me:$LINENO: checking for in6addr_any declaration in netinet/in.h" >&5 echo $ECHO_N "checking for in6addr_any declaration in netinet/in.h... $ECHO_C" >&6 if test "${ac_cv_decl_in6addr_any+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { unsigned char *address; address = (char *)&in6addr_any; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_decl_in6addr_any=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_decl_in6addr_any=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_decl_in6addr_any" >&5 echo "${ECHO_T}$ac_cv_decl_in6addr_any" >&6 if test "$ac_cv_decl_in6addr_any" = yes; then cat >>confdefs.h <<\_ACEOF #define IN6ADDR_ANY_DECLARED 1 _ACEOF fi fi if test $ac_cv_struct_in6_addr = no ; then ac_cv_decl_in6addr_loopback=no else echo "$as_me:$LINENO: checking for in6addr_loopback declaration in netinet/in.h" >&5 echo $ECHO_N "checking for in6addr_loopback declaration in netinet/in.h... $ECHO_C" >&6 if test "${ac_cv_decl_in6addr_loopback+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { unsigned char *address; address = (char *)&in6addr_loopback; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_decl_in6addr_loopback=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_decl_in6addr_loopback=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_decl_in6addr_loopback" >&5 echo "${ECHO_T}$ac_cv_decl_in6addr_loopback" >&6 if test "$ac_cv_decl_in6addr_loopback" = yes; then cat >>confdefs.h <<\_ACEOF #define IN6ADDR_LOOPBACK_DECLARED 1 _ACEOF fi fi for ac_func in getaddrinfo getnameinfo do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "$ac_cv_func_getaddrinfo$ac_cv_func_getnameinfo" != yesyes ; then case $LIBOBJS in "getaddrinfo.$ac_objext" | \ *" getaddrinfo.$ac_objext" | \ "getaddrinfo.$ac_objext "* | \ *" getaddrinfo.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext" ;; esac fi for ac_func in inet_pton do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "$ac_cv_struct_in6_addr$ac_cv_func_inet_pton" != yesyes ; then case $LIBOBJS in "inet_pton.$ac_objext" | \ *" inet_pton.$ac_objext" | \ "inet_pton.$ac_objext "* | \ *" inet_pton.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS inet_pton.$ac_objext" ;; esac fi if test "$ac_cv_decl_in6addr_any$ac_cv_decl_in6addr_loopback" != yesyes ; then case $LIBOBJS in "dummyin6.$ac_objext" | \ *" dummyin6.$ac_objext" | \ "dummyin6.$ac_objext "* | \ *" dummyin6.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS dummyin6.$ac_objext" ;; esac fi if test "$ENABLE_IPV6" = auto ; then if test "$ac_cv_struct_in6_addr$ac_cv_func_getaddrinfo" = yesyes ; then ENABLE_IPV6=yes else ENABLE_IPV6=no fi fi echo "$as_me:$LINENO: checking for IPv6 support" >&5 echo $ECHO_N "checking for IPv6 support... $ECHO_C" >&6 if test "$ENABLE_IPV6" = yes ; then if test "$ac_cv_struct_in6_addr" = no ; then { { echo "$as_me:$LINENO: error: IPv6 not available" >&5 echo "$as_me: error: IPv6 not available" >&2;} { (exit 1); exit 1; }; } fi if test "${ac_cv_func_getaddrinfo}" = no ; then { { echo "$as_me:$LINENO: error: IPv6 not available" >&5 echo "$as_me: error: IPv6 not available" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<\_ACEOF #define ENABLE_IPV6 1 _ACEOF fi echo "$as_me:$LINENO: result: $ENABLE_IPV6" >&5 echo "${ECHO_T}$ENABLE_IPV6" >&6 ac_config_headers="$ac_config_headers config.h" ac_config_links="$ac_config_links ndtpd/book.c:ebnetd/book.c ebhttpd/book.c:ebnetd/book.c ndtpd/config.c:ebnetd/config.c ebhttpd/config.c:ebnetd/config.c ndtpd/defs.h.in:ebnetd/defs.h.in ebhttpd/defs.h.in:ebnetd/defs.h.in ndtpd/ndtpcheck.c:ebnetd/ebncheck.c ebhttpd/ebhtcheck.c:ebnetd/ebncheck.c ndtpd/ndtpcontrol.c:ebnetd/ebncontrol.c ebhttpd/ebhtcontrol.c:ebnetd/ebncontrol.c ndtpd/ndtpd.c:ebnetd/ebnetd.c ebhttpd/ebhttpd.c:ebnetd/ebnetd.c ndtpd/global.c:ebnetd/global.c ebhttpd/global.c:ebnetd/global.c ndtpd/misc.c:ebnetd/misc.c ebhttpd/misc.c:ebnetd/misc.c ndtpd/getopt_long.pl:ebnetd/getopt_long.pl ebhttpd/getopt_long.pl:ebnetd/getopt_long.pl" ac_config_files="$ac_config_files Makefile lib/Makefile ebtiny/Makefile ebnetd/Makefile ndtpd/Makefile ebhttpd/Makefile doc/Makefile doc-ja/Makefile m4/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by ebnetd $as_me 1.0, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration links: $config_links Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ ebnetd config.status 1.0 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "ebtiny/Makefile" ) CONFIG_FILES="$CONFIG_FILES ebtiny/Makefile" ;; "ebnetd/Makefile" ) CONFIG_FILES="$CONFIG_FILES ebnetd/Makefile" ;; "ndtpd/Makefile" ) CONFIG_FILES="$CONFIG_FILES ndtpd/Makefile" ;; "ebhttpd/Makefile" ) CONFIG_FILES="$CONFIG_FILES ebhttpd/Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc-ja/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc-ja/Makefile" ;; "m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "ndtpd/book.c" ) CONFIG_LINKS="$CONFIG_LINKS ndtpd/book.c:ebnetd/book.c" ;; "ebhttpd/book.c" ) CONFIG_LINKS="$CONFIG_LINKS ebhttpd/book.c:ebnetd/book.c" ;; "ndtpd/config.c" ) CONFIG_LINKS="$CONFIG_LINKS ndtpd/config.c:ebnetd/config.c" ;; "ebhttpd/config.c" ) CONFIG_LINKS="$CONFIG_LINKS ebhttpd/config.c:ebnetd/config.c" ;; "ndtpd/defs.h.in" ) CONFIG_LINKS="$CONFIG_LINKS ndtpd/defs.h.in:ebnetd/defs.h.in" ;; "ebhttpd/defs.h.in" ) CONFIG_LINKS="$CONFIG_LINKS ebhttpd/defs.h.in:ebnetd/defs.h.in" ;; "ndtpd/ndtpcheck.c" ) CONFIG_LINKS="$CONFIG_LINKS ndtpd/ndtpcheck.c:ebnetd/ebncheck.c" ;; "ebhttpd/ebhtcheck.c" ) CONFIG_LINKS="$CONFIG_LINKS ebhttpd/ebhtcheck.c:ebnetd/ebncheck.c" ;; "ndtpd/ndtpcontrol.c" ) CONFIG_LINKS="$CONFIG_LINKS ndtpd/ndtpcontrol.c:ebnetd/ebncontrol.c" ;; "ebhttpd/ebhtcontrol.c" ) CONFIG_LINKS="$CONFIG_LINKS ebhttpd/ebhtcontrol.c:ebnetd/ebncontrol.c" ;; "ndtpd/ndtpd.c" ) CONFIG_LINKS="$CONFIG_LINKS ndtpd/ndtpd.c:ebnetd/ebnetd.c" ;; "ebhttpd/ebhttpd.c" ) CONFIG_LINKS="$CONFIG_LINKS ebhttpd/ebhttpd.c:ebnetd/ebnetd.c" ;; "ndtpd/global.c" ) CONFIG_LINKS="$CONFIG_LINKS ndtpd/global.c:ebnetd/global.c" ;; "ebhttpd/global.c" ) CONFIG_LINKS="$CONFIG_LINKS ebhttpd/global.c:ebnetd/global.c" ;; "ndtpd/misc.c" ) CONFIG_LINKS="$CONFIG_LINKS ndtpd/misc.c:ebnetd/misc.c" ;; "ebhttpd/misc.c" ) CONFIG_LINKS="$CONFIG_LINKS ebhttpd/misc.c:ebnetd/misc.c" ;; "ndtpd/getopt_long.pl" ) CONFIG_LINKS="$CONFIG_LINKS ndtpd/getopt_long.pl:ebnetd/getopt_long.pl" ;; "ebhttpd/getopt_long.pl" ) CONFIG_LINKS="$CONFIG_LINKS ebhttpd/getopt_long.pl:ebnetd/getopt_long.pl" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@MAILING_ADDRESS@,$MAILING_ADDRESS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@logdir@,$logdir,;t t s,@EBCONF_EBINCS@,$EBCONF_EBINCS,;t t s,@EBCONF_EBLIBS@,$EBCONF_EBLIBS,;t t s,@EBCONF_ZLIBINCS@,$EBCONF_ZLIBINCS,;t t s,@EBCONF_ZLIBLIBS@,$EBCONF_ZLIBLIBS,;t t s,@EBCONF_PTHREAD_CPPFLAGS@,$EBCONF_PTHREAD_CPPFLAGS,;t t s,@EBCONF_PTHREAD_CFLAGS@,$EBCONF_PTHREAD_CFLAGS,;t t s,@EBCONF_PTHREAD_LDFLAGS@,$EBCONF_PTHREAD_LDFLAGS,;t t s,@EBCONF_INTLINCS@,$EBCONF_INTLINCS,;t t s,@EBCONF_INTLLIBS@,$EBCONF_INTLLIBS,;t t s,@PERL@,$PERL,;t t s,@MAILX@,$MAILX,;t t s,@COMPRESS@,$COMPRESS,;t t s,@GZIPCMD@,$GZIPCMD,;t t s,@BZIP2@,$BZIP2,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_LINKS section. # for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5 echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;} if test ! -r $srcdir/$ac_source; then { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} { (exit 1); exit 1; }; } fi rm -f $ac_dest # Make relative symlinks. ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dest_dir" else as_dir="$ac_dest_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dest_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dest_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dest_dir" != .; then ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dest_dir";; *) case "$ac_dest_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dest_dir";; *) ac_abs_builddir=`pwd`/"$ac_dest_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $srcdir in [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;; esac # Try a symlink, then a hard link, then a copy. ln -s $ac_rel_source $ac_dest 2>/dev/null || ln $srcdir/$ac_source $ac_dest 2>/dev/null || cp -p $srcdir/$ac_source $ac_dest || { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&5 echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&2;} { (exit 1); exit 1; }; } done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi ebnetd-1.0.dfsg.1/AUTHORS0000644000175000017500000000004707673055327014301 0ustar mhattamhattaMotoyuki Kasahara ebnetd-1.0.dfsg.1/COPYING0000644000175000017500000004310507673055410014257 0ustar mhattamhatta GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program 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. This program 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ebnetd-1.0.dfsg.1/ChangeLog0000644000175000017500000000573607773447570015023 0ustar mhattamhatta2003-12-28 Motoyuki Kasahara * ebhttpd/httpdate.c, ebhttpd/httpdate.h, ebhttpd/generator.c, ebhttpd/httprequest.c, ebhttpd/httprequest.h: Fix TIME_WITH_SYS_TIME check. 2003-12-22 Motoyuki Kasahara * configure.ac (EB_LIB_eb3): Call EB_LIB_eb4 instead. * m4/eb3.m4: Substitute the file with `eb4.m4'. * m4/Makefile.am (EXTRA_DIST): Distribute `eb4.m4' instead of `eb3.m4'. * Use Autoconf-2.59, Automake-1.8 and Libtool-1.5. * m4/eb4.m4, m4/herrno.m4, m4/in6addr.m4, m4/libtool.m4, m4/sockaddrin6.m4, m4/sockinttypes.m4, m4/unionwait.m4, m4/utimbuf.m4: Quote function name to be defined in AC_DEFUN. 2003-11-23 Motoyuki Kasahara * config.guess, config.sub, depcomp, install-sh, missing, mkinstalldirs, doc/mdate-sh, doc-ja/mdate-sh: Import from Autocomake-1.7.9. 2003-11-17 Motoyuki Kasahara * ebhttpd/httpmisc.c (http_parse_connection, http_parse_transfer_coding, http_parse_content_length, http_parse_host): Ensure parsing result is initialized even when input string has not a valid form. 2003-10-04 Motoyuki Kasahara * ebnetd/Makefile.am, ndtpd/Makefile.am, ebhttpd/Makefile.am: Insert a comment "automatically generated from defs.h.in" into defs.h. 2003-09-21 Motoyuki Kasahara * libebutils/getopt.c: Include if exists. 2003-09-15 Motoyuki Kasahara * ebnetd/fdcache.h, ebnetd/fdcache.c: Add `path_hash' to FDCache_Entry in order to find file descriptor in a cache table quickly. 2003-09-14 Motoyuki Kasahara * ebnetd/fdcache.h, ebnetd/fdcache.c: New files. * ebnetd/Makefile.am (ebnetd_SOURCES): Add fdcache.c. * ebnetd/Makefile.am (noinst_HEADERS): Add fdcache.h. * ebnetd/ebnet.c: Use the fdcache module. 2003-06-09 Motoyuki Kasahara * Version 1.0beta0. * ndtpd/ndtpstat.in: Output a special message if there is no access. 2003-06-01 Motoyuki Kasahara * ndtpd/global.c, ndtpd/defs.h.in (alias_eiwa, alias_waei, alias_kojien): Removed. * ndtpd/config.c (cf_book_alias_eiwa, cf_book_alias_waei, cf_book_alias_kojien): Removed. 2003-05-24 Motoyuki Kasahara * lib/linebuf.c (read_line_buffer): Fix a bug that timeout never occurs. 2003-05-03 Motoyuki Kasahara * lib/ioall.h: (write_string_all): Fix the function declaration. 2003-04-29 Motoyuki Kasahara * lib/ticket.c, lib/ticket.h (have_ticket): New function. 2003-04-19 Motoyuki Kasahara * lib/confutil.c (parse_tcp_port, parse_udp_port): Check if the string string represents an integer in 0...65535. * ebhttpd/httpmisc.c, ebhttpd/httprequest.h, ebnetd/config.c, ebnetd/global.c, lib/confutil.c, lib/confutil.h, lib/getaddrinfo.c, lib/dummyin6.h: Use `in_port_t' rather than `int'. * lib/serverport.c, lib/serverport.h, lib/dummyin6.h: Use `sa_family_t' rather than `int'. ebnetd-1.0.dfsg.1/INSTALL0000644000175000017500000002066107673055364014267 0ustar mhattamhattaThis software uses EB Library to access CD-ROM books. Before installing the package, you need to install EB Library 3.3 or later version. You can get the latest EB Library from ftp://ftp.sra.co.jp/pub/misc/eb/ You can get information about EB Library from http://www.sra.co.jp/people/m-kasahr/eb/ Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. Optional Feature List ===================== `configure' in this package recognizes the following `--enable-' and `--with-' options. `--with-logdir=DIR' Syslog files that `ndtpdaily' rotates by default are placed on DIR. The default value is `LOCALSTATEDIR/ndtpd/log'. `--with-eb-conf=FILE' Read EB Libfary configuration file in FILE. The default value is `SYSCONFDIR/eb.conf'. `--with-gnu-ld' Assume the C compiler uses GNU ld. The default value is `no'. ebnetd-1.0.dfsg.1/NEWS0000644000175000017500000000053707756155301013727 0ustar mhattamhattaMajor changes in release 1.0: * ebnetd has a table of file descriptor cache now. * ebhttpd is more robust against HTTP request with corrupt header. Major changes in release 1.0beta0: * ndtpd no longer support `alias-eiwa', `alias-waei' or `alias-kojien'. * The defulat configuration file for ndtpd and ebhttpd is `ebnetd.conf', not `ndtpd.conf'. ebnetd-1.0.dfsg.1/config.guess0000755000175000017500000012214107760003723015537 0ustar mhattamhatta#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-10-03' # This file 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. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` # GNU/FreeBSD systems have a "k" prefix to indicate we are using # FreeBSD's kernel, but not the complete OS. case ${LIBC} in gnu) kernel_only='k' ;; esac echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ebnetd-1.0.dfsg.1/config.sub0000755000175000017500000007340607760003725015215 0ustar mhattamhatta#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-08-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ebnetd-1.0.dfsg.1/depcomp0000755000175000017500000003305207760003715014577 0ustar mhattamhatta#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000, 2003 Free Software Foundation, Inc. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 ebnetd-1.0.dfsg.1/install-sh0000755000175000017500000002017407771714414015236 0ustar mhattamhatta#!/bin/sh # install - install a program, script, or datafile scriptversion=2003-09-24.23 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename= transform_arg= instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= usage="Usage: $0 [OPTION]... SRCFILE DSTFILE or: $0 -d DIR1 DIR2... In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. In the second, create the directory path DIR. Options: -b=TRANSFORMBASENAME -c copy source (using $cpprog) instead of moving (using $mvprog). -d create directories instead of installing files. -g GROUP $chgrp installed files to GROUP. -m MODE $chmod installed files to MODE. -o USER $chown installed files to USER. -s strip installed files (using $stripprog). -t=TRANSFORM --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) if test -z "$src"; then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if test -z "$src"; then echo "$0: no input file specified." >&2 exit 1 fi # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then instcmd=: chmodcmd= else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst"; then echo "$0: no destination specified." >&2 exit 1 fi # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift test -d "$pathcomp" || $mkdirprog "$pathcomp" pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $instcmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else # If we're going to rename the final executable, determine the name now. if test -z "$transformarg"; then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename \ | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename. test -z "$dstfile" && dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now remove or move aside any old file at destination location. We # try this two ways since rm can't unlink itself on some systems and # the destination file might be busy for other reasons. In this case, # the final cleanup might fail but the new file should still install # successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ebnetd-1.0.dfsg.1/ltmain.sh0000644000175000017500000053772607771714424015073 0ustar mhattamhatta# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program 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. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then win32_libid_type="x86 archive import" else win32_libid_type="x86 archive static" fi fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # End of Shell function definitions ##################################### # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit 1 ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2003 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit 0 ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" done exit 0 ;; --debug) $echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: ;; --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_output= arg_mode=normal libobj= for arg do case "$arg_mode" in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi arg_mode=target continue ;; -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit 1 ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. if test -n "$available_tags" && test -z "$tagname"; then case $base_compile in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" case "$base_compile " in "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit 1 # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi $echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" base_compile="$base_compile $arg" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit 1 fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit 1 else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit 1 fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # gcc -m* arguments should be passed to the linker via $compiler_flags # in order to pass architecture information to the linker # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo # but this is not reliable with gcc because gcc may use -mfoo to # select a different linker, different libraries, etc, while # -Wl,-mfoo simply passes -mfoo to the linker. -m*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" if test "$with_gcc" = "yes" ; then compiler_flags="$compiler_flags $arg" fi continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit 1 fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit 1 else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base link # command doesn't match the default compiler. if test -n "$available_tags" && test -z "$tagname"; then case $base_compile in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" case $base_compile in "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) # The compiler in $compile_command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit 1 # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplcations in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do # Search the libtool library lib="$searchdir/lib${name}.la" if test -f "$lib"; then found=yes break fi done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$extract_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$old_archive_from_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against it, someone # is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="-L$inst_prefix_dir$libdir $add_dir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="-L$inst_prefix_dir$libdir $add_dir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi newlib_search_path="$newlib_search_path $path" path="" fi ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$deplibs $depdepl" ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $revision in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $age in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval cmds=\"$module_expsym_cmds\" else eval cmds=\"$module_cmds\" fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else eval cmds=\"$archive_cmds\" fi fi if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$save_output-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$save_output-${k}.$objext k=`expr $k + 1` output=$output_objdir/$save_output-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadale object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else eval cmds=\"$archive_cmds\" fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit 0 fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case $0 in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) cwrappersource=`$echo ${objdir}/lt-${output}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) #define HAVE_DOS_BASED_FILE_SYSTEM #ifndef DIR_SEPARATOR_2 #define DIR_SEPARATOR_2 '\\' #endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } char * basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return (char *) base; } char * fnqualify(const char *path) { size_t size; char *p; char tmp[LT_PATHMAX + 1]; assert(path != NULL); /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha (path[0]) && path[1] == ':') return xstrdup (path); #endif if (IS_DIR_SEPARATOR (path[0])) return xstrdup (path); /* prepend the current directory */ /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ p = XMALLOC(char, size); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); return p; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # GNU ar 2.10+ was changed to match POSIX; thus no paths are # encoded into archives. This makes 'ar r' malfunction in # this piecewise linking case whenever conflicting object # names appear in distinct ar calls; check, warn and compensate. if (for obj in $save_oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 AR_FLAGS=cq fi # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit 1 fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit 1 fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit 1 fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $0 --finish$current_libdirs' else exit 0 fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit 0 $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit 0 fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit 1 fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit 0 ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: ebnetd-1.0.dfsg.1/missing0000755000175000017500000002403207760003701014612 0ustar mhattamhatta#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program 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, or (at your option) # any later version. # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 ebnetd-1.0.dfsg.1/mkinstalldirs0000755000175000017500000000556107771714417016046 0ustar mhattamhatta#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2003-11-08.23 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit 0 ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./-- && rmdir ./-- fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./-- "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ebnetd-1.0.dfsg.1/INSTALL-ja0000644000175000017500000002361707673055352014660 0ustar mhattamhattaこのソフトウェアは、CD-ROM 書籍にアクセスするために EB ライブラリを使 用しています。本パッケージをインストールする前に、EB ライブラリ 3.3 もしくはそれ以降のバージョンをインストールする必要があります。 最新の EB ライブラリは次のところから入手できます。 ftp://ftp.sra.co.jp/pub/misc/eb/ EB ライブラリに関する情報は次のところから得ることができます。 http://www.sra.co.jp/people/m-kasahr/eb/ 基本的なインストール方法 ======================== 以下に記したのは、一般的なインストールの方法です。 `configure' シェルスクリプトは、コンパイル中に使用される、システム依 存のチェック項目の値を正しく推定しようと努めます。`configure'は、判定 した値を利用してパッケージ中の各ディレクトリの `Makefile'を生成します。 加えて、システムに依存する定義内容を記した `.h' ファイルを一つもしくは いくつか生成することもあります。最後に、`configure' は `config.status' というシェルスクリプト `config.cache'、`config.log' というファイルを生 成します。`config.status' は、現在のコンフィグレーションを後で再度生成 するときに用います。 `config.cache'は、再度コンフィグレーションを行う ときにスピードアップを図るために、テストの結果を保存してあります。 `config.log' には、(主に `configure' のデバッグに役立つような) コンピュー タの出力が記録されています。 あなたがパッケージをコンパイルするにあたって、特別なことをしなければ ならなかったときは、`configure' がどのような判定をしていたのかを調べて みて、`README' に記されたアドレスに宛てて、相違点や指摘をメールで送っ て下さい。 そうすれば、次回のリリースに向けて検討されると思います。も し、`config.cache' に見られたくない結果が記録されている場合は、その部 分を削除したり編集したりしても構いません。 `configure.in' というファイルは、`autoconf' というプログラムが `configure' を生成するときに参照します。 あなたにとって `configure.in' というファイルが必要になるのは、 `configure.in' の内容を変更したい場合 か、`autoconf' のもっと新しいバージョンで `configure' を生成したい場合 の、いずれかだけです。 パッケージの最も単純なコンパイル方法は次の通りです。 1. パッケージのソースコードが置かれているディレクトリに移動 (`cd') し、 あなたのシステム向けのコンフィグレーションを行うために `./configure' を実行します。 あなたが古いバージョンの System V で `csh' を使用している場合は、`csh' 自身がスクリプトを実行してしま わないように、 `sh ./configure' とする必要があるかも知れません。 `configure' の実行には少々時間がかかります。 実行している間は、どのような項目をチェックしているのかを記したメッ セージが出力されます。 2. `make' を実行してパッケージをコンパイルします。 3. 任意で、パッケージに付属しているセルフテストを実行する場合は、 `make check' を実行します。 4. `make install' を実行して、プログラムおよびデータファイル、ドキュ メントをインストールします。 5. `make clean' を実行すると、生成されたプログラムのバイナリファイル やオブジェクトファイルを、ソースコードの置かれたディレクトリから 消すことができます。 一緒に `configure' が生成したファイルも消す には (こうすることで、別の種類のコンピュータでパッケージをコンパ イルできます)、 `make distclean' を実行します。`make maintainer- clean' というターゲットも用意されていますが、これは主にそのパッケー ジの開発者のためのものです。`make maintainer-clean' を実行してし まうと、パッケージに元々含まれていたファイルを再生成するために、 他のいろいろなプログラムを入手しなくてはいけなくなるかも知れませ ん。 コンパイラとコンパイルオプション ================================ システムによっては、`configure' スクリプトが理解していない、コンパイ ルやリンクのための特別なオプションを与える必要があります。環境変数を通 して、`configure' に対して初期値を与えることができます。Bourne シェル と互換性のあるシェルを使用している場合は、次のようにします。 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure `env' というコマンドがシステムにあるならば、次のようにすることもできま す。 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure 複数のアーキテクチャでのインストール ==================================== オブジェクトファイルをアーキテクチャ毎に別々のディレクトリに置くよう にすることにより、種類の異なる複数のコンピュータが、パッケージを同時に コンパイルできます。 これを行うには、GNU `make' のように、`VPATH' 変数 に対応した `make' を使用する必要があります。オブジェクトファイルや実行 形式のファイルを置いておきたいディレクトリに移動 (`cd') して、そこで `configure' スクリプトを実行します。 `configure' は、自身の存在するディ レクトリおよび `..' にソースコードがあるかどうかを自動的に調べます。 `VPATH' 変数に対応していない `make' を使用している場合は、ソースコー ドディレクトリの下で、一度に一つのアーキテクチャずつコンパイルしていく しかありません。一つのアーキテクチャのコンパイルが終わったら、別のアー キテクチャでコンパイルするために再コンフィグレーションを行う前に `make distclean' を実行してください。 インストール名 ============== デフォルトでは、`make install' を実行すると、パッケージ中のファイル が `/usr/local/bin'、`/usr/local/man' などにインストールされます。 `configure' に対して `--prefix=パス' オプションを指定することで、 `/usr/local' 以外のインストール先を指定するとができま ます。 アーキテクチャに依存したファイルとそうでないファイルを、それぞれ異なっ たインストール先にインストールすることも可能です。 `configure' に対し て `--exec-prefix=パス' を指定すると、プログラムやライブラリなどのイン ストール先が「パス」に変わります。ドキュメントや、データファイルなどは、 通常のインストール先にインストールされます。 加えて、あなたが通常とは異なったディレクトリレイアウトを採用している 場合は、`--bindir=パス' といったオプションを指定することで、特定の種類 のファイルのインストール先だけを変えることができます。 `configure --help' を実行すると、どのようなディレクトリを変更できるのか、どのよう な種類のファイルがどのディレクトリにインストールされるのかが分かります。 パッケージがサポートしているならば、`configure' に `--program-prefix= 接頭辞' や `--program-suffix=接尾辞' というオプションを与えることで、 インストール時にプログラム名に接頭辞や接尾辞を付加することができます。 取捨選択の可能な機能 ==================== パッケージによっては、`configure' が `--enable-機能' オプションを認 識することがあります。ここで「機能」は、パッケージにおいて取捨選択の可 能な機能を表します。また、`--with-パッケージ' オプションを認識すること もあります。ここで「パッケージ」は、`gnu-as' や (X ウィンドウシステム のための) `x' といったものです。`README' ファイルでは、どのような `--enable-'、`--with-' オプションをパッケージが認識するのか、記してお くべきです。 一般に、X ウィンドウシステムを使用しているパッケージでは、 `configure' は X の include ファイルとライブラリファイルを自動的に見つ け出すことができますが、見つけられない場合は、`configure' のオプション `--x-includes=ディレクトリ' と `--x-libraries=ディレクトリ' を用いるこ とでディレクトリの位置 を明示的に指定することができます。 システムの種類の指定 ==================== 設定項目によっては、`configure' が自動的に識別できなくても、パッケー ジが動作するホストの種類を基に決定しなければならないときもあります。通 常、`configure' はそのホストの種類を識別することができますが、もしも `configure' がホストの種類を識別できないという旨のメッセージを出力して きたときは、`--host=種類' オプションを与えて下さい。「種類」は `sun4' のようなシステムの種類を表した短い名前か、あるいは次のように 3 つの項 からなる正式名称のいずれかです。 CPU-社名-システム それぞれの項にどのような値が指定可能なのかについては、`config.sub' ファ イルをご覧下さい。 パッケージが `config.sub' を含んでいないのであれば、 そのパッケージはホストの種類を識別する必要がないことを意味しています。 あなたがクロスコンパイルのためのコンパイラツールをインストールしようと している場合は、`--target=種類' オプションを使用することで、どのホスト 向けのコードを生成させるのかを指定できます。そして、`--build=種類' オ プションを使用することで、パッケージをコンパイルしようとしているシステ ムの種類を指定することができます。 デフォルト値の共有 ================== 複数の `configure' スクリプトに対して共通のデフォルト値を設定したい ときは、サイト毎に `config.site' というシェルスクリプトを作成し、そこ に `CC' や `cache_file'、`prefix' といった変数のデフォルト値を記述して 下さい。 `configure' は `PREFIX/share/config.site' があれば、 それを調 べ、次に `PREFIX/etc/config.site' があればそれを調べます。あるいは、環 境変数 `CONFIG_SITE' を設定することで、サイト固有のスクリプトの位置を 指定することもできます。 ただし、すべての `configure' スクリプトがサイ ト固有のスクリプトを見に行くわけではありませんので、ご注意下さい。 `configure' の動作の制御 ======================== `configure' は次に記したオプションを認識します。 `--cache-file=ファイル' テストの結果の読み込みや書き出しに使用するファイルは、通常 `./config.cache' ですが、代わりに「ファイル」を用います。 `configure' をデバッグするときは、ファイル に `/dev/null' を指定 することで、キャッシュを抑制することができます。 `--help' `configure' のオプションの一覧を表示して、終了します。 `--quiet' `--silent' `-q' どのチェック項目を行っているのかを示すメッセージを出力しません。 通常のメッセージ出力をすべて抑制するには、`/dev/null' へリダイレ クトして下さい (ただし、エラーメッセージについては出力されてしま いますが)。 `--srcdir=ディレクトリ' パッケージのソースコードを探し出す際に、「ディレクトリ」を探しま す。通常、`configure' は自動的にディレクトリを決定します。 `--version' `configure' スクリプトがどのバージョンの Autoconf によって生成さ れたのかを表示し、終了します。 役に立つ場面は限られますが、`configure' には他にもいくつかのオプション が用意されています。 選択可能な機能の一覧 ==================== 本パッケージの `configure' は以下に記した `--enable-' および `--with-' オプションを認識します。 `--with-logdir=DIR' `ndtpdaily' がローテーションを行う syslog ファイルが置かれるディ レクトリのデフォルトとして DIR を指定します。 デフォルトは、 `LOCALSTATEDIR/ndtpd/log' です。 `--with-eb-conf=FILE' EB ライブラリの設定ファイルとして FILE を読み込みます。 デフォルト は、`SYSCONFDIR/eb.conf' です。 `--with-gnu-ld' C コンパイラが GNU ld を使用していると仮定します。 デフォルトは、 `no' です。 ebnetd-1.0.dfsg.1/README-ja0000644000175000017500000000675607760002640014501 0ustar mhattamhatta EBNETD CD-ROM $B=q@R%5!<%P72(B $BK\(B EBNETD $BG[I[%Q%C%1!<%8$K$O!"(Bebnetd, ndtpd, ebhttpd $B$H$$$&(B 3 $B$D$N%5!<(B $B%P%3%^%s%I$r<}O?$7$F$$$^$9!#(B $B$3$l$i$O$$$:$l$b!"(BTCP/IP $B$rMQ$$$F1s3V%[%9(B $B%H$N(B CD-ROM $B=q@R$K%"%/%;%9$9$k$?$a$N%5!<%P$G$9!#(B UNIX $B7O(B OS $B$N%7%9%F%`(B $B>e$GF0:n$5$;$k$3$H$,$G$-$^$9!#(B * ebnetd ebnetd $B$O(B EBNET $B%W%m%H%3%k$N%5!<%P$G!"(BEBNET $B$O!V(BEB $B%i%$%V%i%j!W$H(B $BDL?.$r9T$&$?$a$K@_7W$5$l$?%W%m%H%3%k$G$9!#(B EB $B%i%$%V%i%j$O!"(BCD-ROM $B=q@R$N%"%/%;%9$r9T$&!"(BC $B8@8l$N%i%$%V%i%j$G(B $B$9!#(B ndtpd, ebhttpd $B$b(B EB $B%i%$%V%i%j$r;HMQ$7$F$$$^$9!#(Bebnetd $B$r;H(B $BMQ$9$k$H!"(BEB $B%i%$%V%i%j$N%"%W%j%1!<%7%g%s$O!"1s3V%[%9%H$N(B CD-ROM $B=q@R$K%"%/%;%9$G$-$k$h$&$K$J$j$^$9!#(B EB $B%i%$%V%i%j$K$D$$$F$N>\:Y$O!"(B http://www.sra.co.jp/m-kasahr/eb/ $B$r;2>H$7$F2<$5$$!#(B * ndtpd ndtpd $B$O(B NDTP (Network Dictionary Transfer Protocol) $B%5!<%P$G$9!#(B NDTP $B$r:G=i$Ke0L8_49@-$,$"$j$^$9!#(B Web $B%Z!<%8(B http://www.sra.co.jp/people/m-kasahr/ebnetd/ndtp-clients-ja.html $B$K(B ndtpd $B$HDL?.2DG=$J(B NDTP $B%/%i%$%"%s%H$N0lMw$,:\$C$F$$$^$9!#(B * ebhttpd ebhttpd $B$O(B WWW (World Wide Web) $B%5!<%P$G$9!#(B HTTP/1.0 $B$*$h$S(B HTTP/1.1 (Hypertext Transfer Protocol version 1.0 $B$*$h$S(B 1.1) $B$KBP(B $B1~$7$F$$$^$9!#(B EBNETD $B$O(B UNIX $B7O(B OS $B$N%7%9%F%`>e$GF0:n$5$;$k$3$H$,$G$-$^$9!#(BEB, EBG, EBXA, EBXA-C, S-EBXA $B$*$h$S(B EPWING $B7A<0$N(B CD-ROM $B=q@R$KBP1~$7$F$$$^$9!#(B $B$3$l$i$N7A<0$N(B CD-ROM $B=q@R$O!"F|K\$G0lHLE*$K;H$o$l$F$$$^$9!#(BCD-ROM $B=q(B $B@R<+BN$O(B ISO 9660 $B7A<0$K$J$C$F$$$^$9$N$G!"B>$N(B ISO 9660 $B7A<0$HF1$8MWNN(B $B$G%^%&%s%H$9$k$3$H$,$G$-$^$9!#(B EBNETD $B$O(B CD-ROM $B=q@R$K%"%/%;%9$9$k$?$a$K!"(BEB $B%i%$%V%i%j$r;HMQ$7$F$$$^(B $B$9!#(BEBNETD $B$r%$%s%9%H!<%k$9$kA0$K!"(BEB $B%i%$%V%i%j$r%$%s%9%H!<%k$9$kI,MW(B $B$,$"$j$^$9!#(B EBNETD $B$O%U%j!<%=%U%H%&%'%"$G$9!#$"$J$?$O!"(BFree Software Foundation $B$,(B $B8xI=$7$?(B GNU General Public License (GNU $B0lHL8xM-;HMQ5vBz(B) $B%P!<%8%g%s(B 2 $B$"$k$$$O$=$l0J9_$N3F%P!<%8%g%s$NCf$+$i$$$:$l$+$rA*Br$7!"$=$N%P!<%8%g(B $B%s$,Dj$a$k>r9`$K=>$C$FK\%W%m%0%i%`$r:FHRI[$^$?$OJQ99$9$k$3$H$,$G$-$^$9!#(B EBNETD $B$OM-MQ$H$O;W$$$^$9$,!"HRI[$K$"$?$C$F$O!";T>l@-5Z$SFCDjL\E*E,9g@-(B $B$K$D$$$F$N0EL[$NJ]>Z$r4^$a$F!"$$$+$J$kJ]>Z$b9T$J$$$^$;$s!#>\:Y$K$D$$$F(B $B$O(B GNU General Public License $B$r$*FI$_$/$@$5$$!#(B $B2C$($F!"$"$J$?$O<+J,$N=jM-$9$k(B CD-ROM $B=q@R$N;HMQ5vBz$bpJs$O> * Use `ebnugrade' to upgrade a configuration file. Use the `ebnupgrade' command if you want to upgrade a configuration file (ebnetd.conf or ndtpd.conf) with ease. `ebnupgrade' reads a configuration file for earlier version of EBNETD, NDTPD or ebHTTPD, then generates a new one which is suitable for this version of EBNETD. `ebnupgrade' reads the default EBNETD configuration file, and outputs new configuration to the file `.new'. You can replace your configuration file by the sequence of commands. /usr/local/sbin/ebnupgrade mv /usr/local/etc/ebnetd.conf /usr/local/etc/ebnetd.conf.orig mv /usr/local/etc/ebnetd.conf.new /usr/local/etc/ebnetd.conf It supposes that EBNETD has been installed under `/usr/local' and if directories for system administrative executables (`sbindir') and for read-only single-machine data ('sysconfdir') have not been changed at the installation. `ebnupgrade' also reports how does it modify a configuration file. The reports are output to standard error. ebnetd.conf: 8: server-name' is obsoleted (comment out) ebnetd.conf: 38: ident-hosts' is obsoleted (comment out) ebnetd.conf: 42: ident-timeout' is obsoleted (comment out) ebnetd.conf: 89: netmask in `hosts' must be an integer. (fixed) Try `ebnupgrade --help' for information about command line options. ebnetd-1.0.dfsg.1/UPGRADE-ja0000644000175000017500000000306407673055323014631 0ustar mhattamhatta $B%"%C%W%0%l!<%I$K4X$9$kCm0U;v9`(B ====================================================================== << $B0lHLE*$J%R%s%H(B >> * $B@_Dj%U%!%$%k$r%"%C%W%0%l!<%I$r(B `ebnugrade' $B$G(B $B@_Dj%U%!%$%k(B (ebnetd.conf, ndtpd.conf) $B$r4JC1$K%"%C%W%0%l!<%I$7$?$$$J(B $B$i!"(B`ebnupgrade' $B%3%^%s%I$r;H$$$^$7$g$&!#(Bebnupgrade $B$OA0$N%P!<%8%g%s$N(B EBNETD, NDTPD, ebHTTPD $B$N@_Dj%U%!%$%k$rFI$_9~$_!"K\%P!<%8%g%s$N(B EBNETD $B8~$1$N@_Dj%U%!%$%k$r@8@.$7$^$9!#(B ebnupgrade $B$O(B EBNETD $B$NI8=`$N@_Dj%U%!%$%k$rFI$_9~$_!"?7$7$$@_Dj$r(B `<$BI8=`$N@_Dj%U%!%$%k(B>.new' $B$H$$$&%U%!%$%k$K=PNO$7$^$9!#@_Dj%U%!%$%k$N(B $BCV$-49$($ODj$7$F$$$^$9!#(B ebnupgrade $B$O@_Dj%U%!%$%k$r$I$N$h$&$K=$@5$7$?$N$+$K$D$$$F$bJs9p$7$^$9!#(B $BJs9pFbMF$OI8=`%(%i!<=PNO$K=PNO$5$l$^$9!#(B ebnetd.conf: 8: server-name' is obsoleted. (comment out) ebnetd.conf: 38: ident-hosts' is obsoleted. (comment out) ebnetd.conf: 42: ident-timeout' is obsoleted. (comment out) ebnetd.conf: 89: netmask in `hosts' must be an integer. (fixed) `ebnupgrade --help' $B$G%3%^%s%I9T%*%W%7%g%s$N>pJs$,F@$i$l$^$9!#(B ebnetd-1.0.dfsg.1/lib/0000755000175000017500000000000010613362151013756 5ustar mhattamhattaebnetd-1.0.dfsg.1/lib/dummyin6.h0000644000175000017500000001236707674602322015722 0ustar mhattamhatta/* * Copyright (c) 2001, 2003 Motoyuki Kasahara * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef DUMMYIN6_H #define DUMMYIN6_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #ifndef AF_INET6 #define AF_INET6 (AF_INET + 1) #endif #ifndef PF_INET6 #define PF_INET6 (PF_INET + 1) #endif #ifndef AF_UNSPEC #define AF_UNSPEC AF_INET #endif #ifndef PF_UNSPEC #define PF_UNSPEC PF_INET #endif #ifndef INET6_ADDRSTRLEN #define INET6_ADDRSTRLEN 46 #endif #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 #endif #ifndef HAVE_STRUCT_IN6_ADDR struct in6_addr { unsigned char s6_addr[16]; }; #endif #ifndef HAVE_STRUCT_SOCKADDR_IN6 struct sockaddr_in6 { sa_family_t sin6_family; in_port_t sin6_port; unsigned long sin6_flowinfo; struct in6_addr sin6_addr; unsigned long sin6_scope_id; }; #endif #if !defined(HAVE_STRUCT_SOCKADDR_STORAGE) && !defined(sockaddr_storage) #define sockaddr_storage sockaddr_in #endif #ifndef IN6ADDR_ANY_DECLARED extern const struct in6_addr in6addr_any; #endif #ifndef IN6ADDR_LOOPBACK_DECLARED extern const struct in6_addr in6addr_loopback; #endif #ifndef IN6ADDR_ANY_INIT #define IN6ADDR_ANY_INIT \ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}} #endif #ifndef IN6ADDR_LOOPBACK_INIT #define IN6ADDR_LOOPBACK_INIT \ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}} #endif #ifndef IN6_IS_ADDR_UNSPECIFIED #define IN6_IS_ADDR_UNSPECIFIED(a) \ ( (a)->s6_addr[ 0] == 0 && (a)->s6_addr[ 1] == 0 \ && (a)->s6_addr[ 2] == 0 && (a)->s6_addr[ 3] == 0 \ && (a)->s6_addr[ 4] == 0 && (a)->s6_addr[ 5] == 0 \ && (a)->s6_addr[ 6] == 0 && (a)->s6_addr[ 7] == 0 \ && (a)->s6_addr[ 8] == 0 && (a)->s6_addr[ 9] == 0 \ && (a)->s6_addr[10] == 0 && (a)->s6_addr[11] == 0 \ && (a)->s6_addr[12] == 0 && (a)->s6_addr[13] == 0 \ && (a)->s6_addr[14] == 0 && (a)->s6_addr[15] == 0) #endif #ifndef IN6_IS_ADDR_LOOPBACK #define IN6_IS_ADDR_LOOPBACK(a) \ ( (a)->s6_addr[ 0] == 0 && (a)->s6_addr[ 1] == 0 \ && (a)->s6_addr[ 2] == 0 && (a)->s6_addr[ 3] == 0 \ && (a)->s6_addr[ 4] == 0 && (a)->s6_addr[ 5] == 0 \ && (a)->s6_addr[ 6] == 0 && (a)->s6_addr[ 7] == 0 \ && (a)->s6_addr[ 8] == 0 && (a)->s6_addr[ 9] == 0 \ && (a)->s6_addr[10] == 0 && (a)->s6_addr[11] == 0 \ && (a)->s6_addr[12] == 0 && (a)->s6_addr[13] == 0 \ && (a)->s6_addr[14] == 0 && (a)->s6_addr[15] == 1) #endif #ifndef IN6_IS_ADDR_MULTICAST #define IN6_IS_ADDR_MULTICAST(a) \ ((a)->s6_addr[0] == 0xff) #endif #ifndef IN6_IS_ADDR_LINKLOCAL #define IN6_IS_ADDR_LINKLOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) #endif #ifndef IN6_IS_ADDR_SITELOCAL #define IN6_IS_ADDR_SITELOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) #endif #ifndef IN6_IS_ADDR_V4MAPPED #define IN6_IS_ADDR_V4MAPPED(a) \ ( (a)->s6_addr[ 0] == 0 && (a)->s6_addr[ 1] == 0 \ && (a)->s6_addr[ 2] == 0 && (a)->s6_addr[ 3] == 0 \ && (a)->s6_addr[ 4] == 0 && (a)->s6_addr[ 5] == 0 \ && (a)->s6_addr[ 6] == 0 && (a)->s6_addr[ 7] == 0 \ && (a)->s6_addr[ 8] == 0 && (a)->s6_addr[ 9] == 0 \ && (a)->s6_addr[10] == 0xff && (a)->s6_addr[11] == 0xff) #endif #ifndef IN6_IS_ADDR_V4COMPAT #define IN6_IS_ADDR_V4COMPAT(a) \ ( (a)->s6_addr[ 0] == 0 && (a)->s6_addr[ 1] == 0 \ && (a)->s6_addr[ 2] == 0 && (a)->s6_addr[ 3] == 0 \ && (a)->s6_addr[ 4] == 0 && (a)->s6_addr[ 5] == 0 \ && (a)->s6_addr[ 6] == 0 && (a)->s6_addr[ 7] == 0 \ && (a)->s6_addr[ 8] == 0 && (a)->s6_addr[ 9] == 0 \ && (a)->s6_addr[10] == 0 && (a)->s6_addr[11] == 0 \ && ((a)->s6_addr[12] != 0 || (a)->s6_addr[13] != 0 \ || (a)->s6_addr[14] != 0 \ || ((a)->s6_addr[15] != 0 && (a)->s6_addr[15] != 1))) #endif #endif /* not DUMMYIN6_H */ ebnetd-1.0.dfsg.1/lib/getaddrinfo.h0000644000175000017500000001204507673055406016435 0ustar mhattamhatta/* * Copyright (c) 2001, 02 Motoyuki Kasahara * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef GETADDRINFO_H #define GETADDRINFO_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include /********************************************************************/ /* * Undefine all the macros. * might defines some of them. */ #ifdef EAI_ADDRFAMILY #undef EAI_ADDRFAMILY #endif #ifdef EAI_AGAIN #undef EAI_AGAIN #endif #ifdef EAI_BADFLAGS #undef EAI_BADFLAGS #endif #ifdef EAI_FAIL #undef EAI_FAIL #endif #ifdef EAI_FAMILY #undef EAI_FAMILY #endif #ifdef EAI_MEMORY #undef EAI_MEMORY #endif #ifdef EAI_NONAME #undef EAI_NONAME #endif #ifdef EAI_OVERFLOW #undef EAI_OVERFLOW #endif #ifdef EAI_SERVICE #undef EAI_SERVICE #endif #ifdef EAI_SOCKTYPE #undef EAI_SOCKTYPE #endif #ifdef EAI_SYSTEM #undef EAI_SYSTEM #endif #ifdef AI_PASSIVE #undef AI_PASSIVE #endif #ifdef AI_CANONNAME #undef AI_CANONNAME #endif #ifdef AI_NUMERICHOST #undef AI_NUMERICHOST #endif #ifdef AI_NUMERICSERV #undef AI_NUMERICSERV #endif #ifdef AI_V4MAPPED #undef AI_V4MAPPED #endif #ifdef AI_ALL #undef AI_ALL #endif #ifdef AI_ADDRCONFIG #undef AI_ADDRCONFIG #endif #ifdef AI_DEFAULT #undef AI_DEFAULT #endif #ifdef NI_NOFQDN #undef NI_NOFQDN #endif #ifdef NI_NUMERICHOST #undef NI_NUMERICHOST #endif #ifdef NI_NAMEREQD #undef NI_NAMEREQD #endif #ifdef NI_NUMERICSERV #undef NI_NUMERICSERV #endif #ifdef NI_NUMERICSCOPE #undef NI_NUMERICSCOPE #endif #ifdef NI_DGRAM #undef NI_DGRAM #endif #ifdef NI_MAXHOST #undef NI_MAXHOST #endif #ifdef NI_MAXSERV #undef NI_MAXSERV #endif /* * Fake struct and function names. * might declares all or some of them. */ #if defined(HAVE_GETADDRINFO) || defined(HAVE_GETNAMEINFO) #define addrinfo my_addrinfo #define gai_strerror my_gai_strerror #define freeaddrinfo my_freeaddrinfo #define getaddrinfo my_getaddrinfo #define getnameinfo my_getnameinfo #endif /********************************************************************/ /* * Error codes. */ #define EAI_ADDRFAMILY 1 #define EAI_AGAIN 2 #define EAI_BADFLAGS 3 #define EAI_FAIL 4 #define EAI_FAMILY 5 #define EAI_MEMORY 6 #define EAI_NONAME 7 #define EAI_OVERFLOW 8 #define EAI_SERVICE 9 #define EAI_SOCKTYPE 10 #define EAI_SYSTEM 11 /* * Flags for getaddrinfo(). */ #define AI_ADDRCONFIG 0x0001 #define AI_ALL 0x0002 #define AI_CANONNAME 0x0004 #define AI_NUMERICHOST 0x0008 #define AI_NUMERICSERV 0x0010 #define AI_PASSIVE 0x0020 #define AI_V4MAPPED 0x0040 #define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG) /* * Flags for getnameinfo(). */ #define NI_DGRAM 0x0001 #define NI_NAMEREQD 0x0002 #define NI_NOFQDN 0x0004 #define NI_NUMERICHOST 0x0008 #define NI_NUMERICSCOPE 0x0010 #define NI_NUMERICSERV 0x0020 /* * Maximum length of FQDN and servie name for getnameinfo(). */ #define NI_MAXHOST 1025 #define NI_MAXSERV 32 /* * Address families and Protocol families. */ #ifndef AF_UNSPEC #define AF_UNSPEC AF_INET #endif #ifndef PF_UNSPEC #define PF_UNSPEC PF_INET #endif /* * struct addrinfo. */ struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; socklen_t ai_addrlen; char *ai_canonname; struct sockaddr *ai_addr; struct addrinfo *ai_next; }; /* * Functions. */ #ifdef __STDC__ const char *gai_strerror(int); void freeaddrinfo(struct addrinfo *); int getaddrinfo(const char *, const char *, const struct addrinfo *, struct addrinfo **); int getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, int); #else const char *gai_strerror(); void freeaddrinfo(); int getaddrinfo(); int getnameinfo(); #endif #endif /* not GETADDRINFO_H */ ebnetd-1.0.dfsg.1/lib/confutil.h0000644000175000017500000000242007673055377015775 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef CONFUTIL_H #define CONFUTIL_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include /* * Function declarations. */ #ifdef __STDC__ int parse_integer(const char *, int *); int parse_tcp_port(const char *, in_port_t *); int parse_udp_port(const char *, in_port_t *); int parse_user(const char *, uid_t *); int parse_group(const char *, gid_t *); int parse_on_off(const char *, int *); int parse_syslog_facility(const char *, int *); #else /* not __STDC__ */ int parse_integer(); int parse_tcp_port(); int parse_udp_port(); int parse_user(); int parse_group(); int parse_on_off(); int parse_syslog_facility(); #endif /* not __STDC__ */ #endif /* not CONFUTIL_H */ ebnetd-1.0.dfsg.1/lib/daemon.h0000644000175000017500000000137707673055371015421 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef DAEMON_H #define DAEMON_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * Function declarations. */ #ifdef __STDC__ int daemonize(void); #else int daemonize(); #endif #endif /* not DAEMON_H */ ebnetd-1.0.dfsg.1/lib/fakelog.h0000644000175000017500000000302507673055373015560 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef FAKELOG_H #define FAKELOG_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* * Log modes. */ #define FAKELOG_TO_NOWHERE 0 #define FAKELOG_TO_SYSLOG 1 #define FAKELOG_TO_STDERR 2 #define FAKELOG_TO_BOTH 3 /* * Maximum length of log-name. */ #define FAKELOG_MAX_LOG_NAME_LENGTH 64 /* * Fake syslog(). */ #ifdef syslog #undef syslog #endif #define syslog fakelog /* * Function declarations. */ #ifdef __STDC__ void set_fakelog_name(const char *); void set_fakelog_mode(int); void set_fakelog_level(int); #if (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && defined(HAVE_VSYSLOG) void fakelog(int, const char *, ...); #else /* not (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && ... */ void fakelog(); #endif /* not (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && ... */ #else /* not __STDC__ */ void set_fakelog_name(); void set_fakelog_mode(); void set_fakelog_level(); void fakelog(); #endif /* not __STDC__ */ #endif /* not FAKELOG_H */ ebnetd-1.0.dfsg.1/lib/fdset.h0000644000175000017500000000215107673055372015253 0ustar mhattamhatta/* * Copyright (c) 2001 Takashi UMENO * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef FD_SET_H #define FD_SET_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef HAVE_UNISTD_H #include #endif /* * Function declarations. */ #ifdef __STDC__ void initialize_fdset(fd_set *, int *); void finalize_fdset(fd_set *, int *); void add_fd_to_fdset(fd_set *, int *, int); int shutdown_fdset(fd_set *, int *, int); int close_fdset(fd_set *, int *); #else /* not __STDC__ */ void initialize_fdset(); void finalize_fdset(); void add_fd_to_fdset(); int shutdown_fdset(); int close_fdset(); #endif /* not __STDC__ */ #endif /* not FD_SET_H */ ebnetd-1.0.dfsg.1/lib/filename.h0000644000175000017500000000144107673055403015722 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef FILENAME_H #define FILENAME_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * Function declarations. */ #ifdef __STDC__ int canonicalize_file_name(char *); #else int canonicalize_file_name(); #endif #endif /* not FILENAME_H */ ebnetd-1.0.dfsg.1/lib/getopt.h0000644000175000017500000001760710613362125015445 0ustar mhattamhatta/* Declarations for getopt. Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007 Free Software Foundation, Inc. This file is part of the GNU C Library. This program 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, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* Standalone applications should #define __GETOPT_PREFIX to an identifier that prefixes the external functions and variables defined in this header. When this happens, include the headers that might declare getopt so that they will not cause confusion if included after this file. Then systematically rename identifiers so that they do not collide with the system functions and variables. Renaming avoids problems with some compilers and linkers. */ #if defined __GETOPT_PREFIX && !defined __need_getopt # include # include # include # undef __need_getopt # undef getopt # undef getopt_long # undef getopt_long_only # undef optarg # undef opterr # undef optind # undef optopt # define __GETOPT_CONCAT(x, y) x ## y # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) # define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) # define getopt __GETOPT_ID (getopt) # define getopt_long __GETOPT_ID (getopt_long) # define getopt_long_only __GETOPT_ID (getopt_long_only) # define optarg __GETOPT_ID (optarg) # define opterr __GETOPT_ID (opterr) # define optind __GETOPT_ID (optind) # define optopt __GETOPT_ID (optopt) #endif /* Standalone applications get correct prototypes for getopt_long and getopt_long_only; they declare "char **argv". libc uses prototypes with "char *const *argv" that are incorrect because getopt_long and getopt_long_only can permute argv; this is required for backward compatibility (e.g., for LSB 2.0.1). This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt', but it caused redefinition warnings if both unistd.h and getopt.h were included, since unistd.h includes getopt.h having previously defined __need_getopt. The only place where __getopt_argv_const is used is in definitions of getopt_long and getopt_long_only below, but these are visible only if __need_getopt is not defined, so it is quite safe to rewrite the conditional as follows: */ #if !defined __need_getopt # if defined __GETOPT_PREFIX # define __getopt_argv_const /* empty */ # else # define __getopt_argv_const const # endif #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifndef __THROW # ifndef __GNUC_PREREQ # define __GNUC_PREREQ(maj, min) (0) # endif # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # else # define __THROW # endif #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `-', then non-option arguments are treated as arguments to the option '\1'. This behavior is specific to the GNU `getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in the environment, then do not permute arguments. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW; #ifndef __need_getopt extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; #endif #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ ebnetd-1.0.dfsg.1/lib/hostname.h0000644000175000017500000000213307673055403015757 0ustar mhattamhatta/* * Copyright (c) 1996, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef HOSTNAME_H #define HOSTNAME_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * The string represents unknown hostname or address. */ #ifndef UNKNOWN_HOST #define UNKNOWN_HOST "?" #endif /* * The maximum length of hostname and address. */ #ifdef ENABLE_IPV6 #define MAX_HOST_NAME_LENGTH 1023 #else #define MAX_HOST_NAME_LENGTH 127 #endif /* * Function declarations. */ #ifdef __STDC__ int identify_remote_host(int, char *, char *); #else /* not __STDC__ */ int identify_remote_host(); #endif /* __STDC__ */ #endif /* not HOSTNAME_H */ ebnetd-1.0.dfsg.1/lib/inet_pton2.h0000644000175000017500000000202207673055404016220 0ustar mhattamhatta/* * Copyright (c) 2002 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef INET_PTON2_H #define INET_PTON2_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifndef VOID #ifdef __STDC__ #define VOID void #else #define VOID char #endif #endif #ifdef __STDC__ int inet_pton2(int, const char *, VOID *, char *); int inet_prefix_pton(int, const char *, VOID *, VOID *); int inet_prefix_pton2(int, const char *, VOID *, VOID *, char *); #else int inet_pton2(); int inet_prefix_pton(); int inet_prefix_pton2(); #endif #endif /* INET_PTON2_H */ ebnetd-1.0.dfsg.1/lib/ioall.h0000644000175000017500000000172307673055367015256 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01, 02 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef IOALL_H #define IOALL_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* * Function declarations. */ #ifdef __STDC__ int read_all(int, int, void *, size_t); int write_all(int, int, const void *, size_t); int write_string_all(int, int, const char *); #else /* not __STDC__ */ int read_all(); int write_all(); int write_string_all(); #endif /* not __STDC__ */ #endif /* not IOALL_H */ ebnetd-1.0.dfsg.1/lib/linebuf.h0000644000175000017500000000351307673055377015602 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01, 02 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef LINEBUF_H #define LINEBUF_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* * Buffer size of `Line_Buffer' struct. */ #define LINEBUF_BUFFER_SIZE 256 /* * Line buffer manager. */ typedef struct { int file; /* file descriptor */ int timeout; /* idle timeout interval */ size_t cache_length; /* length of cache data */ char buffer[LINEBUF_BUFFER_SIZE]; /* buffer */ } Line_Buffer; /* * Function declarations. */ #ifdef __STDC__ void initialize_line_buffer(Line_Buffer *); void finalize_line_buffer(Line_Buffer *); void set_line_buffer_timeout(Line_Buffer *, int); void bind_file_to_line_buffer(Line_Buffer *, int); int file_bound_to_line_buffer(Line_Buffer *); void discard_cache_in_line_buffer(Line_Buffer *); size_t cache_length_in_line_buffer(Line_Buffer *); ssize_t read_line_buffer(Line_Buffer *, char *, size_t); ssize_t binary_read_line_buffer(Line_Buffer *, char *, size_t); int skip_line_buffer(Line_Buffer *); #else void initialize_line_buffer(); void finalize_line_buffer(); void set_line_buffer_timeout(); void bind_file_to_line_buffer(); int file_bound_to_line_buffer(); void discard_cache_in_line_buffer(); ssize_t read_line_buffer(); ssize_t binary_read_line_buffer(); int skip_line_buffer(); #endif #endif /* not LINEBUF_H */ ebnetd-1.0.dfsg.1/lib/logpid.h0000644000175000017500000000172607673055375015436 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef LOGPID_H #define LOGPID_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* * Function declarations. */ #ifdef __STDC__ int log_pid_file(const char *); int remove_pid_file(const char *); int probe_pid_file(const char *); int read_pid_file(const char *, pid_t *); #else int log_pid_file(); int remove_pid_file(); int probe_pid_file(); int read_pid_file(); #endif #endif /* not LOGPID_H */ ebnetd-1.0.dfsg.1/lib/makedir.h0000644000175000017500000000165107673055374015570 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef MAKEDIR_H #define MAKEDIR_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * Function declarations. */ #ifdef __STDC__ int make_missing_directory(const char *, int); int make_missing_directory_chain(const char *, int); #else /* not __STDC__ */ int make_missing_directory(); int make_missing_directory_chain(); #endif /* not __STDC__ */ #endif /* not MAKEDIR_H */ ebnetd-1.0.dfsg.1/lib/mappedaddr.h0000644000175000017500000000224707673055370016253 0ustar mhattamhatta/* * Copyright (c) 2002 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef MAPPEDADDR_H #define MAPPEDADDR_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #ifdef __STDC__ void ipv4_to_mapped_ipv6_address(struct in6_addr *, const struct in_addr *); int mapped_ipv6_to_ipv4_address(struct in_addr *, const struct in6_addr *); void ipv4_to_mapped_ipv6_net_mask(struct in6_addr *, const struct in_addr *); int mapped_ipv6_to_ipv4_net_mask(struct in_addr *, const struct in6_addr *); #else void ipv4_to_mapped_ipv6_address(); int mapped_ipv6_to_ipv4_address(); void ipv4_to_mapped_ipv6_net_mask(); int mapped_ipv6_to_ipv4_net_mask(); #endif #endif /* MAPPEDADDR_H */ ebnetd-1.0.dfsg.1/lib/openmax.h0000644000175000017500000000141007673055401015603 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef OPENMAX_H #define OPENMAX_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * Function declarations. */ #ifdef __STDC__ int get_open_max(void); #else int get_open_max(); #endif #endif /* not OPENMAX_H */ ebnetd-1.0.dfsg.1/lib/permission.h0000644000175000017500000000325707673055407016345 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef PERMISSION_H #define PERMISSION_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "dummyin6.h" /* * Access permission list. */ typedef struct Permission_Struct Permission; struct Permission_Struct { int not; /* inverse permission */ char *host_name; /* host name pattern */ struct in6_addr address; /* address */ struct in6_addr net_mask; /* net mask */ char scope_name[IF_NAMESIZE]; /* scope name pattern */ Permission *next; /* pointer to next node */ }; /* * Function declarations. */ #ifdef __STDC__ void initialize_permission(Permission *); void finalize_permission(Permission *); int add_permission(Permission *, const char *); int test_permission(const Permission *, const char *, const char *, int (*func)(const char *, const char *)); int count_permission(const Permission *); #else /* not __STDC__ */ void initialize_permission(); void finalize_permission(); int add_permission(); int test_permission(); int count_permission(); #endif /* not __STDC__ */ #endif /* not PERMISSION_H */ ebnetd-1.0.dfsg.1/lib/privilege.h0000644000175000017500000000152607673055407016140 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef PRIVILEGE_H #define PRIVILEGE_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* * Function declarations. */ #ifdef __STDC__ int set_privilege(uid_t, gid_t); #else /* not __STDC__ */ int set_privilege(); #endif /* not __STDC__ */ #endif /* not PRIVILEGE_H */ ebnetd-1.0.dfsg.1/lib/readconf.h0000644000175000017500000000331107673055376015732 0ustar mhattamhatta/* * Copyright (c) 1997, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef READCONF_H #define READCONF_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * Maximum Line length of a configuration file. */ #define READCONF_SIZE_LINE 511 /* * Maximum Block name in a `Config' structure. */ #define READCONF_SIZE_BLOCK_NAME 127 /* * Definition type macros. */ #define READCONF_ZERO_OR_ONCE 0 #define READCONF_ONCE 1 #define READCONF_ZERO_OR_MORE 2 #define READCONF_ONCE_OR_MORE 3 /* * Configuration syntax table. */ typedef struct { /* * Block name. */ char *block; /* * Directive name. */ char *name; /* * Function to process the directive. */ #ifdef __STDC__ int (*function)(const char *, const char *, int); #else int (*function)(); #endif /* * Definititon type. */ int type; /* * Directive definition counter. * This counter is managed by readconf module. Don't modify * the counter in elsewhere. */ int count; } Configuration; #ifdef __STDC__ int read_configuration(const char *filename, Configuration *); #else /* not __STDC__ */ int read_configuration(); #endif /* not __STDC__ */ #endif /* not READCONF_H */ ebnetd-1.0.dfsg.1/lib/serverport.h0000644000175000017500000000174707673055401016364 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef SERVERPORT_H #define SERVERPORT_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef HAVE_UNISTD_H #include #endif /* * Function declarations. */ #ifdef __STDC__ int set_server_ports(int, int, fd_set *, int *); int wait_server_ports(fd_set *, fd_set *, int *); #else /* not __STDC__ */ int set_server_ports(); int wait_server_ports(); #endif /* not __STDC__ */ #endif /* not SERVERPORT_H */ ebnetd-1.0.dfsg.1/lib/signame.h0000644000175000017500000000221707673055406015572 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef SIGNAME_H #define SIGNAME_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * Function declarations. */ #ifdef __STDC__ int signal_code(const char *); const char *signal_name(int); const char *signal_explanation(int); #ifndef HAVE_PSIGNAL void psignal(int, const char *); #endif #ifndef HAVE_STRSIGNAL const char *strsignal(int); #endif #else /* not __STDC__ */ int signal_code(); const char *signal_name(); const char *signal_explanation(); #ifndef HAVE_PSIGNAL void psignal(); #endif #ifndef HAVE_STRSIGNAL const char *strsignal(); #endif #endif /* not __STDC__ */ #endif /* not SIGNAME_H */ ebnetd-1.0.dfsg.1/lib/ticket.h0000644000175000017500000000257307673055377015446 0ustar mhattamhatta/* * Copyright (c) 1999, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef TICKET_H #define TICKET_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * Ticket Stock. */ typedef struct { char *file_name; /* lock file name */ int file; /* lock file descriptor */ int count; /* the number of tickets */ int lock_spot; /* locked spot (gotten ticket) */ } Ticket_Stock; /* * Function declarations. */ #ifdef __STDC__ void initialize_ticket_stock(Ticket_Stock *); int bind_ticket_stock(Ticket_Stock *, const char *, int); int get_ticket(Ticket_Stock *); int unget_ticket(Ticket_Stock *); int have_ticket(Ticket_Stock *); void finalize_ticket_stock(Ticket_Stock *); #else /* not __STDC__ */ void initialize_ticket_stock(); int bind_ticket_stock(); int get_ticket(); int unget_ticket(); int have_ticket(); void finalize_ticket_stock(); #endif /* not __STDC__ */ #endif /* not TICKET_H */ ebnetd-1.0.dfsg.1/lib/wildcard.h0000644000175000017500000000151307673055400015730 0ustar mhattamhatta/* * Copyright (c) 1997, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef WILDCARD_H #define WILDCARD_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * Function declarations. */ #ifdef __STDC__ int match_wildcard(const char *, const char *); #else /* not __STDC__ */ int match_wildcard(); #endif /* not __STDC__ */ #endif /* not WILDCARD_H */ ebnetd-1.0.dfsg.1/lib/fdset.c0000644000175000017500000000522607673055367015260 0ustar mhattamhatta/* * Copyright (c) 2001 Takashi UMENO * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #ifdef HAVE_UNISTD_H #include #endif /* * FreeBSD uses bzero() in FD_ZERO(). */ #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef TIME_WITH_SYS_TIME #include #include #else /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_FCNTL_H #include #else #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef SHUT_RD #define SHUT_RD 0 #endif #ifndef SHUT_WR #define SHUT_WR 1 #endif #ifndef SHUT_RDWR #define SHUT_RDWR 2 #endif #include "fdset.h" /* * Initialize socket descriptors. */ void initialize_fdset(fdset, max_fd) fd_set *fdset; int *max_fd; { FD_ZERO(fdset); *max_fd = -1; } /* * Finalize socket descriptors. */ void finalize_fdset(fdset, max_fd) fd_set *fdset; int *max_fd; { shutdown_fdset(fdset, max_fd, SHUT_RDWR); close_fdset(fdset, max_fd); } /* * Add file to socket discritors. */ void add_fd_to_fdset(fdset, max_fd, fd) fd_set *fdset; int *max_fd; int fd; { FD_SET(fd, fdset); if (fd > *max_fd) *max_fd = fd; } /* * Shutdown multi sockets */ int shutdown_fdset(fdset, max_fd, how) fd_set *fdset; int *max_fd; int how; { int i; for (i = 0; i <= *max_fd; i++) { if (FD_ISSET(i, fdset)) { shutdown(i, how); FD_CLR(i, fdset); } } return 0; } /* * Close multi sockets */ int close_fdset(fdset, max_fd) fd_set *fdset; int *max_fd; { int i; for (i = 0; i <= *max_fd; i++) { if (FD_ISSET(i, fdset)) { close(i); FD_CLR(i, fdset); } } *max_fd = -1; return 0; } ebnetd-1.0.dfsg.1/lib/Makefile.am0000644000175000017500000000114607673055405016031 0ustar mhattamhattanoinst_LIBRARIES = libebnetd.a libebnetd_a_SOURCES = confutil.c daemon.c fakelog.c fdset.c filename.c \ getopt.c hostname.c inet_pton2.c ioall.c linebuf.c logpid.c \ makedir.c mappedaddr.c openmax.c permission.c privilege.c \ readconf.c serverport.c signame.c ticket.c wildcard.c libebnetd_a_LIBADD = @LIBOBJS@ noinst_HEADERS = dummyin6.h getaddrinfo.h confutil.h daemon.h fakelog.h \ fdset.h filename.h getopt.h hostname.h inet_pton2.h ioall.h \ linebuf.h logpid.h makedir.h mappedaddr.h openmax.h permission.h \ privilege.h readconf.h serverport.h signame.h ticket.h wildcard.h INCLUDES = -DUSE_FAKELOG ebnetd-1.0.dfsg.1/lib/Makefile.in0000644000175000017500000004243407773515024016046 0ustar mhattamhatta# Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ # Copyright (C) 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. # 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. @SET_MAKE@ SOURCES = $(libebnetd_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ subdir = lib DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in dummyin6.c getaddrinfo.c inet_pton.c \ memchr.c memmove.c memset.c strcasecmp.c strerror.c strtol.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/eb4.m4 \ $(top_srcdir)/m4/herrno.m4 $(top_srcdir)/m4/in6addr.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/sockaddrin6.m4 \ $(top_srcdir)/m4/sockinttypes.m4 $(top_srcdir)/m4/unionwait.m4 \ $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = ARFLAGS = cru LIBRARIES = $(noinst_LIBRARIES) libebnetd_a_AR = $(AR) $(ARFLAGS) libebnetd_a_DEPENDENCIES = @LIBOBJS@ am_libebnetd_a_OBJECTS = confutil.$(OBJEXT) daemon.$(OBJEXT) \ fakelog.$(OBJEXT) fdset.$(OBJEXT) filename.$(OBJEXT) \ getopt.$(OBJEXT) hostname.$(OBJEXT) inet_pton2.$(OBJEXT) \ ioall.$(OBJEXT) linebuf.$(OBJEXT) logpid.$(OBJEXT) \ makedir.$(OBJEXT) mappedaddr.$(OBJEXT) openmax.$(OBJEXT) \ permission.$(OBJEXT) privilege.$(OBJEXT) readconf.$(OBJEXT) \ serverport.$(OBJEXT) signame.$(OBJEXT) ticket.$(OBJEXT) \ wildcard.$(OBJEXT) libebnetd_a_OBJECTS = $(am_libebnetd_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = $(DEPDIR)/dummyin6.Po $(DEPDIR)/getaddrinfo.Po \ @AMDEP_TRUE@ $(DEPDIR)/inet_pton.Po $(DEPDIR)/memchr.Po \ @AMDEP_TRUE@ $(DEPDIR)/memmove.Po $(DEPDIR)/memset.Po \ @AMDEP_TRUE@ $(DEPDIR)/strcasecmp.Po $(DEPDIR)/strerror.Po \ @AMDEP_TRUE@ $(DEPDIR)/strtol.Po ./$(DEPDIR)/confutil.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/daemon.Po ./$(DEPDIR)/fakelog.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/fdset.Po ./$(DEPDIR)/filename.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/hostname.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/inet_pton2.Po ./$(DEPDIR)/ioall.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/linebuf.Po ./$(DEPDIR)/logpid.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/makedir.Po ./$(DEPDIR)/mappedaddr.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/openmax.Po ./$(DEPDIR)/permission.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/privilege.Po ./$(DEPDIR)/readconf.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/serverport.Po ./$(DEPDIR)/signame.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/ticket.Po ./$(DEPDIR)/wildcard.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libebnetd_a_SOURCES) DIST_SOURCES = $(libebnetd_a_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS = @COMPRESS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ EBCONF_EBINCS = @EBCONF_EBINCS@ EBCONF_EBLIBS = @EBCONF_EBLIBS@ EBCONF_INTLINCS = @EBCONF_INTLINCS@ EBCONF_INTLLIBS = @EBCONF_INTLLIBS@ EBCONF_PTHREAD_CFLAGS = @EBCONF_PTHREAD_CFLAGS@ EBCONF_PTHREAD_CPPFLAGS = @EBCONF_PTHREAD_CPPFLAGS@ EBCONF_PTHREAD_LDFLAGS = @EBCONF_PTHREAD_LDFLAGS@ EBCONF_ZLIBINCS = @EBCONF_ZLIBINCS@ EBCONF_ZLIBLIBS = @EBCONF_ZLIBLIBS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GZIPCMD = @GZIPCMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAILING_ADDRESS = @MAILING_ADDRESS@ MAILX = @MAILX@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ noinst_LIBRARIES = libebnetd.a libebnetd_a_SOURCES = confutil.c daemon.c fakelog.c fdset.c filename.c \ getopt.c hostname.c inet_pton2.c ioall.c linebuf.c logpid.c \ makedir.c mappedaddr.c openmax.c permission.c privilege.c \ readconf.c serverport.c signame.c ticket.c wildcard.c libebnetd_a_LIBADD = @LIBOBJS@ noinst_HEADERS = dummyin6.h getaddrinfo.h confutil.h daemon.h fakelog.h \ fdset.h filename.h getopt.h hostname.h inet_pton2.h ioall.h \ linebuf.h logpid.h makedir.h mappedaddr.h openmax.h permission.h \ privilege.h readconf.h serverport.h signame.h ticket.h wildcard.h INCLUDES = -DUSE_FAKELOG all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libebnetd.a: $(libebnetd_a_OBJECTS) $(libebnetd_a_DEPENDENCIES) -rm -f libebnetd.a $(libebnetd_a_AR) libebnetd.a $(libebnetd_a_OBJECTS) $(libebnetd_a_LIBADD) $(RANLIB) libebnetd.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/dummyin6.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getaddrinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/inet_pton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memchr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memmove.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/confutil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/daemon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fakelog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linebuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logpid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makedir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mappedaddr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openmax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/permission.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/privilege.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serverport.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signame.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ticket.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wildcard.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: 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: TAGS 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 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"; \ $(mkdir_p) "$(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 $(LIBRARIES) $(HEADERS) installdirs: 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-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am 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 mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ 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: ebnetd-1.0.dfsg.1/lib/dummyin6.c0000644000175000017500000000473707673055371015724 0ustar mhattamhatta/* * Copyright (c) 2001 Motoyuki Kasahara * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * This program provides macros, types and external variables related * to basic IPv6 programming such as PF_INET6. This program is useful * for application which supports both IPv6 and traditional IPv4 systems. * * To use this program, include the header file. * * #include "dummyin6.h" * * This program is intended to be used in combination with GNU Autoconf. * (see below). * * Restriction: * `struct sockaddr_storage' has no ss_ or __ss_ member (e.g. ss_family) * since the structure is merely alias of `sturct sockaddr_in'. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_STRUCT_IN6_ADDR * AC_STRUCT_SOCKADDR_IN6 * AX_STRUCT_SOCKADDR_STORAGE * AC_DECL_IN6ADDR_ANY * AC_DECL_IN6ADDR_LOOPBACK */ #include "dummyin6.h" #ifndef IN6ADDR_ANY_DECLARED const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; #endif #ifndef IN6ADDR_LOOPBACK_DECLARED const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; #endif ebnetd-1.0.dfsg.1/lib/getaddrinfo.c0000644000175000017500000003315607674603040016430 0ustar mhattamhatta/* * Copyright (c) 2001, 02 Motoyuki Kasahara * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * This program provides getaddrinfo() and getnameinfo() described in * RFC2133, 2553 and 3493. These functions are mainly used for IPv6 * application to resolve hostname or address. * * This program is designed to be working on traditional IPv4 systems * which don't have those functions. Therefore, this implementation * supports IPv4 only. * * This program is useful for application which should support both IPv6 * and traditional IPv4 systems. Use genuine getaddrinfo() and getnameinfo() * provided by system if the system supports IPv6. Otherwise, use this * implementation. * * This program is intended to be used in combination with GNU Autoconf. * * This program also provides freeaddrinfo() and gai_strerror(). * * To use this program in your application, insert the following lines to * C source files after including `sys/types.h', `sys/socket.h' and * `netdb.h'. `getaddrinfo.h' defines `struct addrinfo' and AI_, NI_, * EAI_ macros. * * #ifndef HAVE_GETADDRINFO * #include "getaddrinfo.h" * #endif * * Restriction: * getaddrinfo() and getnameinfo() of this program are NOT thread * safe, unless the cpp macro ENABLE_PTHREAD is defined. */ /* * Add the following code to your configure.ac (or configure.in). * AC_C_CONST * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h memory.h stdlib.h) * AC_CHECK_FUNCS(memcpy) * AC_REPLACE_FUNCS(memset) * AC_TYPE_SOCKLEN_T * AC_TYPE_IN_PORT_T * AC_DECL_H_ERRNO * * AC_CHECK_FUNCS(getaddrinfo getnameinfo) * if test "$ac_cv_func_getaddrinfo$ac_cv_func_getnameinfo" != yesyes ; then * LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext" * fi */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef ENABLE_PTHREAD #include #endif #ifdef ENABLE_NLS #include #endif #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif /* not HAVE_MEMCPY */ #ifndef H_ERRNO_DECLARED extern int h_errno; #endif #include "getaddrinfo.h" #ifdef ENABLE_NLS #define _(string) gettext(string) #ifdef gettext_noop #define N_(string) gettext_noop(string) #else #define N_(string) (string) #endif #else #define gettext(string) (string) #define _(string) (string) #define N_(string) (string) #endif /* * Error messages for gai_strerror(). */ static char *eai_errlist[] = { N_("Success"), /* EAI_ADDRFAMILY */ N_("Address family for hostname not supported"), /* EAI_AGAIN */ N_("Temporary failure in name resolution"), /* EAI_BADFLAGS */ N_("Invalid value for ai_flags"), /* EAI_FAIL */ N_("Non-recoverable failure in name resolution"), /* EAI_FAMILY */ N_("ai_family not supported"), /* EAI_MEMORY */ N_("Memory allocation failure"), /* EAI_NONAME */ N_("hostname nor servname provided, or not known"), /* EAI_OVERFLOW */ N_("An argument buffer overflowed"), /* EAI_SERVICE */ N_("servname not supported for ai_socktype"), /* EAI_SOCKTYPE */ N_("ai_socktype not supported"), /* EAI_SYSTEM */ N_("System error returned in errno") }; /* * Default hints for getaddrinfo(). */ static struct addrinfo default_hints = { 0, PF_UNSPEC, 0, 0, 0, NULL, NULL, NULL }; /* * Mutex. */ #ifdef ENABLE_PTHREAD static pthread_mutex_t gai_mutex = PTHREAD_MUTEX_INITIALIZER; #endif /* * Declaration of static functions. */ #ifdef __STDC__ static int is_integer(const char *); static int is_address(const char *); static int itoa_length(int); #else static int is_integer(); static int is_address(); static int itoa_length(); #endif /* * gai_strerror(). */ const char * gai_strerror(ecode) int ecode; { if (ecode < 0 || ecode > EAI_SYSTEM) return _("Unknown error"); return gettext(eai_errlist[ecode]); } /* * freeaddrinfo(). */ void freeaddrinfo(ai) struct addrinfo *ai; { struct addrinfo *next_ai; while (ai != NULL) { if (ai->ai_canonname != NULL) free(ai->ai_canonname); if (ai->ai_addr != NULL) free(ai->ai_addr); next_ai = ai->ai_next; free(ai); ai = next_ai; } } /* * Return 1 if the string `s' represents an integer. */ static int is_integer(s) const char *s; { if (*s == '-' || *s == '+') s++; if (*s < '0' || '9' < *s) return 0; s++; while ('0' <= *s && *s <= '9') s++; return (*s == '\0'); } /* * Return 1 if the string `s' represents an IPv4 address. * Unlike inet_addr(), it doesn't permit malformed nortation such * as "192.168". */ static int is_address(s) const char *s; { const static char delimiters[] = {'.', '.', '.', '\0'}; int i, j; int octet; for (i = 0; i < 4; i++) { if (*s == '0' && *(s + 1) != delimiters[i]) return 0; for (j = 0, octet = 0; '0' <= *s && *s <= '9' && j < 3; s++, j++) octet = octet * 10 + (*s - '0'); if (j == 0 || octet > 255 || *s != delimiters[i]) return 0; s++; } return 1; } /* * Calcurate length of the string `s', where `s' is set by * sprintf(s, "%d", n). */ static int itoa_length(n) int n; { int result = 1; if (n < 0) { n = -n; result++; } while (n >= 10) { result++; n /= 10; } return result; } /* * getaddrinfo(). */ int getaddrinfo(nodename, servname, hints, res) const char *nodename; const char *servname; const struct addrinfo *hints; struct addrinfo **res; { struct addrinfo *head_res = NULL; struct addrinfo *tail_res = NULL; struct addrinfo *new_res; struct sockaddr_in *sa_in; struct in_addr **addr_list; struct in_addr *addr_list_buf[2]; struct in_addr addr_buf; struct in_addr **ap; struct servent *servent; struct hostent *hostent; const char *canonname = NULL; in_port_t port; int saved_h_errno; int result = 0; #ifdef ENABLE_PTHREAD pthread_mutex_lock(&gai_mutex); #endif saved_h_errno = h_errno; if (nodename == NULL && servname == NULL) { result = EAI_NONAME; goto end; } if (hints != NULL) { if (hints->ai_family != PF_INET && hints->ai_family != PF_UNSPEC) { result = EAI_FAMILY; goto end; } if (hints->ai_socktype != SOCK_DGRAM && hints->ai_socktype != SOCK_STREAM && hints->ai_socktype != 0) { result = EAI_SOCKTYPE; goto end; } } else { hints = &default_hints; } if (servname != NULL) { if (is_integer(servname)) port = htons(atoi(servname)); else { if (hints->ai_flags & AI_NUMERICSERV) { result = EAI_NONAME; goto end; } if (hints->ai_socktype == SOCK_DGRAM) servent = getservbyname(servname, "udp"); else if (hints->ai_socktype == SOCK_STREAM) servent = getservbyname(servname, "tcp"); else if (hints->ai_socktype == 0) servent = getservbyname(servname, "tcp"); else { result = EAI_SOCKTYPE; goto end; } if (servent == NULL) { result = EAI_SERVICE; goto end; } port = servent->s_port; } } else { port = htons(0); } if (nodename != NULL) { if (is_address(nodename)) { addr_buf.s_addr = inet_addr(nodename); addr_list_buf[0] = &addr_buf; addr_list_buf[1] = NULL; addr_list = addr_list_buf; if (hints->ai_flags & AI_CANONNAME && !(hints->ai_flags & AI_NUMERICHOST)) { hostent = gethostbyaddr((char *)&addr_buf, sizeof(struct in_addr), AF_INET); if (hostent != NULL) canonname = hostent->h_name; else canonname = nodename; } } else { if (hints->ai_flags & AI_NUMERICHOST) { result = EAI_NONAME; goto end; } hostent = gethostbyname(nodename); if (hostent == NULL) { switch (h_errno) { case HOST_NOT_FOUND: case NO_DATA: result = EAI_NONAME; goto end; case TRY_AGAIN: result = EAI_AGAIN; goto end; default: result = EAI_FAIL; goto end; } } addr_list = (struct in_addr **)hostent->h_addr_list; if (hints->ai_flags & AI_CANONNAME) canonname = hostent->h_name; } } else { if (hints->ai_flags & AI_PASSIVE) addr_buf.s_addr = htonl(INADDR_ANY); else addr_buf.s_addr = htonl(0x7F000001); addr_list_buf[0] = &addr_buf; addr_list_buf[1] = NULL; addr_list = addr_list_buf; } for (ap = addr_list; *ap != NULL; ap++) { new_res = (struct addrinfo *)malloc(sizeof(struct addrinfo)); if (new_res == NULL) { if (head_res != NULL) freeaddrinfo(head_res); result = EAI_MEMORY; goto end; } new_res->ai_family = PF_INET; new_res->ai_socktype = hints->ai_socktype; new_res->ai_protocol = hints->ai_protocol; new_res->ai_addr = NULL; new_res->ai_addrlen = sizeof(struct sockaddr_in); new_res->ai_canonname = NULL; new_res->ai_next = NULL; new_res->ai_addr = (struct sockaddr *) malloc(sizeof(struct sockaddr_in)); if (new_res->ai_addr == NULL) { free(new_res); if (head_res != NULL) freeaddrinfo(head_res); result = EAI_MEMORY; goto end; } sa_in = (struct sockaddr_in *)new_res->ai_addr; memset(sa_in, 0, sizeof(struct sockaddr_in)); sa_in->sin_family = PF_INET; sa_in->sin_port = port; memcpy(&sa_in->sin_addr, *ap, sizeof(struct in_addr)); if (head_res == NULL) head_res = new_res; else tail_res->ai_next = new_res; tail_res = new_res; } if (canonname != NULL && head_res != NULL) { head_res->ai_canonname = (char *)malloc(strlen(canonname) + 1); if (head_res->ai_canonname != NULL) strcpy(head_res->ai_canonname, canonname); } *res = head_res; end: h_errno = saved_h_errno; #ifdef ENABLE_PTHREAD pthread_mutex_unlock(&gai_mutex); #endif return result; } /* * getnameinfo(). */ int getnameinfo(sa, salen, node, nodelen, serv, servlen, flags) const struct sockaddr *sa; socklen_t salen; char *node; socklen_t nodelen; char *serv; socklen_t servlen; int flags; { const struct sockaddr_in *sa_in = (const struct sockaddr_in *)sa; struct hostent *hostent; struct servent *servent; char *ntoa_address; int saved_h_errno; int result = 0; #ifdef ENABLE_PTHREAD pthread_mutex_lock(&gai_mutex); #endif saved_h_errno = h_errno; if (sa_in->sin_family != PF_INET) { result = EAI_FAMILY; goto end; } else if (node == NULL && serv == NULL) { result = EAI_NONAME; goto end; } if (serv != NULL && servlen > 0) { if (flags & NI_NUMERICSERV) servent = NULL; else if (flags & NI_DGRAM) servent = getservbyport(sa_in->sin_port, "udp"); else servent = getservbyport(sa_in->sin_port, "tcp"); if (servent != NULL) { if (servlen <= strlen(servent->s_name)) { result = EAI_OVERFLOW; goto end; } strcpy(serv, servent->s_name); } else { if (servlen <= itoa_length(ntohs(sa_in->sin_port))) { result = EAI_OVERFLOW; goto end; } sprintf(serv, "%d", ntohs(sa_in->sin_port)); } } if (node != NULL && nodelen > 0) { if (flags & NI_NUMERICHOST) hostent = NULL; else { hostent = gethostbyaddr((char *)&sa_in->sin_addr, sizeof(struct in_addr), AF_INET); } if (hostent != NULL) { if (nodelen <= strlen(hostent->h_name)) { result = EAI_OVERFLOW; goto end; } strcpy(node, hostent->h_name); } else { if (flags & NI_NAMEREQD) { result = EAI_NONAME; goto end; } ntoa_address = inet_ntoa(sa_in->sin_addr); if (nodelen <= strlen(ntoa_address)) { result = EAI_OVERFLOW; goto end; } strcpy(node, ntoa_address); } } end: h_errno = saved_h_errno; #ifdef ENABLE_PTHREAD pthread_mutex_unlock(&gai_mutex); #endif return result; } ebnetd-1.0.dfsg.1/lib/inet_pton.c0000644000175000017500000001422307673055365016145 0ustar mhattamhatta/* Copyright (c) 1996 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_HEADER_STDC * AC_CHECK_FUNCS(memcpy strchr) * AC_REPLACE_FUNCS(memset) * AC_CHECK_HEADERS(string.h, memory.h) */ /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #include "dummyin6.h" #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef VOID #ifdef __STDC__ #define VOID void #else #define VOID char #endif #endif #ifndef AF_INET6 #define AF_INET6 (AF_INET + 1) #endif #ifndef PF_INET6 #define PF_INET6 (PF_INET + 1) #endif #ifdef __STDC__ static int inet_pton4(const char *src, unsigned char *dst); static int inet_pton6(const char *src, unsigned char *dst); #else static int inet_pton4(); static int inet_pton6(); #endif /* int * inet_pton(af, src, dst) * convert from presentation format (which usually means ASCII printable) * to network format (which is usually some kind of binary format). * return: * 1 if the address was valid for the specified address family * 0 if the address wasn't valid (`dst' is untouched in this case) * -1 if some other error occurred (`dst' is untouched in this case, too) * author: * Paul Vixie, 1996. */ int inet_pton(af, src, dst) int af; const char *src; VOID *dst; { switch (af) { case AF_INET: return (inet_pton4(src, dst)); case AF_INET6: return (inet_pton6(src, dst)); default: #ifdef EAFNOSUPPORT errno = EAFNOSUPPORT; #endif return (-1); } /* NOTREACHED */ } /* int * inet_pton4(src, dst) * like inet_aton() but without all the hexadecimal and shorthand. * return: * 1 if `src' is a valid dotted quad, else 0. * notice: * does not touch `dst' unless it's returning 1. * author: * Paul Vixie, 1996. */ static int inet_pton4(src, dst) const char *src; unsigned char *dst; { static const char digits[] = "0123456789"; int saw_digit, octets, ch; unsigned char tmp[4], *tp; saw_digit = 0; octets = 0; *(tp = tmp) = 0; while ((ch = *src++) != '\0') { const char *pch; if ((pch = strchr(digits, ch)) != NULL) { unsigned int new = *tp * 10 + (pch - digits); if (new > 255) return (0); *tp = new; if (! saw_digit) { if (++octets > 4) return (0); saw_digit = 1; } } else if (ch == '.' && saw_digit) { if (octets == 4) return (0); *++tp = 0; saw_digit = 0; } else return (0); } if (octets < 4) return (0); memcpy(dst, tmp, 4); return (1); } /* int * inet_pton6(src, dst) * convert presentation level address to network order binary form. * return: * 1 if `src' is a valid [RFC1884 2.2] address, else 0. * notice: * (1) does not touch `dst' unless it's returning 1. * (2) :: in a full address is silently ignored. * credit: * inspired by Mark Andrews. * author: * Paul Vixie, 1996. */ static int inet_pton6(src, dst) const char *src; unsigned char *dst; { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; unsigned char tmp[16], *tp, *endp, *colonp; const char *xdigits, *curtok; int ch, saw_xdigit; unsigned int val; memset((tp = tmp), '\0', 16); endp = tp + 16; colonp = NULL; /* Leading :: requires some special handling. */ if (*src == ':') if (*++src != ':') return (0); curtok = src; saw_xdigit = 0; val = 0; while ((ch = *src++) != '\0') { const char *pch; if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) pch = strchr((xdigits = xdigits_u), ch); if (pch != NULL) { val <<= 4; val |= (pch - xdigits); if (val > 0xffff) return (0); saw_xdigit = 1; continue; } if (ch == ':') { curtok = src; if (!saw_xdigit) { if (colonp) return (0); colonp = tp; continue; } if (tp + 2 > endp) return (0); *tp++ = (unsigned char) (val >> 8) & 0xff; *tp++ = (unsigned char) val & 0xff; saw_xdigit = 0; val = 0; continue; } if (ch == '.' && ((tp + 4) <= endp) && inet_pton4(curtok, tp) > 0) { tp += 4; saw_xdigit = 0; break; /* '\0' was seen by inet_pton4(). */ } return (0); } if (saw_xdigit) { if (tp + 2 > endp) return (0); *tp++ = (unsigned char) (val >> 8) & 0xff; *tp++ = (unsigned char) val & 0xff; } if (colonp != NULL) { /* * Since some memmove()'s erroneously fail to handle * overlapping regions, we'll do the shift by hand. */ const int n = tp - colonp; int i; for (i = 1; i <= n; i++) { endp[- i] = colonp[n - i]; colonp[n - i] = 0; } tp = endp; } if (tp != endp) return (0); memcpy(dst, tmp, 16); return (1); } ebnetd-1.0.dfsg.1/lib/memchr.c0000644000175000017500000000257407673055372015425 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T */ #ifdef HAVE_CONFIG_H #include "config.h" #else /* Define to empty if the keyword `const' does not work. */ /* #define const */ /* Define if `size_t' is not defined. */ /* #define size_t unsigned */ #endif /* not HAVE_CONFIG_H */ #include #include #ifndef VOID #ifdef __STDC__ #define VOID void #else #define VOID char #endif #endif /* * memchr() described in ISO 9899: 1990. */ VOID * memchr(stream, character, length) const VOID *stream; int character; size_t length; { const unsigned char *s = (const unsigned char *)stream; unsigned char c = (unsigned char)character; size_t i; for (i = 0; i < length; i++) { if (*s == c) return (VOID *)s; s++; } return NULL; } ebnetd-1.0.dfsg.1/lib/memmove.c0000644000175000017500000000267507673055367015625 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T */ #ifdef HAVE_CONFIG_H #include "config.h" #else /* Define to empty if the keyword `const' does not work. */ /* #define const */ /* Define if `size_t' is not defined. */ /* #define size_t unsigned */ #endif /* not HAVE_CONFIG_H */ #include #ifndef VOID #ifdef __STDC__ #define VOID void #else #define VOID char #endif #endif /* * memmove() described in ISO 9899: 1990. */ VOID * memmove(destination, source, length) VOID *destination; const VOID *source; size_t length; { char *d = (char *)destination; const char *s = (const char *)source; size_t i; if (s < d) { s += length - 1; d += length - 1; for (i = 0; i < length; i++) *d-- = *s--; } else if (s != d) { for (i = 0; i < length; i++) *d++ = *s++; } return destination; } ebnetd-1.0.dfsg.1/lib/memset.c0000644000175000017500000000231707673055406015435 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_TYPE_SIZE_T */ #ifdef HAVE_CONFIG_H #include "config.h" #else /* Define if `size_t' is not defined. */ /* #define size_t unsigned */ #endif /* not HAVE_CONFIG_H */ #include #ifndef VOID #ifdef __STDC__ #define VOID void #else #define VOID char #endif #endif /* * memset() described in ISO 9899: 1990. */ VOID * memset(stream, character, length) VOID *stream; int character; size_t length; { unsigned char *s = (unsigned char *)stream; unsigned char c = (unsigned char)character; size_t i; for (i = 0; i < length; i++) *s++ = c; return stream; } ebnetd-1.0.dfsg.1/lib/strcasecmp.c0000644000175000017500000000447307673055367016322 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This programs 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T */ #ifdef HAVE_CONFIG_H #include "config.h" #else /* Define to empty if the keyword `const' does not work. */ /* #define const */ /* Define if `size_t' is not defined. */ /* #define size_t unsigned */ #endif /* not HAVE_CONFIG_H */ #include /* * Compare strings. * Cases in the strings are insensitive. */ int strcasecmp(string1, string2) const char *string1; const char *string2; { const unsigned char *string1_p = (const unsigned char *)string1; const unsigned char *string2_p = (const unsigned char *)string2; int c1, c2; while (*string1_p != '\0') { if ('a' <= *string1_p && *string1_p <= 'z') c1 = *string1_p - ('a' - 'A'); else c1 = *string1_p; if ('a' <= *string2_p && *string2_p <= 'z') c2 = *string2_p - ('a' - 'A'); else c2 = *string2_p; if (c1 != c2) return c1 - c2; string1_p++; string2_p++; } return -(*string2_p); } /* * Compare strings within `n' characters. * Cases in the strings are insensitive. */ int strncasecmp(string1, string2, n) const char *string1; const char *string2; size_t n; { const unsigned char *string1_p = (const unsigned char *)string1; const unsigned char *string2_p = (const unsigned char *)string2; size_t i = n; int c1, c2; if (i <= 0) return 0; while (*string1_p != '\0') { if ('a' <= *string1_p && *string1_p <= 'z') c1 = *string1_p - ('a' - 'A'); else c1 = *string1_p; if ('a' <= *string2_p && *string2_p <= 'z') c2 = *string2_p - ('a' - 'A'); else c2 = *string2_p; if (c1 != c2) return c1 - c2; string1_p++; string2_p++; i--; if (i <= 0) return 0; } return -(*string2_p); } ebnetd-1.0.dfsg.1/lib/strerror.c0000644000175000017500000000324707673055375016035 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ extern char *sys_errlist[]; extern int sys_nerr; /* * strerror() described in ISO 9899: 1990. */ char * strerror(error_number) int error_number; { if (0 < error_number && error_number <= sys_nerr) return sys_errlist[error_number]; return "Unknown error"; } /* * perror() described in ISO 9899: 1990. */ void perror(message) const char *message; { if (message != NULL) fprintf(stderr, "%s: ", message); if (0 < errno && errno <= sys_nerr) { fputs(sys_errlist[errno], stderr); fputc('\n', stderr); } else fputs("Unknown error\n", stderr); } ebnetd-1.0.dfsg.1/lib/strtol.c0000644000175000017500000002066207673055405015474 0ustar mhattamhatta/* strtol - Convert string representation of a number into an integer value. Copyright (C) 1991, 92, 94, 95, 96, 97 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if HAVE_CONFIG_H # include #endif #ifdef _LIBC # define USE_NUMBER_GROUPING # define STDC_HEADERS # define HAVE_LIMITS_H #endif #include #include #ifndef errno extern int errno; #endif #ifndef __set_errno # define __set_errno(Val) errno = (Val) #endif #ifdef HAVE_LIMITS_H # include #endif #ifdef STDC_HEADERS # include # include # include #else # ifndef NULL # define NULL 0 # endif #endif #ifdef USE_NUMBER_GROUPING # include "../locale/localeinfo.h" #endif /* Nonzero if we are defining `strtoul' or `strtouq', operating on unsigned integers. */ #ifndef UNSIGNED # define UNSIGNED 0 # define INT LONG int #else # define INT unsigned LONG int #endif /* Determine the name. */ #if UNSIGNED # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol wcstouq # else # define strtol wcstoul # endif # else # ifdef QUAD # define strtol strtouq # else # define strtol strtoul # endif # endif #else # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol wcstoq # else # define strtol wcstol # endif # else # ifdef QUAD # define strtol strtoq # endif # endif #endif /* If QUAD is defined, we are defining `strtoq' or `strtouq', operating on `long long int's. */ #ifdef QUAD # define LONG long long # undef LONG_MIN # define LONG_MIN LONG_LONG_MIN # undef LONG_MAX # define LONG_MAX LONG_LONG_MAX # undef ULONG_MAX # define ULONG_MAX ULONG_LONG_MAX # if __GNUC__ == 2 && __GNUC_MINOR__ < 7 /* Work around gcc bug with using this constant. */ static const unsigned long long int maxquad = ULONG_LONG_MAX; # undef ULONG_MAX # define ULONG_MAX maxquad # endif #else # define LONG long #ifndef ULONG_MAX # define ULONG_MAX ((unsigned long) ~(unsigned long) 0) #endif #ifndef LONG_MAX # define LONG_MAX ((long int) (ULONG_MAX >> 1)) #endif #endif #ifdef USE_WIDE_CHAR # include # include # define L_(Ch) L##Ch # define UCHAR_TYPE wint_t # define STRING_TYPE wchar_t # define ISSPACE(Ch) iswspace (Ch) # define ISALPHA(Ch) iswalpha (Ch) # define TOUPPER(Ch) towupper (Ch) #else # define L_(Ch) Ch # define UCHAR_TYPE unsigned char # define STRING_TYPE char # define ISSPACE(Ch) isspace (Ch) # define ISALPHA(Ch) isalpha (Ch) # define TOUPPER(Ch) toupper (Ch) #endif #ifdef __STDC__ # define INTERNAL(X) INTERNAL1(X) # define INTERNAL1(X) __##X##_internal # define WEAKNAME(X) WEAKNAME1(X) #else # define INTERNAL(X) __/**/X/**/_internal #endif #ifdef USE_NUMBER_GROUPING /* This file defines a function to check for correct grouping. */ # include "grouping.h" #endif /* Convert NPTR to an `unsigned long int' or `long int' in base BASE. If BASE is 0 the base is determined by the presence of a leading zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. If BASE is < 2 or > 36, it is reset to 10. If ENDPTR is not NULL, a pointer to the character after the last one converted is stored in *ENDPTR. */ INT INTERNAL (strtol) (nptr, endptr, base, group) const STRING_TYPE *nptr; STRING_TYPE **endptr; int base; int group; { int negative; register unsigned LONG int cutoff; register unsigned int cutlim; register unsigned LONG int i; register const STRING_TYPE *s; register UCHAR_TYPE c; const STRING_TYPE *save, *end; int overflow; #ifdef USE_NUMBER_GROUPING /* The thousands character of the current locale. */ wchar_t thousands; /* The numeric grouping specification of the current locale, in the format described in . */ const char *grouping; if (group) { grouping = _NL_CURRENT (LC_NUMERIC, GROUPING); if (*grouping <= 0 || *grouping == CHAR_MAX) grouping = NULL; else { /* Figure out the thousands separator character. */ if (mbtowc (&thousands, _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP), strlen (_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP))) <= 0) thousands = (wchar_t) *_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP); if (thousands == L'\0') grouping = NULL; } } else grouping = NULL; #endif if (base < 0 || base == 1 || base > 36) { __set_errno (EINVAL); return 0; } save = s = nptr; /* Skip white space. */ while (ISSPACE (*s)) ++s; if (*s == L_('\0')) goto noconv; /* Check for a sign. */ if (*s == L_('-')) { negative = 1; ++s; } else if (*s == L_('+')) { negative = 0; ++s; } else negative = 0; if (base == 16 && s[0] == L_('0') && TOUPPER (s[1]) == L_('X')) s += 2; /* If BASE is zero, figure it out ourselves. */ if (base == 0) if (*s == L_('0')) { if (TOUPPER (s[1]) == L_('X')) { s += 2; base = 16; } else base = 8; } else base = 10; /* Save the pointer so we can check later if anything happened. */ save = s; #ifdef USE_NUMBER_GROUPING if (group) { /* Find the end of the digit string and check its grouping. */ end = s; for (c = *end; c != L_('\0'); c = *++end) if ((wchar_t) c != thousands && ((wchar_t) c < L_('0') || (wchar_t) c > L_('9')) && (!ISALPHA (c) || (int) (TOUPPER (c) - L_('A') + 10) >= base)) break; if (*s == thousands) end = s; else end = correctly_grouped_prefix (s, end, thousands, grouping); } else #endif end = NULL; cutoff = ULONG_MAX / (unsigned LONG int) base; cutlim = ULONG_MAX % (unsigned LONG int) base; overflow = 0; i = 0; for (c = *s; c != L_('\0'); c = *++s) { if (s == end) break; if (c >= L_('0') && c <= L_('9')) c -= L_('0'); else if (ISALPHA (c)) c = TOUPPER (c) - L_('A') + 10; else break; if ((int) c >= base) break; /* Check for overflow. */ if (i > cutoff || (i == cutoff && c > cutlim)) overflow = 1; else { i *= (unsigned LONG int) base; i += c; } } /* Check if anything actually happened. */ if (s == save) goto noconv; /* Store in ENDPTR the address of one character past the last character we converted. */ if (endptr != NULL) *endptr = (STRING_TYPE *) s; #if !UNSIGNED /* Check for a value that is within the range of `unsigned LONG int', but outside the range of `LONG int'. */ if (overflow == 0 && i > (negative ? -((unsigned LONG int) (LONG_MIN + 1)) + 1 : (unsigned LONG int) LONG_MAX)) overflow = 1; #endif if (overflow) { __set_errno (ERANGE); #if UNSIGNED return ULONG_MAX; #else return negative ? LONG_MIN : LONG_MAX; #endif } /* Return the result of the appropriate sign. */ return (negative ? -i : i); noconv: /* We must handle a special case here: the base is 0 or 16 and the first two characters are '0' and 'x', but the rest are no hexadecimal digits. This is no error case. We return 0 and ENDPTR points to the `x`. */ if (endptr != NULL) if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X') && save[-2] == L_('0')) *endptr = (STRING_TYPE *) &save[-1]; else /* There was no number to convert. */ *endptr = (STRING_TYPE *) nptr; return 0L; } /* External user entry point. */ #if _LIBC - 0 == 0 # undef PARAMS # if defined (__STDC__) && __STDC__ # define PARAMS(Args) Args # else # define PARAMS(Args) () # endif /* Prototype. */ INT strtol PARAMS ((const STRING_TYPE *nptr, STRING_TYPE **endptr, int base)); #endif INT #ifdef weak_function weak_function #endif strtol (nptr, endptr, base) const STRING_TYPE *nptr; STRING_TYPE **endptr; int base; { return INTERNAL (strtol) (nptr, endptr, base, 0); } ebnetd-1.0.dfsg.1/lib/confutil.c0000644000175000017500000001676507673055376016010 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T * AC_TYPE_UID_T * AC_TYPE_GID_T * AC_TYPE_IN_PORT_T * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h, stdlib.h, unistd.h) * AC_CHECK_FUNCS(strcasecmp, strtol) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ #ifndef HAVE_STRTOL #ifdef __STDC__ long strtol(const char *, char **, int); #else /* not __STDC__ */ long strtol(); #endif /* not __STDC__ */ #endif /* not HAVE_STRTOL */ /* * Convert a string to an integer. * * The argument `string' must consists of an optional sign ('-' or '+') * and at least one digit ('0'..'9'). * * If `string' doesn't match this format, -1 is returned. * Otherwise 0 is returned, and the corresponding integer value is * put into `number'. */ int parse_integer(string, number) const char *string; int *number; { const char *p = string; if (*p == '-' || *p == '+') p++; if (*p == '\0') return -1; while ('0' <= *p && *p <= '9') p++; if (*p != '\0') return -1; *number = (int)strtol(string, NULL, 10); return 0; } /* * Convert a string to a port number. (TCP) * * The argument `string' must represents a service name on TCP (e.g. `smtp') * or a port number (e.g. `25'). * * If the string doesn't represent neither valid service name nor port * number, -1 is returned. Otherwise, 0 is returned and the corresponding * port number is put into `port'. */ int parse_tcp_port(string, port) const char *string; in_port_t *port; { struct servent *serv; int n; if (parse_integer(string, &n) == 0) { if (n < 0 || 65535 < n) return -1; *port = n; } else { serv = getservbyname(string, "tcp"); if (serv == NULL) return -1; *port = ntohs(serv->s_port); } return 0; } /* * Convert a string to a port number. (UDP) * * The argument `string' must represents a service name on UDP (e.g. `ntp') * or a port number (e.g. `123'). * * If the string doesn't represent neither valid service name nor port * number, -1 is returned. Otherwise, 0 is returned and the corresponding * port number is put into `port'. */ int parse_udp_port(string, port) const char *string; in_port_t *port; { struct servent *serv; int n; if (parse_integer(string, &n) == 0) { if (n < 0 || 65535 < n) return -1; *port = n; } else { serv = getservbyname(string, "udp"); if (serv == NULL) return -1; *port = ntohs(serv->s_port); } return 0; } /* * Convert a string to an user ID. * * The argument `string' must represents an user name (e.g. `root') or * an user ID (e.g. `0'). * * If the string doesn't represent neither valid service name nor port * number, -1 is returned. Otherwise, 0 is returned and the corresponding * user ID is put into `port'. */ int parse_user(string, user) const char *string; uid_t *user; { struct passwd *entry; int n; if (0 <= parse_integer(string, &n)) *user = (uid_t) n; else { entry = getpwnam(string); if (entry == NULL) return -1; *user = entry->pw_uid; } return 0; } /* * Convert a string to an group ID. * * The argument `string' must represents a group name (e.g. `sys') or an * group ID (e.g. `1'). * * If the string doesn't represent neither valid service name nor port * number, -1 is returned. Otherwise, 0 is returned and the corresponding * group ID is put into `port'. */ int parse_group(string, group) const char *string; gid_t *group; { struct group *entry; int n; if (0 <= parse_integer(string, &n)) *group = (gid_t) n; else { entry = getgrnam(string); if (entry == NULL) return -1; *group = entry->gr_gid; } return 0; } /* * Convert a string (`ON' or `OFF') to an integer (0 or 1). * * The argument `string' must represents `ON' or `OFF'. Cases in the * string are insensitive, so that `ON', `On' `oN', and `on' are accepted. * * If succeeded, the result is put into `result' and 0 is returned. * If `string' represents ON, `result' is set to 1. * If `string' represents OFF, `result' is set to 0. * If `string' represents neither ON nor OFF, -1 is returned. */ int parse_on_off(string, result) const char *string; int *result; { if (strcasecmp(string, "ON") == 0) *result = 1; else if (strcasecmp(string, "OFF") == 0) *result = 0; else return -1; return 0; } /* * Syslog facility and its name. */ typedef struct { int code; const char *name; } Facility_Entry; static const Facility_Entry facility_table[] = { #ifdef LOG_AUTH {LOG_AUTH, "auth"}, #endif #ifdef LOG_AUTHPRIV {LOG_AUTHPRIV, "authpriv"}, #endif #ifdef LOG_CRON {LOG_CRON, "cron"}, #endif #ifdef LOG_DAEMON {LOG_DAEMON, "daemon"}, #endif #ifdef LOG_FTP {LOG_FTP, "ftp"}, #endif #ifdef LOG_KERN {LOG_KERN, "kern"}, #endif #ifdef LOG_LOCAL0 {LOG_LOCAL0, "local0"}, #endif #ifdef LOG_LOCAL1 {LOG_LOCAL1, "local1"}, #endif #ifdef LOG_LOCAL2 {LOG_LOCAL2, "local2"}, #endif #ifdef LOG_LOCAL3 {LOG_LOCAL3, "local3"}, #endif #ifdef LOG_LOCAL4 {LOG_LOCAL4, "local4"}, #endif #ifdef LOG_LOCAL5 {LOG_LOCAL5, "local5"}, #endif #ifdef LOG_LOCAL6 {LOG_LOCAL6, "local6"}, #endif #ifdef LOG_LOCAL7 {LOG_LOCAL7, "local7"}, #endif #ifdef LOG_LPR {LOG_LPR, "lpr"}, #endif #ifdef LOG_MAIL {LOG_MAIL, "mail"}, #endif #ifdef LOG_NEWS {LOG_NEWS, "news"}, #endif #ifdef LOG_SYSLOG {LOG_SYSLOG, "syslog"}, #endif #ifdef LOG_USER {LOG_USER, "user"}, #endif #ifdef LOG_UUCP {LOG_UUCP, "uucp"}, #endif {-1, NULL} }; /* * Convert a syslog facility name to a code. * * The argument `string' must represents a syslog facility name (e.g. * `auth'). * * If the string doesn't represent valid facility name, -1 is returned. * Otherwise, 0 is returned and the corresponding facility code (e.g. * LOG_AUTH) is put into `code'. */ int parse_syslog_facility(name, code) const char *name; int *code; { #ifdef LOG_DAEMON const Facility_Entry *ent; for (ent = facility_table; ent->name != NULL; ent++) { if (strcasecmp(name, ent->name) == 0) { *code = ent->code; return 0; } } #endif /* not LOG_DAEMON */ return -1; } ebnetd-1.0.dfsg.1/lib/daemon.c0000644000175000017500000000572307673055366015417 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_TYPE_PID_T * AC_CHECK_HEADERS(fcntl.h, unistd.h) * AC_CHECK_FUNCS(setsid) * AC_FUNC_SETPGRP */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_FCNTL_H #include #else #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_SETSID #include #endif #ifdef USE_FAKELOG #include "fakelog.h" #endif /* * Run the current process as daemon. */ int daemonize() { pid_t pid; #ifndef HAVE_SETSID int fd = -1; #endif /* * Fork, and then the parent exits. */ pid = fork(); if (pid < 0) { syslog(LOG_ERR, "fork() failed, %s", strerror(errno)); goto failed; } else if (0 < pid) exit(0); /* * Close a tty. */ #ifdef HAVE_SETSID if ((int)setsid() < 0) { syslog(LOG_ERR, "setsid() failed, %s", strerror(errno)); goto failed; } #else #ifdef SETPGRP_VOID setpgrp(); #else /* not SETPGRP_VOID */ if (setpgrp(0, getpid()) < 0) { syslog(LOG_ERR, "setpgrp() failed, %s", strerror(errno)); goto failed; } #endif /* not SETPGRP_VOID */ #ifdef TIOCNOTTY fd = open("/dev/tty" , O_RDWR); if (0 <= fd) { if (ioctl(fd, TIOCNOTTY, NULL) < 0) { syslog(LOG_ERR, "ioctl(TIOCNOTTY) failed", strerror(errno)); goto failed; } if (close(fd) < 0) { syslog(LOG_ERR, "failed to close the file, %s: /dev/tty", strerror(errno)); fd = -1; goto failed; } } #endif /* TIOCNOTTY */ #endif /* HAVE_SETSID */ /* * Change the current directory to root (`/'). */ if (chdir("/") < 0) { syslog(LOG_ERR, "failed to change directory to root, %s", strerror(errno)); goto failed; } syslog(LOG_DEBUG, "debug: run as daemon"); return 0; /* * An error occurs... */ failed: #ifndef HAVE_SETSID if (0 <= fd && close(fd) < 0) { syslog(LOG_ERR, "failed to close the file, %s: /dev/tty", strerror(errno)); } #endif syslog(LOG_ERR, "failed to run as daemon"); return -1; } ebnetd-1.0.dfsg.1/lib/fakelog.c0000644000175000017500000001567207673055371015564 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h, syslog.h) * AC_CHECK_FUNCS(vsyslog, strerror, syslog) * AC_FUNC_VPRINTF */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifdef HAVE_SYSLOG_H #include #endif #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #if (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && defined(HAVE_VSYSLOG) #ifdef __STDC__ #include #else /* not __STDC__ */ #include #endif /* not __STDC__ */ #endif /* (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && ... */ #ifndef HAVE_STRERROR #ifdef __STDC__ char *strerror(int); #else /* not __STDC__ */ char *strerror(); #endif /* not __STDC__ */ #endif /* HAVE_STRERROR */ #include "fakelog.h" #undef syslog /* * Internal log priorities. */ #define FAKELOG_QUIET 0 #define FAKELOG_EMERG 1 #define FAKELOG_ALERT 2 #define FAKELOG_CRIT 3 #define FAKELOG_ERR 4 #define FAKELOG_WARNING 5 #define FAKELOG_NOTICE 6 #define FAKELOG_INFO 7 #define FAKELOG_DEBUG 8 #define FAKELOG_UNKNOWN 9 /* * Log name, mode and level. */ static char *log_name = NULL; static char log_name_buffer[FAKELOG_MAX_LOG_NAME_LENGTH + 1]; static int log_mode = FAKELOG_TO_SYSLOG; static int log_level = FAKELOG_ERR; /* * Set log name. */ void set_fakelog_name(name) const char *name; { if (name == NULL) log_name = NULL; else { strncpy(log_name_buffer, name, FAKELOG_MAX_LOG_NAME_LENGTH); log_name_buffer[FAKELOG_MAX_LOG_NAME_LENGTH] = '\0'; log_name = log_name_buffer; } } /* * Set log level. */ void set_fakelog_mode(mode) int mode; { log_mode = mode; } /* * Set log level. */ void set_fakelog_level(level) int level; { /* * Convert a syslog priority to a fakelog priority. */ switch (level) { #ifdef LOG_EMERG case LOG_EMERG: log_level = FAKELOG_EMERG; break; #endif #ifdef LOG_ALERT case LOG_ALERT: log_level = FAKELOG_ALERT; break; #endif #ifdef LOG_CRIT case LOG_CRIT: log_level = FAKELOG_CRIT; break; #endif #ifdef LOG_ERR case LOG_ERR: log_level = FAKELOG_ERR; break; #endif #ifdef LOG_WARNING case LOG_WARNING: log_level = FAKELOG_WARNING; break; #endif #ifdef LOG_NOTICE case LOG_NOTICE: log_level = FAKELOG_NOTICE; break; #endif #ifdef LOG_INFO case LOG_INFO: log_level = FAKELOG_INFO; break; #endif #ifdef LOG_DEBUG case LOG_DEBUG: log_level = FAKELOG_DEBUG; break; #endif } } /* * The function fakes syslog(), and output a message to standard * error, instead of syslog. * * To use the function, you can fake your sources by the following * trick: * * #define syslog fakelog * * Note that this function doesn't support `%m' that syslog() expands * into the current error message. */ #define BUFFER_SIZE 1024 #if (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && defined(HAVE_VSYSLOG) #ifdef __STDC__ void fakelog(int priority, const char *message, ...) #else /* not __STDC__ */ void fakelog(priority, message, va_alist) int priority; char *message; va_dcl #endif /* not __STDC__ */ #else /* not (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && ... */ void fakelog(priority, message, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) int priority; char *message; char *a0, *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9; #endif /* not (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && ... */ { #if (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && defined(HAVE_VSYSLOG) va_list ap; #endif int log_flag; /* * Convert `priority'. */ switch (priority) { #ifdef LOG_EMERG case LOG_EMERG: log_flag = (FAKELOG_EMERG <= log_level); break; #endif #ifdef LOG_ALERT case LOG_ALERT: log_flag = (FAKELOG_ALERT <= log_level); break; #endif #ifdef LOG_CRIT case LOG_CRIT: log_flag = (FAKELOG_CRIT <= log_level); break; #endif #ifdef LOG_ERR case LOG_ERR: log_flag = (FAKELOG_ERR <= log_level); break; #endif #ifdef LOG_WARNING case LOG_WARNING: log_flag = (FAKELOG_WARNING <= log_level); break; #endif #ifdef LOG_NOTICE case LOG_NOTICE: log_flag = (FAKELOG_NOTICE <= log_level); break; #endif #ifdef LOG_INFO case LOG_INFO: log_flag = (FAKELOG_INFO <= log_level); break; #endif #ifdef LOG_DEBUG case LOG_DEBUG: log_flag = (FAKELOG_DEBUG <= log_level); break; #endif default: log_flag = 0; } /* * Start to use the variable length arguments. */ #if (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && defined(HAVE_VSYSLOG) #ifdef __STDC__ va_start(ap, message); #else /* not __STDC__ */ va_start(ap); #endif /* not __STDC__ */ #endif /* (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && ... */ /* * Output the message to syslog. */ if (log_mode == FAKELOG_TO_SYSLOG || log_mode == FAKELOG_TO_BOTH) { #if (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && defined(HAVE_VSYSLOG) vsyslog(priority, message, ap); #else /* not (defined(HAVE_VPRINTF) || ... */ #ifdef HAVE_SYSLOG syslog(priority, message, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); #endif /* HAVE_SYSLOG */ #endif /* not (defined(HAVE_VPRINTF) || ... */ } /* * Output the message to standard error. */ if ((log_mode == FAKELOG_TO_STDERR || log_mode == FAKELOG_TO_BOTH) && log_flag) { if (log_name != NULL) fprintf(stderr, "%s: ", log_name); #if (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && defined(HAVE_VSYSLOG) #ifdef HAVE_VPRINTF vfprintf(stderr, message, ap); #else /* not HAVE_VPRINTF */ #ifdef HAVE_DOPRNT _doprnt(message, &ap, stderr); #endif /* not HAVE_DOPRNT */ #endif /* not HAVE_VPRINTF */ #else /* not (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && ... */ fprintf(stderr, message, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); #endif /* not (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && ... */ fputc('\n', stderr); fflush(stderr); } /* * End to use the variable length arguments. */ #if (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && defined(HAVE_VSYSLOG) va_end(ap); #endif /* not (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && ... */ } ebnetd-1.0.dfsg.1/lib/filename.c0000644000175000017500000000565607673055402015730 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h, unistd.h, limits.h) * AC_CHECK_FUNCS(strchr, memcpy, getcwd) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif #ifndef HAVE_GETCWD #define getcwd(d,n) getwd(d) #endif /* * The maximum length of a file name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #ifdef USE_FAKELOG #include "fakelog.h" #endif /* * Canonicalize `path_name'. * Convert a path name to an absolute path. * Return 0 upon success, -1 otherwise. */ int canonicalize_file_name(path_name) char *path_name; { char cwd[PATH_MAX + 1]; char tmp_path_name[PATH_MAX + 1]; size_t path_name_length; if (*path_name != '/') { /* * `path_name' is an relative path. Convert to an absolute * path. */ if (getcwd(cwd, PATH_MAX + 1) == NULL) return -1; if (PATH_MAX < strlen(cwd) + 1 + strlen(path_name)) return -1; sprintf(tmp_path_name, "%s/%s", cwd, path_name); strcpy(path_name, tmp_path_name); } /* * Unless `path_name' is "/", eliminate `/' in the tail of the * path name. */ path_name_length = strlen(path_name); if (1 < path_name_length && *(path_name + path_name_length - 1) == '/') *(path_name + path_name_length - 1) = '\0'; return 0; } ebnetd-1.0.dfsg.1/lib/getopt.c0000644000175000017500000007656510613362125015450 0ustar mhattamhatta/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program 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, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBC # include #endif #include "getopt.h" #include #include #include #include #ifdef __VMS # include #endif #ifdef _LIBC # include #else # include "gettext.h" # define _(msgid) gettext (msgid) #endif #if defined _LIBC && defined USE_IN_LIBIO # include #endif #ifndef attribute_hidden # define attribute_hidden #endif /* Unlike standard Unix `getopt', functions like `getopt_long' let the user intersperse the options with the other arguments. As `getopt_long' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Using `getopt' or setting the environment variable POSIXLY_CORRECT disables permutation. Then the application's behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt_int.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Keep a global copy of all internal members of getopt_data. */ static struct _getopt_data getopt_data; #if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV extern char *getenv (); #endif #ifdef _LIBC /* Stored original parameters. XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ extern int __libc_argc; extern char **__libc_argv; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; # endif # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ if (d->__nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } # else # define SWAP_FLAGS(ch1, ch2) # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange (char **argv, struct _getopt_data *d) { int bottom = d->__first_nonopt; int middle = d->__last_nonopt; int top = d->optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, d->__nonoption_flags_max_len), '\0', top + 1 - d->__nonoption_flags_max_len); d->__nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ d->__first_nonopt += (d->optind - d->__last_nonopt); d->__last_nonopt = d->optind; } /* Initialize the internal data when the first call is made. */ static const char * _getopt_initialize (int argc, char **argv, const char *optstring, int posixly_correct, struct _getopt_data *d) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ d->__first_nonopt = d->__last_nonopt = d->optind; d->__nextchar = NULL; d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { d->__ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { d->__ordering = REQUIRE_ORDER; ++optstring; } else if (d->__posixly_correct) d->__ordering = REQUIRE_ORDER; else d->__ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS if (!d->__posixly_correct && argc == __libc_argc && argv == __libc_argv) { if (d->__nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') d->__nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = d->__nonoption_flags_max_len = strlen (orig_str); if (d->__nonoption_flags_max_len < argc) d->__nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (d->__nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) d->__nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', d->__nonoption_flags_max_len - len); } } d->__nonoption_flags_len = d->__nonoption_flags_max_len; } else d->__nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT environment variable were set. */ int _getopt_internal_r (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct, struct _getopt_data *d) { int print_errors = d->opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; d->optarg = NULL; if (d->optind == 0 || !d->__initialized) { if (d->optind == 0) d->optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring, posixly_correct, d); d->__initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \ || (d->optind < d->__nonoption_flags_len \ && __getopt_nonoption_flags[d->optind] == '1')) #else # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') #endif if (d->__nextchar == NULL || *d->__nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (d->__last_nonopt > d->optind) d->__last_nonopt = d->optind; if (d->__first_nonopt > d->optind) d->__first_nonopt = d->optind; if (d->__ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (d->__first_nonopt != d->__last_nonopt && d->__last_nonopt != d->optind) exchange ((char **) argv, d); else if (d->__last_nonopt != d->optind) d->__first_nonopt = d->optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (d->optind < argc && NONOPTION_P) d->optind++; d->__last_nonopt = d->optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (d->optind != argc && !strcmp (argv[d->optind], "--")) { d->optind++; if (d->__first_nonopt != d->__last_nonopt && d->__last_nonopt != d->optind) exchange ((char **) argv, d); else if (d->__first_nonopt == d->__last_nonopt) d->__first_nonopt = d->optind; d->__last_nonopt = argc; d->optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (d->optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (d->__first_nonopt != d->__last_nonopt) d->optind = d->__first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (d->__ordering == REQUIRE_ORDER) return -1; d->optarg = argv[d->optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ d->__nextchar = (argv[d->optind] + 1 + (longopts != NULL && argv[d->optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[d->optind][1] == '-' || (long_only && (argv[d->optind][2] || !strchr (optstring, argv[d->optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { if ((unsigned int) (nameend - d->__nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), argv[0], argv[d->optind]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[d->optind]); #endif } d->__nextchar += strlen (d->__nextchar); d->optind++; d->optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; d->optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) d->optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[d->optind - 1][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #else fprintf (stderr, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[d->optind - 1][0], pfound->name); #else fprintf (stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[d->optind - 1][0], pfound->name); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->__nextchar += strlen (d->__nextchar); d->optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (d->optind < argc) d->optarg = argv[d->optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]); #endif } d->__nextchar += strlen (d->__nextchar); d->optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[d->optind][1] == '-' || strchr (optstring, *d->__nextchar) == NULL) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[d->optind][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), argv[0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], d->__nextchar); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[d->optind][0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[d->optind][0], d->__nextchar); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->__nextchar = (char *) ""; d->optind++; d->optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *d->__nextchar++; char *temp = strchr (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*d->__nextchar == '\0') ++d->optind; if (temp == NULL || c == ':') { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (d->__posixly_correct) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: illegal option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); #endif } else { #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: invalid option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ d->optind++; } else if (d->optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option requires an argument -- %c\n"), argv[0], c) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } d->optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `d->optind' once; increment it again when taking next ARGV-elt as argument. */ d->optarg = argv[d->optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[d->optind]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[d->optind]); #endif } d->__nextchar += strlen (d->__nextchar); d->optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) d->optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } d->__nextchar += strlen (d->__nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (d->optind < argc) d->optarg = argv[d->optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]); #endif } d->__nextchar += strlen (d->__nextchar); return optstring[0] == ':' ? ':' : '?'; } } d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } d->__nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; d->optind++; } else d->optarg = NULL; d->__nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ d->optind++; } else if (d->optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option requires an argument -- %c\n"), argv[0], c) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } d->optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ d->optarg = argv[d->optind++]; d->__nextchar = NULL; } } return c; } } int _getopt_internal (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct) { int result; getopt_data.optind = optind; getopt_data.opterr = opterr; result = _getopt_internal_r (argc, argv, optstring, longopts, longind, long_only, posixly_correct, &getopt_data); optind = getopt_data.optind; optarg = getopt_data.optarg; optopt = getopt_data.optopt; return result; } /* glibc gets a LSB-compliant getopt. Standalone applications get a POSIX-compliant getopt. */ #if _LIBC enum { POSIXLY_CORRECT = 0 }; #else enum { POSIXLY_CORRECT = 1 }; #endif int getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, POSIXLY_CORRECT); } #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (int argc, char **argv) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ ebnetd-1.0.dfsg.1/lib/hostname.c0000644000175000017500000001574107673055401015761 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * Copyright (c) 2001 * IPv6 support by UMENO Takashi * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T * AX_TYPE_SOCKLEN_T * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h, unistd.h) * AC_CHECK_FUNCS(strchr, memcpy) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_UNISTD_H #include #endif #include "dummyin6.h" #if !defined(HAVE_GETADDRINFO) || !defined(HAVE_GETNAMEINFO) #include "getaddrinfo.h" #endif #include "hostname.h" #ifdef USE_FAKELOG #include "fakelog.h" #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif /* not HAVE_MEMCPY */ /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) #ifndef NI_WITHSCOPEID #define NI_WITHSCOPEID 0 #endif /* * Get remote host name and address of the socket `fd'. * * The host name and address are put into `host_name' and `address'. * If unknown, UNKNOWN_HOST is put into it. * If succeed, 0 is returned. Otherwise -1 is returned. * */ #define FAMILY(addr) \ (((struct sockaddr *)(addr))->sa_family) #define IN6_ADDR(addr) \ (&((struct sockaddr_in6 *)(addr))->sin6_addr) #define IN_ADDR(addr) \ (&((struct sockaddr_in *)(addr))->sin_addr) int identify_remote_host(file, host_name, address_string) int file; char *host_name; char *address_string; { struct addrinfo hints; struct addrinfo *info_list; struct addrinfo *info; struct sockaddr_storage peer_name; socklen_t peer_name_length; int gai_error_code; char *p; /* * Set host name and address to UNKNOWN_HOST. */ strncpy(host_name, UNKNOWN_HOST, MAX_HOST_NAME_LENGTH); *(host_name + MAX_HOST_NAME_LENGTH) = '\0'; strncpy(address_string, UNKNOWN_HOST, MAX_HOST_NAME_LENGTH); *(address_string + MAX_HOST_NAME_LENGTH) = '\0'; /* * Get an IP address of the remote host by getpeername(). */ peer_name_length = sizeof(struct sockaddr_storage); if (getpeername(file, (struct sockaddr *)&peer_name, &peer_name_length) < 0) { syslog(LOG_ERR, "getpeername() failed, %s", strerror(errno)); return -1; } if (FAMILY(&peer_name) != AF_INET6 && FAMILY(&peer_name) != AF_INET) { syslog(LOG_DEBUG, "peer host uses unknown protocol family"); return -1; } gai_error_code = getnameinfo((struct sockaddr *)&peer_name, peer_name_length, address_string, MAX_HOST_NAME_LENGTH + 1, NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID); if (gai_error_code != 0) { syslog(LOG_DEBUG, "getnameinfo() failed, %s", gai_strerror(gai_error_code)); return -1; } /* * Get a host name of the remote host by getnameinfo(). */ gai_error_code = getnameinfo((struct sockaddr *)&peer_name, peer_name_length, host_name, MAX_HOST_NAME_LENGTH + 1, NULL, 0, NI_NAMEREQD); if (gai_error_code != 0) return 0; /* * Verify the host name by reversed lookup. */ memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; gai_error_code = getaddrinfo(host_name, NULL, &hints, &info_list); if (gai_error_code != 0) { syslog(LOG_ERR, "getaddrinfo failed (reversed lookup), %s: %s", gai_strerror(gai_error_code), host_name); return 0; } if (FAMILY(&peer_name) == AF_INET6 && IN6_IS_ADDR_V4MAPPED(IN6_ADDR(&peer_name))) { struct sockaddr_in v4_peer_name; *((unsigned char *)&v4_peer_name.sin_addr.s_addr) = *((unsigned char *)IN6_ADDR(&peer_name)->s6_addr + 12); *((unsigned char *)&v4_peer_name.sin_addr.s_addr + 1) = *((unsigned char *)IN6_ADDR(&peer_name)->s6_addr + 13); *((unsigned char *)&v4_peer_name.sin_addr.s_addr + 2) = *((unsigned char *)IN6_ADDR(&peer_name)->s6_addr + 14); *((unsigned char *)&v4_peer_name.sin_addr.s_addr + 3) = *((unsigned char *)IN6_ADDR(&peer_name)->s6_addr + 15); for (info = info_list; info; info = info->ai_next) { if (info->ai_family == AF_INET6) { if (memcmp(IN6_ADDR(&peer_name), IN6_ADDR(info->ai_addr), sizeof(struct in6_addr)) == 0) { break; } } else if (info->ai_family == AF_INET) { if (memcmp(IN_ADDR(&v4_peer_name), IN_ADDR(info->ai_addr), sizeof(struct in_addr)) == 0) { break; } } } } else if (FAMILY(&peer_name) == AF_INET6) { for (info = info_list; info; info = info->ai_next) { if (info->ai_family == AF_INET6) { if (memcmp(IN6_ADDR(&peer_name), IN6_ADDR(info->ai_addr), sizeof(struct in6_addr)) == 0) { break; } } } } else { /* FAMILY(&peer_name) == AF_INET */ for (info = info_list; info; info = info->ai_next) { if (info->ai_family == AF_INET) { if (memcmp(IN_ADDR(&peer_name), IN_ADDR(info->ai_addr), sizeof(struct in_addr)) == 0) { break; } } } } if (info == NULL) { syslog(LOG_ERR, "reversed lookup mismatch: %s -> %s", address_string, host_name); strncpy(host_name, UNKNOWN_HOST, MAX_HOST_NAME_LENGTH); *(host_name + MAX_HOST_NAME_LENGTH) = '\0'; return 0; } /* * Change the host name to lower cases. */ for (p = host_name; *p != '\0'; p++) { if (isupper(*p)) *p = tolower(*p); } freeaddrinfo(info_list); return 0; } ebnetd-1.0.dfsg.1/lib/inet_pton2.c0000644000175000017500000003305707673055402016225 0ustar mhattamhatta/* * Copyright (c) 2002 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h, stdlib.h) * AC_CHECK_FUNCS(inet_pton strchr memcpy) * * and HAVE_STRUCT_IN6_ADDR check. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #ifdef HAVE_NET_IF_H #include #endif #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifndef VOID #ifdef __STDC__ #define VOID void #else #define VOID char #endif #endif #include "inet_pton2.h" #ifdef USE_FAKELOG #include "fakelog.h" #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif /* not HAVE_MEMCPY */ #ifndef IF_NAMESIZE #ifdef IFNAMSIZ #define IF_NAMESIZE IFNAMSIZ #else #define IF_NAMESIZE 16 #endif #endif #ifdef __STDC__ static int inet_pton2_ipv6(const char *, struct in6_addr *, char *); static int inet_pton2_ipv4(const char *, struct in_addr *, char *); static int inet_prefix_pton_ipv6(const char *, struct in6_addr *, struct in6_addr *, char *); static void ipv6_net_mask_length_to_address(int, struct in6_addr *); static int inet_prefix_pton_ipv4(const char *, struct in_addr *, struct in_addr *, char *); static void ipv4_net_mask_length_to_address(int, struct in_addr *); #else static int inet_pton2_ipv6(); static int inet_pton2_ipv4(); static int inet_prefix_pton_ipv6(); static void ipv6_net_mask_length_to_address(); static int inet_prefix_pton_ipv4(); static void ipv4_net_mask_length_to_address(); #endif /* * inet_pton() with scope name extension. * * inet_pton2() has the extra argument `interface'. * If the given address has a scope name, the scope name is put into * `interface' upon return. The maximum length of a scope name * is IF_NAMESIZE. * * Note that only IPv6 address can have a scope name. */ int inet_pton2(family, string, address, interface) int family; const char *string; VOID *address; char *interface; { if (family == AF_INET6) return inet_pton2_ipv6(string, address, interface); else if (family == AF_INET) return inet_pton2_ipv4(string, address, interface); #ifdef EAFNOSUPPORT errno = EAFNOSUPPORT; #else errno = EINVAL; #endif return -1; } /* * Internal function of inet_pton2(). * This function parses IPv6 address (e.g. "ff02::%fxp"). */ int inet_pton2_ipv6(string, address, interface) const char *string; struct in6_addr *address; char *interface; { struct in6_addr address_buffer; char *copied_string = NULL; char *percent; int result; int saved_errno; /* * Copy `string' to `copied_string'. */ copied_string = (char *)malloc(strlen(string) + 1); if (copied_string == NULL) { result = -1; goto failed; } strcpy(copied_string, string); /* * Get scope name. */ percent = strchr(copied_string, '%'); if (percent != NULL) { if (*(percent + 1) == '\0' || IF_NAMESIZE < strlen(percent + 1) + 1) { result = 0; goto failed; } *percent = '\0'; } /* * Parse address. */ result = inet_pton(AF_INET6, copied_string, &address_buffer); if (result != 1) goto failed; /* * Set `address', `net_mask' and `interface'. */ memcpy(address, &address_buffer, sizeof(struct in6_addr)); if (interface != NULL) strcpy(interface, ""); free(copied_string); return 1; /* * An error occurs... */ failed: saved_errno = errno; if (copied_string != NULL) free(copied_string); errno = saved_errno; return result; } /* * Internal function of inet_prefix_pton2(). * This function parses IPv4 address (e.g. "192.16.0"). */ int inet_pton2_ipv4(string, address, interface) const char *string; struct in_addr *address; char *interface; { struct in_addr address_buffer; int result; /* * Parse address. */ result = inet_pton(AF_INET, string, &address_buffer); if (result != 1) return result; /* * Set `address', `net_mask' and `interface'. */ memcpy(address, &address_buffer, sizeof(struct in_addr)); if (interface != NULL) strcpy(interface, ""); return 1; } /* * Converts a presentation format IP-prefix to network format. * IP-prefix is a value with one of the following forms: * * / * * * For example, `ff02::/96' is a valid IPv6-prefix, and `192.168.0/24' * is a vald IPv4-prefix. Also IPv4 and IPv6 addresses are valid * IP-prefixes. * * The meaning of return value is the same as that of inet_pton(). * It returns 1 if the address was valid for the specified address * family, or 0 if the address wasn't parseable in the specified * address family, or -1 if some system error occurred (in which case * `errno' will have been set). */ int inet_prefix_pton(family, string, address, net_mask) int family; const char *string; VOID *address; VOID *net_mask; { if (family == AF_INET6) return inet_prefix_pton_ipv6(string, address, net_mask, NULL); else if (family == AF_INET) return inet_prefix_pton_ipv4(string, address, net_mask, NULL); #ifdef EAFNOSUPPORT errno = EAFNOSUPPORT; #else errno = EINVAL; #endif return -1; } /* * inet_prefix_pton() with scope name extension. * For details about the function, See inet_pton2() and inet_prefix_pton(). */ int inet_prefix_pton2(family, string, address, net_mask, interface) int family; const char *string; VOID *address; VOID *net_mask; char *interface; { if (family == AF_INET6) return inet_prefix_pton_ipv6(string, address, net_mask, interface); else if (family == AF_INET) return inet_prefix_pton_ipv4(string, address, net_mask, interface); #ifdef EAFNOSUPPORT errno = EAFNOSUPPORT; #else errno = EINVAL; #endif return -1; } /* * Internal function of inet_prefix_pton2(). * This function parses IPv6 prefix (e.g. "ff02::%fxp0/96"). */ static int inet_prefix_pton_ipv6(string, address, net_mask, interface) const char *string; struct in6_addr *address; struct in6_addr *net_mask; char *interface; { char *copied_string = NULL; struct in6_addr address_buffer; struct in6_addr net_mask_buffer; unsigned char mask_buffer[16]; char *percent; char *slash; int net_mask_length; int result; int saved_errno; int i; /* * Copy `string' to `copied_string'. */ copied_string = (char *)malloc(strlen(string) + 1); if (copied_string == NULL) { result = -1; goto failed; } strcpy(copied_string, string); /* * Get net mask length. */ slash = strchr(copied_string, '/'); if (slash != NULL) { char *p = slash + 1; if (*p == '0') { p++; } else if ('1' <= *p && *p <= '9') { p++; while ('0' <= *p && *p <= '9') p++; } if (*p != '\0' || p == slash + 1 || slash + 4 < p) { result = 0; goto failed; } *slash = '\0'; net_mask_length = atoi(slash + 1); if (128 < net_mask_length) { result = 0; goto failed; } } else { net_mask_length = 128; } ipv6_net_mask_length_to_address(net_mask_length, &net_mask_buffer); /* * Get scope name. */ percent = strchr(copied_string, '%'); if (percent != NULL) { if (*(percent + 1) == '\0' || IF_NAMESIZE < strlen(percent + 1) + 1) { result = 0; goto failed; } *percent = '\0'; } /* * Parse address. */ result = inet_pton(AF_INET6, copied_string, &address_buffer); if (result != 1) goto failed; /* * Check address/netmask pair. */ for (i = 0; i < 16; i++) { mask_buffer[i] = *((unsigned char *)address_buffer.s6_addr + i) & *((unsigned char *)net_mask_buffer.s6_addr + i); } if (memcmp(mask_buffer, &address_buffer.s6_addr, 16) != 0) { result = 0; goto failed; } /* * Set `address', `net_mask' and `interface'. */ memcpy(address, &address_buffer, sizeof(struct in6_addr)); memcpy(net_mask, &net_mask_buffer, sizeof(struct in6_addr)); if (interface != NULL) { if (percent != NULL) strcpy(interface, percent + 1); else strcpy(interface, ""); } free(copied_string); return 1; /* * An error occurs... */ failed: saved_errno = errno; if (copied_string != NULL) free(copied_string); errno = saved_errno; return result; } /* * Convert IPv6 netmask length to IPv6 address. * For example, 60 is converted to FFFF:FFFF:FFFF:FFF0::. */ static void ipv6_net_mask_length_to_address(length, address) int length; struct in6_addr *address; { static const unsigned char mod8_masks[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe}; unsigned char *address_p = (unsigned char *)address->s6_addr; int rest_length = length; memset(address->s6_addr, 0, 16); while (8 <= rest_length) { *address_p++ = 0xff; rest_length -= 8; } if (0 < rest_length) *address_p = mod8_masks[rest_length]; } /* * Internal function of inet_prefix_pton2(). * This function parses IPv4 prefix (e.g. "192.16.0/24"). */ static int inet_prefix_pton_ipv4(string, address, net_mask, interface) const char *string; struct in_addr *address; struct in_addr *net_mask; char *interface; { char *copied_string = NULL; struct in_addr address_buffer; struct in_addr net_mask_buffer; char *slash; int net_mask_length; int result; int saved_errno; /* * Copy `string' to `copied_string'. */ copied_string = (char *)malloc(strlen(string) + 1); if (copied_string == NULL) { result = -1; goto failed; } strcpy(copied_string, string); /* * Get net mask length. */ slash = strchr(copied_string, '/'); if (slash != NULL) { char *p = slash + 1; if (*p == '0') { p++; } else if ('1' <= *p && *p <= '9') { p++; while ('0' <= *p && *p <= '9') p++; } if (*p != '\0' || p == slash + 1 || slash + 3 < p) { result = 0; goto failed; } *slash = '\0'; net_mask_length = atoi(slash + 1); if (32 < net_mask_length) { result = 0; goto failed; } } else { net_mask_length = 32; } ipv4_net_mask_length_to_address(net_mask_length, &net_mask_buffer); /* * Parse address. */ result = inet_pton(AF_INET, copied_string, &address_buffer); if (result != 1) goto failed; /* * Check address/netmask pair. */ if ((address_buffer.s_addr & net_mask_buffer.s_addr) != address_buffer.s_addr) { result = 0; goto failed; } /* * Set `address', `net_mask' and `interface'. */ memcpy(address, &address_buffer, sizeof(struct in_addr)); memcpy(net_mask, &net_mask_buffer, sizeof(struct in_addr)); if (interface != NULL) strcpy(interface, ""); free(copied_string); return 1; /* * An error occurs... */ failed: saved_errno = errno; if (copied_string != NULL) free(copied_string); errno = saved_errno; return result; } /* * Convert IPv4 netmask length to IPv4 address. * For example, 26 is converted to 255.255.255.192. */ static void ipv4_net_mask_length_to_address(length, address) int length; struct in_addr *address; { static const unsigned char mod8_masks[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe}; unsigned char *address_p = (unsigned char *)&address->s_addr; int rest_length = length; memset(&address->s_addr, 0, 4); while (8 <= rest_length) { *address_p++ = 0xff; rest_length -= 8; } if (0 < rest_length) *address_p = mod8_masks[rest_length]; } /* * Test program. */ #ifdef TEST int main() { char line[512]; char *newline; struct in6_addr ipv6_address, ipv6_net_mask; struct in_addr ipv4_address, ipv4_net_mask; char interface[32]; while (fgets(line, sizeof(line), stdin) != NULL) { newline = strchr(line, '\n'); if (newline != NULL) *newline = '\0'; if (inet_prefix_pton2(AF_INET6, line, &ipv6_address, &ipv6_net_mask, interface) == 1) { printf(">> IPv6 prefix\n"); } if (inet_prefix_pton2(AF_INET, line, &ipv4_address, &ipv4_net_mask, interface) == 1) { printf(">> IPv4 prefix\n"); } if (inet_pton2(AF_INET6, line, &ipv6_address, interface) == 1) { printf(">> IPv6 address\n"); } if (inet_pton2(AF_INET, line, &ipv4_address, interface) == 1) { printf(">> IPv4 address\n"); } } return 0; } #endif /* TEST */ ebnetd-1.0.dfsg.1/lib/ioall.c0000644000175000017500000001066307673055365015252 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01, 02 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T * AC_CHECK_TYPE(ssize_t, int) * AC_CHECK_HEADERS(unistd.h, fcntl.h) * AC_HEADER_TIME */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef TIME_WITH_SYS_TIME #include #include #else /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_FCNTL_H #include #else #include #endif #ifndef VOID #ifdef __STDC__ #define VOID void #else #define VOID char #endif #endif #ifdef USE_FAKELOG #include "fakelog.h" #endif /* * Read data from a file. * It repeats to call read() until all data will have been read. * The function returns 1 upon success, 0 upon timeout, -1 upon error. */ int read_all(file, timeout, buffer, length) int file; int timeout; VOID *buffer; size_t length; { char *buffer_p = buffer; ssize_t rest_length = length; fd_set fdset; struct timeval timeval; int select_result; ssize_t read_result; while (0 < rest_length) { errno = 0; FD_ZERO(&fdset); FD_SET(file, &fdset); if (timeout == 0) select_result = select(file + 1, &fdset, NULL, NULL, NULL); else { timeval.tv_sec = timeout; timeval.tv_usec = 0; select_result = select(file + 1, &fdset, NULL, NULL, &timeval); } if (select_result < 0) { if (errno == EINTR) continue; syslog(LOG_INFO, "failed to select, %s", strerror(errno)); return -1; } else if (select_result == 0) { syslog(LOG_INFO, "timeout"); return 0; } errno = 0; read_result = read(file, buffer_p, (size_t)rest_length); if (read_result < 0) { if (errno == EINTR) continue; return -1; } else if (read_result == 0) { syslog(LOG_ERR, "read() EOF received"); return length - rest_length; } else { rest_length -= read_result; buffer_p += read_result; } } return 1; } /* * Write data to a file. * It repeats to call write() until all data will have written. * The function returns 1 upon success, 0 upon timeout, -1 upon error. */ int write_all(file, timeout, buffer, length) int file; int timeout; const VOID *buffer; size_t length; { const char *buffer_p = buffer; ssize_t rest_length = length; fd_set fdset; struct timeval timeval; int select_result; ssize_t write_result; while (0 < rest_length) { errno = 0; FD_ZERO(&fdset); FD_SET(file, &fdset); if (timeout == 0) select_result = select(file + 1, NULL, &fdset, NULL, NULL); else { timeval.tv_sec = timeout; timeval.tv_usec = 0; select_result = select(file + 1, NULL, &fdset, NULL, &timeval); } if (select_result < 0) { if (errno == EINTR) continue; syslog(LOG_INFO, "failed to select, %s", strerror(errno)); return -1; } else if (select_result == 0) { return 0; } errno = 0; write_result = write(file, buffer_p, (size_t)rest_length); if (write_result < 0) { if (errno == EINTR) continue; return -1; } else { rest_length -= write_result; buffer_p += write_result; } } return 1; } /* * Write a string to a file. * The function returns 1 upon success, 0 upon timeout, -1 upon error. */ int write_string_all(file, timeout, string) int file; int timeout; const char *string; { return write_all(file, timeout, string, strlen(string)); } ebnetd-1.0.dfsg.1/lib/linebuf.c0000644000175000017500000002541607673055376015602 0ustar mhattamhatta/* * copyright (c) 1997, 98, 99, 2000, 02 Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T * AC_CHECK_TYPE(ssize_t, int) * AC_HEADER_STDC * AC_HEADER_TIME * AC_CHECK_HEADERS(string.h, memory.h, stdlib.h, unistd.h) * AC_CHECK_FUNCS(memcpy) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef TIME_WITH_SYS_TIME #include #include #else /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include "linebuf.h" #ifdef USE_FAKELOG #include "fakelog.h" #endif #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif /* not HAVE_MEMCPY */ /* * Initialize `linebuffer'. */ void initialize_line_buffer(line_buffer) Line_Buffer *line_buffer; { line_buffer->buffer[0] = '\0'; line_buffer->file = -1; line_buffer->cache_length = 0; line_buffer->timeout = 0; } /* * Finalize `line_buffer'. */ void finalize_line_buffer(line_buffer) Line_Buffer *line_buffer; { line_buffer->buffer[0] = '\0'; line_buffer->file = -1; line_buffer->cache_length = 0; line_buffer->timeout = 0; } /* * Set timeout seconds. */ void set_line_buffer_timeout(line_buffer, timeout) Line_Buffer *line_buffer; int timeout; { line_buffer->timeout = timeout; } /* * Bind `file' to `line_buffer'. */ void bind_file_to_line_buffer(line_buffer, file) Line_Buffer *line_buffer; int file; { if (line_buffer->file < 0) initialize_line_buffer(line_buffer); line_buffer->file = file; } /* * Return file descriptor bound to `line_buffer'. * Return -1 when no file is bound. */ int file_bound_to_line_buffer(line_buffer) Line_Buffer *line_buffer; { return line_buffer->file; } /* * Discard cache data in `line_buffer'. */ void discard_cache_in_line_buffer(line_buffer) Line_Buffer *line_buffer; { line_buffer->cache_length = 0; } /* * Get the length of cache data in `line_buffer'. */ size_t cache_length_in_line_buffer(line_buffer) Line_Buffer *line_buffer; { return line_buffer->cache_length; } /* * Read a line from the file bound to `line_buffer', and copy the read * line to `line'. It reads at most `max_line_length' bytes. * * The function recognizes both "\n" and "\r\n" as end of line. * "\n" or "\r\n" is not copied to `buffer', but "\0" is added, instead. * * The function returns the number of characters in the line, upon * successful. It doesn't count "\n" or "\r\n" in the tail of the line, * so that 0 is returned for an empty line, and the line length doesn't * exceed one less than `max_line_length'. * * If EOF is received or an error occurs, -1 is returned. If the * line is too long, `max_line_length' is returned. */ ssize_t read_line_buffer(line_buffer, line, max_line_length) Line_Buffer *line_buffer; char *line; size_t max_line_length; { char *line_p; char *newline; size_t search_length; size_t additional_length; size_t line_length; fd_set fdset; struct timeval timeval; int select_result; ssize_t read_result; /* * Return -1 if no file is bound, or if `max_line_length' is 0. */ if (line_buffer->file < 0) return -1; if (max_line_length == 0) return -1; /* * Read a file until newline is appeared. */ line_length = 0; line_p = line; for (;;) { if (0 < line_buffer->cache_length) { /* * Find a newline in the cache data. */ if (max_line_length - line_length < line_buffer->cache_length) search_length = max_line_length - line_length; else search_length = line_buffer->cache_length; newline = (char *)memchr(line_buffer->buffer, '\n', search_length); /* * Append cache data in front of the newline to `line'. */ if (newline != NULL) additional_length = newline - line_buffer->buffer + 1; else additional_length = search_length; memcpy(line_p, line_buffer->buffer, additional_length); line_p += additional_length; line_length += additional_length; line_buffer->cache_length -= additional_length; /* * If cache data not copied to `line' are remained in the * buffer, we move them to the beginning of the buffer. */ memmove(line_buffer->buffer, line_buffer->buffer + additional_length, line_buffer->cache_length); if (newline != NULL) break; } /* * Check for the length of the current line. Return if the * line is too long. * * Note that the following conditional expression can be * substituted to (line_buffer->cache_length != 0), because * remained cache data mean that the line is too long. */ if (max_line_length <= line_length) return line_length; /* * Call select(). */ errno = 0; FD_ZERO(&fdset); FD_SET(line_buffer->file, &fdset); if (line_buffer->timeout == 0) { select_result = select(line_buffer->file + 1, &fdset, NULL, NULL, NULL); } else { timeval.tv_sec = line_buffer->timeout; timeval.tv_usec = 0; select_result = select(line_buffer->file + 1, &fdset, NULL, NULL, &timeval); } if (select_result < 0) { if (errno == EINTR) continue; syslog(LOG_INFO, "failed to select, %s", strerror(errno)); return -1; } else if (select_result == 0) { syslog(LOG_INFO, "timeout"); return -1; } /* * Read from a file. (No cache data are remaind.) */ errno = 0; read_result = read(line_buffer->file, line_buffer->buffer, LINEBUF_BUFFER_SIZE); if (read_result < 0) { if (errno == EINTR) continue; syslog(LOG_INFO, "read() failed, %s", strerror(errno)); return -1; } else if (read_result == 0) { if (line_length == 0) { syslog(LOG_INFO, "read() received EOF"); return -1; } return line_length; } line_buffer->cache_length += read_result; } /* * Overwrite `\n' with `\0'. */ line_p--; *line_p = '\0'; line_length--; /* * If the line is end with `\r\n', remove not only `\n' but `\r'. */ if (0 < line_length && *(line_p - 1) == '\r') { line_p--; *line_p = '\0'; line_length--; } return line_length; } /* * Read just `stream_length' bytes from the file bound to `line_buffer', * and copy the read bytes to `stream'. * * Unlike read_line_buffer(), it doesn't append `\0' to the read data, * nor remove newline character in the read data. * * If it succeeds, the number of bytes actually read is returned. * If EOF is received or an error occurs, -1 is returned. */ ssize_t binary_read_line_buffer(line_buffer, stream, stream_length) Line_Buffer *line_buffer; char *stream; size_t stream_length; { char *stream_p; size_t done_length; fd_set fdset; struct timeval timeval; int select_result; ssize_t read_result; /* * Return -1 if no file is bound. */ if (line_buffer->file < 0) return -1; /* * Return 0 if `stream_length' is 0. */ if (stream_length == 0) return 0; /* * Test whether cache data are left in `line_buffer->buffer'. * If they are, copy them to `stream'. */ stream_p = stream; done_length = 0; if (0 < line_buffer->cache_length) { if (stream_length <= line_buffer->cache_length) done_length = stream_length; else done_length = line_buffer->cache_length; memcpy(stream_p, line_buffer->buffer, done_length); stream_p += done_length; line_buffer->cache_length -= done_length; memmove(line_buffer->buffer, line_buffer->buffer + done_length, line_buffer->cache_length); } /* * Read the file until the number of read bytes (`done_length') is * reached to `stream_length'. */ while (done_length < stream_length) { /* * Call select(). */ errno = 0; FD_ZERO(&fdset); FD_SET(line_buffer->file, &fdset); if (line_buffer->timeout == 0) { select_result = select(line_buffer->file + 1, NULL, &fdset, NULL, NULL); } else { timeval.tv_sec = line_buffer->timeout; timeval.tv_usec = 0; select_result = select(line_buffer->file + 1, NULL, &fdset, NULL, &timeval); } if (select_result < 0) { if (errno == EINTR) continue; syslog(LOG_INFO, "failed to select, %s", strerror(errno)); return -1; } else if (select_result == 0) { syslog(LOG_INFO, "timeout"); return -1; } /* * Read from a file. */ errno = 0; read_result = read(line_buffer->file, stream_p, stream_length - done_length); if (read_result < 0) { if (errno == EINTR) continue; syslog(LOG_ERR, "read() failed, %s", strerror(errno)); return read_result; } else if (read_result == 0) { if (done_length == 0) { syslog(LOG_ERR, "read() EOF received"); return -1; } return done_length; } stream_p += read_result; done_length += read_result; } return stream_length; } /* * Skip too long line read by read_line_buffer(). * * If a line read by read_line_buffer() doesn't contain a newline * character, the line is too long. This function reads and discards * the rest of the line. * * If EOF is received or an error occurs, -1 is returned. * Otherwise, 0 is returned. */ int skip_line_buffer(line_buffer) Line_Buffer *line_buffer; { ssize_t line_length; /* * Read data until the end of the line is found. */ for (;;) { line_length = read_line_buffer(line_buffer, line_buffer->buffer, LINEBUF_BUFFER_SIZE); if (line_length < 0) return -1; if (line_length < LINEBUF_BUFFER_SIZE) break; } return 0; } ebnetd-1.0.dfsg.1/lib/logpid.c0000644000175000017500000001375207673055374015432 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_PID_T * AC_HEADER_STDC * AC_CHECK_HEADERS(unistd.h, stdlib.h) * AC_CHECK_FUNCS(strtol) * AC_HEADER_STAT */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifndef HAVE_STRTOL #ifdef __STDC__ long strtol(const char *, char **, int); #else /* not __STDC__ */ long strtol(); #endif /* not __STDC__ */ #endif /* not HAVE_STRTOL */ #ifdef USE_FAKELOG #include "fakelog.h" #endif #ifdef STAT_MACROS_BROKEN #ifdef S_ISREG #undef S_ISREG #endif #ifdef S_ISDIR #undef S_ISDIR #endif #endif /* STAT_MACROS_BROKEN */ #ifndef S_ISREG #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif #ifndef S_ISDIR #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) /* * Maximum Line length of a pid file. */ #define LOGPID_SIZE_LINE 63 /* * Log the PID of the current process to file specified at `file_name'. * If succeed, 0 is returned. Otherwise -1 is returned. */ int log_pid_file(file_name) const char *file_name; { struct stat status; FILE *file; /* * Does the file already exist? */ if (stat(file_name, &status) == 0 && S_ISREG(status.st_mode)) { syslog(LOG_NOTICE, "warning: the PID file already exists: %s", file_name); } /* * Open the file. */ file = fopen(file_name, "w"); if (file == NULL) { syslog(LOG_ERR, "failed to open the file, %s: %s", strerror(errno), file_name); goto failed; } /* * Write a PID of the process. */ fprintf(file, "%d\n", (int)getpid()); if (ferror(file)) { syslog(LOG_ERR, "failed to write to the file, %s: %s", strerror(errno), file_name); goto failed; } /* * Close the file. */ if (fclose(file) == EOF) { syslog(LOG_ERR, "failed to close the file, %s: %s", strerror(errno), file_name); file = NULL; goto failed; } syslog(LOG_DEBUG, "debug: write a PID to the file: %s", file_name); return 0; /* * An error occurs... */ failed: if (file != NULL && fclose(file) == EOF) { syslog(LOG_ERR, "failed to close the file, %s: %s", strerror(errno), file_name); } syslog(LOG_ERR, "failed to write a PID to the file: %s", file_name); return -1; } /* * Remove a PID file. * If succeed, 0 is returned. Otherwise -1 is returned. */ int remove_pid_file(file_name) const char *file_name; { if (unlink(file_name) == 0) { syslog(LOG_DEBUG, "debug: remove the PID file: %s", file_name); return 0; } else if (errno == ENOENT) { syslog(LOG_NOTICE, "warning: the PID file not exist: %s", file_name); return 0; } syslog(LOG_ERR, "unlink failed(), %s: %s", strerror(errno), file_name); syslog(LOG_ERR, "failed to remove the PID file: %s", file_name); return -1; } /* * Check for existance of a pid file. * If exists, 0 is returned. Otherwise -1 is returned. */ int probe_pid_file(file_name) const char *file_name; { struct stat status; /* * Does the file already exist? */ if (stat(file_name, &status) == 0 || S_ISREG(status.st_mode)) return 0; return -1; } /* * Read a PID from a pid file. * If succeed, 0 is returned. Otherwise -1 is returned. */ int read_pid_file(file_name, pid) const char *file_name; pid_t *pid; { FILE *file; char buffer[LOGPID_SIZE_LINE + 1]; char *end_p; /* * Open the file. */ file = fopen(file_name, "r"); if (file == NULL) { syslog(LOG_ERR, "failed to open the file, %s: %s", strerror(errno), file_name); goto failed; } /* * Read a PID string from the file. */ if (fgets(buffer, LOGPID_SIZE_LINE + 1, file) == NULL) { syslog(LOG_ERR, "failed to read the file, %s: %s", strerror(errno), file_name); goto failed; } /* * Parse the PID string. */ *pid = strtol(buffer, &end_p, 10); if (!isdigit(buffer[0]) || (*end_p != '\0' && *end_p != '\n')) { syslog(LOG_ERR, "invalid PID: %s", file_name); goto failed; } /* * Close the file. */ if (fclose(file) == EOF) { syslog(LOG_ERR, "failed to close the file, %s: %s", strerror(errno), file_name); file = NULL; goto failed; } return 0; /* * An error occurs... */ failed: if (file != NULL && fclose(file) == EOF) { syslog(LOG_ERR, "failed to close the file, %s: %s", strerror(errno), file_name); } syslog(LOG_ERR, "failed to read a PID from the file: %s", file_name); return -1; } ebnetd-1.0.dfsg.1/lib/makedir.c0000644000175000017500000000706407673055372015565 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_MODE_T * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h, stdlib.h, limits.h) * AC_CHECK_FUNCS(strchr) * AC_HEADER_STAT */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ /* * The maximum length of a filename. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #ifdef STAT_MACROS_BROKEN #ifdef S_ISREG #undef S_ISREG #endif #ifdef S_ISDIR #undef S_ISDIR #endif #endif /* STAT_MACROS_BROKEN */ #ifndef S_ISREG #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif #ifndef S_ISDIR #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif #ifdef USE_FAKELOG #include "fakelog.h" #endif /* * Make a directory if the directory doesn't exist. * * If making the directory is succeeded or the directory has already * created, 0 is returned. Otherwise -1 is returned. */ int make_missing_directory(path, mode) const char *path; mode_t mode; { struct stat status; if (stat(path, &status) < 0) { if (mkdir(path, mode) < 0) { syslog(LOG_ERR, "failed to make the directory, %s: %s", strerror(errno), path); return -1; } syslog(LOG_DEBUG, "debug: make the directory: %s", path); } else if (!S_ISDIR(status.st_mode)) { syslog(LOG_ERR, "already exists, but not a directory: %s", path); return -1; } else { syslog(LOG_DEBUG, "debug: the directory already exists: %s\n", path); } return 0; } /* * Make a directory if the directory doesn't exist. * Intermediate directories are also created if required. * * If making the directory is succeeded or the directory has already * created, 0 is returned. Otherwise -1 is returned. */ int make_missing_directory_chain(path, mode) const char *path; mode_t mode; { char temporary_path[PATH_MAX + 1]; char *p; if (PATH_MAX < strlen(path)) { strncpy(temporary_path, path, PATH_MAX); *(temporary_path + PATH_MAX) = '\0'; syslog(LOG_ERR, "too long path: %s...", temporary_path); return -1; } strcpy(temporary_path, path); for (p = strchr(temporary_path, '/'); p != NULL; p = strchr(p + 1, '/')) { *p = '\0'; if (make_missing_directory(temporary_path, mode) < 0) return -1; *p = '/'; } if (make_missing_directory(temporary_path, mode) < 0) return -1; return 0; } ebnetd-1.0.dfsg.1/lib/mappedaddr.c0000644000175000017500000001035007673055365016244 0ustar mhattamhatta/* * Copyright (c) 2002 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h) * AC_CHECK_FUNCS(inet_pton memcpy) * * and HAVE_STRUCT_IN6_ADDR check. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif /* not HAVE_MEMCPY */ /* * Prefix of IPv4 mapped IPv6 address. */ static const unsigned char mapped_ipv6_address_prefix[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff }; static const unsigned char mapped_ipv6_net_mask_prefix[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; void ipv4_to_mapped_ipv6_address(ipv6_address, ipv4_address) struct in6_addr *ipv6_address; const struct in_addr *ipv4_address; { memcpy(&ipv6_address->s6_addr, mapped_ipv6_address_prefix, 12); memcpy((unsigned char *)ipv6_address->s6_addr + 12, &ipv4_address->s_addr, 4); } int mapped_ipv6_to_ipv4_address(ipv4_address, ipv6_address) struct in_addr *ipv4_address; const struct in6_addr *ipv6_address; { if (memcmp(&ipv6_address->s6_addr, mapped_ipv6_address_prefix, 12) != 0) return -1; memcpy(&ipv4_address->s_addr, (unsigned char *)ipv6_address->s6_addr + 12, 4); return 0; } void ipv4_to_mapped_ipv6_net_mask(ipv6_net_mask, ipv4_net_mask) struct in6_addr *ipv6_net_mask; const struct in_addr *ipv4_net_mask; { memcpy(&ipv6_net_mask->s6_addr, mapped_ipv6_net_mask_prefix, 12); memcpy((unsigned char *)ipv6_net_mask->s6_addr + 12, &ipv4_net_mask->s_addr, 4); } int mapped_ipv6_to_ipv4_net_mask(ipv4_net_mask, ipv6_net_mask) struct in_addr *ipv4_net_mask; const struct in6_addr *ipv6_net_mask; { if (memcmp(&ipv6_net_mask->s6_addr, mapped_ipv6_net_mask_prefix, 12) != 0) return -1; memcpy(&ipv4_net_mask->s_addr, (unsigned char *)ipv6_net_mask->s6_addr + 12, 4); return 0; } /* * Test program. */ #ifdef TEST #include #include #include int main() { char line[512]; char result[512]; char *newline; struct in6_addr ipv6_address; struct in_addr ipv4_address; while (fgets(line, sizeof(line), stdin) != NULL) { newline = strchr(line, '\n'); if (newline != NULL) *newline = '\0'; if (inet_pton(AF_INET6, line, &ipv6_address) == 1) { if (mapped_ipv6_to_ipv4_address(&ipv4_address, &ipv6_address) < 0) { printf(">> IPv6 address, but not IPv4 mapped\n"); continue; } if (inet_ntop(AF_INET, &ipv4_address, result, sizeof(result)) == NULL) { printf(">> internal error?, inet_ntop() failed\n"); continue; } } else if (inet_pton(AF_INET, line, &ipv4_address) == 1) { ipv4_to_mapped_ipv6_address(&ipv6_address, &ipv4_address); if (inet_ntop(AF_INET6, &ipv6_address, result, sizeof(result)) == NULL) { printf(">> internal error?, inet_ntop() failed\n"); continue; } } else { printf(">> not IP address\n"); continue; } printf(">> %s\n", result); } return 0; } #endif /* TEST */ ebnetd-1.0.dfsg.1/lib/openmax.c0000644000175000017500000000422407673055400015603 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_CHECK_HEADERS(unistd.h) * AC_CHECK_FUNCS(getdtablesize, getrlimit, sysconf) * AC_HEADER_TIME */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef HAVE_GETDTABLESIZE #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #else /* not HAVE_GETDTABLESIZE */ #ifdef HAVE_GETRLIMIT #ifdef TIME_WITH_SYS_TIME #include #include #else /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ #include #else /* not HAVE_GETRLIMIT */ #ifdef HAVE_SYSCONF #include #else /* not HAVE_SYSCONF */ #include #ifndef NOFILE #define DEFAULT_OPEN_MAX 128 #endif /* not NOFILE */ #endif /* not HAVE_SYSCONF */ #endif /* not HAVE_GETRLIMIT */ #endif /* not HAVE_GETDTABLESIZE */ /* * Get the maximum number of open files. */ int get_open_max() { int open_max; #ifdef HAVE_GETDTABLESIZE open_max = getdtablesize(); #else /* not HAVE_GETDTABLESIZE */ #ifdef HAVE_GETRLIMIT { struct rlimit limit; getrlimit(RLIMIT_NOFILE, &limit); open_max = limit.rlim_cur; } #else /* not HAVE_GETRLIMIT */ #ifdef HAVE_SYSCONF open_max = sysconf(_SC_OPEN_MAX); #else /* not HAVE_SYSCONF */ #ifdef NOFILE open_max = NOFILE; #else /* not NOFILE */ open_max = DEFAULT_OPEN_MAX; #endif /* not NOFILE */ #endif /* not HAVE_SYSCONF */ #endif /* not HAVE_GETRLIMIT */ #endif /* not HAVE_GETDTABLESIZE */ return open_max; } ebnetd-1.0.dfsg.1/lib/privilege.c0000644000175000017500000000546007673055404016131 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_TYPE_UID_T * AC_TYPE_GID_T * AC_CHECK_HEADERS(unistd.h) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_FAKELOG #include "fakelog.h" #endif /* * Set UID and GID of the current process. * To set a UID, the current UID of the process must be root. * * If succeeded, 0 is returned. Otherwise -1 is returned. */ int set_privilege(new_uid, new_gid) uid_t new_uid; gid_t new_gid; { struct passwd *password_entry; uid_t current_uid; gid_t current_gid; int gid_ok = 0; /* * Set a GID. */ current_gid = getgid(); if (new_gid != current_gid) { password_entry = getpwuid(new_uid); if (password_entry == NULL) { syslog(LOG_ERR, "getpwuid() failed, %s: uid=%d", strerror(errno), (int)new_uid); goto failed; } if (initgroups(password_entry->pw_name, new_gid) < 0) { syslog(LOG_ERR, "initgroups() failed, %s: gid=%d", strerror(errno), (int)new_gid); goto failed; } if (setgid(new_gid) < 0) { syslog(LOG_ERR, "setgid() fialed, %s: gid=%d", strerror(errno), (int)new_gid); goto failed; } } gid_ok = 1; /* * Set an UID only when the UID of the current process is root. */ current_uid = getuid(); if (current_uid != new_uid) { if (current_uid != 0) goto failed; if (setuid(new_uid) < 0) { syslog(LOG_ERR, "setuid() fialed, %s: uid=%d", strerror(errno), (int)new_uid); goto failed; } } syslog(LOG_DEBUG, "debug: set privilege: uid=%d, gid=%d", new_uid, new_gid); return 0; /* * An error occurs... */ failed: if (gid_ok) syslog(LOG_ERR, "failed to set owner of the process"); else syslog(LOG_ERR, "failed to set owner and group of the process"); return -1; } ebnetd-1.0.dfsg.1/lib/permission.c0000644000175000017500000002163007673055405016331 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h, stdlib.h) * AC_CHECK_FUNCS(inet_pton memcpy strchr) * * and HAVE_STRUCT_IN6_ADDR check. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #include #include #include #include #ifdef HAVE_STDLIB_H #include #endif #include "dummyin6.h" #include "mappedaddr.h" #include "inet_pton2.h" #include "permission.h" #ifdef USE_FAKELOG #include "fakelog.h" #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif /* not HAVE_MEMCPY */ #ifndef HAVE_INET_PTON #ifdef __STDC__ int inet_pton(int, const char *, void *); #else int inet_pton(); #endif #endif #ifdef __STDC__ static const char *strnopbrk(const char *, const char *); #else static const char *strnopbrk(); #endif /* * Initialize `permission'. */ void initialize_permission(permission) Permission *permission; { permission->next = NULL; } /* * Free all nodes in `permission'. */ void finalize_permission(permission) Permission *permission; { Permission *permission_p; Permission *next; permission_p = permission->next; while (permission_p != NULL) { next = permission_p->next; if (permission_p->host_name != NULL) free(permission_p->host_name); free(permission_p); permission_p = next; } permission->next = NULL; } /* * Add `pattern' to the list `permission'. * * If `permission' is a valid IPv4/IPv6 prefix or address, it is recognized * as it is. Otherwise `pattern' is recognized as a host name. * * The function returns 0 upon successful, -1 otherwise. */ int add_permission(permission, pattern) Permission *permission; const char *pattern; { Permission *permission_p = NULL; const char *pattern_p = pattern; struct in_addr ipv4_address, ipv4_net_mask; /* * Allocate memories for a new node and a host name. */ permission_p = (Permission *)malloc(sizeof(Permission)); if (permission_p == NULL) { syslog(LOG_ERR, "memory exhausted"); goto failed; } permission_p->not = 0; permission_p->host_name = NULL; memcpy(&permission_p->address, &in6addr_any, sizeof(struct in6_addr)); memcpy(&permission_p->net_mask, &in6addr_any, sizeof(struct in6_addr)); permission_p->scope_name[0] = '\0'; permission_p->next = NULL; /* * Set flag. */ if (*pattern_p == '!') { permission_p->not = 1; pattern_p++; } /* * Parse the given pattern. */ if (strchr(pattern_p, ':') != NULL) { /* * The pattern seems to be an IPv6 address. */ if (inet_prefix_pton2(AF_INET6, pattern_p, &permission_p->address, &permission_p->net_mask, permission_p->scope_name) != 1) { syslog(LOG_ERR, "invalid IPv6 prefix: %s", pattern_p); goto failed; } } else if (strnopbrk(pattern_p, "0123456789./") == NULL) { /* * The pattern seems to be an IPv4 address. */ if (inet_prefix_pton(AF_INET, pattern_p, &ipv4_address, &ipv4_net_mask) != 1) { syslog(LOG_ERR, "invalid IPv4 prefix: %s", pattern_p); goto failed; } ipv4_to_mapped_ipv6_address(&permission_p->address, &ipv4_address); ipv4_to_mapped_ipv6_net_mask(&permission_p->net_mask, &ipv4_net_mask); } else { /* * The pattern seems to be a host name. */ permission_p->host_name = (char *)malloc(strlen(pattern_p) + 1); if (permission_p->host_name == NULL) { syslog(LOG_ERR, "memory exhausted"); goto failed; } strcpy(permission_p->host_name, pattern_p); } /* * Insert the new node into the permission list. */ permission_p->next = permission->next; permission->next = permission_p; return 0; /* * If an error occurs... */ failed: if (permission_p != NULL) { if (permission_p->host_name == NULL) free(permission_p->host_name); free(permission_p); } return -1; } /* * strnopbrk() is similar to strpbrk(), but it locates the string `s' * the first occurrence of any character *NOT* listed in `charset'. */ static const char * strnopbrk(string, charset) const char *string; const char *charset; { unsigned char table[256]; /* assumes CHAR_BITS is 8 */ const unsigned char *string_p = (const unsigned char *)string; const unsigned char *charset_p = (const unsigned char *)charset; memset(table, 0, sizeof(table)); while (*charset_p != '\0') table[*charset_p++] = 1; while (*string_p != '\0') { if (!table[*string_p]) return (const char *)string_p; string_p++; } return NULL; } /* * Examine access permission to `host_name' and `address'. * If access is permitted, 1 is returned. Otherwise 0 is returned. */ int test_permission(permission, host_name, address_string, function) const Permission *permission; const char *host_name; const char *address_string; #ifdef __STDC__ int (*function)(const char *, const char *); #else int (*function)(); #endif { const Permission *permission_p; int result = 0; struct in6_addr ipv6_address; struct in_addr ipv4_address; char scope_name[IF_NAMESIZE]; unsigned char mask_buffer[16]; int i; if (inet_pton2(AF_INET6, address_string, &ipv6_address, scope_name) == 1) { /* nothing to do */ } else if (inet_pton(AF_INET, address_string, &ipv4_address) == 1) { ipv4_to_mapped_ipv6_address(&ipv6_address, &ipv4_address); scope_name[0] = '\0'; } /* * Test. */ for (permission_p = permission->next; permission_p != NULL; permission_p = permission_p->next) { if (permission_p->host_name != NULL) { if (function(permission_p->host_name, host_name)) result = permission_p->not ? 0 : 1; } else { for (i = 0; i < 16; i++) { mask_buffer[i] = *((unsigned char *)ipv6_address.s6_addr + i) & *((unsigned char *)permission_p->net_mask.s6_addr + i); } if (memcmp(mask_buffer, permission_p->address.s6_addr, 16) == 0) { if (permission_p->scope_name[0] == '\0' || strcmp(permission_p->scope_name, scope_name) == 0) { result = permission_p->not ? 0 : 1; } } } } return result; } /* * Count the entires of the permission list, and return it. */ int count_permission(permission) const Permission *permission; { const Permission *permission_p; int count = 0; for (permission_p = permission->next; permission_p != NULL; permission_p = permission_p->next) count++; return count; } /* * Test program. */ #ifdef TEST int streq(s1, s2) const char *s1; const char *s2; { return (strcmp(s1, s2) == 0); } int main(argc, argv) int argc; char *argv[]; { Permission permission; FILE *file; char buffer[512]; char *newline; if (argc != 2) { fprintf(stderr, "Usage: %s access-list-file\n", argv[0]); return 1; } initialize_permission(&permission); set_fakelog_mode(FAKELOG_TO_STDERR); file = fopen(argv[1], "r"); if (file == NULL) { fprintf(stderr, "%s: failed to open the file: %s\n", argv[0], argv[1]); return 1; } while (fgets(buffer, sizeof(buffer), file) != NULL) { newline = strchr(buffer, '\n'); if (newline != NULL) *newline = '\0'; if (add_permission(&permission, buffer) < 0) { fprintf(stderr, "%s: failed to add permission to the list: %s\n", argv[0], buffer); fclose(file); return 1; } } fclose(file); while (fgets(buffer, sizeof(buffer), stdin) != NULL) { newline = strchr(buffer, '\n'); if (newline != NULL) *newline = '\0'; if (test_permission(&permission, "?", buffer, streq)) printf("allowed\n"); else printf("denied\n"); } return 0; } #endif /* TEST */ ebnetd-1.0.dfsg.1/lib/readconf.c0000644000175000017500000002656607673055374015744 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h, unistd.h) * AC_CHECK_FUNCS(strchr) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #include "readconf.h" #ifdef __STDC__ static Configuration *find_directive(Configuration *, const char *, const char *); static void reset_configuration(Configuration *, const char *); static Configuration *check_configuration(Configuration *, const char *); #else /* not __STDC__ */ static Configuration *find_directive(); static void reset_configuration(); static Configuration *check_configuration(); #endif /* not __STDC__ */ #ifdef USE_FAKELOG #include "fakelog.h" #endif #define READCONF_IS_REDEFINABLE(t) \ ((t) == READCONF_ZERO_OR_MORE || (t) == READCONF_ONCE_OR_MORE) #define READCONF_IS_REQUIRED(t) \ ((t) == READCONF_ONCE || (t) == READCONF_ONCE_OR_MORE) /* * Read configurations from the file `file_name'. * `table' is a table which lists all recognized directives. * If no error occurrs, 0 is returned. Otherwise -1 is returned. */ int read_configuration(file_name, configuration_table) const char *file_name; Configuration *configuration_table; { Configuration *directive; Configuration *lack_directive; FILE *file; char line_buffer[READCONF_SIZE_LINE + 1]; char block[READCONF_SIZE_BLOCK_NAME + 1]; char *space; char *name; char *argument; int line_number = 0; char *p; /* * Reset counters in the directive table. */ block[0] = '\0'; reset_configuration(configuration_table, block); /* * Call a pre-process hook. */ directive = find_directive(configuration_table, block, "begin"); if (directive != NULL && directive->function(NULL, file_name, line_number) < 0) return -1; /* * Open the configuration file. */ file = fopen(file_name, "r"); if (file == NULL) { syslog(LOG_ERR, "%s: failed to open the file, %s", file_name, strerror(errno)); goto failed; } syslog(LOG_DEBUG, "%s: debug: open the file", file_name); /* * Read each line in the configuration file. */ while (fgets(line_buffer, READCONF_SIZE_LINE + 1, file) != NULL) { line_number++; /* * Check for the line length. * An error occurs if it exceeds a limit. */ p = strchr(line_buffer, '\n'); if (p != NULL) *p = '\0'; else if (strlen(line_buffer) == READCONF_SIZE_LINE) { *(line_buffer + READCONF_SIZE_LINE) = '\0'; syslog(LOG_ERR, "%s:%d: too long line: %s...", file_name, line_number, line_buffer); goto failed; } /* * Get a directive name. */ for (name = line_buffer; *name == ' ' || *name == '\t'; name++) ; /* * Ignore this line if the line is empty or starts with '#'. */ if (*name == '#') { syslog(LOG_DEBUG, "%s:%d: debug: comment line", file_name, line_number); continue; } if (*name == '\0') { syslog(LOG_DEBUG, "%s:%d: debug: empty line", file_name, line_number); continue; } /* * Get an argument to the directive name. */ for (p = name; *p != ' ' && *p != '\t' && *p != '\0'; p++) ; if (*p != '\0') { *p++ = '\0'; while (*p == ' ' || *p == '\t') p++; } if (*p == '\0') argument = NULL; else argument = p; /* * Delete spaces and tabls in the tail of the line. */ if (argument != NULL) { for (p = argument, space = NULL; *p != '\0'; p++) { if (*p == ' ' || *p == '\t') { if (space == NULL) space = p; } else space = NULL; } if (space != NULL) *space = '\0'; } /* * Check for the directive name. */ if (strcmp(name, "begin") == 0) { char argument_begin[(READCONF_SIZE_BLOCK_NAME * 2) + 1]; /* * `begin' keyword. Beginning of the block. * Check for the argument. */ if (argument == NULL) { syslog(LOG_ERR, "%s:%d: missing argument: begin", file_name, line_number); goto failed; } if (READCONF_SIZE_BLOCK_NAME < strlen(block) + 1 + strlen(argument)) { syslog(LOG_ERR, "%s:%d: unkonwn directive name: begin %s", file_name, line_number, argument); goto failed; } /* * Find a directive entry in the table. */ strcpy(argument_begin, "begin "); strcat(argument_begin, argument); directive = find_directive(configuration_table, block, argument_begin); if (directive == NULL) { syslog(LOG_ERR, "%s:%d: unknown directive name: begin %s", file_name, line_number, argument); goto failed; } directive->count++; if (1 < directive->count && !READCONF_IS_REDEFINABLE(directive->type)) { syslog(LOG_ERR, "%s:%d: directive redefined: begin %s", file_name, line_number, argument); goto failed; } /* * Update the current block name. */ if (block[0] != '\0') strcat(block, " "); strcat(block, argument); /* * Reset counters for the block. */ reset_configuration(configuration_table, block); /* * Dispatch. */ if (directive->function != NULL && directive->function(NULL, file_name, line_number) < 0) goto failed; } else if (strcmp(name, "end") == 0) { char argument_end[(READCONF_SIZE_BLOCK_NAME * 2) + 1]; /* * `end' keyword. End of the book definition. * Check for the argument. */ if (argument != NULL) { syslog(LOG_ERR, "%s:%d: unwanted argument: %s", file_name, line_number, argument); goto failed; } /* * If there is no correspondig `begin' keyword, an error is * caused. */ if (block[0] == '\0') { syslog(LOG_ERR, "%s:%d: unexpected: end", file_name, line_number); goto failed; } /* * Checks for counters. * If required directive is not defined, an error occurs. */ lack_directive = check_configuration(configuration_table, block); if (lack_directive != NULL) { syslog(LOG_ERR, "%s:%d: missing directive: %s", file_name, line_number, lack_directive->name); goto failed; } /* * Update the current block name, and get a directive * name to be found by `find_directive()'. */ p = strrchr(block, ' '); strcpy(argument_end, "end "); if (p != NULL) { strcat(argument_end, p + 1); *p = '\0'; } else { strcat(argument_end, block); block[0] = '\0'; } /* * Dispatch. */ directive = find_directive(configuration_table, block, argument_end); if (directive == NULL) { syslog(LOG_ERR, "%s:%d: unexpected: end", file_name, line_number); goto failed; } if (directive->function != NULL && directive->function(NULL, file_name, line_number) < 0) goto failed; } else { /* * It is a directive. * Look for a directive entry in the table. */ if (argument == NULL) { syslog(LOG_ERR, "%s:%d: missing argument: %s", file_name, line_number, name); goto failed; } directive = find_directive(configuration_table, block, name); if (directive == NULL) { syslog(LOG_ERR, "%s:%d: unknown directive: %s", file_name, line_number, name); goto failed; } directive->count++; if (1 < directive->count && !READCONF_IS_REDEFINABLE(directive->type)) { syslog(LOG_ERR, "%s:%d: directive redefined: %s", file_name, line_number, name); goto failed; } /* * Dispatch. */ if (directive->function != NULL && directive->function(argument, file_name, line_number) < 0) goto failed; } } /* * End of the configuration file. * Check for balance of "begin" and "end". */ if (block[0] != '\0') { syslog(LOG_ERR, "%s: missing: end", file_name, line_number); goto failed; } /* * Checks for counters in the directive table. * If required directive is not defined, an error occurs. */ lack_directive = check_configuration(configuration_table, block); if (lack_directive != NULL) { syslog(LOG_ERR, "%s: missing directive: %s", file_name, lack_directive->name); goto failed; } /* * Call a post-process hook. */ directive = find_directive(configuration_table, block, "end"); if (directive != NULL && directive->function(NULL, file_name, line_number) < 0) goto failed; /* * Close the configuration file. */ if (fclose(file) == EOF) { syslog(LOG_ERR, "%s: failed to close the file, %s", file_name, strerror(errno)); file = NULL; goto failed; } syslog(LOG_DEBUG, "%s: debug: close the file", file_name); return 0; /* * An error occurs... */ failed: if (file != NULL && fclose(file) == EOF) syslog(LOG_ERR, "%s: failed to close the file, %s", file_name, strerror(errno)); return -1; } /* * Find the directive which has `block' and `name' pair. * * If found, the pointer to the entry is returned. Otherwise NULL is * returned. */ static Configuration * find_directive(configuration_table, block, name) Configuration *configuration_table; const char *block; const char *name; { Configuration *directive; for (directive = configuration_table; directive->name != NULL; directive++) { if (strcmp(directive->name, name) == 0 && strcmp(directive->block, block) == 0) return directive; } return NULL; } /* * Reset counters which have `block' name in the table. */ static void reset_configuration(configuration_table, block) Configuration *configuration_table; const char *block; { Configuration *directive; for (directive = configuration_table; directive->name != NULL; directive++) { if (directive->block != NULL && strcmp(directive->block, block) == 0) directive->count = 0; } } /* * Check for counters in the configuration table. * * If required directive is not defined, its name is returned. * When more than one required table are undefined, the ealiest one in * the table is returned. * * If all required table are defined, NULL is returned. */ static Configuration * check_configuration(configuration_table, block) Configuration *configuration_table; const char *block; { Configuration *directive; for (directive = configuration_table; directive->name != NULL; directive++) { if (directive->block != NULL && strcmp(directive->block, block) == 0 && directive->count == 0 && READCONF_IS_REQUIRED(directive->type)) return directive; } return NULL; } ebnetd-1.0.dfsg.1/lib/serverport.c0000644000175000017500000001531207673055400016347 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * Copyright (c) 2001 * IPv6 support by UMENO Takashi * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T * AC_TYPE_SA_FAMILY_T * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h, unistd.h) * AC_CHECK_FUNCS(memcpy) * AC_HEADER_TIME */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_FCNTL_H #include #else #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef TIME_WITH_SYS_TIME #include #include #else /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ #include "dummyin6.h" #if !defined(HAVE_GETADDRINFO) || !defined(HAVE_GETNAMEINFO) #include "getaddrinfo.h" #endif #include "serverport.h" #include "fdset.h" #ifdef USE_FAKELOG #include "fakelog.h" #endif #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif /* not HAVE_MEMCPY */ #undef LISTEN_NONBLOCK_SOCKETS /* * Target address families. */ #ifdef ENABLE_IPV6 static sa_family_t target_families[] = {AF_INET6, AF_INET}; #define TARGET_FAMILY_COUNT 2 #else static sa_family_t target_families[] = {AF_INET}; #define TARGET_FAMILY_COUNT 1 #endif /* * Bind and listen to a TCP port. * * `port' is a port number to which the server listens. * `backlog' is a maximum queue length of pending connections. * * If successful, the file descriptor of the socket is returned. * Otherwise, -1 is returned. */ int set_server_ports(port, backlog, listening_files, max_file) int port; int backlog; fd_set *listening_files; int *max_file; { struct addrinfo hints; struct addrinfo *info_list; struct addrinfo *info; int socket_options; char address_string[INET6_ADDRSTRLEN]; char port_string[16]; int gai_error_code; int file; int i; initialize_fdset(listening_files, max_file); /* * Get address information. */ sprintf(port_string, "%d", (int)port); memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; gai_error_code = getaddrinfo(NULL, port_string, &hints, &info_list); if (gai_error_code != 0) { syslog(LOG_DEBUG, "debug: getaddrinfo fail, %s", gai_strerror(gai_error_code)); goto failed; } for (i = 0; i < TARGET_FAMILY_COUNT; i++) { for (info = info_list; info != NULL; info = info->ai_next) { if (info->ai_family != target_families[i]) continue; info->ai_addr->sa_family = info->ai_family; /* for AIX. */ gai_error_code = getnameinfo(info->ai_addr, info->ai_addrlen, address_string, sizeof(address_string), NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV); if (gai_error_code != 0) continue; /* * Create a socket. */ file = socket(info->ai_family, info->ai_socktype, info->ai_protocol); if (file < 0) continue; #ifdef SO_REUSEADDR socket_options = 1; if (setsockopt(file, SOL_SOCKET, SO_REUSEADDR, (char *)&socket_options, sizeof(socket_options)) < 0) { syslog(LOG_ERR, "setsockopt() failed, %s: %s", strerror(errno), address_string); goto failed; } #endif /* * Bind the socket. */ if (bind(file, info->ai_addr, info->ai_addrlen) < 0) { syslog(LOG_ERR, "bind() failed, %s: %s", strerror(errno), address_string); close(file); continue; } /* * Listen to the port. */ if (listen(file, backlog) < 0) { syslog(LOG_ERR, "listen() failed, %s: %s", strerror(errno), address_string); goto failed; } add_fd_to_fdset(listening_files, max_file, file); #ifdef LISTEN_NONBLOCK_SOCKETS fcntl(file, F_GETFL, 0); fcntl(file, F_SETFL, O_NONBLOCK); #endif syslog(LOG_DEBUG, "debug: set server port: %s", address_string); } } freeaddrinfo(info_list); if (*max_file < 0) syslog(LOG_ERR, "no server port available: %d/tcp", (int)port); return *max_file; /* * An error occurs... */ failed: freeaddrinfo(info_list); syslog(LOG_ERR, "failed to listen to the port: %d/tcp", (int)port); return -1; } /* * Wait until a new connection comes. * * `file' is a socket to wait a connection. * The system call listen() must have been called for `file'. * (A file created by set_server_port() is suitable for `file'.) * * The function never returns until a new connection comes, or an error * occurs. If an error occurs, -1 is returned. Otherwise 0 is returned. */ int wait_server_ports(listening_files, select_files, max_file) fd_set *listening_files; fd_set *select_files; int *max_file; { int status; memcpy(select_files, listening_files, sizeof(fd_set)); for (;;) { /* * Wait until a new connection comes. */ status = select(*max_file + 1, select_files, NULL, NULL, NULL); if (0 < status) break; else if (errno == EINTR) { /* * When a child process exits, select() returns -1 and `errno' * is set to EINTR. */ return -1; } else { syslog(LOG_ERR, "select() failed, %s", strerror(errno)); goto failed; } } syslog(LOG_DEBUG, "debug: catch a new connection"); return 0; /* * An error occurs... */ failed: syslog(LOG_ERR, "failed to catch a new connection"); return -1; } ebnetd-1.0.dfsg.1/lib/signame.c0000644000175000017500000002004007673055402015553 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_TYPE_SIZE_T * AC_HEADER_STDC * AC_CHECK_HEADERS(string.h, memory.h, unistd.h) * AC_CHECK_FUNCS(strcasecmp, psignal, strsignal) * AC_DECL_SYS_SIGLIST */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ #ifndef NSIG #ifdef _NSIG #define NSIG _NSIG #else #define NSIG 32 #endif #endif /* * Signal codes, names, and explanations. * The table is taken from `signame.c' in GNU make version 3.75. */ /* Convert between signal names and numbers. Copyright (C) 1990, 1992, 1993, 1995, 1996 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program 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 this program; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ typedef struct { int code; const char *name; const char *explanation; } Signal_Entry; static const Signal_Entry signal_table[] = { /* Initialize signal names. */ #ifdef SIGHUP {SIGHUP, "HUP", "Hangup"}, #endif #ifdef SIGINT {SIGINT, "INT", "Interrupt"}, #endif #ifdef SIGQUIT {SIGQUIT, "QUIT", "Quit"}, #endif #ifdef SIGILL {SIGILL, "ILL", "Illegal Instruction"}, #endif #ifdef SIGTRAP {SIGTRAP, "TRAP", "Trace/breakpoint trap"}, #endif /* * If SIGIOT == SIGABRT, we want to print it as SIGABRT because * SIGABRT is in ANSI and POSIX.1 and SIGIOT isn't. */ #ifdef SIGABRT {SIGABRT, "ABRT", "Aborted"}, #endif #ifdef SIGIOT {SIGIOT, "IOT", "IOT trap"}, #endif #ifdef SIGEMT {SIGEMT, "EMT", "EMT trap"}, #endif #ifdef SIGFPE {SIGFPE, "FPE", "Floating point exception"}, #endif #ifdef SIGKILL {SIGKILL, "KILL", "Killed"}, #endif #ifdef SIGBUS {SIGBUS, "BUS", "Bus error"}, #endif #ifdef SIGSEGV {SIGSEGV, "SEGV", "Segmentation fault"}, #endif #ifdef SIGSYS {SIGSYS, "SYS", "Bad system call"}, #endif #ifdef SIGPIPE {SIGPIPE, "PIPE", "Broken pipe"}, #endif #ifdef SIGALRM {SIGALRM, "ALRM", "Alarm clock"}, #endif #ifdef SIGTERM {SIGTERM, "TERM", "Terminated"}, #endif #ifdef SIGUSR1 {SIGUSR1, "USR1", "User defined signal 1"}, #endif #ifdef SIGUSR2 {SIGUSR2, "USR2", "User defined signal 2"}, #endif /* * If SIGCLD == SIGCHLD, we want to print it as SIGCHLD because that * is what is in POSIX.1. */ #ifdef SIGCHLD {SIGCHLD, "CHLD", "Child exited"}, #endif #ifdef SIGCLD {SIGCLD, "CLD", "Child exited"}, #endif #ifdef SIGPWR {SIGPWR, "PWR", "Power failure"}, #endif #ifdef SIGTSTP {SIGTSTP, "TSTP", "Stopped"}, #endif #ifdef SIGTTIN {SIGTTIN, "TTIN", "Stopped (tty input)"}, #endif #ifdef SIGTTOU {SIGTTOU, "TTOU", "Stopped (tty output)"}, #endif #ifdef SIGSTOP {SIGSTOP, "STOP", "Stopped (signal)"}, #endif #ifdef SIGXCPU {SIGXCPU, "XCPU", "CPU time limit exceeded"}, #endif #ifdef SIGXFSZ {SIGXFSZ, "XFSZ", "File size limit exceeded"}, #endif #ifdef SIGVTALRM {SIGVTALRM, "VTALRM", "Virtual timer expired"}, #endif #ifdef SIGPROF {SIGPROF, "PROF", "Profiling timer expired"}, #endif /* * "Window size changed" might be more accurate, but even if that * is all that it means now, perhaps in the future it will be * extended to cover other kinds of window changes. */ #ifdef SIGWINCH {SIGWINCH, "WINCH", "Window changed"}, #endif #ifdef SIGCONT {SIGCONT, "CONT", "Continued"}, #endif #ifdef SIGURG {SIGURG, "URG", "Urgent I/O condition"}, #endif /* "I/O pending" has also been suggested. A disadvantage is * that signal only happens when the process has * asked for it, not everytime I/O is pending. Another disadvantage * is the confusion from giving it a different name than under Unix. */ #ifdef SIGIO {SIGIO, "IO", "I/O possible"}, #endif #ifdef SIGWIND {SIGWIND, "WIND", "SIGWIND"}, #endif #ifdef SIGPHONE {SIGPHONE, "PHONE", "SIGPHONE"}, #endif #ifdef SIGPOLL {SIGPOLL, "POLL", "I/O possible"}, #endif #ifdef SIGLOST {SIGLOST, "LOST", "Resource lost"}, #endif #ifdef SIGDANGER {SIGDANGER, "DANGER", "Danger signal"}, #endif #ifdef SIGINFO {SIGINFO, "INFO", "Information request"}, #endif {-1, NULL, NULL} }; /* * Return the abbreviation name for signal number `code'. */ const char * signal_name(code) int code; { const Signal_Entry *entry; for (entry = signal_table; entry->name != NULL; entry++) { if (entry->code == code) return entry->name; } return NULL; } /* * Return the signal number for an abbreviated signal name `name', * or -1 if there is no signal by that name. */ int signal_code(name) const char *name; { const Signal_Entry *entry; for (entry = signal_table; entry->name != NULL; entry++) { if (strcasecmp(entry->name, name) == 0) return entry->code; } return -1; } /* * Return the signal explanation for an signal `code', or NULL if there * is no signal `code'. */ const char * signal_explanation(code) int code; { const Signal_Entry *entry; for (entry = signal_table; entry->name != NULL; entry++) { if (entry->code == code) return entry->explanation; } return NULL; } /* * Print the name of SIGNAL and message to standard error. */ #ifndef HAVE_PSIGNAL void psignal(code, message) int code; const char *message; { const Signal_Entry *entry; const char *default_message = NULL; if (message != NULL) fprintf(stderr, "%s: ", message); #ifdef SYS_SIGLIST_DECLARED if (0 < code && code < NSIG) default_message = (const char *) sys_siglist[code]; #else /* not SYS_SIGLIST_DECLARED */ for (entry = signal_table; entry->name != NULL; entry++) { if (entry->code == code) { default_message = entry->explanation; break; } } #endif /* not SYS_SIGLIST_DECLARED */ if (default_message == NULL) fprintf(stderr, "unknown signal\n"); else fprintf(stderr, "%s\n", default_message); } #endif /* not HAVE_PSIGNAL */ /* * Return the string associated with the signal number. */ #ifndef HAVE_STRSIGNAL const char * strsignal(code) int code; { #ifndef SYS_SIGLIST_DECLARED const Signal_Entry *entry; for (entry = signal_table; entry->name != NULL; entry++) { if (entry->code == code) return entry->explanation; } #else /* not SYS_SIGLIST_DECLARED */ if (0 < code && code < NSIG) return (const char *) sys_siglist[code]; #endif /* not SYS_SIGLIST_DECLARED */ return "Unknown signal"; } #endif /* not HAVE_STRSIGNAL */ ebnetd-1.0.dfsg.1/lib/ticket.c0000644000175000017500000001201007673055375015422 0ustar mhattamhatta/* -*- C -*- * Copyright (c) 1999, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST * AC_CHECK_HEADERS(stdlib.h, unistd.h, fcntl.h) */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_FCNTL_H #include #else #include #endif #include "ticket.h" #ifndef O_BINARY #define O_BINARY 0 #endif /* * Whence parameter for lseek(). */ #ifndef SEEK_SET #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 #endif #ifdef USE_FAKELOG #include "fakelog.h" #endif /* * initialize a stock file. */ void initialize_ticket_stock(stock) Ticket_Stock *stock; { stock->file_name = NULL; stock->file = -1; stock->count = -1; stock->lock_spot = -1; } /* * Bind a ticket stock to a lock file `file_name', and set the number * of tickets on the stock as `lockmax'. * * If it succeeds, 0 is returned. Otherwise -1 is returned. */ int bind_ticket_stock(stock, file_name, lock_max) Ticket_Stock *stock; const char *file_name; int lock_max; { /* * Record the lock file_name to the stock. */ stock->file_name = (char *) malloc(strlen(file_name) + 1); if (stock->file_name == NULL) { syslog(LOG_ERR, "memory exhausted"); goto failed; } strcpy(stock->file_name, file_name); /* * Open the lock file `file_name'. */ stock->file = open(file_name, O_RDWR | O_CREAT | O_BINARY, 0600); if (stock->file < 0) { syslog(LOG_ERR, "failed to open the file, %s: %s", strerror(errno), file_name); goto failed; } stock->lock_spot = -1; stock->count = lock_max; syslog(LOG_DEBUG, "debug: open the lock file: %s", file_name); return 0; /* * An error occurs... */ failed: finalize_ticket_stock(stock); return -1; } /* * Get a ticket from `stock'. * If it succeeds, or we have gotten a ticket from the stock, then * 0 is returned. Otherwise -1 is returned. */ int get_ticket(stock) Ticket_Stock *stock; { struct flock lock; int i; if (stock->file < 0) return -1; if (0 <= stock->lock_spot) return 0; /* * Try to lock a free spot in the lock file. */ for (i = 0; i < stock->count; i++) { lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_start = i; lock.l_len = 1; lock.l_pid = 0; if (fcntl(stock->file, F_SETLK, &lock) == 0) { syslog(LOG_DEBUG, "debug: lock the spot %d on the lock file: %s", i, stock->file_name); stock->lock_spot = i; return 0; } } syslog(LOG_DEBUG, "debug: no free spot is left on the lock file: %s", stock->file_name); return -1; } /* * Release a ticket that is gotten from `stock' beforehand. * * If it succeeds to release or no lock is set, then 0 is returned. * Otherwise -1 is returned. */ int unget_ticket(stock) Ticket_Stock *stock; { struct flock lock; if (stock->file < 0 || stock->lock_spot < 0) return 0; /* * Unlock the spot. */ lock.l_type = F_UNLCK; lock.l_whence = SEEK_SET; lock.l_start = stock->lock_spot; lock.l_len = 1; lock.l_pid = 0; if (fcntl(stock->file, F_SETLK, &lock) != 0) { syslog(LOG_ERR, "failed to unlock the spot %d on the file, %s: %s", stock->lock_spot, strerror(errno), stock->file_name); return -1; } stock->lock_spot = -1; return 0; } /* * Test whether `stock' has had a ticket or not. */ int have_ticket(stock) Ticket_Stock *stock; { return (0 <= stock->file && 0 <= stock->lock_spot); } /* * Clear the ticket stock. */ void finalize_ticket_stock(stock) Ticket_Stock *stock; { /* * Close the lock file. */ if (0 <= stock->file) { close(stock->file); syslog(LOG_DEBUG, "debug: close the lock file: %s", stock->file_name); stock->file = -1; } /* * Dispose memory allocated to the file_name. */ if (stock->file_name != NULL) { free(stock->file_name); stock->file_name = NULL; } stock->count = -1; stock->lock_spot = -1; } ebnetd-1.0.dfsg.1/lib/wildcard.c0000644000175000017500000000326707673055377015750 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ /* * This program requires the following Autoconf macros: * AC_C_CONST */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* * Do wildcard pattern matching. * In the pattern, the following characters have special meaning. * * `*' matches any sequence of zero or more characters. * '\x' a character following a backslash is taken literally. * (e.g. '\*' means an asterisk itself.) * * If `pattern' matches to `string', 1 is returned. Otherwise 0 is * returned. */ int match_wildcard(pattern, string) const char *pattern; const char *string; { const char *pattern_p = pattern; const char *string_p = string; while (*pattern_p != '\0') { if (*pattern_p == '*') { pattern_p++; if (*pattern_p == '\0') return 1; while (*string_p != '\0') { if (*string_p == *pattern_p && match_wildcard(pattern_p, string_p)) return 1; string_p++; } return 0; } else { if (*pattern_p == '\\' && *(pattern_p + 1) != '\0') pattern_p++; if (*pattern_p != *string_p) return 0; } pattern_p++; string_p++; } return (*string_p == '\0'); } ebnetd-1.0.dfsg.1/lib/gettext.h0000644000175000017500000002240610613362116015620 0ustar mhattamhatta/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by the gettext() and ngettext() macros. This is an alternative to calling textdomain(), and is useful for libraries. */ # ifdef DEFAULT_TEXT_DOMAIN # undef gettext # define gettext(Msgid) \ dgettext (DEFAULT_TEXT_DOMAIN, Msgid) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) # endif #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include # if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) # define dcgettext(Domainname, Msgid, Category) \ ((void) (Category), dgettext (Domainname, Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 \ ? ((void) (Msgid2), (const char *) (Msgid1)) \ : ((void) (Msgid1), (const char *) (Msgid2))) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) \ ((void) (Domainname), (const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) \ ((void) (Domainname), (const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String /* The separator between msgctxt and msgid in a .mo file. */ #define GETTEXT_CONTEXT_GLUE "\004" /* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be short and rarely need to change. The letter 'p' stands for 'particular' or 'special'. */ #ifdef DEFAULT_TEXT_DOMAIN # define pgettext(Msgctxt, Msgid) \ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #else # define pgettext(Msgctxt, Msgid) \ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif #define dpgettext(Domainname, Msgctxt, Msgid) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) #ifdef DEFAULT_TEXT_DOMAIN # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #else # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #endif #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * pgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, int category) { const char *translation = dcgettext (domain, msg_ctxt_id, category); if (translation == msg_ctxt_id) return msgid; else return translation; } #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * npgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { const char *translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); if (translation == msg_ctxt_id || translation == msgid_plural) return (n == 1 ? msgid : msgid_plural); else return translation; } /* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID can be arbitrary expressions. But for string literals these macros are less efficient than those above. */ #include #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ /* || __STDC_VERSION__ >= 199901L */ ) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include #endif #define pgettext_expr(Msgctxt, Msgid) \ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) #define dpgettext_expr(Domainname, Msgctxt, Msgid) \ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (translation != msg_ctxt_id) return translation; } return msgid; } #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcnpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (!(translation == msg_ctxt_id || translation == msgid_plural)) return translation; } return (n == 1 ? msgid : msgid_plural); } #endif /* _LIBGETTEXT_H */ ebnetd-1.0.dfsg.1/lib/getopt_int.h0000644000175000017500000001127410613362125016311 0ustar mhattamhatta/* Internal declarations for getopt. Copyright (C) 1989-1994,1996-1999,2001,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program 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, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETOPT_INT_H #define _GETOPT_INT_H 1 extern int _getopt_internal (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only, int __posixly_correct); /* Reentrant versions which can handle parsing multiple argument vectors at the same time. */ /* Data type for reentrant functions. */ struct _getopt_data { /* These have exactly the same meaning as the corresponding global variables, except that they are used for the reentrant versions of getopt. */ int optind; int opterr; int optopt; char *optarg; /* Internal members. */ /* True if the internal members have been initialized. */ int __initialized; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ char *__nextchar; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters, or by calling getopt. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } __ordering; /* If the POSIXLY_CORRECT environment variable is set or getopt was called. */ int __posixly_correct; /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ int __first_nonopt; int __last_nonopt; #if defined _LIBC && defined USE_NONOPTION_FLAGS int __nonoption_flags_max_len; int __nonoption_flags_len; # endif }; /* The initializer is necessary to set OPTIND and OPTERR to their default values and to clear the initialization flag. */ #define _GETOPT_DATA_INITIALIZER { 1, 1 } extern int _getopt_internal_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only, int __posixly_correct, struct _getopt_data *__data); extern int _getopt_long_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, struct _getopt_data *__data); extern int _getopt_long_only_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, struct _getopt_data *__data); #endif /* getopt_int.h */ ebnetd-1.0.dfsg.1/ebnetd.conf.sample.in0000644000175000017500000000435407673055413017227 0ustar mhattamhatta###################################################################### # Configuration file for ebnetd/ndtpd/ebhttpd. # (Copy this file to `ebnetd.conf', and edit it.) ###################################################################### ### Port number `ebnetd' binds. ### (default: ebnet) # ebnet-port ebnet ### Port number `ndtpd' binds. ### (default: ndtp) # ndtp-port ndtp ### Port number `ebhttpd' binds. ### (default: http) # http-port http ### Owner of the server process. ### (default: none) user ndtpuser ### Group of the server process. ### (default: none) group ndtpgrp ### How many clients can be connected to the server at the same time. ### (default: 1) # max-clients 1 ### Which hosts can or cannot connect to the server. ### (default: none) hosts 127.0.0.1 hosts ::1 hosts !? hosts host.your.domain ### Timeout seconds until the server disconnects an idle connection. ### (default: 900) # timeout 900 ### Path to a working directory. ### Please create the directory and make it be writable for the server ### processes before executing the server. ### (default: @pkglocalstatedir@) # work-path @pkglocalstatedir@ ### How many hit entries the server tries to find at a search. ### (default: 50) # max-hits 50 ### The maximum size of text the server may send as a response to ### a client. ### (default: 32768) # max-text-size 32768 ### Syslog facility ### (default: daemon) syslog-facility local0 ### ### Book entry ### begin book ### Name of the book. ### (required) name jitenban97 ### Title of the book. ### (required) title Jitenban 97 ### Path to a top directory of the book. ### (required) path /cdrom ### Path to a top directory of the appdendix data of the book. ### (default: none) appendix-path @datadir@/eb/appendix/jitenban97-2.1 ### How many clients can access the book at the same time. ### (default: 1) max-clients 1 ### Which hosts can or cannot access to the book. ### (default: none) hosts 127.0.0.1 hosts ::1 hosts !? hosts host.your.domain end ### Add a book group directive (lines between `begin book' and `end'), ### if you want to read another CD-ROM book. A book group directive ### is required for each book. ebnetd-1.0.dfsg.1/move-if-change0000755000175000017500000000154507673055330015742 0ustar mhattamhatta#!/bin/sh # Copyright (C) 1996 Free Software Foundation, Inc. # # This program 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. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. if test -r $2 then if cmp $1 $2 > /dev/null then echo $2 is unchanged rm -f $1 else mv -f $1 $2 fi else mv -f $1 $2 fi ebnetd-1.0.dfsg.1/ebtiny/0000755000175000017500000000000007773515157014525 5ustar mhattamhattaebnetd-1.0.dfsg.1/ebtiny/appendix.h0000644000175000017500000000202507673055334016500 0ustar mhattamhatta/* * Copyright (c) 2003 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef TINYEB_APPENDIX_H #define TINYEB_APPENDIX_H #include "ebtiny/eb.h" #define EB_Appendix EB_Book #define eb_bind_appendix eb_bind #define eb_initialize_appendix eb_initialize_book #define eb_finalize_appendix eb_finalize_book #define eb_appendix_subbook_list eb_subbook_list #define eb_appendix_subbook_directory2 eb_subbook_directory2 #define eb_load_all_appendix_subbooks eb_load_all_subbooks #endif /* not TINYEB_APPENDIX_H */ ebnetd-1.0.dfsg.1/ebtiny/eb.h0000644000175000017500000000452407673055333015263 0ustar mhattamhatta/* * Copyright (c) 2003 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef TINYEB_EB_H #define TINYEB_EB_H #include /* * Special subbook code for representing error state. */ #define EB_SUBBOOK_INVALID -1 /* * Maximum length of a directory name. */ #define EB_MAX_DIRECTORY_NAME_LENGTH 8 /* * Maximum length of a file name under a certain directory. * prefix(8 chars) + '.' + suffix(3 chars) + ';' + digit(1 char) */ #define EB_MAX_FILE_NAME_LENGTH 14 /* * Maximum number of subbooks in a book. */ #define EB_MAX_SUBBOOKS 50 /* * Trick for function prototypes. */ #ifndef EB_P #if defined(__STDC__) || defined(__cplusplus) || defined(WIN32) #define EB_P(p) p #else /* not (__STDC__ && __cplusplus && WIN32) */ #define EB_P(p) () #endif /* not (__STDC__ && __cplusplus && WIN32) */ #endif /* EB_P */ /* * Types for various codes. */ typedef int EB_Error_Code; typedef int EB_Subbook_Code; /* * Typedef for Structures. */ typedef struct EB_Book_Struct EB_Book; typedef struct EB_Book_Struct EB_Appendix; /* * Book */ struct EB_Book_Struct { int subbook_count; char subbooks[EB_MAX_SUBBOOKS][EB_MAX_DIRECTORY_NAME_LENGTH + 1]; }; /* * Function declarations. */ EB_Error_Code eb_initialize_library EB_P((void)); void eb_finalize_library EB_P((void)); void eb_initialize_book EB_P((EB_Book *)); EB_Error_Code eb_bind EB_P((EB_Book *, const char *)); void eb_finalize_book EB_P((EB_Book *)); EB_Error_Code eb_subbook_list EB_P((EB_Book *, EB_Subbook_Code *, int *)); EB_Error_Code eb_subbook_directory2 EB_P((EB_Book *, EB_Subbook_Code, char *)); EB_Error_Code eb_load_all_subbooks EB_P((EB_Book *)); EB_Error_Code eb_fix_directory_name EB_P((const char *, char *)); EB_Error_Code eb_find_file_name EB_P((const char *, const char *, char *)); ssize_t eb_read_all EB_P((int, char *, size_t)); #endif /* not TINYEB_EB_H */ ebnetd-1.0.dfsg.1/ebtiny/error.h0000644000175000017500000000217307673055331016022 0ustar mhattamhatta/* * Copyright (c) 2003 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef TINYEB_ERROR_H #define TINYEB_ERROR_H #include "ebtiny/eb.h" /* * Error codes. */ #define EB_SUCCESS 0 #define EB_ERR_EMPTY_FILE_NAME 1 #define EB_ERR_TOO_LONG_FILE_NAME 2 #define EB_ERR_BAD_FILE_NAME 3 #define EB_ERR_BAD_DIR_NAME 4 #define EB_ERR_FAIL_OPEN_CAT 5 #define EB_ERR_FAIL_READ_CAT 6 #define EB_ERR_UNEXP_CAT 7 #define EB_ERR_UNBOUND_BOOK 8 #define EB_ERR_NO_SUCH_SUB 9 /* * The number of error codes. */ #define EB_NUMBER_OF_ERRORS 10 /* * Function declarations. */ const char *eb_error_message EB_P((EB_Error_Code)); #endif /* not TINYEB_ERROR_H */ ebnetd-1.0.dfsg.1/ebtiny/Makefile.am0000644000175000017500000000025207673055332016551 0ustar mhattamhattanoinst_LIBRARIES = libebtiny.a libebtiny_a_SOURCES = book.c eb.c error.c util.c noinst_HEADERS = appendix.h eb.h error.h INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/lib ebnetd-1.0.dfsg.1/ebtiny/Makefile.in0000644000175000017500000003343007773515024016566 0ustar mhattamhatta# Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ # Copyright (C) 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. # 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. @SET_MAKE@ SOURCES = $(libebtiny_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ subdir = ebtiny DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/eb4.m4 \ $(top_srcdir)/m4/herrno.m4 $(top_srcdir)/m4/in6addr.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/sockaddrin6.m4 \ $(top_srcdir)/m4/sockinttypes.m4 $(top_srcdir)/m4/unionwait.m4 \ $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = ARFLAGS = cru LIBRARIES = $(noinst_LIBRARIES) libebtiny_a_AR = $(AR) $(ARFLAGS) libebtiny_a_LIBADD = am_libebtiny_a_OBJECTS = book.$(OBJEXT) eb.$(OBJEXT) error.$(OBJEXT) \ util.$(OBJEXT) libebtiny_a_OBJECTS = $(am_libebtiny_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/book.Po ./$(DEPDIR)/eb.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/error.Po ./$(DEPDIR)/util.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libebtiny_a_SOURCES) DIST_SOURCES = $(libebtiny_a_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS = @COMPRESS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ EBCONF_EBINCS = @EBCONF_EBINCS@ EBCONF_EBLIBS = @EBCONF_EBLIBS@ EBCONF_INTLINCS = @EBCONF_INTLINCS@ EBCONF_INTLLIBS = @EBCONF_INTLLIBS@ EBCONF_PTHREAD_CFLAGS = @EBCONF_PTHREAD_CFLAGS@ EBCONF_PTHREAD_CPPFLAGS = @EBCONF_PTHREAD_CPPFLAGS@ EBCONF_PTHREAD_LDFLAGS = @EBCONF_PTHREAD_LDFLAGS@ EBCONF_ZLIBINCS = @EBCONF_ZLIBINCS@ EBCONF_ZLIBLIBS = @EBCONF_ZLIBLIBS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GZIPCMD = @GZIPCMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAILING_ADDRESS = @MAILING_ADDRESS@ MAILX = @MAILX@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ noinst_LIBRARIES = libebtiny.a libebtiny_a_SOURCES = book.c eb.c error.c util.c noinst_HEADERS = appendix.h eb.h error.h INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/lib all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ebtiny/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu ebtiny/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libebtiny.a: $(libebtiny_a_OBJECTS) $(libebtiny_a_DEPENDENCIES) -rm -f libebtiny.a $(libebtiny_a_AR) libebtiny.a $(libebtiny_a_OBJECTS) $(libebtiny_a_LIBADD) $(RANLIB) libebtiny.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/book.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: 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: TAGS 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 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"; \ $(mkdir_p) "$(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 $(LIBRARIES) $(HEADERS) installdirs: 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-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am 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 mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ 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: ebnetd-1.0.dfsg.1/ebtiny/book.c0000644000175000017500000001570207673055332015621 0ustar mhattamhatta/* * Copyright (c) 2003 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_FCNTL_H #include #else #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #include "ebtiny/eb.h" #include "ebtiny/error.h" /* * Unexported functions. */ static EB_Error_Code eb_load_catalog_eb EB_P((EB_Book *, const char *)); static EB_Error_Code eb_load_catalog_epwing EB_P((EB_Book *, const char *)); void eb_initialize_book(book) EB_Book *book; { int i; book->subbook_count = 0; for (i = 0; i < book->subbook_count; i++) book->subbooks[i][0] = '\0'; } void eb_finalize_book(book) EB_Book *book; { int i; for (i = 0; i < book->subbook_count; i++) book->subbooks[i][0] = '\0'; book->subbook_count = 0; } EB_Error_Code eb_load_all_subbooks(book) EB_Book *book; { return EB_SUCCESS; } EB_Error_Code eb_bind(book, path) EB_Book *book; const char *path; { EB_Error_Code error_code; size_t path_length; if (book->subbooks != NULL) { eb_finalize_book(book); eb_initialize_book(book); } if (*path != '/') return EB_ERR_BAD_FILE_NAME; path_length = strlen(path); if (PATH_MAX < path_length + 1 + EB_MAX_FILE_NAME_LENGTH) return EB_ERR_TOO_LONG_FILE_NAME; error_code = eb_load_catalog_eb(book, path); if (error_code != EB_SUCCESS) error_code = eb_load_catalog_epwing(book, path); if (error_code != EB_SUCCESS) return error_code; return EB_SUCCESS; } static EB_Error_Code eb_load_catalog_eb(book, book_path) EB_Book *book; const char *book_path; { char catalog_path_name[PATH_MAX + 1]; char catalog_file_name[EB_MAX_FILE_NAME_LENGTH + 1]; char buffer[40]; char *space; EB_Error_Code error_code; int file = -1; int i; /* * Open a catalog file. */ error_code = eb_find_file_name(book_path, "catalog", catalog_file_name); if (error_code != EB_SUCCESS) goto failed; sprintf(catalog_path_name, "%s/%s", book_path, catalog_file_name); file = open(catalog_path_name, O_RDONLY); if (file < 0) { error_code = EB_ERR_FAIL_OPEN_CAT; goto failed; } /* * Get the number of subbooks in this book. */ if (eb_read_all(file, buffer, 16) != 16) { error_code = EB_ERR_FAIL_READ_CAT; goto failed; } book->subbook_count = (*(unsigned char *)buffer << 8) + (*(unsigned char *)(buffer + 1)); if (EB_MAX_SUBBOOKS < book->subbook_count) book->subbook_count = EB_MAX_SUBBOOKS; if (book->subbook_count == 0) { error_code = EB_ERR_UNEXP_CAT; goto failed; } /* * Read subbook information. */ for (i = 0; i < book->subbook_count; i++) { if (eb_read_all(file, buffer, 40) != 40) { error_code = EB_ERR_FAIL_READ_CAT; goto failed; } strncpy(book->subbooks[i], buffer + 32, EB_MAX_DIRECTORY_NAME_LENGTH); *(book->subbooks[i] + EB_MAX_DIRECTORY_NAME_LENGTH) = '\0'; space = strchr(book->subbooks[i], ' '); if (space != NULL) *space = '\0'; } close(file); return EB_SUCCESS; /* * An error occurs... */ failed: if (0 <= file) close(file); return error_code; } static EB_Error_Code eb_load_catalog_epwing(book, book_path) EB_Book *book; const char *book_path; { char catalog_path_name[PATH_MAX + 1]; char catalog_file_name[EB_MAX_FILE_NAME_LENGTH + 1]; char buffer[164]; char *space; EB_Error_Code error_code; int file = -1; int i; /* * Open a catalog file. */ error_code = eb_find_file_name(book_path, "catalogs", catalog_file_name); if (error_code != EB_SUCCESS) goto failed; sprintf(catalog_path_name, "%s/%s", book_path, catalog_file_name); file = open(catalog_path_name, O_RDONLY); if (file < 0) { error_code = EB_ERR_FAIL_OPEN_CAT; goto failed; } /* * Get the number of subbooks in this book. */ if (eb_read_all(file, buffer, 16) != 16) { error_code = EB_ERR_FAIL_READ_CAT; goto failed; } book->subbook_count = (*(unsigned char *)buffer << 8) + (*(unsigned char *)(buffer + 1)); if (EB_MAX_SUBBOOKS < book->subbook_count) book->subbook_count = EB_MAX_SUBBOOKS; if (book->subbook_count == 0) { error_code = EB_ERR_UNEXP_CAT; goto failed; } /* * Read subbook information. */ for (i = 0; i < book->subbook_count; i++) { if (eb_read_all(file, buffer, 164) != 164) { error_code = EB_ERR_FAIL_READ_CAT; goto failed; } strncpy(book->subbooks[i], buffer + 82, EB_MAX_DIRECTORY_NAME_LENGTH); *(book->subbooks[i] + EB_MAX_DIRECTORY_NAME_LENGTH) = '\0'; space = strchr(book->subbooks[i], ' '); if (space != NULL) *space = '\0'; } close(file); return EB_SUCCESS; /* * An error occurs... */ failed: if (0 <= file) close(file); return error_code; } EB_Error_Code eb_subbook_list(book, subbook_list, subbook_count) EB_Book *book; EB_Subbook_Code *subbook_list; int *subbook_count; { int i; if (book->subbooks == NULL) return EB_ERR_UNBOUND_BOOK; for (i = 0; i < book->subbook_count; i++) subbook_list[i] = i; *subbook_count = book->subbook_count; return EB_SUCCESS; } EB_Error_Code eb_subbook_directory2(book, subbook_code, directory) EB_Book *book; EB_Subbook_Code subbook_code; char *directory; { char *p; if (book->subbooks == NULL) return EB_ERR_UNBOUND_BOOK; if (subbook_code < 0 || book->subbook_count <= subbook_code) return EB_ERR_NO_SUCH_SUB; strcpy(directory, book->subbooks[subbook_code]); for (p = directory; *p != '\0'; p++) { if ('A' <= *p && *p <= 'Z') *p += ('a' - 'A'); } return EB_SUCCESS; } ebnetd-1.0.dfsg.1/ebtiny/eb.c0000644000175000017500000000134507673055331015252 0ustar mhattamhatta/* * Copyright (c) 2003 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ebtiny/eb.h" #include "ebtiny/error.h" EB_Error_Code eb_initialize_library() { return EB_SUCCESS; } void eb_finalize_library() { } ebnetd-1.0.dfsg.1/ebtiny/error.c0000644000175000017500000000277707673055332016030 0ustar mhattamhatta/* * Copyright (c) 2003 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "ebtiny/eb.h" #include "ebtiny/error.h" /* * Error messages. */ static const char * const error_messages[] = { /* 0 -- 4 */ "no error", "an empty file name", "too long file name", "bad file name", "bad directory name", /* 5 -- 10 */ "failed to open a catalog file in the book/appendix", "failed to read a catalog file in the book/appendix", "unexpected format in a catalog file in the book/appendix", "book/appendix not bound", "no such subbook in the book/appendix", NULL }; /* * Look up the error message corresponding to the error code `error_code'. */ const char * eb_error_message(error_code) EB_Error_Code error_code; { const char *message; if (0 <= error_code && error_code < EB_NUMBER_OF_ERRORS) message = error_messages[error_code]; else message = "unknown error"; return message; } ebnetd-1.0.dfsg.1/ebtiny/util.c0000644000175000017500000001436207673055333015646 0ustar mhattamhatta/* * Copyright (c) 2003 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_FCNTL_H #include #else #include #endif #if HAVE_DIRENT_H #include #define NAMLEN(dirent) strlen((dirent)->d_name) #else /* not HAVE_DIRENT_H */ #define dirent direct #define NAMLEN(dirent) (dirent)->d_namlen #if HAVE_SYS_NDIR_H #include #endif /* HAVE_SYS_NDIR_H */ #if HAVE_SYS_DIR_H #include #endif /* HAVE_SYS_DIR_H */ #if HAVE_NDIR_H #include #endif /* HAVE_NDIR_H */ #endif /* not HAVE_DIRENT_H */ /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #include "ebtiny/eb.h" #include "ebtiny/error.h" /* * Rewrite `directory_name' to a real directory name in the `path' directory. * * If a directory matched to `directory_name' exists, then EB_SUCCESS is * returned, and `directory_name' is rewritten to that name. Otherwise * EB_ERR_BAD_DIR_NAME is returned. */ EB_Error_Code eb_fix_directory_name(path, directory_name) const char *path; char *directory_name; { struct dirent *entry; DIR *dir; /* * Open the directory `path'. */ dir = opendir(path); if (dir == NULL) goto failed; for (;;) { /* * Read the directory entry. */ entry = readdir(dir); if (entry == NULL) goto failed; if (strcasecmp(entry->d_name, directory_name) == 0) break; } strcpy(directory_name, entry->d_name); closedir(dir); return EB_SUCCESS; /* * An error occurs... */ failed: if (dir != NULL) closedir(dir); return EB_ERR_BAD_DIR_NAME; } #define FOUND_NONE 0 #define FOUND_EBZ 1 #define FOUND_BASENAME 2 #define FOUND_ORG 3 /* * Rewrite `found_file_name' to a real file name in the `path_name' * directory. * * If a file matched to `rarget_file_name' exists, then EB_SUCCESS * is returned, and `found_file_name' is rewritten to that name. * Otherwise EB_ERR_BAD_FILE_NAME is returned. * * Note that `target_file_name' must not contain `.' or excceed * EB_MAX_DIRECTORY_NAME_LENGTH characters. */ EB_Error_Code eb_find_file_name(path_name, target_file_name, found_file_name) const char *path_name; const char *target_file_name; char *found_file_name; { char ebz_target_file_name[EB_MAX_FILE_NAME_LENGTH + 1]; char org_target_file_name[EB_MAX_FILE_NAME_LENGTH + 1]; char candidate_file_name[EB_MAX_FILE_NAME_LENGTH + 1]; DIR *dir; struct dirent *entry; size_t d_namlen; int found = FOUND_NONE; strcpy(ebz_target_file_name, target_file_name); strcat(ebz_target_file_name, ".ebz"); strcpy(org_target_file_name, target_file_name); strcat(org_target_file_name, ".org"); candidate_file_name[0] = '\0'; /* * Open the directory `path_name'. */ dir = opendir(path_name); if (dir == NULL) goto failed; for (;;) { /* * Read the directory entry. */ entry = readdir(dir); if (entry == NULL) break; /* * Compare the given file names and the current entry name. * We consider they are matched when one of the followings * is true: * * == * +";1' == * +"." == * +".;1" == * +".ebz" == * +".ebz;1" == * +".org" == * +".org;1" == * * All the comparisons are done without case sensitivity. * We support version number ";1" only. */ d_namlen = NAMLEN(entry); if (2 < d_namlen && *(entry->d_name + d_namlen - 2) == ';' && isdigit(*(entry->d_name + d_namlen - 1))) { d_namlen -= 2; } if (1 < d_namlen && *(entry->d_name + d_namlen - 1) == '.') d_namlen--; if (strcasecmp(entry->d_name, ebz_target_file_name) == 0 && *(ebz_target_file_name + d_namlen) == '\0' && found < FOUND_EBZ) { strcpy(candidate_file_name, entry->d_name); found = FOUND_EBZ; } if (strncasecmp(entry->d_name, target_file_name, d_namlen) == 0 && *(target_file_name + d_namlen) == '\0' && found < FOUND_BASENAME) { strcpy(candidate_file_name, entry->d_name); found = FOUND_BASENAME; } if (strcasecmp(entry->d_name, org_target_file_name) == 0 && *(org_target_file_name + d_namlen) == '\0' && found < FOUND_ORG) { strcpy(candidate_file_name, entry->d_name); found = FOUND_ORG; break; } } if (found == FOUND_NONE) goto failed; closedir(dir); strcpy(found_file_name, candidate_file_name); return EB_SUCCESS; /* * An error occurs... */ failed: if (dir != NULL) closedir(dir); return EB_ERR_BAD_FILE_NAME; } ssize_t eb_read_all(file, buffer, length) int file; char *buffer; size_t length; { char *buffer_p = buffer; ssize_t rest_length = length; ssize_t n; while (0 < rest_length) { errno = 0; n = read(file, buffer_p, (size_t)rest_length); if (n < 0) { if (errno == EINTR) continue; return -1; } else if (n == 0) break; else { rest_length -= n; buffer_p += n; } } return length - rest_length; } ebnetd-1.0.dfsg.1/ndtpd/0000755000175000017500000000000007773515157014344 5ustar mhattamhattaebnetd-1.0.dfsg.1/ndtpd/ndtp.h0000644000175000017500000000223007673055412015447 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef NDTP_H #define NDTP_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "defs.h" /* * Maximum length definitions for NDTP. */ #define NDTP_MAX_LINE_LENGTH 511 /* * Length of short buffer. */ #define NDTP_SHORT_BUFFER_LENGTH 15 /* * Maximum length of a tag. */ #define NDTP_MAX_TAG_LENGTH 31 /* * Function declarations. */ void set_common_hooks EBNETD_P((EB_Hookset *)); void set_bitmap_hooks EBNETD_P((EB_Hookset *)); void set_text_hooks EBNETD_P((EB_Hookset *)); #endif /* NDTP_H */ ebnetd-1.0.dfsg.1/ndtpd/Makefile.am0000644000175000017500000000347107737407214016377 0ustar mhattamhattapkglocalstatedir = $(localstatedir)/$(PACKAGE) logdir = @logdir@ LIBEBNETD = $(top_builddir)/lib/libebnetd.a sbin_PROGRAMS = ndtpd ndtpcheck ndtpcontrol libexec_SCRIPTS = ndtpstat ndtpd_SOURCES = book.c config.c global.c misc.c ndtpd.c \ ndtp.c hookset.c ndtpd_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ndtpd_DEPENDENCIES = $(LIBEBNETD) ndtpcheck_SOURCES = book.c config.c global.c misc.c ndtpcheck.c ndtpcheck_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ndtpcheck_DEPENDENCIES = $(LIBEBNETD) ndtpcontrol_SOURCES = book.c config.c global.c misc.c ndtpcontrol.c ndtpcontrol_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ndtpcontrol_DEPENDENCIES = $(LIBEBNETD) noinst_HEADERS = ndtp.h INCLUDES = -DUSE_FAKELOG -DNDTPD -I$(top_srcdir)/lib $(EBCONF_EBINCS) EXTRA_DIST = ndtpstat.in CLEANFILES = defs.h stamp-defs-h defs.h.tmp ndtpstat ndtpstat.tmp DISTCLEANFILES = book.c config.c defs.h.in global.c misc.c ndtpd.c \ ndtpcheck.c ndtpcontrol.c getopt_long.pl BUILT_SOURCES = defs.h defs.h: stamp-defs-h stamp-defs-h: defs.h.in Makefile rm -f defs.h.tmp echo '/* automatically generated from defs.h.in. */' \ > defs.h.tmp sed -e 's;\@sysconfdir\@;$(sysconfdir);' \ -e 's;\@pkglocalstatedir\@;$(pkglocalstatedir);' \ defs.h.in >> defs.h.tmp $(top_srcdir)/move-if-change defs.h.tmp defs.h @echo timestamp > stamp-defs-h ndtpstat: getopt_long.pl ndtpstat.in Makefile rm -f ndtpstat sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/ndtpstat.in | sed '/^$$/q' > ndtpstat.tmp cat getopt_long.pl >> ndtpstat.tmp sed -e 's;\@VERSION\@;$(VERSION);' \ -e 's;\@MAILING_ADDRESS\@;$(MAILING_ADDRESS);' \ $(srcdir)/ndtpstat.in | sed '1,/^$$/d' >> ndtpstat.tmp cp ndtpstat.tmp ndtpstat chmod +x ndtpstat rm -f ndtpstat.tmp ebnetd-1.0.dfsg.1/ndtpd/Makefile.in0000644000175000017500000004612207773515025016410 0ustar mhattamhatta# Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ # Copyright (C) 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. # 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. @SET_MAKE@ SOURCES = $(ndtpcheck_SOURCES) $(ndtpcontrol_SOURCES) $(ndtpd_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ sbin_PROGRAMS = ndtpd$(EXEEXT) ndtpcheck$(EXEEXT) ndtpcontrol$(EXEEXT) subdir = ndtpd DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/eb4.m4 \ $(top_srcdir)/m4/herrno.m4 $(top_srcdir)/m4/in6addr.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/sockaddrin6.m4 \ $(top_srcdir)/m4/sockinttypes.m4 $(top_srcdir)/m4/unionwait.m4 \ $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = book.c config.c defs.h.in ndtpcheck.c \ ndtpcontrol.c ndtpd.c global.c misc.c getopt_long.pl am__installdirs = $(DESTDIR)$(sbindir) $(DESTDIR)$(libexecdir) sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_ndtpcheck_OBJECTS = book.$(OBJEXT) config.$(OBJEXT) \ global.$(OBJEXT) misc.$(OBJEXT) ndtpcheck.$(OBJEXT) ndtpcheck_OBJECTS = $(am_ndtpcheck_OBJECTS) am__DEPENDENCIES_1 = $(top_builddir)/lib/libebnetd.a am__DEPENDENCIES_2 = am_ndtpcontrol_OBJECTS = book.$(OBJEXT) config.$(OBJEXT) \ global.$(OBJEXT) misc.$(OBJEXT) ndtpcontrol.$(OBJEXT) ndtpcontrol_OBJECTS = $(am_ndtpcontrol_OBJECTS) am_ndtpd_OBJECTS = book.$(OBJEXT) config.$(OBJEXT) global.$(OBJEXT) \ misc.$(OBJEXT) ndtpd.$(OBJEXT) ndtp.$(OBJEXT) \ hookset.$(OBJEXT) ndtpd_OBJECTS = $(am_ndtpd_OBJECTS) libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(libexec_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/book.Po ./$(DEPDIR)/config.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/global.Po ./$(DEPDIR)/hookset.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/misc.Po ./$(DEPDIR)/ndtp.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/ndtpcheck.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/ndtpcontrol.Po ./$(DEPDIR)/ndtpd.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(ndtpcheck_SOURCES) $(ndtpcontrol_SOURCES) $(ndtpd_SOURCES) DIST_SOURCES = $(ndtpcheck_SOURCES) $(ndtpcontrol_SOURCES) \ $(ndtpd_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS = @COMPRESS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ EBCONF_EBINCS = @EBCONF_EBINCS@ EBCONF_EBLIBS = @EBCONF_EBLIBS@ EBCONF_INTLINCS = @EBCONF_INTLINCS@ EBCONF_INTLLIBS = @EBCONF_INTLLIBS@ EBCONF_PTHREAD_CFLAGS = @EBCONF_PTHREAD_CFLAGS@ EBCONF_PTHREAD_CPPFLAGS = @EBCONF_PTHREAD_CPPFLAGS@ EBCONF_PTHREAD_LDFLAGS = @EBCONF_PTHREAD_LDFLAGS@ EBCONF_ZLIBINCS = @EBCONF_ZLIBINCS@ EBCONF_ZLIBLIBS = @EBCONF_ZLIBLIBS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GZIPCMD = @GZIPCMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAILING_ADDRESS = @MAILING_ADDRESS@ MAILX = @MAILX@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ pkglocalstatedir = $(localstatedir)/$(PACKAGE) LIBEBNETD = $(top_builddir)/lib/libebnetd.a libexec_SCRIPTS = ndtpstat ndtpd_SOURCES = book.c config.c global.c misc.c ndtpd.c \ ndtp.c hookset.c ndtpd_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ndtpd_DEPENDENCIES = $(LIBEBNETD) ndtpcheck_SOURCES = book.c config.c global.c misc.c ndtpcheck.c ndtpcheck_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ndtpcheck_DEPENDENCIES = $(LIBEBNETD) ndtpcontrol_SOURCES = book.c config.c global.c misc.c ndtpcontrol.c ndtpcontrol_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ndtpcontrol_DEPENDENCIES = $(LIBEBNETD) noinst_HEADERS = ndtp.h INCLUDES = -DUSE_FAKELOG -DNDTPD -I$(top_srcdir)/lib $(EBCONF_EBINCS) EXTRA_DIST = ndtpstat.in CLEANFILES = defs.h stamp-defs-h defs.h.tmp ndtpstat ndtpstat.tmp DISTCLEANFILES = book.c config.c defs.h.in global.c misc.c ndtpd.c \ ndtpcheck.c ndtpcontrol.c getopt_long.pl BUILT_SOURCES = defs.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ndtpd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu ndtpd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ rm -f $(DESTDIR)$(sbindir)/$$f; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done ndtpcheck$(EXEEXT): $(ndtpcheck_OBJECTS) $(ndtpcheck_DEPENDENCIES) @rm -f ndtpcheck$(EXEEXT) $(LINK) $(ndtpcheck_LDFLAGS) $(ndtpcheck_OBJECTS) $(ndtpcheck_LDADD) $(LIBS) ndtpcontrol$(EXEEXT): $(ndtpcontrol_OBJECTS) $(ndtpcontrol_DEPENDENCIES) @rm -f ndtpcontrol$(EXEEXT) $(LINK) $(ndtpcontrol_LDFLAGS) $(ndtpcontrol_OBJECTS) $(ndtpcontrol_LDADD) $(LIBS) ndtpd$(EXEEXT): $(ndtpd_OBJECTS) $(ndtpd_DEPENDENCIES) @rm -f ndtpd$(EXEEXT) $(LINK) $(ndtpd_LDFLAGS) $(ndtpd_OBJECTS) $(ndtpd_LDADD) $(LIBS) install-libexecSCRIPTS: $(libexec_SCRIPTS) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(libexecdir) @list='$(libexec_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(libexecSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(libexecdir)/$$f"; \ $(libexecSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(libexecdir)/$$f; \ else :; fi; \ done uninstall-libexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(libexec_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f $(DESTDIR)$(libexecdir)/$$f"; \ rm -f $(DESTDIR)$(libexecdir)/$$f; \ done mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/book.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hookset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ndtp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ndtpcheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ndtpcontrol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ndtpd.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: 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: TAGS 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 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"; \ $(mkdir_p) "$(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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(HEADERS) installdirs: $(mkdir_p) $(DESTDIR)$(sbindir) $(DESTDIR)$(libexecdir) install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-libexecSCRIPTS install-sbinPROGRAMS 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-libexecSCRIPTS \ uninstall-sbinPROGRAMS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libexecSCRIPTS install-man install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am uninstall-libexecSCRIPTS \ uninstall-sbinPROGRAMS defs.h: stamp-defs-h stamp-defs-h: defs.h.in Makefile rm -f defs.h.tmp echo '/* automatically generated from defs.h.in. */' \ > defs.h.tmp sed -e 's;\@sysconfdir\@;$(sysconfdir);' \ -e 's;\@pkglocalstatedir\@;$(pkglocalstatedir);' \ defs.h.in >> defs.h.tmp $(top_srcdir)/move-if-change defs.h.tmp defs.h @echo timestamp > stamp-defs-h ndtpstat: getopt_long.pl ndtpstat.in Makefile rm -f ndtpstat sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/ndtpstat.in | sed '/^$$/q' > ndtpstat.tmp cat getopt_long.pl >> ndtpstat.tmp sed -e 's;\@VERSION\@;$(VERSION);' \ -e 's;\@MAILING_ADDRESS\@;$(MAILING_ADDRESS);' \ $(srcdir)/ndtpstat.in | sed '1,/^$$/d' >> ndtpstat.tmp cp ndtpstat.tmp ndtpstat chmod +x ndtpstat rm -f ndtpstat.tmp # 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: ebnetd-1.0.dfsg.1/ndtpd/book.c0000644000175000017500000002143207673055357015444 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #if defined(NDTPD) || defined(EBHTTPD) #include #include #endif #if defined(EBNETD) #include "ebtiny/eb.h" #include "ebtiny/appendix.h" #endif #include "fakelog.h" #include "permission.h" #include "ticket.h" #include "wildcard.h" #include "defs.h" /* * Initialize the book list `book_registry'. */ void initialize_book_registry() { book_registry = NULL; book_count = 0; } /* * Clear the book list `book_registry'. * Free all nodes and allocated memories in `book_registry', * and then set it to NULL. */ void finalize_book_registry() { Book *book = book_registry; Book *next; /* * Reset books list. Free all malloced memories. */ while (book != NULL) { next = book->next; delete_book(book); book = next; } book_registry = NULL; book_count = 0; } /* * Count books in `book_registry'. */ int count_book_registry() { Book *book; int count; for (book = book_registry, count = 0; book != NULL; book = book->next, count++) ; return count; } /* * Bind all books and appendixes in `book_registry'. */ int activate_book_registry() { Book *book; EB_Error_Code error_code; int available_count = 0; char lock_file_name[PATH_MAX + 1]; /* * If there is no book in the registry, do nothing. */ if (book_registry == NULL) return 0; for (book = book_registry; book != NULL; book = book->next) { /* * Bind a book. */ error_code = eb_bind(&book->book, book->path); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "the book is not available, %s: %s", eb_error_message(error_code), book->path); delete_book(book); continue; } available_count++; /* * Initialize all subbooks when running as a standalone daemon. */ if (server_mode == SERVER_MODE_STANDALONE) eb_load_all_subbooks(&book->book); /* * Bind a ticket stock for the book. */ if (book->max_clients != 0) { sprintf(lock_file_name, "%s/%s.%s", work_path, book->name, BOOK_LOCK_SUFFIX); if (bind_ticket_stock(&book->ticket_stock, lock_file_name, book->max_clients) < 0) return -1; } if (book->appendix_path != NULL) { /* * Bind an appendix. */ error_code = eb_bind_appendix(&book->appendix, book->appendix_path); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "the appendix is not available, %s: %s", eb_error_message(error_code), book->appendix_path); continue; } /* * Initialize all subbooks when running as a standalone daemon. */ if (server_mode == SERVER_MODE_STANDALONE) eb_load_all_appendix_subbooks(&book->appendix); } } return available_count; } /* * Add a new book to `book_registry'. * Upon successful, a pointer to the added book is returned. * Otherwise NULL is returned. */ Book * add_book() { Book *new_book; Book *book; int i; new_book = (Book *)malloc(sizeof(Book)); if (new_book == NULL) { syslog(LOG_ERR, "memory exhausted"); return NULL; } /* * Set initial values to the new book. */ eb_initialize_book(&new_book->book); eb_initialize_appendix(&new_book->appendix); new_book->path = NULL; new_book->appendix_path = NULL; new_book->name[0] = '\0'; new_book->title[0] = '\0'; new_book->max_clients = DEFAULT_BOOK_MAX_CLIENTS; initialize_permission(&new_book->permissions); initialize_ticket_stock(&new_book->ticket_stock); new_book->next = NULL; if (book_count == 0) book_registry = new_book; else { book = book_registry; for (i = 1; i < book_count; i++) book = book->next; book->next = new_book; } book_count++; return new_book; } /* * Delete `target_book' from `book_registry'. * Return 0 upon success, -1 otherwise. */ int delete_book(target_book) Book *target_book; { Book *book; if (book_registry == target_book) book_registry = target_book->next; else { for (book = book_registry; book != NULL; book = book->next) { if (book->next == target_book) { book->next = target_book->next; break; } } if (book == NULL) return -1; } finalize_permission(&target_book->permissions); finalize_ticket_stock(&target_book->ticket_stock); eb_finalize_book(&target_book->book); eb_finalize_appendix(&target_book->appendix); if (target_book->path != NULL) free(target_book->path); if (target_book->appendix_path != NULL) free(target_book->appendix_path); free(target_book); return 0; } /* * Find the bound book with `name' in `book_regitry'. * * If found, the pointer to the book is returned. * Otherwise NULL is returned. */ Book * find_book(name) const char *name; { Book *book; /* * Find the bound book. */ for (book = book_registry; book != NULL; book = book->next) { if (strcasecmp(book->name, name) == 0) return book; } return NULL; } /* * Search `book' for the subbook whose directory name is * `directory'. * If found, the subbook-code of the subbook is returned. * Otherwise, -1 is returned. */ EB_Subbook_Code find_subbook(book, directory) Book *book; const char *directory; { EB_Error_Code error_code; EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS]; char directory2[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; int subbook_count; int i; /* * Find the subbook in the current book. */ error_code = eb_subbook_list(&book->book, subbook_list, &subbook_count); if (error_code != EB_SUCCESS) return EB_SUBBOOK_INVALID; for (i = 0; i < subbook_count; i++) { error_code = eb_subbook_directory2(&book->book, subbook_list[i], directory2); if (error_code != EB_SUCCESS) continue; if (strcasecmp(directory, directory2) == 0) return subbook_list[i]; } return EB_SUBBOOK_INVALID; } /* * Search `book' for the subbook whose directory name of an appendix * is `directory'. * If found, the subbook-code of the subbook is returned. * Otherwise, -1 is returned. */ EB_Subbook_Code find_appendix_subbook(book, directory) Book *book; const char *directory; { EB_Error_Code error_code; EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS]; char directory2[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; int subbook_count; int i; /* * Find the subbook in the current appendix. */ error_code = eb_appendix_subbook_list(&book->appendix, subbook_list, &subbook_count); if (error_code != EB_SUCCESS) return EB_SUBBOOK_INVALID; for (i = 0; i < subbook_count; i++) { error_code = eb_appendix_subbook_directory2(&book->appendix, subbook_list[i], directory2); if (error_code != EB_SUCCESS) continue; if (strcasecmp(directory, directory2) == 0) return subbook_list[i]; } return EB_SUBBOOK_INVALID; } /* * For the current client, * check permission flags to the books in `book_registry'. */ void check_book_permissions() { Book *book; for (book = book_registry; book != NULL; book = book->next) { book->permission_flag = test_permission(&book->permissions, client_host_name, client_address, match_wildcard); } } /* * For the current client, * set permission flags to all books in `book_registry'. */ void set_all_book_permissions() { Book *book; for (book = book_registry; book != NULL; book = book->next) book->permission_flag = 1; } ebnetd-1.0.dfsg.1/ndtpd/config.c0000644000175000017500000005243307673055355015762 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #if defined(NDTPD) || defined(EBHTTPD) #include #include #endif #if defined(EBNETD) #include "ebtiny/eb.h" #include "ebtiny/appendix.h" #endif #include "confutil.h" #include "fakelog.h" #include "filename.h" #include "hostname.h" #include "readconf.h" #include "permission.h" #include "defs.h" /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) /* * Unexported functions. */ static int cf_begin EBNETD_P((const char *, const char *, int)); static int cf_end EBNETD_P((const char *, const char *, int)); static int cf_ebnet_port EBNETD_P((const char *, const char *, int)); static int cf_ndtp_port EBNETD_P((const char *, const char *, int)); static int cf_http_port EBNETD_P((const char *, const char *, int)); static int cf_user EBNETD_P((const char *, const char *, int)); static int cf_group EBNETD_P((const char *, const char *, int)); static int cf_max_clients EBNETD_P((const char *, const char *, int)); static int cf_hosts EBNETD_P((const char *, const char *, int)); static int cf_timeout EBNETD_P((const char *, const char *, int)); static int cf_work_path EBNETD_P((const char *, const char *, int)); static int cf_max_hits EBNETD_P((const char *, const char *, int)); static int cf_max_text_size EBNETD_P((const char *, const char *, int)); static int cf_syslog_facility EBNETD_P((const char *, const char *, int)); static int cf_begin_book EBNETD_P((const char *, const char *, int)); static int cf_end_book EBNETD_P((const char *, const char *, int)); static int cf_book_name EBNETD_P((const char *, const char *, int)); static int cf_book_title EBNETD_P((const char *, const char *, int)); static int cf_book_path EBNETD_P((const char *, const char *, int)); static int cf_appendix_path EBNETD_P((const char *, const char *, int)); static int cf_book_max_clients EBNETD_P((const char *, const char *, int)); static int cf_book_hosts EBNETD_P((const char *, const char *, int)); /* * Syntax of the configuration file. */ Configuration configuration_table[] = { {"", "begin", cf_begin, READCONF_ZERO_OR_ONCE, 0}, {"", "end", cf_end, READCONF_ZERO_OR_ONCE, 0}, /* single directives. */ {"", "ebnet-port", cf_ebnet_port, READCONF_ZERO_OR_ONCE, 0}, {"", "ndtp-port", cf_ndtp_port, READCONF_ZERO_OR_ONCE, 0}, {"", "http-port", cf_http_port, READCONF_ZERO_OR_ONCE, 0}, {"", "user", cf_user, READCONF_ZERO_OR_ONCE, 0}, {"", "group", cf_group, READCONF_ZERO_OR_ONCE, 0}, {"", "max-clients", cf_max_clients, READCONF_ZERO_OR_ONCE, 0}, {"", "hosts", cf_hosts, READCONF_ZERO_OR_MORE, 0}, {"", "timeout", cf_timeout, READCONF_ZERO_OR_ONCE, 0}, {"", "work-path", cf_work_path, READCONF_ZERO_OR_ONCE, 0}, {"", "max-hits", cf_max_hits, READCONF_ZERO_OR_ONCE, 0}, {"", "max-text-size", cf_max_text_size, READCONF_ZERO_OR_ONCE, 0}, {"", "syslog-facility", cf_syslog_facility, READCONF_ZERO_OR_ONCE, 0}, /* book group directive. */ {"", "begin book", cf_begin_book, READCONF_ZERO_OR_MORE, 0}, {"book", "name", cf_book_name, READCONF_ONCE, 0}, {"book", "title", cf_book_title, READCONF_ONCE, 0}, {"book", "path", cf_book_path, READCONF_ONCE, 0}, {"book", "appendix-path", cf_appendix_path, READCONF_ZERO_OR_ONCE, 0}, {"book", "max-clients", cf_book_max_clients, READCONF_ZERO_OR_ONCE, 0}, {"book", "hosts", cf_book_hosts, READCONF_ZERO_OR_MORE, 0}, {"", "end book", cf_end_book, READCONF_ZERO_OR_MORE, 0}, {"", NULL, NULL, READCONF_ONCE, 0} }; /* * The current configuring book. */ static Book *cf_book; /* * The hook is called before reading a configuration file. */ static int cf_begin(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * The length of the file_name "/" * must not exceed PATH_MAX. */ if (PATH_MAX < strlen(DEFAULT_WORK_PATH) + 1 + MAX_WORK_PATH_BASE_NAME_LENGTH) { syslog(LOG_ERR, "internal error, too long DEFAULT_WORK_PATH"); return -1; } strcpy(work_path, DEFAULT_WORK_PATH); /* * Debugging information. */ syslog(LOG_DEBUG, "%s: debug: beginning of the configuration", file_name); return 0; } /* * The hook is called just after reading a configuration file. */ static int cf_end(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * If the configuration file has no `hosts' directive, and if * the mode is SERVER_MODE_CHECK, then output a warning message. */ if (server_mode == SERVER_MODE_CHECK && count_permission(&permissions) == 0) { syslog(LOG_ERR, "warning: nobody can connect to the server \ because the configuration file has no `hosts' directive"); } /* * If the configuration file has no `book' group directive, and if * the mode is SERVER_MODE_CHECK, then output a warning message. */ if (server_mode == SERVER_MODE_CHECK && count_book_registry() == 0) syslog(LOG_ERR, "warning: no book definition"); /* * Set the pid file_name. */ sprintf(pid_file_name, "%s/%s", work_path, PID_BASE_NAME); if (canonicalize_file_name(pid_file_name) < 0) return -1; /* * Set the connection lock file_name. */ sprintf(connection_lock_file_name, "%s/%s", work_path, LOCK_BASE_NAME); /* * debugging information. */ syslog(LOG_DEBUG, "%s: debug: end of the configuration", file_name); return 0; } /* * `ebnet-port' directive. */ static int cf_ebnet_port(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { in_port_t port; /* * Parse the port number. */ if (parse_tcp_port(argument, &port) < 0) { syslog(LOG_ERR, "%s:%d: unknown service: %s", file_name, line_number, argument); return -1; } /* * Set the port number, if this is EBNETD. */ #ifdef EBNETD listening_port = port; #endif /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set ebnet-port: %d", file_name, line_number, (int)port); return 0; } /* * `ndtp-port' directive. */ static int cf_ndtp_port(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { in_port_t port; /* * Parse the port number. */ if (parse_tcp_port(argument, &port) < 0) { syslog(LOG_ERR, "%s:%d: unknown service: %s", file_name, line_number, argument); return -1; } /* * Set the port number, if this is NDTPD. */ #ifdef NDTPD listening_port = port; #endif /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set ndtp-port: %d", file_name, line_number, (int)port); return 0; } /* * `http-port' directive. */ static int cf_http_port(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { in_port_t port; /* * Parse the port number. */ if (parse_tcp_port(argument, &port) < 0) { syslog(LOG_ERR, "%s:%d: unknown service: %s", file_name, line_number, argument); return -1; } /* * Set the port number, if this is ebHTTPD. */ #ifdef EBHTTPD listening_port = port; #endif /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set http-port: %d", file_name, line_number, (int)port); return 0; } /* * `user' directive. */ static int cf_user(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the user ID. */ if (parse_user(argument, &user_id) < 0) { syslog(LOG_ERR, "%s:%d: unknown user: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set user: %d", file_name, line_number, (int)user_id); return 0; } /* * `group' directive. */ static int cf_group(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the group ID. */ if (parse_group(argument, &group_id) < 0) { syslog(LOG_ERR, "%s:%d: unknown group: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set group: %d", file_name, line_number, (int)group_id); return 0; } /* * `max-clients' directive. */ static int cf_max_clients(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the max-clients. */ if (parse_integer(argument, &max_clients) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set max-clients: %d", file_name, line_number, max_clients); return 0; } /* * `hosts' directive. */ static int cf_hosts(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Add `argument' to the host permission list. */ if (add_permission(&permissions, argument) < 0) { syslog(LOG_ERR, "%s:%d: invalid host, IP address or IP prefix: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: add hosts: %s", file_name, line_number, argument); return 0; } /* * `timeout' directive. */ static int cf_timeout(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the timeout. */ if (parse_integer(argument, &idle_timeout) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set timeout: %d", file_name, line_number, idle_timeout); return 0; } /* * `work-path' directive. */ static int cf_work_path(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Check for the length of the path. * The length of `/' must not exceed PATH_MAX. */ if (PATH_MAX < strlen(argument) + 1 + MAX_WORK_PATH_BASE_NAME_LENGTH) { syslog(LOG_ERR, "%s:%d: too long path", file_name, line_number); return -1; } /* * The file_name must be an absolute path. */ if (*argument != '/') { syslog(LOG_ERR, "%s:%d: not an absolute path: %s", file_name, line_number, argument); return -1; } /* * Set the working directory path. */ strcpy(work_path, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set work-path: %s", file_name, line_number, work_path); return 0; } /* * `max-hits' directive. */ static int cf_max_hits(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the max hits. */ if (parse_integer(argument, &max_hits) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set max-hits: %d", file_name, line_number, max_hits); return 0; } /* * `max-text-size' directive. */ static int cf_max_text_size(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { int size; /* * Parse and set the max text size. */ if (parse_integer(argument, &size) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } max_text_size = size; /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set max-text-size: %d", file_name, line_number, max_text_size); return 0; } /* * `syslog-facility' directive. */ static int cf_syslog_facility(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set a syslog facility. */ if (parse_syslog_facility(argument, &syslog_facility) < 0) { syslog(LOG_ERR, "%s:%d: unknown syslog facility: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set syslog-facility: %s", file_name, line_number, argument); return 0; } /* * `begin book' sequence. */ static int cf_begin_book(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Create a new book node. */ cf_book = add_book(); if (cf_book == NULL) { syslog(LOG_ERR, "%s:%d: memory exhausted", file_name, line_number); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: beginning of the book definition", file_name, line_number); return 0; } /* * `end book' sequence. */ static int cf_end_book(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * If the group directive has no `hosts' sub-directive, and if * the mode is SERVER_MODE_CHECK, then output a warning message. */ if (server_mode == SERVER_MODE_CHECK && count_permission(&cf_book->permissions) == 0) { syslog(LOG_ERR, "%s:%d: warning: nobody can access the book \ because the book definition has no `hosts' sub-directive", file_name, line_number); } /* * Set `max-clients' for the book to 0 when test mode. */ if (server_mode == SERVER_MODE_TEST) { cf_book->max_clients = 0; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: end of the book definition", file_name, line_number); return 0; } /* * `name' directive (in book structure). */ static int cf_book_name(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { const char *p; /* * Check for the length of the book name. */ if (MAX_BOOK_NAME_LENGTH < strlen(argument)) { syslog(LOG_ERR, "%s:%d: too long book name", file_name, line_number); return -1; } /* * The tagname must consist of upper letters, digit, '_', and '-'. */ for (p = argument; *p != '\0'; p++) { if (!islower(*p) && !isdigit(*p) && *p != '_' && *p != '-') { syslog(LOG_ERR, "%s:%d: the book name contains invalid character: %s", file_name, line_number, argument); return -1; } } /* * Check for uniqness of book names. */ if (find_book(argument) != NULL) { syslog(LOG_ERR, "%s:%d: the book name redefined: %s", file_name, line_number, argument); return -1; } /* * Set the book name. */ strcpy(cf_book->name, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-name: %s", file_name, line_number, cf_book->name); return 0; } /* * `title' directive (in book structure). */ static int cf_book_title(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Check for the length of the title. */ if (MAX_BOOK_TITLE_LENGTH < strlen(argument)) { syslog(LOG_ERR, "%s:%d: too long book title", file_name, line_number); return -1; } /* * Set the title. */ strcpy(cf_book->title, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-title: %s", file_name, line_number, cf_book->title); return 0; } /* * `path' directive (in book structure). */ static int cf_book_path(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { size_t argument_length; /* * Check for the length of the path. */ argument_length = strlen(argument); if (PATH_MAX < argument_length) { syslog(LOG_ERR, "%s:%d: too long path", file_name, line_number); return -1; } /* * The path must be an absolute path. */ if (*argument != '/') { syslog(LOG_ERR, "%s:%d: not an absolute path: %s", file_name, line_number, argument); return -1; } /* * Set the book path. */ cf_book->path = (char *)malloc(argument_length + 1); if (cf_book->path == NULL) { syslog(LOG_ERR, "%s:%d: memory exhausted", file_name, line_number); return -1; } strcpy(cf_book->path, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-path: %s", file_name, line_number, argument); return 0; } /* * `appendix-path' directive. */ static int cf_appendix_path(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { size_t argument_length; /* * Check for the length of the path. */ argument_length = strlen(argument); if (PATH_MAX < argument_length) { syslog(LOG_ERR, "%s:%d: too long appendix path", file_name); return -1; } /* * The path must be an absolute path. */ if (*argument != '/') { syslog(LOG_ERR, "%s:%d: not an absolute path: %s", file_name, line_number, argument); return -1; } /* * Set the book path. */ cf_book->appendix_path = (char *)malloc(argument_length + 1); if (cf_book->appendix_path == NULL) { syslog(LOG_ERR, "%s:%d: memory exhausted", file_name, line_number); return -1; } strcpy(cf_book->appendix_path, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set appendix-path: %s", file_name, line_number, argument); return 0; } /* * `max-clients' directive (in book structure). */ static int cf_book_max_clients(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * An argumentument represents a remote host name or address. */ if (parse_integer(argument, &cf_book->max_clients) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-max-clients: %d", file_name, line_number, cf_book->max_clients); return 0; } /* * `hosts' directive (in book structure). */ static int cf_book_hosts(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Add `argument' to the permission list. */ if (add_permission(&cf_book->permissions, argument) < 0) { syslog(LOG_ERR, "%s:%d: invalid host, IP address or IP prefix: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: add book-hosts: %s", file_name, line_number, argument); return 0; } ebnetd-1.0.dfsg.1/ndtpd/global.c0000644000175000017500000001030707673055353015745 0ustar mhattamhatta/* * Copyright (c) 1997, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef TIME_WITH_SYS_TIME #include #include #else /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ #if defined(NDTPD) || defined(EBHTTPD) #include #endif #if defined(EBNETD) #include "ebtiny/eb.h" #endif #include "confutil.h" #include "hostname.h" #include "linebuf.h" #include "permission.h" #include "defs.h" /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ /* * Actual program name (argv[0]). */ const char *invoked_name; /* * Generic name of the program. */ const char *program_name; /* * Program version. */ const char *program_version; /* * Path to a working directory. */ char work_path[PATH_MAX + 1]; /* * Configuration file name. */ char configuration_file_name[PATH_MAX + 1]; /* * Port number the server listens to. */ in_port_t listening_port; in_port_t old_listening_port; /* * File descriptors for the server to listen to the port. */ fd_set listening_files; int max_listening_file; /* * File descriptor to communicate with a client. */ int accepted_in_file; int accepted_out_file; /* * User ID of the server process. */ uid_t user_id; /* * Group ID of the server process. */ gid_t group_id; /* * Filename to log the process ID of the server. */ char pid_file_name[PATH_MAX + 1]; char old_pid_file_name[PATH_MAX + 1]; /* * Lock file_name and ticket stock to count connections to the server. */ char connection_lock_file_name[PATH_MAX + 1]; Ticket_Stock connection_ticket_stock; /* * The maximum number of connections to the server at once. */ int max_clients; /* * The number of the current connections. */ int connection_count; /* * Seconds the server closes an idle connection. */ int idle_timeout; /* * Host permission list. */ Permission permissions; /* * Book registry. */ Book *book_registry; int book_count; /* * The number of hit entries the server give up searching. */ int max_hits; /* * The maximum size of text the server may send as a response to a client. */ size_t max_text_size; /* * Hostname of the client. */ char client_host_name[MAX_HOST_NAME_LENGTH + 1]; /* * Address of the client. */ char client_address[MAX_HOST_NAME_LENGTH + 1]; /* * Running mode of the server. * (standalone, inetd, test, check or control) */ int server_mode; /* * Syslog facility. */ int syslog_facility; /* * Client sockaddr */ #if defined(ENABLE_IPV6) struct sockaddr_storage client_sockaddr; #else struct sockaddr_in client_sockaddr; #endif /* * Initialize global variables. */ int initialize_global_variables() { initialize_permission(&permissions); initialize_ticket_stock(&connection_ticket_stock); initialize_book_registry(); user_id = getuid(); group_id = getgid(); max_clients = DEFAULT_MAX_CLIENTS; idle_timeout = DEFAULT_IDLE_TIMEOUT; max_hits = DEFAULT_MAX_HITS; max_text_size = DEFAULT_MAX_TEXT_SIZE; if (parse_tcp_port(SERVICE_NAME, &listening_port) < 0) listening_port = DEFAULT_PORT; return 0; } /* * Finalize global variables. */ void finalize_global_variables() { finalize_permission(&permissions); finalize_ticket_stock(&connection_ticket_stock); finalize_book_registry(); } ebnetd-1.0.dfsg.1/ndtpd/misc.c0000644000175000017500000000212607673055357015444 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01, 02 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "defs.h" /* * Output the version number to standard out. */ void output_version() { printf("%s (EBNETD) version %s\n", program_name, program_version); printf("Copyright (c) 1997 - 2003\n"); printf(" Motoyuki Kasahara\n"); fflush(stdout); } /* * Output ``try ...'' message to standard error. */ void output_try_help() { fprintf(stderr, "try `%s --help' for more information\n", invoked_name); fflush(stderr); } ebnetd-1.0.dfsg.1/ndtpd/ndtpcheck.c0000644000175000017500000001257707673055354016464 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #include "fakelog.h" #include "getopt.h" #include "hostname.h" #include "permission.h" #include "readconf.h" #include "wildcard.h" #include "defs.h" /* * Unexported functions. */ static void output_help EBNETD_P((void)); /* * Command line options. */ static const char *short_options = "c:dhv"; static struct option long_options[] = { {"configuration-file", required_argument, NULL, 'c'}, {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {"verbose", no_argument, NULL, 'd'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; int main(argc, argv) int argc; char *argv[]; { EB_Error_Code error_code; int ch; /* * We must output US-ASCII syslog messages. */ #ifdef HAVE_SETLOCALE setlocale(LC_ALL, "C"); #endif /* * Set program name and version. */ invoked_name = argv[0]; program_name = CHECK_PROGRAM_NAME; program_version = VERSION; /* * Initialize EB Library. */ error_code = eb_initialize_library(); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "%s\n", eb_error_message(error_code)); exit(1); } /* * Initialize global and static variables. */ server_mode = SERVER_MODE_CHECK; initialize_global_variables(); if (PATH_MAX < strlen(DEFAULT_CONFIGURATION_FILE_NAME)) { fprintf(stderr, "%s: internal error, too long DEFAULT_CONFIGURATION_FILE_NAME\n", invoked_name); exit(1); } strcpy(configuration_file_name, DEFAULT_CONFIGURATION_FILE_NAME); /* * Set fakelog behavior. */ set_fakelog_name(invoked_name); set_fakelog_mode(FAKELOG_TO_STDERR); set_fakelog_level(LOG_ERR); /* * Parse command line options. */ for (;;) { ch = getopt_long(argc, argv, short_options, long_options, NULL); if (ch == -1) break; switch (ch) { case 'c': /* * Option `-c file'. Specify a configuration file name. */ if (PATH_MAX < strlen(optarg)) { fprintf(stderr, "%s: too long configuration file_name\n", invoked_name); fflush(stderr); exit(1); } strcpy(configuration_file_name, optarg); break; case 'd': /* * Option `-d'. Debug mode. */ set_fakelog_level(LOG_DEBUG); break; case 'h': /* * Option `-h'. Help. */ output_help(); exit(0); case 'v': /* * Option `-v'. Show the version number. */ output_version(); exit(0); default: output_try_help(); exit(1); } } /* * Check for the number of rest arguments. */ if (0 < argc - optind) { fprintf(stderr, "%s: too many arguments\n", invoked_name); output_try_help(); exit(1); } /* * Read the configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { fprintf(stderr, "%s: configuration failure\n", invoked_name); fflush(stderr); exit(1); } /* * Finalize global and static variables. */ finalize_global_variables(); /* * Finalize EB Library. */ eb_finalize_library(); return 0; } /* * Output the usage to standard out. */ static void output_help() { printf("Usage: %s [option...]\n", program_name); printf("Options:\n"); printf(" -c FILE --configuration-file FILE\n"); printf(" specify a configuration file\n"); printf(" (default: %s)\n", DEFAULT_CONFIGURATION_FILE_NAME); printf(" -d --debug --verbose degug mode\n"); printf(" -h --help display this help, then exit\n"); printf(" -v --version display version number, then exit\n"); printf("\nDefault value used in a configuration file:\n"); printf(" work-path %s\n", DEFAULT_WORK_PATH); printf("\nReport bugs to %s.\n", MAILING_ADDRESS); fflush(stdout); } ebnetd-1.0.dfsg.1/ndtpd/ndtpcontrol.c0000644000175000017500000002133307673055355017056 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ #ifndef HAVE_STRERROR #ifdef __STDC__ char *strerror(int); #else /* not __STDC__ */ char *strerror(); #endif /* not __STDC__ */ #endif /* HAVE_STRERROR */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #include "fakelog.h" #include "getopt.h" #include "hostname.h" #include "logpid.h" #include "permission.h" #include "readconf.h" #include "wildcard.h" #include "defs.h" /* * Unexported functions. */ static void output_help EBNETD_P((void)); /* * Command line options. */ static const char *short_options = "c:hv"; static struct option long_options[] = { {"configuration-file", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /* * Sub-commands. */ #define SUB_COMMAND_STATUS 0 #define SUB_COMMAND_RESTART 1 #define SUB_COMMAND_TERMINATE 2 #define SUB_COMMAND_KILL 3 typedef struct { const char *name; int id; int signal; } Sub_Command; static const Sub_Command command_table[] = { {"status", SUB_COMMAND_STATUS, -1}, {"restart", SUB_COMMAND_RESTART, SIGHUP}, {"terminate", SUB_COMMAND_TERMINATE, SIGTERM}, {"kill", SUB_COMMAND_KILL, SIGKILL}, {NULL, 0} }; /* * Unexported functions. */ #ifdef __STDC__ static const Sub_Command *get_sub_command(const char *); #else static const Sub_Command *get_sub_command(); #endif int main(argc, argv) int argc; char *argv[]; { EB_Error_Code error_code; const Sub_Command *command; pid_t pid; int ch; /* * We must output US-ASCII syslog messages. */ #ifdef HAVE_SETLOCALE setlocale(LC_ALL, "C"); #endif /* * Set program name and version. */ invoked_name = argv[0]; program_name = CONTROL_PROGRAM_NAME; program_version = VERSION; /* * Initialize EB Library. */ error_code = eb_initialize_library(); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "%s\n", eb_error_message(error_code)); exit(1); } /* * Initialize global and static variables. */ server_mode = SERVER_MODE_CONTROL; initialize_global_variables(); if (PATH_MAX < strlen(DEFAULT_CONFIGURATION_FILE_NAME)) { fprintf(stderr, "%s: internal error, too long DEFAULT_CONFIGURATION_FILE_NAME\n", invoked_name); exit(1); } strcpy(configuration_file_name, DEFAULT_CONFIGURATION_FILE_NAME); /* * Set fakelog behavior. */ set_fakelog_name(invoked_name); set_fakelog_mode(FAKELOG_TO_STDERR); set_fakelog_level(LOG_ERR); /* * Parse command line options. */ for (;;) { ch = getopt_long(argc, argv, short_options, long_options, NULL); if (ch == -1) break; switch (ch) { case 'c': /* * Option `-c file'. Specify a configuration file_name. */ if (PATH_MAX < strlen(optarg)) { fprintf(stderr, "%s: too long configuration file_name\n", invoked_name); fflush(stderr); exit(1); } strcpy(configuration_file_name, optarg); break; case 'h': /* * Option `-h'. Help. */ output_help(); exit(0); case 'v': /* * Option `-v'. Show the version number. */ output_version(); exit(0); default: output_try_help(); exit(1); } } /* * Check for the number of rest arguments. */ if (argc - optind == 0) { fprintf(stderr, "%s: too few argument\n", invoked_name); output_try_help(); exit(1); } if (1 < argc - optind) { fprintf(stderr, "%s: too many arguments\n", invoked_name); output_try_help(); exit(1); } /* * Check for sub-command. */ command = get_sub_command(argv[optind]); if (command == NULL) { output_try_help(); exit(1); } /* * Read the configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { fprintf(stderr, "%s: configuration failure\n", invoked_name); fflush(stderr); exit(1); } /* * Read PID from the pid-file. */ if (probe_pid_file(pid_file_name) < 0) { fprintf(stderr, "%s: PID file not found: %s\n", invoked_name, pid_file_name); fprintf(stderr, "%s: server not running\n", invoked_name); fflush(stderr); exit(1); } if (read_pid_file(pid_file_name, &pid) < 0) exit(1); /* * When sub-command is `status', output a message and exit. */ if (command->id == SUB_COMMAND_STATUS) { fprintf(stderr, "%s: PID file found: %s\n", invoked_name, pid_file_name); fprintf(stderr, "%s: ndtpd is running (PID = %u)\n", invoked_name, (unsigned)pid); fflush(stderr); exit(0); } /* * Send a signal to the running `ndtpd'. */ if (kill(pid, command->signal) < 0) { fprintf(stderr, "%s: %s\n", invoked_name, strerror(errno)); fflush(stderr); exit(1); } /* * When ndtpd is killed (send SIGKILL), ndtpd failed to remove * the pid file ndtpd. The command try to remove it. */ if (command->id == SUB_COMMAND_KILL) { if (remove_pid_file(pid_file_name) < 0) exit(1); } /* * Finalize global and static variables. */ finalize_global_variables(); /* * Finalize EB Library. */ eb_finalize_library(); return 0; } /* * Parse sub-command. */ static const Sub_Command * get_sub_command(name) const char *name; { size_t name_length; const Sub_Command *command; const Sub_Command *candidate = NULL; int matches; name_length = strlen(name); matches = 0; for (command = command_table; command->name != NULL; command++) { if (strcasecmp(name, command->name) == 0) return command; else if (strncasecmp(name, command->name, name_length) == 0) { candidate = command; matches++; } } if (matches == 0) { fprintf(stderr, "%s: unknown command `%s'\n", invoked_name, name); fflush(stderr); return NULL; } else if (1 < matches) { fprintf(stderr, "%s: command `%s' is ambigous\n", invoked_name, name); fflush(stderr); return NULL; } return candidate; } /* * Output the usage to standard out. */ static void output_help() { printf("Usage: %s [option...] sub-command\n", program_name); printf("Options:\n"); printf(" -c FILE --configuration-file FILE\n"); printf(" specify a configuration file\n"); printf(" (default: %s)\n", DEFAULT_CONFIGURATION_FILE_NAME); printf(" -h --help display this help, then exit\n"); printf(" -v --version display version number, then exit\n"); printf("\nSub-commands:\n"); printf(" kill kill ndtpd (send SIGKILL)\n"); printf(" restart restart ndtpd (send SIGHUP)\n"); printf(" status output status of ndtpd\n"); printf(" terminate terminate ndtpd (send SIGTERM)\n"); printf("\nDefault value used in a configuration file:\n"); printf(" work-path %s\n", DEFAULT_WORK_PATH); printf("\nReport bugs to %s.\n", MAILING_ADDRESS); fflush(stdout); } ebnetd-1.0.dfsg.1/ndtpd/ndtpd.c0000644000175000017500000006434607673055354015633 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01, 02 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #if defined(HAVE_SYS_WAIT_H) || defined(HAVE_UNION_WAIT) #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_GETCWD #define getcwd(d,n) getwd(d) #endif #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #ifdef HAVE_UNION_WAIT #ifndef WTERMSIG #define WTERMSIG(x) ((x).w_termsig) #endif #ifndef WCOREDUMP #define WCOREDUMP(x) ((x).w_coredump) #endif #ifndef WEXITSTATUS #define WEXITSTATUS(x) ((x).w_retcode) #endif #ifndef WIFSIGNALED #define WIFSIGNALED(x) (WTERMSIG(x) != 0) #endif #ifndef WIFEXITED #define WIFEXITED(x) (WTERMSIG(x) == 0) #endif #else /* not HAVE_UNION_WAIT */ #ifndef WTERMSIG #define WTERMSIG(x) ((x) & 0x7f) #endif #ifndef WCOREDUMP #define WCOREDUMP(x) ((x) & 0x80) #endif #ifndef WEXITSTATUS #define WEXITSTATUS(x) (((x) >> 8) & 0xff) #endif #ifndef WIFSIGNALED #define WIFSIGNALED(x) (WTERMSIG (x) != 0) #endif #ifndef WIFEXITED #define WIFEXITED(x) (WTERMSIG (x) == 0) #endif #endif /* not HAVE_UNION_WAIT */ #ifndef SHUT_RD #define SHUT_RD 0 #endif #ifndef SHUT_WR #define SHUT_WR 1 #endif #ifndef SHUT_RDWR #define SHUT_RDWR 2 #endif #include "confutil.h" #include "daemon.h" #include "fakelog.h" #include "fdset.h" #include "filename.h" #include "getopt.h" #include "hostname.h" #include "linebuf.h" #include "logpid.h" #include "openmax.h" #include "permission.h" #include "privilege.h" #include "serverport.h" #include "signame.h" #include "ticket.h" #include "wildcard.h" #include "defs.h" /* * Unexported functions. */ static void standalone_main EBNETD_P((void)); static void inetd_main EBNETD_P((void)); static void test_main EBNETD_P((void)); static void output_help EBNETD_P((void)); static void set_signal_handler EBNETD_P((int, RETSIGTYPE (*)(int))); static void block_signal EBNETD_P((int)); static void unblock_signal EBNETD_P((int)); static RETSIGTYPE abort_parent EBNETD_P((int)); static RETSIGTYPE abort_child EBNETD_P((int)); static RETSIGTYPE terminate_parent EBNETD_P((int)); static RETSIGTYPE terminate_child EBNETD_P((int)); static RETSIGTYPE restart_parent EBNETD_P((int)); static RETSIGTYPE wait_child EBNETD_P((int)); /* * Command line options. */ static const char *short_options = "c:hitv"; static struct option long_options[] = { {"configuration-file", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"inetd", no_argument, NULL, 'i'}, {"test", no_argument, NULL, 't'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /* * The flag is set when the server is started. */ static int once_started; /* * The flag is set if SIGHUP is received. */ static int restart_trigger; /* * Process group ID of the server. */ pid_t process_group_id; /* * Signal mask. */ #if !defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSETMASK) static int signal_mask = 0; #endif int main(argc, argv) int argc; char *argv[]; { EB_Error_Code error_code; int ch; /* * We must output US-ASCII syslog messages. */ #ifdef HAVE_SETENV setenv("LC_ALL", "C", 1); setenv("LANGUAGE", "C", 1); #else putenv("LC_ALL=C"); putenv("LANGUAGE=C"); #endif #ifdef HAVE_SETLOCALE setlocale(LC_ALL, "C"); #endif /* * Set program name and version. */ invoked_name = argv[0]; program_name = SERVER_PROGRAM_NAME; program_version = VERSION; /* * Set umask. */ umask(SERVER_UMASK); /* * Set fakelog behavior. */ set_fakelog_name(invoked_name); set_fakelog_mode(FAKELOG_TO_SYSLOG); set_fakelog_level(LOG_DEBUG); /* * Open syslog. * If LOG_DAEMON is not defined, it assumes old style syslog * It doesn't have facility. */ syslog_facility = DEFAULT_SYSLOG_FACILITY; #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif syslog(LOG_DEBUG, "debug: open syslog"); /* * Initialize EB Library. */ error_code = eb_initialize_library(); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "%s\n", eb_error_message(error_code)); exit(1); } /* * Initialize variables. */ once_started = 0; initialize_fdset(&listening_files, &max_listening_file); server_mode = SERVER_MODE_STANDALONE; if (PATH_MAX < strlen(DEFAULT_CONFIGURATION_FILE_NAME)) { syslog(LOG_ERR, "internal error, too long DEFAULT_CONFIGURATION_FILE_NAME"); goto die; } strcpy(configuration_file_name, DEFAULT_CONFIGURATION_FILE_NAME); initialize_global_variables(); /* * Parse command line options. */ for (;;) { ch = getopt_long(argc, argv, short_options, long_options, NULL); if (ch == -1) break; switch (ch) { case 'c': /* * Option `-c file'. Specify the configuration file name. */ if (PATH_MAX < strlen(optarg)) { fprintf(stderr, "%s: too long configuration file name\n", invoked_name); goto die; } strcpy(configuration_file_name, optarg); if (canonicalize_file_name(configuration_file_name) < 0) goto die; break; case 'h': /* * Option `-h'. Help. */ output_help(); exit(0); case 'i': /* * Option `-i'. Inetd mode. */ server_mode = SERVER_MODE_INETD; break; case 't': /* * Option `-t'. Test mode. */ server_mode = SERVER_MODE_TEST; break; case 'v': /* * Option `-v'. Show version and exit immediately. */ output_version(); exit(0); default: output_try_help(); exit(1); } } /* * Check for the number of rest arguments. */ if (0 < argc - optind) { fprintf(stderr, "%s: too many arguments\n", invoked_name); output_try_help(); exit(1); } /* * Main routine for each server mode. */ switch (server_mode) { case SERVER_MODE_STANDALONE: for (;;) standalone_main(); break; case SERVER_MODE_INETD: inetd_main(); break; case SERVER_MODE_TEST: test_main(); break; } return 0; /* * A fatal error occurrs... */ die: if (server_mode == SERVER_MODE_STANDALONE) syslog(LOG_CRIT, "the server exits"); else if (server_mode == SERVER_MODE_INETD) syslog(LOG_INFO, "the server exits"); exit(1); } /* * Main routine for standalone mode. */ static void standalone_main() { #if defined(ENABLE_IPV6) struct sockaddr_storage address; #else struct sockaddr_in address; #endif socklen_t address_length; int fd; int pid = -1; fd_set select_files; int i; /* * Block signals. */ #if !defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSETMASK) signal_mask = 0; #endif block_signal(SIGHUP); block_signal(SIGINT); block_signal(SIGTERM); /* * Reset restart trigger. */ restart_trigger = 0; /* * Kill child processes. */ if (once_started) { #ifdef HAVE_KILLPG killpg(process_group_id, SIGINT); #else kill(-process_group_id, SIGINT); #endif syslog(LOG_DEBUG, "debug: kill all child processes"); } /* * Close unwanted files. */ if (!once_started) { closelog(); for (fd = get_open_max() - 1; 0 <= fd; fd--) close(fd); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif syslog(LOG_DEBUG, "debug: reopen syslog"); } /* * Re-initinalize variables. */ if (once_started) { finalize_global_variables(); initialize_global_variables(); } /* * Read a configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { syslog(LOG_ERR, "configuration failure"); goto die; } /* * Reopen syslog. */ closelog(); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif /* * Run as standalone daemon. */ if (!once_started) { if (daemonize() < 0) goto die; #ifdef GETPGRP_VOID process_group_id = getpgrp(); #else process_group_id = getpgrp(getpid()); #endif } /* * Change the current working directory. */ if (chdir(work_path) < 0) { syslog(LOG_ERR, "failed to change the directory, %s: %s", strerror(errno), work_path); goto die; } /* * Shutdown old connections if the server port is changed. */ if (once_started && listening_port != old_listening_port) { /* shutdown multi sockets */ if (shutdown_fdset(&listening_files, &max_listening_file, SHUT_RDWR) < 0) { syslog(LOG_ERR, "shutdown() failed, %s", strerror(errno)); goto die; } /* close multi sockets */ close_fdset(&listening_files, &max_listening_file); syslog(LOG_DEBUG, "debug: shutdown the old socket: %d/tcp", listening_port); } /* * Bind and listen to the server port. */ if (max_listening_file < 0) { if (set_server_ports(listening_port, LISTENING_BACKLOG, &listening_files, &max_listening_file) < 0) goto die; old_listening_port = listening_port; } /* * Set UID and GID. */ if (set_privilege(user_id, group_id) < 0) goto die; /* * Activate all books. */ if (activate_book_registry() == 0) syslog(LOG_ERR, "no book is available"); /* * Unlink an old PID file if exists. */ if (once_started) remove_pid_file(old_pid_file_name); strcpy(old_pid_file_name, pid_file_name); /* * Bind a ticket stock. */ if (max_clients != 0 && bind_ticket_stock(&connection_ticket_stock, connection_lock_file_name, max_clients) < 0) goto die; /* * Log pid to the file. */ if (log_pid_file(pid_file_name) < 0) goto die; /* * Set signal handlers. */ set_signal_handler(SIGBUS, abort_parent); set_signal_handler(SIGSEGV, abort_parent); set_signal_handler(SIGINT, SIG_IGN); set_signal_handler(SIGQUIT, SIG_IGN); set_signal_handler(SIGTERM, terminate_parent); set_signal_handler(SIGCHLD, wait_child); set_signal_handler(SIGHUP, restart_parent); /* * Set `once_started' flag. */ if (once_started) syslog(LOG_NOTICE, "server restarted"); else syslog(LOG_NOTICE, "server started"); once_started = 1; /* * Main loop for the parent process. */ for (;;) { /* * Unblock fatal signals. */ unblock_signal(SIGHUP); unblock_signal(SIGINT); unblock_signal(SIGTERM); unblock_signal(SIGCHLD); /* * Wait a connection from a client. */ if (wait_server_ports(&listening_files, &select_files, &max_listening_file) < 0) { if (errno != EINTR) { syslog(LOG_DEBUG, "failed to wait a connection, %s", strerror(errno)); goto die; } else if (restart_trigger) { return; } else { continue; } } /* * Block fatal signals. */ block_signal(SIGHUP); block_signal(SIGINT); block_signal(SIGTERM); block_signal(SIGCHLD); /* * Accept a connection. */ #if defined(ENABLE_IPV6) address_length = sizeof(struct sockaddr_storage); #else address_length = sizeof(struct sockaddr_in); #endif /* * TODO: nonblocking I/O (not yet) */ for (i = 0; i <= max_listening_file; i++) { if (FD_ISSET(i, &select_files)) { accepted_in_file = accept(i, (struct sockaddr *)&address, &address_length); accepted_out_file = accepted_in_file; if (accepted_in_file < 0) { syslog(LOG_ERR, "accept() failed, %s", strerror(errno)); continue; } syslog(LOG_DEBUG, "debug: accept the connection"); /* * Fork. The child process talk to the client. */ pid = fork(); if (pid < 0) { syslog(LOG_ERR, "fork() failed, %s", strerror(errno)); continue; } else if (pid == 0) { syslog(LOG_DEBUG, "debug: forked"); break; } /* * Close an accepted socket (at the parent process). */ if (close(accepted_in_file) < 0) { syslog(LOG_ERR, "close() failed, %s", strerror(errno)); goto die; } } } if (pid == 0) { break; } } /* * Set signal handlers. */ set_signal_handler(SIGBUS, abort_child); set_signal_handler(SIGSEGV, abort_child); set_signal_handler(SIGINT, terminate_child); set_signal_handler(SIGTERM, terminate_child); set_signal_handler(SIGCHLD, SIG_IGN); set_signal_handler(SIGHUP, terminate_child); set_signal_handler(SIGPIPE, SIG_IGN); /* * Unblock fatal signals. */ unblock_signal(SIGHUP); unblock_signal(SIGINT); unblock_signal(SIGTERM); unblock_signal(SIGCHLD); /* * Close the file to listen to the server port. */ close_fdset(&listening_files, &max_listening_file); /* * Get the client host name and address. */ if (identify_remote_host(accepted_in_file, client_host_name, client_address) < 0) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); shutdown(accepted_in_file, SHUT_RDWR); exit(1); } /* * Check for the access permission to the client. */ if (!test_permission(&permissions, client_host_name, client_address, match_wildcard)) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); shutdown(accepted_in_file, SHUT_RDWR); exit(0); } /* * Get a ticket for the client. */ if (max_clients != 0) { if (get_ticket(&connection_ticket_stock) < 0) { syslog(LOG_INFO, "full of clients"); shutdown(accepted_in_file, SHUT_RDWR); exit(0); } } syslog(LOG_INFO, "connected: host=%s(%s)", client_host_name, client_address); /* * Set book permissions to the current client. */ check_book_permissions(); /* * Communicate with the client. */ protocol_main(); shutdown(accepted_in_file, SHUT_RDWR); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); syslog(LOG_INFO, "the child server process exits"); exit(0); /* * A fatal error occurrs on a parent... */ die: shutdown_fdset(&listening_files, &max_listening_file, SHUT_RDWR); close_fdset(&listening_files, &max_listening_file); if (once_started) remove_pid_file(old_pid_file_name); if (once_started) { set_signal_handler(SIGINT, SIG_IGN); #ifdef HAVE_KILLPG killpg(process_group_id, SIGINT); #else kill(-process_group_id, SIGINT); #endif } finalize_global_variables(); eb_finalize_library(); syslog(LOG_CRIT, "the server exits"); exit(1); } /* * Main routine for inetd mode. */ static void inetd_main() { accepted_in_file = 0; accepted_out_file = 1; /* * Set signal handlers. */ set_signal_handler(SIGBUS, abort_parent); set_signal_handler(SIGSEGV, abort_parent); set_signal_handler(SIGINT, SIG_IGN); set_signal_handler(SIGQUIT, SIG_IGN); set_signal_handler(SIGTERM, terminate_parent); set_signal_handler(SIGHUP, terminate_parent); set_signal_handler(SIGPIPE, SIG_IGN); /* * Read a configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { syslog(LOG_ERR, "configuration failure"); goto die; } /* * Reopen syslog. */ closelog(); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif /* * Change the current working directory. */ if (chdir(work_path) < 0) { syslog(LOG_ERR, "failed to change the directory, %s: %s", strerror(errno), work_path); goto die; } /* * Set UID and GID. */ if (set_privilege(user_id, group_id) < 0) { syslog(LOG_ERR, "failed to set owner and group of the process"); goto die; } /* * Get the client host name and address. */ if (identify_remote_host(accepted_in_file, client_host_name, client_address) < 0) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); goto die; } /* * Check for the access permission to the client. */ if (!test_permission(&permissions, client_host_name, client_address, match_wildcard)) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); shutdown(accepted_in_file, SHUT_RDWR); exit(0); } /* * Get a ticket for the client. */ if (max_clients != 0) { bind_ticket_stock(&connection_ticket_stock, connection_lock_file_name, max_clients); if (get_ticket(&connection_ticket_stock) < 0) { syslog(LOG_INFO, "full of clients"); goto die; } } syslog(LOG_INFO, "connected: host=%s(%s)", client_host_name, client_address); /* * Activate all books. */ if (activate_book_registry() == 0) syslog(LOG_ERR, "no book is available"); /* * Check book permissions to the current client. */ check_book_permissions(); /* * Communicate with the client. */ protocol_main(); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); syslog(LOG_INFO, "the server exits"); exit(0); /* * A fatal error occurrs... */ die: fflush(stderr); shutdown(accepted_in_file, SHUT_RDWR); finalize_global_variables(); eb_finalize_library(); syslog(LOG_INFO, "the server exits"); exit(1); } /* * Main routine for inetd mode. */ static void test_main() { accepted_in_file = 0; accepted_out_file = 1; /* * Read a configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { fprintf(stderr, "configuration failure\n"); syslog(LOG_ERR, "configuration failure"); exit(1); } /* * Activate all books. */ if (activate_book_registry() == 0) syslog(LOG_ERR, "no book is available"); /* * Set dummy host name and address. */ strcpy(client_address, "test-mode"); if (isatty(0)) strncpy(client_host_name, ttyname(0), MAX_HOST_NAME_LENGTH); else strncpy(client_host_name, "stdin", MAX_HOST_NAME_LENGTH); *(client_host_name + MAX_HOST_NAME_LENGTH) = '\0'; idle_timeout = 0; /* * Reopen syslog. */ closelog(); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif syslog(LOG_INFO, "connected: host=%s(%s)", client_host_name, client_address); /* * Set book permissions. */ set_all_book_permissions(); /* * Communicate with the client. */ printf("# %s version %s\n", program_name, program_version); printf("# test mode\n"); fflush(stdout); protocol_main(); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); exit(0); } /* * Output usage to standard out. */ static void output_help() { printf("Usage: %s [option...]\n", program_name); printf("Options:\n"); printf(" -c FILE --configuration-file FILE\n"); printf(" specify a configuration file\n"); printf(" (default: %s)\n", DEFAULT_CONFIGURATION_FILE_NAME); printf(" -h --help display this help, then exit\n"); printf(" -i --inetd inetd mode\n"); printf(" -t --test test mode\n"); printf(" -v --version display version number, then exit\n"); printf("\nDefault value used in a configuration file:\n"); printf(" work-path %s\n", DEFAULT_WORK_PATH); printf("\nOptional feature:\n"); #ifdef ENABLE_IPV6 printf(" IPv6 support enabled\n"); #else printf(" IPv6 disabled\n\n"); #endif printf("\nReport bugs to %s.\n", MAILING_ADDRESS); fflush(stdout); } /* * Set a signal handler. * `signal' on some SystemV based systems is not reliable. * We use `sigaction' if available. */ static void set_signal_handler(signal_number, function) int signal_number; RETSIGTYPE (*function) EBNETD_P((int)); { #ifdef HAVE_SIGPROCMASK struct sigaction action; action.sa_handler = function; sigemptyset(&action.sa_mask); action.sa_flags = SA_NOCLDSTOP; if (signal_number == SIGALRM) { #ifdef SA_INTERRUPT action.sa_flags |= SA_INTERRUPT; #endif } else { #ifdef SA_RESTART action.sa_flags |= SA_RESTART; #endif } sigaction(signal_number, &action, NULL); #else /* not HAVE_SIGPROCMASK */ signal(signal_number, function); #endif /* not HAVE_SIGPROCMASK */ } /* * Block signals of `signal_number' type (SIGHUP, SIGINT, ...). * * `sigprocmask' is used, if available. * Otherwise, `sigsetmask' is used if the system has it. * If neither `sigprocmask' nor `sigsetmask' is available, we give up * blocking a signal. */ static void block_signal(signal_number) int signal_number; { #ifdef HAVE_SIGPROCMASK sigset_t signal_set; #endif #ifdef HAVE_SIGPROCMASK sigemptyset(&signal_set); sigaddset(&signal_set, signal_number); sigprocmask(SIG_BLOCK, &signal_set, NULL); #else /* not HAVE_SIGPROCMASK */ #ifdef HAVE_SIGSETMASK signal_mask |= sigmask(signal_number); sigsetmask(signal_mask); #endif /* HAVE_SIGSETMASK */ #endif /* not HAVE_SIGPROCMASK */ } /* * Block signals of `signal_number' type (SIGHUP, SIGINT, ...). * * `sigprocmask' is used, if available. * Otherwise, `sigsetmask' is used if the system has it. * If neither `sigprocmask' nor `sigsetmask' is available, we give up * blocking a signal. */ static void unblock_signal(signal_number) int signal_number; { #ifdef HAVE_SIGPROCMASK sigset_t signal_set; #endif #ifdef HAVE_SIGPROCMASK sigemptyset(&signal_set); sigaddset(&signal_set, signal_number); sigprocmask (SIG_UNBLOCK, &signal_set, NULL); #else /* not HAVE_SIGPROCMASK */ #ifdef HAVE_SIGSETMASK signal_mask = (signal_mask | sigmask(signal_number)) ^ sigmask(signal_number); sigsetmask(signal_mask); #endif /* HAVE_SIGSETMASK */ #endif /* not HAVE_SIGPROCMASK */ } /* * Signal handler for SIGBUS and SIGSEGV. (for parent) */ static RETSIGTYPE abort_parent(signal_number) int signal_number; { if (server_mode == SERVER_MODE_STANDALONE) { syslog(LOG_CRIT, "the server process aborts, receives SIG%s", signal_name(signal_number)); } else { syslog(LOG_ERR, "the server process aborts, receives SIG%s", signal_name(signal_number)); } abort(); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGBUS and SIGSEGV. (for child) */ static RETSIGTYPE abort_child(signal_number) int signal_number; { syslog(LOG_ERR, "the child server process aborts, receives SIG%s", signal_name(signal_number)); abort(); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGTERM, SIGINT SIGQUIT, and SIGHUP. (for parent) */ static RETSIGTYPE terminate_parent(signal_number) int signal_number; { if (server_mode == SERVER_MODE_STANDALONE) { syslog(LOG_CRIT, "the server process exits, receives SIG%s", signal_name(signal_number)); } else { syslog(LOG_ERR, "the server process exits, receives SIG%s", signal_name(signal_number)); } /* * Kill child processes. */ set_signal_handler(SIGINT, SIG_IGN); if (server_mode == SERVER_MODE_STANDALONE) { #ifdef HAVE_KILLPG killpg(process_group_id, SIGINT); #else kill(-process_group_id, SIGINT); #endif } /* * Shutdown a server port. */ shutdown_fdset(&listening_files, &max_listening_file, SHUT_RDWR); close_fdset(&listening_files, &max_listening_file); /* * Remove a PID file. */ if (server_mode == SERVER_MODE_STANDALONE) remove_pid_file(old_pid_file_name); _exit(1); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGHUP, SIGINT, SIGQUIT and SIGTERM. (for child) */ static RETSIGTYPE terminate_child(signal_number) int signal_number; { syslog(LOG_ERR, "the child server process exits, receives SIG%s", signal_name(signal_number)); shutdown(accepted_in_file, SHUT_RDWR); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); _exit(0); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGCHLD. */ static RETSIGTYPE wait_child(signal_number) int signal_number; { #ifdef HAVE_UNION_WAIT union wait status; #else int status; #endif syslog(LOG_INFO, "receives SIGCHLD"); #ifdef HAVE_WAITPID while (0 < waitpid(-1, &status, WNOHANG)) ; #else /* not HAVE WAITPID */ while (0 < wait3(&status, WNOHANG, NULL)) ; #endif /* not HAVE WAITPID */ /* * Set a signal handler again. */ set_signal_handler(SIGCHLD, wait_child); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGHUP (for parent). */ static RETSIGTYPE restart_parent(signal_number) int signal_number; { syslog(LOG_ERR, "the server restart, receives SIGHUP"); restart_trigger++; #ifndef RETSIGTYPE_VOID return 0; #endif } ebnetd-1.0.dfsg.1/ndtpd/ndtp.c0000644000175000017500000015754107673055411015461 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01, 02 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include "defs.h" #include "fakelog.h" #include "ioall.h" #include "linebuf.h" #include "ndtp.h" #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif #ifndef HAVE_STRTOL #ifdef __STDC__ long strtol(const char *, char **, int); #else /* not __STDC__ */ long strtol(); #endif /* not __STDC__ */ #endif /* not HAVE_STRTOL */ /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) /* * Unexported functions. */ static int command_L EBNETD_P((char *, char *)); static int command_Q EBNETD_P((char *, char *)); static int command_A EBNETD_P((char *, char *)); static int command_u EBNETD_P((char *, char *)); static int command_P EBNETD_P((char *, char *)); static int command_F EBNETD_P((char *, char *)); static int command_S EBNETD_P((char *, char *)); static int command_I EBNETD_P((char *, char *)); static int command_v EBNETD_P((char *, char *)); static int command_T EBNETD_P((char *, char *)); static int command_t EBNETD_P((char *, char *)); static int command_X EBNETD_P((char *, char *)); static int command_XL EBNETD_P((char *, char *)); static int command_XI EBNETD_P((char *, char *)); static int command_XB EBNETD_P((char *, char *)); static int command_Xb EBNETD_P((char *, char *)); static int command_XS EBNETD_P((char *, char *)); static int book_number_to_name EBNETD_P((char *)); static void reverse_word EBNETD_P((char *)); static void iso8859_1_to_ascii_str EBNETD_P((char *)); static void iso8859_1_to_ascii_mem EBNETD_P((char *, size_t)); /* * NDTP command table. */ typedef struct { char name; int (*function) EBNETD_P((char *, char *)); } NDTP_Command; static const NDTP_Command ndtp_commands[] = { {'L', command_L}, {'Q', command_Q}, {'A', command_A}, {'u', command_u}, {'P', command_P}, {'F', command_F}, {'S', command_S}, {'I', command_I}, {'v', command_v}, {'T', command_T}, {'t', command_t}, {'X', command_X}, {'\0', NULL} }; /* * Line buffer to comunicate with a client. */ static Line_Buffer line_buffer; /* * Hookset for processing text in CD-ROM books. */ static EB_Hookset ndtp_hookset; /* * Current book. */ static Book *current_book; /* * Current subbook name. */ static char current_subbook_name[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; /* * Current font height. */ static int current_font_height; /* * Communicate with a client by NDTP. */ int protocol_main() { char line[NDTP_MAX_LINE_LENGTH + 1]; const NDTP_Command *command; char command_name[2]; ssize_t line_length; current_book = NULL; current_subbook_name[0] = '\0'; current_font_height = 0; initialize_line_buffer(&line_buffer); bind_file_to_line_buffer(&line_buffer, accepted_in_file); set_line_buffer_timeout(&line_buffer, idle_timeout); eb_initialize_hookset(&ndtp_hookset); set_common_hooks(&ndtp_hookset); for (;;) { /* * Read a line received from the client. */ line_length = read_line_buffer(&line_buffer, line, NDTP_MAX_LINE_LENGTH); if (line_length < 0) goto die; else if (line_length == 0) continue; /* * Check for the line length. */ if (NDTP_MAX_LINE_LENGTH <= line_length) { if (skip_line_buffer(&line_buffer) < 0) goto die; *(line + NDTP_SHORT_BUFFER_LENGTH) = '\0'; syslog(LOG_INFO, "too long request line: line=%s..., host=%s(%s)", line, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) goto die; continue; } syslog(LOG_DEBUG, "debug: received line: %s", line); /* * Scan the command table. */ for (command = ndtp_commands; command->name != '\0'; command++) { if (command->name == *line) break; } if (command->name == '\0') { *(line + 1) = '\0'; syslog(LOG_INFO, "unknown command: command=%s, host=%s(%s)", line, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) goto die; continue; } /* * Dispatch. */ command_name[0] = *line; command_name[1] = '\0'; if ((command->function)(command_name, line + 1) < 0) goto die; /* * Quit when the received command is `Q'. (Quit even when * ndtpd receives too many arguments for `Q'.) */ if (*line == 'Q') break; } finalize_line_buffer(&line_buffer); eb_finalize_hookset(&ndtp_hookset); return 0; die: finalize_line_buffer(&line_buffer); eb_finalize_hookset(&ndtp_hookset); return -1; } /* * Command `L'. Change the current book/subbook. * It takes an argument which represents a book/subbook name. */ static int command_L(command, argument) char *command; char *argument; { EB_Error_Code error_code; char book_name[MAX_BOOK_NAME_LENGTH + 1]; char subbook_name[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; EB_Subbook_Code subbook; EB_Subbook_Code appendix_subbook; char *slash; /* * Unset the current book. */ if (current_book != NULL) { eb_unset_subbook(¤t_book->book); eb_unset_appendix_subbook(¤t_book->appendix); current_book = NULL; } current_subbook_name[0] = '\0'; current_font_height = 0; /* * If `argument' is `nodict', unset the current book/subbook. */ if (strcmp(argument, "nodict") == 0) { if (write_string_all(accepted_out_file, idle_timeout, "$*\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=nodict, host=%s(%s)", command, client_host_name, client_address); goto failed; } /* * If the argument doesn't contain a slash (`/'), it must be a book * number. We convert it to the corresponding book name. */ slash = strchr(argument, '/'); if (slash == NULL) { if (book_number_to_name(argument) < 0) { syslog(LOG_INFO, "unknown book: command=%s, book=%s, host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } /* * The number `0' is converted to `nodict'. * Unset the current book/subbook. */ if (strcmp(argument, "nodict") == 0) { if (write_string_all(accepted_out_file, idle_timeout, "$*\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=nodict, host=%s(%s)", command, client_host_name, client_address); return 0; } /* * Find a slash (`/') again. */ slash = strchr(argument, '/'); } /* * Get book and subbook names separated by a slash (`/'). */ strncpy(book_name, argument, (int)(slash - argument)); *(book_name + (int)(slash - argument)) = '\0'; strcpy(subbook_name, slash + 1); /* * Set the current book. */ current_book = find_book(book_name); if (current_book == NULL) { syslog(LOG_INFO, "unknown book: command=%s, book=%s, host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } /* * Check for access permission to the book. */ if (!current_book->permission_flag) { syslog(LOG_ERR, "denied: command=%s, book=%s, host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } /* * Get a ticket to access the book. * (Don't release the ticket when the current book is unset.) */ if (current_book->max_clients != 0 && get_ticket(¤t_book->ticket_stock) < 0) { syslog(LOG_INFO, "full of clients: command=%s, book=%s, host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } /* * Find the subbook in the current book. */ subbook = find_subbook(current_book, subbook_name); if (subbook < 0) { syslog(LOG_INFO, "unknown book: command=%s, book=%s, host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } /* * Set the current subbook. */ error_code = eb_set_subbook(¤t_book->book, subbook); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s, host=%s(%s)", eb_error_message(error_code), command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } /* * Find the subbook in the current appendix. */ error_code = eb_is_appendix_bound(¤t_book->appendix); if (error_code != EB_SUCCESS) { appendix_subbook = find_appendix_subbook(current_book, subbook_name); if (appendix_subbook < 0) { syslog(LOG_INFO, "unknown appendix: command=%s, book=%s, \ host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } /* * Set the current subbook. */ error_code = eb_set_appendix_subbook(¤t_book->appendix, appendix_subbook); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s, host=%s(%s)", eb_error_message(error_code), command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } } /* * Get the current subbook name. */ error_code = eb_subbook_directory(¤t_book->book, current_subbook_name); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s, host=%s(%s)", eb_error_message(error_code), command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } /* * Set text hooks. */ set_text_hooks(&ndtp_hookset); /* * Send a response. */ if (write_string_all(accepted_out_file, idle_timeout, "$*\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=%s, host=%s(%s)", command, argument, client_host_name, client_address); return 0; /* * An error occurs... */ failed: if (current_book != NULL) { eb_unset_subbook(¤t_book->book); eb_unset_appendix_subbook(¤t_book->appendix); current_book = NULL; } return 0; } /* * Command `Q'. Quit. */ static int command_Q(command, argument) char *command; char *argument; { /* * The argument should be empty. */ if (*argument != '\0') { syslog(LOG_INFO, "too many arguments: command=%s, host=%s(%s)", command, client_host_name, client_address); return 0; } syslog(LOG_INFO, "succeeded: command=%s, host=%s(%s)", command, client_host_name, client_address); return 0; } /* * Command `A'. Get access permission. * The command is not supported. It always sends the `succeeded' response. */ static int command_A(command, argument) char *command; char *argument; { /* * Send a success code. */ if (write_string_all(accepted_out_file, idle_timeout, "$A\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, host=%s(%s)", command, client_host_name, client_address); return 0; } /* * Command `u'. List current users. * The command is not supported. It always sends an empty list. */ static int command_u(command, argument) char *command; char *argument; { /* * The argument must be empty. */ if (*argument != '\0') { syslog(LOG_INFO, "too many arguments: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Send an empty list. */ if (write_string_all(accepted_out_file, idle_timeout, "$U\n$$\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, host=%s(%s)", command, client_host_name, client_address); return 0; } /* Index size of a hit list. */ #define HIT_LIST_LENGTH 50 /* * Command `P'. Search a word. * It takes two arguments without a separater. * The first argument is a character which represents an index type. * The second argument represents a word to search. */ static int command_P(command, argument) char *command; char *argument; { EB_Error_Code error_code; EB_Character_Code character_code; EB_Hit hit_list[HIT_LIST_LENGTH]; EB_Hit *hit; int hit_count; char position_buffer[MAX_STRING_LENGTH + 1]; char heading_buffer1[MAX_STRING_LENGTH + 1]; char heading_buffer2[MAX_STRING_LENGTH + 1]; char *heading; char *previous_heading; ssize_t heading_length; EB_Position previous_text_position; char word[EB_MAX_WORD_LENGTH + 1]; size_t word_length; char method; int n; int i; /* * Check for the current book. */ if (current_book == NULL) { syslog(LOG_INFO, "no current book: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; return 0; } /* * Set a word to search and a search method. */ word_length = strlen(argument) - 1; if (EB_MAX_WORD_LENGTH < word_length) { syslog(LOG_INFO, "too long word: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } if (*argument == '\0') { syslog(LOG_INFO, "empty method name: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } strcpy(word, argument + 1); method = *argument; /* * Check for the search method. */ if (strchr("akAKj", method) == NULL) { syslog(LOG_INFO, "bad search method: command=%s, method=%c, \ host=%s(%s)", command, method, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * For syslog output, replace TAB in `argument' with semicolon. */ if (method == 'j') { char *p = argument + 1; for (;;) { p = strchr(p, '\t'); if (p == NULL) break; *p++ = ';'; } } /* * Submit a search request. * * Before submission, remove `*' in the tail of the word and choose * a search function. If the word is written in ISO 8859-1 and it * ends with `\xa1\xf6' (upside-down `!' and umlaut accent `o'), it * is recognized as asterisk (`*') of JIS X 0208 by mistake. */ if (method == 'j') { char *keywords[EB_MAX_KEYWORDS + 2]; char *p; char *tab; /* * Split keywords with a TAB. We split (EB_MAX_KEYWORDS + 1) * keywords maximum because "too many keywords" error can * be detected by EB Library. */ p = word; i = 0; while (i < EB_MAX_KEYWORDS + 1) { keywords[i++] = p; tab = strchr(p, '\t'); if (tab == NULL) break; *tab = '\0'; p = tab + 1; } keywords[i] = NULL; error_code = eb_search_keyword(¤t_book->book, (const char * const *) keywords); } else if (1 <= word_length && *(word + word_length - 1) == '*') { /* * The word is terminated by "*". */ *(word + word_length - 1) = '\0'; if (method == 'a' || method == 'k') { error_code = eb_search_word(¤t_book->book, word); } else { reverse_word(word); error_code = eb_search_endword(¤t_book->book, word); } } else if (2 <= word_length /* * The word is terminated by an asterisk of JIS X 0208. */ && *((unsigned char *)(word + word_length - 2)) == 0xa1 && *((unsigned char *)(word + word_length - 1)) == 0xf6) { *(word + word_length - 2) = '\0'; if (method == 'a' || method == 'k') { error_code = eb_search_word(¤t_book->book, word); } else { reverse_word(word); error_code = eb_search_endword(¤t_book->book, word); } } else { /* * Exact word search. */ error_code = eb_search_exactword(¤t_book->book, word); } if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, method=%c, word=%s, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, method, argument + 1, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$0\n$$\n") <= 0) return -1; return 0; } /* * Get hit entries and send them to a client. */ if (write_string_all(accepted_out_file, idle_timeout, "$0\n") <= 0) return -1; hit_count = 0; heading = heading_buffer1; previous_heading = heading_buffer2; *previous_heading = '\0'; previous_text_position.page = 0; previous_text_position.offset = 0; n = 0; error_code = eb_character_code(¤t_book->book, &character_code); if (error_code != EB_SUCCESS) character_code = EB_CHARCODE_JISX0208; while (hit_count < max_hits || max_hits == 0) { /* * Get hit entries. */ error_code = eb_hit_list(¤t_book->book, HIT_LIST_LENGTH, hit_list, &n); if (error_code != EB_SUCCESS || n == 0) break; for (i = 0, hit = hit_list; i < n; i++, hit_count++, hit++) { /* * Seek the current subbook. */ error_code = eb_seek_text(¤t_book->book, &hit->heading); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, method=%c, \ word=%s, host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, method, argument + 1, client_host_name, client_address); continue; } /* * Get heading. */ error_code = eb_read_heading(¤t_book->book, ¤t_book->appendix, &ndtp_hookset, NULL, MAX_STRING_LENGTH, heading, &heading_length); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, method=%c, \ word=%s, host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, method, argument + 1, client_host_name, client_address); break; } if (error_code != EB_SUCCESS || heading_length == 0) continue; *(heading + heading_length) = '\0'; if (character_code == EB_CHARCODE_ISO8859_1) iso8859_1_to_ascii_mem(heading, heading_length); /* * Ignore a hit entry if its heading and text location are * equal to those of the previous hit entry. */ if (previous_text_position.page == hit->text.page && previous_text_position.offset == hit->text.offset && strcmp(heading, previous_heading) == 0) continue; /* * Output the heading and text position. */ if (write_string_all(accepted_out_file, idle_timeout, heading) <= 0) return -1; sprintf(position_buffer, "\n%x:%x\n", hit->text.page, hit->text.offset); if (write_string_all(accepted_out_file, idle_timeout, position_buffer) <= 0) return -1; /* * Keep the last message, page, and offset, to remove * duplicated entries. */ if (heading == heading_buffer1) { heading = heading_buffer2; previous_heading = heading_buffer1; } else { heading = heading_buffer1; previous_heading = heading_buffer2; } previous_text_position.page = hit->text.page; previous_text_position.offset = hit->text.offset; } } if (n < 0) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, method=%c, word=%s, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, method, argument + 1, client_host_name, client_address); } if (write_string_all(accepted_out_file, idle_timeout, "$$\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=%s/%s, method=%c, \ word=%s, matches=%d, host=%s(%s)", command, current_book->name, current_subbook_name, method, argument + 1, hit_count, client_host_name, client_address); return 0; } /* * Command `F'. Send a page. * It takes an argument which represents a page to send. * The page number must be a hexadecimal integer. */ static int command_F(command, argument) char *command; char *argument; { EB_Error_Code error_code; EB_Position position; char message[EB_SIZE_PAGE + 3]; /* "$F" + page + "\n" */ char *end_p; ssize_t text_length; /* * Set header and footer. */ message[0] = '$'; message[1] = 'F'; message[EB_SIZE_PAGE + 2] = '\n'; /* * Check for the current book. */ if (current_book == NULL) { syslog(LOG_INFO, "no current book: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; return 0; } /* * Parse an page number. */ position.offset = 0; position.page = strtol(argument, &end_p, 16); if (!isxdigit(*argument) || *end_p != '\0') { syslog(LOG_INFO, "bad page number: command=%s, page=%s, host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Read the page. */ error_code = eb_seek_text(¤t_book->book, &position); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, page=%d, host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, position.page, client_host_name, client_address); memset(message + 2, '\0', EB_SIZE_PAGE); if (write_all(accepted_out_file, idle_timeout, message, EB_SIZE_PAGE + 3) <= 0) return -1; return 0; } error_code = eb_read_rawtext(¤t_book->book, EB_SIZE_PAGE, message + 2, &text_length); if (error_code != EB_SUCCESS || text_length != EB_SIZE_PAGE) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, page=%d, host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, position.page, client_host_name, client_address); memset(message + 2, '\0', EB_SIZE_PAGE); if (write_all(accepted_out_file, idle_timeout, message, EB_SIZE_PAGE + 3) <= 0) return -1; return 0; } /* * Send the page to the client ("$F" + page + "\n"). */ if (write_all(accepted_out_file, idle_timeout, message, EB_SIZE_PAGE + 3) <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=%s/%s, page=%d, host=%s(%s)", command, current_book->name, current_subbook_name, position.page, client_host_name, client_address); return 0; } /* * Command `S'. Send text. * It takes two arguments; page number and offset separeted by a colon (`:'). * Both the page number and offset must be hexadecimal integers. */ static int command_S(command, argument) char *command; char *argument; { EB_Error_Code error_code; EB_Position position; EB_Character_Code character_code; char text[EB_SIZE_PAGE]; char *end_p; char *offset_p; size_t rest_text_length; size_t text_length_argument; ssize_t actual_text_length; /* * Check for the current book. */ if (current_book == NULL) { syslog(LOG_INFO, "no current book: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; return 0; } /* * Parse a page number. */ position.page = strtol(argument, &end_p, 16); if (!isxdigit(*argument) || *end_p != ':') { syslog(LOG_INFO, "bad position: command=%s, position=%s, host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Parse an offset number. */ offset_p = end_p + 1; position.offset = strtol(offset_p, &end_p, 16); if (!isxdigit(*offset_p) || *end_p != '\0') { syslog(LOG_INFO, "bad position: command=%s, position=%s, host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Get character code of the current book. */ error_code = eb_character_code(¤t_book->book, &character_code); if (error_code != EB_SUCCESS) character_code = EB_CHARCODE_JISX0208; /* * Seek the current subbook. */ error_code = eb_seek_text(¤t_book->book, &position); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, position=%s, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$1\n$$\n") <= 0) return -1; return 0; } /* * Read text and send them to the client. */ if (write_string_all(accepted_out_file, idle_timeout, "$1\n") <= 0) return -1; rest_text_length = max_text_size; for (;;) { if (EB_SIZE_PAGE - 1 < rest_text_length || max_text_size == 0) text_length_argument = EB_SIZE_PAGE - 1; else text_length_argument = rest_text_length; if (text_length_argument <= 0) break; error_code = eb_read_text(¤t_book->book, ¤t_book->appendix, &ndtp_hookset, NULL, text_length_argument, text, &actual_text_length); if (error_code != EB_SUCCESS || actual_text_length == 0) break; rest_text_length -= actual_text_length; if (character_code == EB_CHARCODE_ISO8859_1) iso8859_1_to_ascii_mem(text, actual_text_length); if (write_all(accepted_out_file, idle_timeout, text, actual_text_length) <= 0) return -1; } if (write_string_all(accepted_out_file, idle_timeout, "\n$$\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=%s/%s, position=%s, \ host=%s(%s)", command, current_book->name, current_subbook_name, argument, client_host_name, client_address); return 0; } /* * Command `I'. Send an index list. * The page numbers in the table are dummy except for menu search. */ static int command_I(command, argument) char *command; char *argument; { char message[MAX_STRING_LENGTH + 1]; EB_Position position; /* * The argument must be empty. */ if (*argument != '\0') { syslog(LOG_INFO, "too many arguments: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Check for the current book. */ if (current_book == NULL) { syslog(LOG_INFO, "no current book: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; return 0; } /* * Send response data. */ if (write_string_all(accepted_out_file, idle_timeout, "$I\n") <= 0) return -1; if (eb_have_word_search(¤t_book->book)) { if (write_string_all(accepted_out_file, idle_timeout, "IA 1\nIK 1\n") <= 0) return -1; } if (eb_have_endword_search(¤t_book->book)) { if (write_string_all(accepted_out_file, idle_timeout, "BA 1\nBK 1\n") <= 0) return -1; } if (eb_menu(¤t_book->book, &position) == EB_SUCCESS) { sprintf(message, "HA %x\n", position.page); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; } if (eb_copyright(¤t_book->book, &position) == EB_SUCCESS) { sprintf(message, "OK %x\n", position.page); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; } if (eb_have_keyword_search(¤t_book->book)) { if (write_string_all(accepted_out_file, idle_timeout, "JO 1\n") <= 0) return -1; } if (write_string_all(accepted_out_file, idle_timeout, "$$\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=%s/%s, host=%s(%s)", command, current_book->name, current_subbook_name, client_host_name, client_address); return 0; } /* * Command `v'. Output version number of the server. */ static int command_v(command, argument) char *command; char *argument; { char message[MAX_STRING_LENGTH + 1]; /* * The argument must be empty. */ if (*argument != '\0') { syslog(LOG_INFO, "too many arguments: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } sprintf(message, "$v%s version %s\n", program_name, program_version); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, host=%s(%s)", command, client_host_name, client_address); return 0; } /* * Command `T'. Output a book list. */ static int command_T(command, argument) char *command; char *argument; { EB_Error_Code error_code; EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS]; EB_Character_Code character_code; Book *book; char message[MAX_STRING_LENGTH + 1]; char title[EB_MAX_TITLE_LENGTH + 1]; int subbook_count; int i, j; /* * The argument must be empty. */ if (*argument != '\0') { syslog(LOG_INFO, "too many arguments: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Send a book list. */ for (book = book_registry, i = 1; book != NULL; book = book->next) { if (!eb_is_bound(&book->book)) continue; error_code = eb_subbook_list(&book->book, subbook_list, &subbook_count); if (error_code != EB_SUCCESS || !book->permission_flag) continue; error_code = eb_character_code(&book->book, &character_code); if (error_code != EB_SUCCESS) character_code = EB_CHARCODE_JISX0208; for (j = 0; j < subbook_count; j++, i++) { error_code = eb_subbook_title2(&book->book, subbook_list[j], title); if (error_code != EB_SUCCESS) strcpy(title, "(not available)"); sprintf(message, "%d\t%s\n", i, title); if (character_code == EB_CHARCODE_ISO8859_1) iso8859_1_to_ascii_str(message); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; } } if (write_string_all(accepted_out_file, idle_timeout, "$*\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, host=%s(%s)", command, client_host_name, client_address); return 0; } /* * Command `t'. List current users and books. * The command is not supported. It always sends an empty list. */ static int command_t(command, argument) char *command; char *argument; { EB_Error_Code error_code; EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS]; EB_Character_Code character_code; Book *book; char message[MAX_STRING_LENGTH + 1]; char title[EB_MAX_TITLE_LENGTH + 1]; char directory[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; int subbook_count; int i, j; /* * The argument must be empty. */ if (*argument != '\0') { syslog(LOG_INFO, "too many arguments: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Send a book list. */ for (book = book_registry, i = 1; book != NULL; book = book->next) { if (!eb_is_bound(&book->book)) continue; error_code = eb_subbook_list(&book->book, subbook_list, &subbook_count); if (error_code != EB_SUCCESS || !book->permission_flag) continue; error_code = eb_character_code(&book->book, &character_code); if (error_code != EB_SUCCESS) character_code = EB_CHARCODE_JISX0208; for (j = 0; j < subbook_count; j++, i++) { error_code = eb_subbook_directory2(&book->book, subbook_list[j], directory); if (error_code != EB_SUCCESS) strcpy(directory, "*"); error_code = eb_subbook_title2(&book->book, subbook_list[j], title); if (error_code != EB_SUCCESS) strcpy(title, "(not available)"); sprintf(message, "%d\t%s\t%s/%s\t%d\t%d\t%d\n", i, title, book->name, directory, 0, book->max_clients, idle_timeout); if (character_code == EB_CHARCODE_ISO8859_1) iso8859_1_to_ascii_str(message); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; } } if (write_string_all(accepted_out_file, idle_timeout, "$*\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, host=%s(%s)", command, client_host_name, client_address); return 0; } /* * `X' prefixed Commands. */ static int command_X(command, argument) char *command; char *argument; { switch (*argument) { case 'I': return command_XI("XI", argument + 1); case 'L': return command_XL("XL", argument + 1); case 'B': return command_XB("XB", argument + 1); case 'b': return command_Xb("Xb", argument + 1); case 'S': return command_XS("XS", argument + 1); } syslog(LOG_INFO, "unknown command: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Command `XI'. Send a bitmap size list. */ static int command_XI(command, argument) char *command; char *argument; { EB_Error_Code error_code; EB_Font_Code font_list[EB_MAX_FONTS]; int height; int font_count; char message[MAX_STRING_LENGTH + 1]; int i; /* * The argument must be empty. */ if (*argument != '\0') { syslog(LOG_INFO, "too many arguments: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Check for the current book. */ if (current_book == NULL) { syslog(LOG_INFO, "no current book: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; return 0; } /* * Send response data. */ if (write_string_all(accepted_out_file, idle_timeout, "$I\n") <= 0) return -1; error_code = eb_font_list(¤t_book->book, font_list, &font_count); if (error_code != EB_SUCCESS) font_count = 0; for (i = 0; i < font_count; i++) { if (eb_font_height2(font_list[i], &height) != EB_SUCCESS) continue; sprintf(message, "%d\n", height); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; } if (write_string_all(accepted_out_file, idle_timeout, "$$\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=%s/%s, host=%s(%s)", command, current_book->name, current_subbook_name, client_host_name, client_address); return 0; } /* * Command `XL'. Set the current bitmap size. */ static int command_XL(command, argument) char *command; char *argument; { EB_Error_Code error_code; EB_Font_Code font_code; int height; char *end_p; /* * Check for the current book. */ if (current_book == NULL) { syslog(LOG_INFO, "no current book: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; goto failed; } /* * Unset the current bitmap size. */ eb_unset_font(¤t_book->book); current_font_height = 0; /* * Parse an argument. */ height = strtol(argument, &end_p, 10); if (!isdigit(argument[0]) || *end_p != '\0') { syslog(LOG_INFO, "bad bitmap height: command=%s, bitmap-size=%s, \ host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; goto failed; } /* * If height is `0', unset the bitmap size. */ if (height == 0) { if (write_string_all(accepted_out_file, idle_timeout, "$*\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=%s/%s, bitmap-size=0, \ host=%s(%s)", command, current_book->name, current_subbook_name, client_host_name, client_address); set_text_hooks(&ndtp_hookset); return 0; } /* * Check for the font height. */ switch (height) { case 16: font_code = EB_FONT_16; break; case 24: font_code = EB_FONT_24; break; case 30: font_code = EB_FONT_30; break; case 48: font_code = EB_FONT_48; break; default: syslog(LOG_INFO, "bad bitmap height: command=%s, book=%s/%s, \ bitmap-size=%d, host=%s(%s)", command, current_book->name, current_subbook_name, height, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } /* * Set the current bitmap size. */ error_code = eb_set_font(¤t_book->book, font_code); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, bitmap-size=%d, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, height, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; goto failed; } current_font_height = height; set_bitmap_hooks(&ndtp_hookset); /* * Send a response. */ if (write_string_all(accepted_out_file, idle_timeout, "$*\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=%s/%s, bitmap-size=%d, \ host=%s(%s)", command, current_book->name, current_subbook_name, height, client_host_name, client_address); return 0; /* * An error occurs... */ failed: if (current_book != NULL) { eb_unset_font(¤t_book->book); current_font_height = 0; set_text_hooks(&ndtp_hookset); } return 0; } /* * Command `XB'. Send bitmap data of all local characters defined in * the current subbook. */ static int command_XB(command, argument) char *command; char *argument; { EB_Error_Code error_code; char bitmap[EB_SIZE_WIDE_FONT_48]; char xbm[EB_SIZE_NARROW_FONT_48_XBM]; char header[MAX_STRING_LENGTH + 1]; int width; int start_character_number; int end_character_number; int ch; size_t xbm_length; /* * The argument must be empty. */ if (*argument != '\0') { syslog(LOG_INFO, "too many arguments: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Check for the current book and bitmap size. */ if (current_book == NULL) { syslog(LOG_INFO, "no current book: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; return 0; } if (current_font_height == 0) { syslog(LOG_INFO, "no current bitmap size: command=%s, book=%s/%s, \ host=%s(%s)", command, current_book->name, current_subbook_name, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; return 0; } if (write_string_all(accepted_out_file, idle_timeout, "$I\n") <= 0) return -1; /* * Send bitmap data of narrow characters. */ do { if (!eb_have_narrow_font(¤t_book->book)) break; error_code = eb_narrow_font_width(¤t_book->book, &width); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, bitmap-size=%d, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, current_font_height, client_host_name, client_address); break; } error_code = eb_narrow_font_start(¤t_book->book, &start_character_number); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, bitmap-size=%d, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, current_font_height, client_host_name, client_address); } error_code = eb_narrow_font_end(¤t_book->book, &end_character_number); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, bitmap-size=%d, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, current_font_height, client_host_name, client_address); break; } ch = start_character_number; while (0 <= ch) { error_code = eb_narrow_font_character_bitmap(¤t_book->book, ch, bitmap); if (error_code != EB_SUCCESS) continue; eb_bitmap_to_xbm(bitmap, width, current_font_height, xbm, &xbm_length); sprintf(header, "$=h%04x\n", ch); if (write_string_all(accepted_out_file, idle_timeout, header) <= 0) return -1; if (write_all(accepted_out_file, idle_timeout, xbm, xbm_length) <= 0) return -1; error_code = eb_forward_narrow_font_character(¤t_book->book, 1, &ch); if (error_code != EB_SUCCESS) break; } } while (0); /* * Send bitmap data of wide characters. */ do { if (!eb_have_wide_font(¤t_book->book)) break; error_code = eb_wide_font_width(¤t_book->book, &width); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, bitmap-size=%d, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, current_font_height, client_host_name, client_address); break; } error_code = eb_wide_font_start(¤t_book->book, &start_character_number); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, bitmap-size=%d, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, current_font_height, client_host_name, client_address); break; } error_code= eb_wide_font_end(¤t_book->book, &end_character_number); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, bitmap-size=%d, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, current_font_height, client_host_name, client_address); break; } ch = start_character_number; while (0 <= ch) { error_code = eb_wide_font_character_bitmap(¤t_book->book, ch, bitmap); if (error_code != EB_SUCCESS) continue; eb_bitmap_to_xbm(bitmap, width, current_font_height, xbm, &xbm_length); sprintf(header, "$=z%04x\n", ch); if (write_string_all(accepted_out_file, idle_timeout, header) <= 0) return -1; if (write_all(accepted_out_file, idle_timeout, xbm, xbm_length) <= 0) return -1; error_code = eb_forward_wide_font_character(¤t_book->book, 1, &ch); if (error_code != EB_SUCCESS) break; } } while (0); /* * End of the response data. */ if (write_string_all(accepted_out_file, idle_timeout, "$$\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=%s/%s, bitmap-size=%d, \ host=%s(%s)", command, current_book->name, current_subbook_name, current_font_height, client_host_name, client_address); return 0; } /* * Command `Xb'. Send bitmap data of a local character. */ static int command_Xb(command, argument) char *command; char *argument; { EB_Error_Code error_code; char bitmap[EB_SIZE_WIDE_FONT_48]; char xbm[EB_SIZE_WIDE_FONT_48_XBM]; char *end_p; int character_number; int character_type; int width; size_t xbm_length; /* * Check for the current book and bitmap size. */ if (current_book == NULL) { syslog(LOG_INFO, "no current book: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; return 0; } if (current_font_height == 0) { syslog(LOG_INFO, "no current bitmap size: command=%s, book=%s/%s, \ host=%s(%s)", command, current_book->name, current_subbook_name, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; return 0; } /* * Parse a charcter number; */ character_type = *argument; character_number = strtol(argument + 1, &end_p, 16); if (!isxdigit(*(argument + 1)) || *end_p != '\0' || (character_type != 'h' && character_type != 'z')) { syslog(LOG_INFO, "bad bitmap height: command=%s, character=%s, \ host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Get width of the character. */ if (character_type == 'h') error_code = eb_narrow_font_width(¤t_book->book, &width); else error_code = eb_wide_font_width(¤t_book->book, &width); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, bitmap-size=%d, \ character=%s, host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, current_font_height, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; return 0; } /* * Get bitmap data of the character. */ if (character_type == 'h') { error_code = eb_narrow_font_character_bitmap(¤t_book->book, character_number, bitmap); } else { error_code = eb_wide_font_character_bitmap(¤t_book->book, character_number, bitmap); } if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, bitmap-size=%d, \ character=%s, host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, current_font_height, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; return 0; } /* * Get XBM data of the character. */ eb_bitmap_to_xbm(bitmap, width, current_font_height, xbm, &xbm_length); /* * Send bitmap data of the character. */ if (write_string_all(accepted_out_file, idle_timeout, "$I\n") <= 0) return -1; if (write_all(accepted_out_file, idle_timeout, xbm, xbm_length) <= 0) return -1; if (write_string_all(accepted_out_file, idle_timeout, "$$\n") <= 0) return -1; syslog(LOG_INFO, "succeeded: command=%s, book=%s/%s, bitmap-size=%d, \ character=%s, host=%s(%s)", command, current_book->name, current_subbook_name, current_font_height, argument, client_host_name, client_address); return 0; } /* * Command `XS'. Tell location of the previous or next paragraph. */ static int command_XS(command, argument) char *command; char *argument; { EB_Error_Code error_code; EB_Position position; char message[MAX_STRING_LENGTH + 1]; char *offset_p; char *end_p; int sign; /* * Check for the current book. */ if (current_book == NULL) { syslog(LOG_INFO, "no current book: command=%s, host=%s(%s)", command, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$<\n") <= 0) return -1; return 0; } /* * Parse an optional sign. */ if (*argument != '+' && *argument != '-') { syslog(LOG_INFO, "bad direction sign: command=%s, position=%s, \ host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } sign = *argument; /* * Parse a page number. */ position.page = strtol(argument + 1, &end_p, 16); if (!isxdigit(*(argument + 1)) || *end_p != ':') { syslog(LOG_INFO, "bad position: command=%s, position=%s, host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Parse an offset number. */ offset_p = end_p + 1; position.offset = strtol(offset_p, &end_p, 16); if (!isxdigit(*offset_p) || *end_p != '\0') { syslog(LOG_INFO, "bad position: command=%s, position=%s, host=%s(%s)", command, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$?\n") <= 0) return -1; return 0; } /* * Seek the current subbook. */ error_code = eb_seek_text(¤t_book->book, &position); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, position=%s, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$1\n$$\n") <= 0) return -1; return 0; } /* * Forward or backward the text. */ if (sign == '+') { error_code = eb_forward_text(¤t_book->book, ¤t_book->appendix); } else if (sign == '-') { error_code = eb_backward_text(¤t_book->book, ¤t_book->appendix); } if (error_code == EB_SUCCESS) error_code = eb_tell_text(¤t_book->book, &position); /* * Output response. */ if (error_code == EB_SUCCESS) { sprintf(message, "$XS%x:%x\n", position.page, position.offset); if (write_string_all(accepted_out_file, idle_timeout, message) <= 0) return -1; } else if (error_code == EB_ERR_END_OF_CONTENT) { if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; } else { syslog(LOG_INFO, "%s: command=%s, book=%s/%s, position=%s, \ host=%s(%s)", eb_error_message(error_code), command, current_book->name, current_subbook_name, argument, client_host_name, client_address); if (write_string_all(accepted_out_file, idle_timeout, "$&\n") <= 0) return -1; return 0; } syslog(LOG_INFO, "succeeded: command=%s, book=%s/%s, position=%s, \ host=%s(%s)", command, current_book->name, current_subbook_name, argument, client_host_name, client_address); return 0; } /* * Convert a book number `argument' to the corresponding book name. * * If succeeds, 0 is returned, and `argument' is overwritten. Upon return, * `argument' represents the book name. Otherwise, -1 is returned and * `argument' is unchanged. */ static int book_number_to_name(argument) char *argument; { EB_Error_Code error_code; int number; Book *book; int subbook_count; EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS]; char directory[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; char *end_p; int i; /* * Get a book number. */ number = strtol(argument, &end_p, 10); if (!isdigit(argument[0]) || *end_p != '\0') return -1; /* * If `argument' is `0', it is equivalent to `nodict'. * Unset the current book/subbook. */ if (number == 0) { strcpy(argument, "nodict"); return 0; } /* * Find `book/subbook' corresponding with `number'. */ for (book = book_registry, i = 1; book != NULL && i <= number; book = book->next) { if (!eb_is_bound(&book->book)) continue; error_code = eb_subbook_list(&book->book, subbook_list, &subbook_count); if (error_code != EB_SUCCESS || !book->permission_flag) continue; if (number < i + subbook_count) { error_code = eb_subbook_directory2(&book->book, subbook_list[number - i], directory); if (error_code != EB_SUCCESS) return -1; sprintf(argument, "%s/%s", book->name, directory); return 0; } i += subbook_count; } return -1; } /* * Reverse a word for ENDWORD SEARCH. * * `word' is a word to reverse. It must be an alphabetic word. * The reversed word is also put into `word'. */ static void reverse_word(word) char *word; { char buffer[NDTP_MAX_LINE_LENGTH + 1]; unsigned char *p1, *p2; strcpy(buffer, word); p1 = (unsigned char *)word; p2 = (unsigned char *)buffer + strlen(word); *p2-- = '\0'; while (*p1 != '\0') { if (*p1 == 0x8f) { /* * `*p1' is SS3. * (It may be rejected by `eb_search_word', though.) */ if (*(p1 + 1) == '\0' || *(p1 + 2) == '\0') break; *p2 = *(p1 + 2); *(p2 - 1) = *(p1 + 1); *(p2 - 2) = *p1; p1 += 3; p2 -= 3; } else if ((0xa1 <= *p1 && *p1 <= 0xfe) || *p1 == 0x8e) { /* * `*p1' is SS2 or a character in JIS X 0208. */ if (*(p1 + 1) == '\0') break; *p2 = *(p1 + 1); *(p2 - 1) = *p1; p1 += 2; p2 -= 2; } else { /* * Otherwise. */ *p2 = *p1; p1 += 1; p2 -= 1; } } strcpy(word, (char *)p2 + 1); } /* * ISO 8859 1 to EUC-JP conversion table. */ static const char iso8859_1_to_euc_table[] = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', /* 80 - 87 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', /* 88 - 8f */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', /* 90 - 97 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', /* 98 - 9f */ ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', /* a0 - a7 */ '\'', 'C', ' ', '<', ' ', '-', 'R', '~', /* a8 - af */ ' ', ' ', '2', '3', '\'', 'u', '*', '*', /* b0 - b7 */ ',' , '1', ' ', '>', ' ', ' ', ' ', ' ', /* b8 - bf */ 'A', 'A', 'A', 'A', 'A', 'A', ' ', 'C', /* c0 - c7 */ 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', /* c8 - cf */ 'D', 'N', 'O', 'O', 'O', 'O', 'O', 'x', /* d0 - d7 */ 'O', 'U', 'U', 'U', 'U', 'Y', 'P', 'B', /* d8 - df */ 'a', 'a', 'a', 'a', 'a', 'a', ' ', 'c', /* e0 - e7 */ 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', /* e8 - ef */ 'o', 'n', 'o', 'o', 'o', 'o', 'o', '/', /* f0 - f7 */ 'o', 'u', 'u', 'u', 'u', 'y', 'p', 'y', /* f8 - ff */ }; /* * Convert an ISO 8859-1 string to ASCII. */ static void iso8859_1_to_ascii_str(string) char *string; { unsigned char *strp = (unsigned char *)string; while (*strp != '\0') { if (0x80 <= *strp) *(char *)strp = iso8859_1_to_euc_table[*strp - 0x80]; strp++; } } /* * Convert an ISO 8859-1 stream to ASCII. */ static void iso8859_1_to_ascii_mem(stream, length) char *stream; size_t length; { unsigned char *strp = (unsigned char *)stream; size_t i; for (i = length; 0 < i; i--) { if (0x80 <= *strp) *(char *)strp = iso8859_1_to_euc_table[*strp - 0x80]; strp++; } } ebnetd-1.0.dfsg.1/ndtpd/hookset.c0000644000175000017500000001454707673055412016167 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "ndtp.h" /* * Unexported functions. */ static EB_Error_Code hook_narrow_font_text EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_narrow_font_bitmap EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_wide_font_text EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_wide_font_bitmap EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_reference EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_begin_script EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_end_script EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_gb2312 EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); /* * Hooks. */ static const EB_Hook common_hooks[] = { {EB_HOOK_NARROW_FONT, hook_narrow_font_text}, {EB_HOOK_WIDE_FONT, hook_wide_font_text}, {EB_HOOK_END_REFERENCE, hook_reference}, {EB_HOOK_END_CANDIDATE_GROUP, hook_reference}, {EB_HOOK_BEGIN_SUPERSCRIPT, hook_begin_script}, {EB_HOOK_BEGIN_SUBSCRIPT, hook_begin_script}, {EB_HOOK_END_SUPERSCRIPT, hook_end_script}, {EB_HOOK_END_SUBSCRIPT, hook_end_script}, {EB_HOOK_GB2312, hook_gb2312}, {EB_HOOK_NULL, NULL} }; static const EB_Hook text_hooks[] = { {EB_HOOK_NARROW_FONT, hook_narrow_font_text}, {EB_HOOK_WIDE_FONT, hook_wide_font_text}, {EB_HOOK_NULL, NULL} }; static const EB_Hook bitmap_hooks[] = { {EB_HOOK_NARROW_FONT, hook_narrow_font_bitmap}, {EB_HOOK_WIDE_FONT, hook_wide_font_bitmap}, {EB_HOOK_NULL, NULL} }; /* * Set `common_hooks[]' to `hookset'. */ void set_common_hooks(EB_Hookset *hookset) { eb_set_hooks(hookset, (EB_Hook *)common_hooks); } /* * Set `bitmap_hooks[]' to `hookset'. */ void set_bitmap_hooks(EB_Hookset *hookset) { eb_set_hooks(hookset, (EB_Hook *)bitmap_hooks); } /* * Set `text_hooks[]' to `hookset'. */ void set_text_hooks(EB_Hookset *hookset) { eb_set_hooks(hookset, (EB_Hook *)text_hooks); } /* * Hook for narrow font characters. */ static int hook_narrow_font_text(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { char alt_text[EB_MAX_ALTERNATION_TEXT_LENGTH + 1]; if (eb_narrow_alt_character_text(appendix, argv[0], alt_text) != EB_SUCCESS) sprintf(alt_text, "#%04x", argv[0]); eb_write_text_string(book, alt_text); return EB_SUCCESS; } /* * Hook for narrow font characters. */ static int hook_narrow_font_bitmap(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { char tag[NDTP_MAX_TAG_LENGTH + 1]; sprintf(tag, "", argv[0]); eb_write_text_string(book, tag); return EB_SUCCESS; } /* * Hook for wide font characters. */ static int hook_wide_font_text(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { char alt_text[EB_MAX_ALTERNATION_TEXT_LENGTH + 1]; if (eb_wide_alt_character_text(appendix, argv[0], alt_text) != EB_SUCCESS) sprintf(alt_text, "#%04x", argv[0]); eb_write_text_string(book, alt_text); return EB_SUCCESS; } /* * Hook for wide font characters. */ static int hook_wide_font_bitmap(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { char tag[NDTP_MAX_TAG_LENGTH + 1]; sprintf(tag, "", argv[0]); eb_write_text_string(book, tag); return EB_SUCCESS; } /* * Hook for a reference to text. */ static int hook_reference(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { char tag[NDTP_MAX_TAG_LENGTH + 1]; sprintf(tag, "<%x:%x>", argv[1], argv[2]); eb_write_text_string(book, tag); return EB_SUCCESS; } /* * Hook for beginning of superscript or subscript. */ static int hook_begin_script(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { eb_write_text_byte1(book, '('); return EB_SUCCESS; } /* * Hook for end of superscript or subscript. */ static int hook_end_script(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { eb_write_text_byte1(book, ')'); return EB_SUCCESS; } /* * Hook for a GB 2312 character. */ static int hook_gb2312(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { char tag[NDTP_MAX_TAG_LENGTH + 1]; unsigned char c1, c2; c1 = (argv[0] >> 8) & 0xff; c2 = argv[0] & 0xff; sprintf(tag, "<&g0:%02d%02d>", c1 - 0xa0, c2 - 0xa0); eb_write_text_string(book, tag); return EB_SUCCESS; } ebnetd-1.0.dfsg.1/ndtpd/ndtpstat.in0000644000175000017500000001246407673055411016533 0ustar mhattamhatta#! @PERL@ eval 'exec @PERL@ -S $0 ${1+"$@"}' if 0; # -*- Perl -*- # Copyright (c) 1997 - 2003 # Motoyuki Kasahara # # This program 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, or (at your option) # any later version. # # This program 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. # # Program name, program version and mailing address. $progname ='ndtpstat'; $version = '@VERSION@'; $mailing_address = '@MAILING_ADDRESS@'; $help = "Usage: $progname [option...] [syslog-file...] Options: -h --help display this help, then exit -v --version display version number, then exit Arguments: syslog-file syslog file Report bugs to $mailing_address. "; # Copyright message. $copyright = "Copyright (c) 1997 - 2003 Motoyuki Kasahara "; $tryhelp = "try \`$0 --help\' for more information\n"; @option_list = ('-h --help no-argument', '-v --version no-argument'); # # Parse command line options. # &getopt_initialize(@option_list); while (($opt, $arg) = &getopt_long) { if ($opt eq '-h') { print $help; exit(0); } elsif ($opt eq '-v') { print "$progname (EBNETD) version $version\n"; print $copyright; exit(0); } else { die $tryhelp; } } # # Scan logs. # while (<>) { next unless (s/^.* ndtpd\[\d+\]: ([^:]+): //); $status = $1; foreach $i (split(/, /)) { next unless (($name, $value) = ($i =~ /^([^=]+)=(.*)$/)); if ($name eq 'host') { $value =~ s/^\?\((.*)\)$/$1/; $value =~ s/^(.*)\(.*\)$/$1/; $value = '(test-mode)' if ($value =~ /^\//); } $field{$name} = $value; } if ($status =~ /connected$/) { $permconn{$field{'host'}}++; $permconn_total++; } elsif ($status =~ /connection denied$/) { $denyconn{$field{'host'}}++; $denyconn_total++; } elsif ($status =~ /succeeded$/) { if ($field{'command'} eq 'L') { $set{$field{'book'}}++; $access{$field{'book'}}++; $set_total++; $access_total++; } elsif ($field{'command'} eq 'P') { $search{$field{'book'}}++; $access{$field{'book'}}++; $search_total++; $access_total++; } elsif ($field{'command'} eq 'F' || $field{'command'} eq 'S' || $field{'command'} eq 'XF' || $field{'command'} eq 'XS') { $sendtext{$field{'book'}}++; $access{$field{'book'}}++; $sendtext_total++; $access_total++; } elsif ($field{'command'} eq 'XI' || $field{'command'} eq 'XL' || $field{'command'} eq 'XB' || $field{'command'} eq 'Xb') { $others{$field{'book'}}++; $access{$field{'book'}}++; $others_total++; $access_total++; } } elsif ($status =~ /denied$/) { $denybook{$field{'host'}}++; $denybook_total++; } } # # Output header. # print "############################################################################\n"; print "# NDTPD statistics\n"; print "############################################################################\n\n"; if ($permconn_total == 0 && $denyconn_total == 0 && $access_total == 0 && $denybook_total == 0) { print "(no access from client)\n"; exit; } # # Output the `Permitted Connections to the server' list. # print "Permitted Connections to the server:\n\n"; printf "%-32s %7s\n", 'client', 'counts'; print "-----------------------------------------\n"; foreach $i (sort {$permconn{$b} <=> $permconn{$a}} keys(%permconn)) { printf "%-32s %7d\n", $i, $permconn{$i}; } print "-----------------------------------------\n"; printf "%-32s %7d\n\n\n", 'total', $permconn_total; # # Output the `Denied connections to the server' list. # print "Denied connections to the server:\n\n"; printf "%-32s %7s\n", 'client', 'counts'; print "-----------------------------------------\n"; foreach $i (sort {$denyconn{$b} <=> $denyconn{$a}} keys(%denyconn)) { printf "%-32s %7d\n", $i, $denyconn{$i}; } print "-----------------------------------------\n"; printf "%-32s %7d\n\n\n", 'total', $denyconn_total; # # Output the `Accesses to book' list. # print "Accesses to book:\n\n"; printf "%-24s %8s (= %6s + %7s + %7s + %7s)\n", 'book', 'access', 'set', 'search', 'text', 'others'; print "----------------------------------------------------------------------------\n"; foreach $i (sort {$access{$b} <=> $access{$a}} keys(%access)) { printf "%-24s %8d (= %6d + %7d + %7d + %7d)\n", $i, $access{$i}, $set{$i}, $search{$i}, $sendtext{$i}, $others{$i}; } print "----------------------------------------------------------------------------\n"; printf "%-24s %8d (= %6d + %7d + %7d + %7d)\n\n\n", 'total', $access_total, $set_total, $search_total, $sendtext_total, $others_total; # # Output the `Denied accesses to book' list. # print "Denied accesses to book:\n\n"; printf "%-32s %7s\n", 'client', 'counts'; print "-----------------------------------------\n"; foreach $i (sort {$denybook{$b} <=> $denybook{$a}} keys(%denybook)) { printf "%-32s %7d\n", $i, $denybook{$i}; } print "-----------------------------------------\n"; printf "%-32s %7d\n\n\n", 'total', $denybook_total; # Local Variables: # mode: perl # End: ebnetd-1.0.dfsg.1/ebhttpd/0000755000175000017500000000000007773515160014657 5ustar mhattamhattaebnetd-1.0.dfsg.1/ebhttpd/cgiquery.h0000644000175000017500000000316507673055343016666 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef CGIQUERY_H #define CGIQUERY_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * A `name=value' pair in CGI Query */ typedef struct CGI_Query_Element_Struct CGI_Query_Element; struct CGI_Query_Element_Struct { char *name; char *value; CGI_Query_Element *next; }; /* * CGI Query. */ typedef struct { int element_count; CGI_Query_Element *elements; char *elements_buffer; } CGI_Query; /* * Function Declarations. */ #ifdef __STDC__ void cgi_query_initialize(CGI_Query *); void cgi_query_finalize(CGI_Query *); const char *cgi_query_element_value(CGI_Query *, const char *); const char *cgi_query_element_string_value(CGI_Query *, const char *); int cgi_query_element_integer_value(CGI_Query *, const char *); int cgi_query_parse_string(CGI_Query *, const char *); #else /* not __STDC__ */ void cgi_query_initialize(); void cgi_query_finalize(); const char *cgi_query_element_value(); const char *cgi_query_element_string_value(); const char *cgi_query_element_integer_value(); int cgi_query_parse_string(); #endif /* not __STDC__ */ #endif /* not CGIQUERY_H */ ebnetd-1.0.dfsg.1/ebhttpd/entity.h0000644000175000017500000000154607673055340016350 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef ENTITY_H #define ENTITY_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * Max length of an HTML entity name (e.g. "÷"). * Note that the name includes `&' and `;'. */ #define MAX_ENTITY_NAME_LENGTH 8 /* * Global variables. */ extern const char *latin1_entity_name_table[]; #endif /* ENTITY_H */ ebnetd-1.0.dfsg.1/ebhttpd/http.h0000644000175000017500000001256507673055340016016 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef HTTP_H #define HTTP_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "defs.h" #include "httprequest.h" /* * Default charset of text content. */ #define DEFAULT_CONTENT_CHARSET "euc-jp" /* * Whether response entity is sent or not, and if sent, what transfer * encoding will be used (`chunked' or `asis'). */ #define ENTITY_TRANSFER_NONE 0 #define ENTITY_TRANSFER_ASIS 1 #define ENTITY_TRANSFER_CHUNKED 2 /* * Type definitions. */ typedef struct Entity_Generator_Struct Entity_Generator; typedef struct Response_Property_Struct Response_Property; /* * Entity generator. */ struct Entity_Generator_Struct { const char *pattern; const char *content_type; const char *content_charset; void (*function) EBNETD_P((Response_Property *)); }; /* * Various properties for generating response entity. */ struct Response_Property_Struct { /* * Parser status. */ HTTP_Status_Code status; /* * Entity generator. */ const Entity_Generator *entity_generator; /* * Whether response entity is sent or not, and if sent, what * transfer encoding will be used. */ int entity_transfer_mode; /* * Whether an error occured in sending response data. */ int response_error_flag; /* * HTTP response code. */ int response_code; /* * Current book. */ Book *book; /* * Current subbook name. */ char subbook_name[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; /* * Current subbook title. */ char subbook_title[EB_MAX_TITLE_LENGTH + 1]; /* * Current input words. * Represented as `word1', `word2' ... in CGI query. */ char input_words[EB_MAX_KEYWORDS][EB_MAX_WORD_LENGTH + 1]; /* * Current multi search. */ EB_Multi_Search_Code multi_search; /* * Current multi search entry. * Represented as `select' in CGI query. */ EB_Multi_Entry_Code multi_entry; /* * Current whence of the hit entries. * Represented as `whence' in CGI query. */ int whence; /* * Current text page and offset. * Represented as `page' and `offset' in CGI query. */ EB_Position position; /* * Local character number. * Represented as `char' in CGI query. */ int local_character; /* * Data size for WAVE sound data. * Represented as `size' in CGI query. */ size_t size; /* * Width for monochrome graphic data. * Represented as `width' in CGI query. */ size_t width; /* * Width for monochrome graphic data. * Represented as `width' in CGI query. */ size_t height; /* * Data size for MPEG movie data. * Represented as `filename' in CGI query. */ char file_name[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; /* * Hookset to generate HTML. */ EB_Hookset *hookset; }; /* * Function Declaration. */ /* hookest.c */ void set_html_hooks EBNETD_P((EB_Hookset *)); /* http.c */ void output_string EBNETD_P((Response_Property *, const char *)); void output_data EBNETD_P((Response_Property *, const char *, size_t)); void output_cgi_string EBNETD_P((Response_Property *, const char *)); void output_html_safe_string EBNETD_P((Response_Property *, const char *)); void output_euc_html_safe_string EBNETD_P((Response_Property *, const char *)); void output_latin1_html_safe_string EBNETD_P((Response_Property *, const char *)); /* generator.c */ void output_error_message EBNETD_P((Response_Property *)); void output_book_list EBNETD_P((Response_Property *)); void output_subbook_list EBNETD_P((Response_Property *)); void output_method_list EBNETD_P((Response_Property *)); void output_word_form EBNETD_P((Response_Property *)); void output_exactword_form EBNETD_P((Response_Property *)); void output_endword_form EBNETD_P((Response_Property *)); void output_keyword_form EBNETD_P((Response_Property *)); void output_multi_form EBNETD_P((Response_Property *)); void output_search_word EBNETD_P((Response_Property *)); void output_search_exactword EBNETD_P((Response_Property *)); void output_search_endword EBNETD_P((Response_Property *)); void output_search_keyword EBNETD_P((Response_Property *)); void output_search_multi EBNETD_P((Response_Property *)); void output_text EBNETD_P((Response_Property *)); void output_narrow_font_character EBNETD_P((Response_Property *)); void output_wide_font_character EBNETD_P((Response_Property *)); void output_mono_graphic EBNETD_P((Response_Property *)); void output_gray_graphic EBNETD_P((Response_Property *)); void output_color_graphic EBNETD_P((Response_Property *)); void output_wave EBNETD_P((Response_Property *)); void output_mpeg EBNETD_P((Response_Property *)); #endif /* not HTTP_H */ ebnetd-1.0.dfsg.1/ebhttpd/httpdate.h0000644000175000017500000000246307773152666016662 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef HTTPDATE_H #define HTTPDATE_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef TIME_WITH_SYS_TIME #include #include #else #ifdef HAVE_SYS_TIME_H #include #else #include #endif #endif /* * The length of an HTTP date (e.g. "Tue, 25 Jun 1997 03:57:33 GMT"). */ #define HTTP_DATE_STRING_LENGTH 30 /* * Function Declarations. */ #ifdef __STDC__ int http_make_date(char *); int http_make_date2(char *, const struct tm *); int http_compare_date(struct tm *, struct tm *); int http_parse_date(const char *, struct tm *); void http_set_origin_date(struct tm *); #else int http_make_date(); int http_make_date2(); int http_compare_date(); int http_parse_date(); void http_set_origin_date(); #endif #endif /* not HTTPDATE_H */ ebnetd-1.0.dfsg.1/ebhttpd/httprequest.h0000644000175000017500000001434407773152707017432 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef HTTPREQUEST_H #define HTTPREQUEST_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifdef TIME_WITH_SYS_TIME #include #include #else #ifdef HAVE_SYS_TIME_H #include #else #include #endif #endif #include "urlparts.h" #include "httprescode.h" #include "linebuf.h" /* * Type for HTTP method code. */ typedef int HTTP_Method_Code; typedef int HTTP_Version_Code; /* * HTTP method codes. */ #define HTTP_METHOD_OPTIONS 0 #define HTTP_METHOD_GET 1 #define HTTP_METHOD_HEAD 2 #define HTTP_METHOD_POST 3 #define HTTP_METHOD_PUT 4 #define HTTP_METHOD_DELETE 5 #define HTTP_METHOD_TRACE 6 #define HTTP_METHOD_UNKNOWN -1 /* * HTTP version codes. */ #define HTTP_VERSION_0_9 0 #define HTTP_VERSION_1_0 1 #define HTTP_VERSION_1_1 2 #define HTTP_VERSION_HIGH 3 /* * HTTP trasfer coding type, and its values. */ typedef int HTTP_Transfer_Coding_Code; #define HTTP_MAX_TRANSFER_CODINGS 1 #define HTTP_TRANSFER_CODING_CHUNKED 0 /* * HTTP connection type, and its values. */ typedef int HTTP_Connection_Code; #define HTTP_MAX_CONNECTIONS 1 #define HTTP_CONNECTION_CLOSE 0 /* * HTTP internal status */ typedef int HTTP_Status_Code; #define HTTP_STATUS_CLOSE_IMMEDIATELY 0 #define HTTP_STATUS_CLOSE_AFTER_RESPOND 1 #define HTTP_STATUS_OPEN 2 /* * Maximum length definitions. */ #define HTTP_MAX_HOST_NAME_LENGTH 63 #define HTTP_MAX_LINE_LENGTH 1023 #define HTTP_MAX_HEADER_LENGTH 511 #define HTTP_MAX_URI_LENGTH 1023 #define HTTP_MAX_METHOD_LENGTH 15 #define HTTP_MAX_VERSION_LENGTH 15 /* * HTTP request. */ typedef struct { /* * Method (e.g. GET, POST, ...). */ HTTP_Method_Code method; /* * URL (e.g. "http://www.w3.org/"). */ URL_Parts url; /* * HTTP major and minor versions. */ HTTP_Version_Code version; /* * Content length specified by `Content-Length' */ size_t content_length; /* * Host name or IP address, and port specified by the `Host' * header field. */ char host[HTTP_MAX_HOST_NAME_LENGTH + 1]; in_port_t port; /* * Values of `Transfer-Encoding' header field. */ HTTP_Transfer_Coding_Code transfer_codings[HTTP_MAX_TRANSFER_CODINGS]; /* * Values of `Connection' header field. */ HTTP_Connection_Code connections[HTTP_MAX_CONNECTIONS]; /* * Date specified by `If-Modified-Since'. */ struct tm if_modified_since; /* * Response code. * (If the request parser finds an error, the parser sets this). */ HTTP_Response_Code response_code; /* * Parser status. */ HTTP_Status_Code status; } HTTP_Request; /* * Function Declarations. */ #ifdef __STDC__ /* httprequest.c */ void http_initialize_request(HTTP_Request *); void http_finalize_request(HTTP_Request *); int http_receive_request(HTTP_Request *, Line_Buffer *); HTTP_Method_Code http_request_method(HTTP_Request *); const char *http_request_method_string(HTTP_Request *); const char *http_request_url(HTTP_Request *); const char *http_request_url_scheme(HTTP_Request *); const char *http_request_url_user(HTTP_Request *); const char *http_request_url_password(HTTP_Request *); const char *http_request_url_host(HTTP_Request *); const char *http_request_url_port(HTTP_Request *); const char *http_request_url_path(HTTP_Request *); const char *http_request_url_params(HTTP_Request *); const char *http_request_url_query(HTTP_Request *); const char *http_request_url_fragment(HTTP_Request *); HTTP_Version_Code http_request_version(HTTP_Request *); const char *http_request_version_string(HTTP_Request *); size_t http_request_content_length(HTTP_Request *); const char *http_request_host(HTTP_Request *); int http_request_port(HTTP_Request *); struct tm *http_request_if_modified_since(HTTP_Request *); HTTP_Response_Code http_request_response_code(HTTP_Request *); HTTP_Status_Code http_request_status(HTTP_Request *); /* httpmisc.c */ void http_remove_header_spaces(char *); int http_parse_method(const char *, HTTP_Method_Code *); int http_parse_connection(const char *, HTTP_Connection_Code *); int http_parse_transfer_coding(const char *, HTTP_Transfer_Coding_Code *); int http_parse_content_length(const char *, size_t *); int http_parse_host(const char *, char *, in_port_t *); int http_parse_version(const char *, HTTP_Version_Code *); const char *http_method_string(HTTP_Method_Code); const char *http_version_string(HTTP_Version_Code); #else /* not __STDC__ */ /* httprequest.c */ void http_initialize_request(); void http_finalize_request(); int http_receive_request(); HTTP_Method_Code http_request_method(); const char *http_request_method_string(); const char *http_request_url(); const char *http_request_url_scheme(); const char *http_request_url_user(); const char *http_request_url_password(); const char *http_request_url_host(); const char *http_request_url_port(); const char *http_request_url_path(); const char *http_request_url_params(); const char *http_request_url_query(); const char *http_request_url_fragment(); HTTP_Version_Code http_request_version(); const char *http_request_version_string(); size_t http_request_content_length(); const char *http_request_host(); int http_request_port(); struct tm *http_request_if_modified_since(); HTTP_Response_Code http_request_response_code(); HTTP_Status_Code http_request_status(); /* httpmisc.c */ void http_remove_header_spaces(); int http_parse_method(); int http_parse_connection(); int http_parse_transfer_coding(); int http_parse_content_length(); int http_parse_host(); int http_parse_version(); const char *http_method_string(); const char *http_version_string(); #endif /* not __STDC__ */ #endif /* not HTTPREQUEST_H */ ebnetd-1.0.dfsg.1/ebhttpd/httprescode.h0000644000175000017500000000505207673055343017357 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef HTTPRESPONSE_H #define HTTPRESPONSE_H /* * Type for HTTP response code. */ typedef int HTTP_Response_Code; /* * HTTP response codes. */ /* 1xx -- Informational */ #define HTTP_RESPONSE_CONTINUE 100 #define HTTP_RESPONSE_SWITCHING_PROTOCOLS 101 /* 2xx -- Successful */ #define HTTP_RESPONSE_OK 200 #define HTTP_RESPONSE_CREATED 201 #define HTTP_RESPONSE_ACCEPTED 202 #define HTTP_RESPONSE_NON_AUTHORITATIVE_INFORMATION 203 #define HTTP_RESPONSE_NO_CONTENT 204 #define HTTP_RESPONSE_RESET_CONTENT 205 #define HTTP_RESPONSE_PARTIAL_CONTENT 206 /* 3xx -- Redirection */ #define HTTP_RESPONSE_MULTIPUL_CHOISES 300 #define HTTP_RESPONSE_MOVED_PERMANENTLY 301 #define HTTP_RESPONSE_MOVED_TEMPORARILY 302 #define HTTP_RESPONSE_SEE_OTHER 303 #define HTTP_RESPONSE_NOT_MODIFIED 304 #define HTTP_RESPONSE_USE_PROXY 305 /* 4xx -- Error */ #define HTTP_RESPONSE_BAD_REQUEST 400 #define HTTP_RESPONSE_UNAUTHORIZED 401 #define HTTP_RESPONSE_PAYMENT_REQUIRED 402 #define HTTP_RESPONSE_FORBIDDEN 403 #define HTTP_RESPONSE_NOT_FOUND 404 #define HTTP_RESPONSE_METHOD_NOT_ALLOWED 405 #define HTTP_RESPONSE_NOT_ACCEPTABLE 406 #define HTTP_RESPONSE_PROXY_AUTHENTICATION_REQUIRED 407 #define HTTP_RESPONSE_REQUEST_TIME_OUT 408 #define HTTP_RESPONSE_CONFLICT 409 #define HTTP_RESPONSE_GONE 410 #define HTTP_RESPONSE_LENGTH_REQUIRED 411 #define HTTP_RESPONSE_PRECONDITION_FAILED 412 #define HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE 413 #define HTTP_RESPONSE_REQUEST_URI_TOO_LARGE 414 #define HTTP_RESPONSE_UNSUPPORTED_MEDIA_TYPE 415 /* 5xx -- Server Error */ #define HTTP_RESPONSE_INTERNAL_SERVER_ERROR 500 #define HTTP_RESPONSE_NOT_IMPLEMENTED 501 #define HTTP_RESPONSE_BAD_GATEWAY 502 #define HTTP_RESPONSE_SERVICE_UNAVAILABLE 503 #define HTTP_RESPONSE_GATEWAY_TIME_OUT 504 #define HTTP_RESPONSE_HTTP_VERSION_NOT_SUPPORTED 505 #ifdef __STDC__ const char *http_response_code_message(HTTP_Response_Code); #else const char *http_response_code_message(); #endif #endif /* not HTTPRESPONSE_H */ ebnetd-1.0.dfsg.1/ebhttpd/pathparts.h0000644000175000017500000000313307673055335017040 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef PATHPARTS_H #define PATHPARTS_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * Segments in a path. */ typedef struct { int is_absolute; /* true if this is absolute path */ char **segments; /* segment list */ int segment_count; /* the number of segments */ char *leaf; /* leaf path of a path */ char *buffer; /* buffer of `segments' */ } Path_Parts; /* * Function Declarations. */ #ifdef __STDC__ void path_parts_initialize(Path_Parts *); void path_parts_finalize(Path_Parts *); int path_parts_parse(Path_Parts *, const char *); int path_parts_segment_count(Path_Parts *); const char *path_parts_leaf(Path_Parts *); const char *path_parts_segment(Path_Parts *, int); int path_parts_is_absolute(Path_Parts *); int path_parts_is_relative(Path_Parts *); #else void path_parts_initialize(); void path_parts_finalize(); int path_parts_parse(); int path_parts_segment_count(); const char *path_parts_segment(); const char *path_parts_leaf(); int path_parts_is_absolute(); int path_parts_is_relative(); #endif #endif /* not PATHPARTS_H */ ebnetd-1.0.dfsg.1/ebhttpd/urlparts.h0000644000175000017500000000372407673055337016716 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifndef URLPARTS_H #define URLPARTS_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * URL Parts. */ typedef struct { char *url; char *scheme; char *user; char *password; char *host; char *port; char *path; char *params; char *query; char *fragment; char *buffer; } URL_Parts; /* * Function Declarations. */ #ifdef __STDC__ void url_parts_initialize(URL_Parts *); void url_parts_finalize(URL_Parts *); const char *url_parts_url(URL_Parts *); const char *url_parts_scheme(URL_Parts *); const char *url_parts_user(URL_Parts *); const char *url_parts_password(URL_Parts *); const char *url_parts_host(URL_Parts *); const char *url_parts_port(URL_Parts *); const char *url_parts_path(URL_Parts *); const char *url_parts_params(URL_Parts *); const char *url_parts_query(URL_Parts *); const char *url_parts_fragment(URL_Parts *); int url_parts_parse(URL_Parts *, const char *); void url_parts_print(URL_Parts *); #else /* not __STDC__ */ void url_parts_initialize(); void url_parts_finalize(); const char *url_parts_url(); const char *url_parts_scheme(); const char *url_parts_user(); const char *url_parts_password(); const char *url_parts_host(); const char *url_parts_port(); const char *url_parts_path(); const char *url_parts_params(); const char *url_parts_query(); const char *url_parts_fragment(); int url_parts_parse(); void url_parts_print(); #endif /* not __STDC__ */ #endif /* not URLPARTS_H */ ebnetd-1.0.dfsg.1/ebhttpd/Makefile.am0000644000175000017500000000411107737407150016707 0ustar mhattamhatta@SET_MAKE@ pkglocalstatedir = $(localstatedir)/ebnetd logdir = @logdir@ LIBEBNETD = $(top_builddir)/lib/libebnetd.a sbin_PROGRAMS = ebhttpd ebhtcheck ebhtcontrol libexec_SCRIPTS = ebhtstat ebhttpd_SOURCES = book.c config.c global.c misc.c ebhttpd.c \ cgiquery.c entity.c generator.c hookset.c httpdate.c http.c \ httpmisc.c httprequest.c httprescode.c pathparts.c urlparts.c ebhttpd_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ebhttpd_DEPENDENCIES = $(LIBEBNETD) ebhtcheck_SOURCES = book.c config.c global.c ebhtcheck.c misc.c ebhtcheck_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ebhtcheck_DEPENDENCIES = $(LIBEBNETD) ebhtcontrol_SOURCES = book.c config.c global.c ebhtcontrol.c misc.c ebhtcontrol_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ebhtcontrol_DEPENDENCIES = $(LIBEBNETD) INCLUDES = -DUSE_FAKELOG -DEBHTTPD -I$(top_srcdir) -I$(top_srcdir)/lib \ $(EBCONF_EBINCS) $(EBCONF_ZLIBINCS) $(EBCONF_INTLINCS) EXTRA_DIST = ebhtstat.in CLEANFILES = defs.h stamp-defs-h defs.h.tmp ebhtstat ebhtstat.tmp DISTCLEANFILES = book.c config.c defs.h.in global.c misc.c ebhttpd.c \ ebhtcheck.c ebhtcontrol.c getopt_long.pl BUILT_SOURCES = defs.h noinst_HEADERS = cgiquery.h entity.h http.h httpdate.h httprequest.h \ httprescode.h pathparts.h urlparts.h defs.h: stamp-defs-h stamp-defs-h: defs.h.in Makefile rm -f defs.h.tmp echo '/* automatically generated from defs.h.in. */' \ > defs.h.tmp sed -e 's;\@sysconfdir\@;$(sysconfdir);' \ -e 's;\@pkglocalstatedir\@;$(pkglocalstatedir);' \ defs.h.in >> defs.h.tmp $(top_srcdir)/move-if-change defs.h.tmp defs.h @echo timestamp > stamp-defs-h ebhtstat: getopt_long.pl ebhtstat.in Makefile rm -f ebhtstat sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/ebhtstat.in | sed '/^$$/q' > ebhtstat.tmp cat getopt_long.pl >> ebhtstat.tmp sed -e 's;\@VERSION\@;$(VERSION);' \ -e 's;\@MAILING_ADDRESS\@;$(MAILING_ADDRESS);' \ $(srcdir)/ebhtstat.in | sed '1,/^$$/d' >> ebhtstat.tmp cp ebhtstat.tmp ebhtstat chmod +x ebhtstat rm -f ebhtstat.tmp ebnetd-1.0.dfsg.1/ebhttpd/Makefile.in0000644000175000017500000005076307773515023016735 0ustar mhattamhatta# Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ # Copyright (C) 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. # 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. @SET_MAKE@ SOURCES = $(ebhtcheck_SOURCES) $(ebhtcontrol_SOURCES) $(ebhttpd_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ sbin_PROGRAMS = ebhttpd$(EXEEXT) ebhtcheck$(EXEEXT) \ ebhtcontrol$(EXEEXT) subdir = ebhttpd DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/eb4.m4 \ $(top_srcdir)/m4/herrno.m4 $(top_srcdir)/m4/in6addr.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/sockaddrin6.m4 \ $(top_srcdir)/m4/sockinttypes.m4 $(top_srcdir)/m4/unionwait.m4 \ $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = book.c config.c defs.h.in ebhtcheck.c \ ebhtcontrol.c ebhttpd.c global.c misc.c getopt_long.pl am__installdirs = $(DESTDIR)$(sbindir) $(DESTDIR)$(libexecdir) sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_ebhtcheck_OBJECTS = book.$(OBJEXT) config.$(OBJEXT) \ global.$(OBJEXT) ebhtcheck.$(OBJEXT) misc.$(OBJEXT) ebhtcheck_OBJECTS = $(am_ebhtcheck_OBJECTS) am__DEPENDENCIES_1 = $(top_builddir)/lib/libebnetd.a am__DEPENDENCIES_2 = am_ebhtcontrol_OBJECTS = book.$(OBJEXT) config.$(OBJEXT) \ global.$(OBJEXT) ebhtcontrol.$(OBJEXT) misc.$(OBJEXT) ebhtcontrol_OBJECTS = $(am_ebhtcontrol_OBJECTS) am_ebhttpd_OBJECTS = book.$(OBJEXT) config.$(OBJEXT) global.$(OBJEXT) \ misc.$(OBJEXT) ebhttpd.$(OBJEXT) cgiquery.$(OBJEXT) \ entity.$(OBJEXT) generator.$(OBJEXT) hookset.$(OBJEXT) \ httpdate.$(OBJEXT) http.$(OBJEXT) httpmisc.$(OBJEXT) \ httprequest.$(OBJEXT) httprescode.$(OBJEXT) \ pathparts.$(OBJEXT) urlparts.$(OBJEXT) ebhttpd_OBJECTS = $(am_ebhttpd_OBJECTS) libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(libexec_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/book.Po ./$(DEPDIR)/cgiquery.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/config.Po ./$(DEPDIR)/ebhtcheck.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/ebhtcontrol.Po ./$(DEPDIR)/ebhttpd.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/entity.Po ./$(DEPDIR)/generator.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/global.Po ./$(DEPDIR)/hookset.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/http.Po ./$(DEPDIR)/httpdate.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/httpmisc.Po ./$(DEPDIR)/httprequest.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/httprescode.Po ./$(DEPDIR)/misc.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/pathparts.Po ./$(DEPDIR)/urlparts.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(ebhtcheck_SOURCES) $(ebhtcontrol_SOURCES) \ $(ebhttpd_SOURCES) DIST_SOURCES = $(ebhtcheck_SOURCES) $(ebhtcontrol_SOURCES) \ $(ebhttpd_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS = @COMPRESS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ EBCONF_EBINCS = @EBCONF_EBINCS@ EBCONF_EBLIBS = @EBCONF_EBLIBS@ EBCONF_INTLINCS = @EBCONF_INTLINCS@ EBCONF_INTLLIBS = @EBCONF_INTLLIBS@ EBCONF_PTHREAD_CFLAGS = @EBCONF_PTHREAD_CFLAGS@ EBCONF_PTHREAD_CPPFLAGS = @EBCONF_PTHREAD_CPPFLAGS@ EBCONF_PTHREAD_LDFLAGS = @EBCONF_PTHREAD_LDFLAGS@ EBCONF_ZLIBINCS = @EBCONF_ZLIBINCS@ EBCONF_ZLIBLIBS = @EBCONF_ZLIBLIBS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GZIPCMD = @GZIPCMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAILING_ADDRESS = @MAILING_ADDRESS@ MAILX = @MAILX@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ pkglocalstatedir = $(localstatedir)/ebnetd LIBEBNETD = $(top_builddir)/lib/libebnetd.a libexec_SCRIPTS = ebhtstat ebhttpd_SOURCES = book.c config.c global.c misc.c ebhttpd.c \ cgiquery.c entity.c generator.c hookset.c httpdate.c http.c \ httpmisc.c httprequest.c httprescode.c pathparts.c urlparts.c ebhttpd_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ebhttpd_DEPENDENCIES = $(LIBEBNETD) ebhtcheck_SOURCES = book.c config.c global.c ebhtcheck.c misc.c ebhtcheck_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ebhtcheck_DEPENDENCIES = $(LIBEBNETD) ebhtcontrol_SOURCES = book.c config.c global.c ebhtcontrol.c misc.c ebhtcontrol_LDADD = $(LIBEBNETD) $(EBCONF_EBLIBS) $(EBCONF_ZLIBLIBS) \ $(EBCONF_INTLLIBS) ebhtcontrol_DEPENDENCIES = $(LIBEBNETD) INCLUDES = -DUSE_FAKELOG -DEBHTTPD -I$(top_srcdir) -I$(top_srcdir)/lib \ $(EBCONF_EBINCS) $(EBCONF_ZLIBINCS) $(EBCONF_INTLINCS) EXTRA_DIST = ebhtstat.in CLEANFILES = defs.h stamp-defs-h defs.h.tmp ebhtstat ebhtstat.tmp DISTCLEANFILES = book.c config.c defs.h.in global.c misc.c ebhttpd.c \ ebhtcheck.c ebhtcontrol.c getopt_long.pl BUILT_SOURCES = defs.h noinst_HEADERS = cgiquery.h entity.h http.h httpdate.h httprequest.h \ httprescode.h pathparts.h urlparts.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ebhttpd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu ebhttpd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ rm -f $(DESTDIR)$(sbindir)/$$f; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done ebhtcheck$(EXEEXT): $(ebhtcheck_OBJECTS) $(ebhtcheck_DEPENDENCIES) @rm -f ebhtcheck$(EXEEXT) $(LINK) $(ebhtcheck_LDFLAGS) $(ebhtcheck_OBJECTS) $(ebhtcheck_LDADD) $(LIBS) ebhtcontrol$(EXEEXT): $(ebhtcontrol_OBJECTS) $(ebhtcontrol_DEPENDENCIES) @rm -f ebhtcontrol$(EXEEXT) $(LINK) $(ebhtcontrol_LDFLAGS) $(ebhtcontrol_OBJECTS) $(ebhtcontrol_LDADD) $(LIBS) ebhttpd$(EXEEXT): $(ebhttpd_OBJECTS) $(ebhttpd_DEPENDENCIES) @rm -f ebhttpd$(EXEEXT) $(LINK) $(ebhttpd_LDFLAGS) $(ebhttpd_OBJECTS) $(ebhttpd_LDADD) $(LIBS) install-libexecSCRIPTS: $(libexec_SCRIPTS) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(libexecdir) @list='$(libexec_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(libexecSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(libexecdir)/$$f"; \ $(libexecSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(libexecdir)/$$f; \ else :; fi; \ done uninstall-libexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(libexec_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f $(DESTDIR)$(libexecdir)/$$f"; \ rm -f $(DESTDIR)$(libexecdir)/$$f; \ done mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/book.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgiquery.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebhtcheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebhtcontrol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebhttpd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entity.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hookset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpdate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpmisc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httprequest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httprescode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pathparts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/urlparts.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: 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: TAGS 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 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"; \ $(mkdir_p) "$(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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(HEADERS) installdirs: $(mkdir_p) $(DESTDIR)$(sbindir) $(DESTDIR)$(libexecdir) install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-libexecSCRIPTS install-sbinPROGRAMS 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-libexecSCRIPTS \ uninstall-sbinPROGRAMS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libexecSCRIPTS install-man install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am uninstall-libexecSCRIPTS \ uninstall-sbinPROGRAMS @SET_MAKE@ defs.h: stamp-defs-h stamp-defs-h: defs.h.in Makefile rm -f defs.h.tmp echo '/* automatically generated from defs.h.in. */' \ > defs.h.tmp sed -e 's;\@sysconfdir\@;$(sysconfdir);' \ -e 's;\@pkglocalstatedir\@;$(pkglocalstatedir);' \ defs.h.in >> defs.h.tmp $(top_srcdir)/move-if-change defs.h.tmp defs.h @echo timestamp > stamp-defs-h ebhtstat: getopt_long.pl ebhtstat.in Makefile rm -f ebhtstat sed -e 's;\@PERL\@;$(PERL);' \ $(srcdir)/ebhtstat.in | sed '/^$$/q' > ebhtstat.tmp cat getopt_long.pl >> ebhtstat.tmp sed -e 's;\@VERSION\@;$(VERSION);' \ -e 's;\@MAILING_ADDRESS\@;$(MAILING_ADDRESS);' \ $(srcdir)/ebhtstat.in | sed '1,/^$$/d' >> ebhtstat.tmp cp ebhtstat.tmp ebhtstat chmod +x ebhtstat rm -f ebhtstat.tmp # 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: ebnetd-1.0.dfsg.1/ebhttpd/book.c0000644000175000017500000002143207673055357015765 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #if defined(NDTPD) || defined(EBHTTPD) #include #include #endif #if defined(EBNETD) #include "ebtiny/eb.h" #include "ebtiny/appendix.h" #endif #include "fakelog.h" #include "permission.h" #include "ticket.h" #include "wildcard.h" #include "defs.h" /* * Initialize the book list `book_registry'. */ void initialize_book_registry() { book_registry = NULL; book_count = 0; } /* * Clear the book list `book_registry'. * Free all nodes and allocated memories in `book_registry', * and then set it to NULL. */ void finalize_book_registry() { Book *book = book_registry; Book *next; /* * Reset books list. Free all malloced memories. */ while (book != NULL) { next = book->next; delete_book(book); book = next; } book_registry = NULL; book_count = 0; } /* * Count books in `book_registry'. */ int count_book_registry() { Book *book; int count; for (book = book_registry, count = 0; book != NULL; book = book->next, count++) ; return count; } /* * Bind all books and appendixes in `book_registry'. */ int activate_book_registry() { Book *book; EB_Error_Code error_code; int available_count = 0; char lock_file_name[PATH_MAX + 1]; /* * If there is no book in the registry, do nothing. */ if (book_registry == NULL) return 0; for (book = book_registry; book != NULL; book = book->next) { /* * Bind a book. */ error_code = eb_bind(&book->book, book->path); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "the book is not available, %s: %s", eb_error_message(error_code), book->path); delete_book(book); continue; } available_count++; /* * Initialize all subbooks when running as a standalone daemon. */ if (server_mode == SERVER_MODE_STANDALONE) eb_load_all_subbooks(&book->book); /* * Bind a ticket stock for the book. */ if (book->max_clients != 0) { sprintf(lock_file_name, "%s/%s.%s", work_path, book->name, BOOK_LOCK_SUFFIX); if (bind_ticket_stock(&book->ticket_stock, lock_file_name, book->max_clients) < 0) return -1; } if (book->appendix_path != NULL) { /* * Bind an appendix. */ error_code = eb_bind_appendix(&book->appendix, book->appendix_path); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "the appendix is not available, %s: %s", eb_error_message(error_code), book->appendix_path); continue; } /* * Initialize all subbooks when running as a standalone daemon. */ if (server_mode == SERVER_MODE_STANDALONE) eb_load_all_appendix_subbooks(&book->appendix); } } return available_count; } /* * Add a new book to `book_registry'. * Upon successful, a pointer to the added book is returned. * Otherwise NULL is returned. */ Book * add_book() { Book *new_book; Book *book; int i; new_book = (Book *)malloc(sizeof(Book)); if (new_book == NULL) { syslog(LOG_ERR, "memory exhausted"); return NULL; } /* * Set initial values to the new book. */ eb_initialize_book(&new_book->book); eb_initialize_appendix(&new_book->appendix); new_book->path = NULL; new_book->appendix_path = NULL; new_book->name[0] = '\0'; new_book->title[0] = '\0'; new_book->max_clients = DEFAULT_BOOK_MAX_CLIENTS; initialize_permission(&new_book->permissions); initialize_ticket_stock(&new_book->ticket_stock); new_book->next = NULL; if (book_count == 0) book_registry = new_book; else { book = book_registry; for (i = 1; i < book_count; i++) book = book->next; book->next = new_book; } book_count++; return new_book; } /* * Delete `target_book' from `book_registry'. * Return 0 upon success, -1 otherwise. */ int delete_book(target_book) Book *target_book; { Book *book; if (book_registry == target_book) book_registry = target_book->next; else { for (book = book_registry; book != NULL; book = book->next) { if (book->next == target_book) { book->next = target_book->next; break; } } if (book == NULL) return -1; } finalize_permission(&target_book->permissions); finalize_ticket_stock(&target_book->ticket_stock); eb_finalize_book(&target_book->book); eb_finalize_appendix(&target_book->appendix); if (target_book->path != NULL) free(target_book->path); if (target_book->appendix_path != NULL) free(target_book->appendix_path); free(target_book); return 0; } /* * Find the bound book with `name' in `book_regitry'. * * If found, the pointer to the book is returned. * Otherwise NULL is returned. */ Book * find_book(name) const char *name; { Book *book; /* * Find the bound book. */ for (book = book_registry; book != NULL; book = book->next) { if (strcasecmp(book->name, name) == 0) return book; } return NULL; } /* * Search `book' for the subbook whose directory name is * `directory'. * If found, the subbook-code of the subbook is returned. * Otherwise, -1 is returned. */ EB_Subbook_Code find_subbook(book, directory) Book *book; const char *directory; { EB_Error_Code error_code; EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS]; char directory2[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; int subbook_count; int i; /* * Find the subbook in the current book. */ error_code = eb_subbook_list(&book->book, subbook_list, &subbook_count); if (error_code != EB_SUCCESS) return EB_SUBBOOK_INVALID; for (i = 0; i < subbook_count; i++) { error_code = eb_subbook_directory2(&book->book, subbook_list[i], directory2); if (error_code != EB_SUCCESS) continue; if (strcasecmp(directory, directory2) == 0) return subbook_list[i]; } return EB_SUBBOOK_INVALID; } /* * Search `book' for the subbook whose directory name of an appendix * is `directory'. * If found, the subbook-code of the subbook is returned. * Otherwise, -1 is returned. */ EB_Subbook_Code find_appendix_subbook(book, directory) Book *book; const char *directory; { EB_Error_Code error_code; EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS]; char directory2[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; int subbook_count; int i; /* * Find the subbook in the current appendix. */ error_code = eb_appendix_subbook_list(&book->appendix, subbook_list, &subbook_count); if (error_code != EB_SUCCESS) return EB_SUBBOOK_INVALID; for (i = 0; i < subbook_count; i++) { error_code = eb_appendix_subbook_directory2(&book->appendix, subbook_list[i], directory2); if (error_code != EB_SUCCESS) continue; if (strcasecmp(directory, directory2) == 0) return subbook_list[i]; } return EB_SUBBOOK_INVALID; } /* * For the current client, * check permission flags to the books in `book_registry'. */ void check_book_permissions() { Book *book; for (book = book_registry; book != NULL; book = book->next) { book->permission_flag = test_permission(&book->permissions, client_host_name, client_address, match_wildcard); } } /* * For the current client, * set permission flags to all books in `book_registry'. */ void set_all_book_permissions() { Book *book; for (book = book_registry; book != NULL; book = book->next) book->permission_flag = 1; } ebnetd-1.0.dfsg.1/ebhttpd/config.c0000644000175000017500000005243307673055355016303 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #if defined(NDTPD) || defined(EBHTTPD) #include #include #endif #if defined(EBNETD) #include "ebtiny/eb.h" #include "ebtiny/appendix.h" #endif #include "confutil.h" #include "fakelog.h" #include "filename.h" #include "hostname.h" #include "readconf.h" #include "permission.h" #include "defs.h" /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) /* * Unexported functions. */ static int cf_begin EBNETD_P((const char *, const char *, int)); static int cf_end EBNETD_P((const char *, const char *, int)); static int cf_ebnet_port EBNETD_P((const char *, const char *, int)); static int cf_ndtp_port EBNETD_P((const char *, const char *, int)); static int cf_http_port EBNETD_P((const char *, const char *, int)); static int cf_user EBNETD_P((const char *, const char *, int)); static int cf_group EBNETD_P((const char *, const char *, int)); static int cf_max_clients EBNETD_P((const char *, const char *, int)); static int cf_hosts EBNETD_P((const char *, const char *, int)); static int cf_timeout EBNETD_P((const char *, const char *, int)); static int cf_work_path EBNETD_P((const char *, const char *, int)); static int cf_max_hits EBNETD_P((const char *, const char *, int)); static int cf_max_text_size EBNETD_P((const char *, const char *, int)); static int cf_syslog_facility EBNETD_P((const char *, const char *, int)); static int cf_begin_book EBNETD_P((const char *, const char *, int)); static int cf_end_book EBNETD_P((const char *, const char *, int)); static int cf_book_name EBNETD_P((const char *, const char *, int)); static int cf_book_title EBNETD_P((const char *, const char *, int)); static int cf_book_path EBNETD_P((const char *, const char *, int)); static int cf_appendix_path EBNETD_P((const char *, const char *, int)); static int cf_book_max_clients EBNETD_P((const char *, const char *, int)); static int cf_book_hosts EBNETD_P((const char *, const char *, int)); /* * Syntax of the configuration file. */ Configuration configuration_table[] = { {"", "begin", cf_begin, READCONF_ZERO_OR_ONCE, 0}, {"", "end", cf_end, READCONF_ZERO_OR_ONCE, 0}, /* single directives. */ {"", "ebnet-port", cf_ebnet_port, READCONF_ZERO_OR_ONCE, 0}, {"", "ndtp-port", cf_ndtp_port, READCONF_ZERO_OR_ONCE, 0}, {"", "http-port", cf_http_port, READCONF_ZERO_OR_ONCE, 0}, {"", "user", cf_user, READCONF_ZERO_OR_ONCE, 0}, {"", "group", cf_group, READCONF_ZERO_OR_ONCE, 0}, {"", "max-clients", cf_max_clients, READCONF_ZERO_OR_ONCE, 0}, {"", "hosts", cf_hosts, READCONF_ZERO_OR_MORE, 0}, {"", "timeout", cf_timeout, READCONF_ZERO_OR_ONCE, 0}, {"", "work-path", cf_work_path, READCONF_ZERO_OR_ONCE, 0}, {"", "max-hits", cf_max_hits, READCONF_ZERO_OR_ONCE, 0}, {"", "max-text-size", cf_max_text_size, READCONF_ZERO_OR_ONCE, 0}, {"", "syslog-facility", cf_syslog_facility, READCONF_ZERO_OR_ONCE, 0}, /* book group directive. */ {"", "begin book", cf_begin_book, READCONF_ZERO_OR_MORE, 0}, {"book", "name", cf_book_name, READCONF_ONCE, 0}, {"book", "title", cf_book_title, READCONF_ONCE, 0}, {"book", "path", cf_book_path, READCONF_ONCE, 0}, {"book", "appendix-path", cf_appendix_path, READCONF_ZERO_OR_ONCE, 0}, {"book", "max-clients", cf_book_max_clients, READCONF_ZERO_OR_ONCE, 0}, {"book", "hosts", cf_book_hosts, READCONF_ZERO_OR_MORE, 0}, {"", "end book", cf_end_book, READCONF_ZERO_OR_MORE, 0}, {"", NULL, NULL, READCONF_ONCE, 0} }; /* * The current configuring book. */ static Book *cf_book; /* * The hook is called before reading a configuration file. */ static int cf_begin(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * The length of the file_name "/" * must not exceed PATH_MAX. */ if (PATH_MAX < strlen(DEFAULT_WORK_PATH) + 1 + MAX_WORK_PATH_BASE_NAME_LENGTH) { syslog(LOG_ERR, "internal error, too long DEFAULT_WORK_PATH"); return -1; } strcpy(work_path, DEFAULT_WORK_PATH); /* * Debugging information. */ syslog(LOG_DEBUG, "%s: debug: beginning of the configuration", file_name); return 0; } /* * The hook is called just after reading a configuration file. */ static int cf_end(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * If the configuration file has no `hosts' directive, and if * the mode is SERVER_MODE_CHECK, then output a warning message. */ if (server_mode == SERVER_MODE_CHECK && count_permission(&permissions) == 0) { syslog(LOG_ERR, "warning: nobody can connect to the server \ because the configuration file has no `hosts' directive"); } /* * If the configuration file has no `book' group directive, and if * the mode is SERVER_MODE_CHECK, then output a warning message. */ if (server_mode == SERVER_MODE_CHECK && count_book_registry() == 0) syslog(LOG_ERR, "warning: no book definition"); /* * Set the pid file_name. */ sprintf(pid_file_name, "%s/%s", work_path, PID_BASE_NAME); if (canonicalize_file_name(pid_file_name) < 0) return -1; /* * Set the connection lock file_name. */ sprintf(connection_lock_file_name, "%s/%s", work_path, LOCK_BASE_NAME); /* * debugging information. */ syslog(LOG_DEBUG, "%s: debug: end of the configuration", file_name); return 0; } /* * `ebnet-port' directive. */ static int cf_ebnet_port(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { in_port_t port; /* * Parse the port number. */ if (parse_tcp_port(argument, &port) < 0) { syslog(LOG_ERR, "%s:%d: unknown service: %s", file_name, line_number, argument); return -1; } /* * Set the port number, if this is EBNETD. */ #ifdef EBNETD listening_port = port; #endif /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set ebnet-port: %d", file_name, line_number, (int)port); return 0; } /* * `ndtp-port' directive. */ static int cf_ndtp_port(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { in_port_t port; /* * Parse the port number. */ if (parse_tcp_port(argument, &port) < 0) { syslog(LOG_ERR, "%s:%d: unknown service: %s", file_name, line_number, argument); return -1; } /* * Set the port number, if this is NDTPD. */ #ifdef NDTPD listening_port = port; #endif /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set ndtp-port: %d", file_name, line_number, (int)port); return 0; } /* * `http-port' directive. */ static int cf_http_port(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { in_port_t port; /* * Parse the port number. */ if (parse_tcp_port(argument, &port) < 0) { syslog(LOG_ERR, "%s:%d: unknown service: %s", file_name, line_number, argument); return -1; } /* * Set the port number, if this is ebHTTPD. */ #ifdef EBHTTPD listening_port = port; #endif /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set http-port: %d", file_name, line_number, (int)port); return 0; } /* * `user' directive. */ static int cf_user(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the user ID. */ if (parse_user(argument, &user_id) < 0) { syslog(LOG_ERR, "%s:%d: unknown user: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set user: %d", file_name, line_number, (int)user_id); return 0; } /* * `group' directive. */ static int cf_group(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the group ID. */ if (parse_group(argument, &group_id) < 0) { syslog(LOG_ERR, "%s:%d: unknown group: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set group: %d", file_name, line_number, (int)group_id); return 0; } /* * `max-clients' directive. */ static int cf_max_clients(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the max-clients. */ if (parse_integer(argument, &max_clients) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set max-clients: %d", file_name, line_number, max_clients); return 0; } /* * `hosts' directive. */ static int cf_hosts(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Add `argument' to the host permission list. */ if (add_permission(&permissions, argument) < 0) { syslog(LOG_ERR, "%s:%d: invalid host, IP address or IP prefix: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: add hosts: %s", file_name, line_number, argument); return 0; } /* * `timeout' directive. */ static int cf_timeout(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the timeout. */ if (parse_integer(argument, &idle_timeout) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set timeout: %d", file_name, line_number, idle_timeout); return 0; } /* * `work-path' directive. */ static int cf_work_path(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Check for the length of the path. * The length of `/' must not exceed PATH_MAX. */ if (PATH_MAX < strlen(argument) + 1 + MAX_WORK_PATH_BASE_NAME_LENGTH) { syslog(LOG_ERR, "%s:%d: too long path", file_name, line_number); return -1; } /* * The file_name must be an absolute path. */ if (*argument != '/') { syslog(LOG_ERR, "%s:%d: not an absolute path: %s", file_name, line_number, argument); return -1; } /* * Set the working directory path. */ strcpy(work_path, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set work-path: %s", file_name, line_number, work_path); return 0; } /* * `max-hits' directive. */ static int cf_max_hits(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set the max hits. */ if (parse_integer(argument, &max_hits) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set max-hits: %d", file_name, line_number, max_hits); return 0; } /* * `max-text-size' directive. */ static int cf_max_text_size(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { int size; /* * Parse and set the max text size. */ if (parse_integer(argument, &size) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } max_text_size = size; /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set max-text-size: %d", file_name, line_number, max_text_size); return 0; } /* * `syslog-facility' directive. */ static int cf_syslog_facility(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Parse and set a syslog facility. */ if (parse_syslog_facility(argument, &syslog_facility) < 0) { syslog(LOG_ERR, "%s:%d: unknown syslog facility: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set syslog-facility: %s", file_name, line_number, argument); return 0; } /* * `begin book' sequence. */ static int cf_begin_book(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Create a new book node. */ cf_book = add_book(); if (cf_book == NULL) { syslog(LOG_ERR, "%s:%d: memory exhausted", file_name, line_number); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: beginning of the book definition", file_name, line_number); return 0; } /* * `end book' sequence. */ static int cf_end_book(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * If the group directive has no `hosts' sub-directive, and if * the mode is SERVER_MODE_CHECK, then output a warning message. */ if (server_mode == SERVER_MODE_CHECK && count_permission(&cf_book->permissions) == 0) { syslog(LOG_ERR, "%s:%d: warning: nobody can access the book \ because the book definition has no `hosts' sub-directive", file_name, line_number); } /* * Set `max-clients' for the book to 0 when test mode. */ if (server_mode == SERVER_MODE_TEST) { cf_book->max_clients = 0; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: end of the book definition", file_name, line_number); return 0; } /* * `name' directive (in book structure). */ static int cf_book_name(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { const char *p; /* * Check for the length of the book name. */ if (MAX_BOOK_NAME_LENGTH < strlen(argument)) { syslog(LOG_ERR, "%s:%d: too long book name", file_name, line_number); return -1; } /* * The tagname must consist of upper letters, digit, '_', and '-'. */ for (p = argument; *p != '\0'; p++) { if (!islower(*p) && !isdigit(*p) && *p != '_' && *p != '-') { syslog(LOG_ERR, "%s:%d: the book name contains invalid character: %s", file_name, line_number, argument); return -1; } } /* * Check for uniqness of book names. */ if (find_book(argument) != NULL) { syslog(LOG_ERR, "%s:%d: the book name redefined: %s", file_name, line_number, argument); return -1; } /* * Set the book name. */ strcpy(cf_book->name, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-name: %s", file_name, line_number, cf_book->name); return 0; } /* * `title' directive (in book structure). */ static int cf_book_title(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Check for the length of the title. */ if (MAX_BOOK_TITLE_LENGTH < strlen(argument)) { syslog(LOG_ERR, "%s:%d: too long book title", file_name, line_number); return -1; } /* * Set the title. */ strcpy(cf_book->title, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-title: %s", file_name, line_number, cf_book->title); return 0; } /* * `path' directive (in book structure). */ static int cf_book_path(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { size_t argument_length; /* * Check for the length of the path. */ argument_length = strlen(argument); if (PATH_MAX < argument_length) { syslog(LOG_ERR, "%s:%d: too long path", file_name, line_number); return -1; } /* * The path must be an absolute path. */ if (*argument != '/') { syslog(LOG_ERR, "%s:%d: not an absolute path: %s", file_name, line_number, argument); return -1; } /* * Set the book path. */ cf_book->path = (char *)malloc(argument_length + 1); if (cf_book->path == NULL) { syslog(LOG_ERR, "%s:%d: memory exhausted", file_name, line_number); return -1; } strcpy(cf_book->path, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-path: %s", file_name, line_number, argument); return 0; } /* * `appendix-path' directive. */ static int cf_appendix_path(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { size_t argument_length; /* * Check for the length of the path. */ argument_length = strlen(argument); if (PATH_MAX < argument_length) { syslog(LOG_ERR, "%s:%d: too long appendix path", file_name); return -1; } /* * The path must be an absolute path. */ if (*argument != '/') { syslog(LOG_ERR, "%s:%d: not an absolute path: %s", file_name, line_number, argument); return -1; } /* * Set the book path. */ cf_book->appendix_path = (char *)malloc(argument_length + 1); if (cf_book->appendix_path == NULL) { syslog(LOG_ERR, "%s:%d: memory exhausted", file_name, line_number); return -1; } strcpy(cf_book->appendix_path, argument); /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set appendix-path: %s", file_name, line_number, argument); return 0; } /* * `max-clients' directive (in book structure). */ static int cf_book_max_clients(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * An argumentument represents a remote host name or address. */ if (parse_integer(argument, &cf_book->max_clients) < 0) { syslog(LOG_ERR, "%s:%d: not an integer: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: set book-max-clients: %d", file_name, line_number, cf_book->max_clients); return 0; } /* * `hosts' directive (in book structure). */ static int cf_book_hosts(argument, file_name, line_number) const char *argument; const char *file_name; int line_number; { /* * Add `argument' to the permission list. */ if (add_permission(&cf_book->permissions, argument) < 0) { syslog(LOG_ERR, "%s:%d: invalid host, IP address or IP prefix: %s", file_name, line_number, argument); return -1; } /* * Debugging information. */ syslog(LOG_DEBUG, "%s:%d: debug: add book-hosts: %s", file_name, line_number, argument); return 0; } ebnetd-1.0.dfsg.1/ebhttpd/global.c0000644000175000017500000001030707673055353016266 0ustar mhattamhatta/* * Copyright (c) 1997, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef TIME_WITH_SYS_TIME #include #include #else /* not TIME_WITH_SYS_TIME */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ #if defined(NDTPD) || defined(EBHTTPD) #include #endif #if defined(EBNETD) #include "ebtiny/eb.h" #endif #include "confutil.h" #include "hostname.h" #include "linebuf.h" #include "permission.h" #include "defs.h" /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ /* * Actual program name (argv[0]). */ const char *invoked_name; /* * Generic name of the program. */ const char *program_name; /* * Program version. */ const char *program_version; /* * Path to a working directory. */ char work_path[PATH_MAX + 1]; /* * Configuration file name. */ char configuration_file_name[PATH_MAX + 1]; /* * Port number the server listens to. */ in_port_t listening_port; in_port_t old_listening_port; /* * File descriptors for the server to listen to the port. */ fd_set listening_files; int max_listening_file; /* * File descriptor to communicate with a client. */ int accepted_in_file; int accepted_out_file; /* * User ID of the server process. */ uid_t user_id; /* * Group ID of the server process. */ gid_t group_id; /* * Filename to log the process ID of the server. */ char pid_file_name[PATH_MAX + 1]; char old_pid_file_name[PATH_MAX + 1]; /* * Lock file_name and ticket stock to count connections to the server. */ char connection_lock_file_name[PATH_MAX + 1]; Ticket_Stock connection_ticket_stock; /* * The maximum number of connections to the server at once. */ int max_clients; /* * The number of the current connections. */ int connection_count; /* * Seconds the server closes an idle connection. */ int idle_timeout; /* * Host permission list. */ Permission permissions; /* * Book registry. */ Book *book_registry; int book_count; /* * The number of hit entries the server give up searching. */ int max_hits; /* * The maximum size of text the server may send as a response to a client. */ size_t max_text_size; /* * Hostname of the client. */ char client_host_name[MAX_HOST_NAME_LENGTH + 1]; /* * Address of the client. */ char client_address[MAX_HOST_NAME_LENGTH + 1]; /* * Running mode of the server. * (standalone, inetd, test, check or control) */ int server_mode; /* * Syslog facility. */ int syslog_facility; /* * Client sockaddr */ #if defined(ENABLE_IPV6) struct sockaddr_storage client_sockaddr; #else struct sockaddr_in client_sockaddr; #endif /* * Initialize global variables. */ int initialize_global_variables() { initialize_permission(&permissions); initialize_ticket_stock(&connection_ticket_stock); initialize_book_registry(); user_id = getuid(); group_id = getgid(); max_clients = DEFAULT_MAX_CLIENTS; idle_timeout = DEFAULT_IDLE_TIMEOUT; max_hits = DEFAULT_MAX_HITS; max_text_size = DEFAULT_MAX_TEXT_SIZE; if (parse_tcp_port(SERVICE_NAME, &listening_port) < 0) listening_port = DEFAULT_PORT; return 0; } /* * Finalize global variables. */ void finalize_global_variables() { finalize_permission(&permissions); finalize_ticket_stock(&connection_ticket_stock); finalize_book_registry(); } ebnetd-1.0.dfsg.1/ebhttpd/ebhtcheck.c0000644000175000017500000001257707673055354016762 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #include "fakelog.h" #include "getopt.h" #include "hostname.h" #include "permission.h" #include "readconf.h" #include "wildcard.h" #include "defs.h" /* * Unexported functions. */ static void output_help EBNETD_P((void)); /* * Command line options. */ static const char *short_options = "c:dhv"; static struct option long_options[] = { {"configuration-file", required_argument, NULL, 'c'}, {"debug", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {"verbose", no_argument, NULL, 'd'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; int main(argc, argv) int argc; char *argv[]; { EB_Error_Code error_code; int ch; /* * We must output US-ASCII syslog messages. */ #ifdef HAVE_SETLOCALE setlocale(LC_ALL, "C"); #endif /* * Set program name and version. */ invoked_name = argv[0]; program_name = CHECK_PROGRAM_NAME; program_version = VERSION; /* * Initialize EB Library. */ error_code = eb_initialize_library(); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "%s\n", eb_error_message(error_code)); exit(1); } /* * Initialize global and static variables. */ server_mode = SERVER_MODE_CHECK; initialize_global_variables(); if (PATH_MAX < strlen(DEFAULT_CONFIGURATION_FILE_NAME)) { fprintf(stderr, "%s: internal error, too long DEFAULT_CONFIGURATION_FILE_NAME\n", invoked_name); exit(1); } strcpy(configuration_file_name, DEFAULT_CONFIGURATION_FILE_NAME); /* * Set fakelog behavior. */ set_fakelog_name(invoked_name); set_fakelog_mode(FAKELOG_TO_STDERR); set_fakelog_level(LOG_ERR); /* * Parse command line options. */ for (;;) { ch = getopt_long(argc, argv, short_options, long_options, NULL); if (ch == -1) break; switch (ch) { case 'c': /* * Option `-c file'. Specify a configuration file name. */ if (PATH_MAX < strlen(optarg)) { fprintf(stderr, "%s: too long configuration file_name\n", invoked_name); fflush(stderr); exit(1); } strcpy(configuration_file_name, optarg); break; case 'd': /* * Option `-d'. Debug mode. */ set_fakelog_level(LOG_DEBUG); break; case 'h': /* * Option `-h'. Help. */ output_help(); exit(0); case 'v': /* * Option `-v'. Show the version number. */ output_version(); exit(0); default: output_try_help(); exit(1); } } /* * Check for the number of rest arguments. */ if (0 < argc - optind) { fprintf(stderr, "%s: too many arguments\n", invoked_name); output_try_help(); exit(1); } /* * Read the configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { fprintf(stderr, "%s: configuration failure\n", invoked_name); fflush(stderr); exit(1); } /* * Finalize global and static variables. */ finalize_global_variables(); /* * Finalize EB Library. */ eb_finalize_library(); return 0; } /* * Output the usage to standard out. */ static void output_help() { printf("Usage: %s [option...]\n", program_name); printf("Options:\n"); printf(" -c FILE --configuration-file FILE\n"); printf(" specify a configuration file\n"); printf(" (default: %s)\n", DEFAULT_CONFIGURATION_FILE_NAME); printf(" -d --debug --verbose degug mode\n"); printf(" -h --help display this help, then exit\n"); printf(" -v --version display version number, then exit\n"); printf("\nDefault value used in a configuration file:\n"); printf(" work-path %s\n", DEFAULT_WORK_PATH); printf("\nReport bugs to %s.\n", MAILING_ADDRESS); fflush(stdout); } ebnetd-1.0.dfsg.1/ebhttpd/misc.c0000644000175000017500000000212607673055357015765 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01, 02 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "defs.h" /* * Output the version number to standard out. */ void output_version() { printf("%s (EBNETD) version %s\n", program_name, program_version); printf("Copyright (c) 1997 - 2003\n"); printf(" Motoyuki Kasahara\n"); fflush(stdout); } /* * Output ``try ...'' message to standard error. */ void output_try_help() { fprintf(stderr, "try `%s --help' for more information\n", invoked_name); fflush(stderr); } ebnetd-1.0.dfsg.1/ebhttpd/ebhtcontrol.c0000644000175000017500000002133307673055355017354 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ #ifndef HAVE_STRERROR #ifdef __STDC__ char *strerror(int); #else /* not __STDC__ */ char *strerror(); #endif /* not __STDC__ */ #endif /* HAVE_STRERROR */ /* * The maximum length of path name. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #include "fakelog.h" #include "getopt.h" #include "hostname.h" #include "logpid.h" #include "permission.h" #include "readconf.h" #include "wildcard.h" #include "defs.h" /* * Unexported functions. */ static void output_help EBNETD_P((void)); /* * Command line options. */ static const char *short_options = "c:hv"; static struct option long_options[] = { {"configuration-file", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /* * Sub-commands. */ #define SUB_COMMAND_STATUS 0 #define SUB_COMMAND_RESTART 1 #define SUB_COMMAND_TERMINATE 2 #define SUB_COMMAND_KILL 3 typedef struct { const char *name; int id; int signal; } Sub_Command; static const Sub_Command command_table[] = { {"status", SUB_COMMAND_STATUS, -1}, {"restart", SUB_COMMAND_RESTART, SIGHUP}, {"terminate", SUB_COMMAND_TERMINATE, SIGTERM}, {"kill", SUB_COMMAND_KILL, SIGKILL}, {NULL, 0} }; /* * Unexported functions. */ #ifdef __STDC__ static const Sub_Command *get_sub_command(const char *); #else static const Sub_Command *get_sub_command(); #endif int main(argc, argv) int argc; char *argv[]; { EB_Error_Code error_code; const Sub_Command *command; pid_t pid; int ch; /* * We must output US-ASCII syslog messages. */ #ifdef HAVE_SETLOCALE setlocale(LC_ALL, "C"); #endif /* * Set program name and version. */ invoked_name = argv[0]; program_name = CONTROL_PROGRAM_NAME; program_version = VERSION; /* * Initialize EB Library. */ error_code = eb_initialize_library(); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "%s\n", eb_error_message(error_code)); exit(1); } /* * Initialize global and static variables. */ server_mode = SERVER_MODE_CONTROL; initialize_global_variables(); if (PATH_MAX < strlen(DEFAULT_CONFIGURATION_FILE_NAME)) { fprintf(stderr, "%s: internal error, too long DEFAULT_CONFIGURATION_FILE_NAME\n", invoked_name); exit(1); } strcpy(configuration_file_name, DEFAULT_CONFIGURATION_FILE_NAME); /* * Set fakelog behavior. */ set_fakelog_name(invoked_name); set_fakelog_mode(FAKELOG_TO_STDERR); set_fakelog_level(LOG_ERR); /* * Parse command line options. */ for (;;) { ch = getopt_long(argc, argv, short_options, long_options, NULL); if (ch == -1) break; switch (ch) { case 'c': /* * Option `-c file'. Specify a configuration file_name. */ if (PATH_MAX < strlen(optarg)) { fprintf(stderr, "%s: too long configuration file_name\n", invoked_name); fflush(stderr); exit(1); } strcpy(configuration_file_name, optarg); break; case 'h': /* * Option `-h'. Help. */ output_help(); exit(0); case 'v': /* * Option `-v'. Show the version number. */ output_version(); exit(0); default: output_try_help(); exit(1); } } /* * Check for the number of rest arguments. */ if (argc - optind == 0) { fprintf(stderr, "%s: too few argument\n", invoked_name); output_try_help(); exit(1); } if (1 < argc - optind) { fprintf(stderr, "%s: too many arguments\n", invoked_name); output_try_help(); exit(1); } /* * Check for sub-command. */ command = get_sub_command(argv[optind]); if (command == NULL) { output_try_help(); exit(1); } /* * Read the configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { fprintf(stderr, "%s: configuration failure\n", invoked_name); fflush(stderr); exit(1); } /* * Read PID from the pid-file. */ if (probe_pid_file(pid_file_name) < 0) { fprintf(stderr, "%s: PID file not found: %s\n", invoked_name, pid_file_name); fprintf(stderr, "%s: server not running\n", invoked_name); fflush(stderr); exit(1); } if (read_pid_file(pid_file_name, &pid) < 0) exit(1); /* * When sub-command is `status', output a message and exit. */ if (command->id == SUB_COMMAND_STATUS) { fprintf(stderr, "%s: PID file found: %s\n", invoked_name, pid_file_name); fprintf(stderr, "%s: ndtpd is running (PID = %u)\n", invoked_name, (unsigned)pid); fflush(stderr); exit(0); } /* * Send a signal to the running `ndtpd'. */ if (kill(pid, command->signal) < 0) { fprintf(stderr, "%s: %s\n", invoked_name, strerror(errno)); fflush(stderr); exit(1); } /* * When ndtpd is killed (send SIGKILL), ndtpd failed to remove * the pid file ndtpd. The command try to remove it. */ if (command->id == SUB_COMMAND_KILL) { if (remove_pid_file(pid_file_name) < 0) exit(1); } /* * Finalize global and static variables. */ finalize_global_variables(); /* * Finalize EB Library. */ eb_finalize_library(); return 0; } /* * Parse sub-command. */ static const Sub_Command * get_sub_command(name) const char *name; { size_t name_length; const Sub_Command *command; const Sub_Command *candidate = NULL; int matches; name_length = strlen(name); matches = 0; for (command = command_table; command->name != NULL; command++) { if (strcasecmp(name, command->name) == 0) return command; else if (strncasecmp(name, command->name, name_length) == 0) { candidate = command; matches++; } } if (matches == 0) { fprintf(stderr, "%s: unknown command `%s'\n", invoked_name, name); fflush(stderr); return NULL; } else if (1 < matches) { fprintf(stderr, "%s: command `%s' is ambigous\n", invoked_name, name); fflush(stderr); return NULL; } return candidate; } /* * Output the usage to standard out. */ static void output_help() { printf("Usage: %s [option...] sub-command\n", program_name); printf("Options:\n"); printf(" -c FILE --configuration-file FILE\n"); printf(" specify a configuration file\n"); printf(" (default: %s)\n", DEFAULT_CONFIGURATION_FILE_NAME); printf(" -h --help display this help, then exit\n"); printf(" -v --version display version number, then exit\n"); printf("\nSub-commands:\n"); printf(" kill kill ndtpd (send SIGKILL)\n"); printf(" restart restart ndtpd (send SIGHUP)\n"); printf(" status output status of ndtpd\n"); printf(" terminate terminate ndtpd (send SIGTERM)\n"); printf("\nDefault value used in a configuration file:\n"); printf(" work-path %s\n", DEFAULT_WORK_PATH); printf("\nReport bugs to %s.\n", MAILING_ADDRESS); fflush(stdout); } ebnetd-1.0.dfsg.1/ebhttpd/ebhttpd.c0000644000175000017500000006434607673055354016475 0ustar mhattamhatta/* * Copyright (c) 1997, 98, 99, 2000, 01, 02 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #if defined(HAVE_SYS_WAIT_H) || defined(HAVE_UNION_WAIT) #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_GETCWD #define getcwd(d,n) getwd(d) #endif #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else /* not MAXPATHLEN */ #define PATH_MAX 1024 #endif /* not MAXPATHLEN */ #endif /* not PATH_MAX */ #ifdef HAVE_UNION_WAIT #ifndef WTERMSIG #define WTERMSIG(x) ((x).w_termsig) #endif #ifndef WCOREDUMP #define WCOREDUMP(x) ((x).w_coredump) #endif #ifndef WEXITSTATUS #define WEXITSTATUS(x) ((x).w_retcode) #endif #ifndef WIFSIGNALED #define WIFSIGNALED(x) (WTERMSIG(x) != 0) #endif #ifndef WIFEXITED #define WIFEXITED(x) (WTERMSIG(x) == 0) #endif #else /* not HAVE_UNION_WAIT */ #ifndef WTERMSIG #define WTERMSIG(x) ((x) & 0x7f) #endif #ifndef WCOREDUMP #define WCOREDUMP(x) ((x) & 0x80) #endif #ifndef WEXITSTATUS #define WEXITSTATUS(x) (((x) >> 8) & 0xff) #endif #ifndef WIFSIGNALED #define WIFSIGNALED(x) (WTERMSIG (x) != 0) #endif #ifndef WIFEXITED #define WIFEXITED(x) (WTERMSIG (x) == 0) #endif #endif /* not HAVE_UNION_WAIT */ #ifndef SHUT_RD #define SHUT_RD 0 #endif #ifndef SHUT_WR #define SHUT_WR 1 #endif #ifndef SHUT_RDWR #define SHUT_RDWR 2 #endif #include "confutil.h" #include "daemon.h" #include "fakelog.h" #include "fdset.h" #include "filename.h" #include "getopt.h" #include "hostname.h" #include "linebuf.h" #include "logpid.h" #include "openmax.h" #include "permission.h" #include "privilege.h" #include "serverport.h" #include "signame.h" #include "ticket.h" #include "wildcard.h" #include "defs.h" /* * Unexported functions. */ static void standalone_main EBNETD_P((void)); static void inetd_main EBNETD_P((void)); static void test_main EBNETD_P((void)); static void output_help EBNETD_P((void)); static void set_signal_handler EBNETD_P((int, RETSIGTYPE (*)(int))); static void block_signal EBNETD_P((int)); static void unblock_signal EBNETD_P((int)); static RETSIGTYPE abort_parent EBNETD_P((int)); static RETSIGTYPE abort_child EBNETD_P((int)); static RETSIGTYPE terminate_parent EBNETD_P((int)); static RETSIGTYPE terminate_child EBNETD_P((int)); static RETSIGTYPE restart_parent EBNETD_P((int)); static RETSIGTYPE wait_child EBNETD_P((int)); /* * Command line options. */ static const char *short_options = "c:hitv"; static struct option long_options[] = { {"configuration-file", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"inetd", no_argument, NULL, 'i'}, {"test", no_argument, NULL, 't'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /* * The flag is set when the server is started. */ static int once_started; /* * The flag is set if SIGHUP is received. */ static int restart_trigger; /* * Process group ID of the server. */ pid_t process_group_id; /* * Signal mask. */ #if !defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSETMASK) static int signal_mask = 0; #endif int main(argc, argv) int argc; char *argv[]; { EB_Error_Code error_code; int ch; /* * We must output US-ASCII syslog messages. */ #ifdef HAVE_SETENV setenv("LC_ALL", "C", 1); setenv("LANGUAGE", "C", 1); #else putenv("LC_ALL=C"); putenv("LANGUAGE=C"); #endif #ifdef HAVE_SETLOCALE setlocale(LC_ALL, "C"); #endif /* * Set program name and version. */ invoked_name = argv[0]; program_name = SERVER_PROGRAM_NAME; program_version = VERSION; /* * Set umask. */ umask(SERVER_UMASK); /* * Set fakelog behavior. */ set_fakelog_name(invoked_name); set_fakelog_mode(FAKELOG_TO_SYSLOG); set_fakelog_level(LOG_DEBUG); /* * Open syslog. * If LOG_DAEMON is not defined, it assumes old style syslog * It doesn't have facility. */ syslog_facility = DEFAULT_SYSLOG_FACILITY; #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif syslog(LOG_DEBUG, "debug: open syslog"); /* * Initialize EB Library. */ error_code = eb_initialize_library(); if (error_code != EB_SUCCESS) { syslog(LOG_ERR, "%s\n", eb_error_message(error_code)); exit(1); } /* * Initialize variables. */ once_started = 0; initialize_fdset(&listening_files, &max_listening_file); server_mode = SERVER_MODE_STANDALONE; if (PATH_MAX < strlen(DEFAULT_CONFIGURATION_FILE_NAME)) { syslog(LOG_ERR, "internal error, too long DEFAULT_CONFIGURATION_FILE_NAME"); goto die; } strcpy(configuration_file_name, DEFAULT_CONFIGURATION_FILE_NAME); initialize_global_variables(); /* * Parse command line options. */ for (;;) { ch = getopt_long(argc, argv, short_options, long_options, NULL); if (ch == -1) break; switch (ch) { case 'c': /* * Option `-c file'. Specify the configuration file name. */ if (PATH_MAX < strlen(optarg)) { fprintf(stderr, "%s: too long configuration file name\n", invoked_name); goto die; } strcpy(configuration_file_name, optarg); if (canonicalize_file_name(configuration_file_name) < 0) goto die; break; case 'h': /* * Option `-h'. Help. */ output_help(); exit(0); case 'i': /* * Option `-i'. Inetd mode. */ server_mode = SERVER_MODE_INETD; break; case 't': /* * Option `-t'. Test mode. */ server_mode = SERVER_MODE_TEST; break; case 'v': /* * Option `-v'. Show version and exit immediately. */ output_version(); exit(0); default: output_try_help(); exit(1); } } /* * Check for the number of rest arguments. */ if (0 < argc - optind) { fprintf(stderr, "%s: too many arguments\n", invoked_name); output_try_help(); exit(1); } /* * Main routine for each server mode. */ switch (server_mode) { case SERVER_MODE_STANDALONE: for (;;) standalone_main(); break; case SERVER_MODE_INETD: inetd_main(); break; case SERVER_MODE_TEST: test_main(); break; } return 0; /* * A fatal error occurrs... */ die: if (server_mode == SERVER_MODE_STANDALONE) syslog(LOG_CRIT, "the server exits"); else if (server_mode == SERVER_MODE_INETD) syslog(LOG_INFO, "the server exits"); exit(1); } /* * Main routine for standalone mode. */ static void standalone_main() { #if defined(ENABLE_IPV6) struct sockaddr_storage address; #else struct sockaddr_in address; #endif socklen_t address_length; int fd; int pid = -1; fd_set select_files; int i; /* * Block signals. */ #if !defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSETMASK) signal_mask = 0; #endif block_signal(SIGHUP); block_signal(SIGINT); block_signal(SIGTERM); /* * Reset restart trigger. */ restart_trigger = 0; /* * Kill child processes. */ if (once_started) { #ifdef HAVE_KILLPG killpg(process_group_id, SIGINT); #else kill(-process_group_id, SIGINT); #endif syslog(LOG_DEBUG, "debug: kill all child processes"); } /* * Close unwanted files. */ if (!once_started) { closelog(); for (fd = get_open_max() - 1; 0 <= fd; fd--) close(fd); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif syslog(LOG_DEBUG, "debug: reopen syslog"); } /* * Re-initinalize variables. */ if (once_started) { finalize_global_variables(); initialize_global_variables(); } /* * Read a configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { syslog(LOG_ERR, "configuration failure"); goto die; } /* * Reopen syslog. */ closelog(); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif /* * Run as standalone daemon. */ if (!once_started) { if (daemonize() < 0) goto die; #ifdef GETPGRP_VOID process_group_id = getpgrp(); #else process_group_id = getpgrp(getpid()); #endif } /* * Change the current working directory. */ if (chdir(work_path) < 0) { syslog(LOG_ERR, "failed to change the directory, %s: %s", strerror(errno), work_path); goto die; } /* * Shutdown old connections if the server port is changed. */ if (once_started && listening_port != old_listening_port) { /* shutdown multi sockets */ if (shutdown_fdset(&listening_files, &max_listening_file, SHUT_RDWR) < 0) { syslog(LOG_ERR, "shutdown() failed, %s", strerror(errno)); goto die; } /* close multi sockets */ close_fdset(&listening_files, &max_listening_file); syslog(LOG_DEBUG, "debug: shutdown the old socket: %d/tcp", listening_port); } /* * Bind and listen to the server port. */ if (max_listening_file < 0) { if (set_server_ports(listening_port, LISTENING_BACKLOG, &listening_files, &max_listening_file) < 0) goto die; old_listening_port = listening_port; } /* * Set UID and GID. */ if (set_privilege(user_id, group_id) < 0) goto die; /* * Activate all books. */ if (activate_book_registry() == 0) syslog(LOG_ERR, "no book is available"); /* * Unlink an old PID file if exists. */ if (once_started) remove_pid_file(old_pid_file_name); strcpy(old_pid_file_name, pid_file_name); /* * Bind a ticket stock. */ if (max_clients != 0 && bind_ticket_stock(&connection_ticket_stock, connection_lock_file_name, max_clients) < 0) goto die; /* * Log pid to the file. */ if (log_pid_file(pid_file_name) < 0) goto die; /* * Set signal handlers. */ set_signal_handler(SIGBUS, abort_parent); set_signal_handler(SIGSEGV, abort_parent); set_signal_handler(SIGINT, SIG_IGN); set_signal_handler(SIGQUIT, SIG_IGN); set_signal_handler(SIGTERM, terminate_parent); set_signal_handler(SIGCHLD, wait_child); set_signal_handler(SIGHUP, restart_parent); /* * Set `once_started' flag. */ if (once_started) syslog(LOG_NOTICE, "server restarted"); else syslog(LOG_NOTICE, "server started"); once_started = 1; /* * Main loop for the parent process. */ for (;;) { /* * Unblock fatal signals. */ unblock_signal(SIGHUP); unblock_signal(SIGINT); unblock_signal(SIGTERM); unblock_signal(SIGCHLD); /* * Wait a connection from a client. */ if (wait_server_ports(&listening_files, &select_files, &max_listening_file) < 0) { if (errno != EINTR) { syslog(LOG_DEBUG, "failed to wait a connection, %s", strerror(errno)); goto die; } else if (restart_trigger) { return; } else { continue; } } /* * Block fatal signals. */ block_signal(SIGHUP); block_signal(SIGINT); block_signal(SIGTERM); block_signal(SIGCHLD); /* * Accept a connection. */ #if defined(ENABLE_IPV6) address_length = sizeof(struct sockaddr_storage); #else address_length = sizeof(struct sockaddr_in); #endif /* * TODO: nonblocking I/O (not yet) */ for (i = 0; i <= max_listening_file; i++) { if (FD_ISSET(i, &select_files)) { accepted_in_file = accept(i, (struct sockaddr *)&address, &address_length); accepted_out_file = accepted_in_file; if (accepted_in_file < 0) { syslog(LOG_ERR, "accept() failed, %s", strerror(errno)); continue; } syslog(LOG_DEBUG, "debug: accept the connection"); /* * Fork. The child process talk to the client. */ pid = fork(); if (pid < 0) { syslog(LOG_ERR, "fork() failed, %s", strerror(errno)); continue; } else if (pid == 0) { syslog(LOG_DEBUG, "debug: forked"); break; } /* * Close an accepted socket (at the parent process). */ if (close(accepted_in_file) < 0) { syslog(LOG_ERR, "close() failed, %s", strerror(errno)); goto die; } } } if (pid == 0) { break; } } /* * Set signal handlers. */ set_signal_handler(SIGBUS, abort_child); set_signal_handler(SIGSEGV, abort_child); set_signal_handler(SIGINT, terminate_child); set_signal_handler(SIGTERM, terminate_child); set_signal_handler(SIGCHLD, SIG_IGN); set_signal_handler(SIGHUP, terminate_child); set_signal_handler(SIGPIPE, SIG_IGN); /* * Unblock fatal signals. */ unblock_signal(SIGHUP); unblock_signal(SIGINT); unblock_signal(SIGTERM); unblock_signal(SIGCHLD); /* * Close the file to listen to the server port. */ close_fdset(&listening_files, &max_listening_file); /* * Get the client host name and address. */ if (identify_remote_host(accepted_in_file, client_host_name, client_address) < 0) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); shutdown(accepted_in_file, SHUT_RDWR); exit(1); } /* * Check for the access permission to the client. */ if (!test_permission(&permissions, client_host_name, client_address, match_wildcard)) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); shutdown(accepted_in_file, SHUT_RDWR); exit(0); } /* * Get a ticket for the client. */ if (max_clients != 0) { if (get_ticket(&connection_ticket_stock) < 0) { syslog(LOG_INFO, "full of clients"); shutdown(accepted_in_file, SHUT_RDWR); exit(0); } } syslog(LOG_INFO, "connected: host=%s(%s)", client_host_name, client_address); /* * Set book permissions to the current client. */ check_book_permissions(); /* * Communicate with the client. */ protocol_main(); shutdown(accepted_in_file, SHUT_RDWR); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); syslog(LOG_INFO, "the child server process exits"); exit(0); /* * A fatal error occurrs on a parent... */ die: shutdown_fdset(&listening_files, &max_listening_file, SHUT_RDWR); close_fdset(&listening_files, &max_listening_file); if (once_started) remove_pid_file(old_pid_file_name); if (once_started) { set_signal_handler(SIGINT, SIG_IGN); #ifdef HAVE_KILLPG killpg(process_group_id, SIGINT); #else kill(-process_group_id, SIGINT); #endif } finalize_global_variables(); eb_finalize_library(); syslog(LOG_CRIT, "the server exits"); exit(1); } /* * Main routine for inetd mode. */ static void inetd_main() { accepted_in_file = 0; accepted_out_file = 1; /* * Set signal handlers. */ set_signal_handler(SIGBUS, abort_parent); set_signal_handler(SIGSEGV, abort_parent); set_signal_handler(SIGINT, SIG_IGN); set_signal_handler(SIGQUIT, SIG_IGN); set_signal_handler(SIGTERM, terminate_parent); set_signal_handler(SIGHUP, terminate_parent); set_signal_handler(SIGPIPE, SIG_IGN); /* * Read a configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { syslog(LOG_ERR, "configuration failure"); goto die; } /* * Reopen syslog. */ closelog(); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif /* * Change the current working directory. */ if (chdir(work_path) < 0) { syslog(LOG_ERR, "failed to change the directory, %s: %s", strerror(errno), work_path); goto die; } /* * Set UID and GID. */ if (set_privilege(user_id, group_id) < 0) { syslog(LOG_ERR, "failed to set owner and group of the process"); goto die; } /* * Get the client host name and address. */ if (identify_remote_host(accepted_in_file, client_host_name, client_address) < 0) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); goto die; } /* * Check for the access permission to the client. */ if (!test_permission(&permissions, client_host_name, client_address, match_wildcard)) { syslog(LOG_ERR, "connection denied: host=%s(%s)", client_host_name, client_address); shutdown(accepted_in_file, SHUT_RDWR); exit(0); } /* * Get a ticket for the client. */ if (max_clients != 0) { bind_ticket_stock(&connection_ticket_stock, connection_lock_file_name, max_clients); if (get_ticket(&connection_ticket_stock) < 0) { syslog(LOG_INFO, "full of clients"); goto die; } } syslog(LOG_INFO, "connected: host=%s(%s)", client_host_name, client_address); /* * Activate all books. */ if (activate_book_registry() == 0) syslog(LOG_ERR, "no book is available"); /* * Check book permissions to the current client. */ check_book_permissions(); /* * Communicate with the client. */ protocol_main(); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); syslog(LOG_INFO, "the server exits"); exit(0); /* * A fatal error occurrs... */ die: fflush(stderr); shutdown(accepted_in_file, SHUT_RDWR); finalize_global_variables(); eb_finalize_library(); syslog(LOG_INFO, "the server exits"); exit(1); } /* * Main routine for inetd mode. */ static void test_main() { accepted_in_file = 0; accepted_out_file = 1; /* * Read a configuration file. */ if (read_configuration(configuration_file_name, configuration_table) < 0) { fprintf(stderr, "configuration failure\n"); syslog(LOG_ERR, "configuration failure"); exit(1); } /* * Activate all books. */ if (activate_book_registry() == 0) syslog(LOG_ERR, "no book is available"); /* * Set dummy host name and address. */ strcpy(client_address, "test-mode"); if (isatty(0)) strncpy(client_host_name, ttyname(0), MAX_HOST_NAME_LENGTH); else strncpy(client_host_name, "stdin", MAX_HOST_NAME_LENGTH); *(client_host_name + MAX_HOST_NAME_LENGTH) = '\0'; idle_timeout = 0; /* * Reopen syslog. */ closelog(); #ifdef LOG_DAEMON openlog(program_name, LOG_NDELAY | LOG_PID, syslog_facility); #else openlog(program_name, LOG_NDELAY | LOG_PID); #endif syslog(LOG_INFO, "connected: host=%s(%s)", client_host_name, client_address); /* * Set book permissions. */ set_all_book_permissions(); /* * Communicate with the client. */ printf("# %s version %s\n", program_name, program_version); printf("# test mode\n"); fflush(stdout); protocol_main(); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); exit(0); } /* * Output usage to standard out. */ static void output_help() { printf("Usage: %s [option...]\n", program_name); printf("Options:\n"); printf(" -c FILE --configuration-file FILE\n"); printf(" specify a configuration file\n"); printf(" (default: %s)\n", DEFAULT_CONFIGURATION_FILE_NAME); printf(" -h --help display this help, then exit\n"); printf(" -i --inetd inetd mode\n"); printf(" -t --test test mode\n"); printf(" -v --version display version number, then exit\n"); printf("\nDefault value used in a configuration file:\n"); printf(" work-path %s\n", DEFAULT_WORK_PATH); printf("\nOptional feature:\n"); #ifdef ENABLE_IPV6 printf(" IPv6 support enabled\n"); #else printf(" IPv6 disabled\n\n"); #endif printf("\nReport bugs to %s.\n", MAILING_ADDRESS); fflush(stdout); } /* * Set a signal handler. * `signal' on some SystemV based systems is not reliable. * We use `sigaction' if available. */ static void set_signal_handler(signal_number, function) int signal_number; RETSIGTYPE (*function) EBNETD_P((int)); { #ifdef HAVE_SIGPROCMASK struct sigaction action; action.sa_handler = function; sigemptyset(&action.sa_mask); action.sa_flags = SA_NOCLDSTOP; if (signal_number == SIGALRM) { #ifdef SA_INTERRUPT action.sa_flags |= SA_INTERRUPT; #endif } else { #ifdef SA_RESTART action.sa_flags |= SA_RESTART; #endif } sigaction(signal_number, &action, NULL); #else /* not HAVE_SIGPROCMASK */ signal(signal_number, function); #endif /* not HAVE_SIGPROCMASK */ } /* * Block signals of `signal_number' type (SIGHUP, SIGINT, ...). * * `sigprocmask' is used, if available. * Otherwise, `sigsetmask' is used if the system has it. * If neither `sigprocmask' nor `sigsetmask' is available, we give up * blocking a signal. */ static void block_signal(signal_number) int signal_number; { #ifdef HAVE_SIGPROCMASK sigset_t signal_set; #endif #ifdef HAVE_SIGPROCMASK sigemptyset(&signal_set); sigaddset(&signal_set, signal_number); sigprocmask(SIG_BLOCK, &signal_set, NULL); #else /* not HAVE_SIGPROCMASK */ #ifdef HAVE_SIGSETMASK signal_mask |= sigmask(signal_number); sigsetmask(signal_mask); #endif /* HAVE_SIGSETMASK */ #endif /* not HAVE_SIGPROCMASK */ } /* * Block signals of `signal_number' type (SIGHUP, SIGINT, ...). * * `sigprocmask' is used, if available. * Otherwise, `sigsetmask' is used if the system has it. * If neither `sigprocmask' nor `sigsetmask' is available, we give up * blocking a signal. */ static void unblock_signal(signal_number) int signal_number; { #ifdef HAVE_SIGPROCMASK sigset_t signal_set; #endif #ifdef HAVE_SIGPROCMASK sigemptyset(&signal_set); sigaddset(&signal_set, signal_number); sigprocmask (SIG_UNBLOCK, &signal_set, NULL); #else /* not HAVE_SIGPROCMASK */ #ifdef HAVE_SIGSETMASK signal_mask = (signal_mask | sigmask(signal_number)) ^ sigmask(signal_number); sigsetmask(signal_mask); #endif /* HAVE_SIGSETMASK */ #endif /* not HAVE_SIGPROCMASK */ } /* * Signal handler for SIGBUS and SIGSEGV. (for parent) */ static RETSIGTYPE abort_parent(signal_number) int signal_number; { if (server_mode == SERVER_MODE_STANDALONE) { syslog(LOG_CRIT, "the server process aborts, receives SIG%s", signal_name(signal_number)); } else { syslog(LOG_ERR, "the server process aborts, receives SIG%s", signal_name(signal_number)); } abort(); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGBUS and SIGSEGV. (for child) */ static RETSIGTYPE abort_child(signal_number) int signal_number; { syslog(LOG_ERR, "the child server process aborts, receives SIG%s", signal_name(signal_number)); abort(); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGTERM, SIGINT SIGQUIT, and SIGHUP. (for parent) */ static RETSIGTYPE terminate_parent(signal_number) int signal_number; { if (server_mode == SERVER_MODE_STANDALONE) { syslog(LOG_CRIT, "the server process exits, receives SIG%s", signal_name(signal_number)); } else { syslog(LOG_ERR, "the server process exits, receives SIG%s", signal_name(signal_number)); } /* * Kill child processes. */ set_signal_handler(SIGINT, SIG_IGN); if (server_mode == SERVER_MODE_STANDALONE) { #ifdef HAVE_KILLPG killpg(process_group_id, SIGINT); #else kill(-process_group_id, SIGINT); #endif } /* * Shutdown a server port. */ shutdown_fdset(&listening_files, &max_listening_file, SHUT_RDWR); close_fdset(&listening_files, &max_listening_file); /* * Remove a PID file. */ if (server_mode == SERVER_MODE_STANDALONE) remove_pid_file(old_pid_file_name); _exit(1); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGHUP, SIGINT, SIGQUIT and SIGTERM. (for child) */ static RETSIGTYPE terminate_child(signal_number) int signal_number; { syslog(LOG_ERR, "the child server process exits, receives SIG%s", signal_name(signal_number)); shutdown(accepted_in_file, SHUT_RDWR); /* * Clear lists and buffers. */ finalize_global_variables(); eb_finalize_library(); _exit(0); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGCHLD. */ static RETSIGTYPE wait_child(signal_number) int signal_number; { #ifdef HAVE_UNION_WAIT union wait status; #else int status; #endif syslog(LOG_INFO, "receives SIGCHLD"); #ifdef HAVE_WAITPID while (0 < waitpid(-1, &status, WNOHANG)) ; #else /* not HAVE WAITPID */ while (0 < wait3(&status, WNOHANG, NULL)) ; #endif /* not HAVE WAITPID */ /* * Set a signal handler again. */ set_signal_handler(SIGCHLD, wait_child); #ifndef RETSIGTYPE_VOID return 0; #endif } /* * Signal handler for SIGHUP (for parent). */ static RETSIGTYPE restart_parent(signal_number) int signal_number; { syslog(LOG_ERR, "the server restart, receives SIGHUP"); restart_trigger++; #ifndef RETSIGTYPE_VOID return 0; #endif } ebnetd-1.0.dfsg.1/ebhttpd/cgiquery.c0000644000175000017500000002531107673055342016655 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif #ifndef HAVE_STRTOL #ifdef __STDC__ long strtol(const char *, char **, int); #else /* not __STDC__ */ long strtol(); #endif /* not __STDC__ */ #endif /* not HAVE_STRTOL */ #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp() int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) #include "cgiquery.h" /* * Unexported functions. */ #ifdef __STDC__ static void cgi_query_decode_string(char *); #else static void cgi_query_decode_string(); #endif /* * Initialize a query. */ void cgi_query_initialize(query) CGI_Query *query; { query->element_count = 0; query->elements = NULL; query->elements_buffer = NULL; } /* * Finalize a query. * All allocated memories in `queue' are also disposed. */ void cgi_query_finalize(query) CGI_Query *query; { CGI_Query_Element *element; CGI_Query_Element *element_next; /* * Dispose all elements in a query. */ if (query->elements != NULL) { element = query->elements; while (element != NULL) { element_next = element->next; free(element); element = element_next; } query->elements = NULL; if (query->elements_buffer != NULL) free(query->elements_buffer); query->elements_buffer = NULL; } /* * Set element count to 0. */ query->element_count = 0; } /* * Find a query element whose name is `name'. * If the element is found, a given value for the name is returned. * Otherwise, NULL is returned. */ const char * cgi_query_element_value(query, name) CGI_Query *query; const char *name; { CGI_Query_Element *element; element = query->elements; while (element != NULL) { if (strcmp(element->name, name) == 0) return (const char *)element->value; element = element->next; } return NULL; } /* * This function is equevalent to cgi_query_element_value(), except * that it returns an empty string when `name' is not defined. */ const char * cgi_query_element_string_value(query, name) CGI_Query *query; const char *name; { CGI_Query_Element *element; element = query->elements; while (element != NULL) { if (strcmp(element->name, name) == 0) return (const char *)element->value; element = element->next; } return ""; } /* * Find a query element whose name is `name'. * If the element is found, this function converts the string value * for the name to an integer and then returns the value. * Otherwise, 0 is returned. */ int cgi_query_element_integer_value(query, name) CGI_Query *query; const char *name; { CGI_Query_Element *element; element = query->elements; while (element != NULL) { if (strcmp(element->name, name) == 0) { if (strncasecmp(element->value, "0x", 2) == 0) return strtol((const char *)element->value + 2, NULL, 16); else return strtol((const char *)element->value, NULL, 10); } element = element->next; } return 0; } /* * Parse a query string. * The argument `query_string' is a CGI query. That is a list of * `name' or `name=value' elements, separated by an ampersand (`&'), * like this: * * "word=hyper+text&sort=score&maxhits=20" * * Note that if an element has a name only, the value for the element * is set to an empty string, not NULL. * * This function returns -1 if not enough memory is remained, * returns 0 otherwise. */ int cgi_query_parse_string(query, query_string) CGI_Query *query; const char *query_string; { CGI_Query_Element *element; char *query_string_p; char *name; char *value; size_t query_string_length; int end_of_query_string; /* * Re-initialize if `query' has already been used. */ if (query->elements != NULL) { cgi_query_finalize(query); cgi_query_initialize(query); } /* * Copy `query_string' to `query->elements_buffer'. */ query_string_length = strlen(query_string); query->elements_buffer = (char *)malloc(query_string_length + 1); if (query->elements_buffer == NULL) goto failed; memcpy(query->elements_buffer, query_string, query_string_length + 1); /* * Parse `query_string'. */ query_string_p = query->elements_buffer; name = query->elements_buffer; value = NULL; end_of_query_string = 0; for (;;) { if (*query_string_p == '=' && value == NULL) { /* * `=' separates name and value. */ *query_string_p = '\0'; value = query_string_p + 1; } else if (*query_string_p == '&' || *query_string_p == '\0') { /* * `&' or `\0' terminates a query element. */ if (*query_string_p == '\0') end_of_query_string = 1; *query_string_p = '\0'; /* * Allocate memories for the element, and set name and value * of the element. */ element = (CGI_Query_Element *) malloc(sizeof(CGI_Query_Element)); if (element == NULL) goto failed; element->name = name; if (value == NULL) element->value = query_string_p; else element->value = value; /* * Decode name and value. */ cgi_query_decode_string(element->name); cgi_query_decode_string(element->value); element->next = query->elements; query->elements = element; query->element_count++; /* * Exit the loop if `\0' is appeared. */ if (end_of_query_string) break; name = query_string_p + 1; value = NULL; } query_string_p++; } return 0; /* * An error occurs... */ failed: cgi_query_finalize(query); return -1; } /* * Decode all "%" and "+" in a query name or value. * "%" is decoded to an 8 bits code . * "+" is decoded to a space. */ static void cgi_query_decode_string(string) char *string; { char *source_string_p = string; char *destination_string_p = string; int hex1; int hex2; int c; while (*source_string_p != '\0') { if (*source_string_p == '%' && isxdigit(*(source_string_p + 1)) && isxdigit(*(source_string_p + 2))) { /* * "%" occurs. * Convert it to an 8 bit code . */ hex1 = *(source_string_p + 1); hex2 = *(source_string_p + 2); c = 0; if ('0' <= hex1 && hex1 <= '9') c += (hex1 - '0') << 4; else if ('A' <= hex1 && hex1 <= 'F') c += (hex1 - 'A' + 0x0a) << 4; else if ('a' <= hex1 && hex1 <= 'f') c += (hex1 - 'a' + 0x0a) << 4; if ('0' <= hex2 && hex2 <= '9') c += (hex2 - '0'); else if ('A' <= hex2 && hex2 <= 'F') c += (hex2 - 'A' + 0x0a); else if ('a' <= hex2 && hex2 <= 'f') c += (hex2 - 'a' + 0x0a); *(unsigned char *)destination_string_p = c; source_string_p += 3; destination_string_p++; } else if (*source_string_p == '+') { /* * `+' occurs. * Convert it to a space. */ *destination_string_p = ' '; source_string_p++; destination_string_p++; } else { *destination_string_p = *source_string_p; source_string_p++; destination_string_p++; } } *destination_string_p = '\0'; } /* * Print a query state to standard out, like this: * * cgi_query = { * element_count = 3, * elements = { * {name = word, value = hyper text}, * {name = sort, value = score}, * {name = maxhits, value = 20} * } * } */ #if defined(DEBUG) || defined(TEST) void cgi_query_print(query) CGI_Query *query; { CGI_Query_Element *element; char *name_p; /* * Print header and element_count. */ printf("cgi_query = {\n element_count = %d,\n elements = {\n", query->element_count); for (element = query->elements; element != NULL; element = element->next) { /* * Print name. */ fputs(" {name = \"", stdout); for (name_p = element->name; *name_p != '\0'; name_p++) { if (' ' <= *name_p && *name_p <= '~' && *name_p != '"') fputc(*name_p, stdout); else printf("\\x%02x", *(unsigned char *)name_p); } /* * Print value. */ fputs("\", value = \"", stdout); for (name_p = element->value; *name_p != '\0'; name_p++) { if (' ' <= *name_p && *name_p <= '~' && *name_p != '"') fputc(*name_p, stdout); else printf("\\x%02x", *(unsigned char *)name_p); } /* * Print footer. */ if (element->next == NULL) fputs("\"}\n", stdout); else fputs("\"},\n", stdout); } /* * Print footer. */ fputs("}\n", stdout); fflush(stdout); } #endif /* defined(DEBUG) || defined(TEST) */ /* * Main for test. */ #ifdef TEST int main(argc, argv) int argc; char *argv[]; { CGI_Query query; cgi_query_initialize(&query); if (argc < 2) { fprintf(stderr, "usage: %s query-string\n", argv[0]); exit(1); } cgi_query_parse_string(&query, argv[1]); cgi_query_print(&query); } #endif ebnetd-1.0.dfsg.1/ebhttpd/entity.c0000644000175000017500000000644007673055335016345 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* * Latin-1 character to entity reference table. * (e.g. 'a --> á) */ const char *latin1_entity_name_table[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x00 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x08 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x10 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x18 */ NULL, NULL, "quot", NULL, NULL, NULL, "amp", NULL, /* 0x20 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x28 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x30 */ NULL, NULL, NULL, NULL, "lt", NULL, "gt", NULL, /* 0x38 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x40 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x48 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x50 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x58 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x60 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x68 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x70 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x78 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x80 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x88 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x90 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x98 */ "nbsp", "iexcl", "cent", "pound", /* 0xa0 */ "curren", "yen", "brvbar", "sect", /* 0xa4 */ "uml", "copy", "ordf", "laquo", /* 0xa8 */ "not", "shy", "reg", "macr", /* 0xac */ "deg", "plusmn", "sup2", "sup3", /* 0xb0 */ "acute", "micro", "para", "middot", /* 0xb4 */ "cedil", "sup1", "ordm", "requo", /* 0xb8 */ "frac14", "frac12", "farc34", "iquest", /* 0xbc */ "Agrave", "Aacute", "Acirc", "Atilde", /* 0xc0 */ "Auml", "Aring", "AElig", "Ccedil", /* 0xc4 */ "Egrave", "Eacute", "Ecirc", "Euml", /* 0xc8 */ "Igrave", "Iacute", "Icirc", "Iuml", /* 0xcc */ "ETH", "Ntilde", "Ograve", "Oacute", /* 0xd0 */ "Ocirc", "Otilde", "Ouml", "times", /* 0xd4 */ "Oslash", "Ugrave", "Uacute", "Ucirc", /* 0xd8 */ "Uuml", "Yacute", "THORN", "szlig", /* 0xdc */ "agrave", "aacute", "acirc", "atilde", /* 0xe0 */ "auml", "aring", "aelig", "ccedil", /* 0xe4 */ "egrave", "eacute", "ecirc", "euml", /* 0xe8 */ "igrave", "iacute", "icirc", "iuml", /* 0xec */ "eth", "ntilde", "ograve", "oacute", /* 0xf0 */ "ocirc", "otilde", "ouml", "divide", /* 0xf4 */ "oslash", "ugrave", "uacute", "ucirc", /* 0xf8 */ "uuml", "yacute", "thorn", "yuml" /* 0xfc */ }; ebnetd-1.0.dfsg.1/ebhttpd/generator.c0000644000175000017500000013774307773152633017032 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef TIME_WITH_SYS_TIME #include #include #else #ifdef HAVE_SYS_TIME_H #include #else #include #endif #endif #include #include #include #include #include #include #include "httprescode.h" #include "http.h" #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif /* not HAVE_MEMCPY */ #ifdef __STDC__ #define VOID void #else #define VOID char #endif /* * Width of the text entry in a form. */ #define INPUT_TEXT_ENTRY_SIZE 40 /* * Unexported functions. */ static void output_html_header EBNETD_P((Response_Property *, const char *)); static void output_html_footer EBNETD_P((Response_Property *)); static void output_word_list EBNETD_P((Response_Property *)); static void output_hit_list EBNETD_P((Response_Property *, int *, int *)); static void output_search_mutli_select EBNETD_P((Response_Property *)); static void output_search_mutli_result EBNETD_P((Response_Property *)); static void output_text_internal EBNETD_P((Response_Property *, EB_Position *)); /* * Output header part of HTML. */ static void output_html_header(property, title) Response_Property *property; const char *title; { char text[MAX_STRING_LENGTH + 1]; output_string(property, "\n"); output_string(property, "\n"); output_string(property, "\n"); sprintf(text, "%s\n", title); output_string(property, text); output_string(property, "\n"); output_string(property, "\n"); sprintf(text, "

%s

\n", title); output_string(property, text); } /* * Output footer part of HTML. */ static void output_html_footer(property) Response_Property *property; { output_string(property, "
\n"); output_string(property, "
Powered by ebHTTPD
\n"); output_string(property, "\n"); output_string(property, "\n"); } /* * Output error message as HTML. */ void output_error_message(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; const char *response_code_message; output_html_header(property, "Error"); response_code_message = http_response_code_message(property->response_code); if (response_code_message == NULL) response_code_message = "Unknown Error"; sprintf(text, "%03d %s\n", property->response_code, response_code_message); output_string(property, text); output_html_footer(property); } /* * Output `&word1=...&word2=....&...' as HTML. */ static void output_word_list(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; int i; for (i = 0; i < EB_MAX_KEYWORDS; i++) { sprintf(text, "&word%d=", i + 1); output_string(property, text); output_cgi_string(property, property->input_words[i]); } } /* * Output book list as HTML. * (path = /) */ void output_book_list(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; Book *book; /* * Oputput an HTML header. */ output_html_header(property, "書籍一覧"); /* * Output a book list. */ output_string(property, "\n"); /* * Oputput an HTML footer. */ output_html_footer(property); } /* * Output subbook list as HTML. * (path = //) */ void output_subbook_list(property) Response_Property *property; { EB_Error_Code error_code; char text[MAX_STRING_LENGTH + 1]; EB_Subbook_Code subbook_list[EB_MAX_SUBBOOKS]; char subbook_title[EB_MAX_TITLE_LENGTH + 1]; char subbook_name[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; int subbook_count; int i; /* * Oputput an HTML header. */ output_html_header(property, "副本一覧"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); output_string(property, "→"); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); output_string(property, ")

\n"); /* * Get a subbook list of the current book. */ error_code = eb_subbook_list(&property->book->book, subbook_list, &subbook_count); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } /* * Output an input form. */ output_string(property, "\n"); /* * Oputput an HTML footer. */ footer: output_html_footer(property); } /* * Output method list as HTML. * (path = ///) */ void output_method_list(property) Response_Property *property; { EB_Error_Code error_code; char multi_title[EB_MAX_MULTI_TITLE_LENGTH + 1]; char text[MAX_STRING_LENGTH + 1]; EB_Multi_Search_Code multi_list[EB_MAX_MULTI_SEARCHES]; EB_Position position; int multi_count; int i; /* * Oputput an HTML header. */ output_html_header(property, "検索方式一覧"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); output_string(property, "→"); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); output_string(property, ")

\n"); /* * Get a mulit search list of the current subbook. */ eb_multi_search_list(&property->book->book, multi_list, &multi_count); /* * Output a method list. */ output_string(property, "\n"); /* * Oputput an HTML footer. */ output_html_footer(property); } /* * Output word search input form as HTML. * (path = ///word) */ void output_word_form(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; /* * Oputput an HTML header. */ output_html_header(property, "前方一致検索"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); output_string(property, "→前方一致検索\n"); output_string(property, ")

\n"); /* * Output an input form. */ sprintf(text, "
\n", property->book->name, property->subbook_name); output_string(property, text); output_string(property, "

\n"); output_string(property, "単語:
\n"); sprintf(text, "
\n", INPUT_TEXT_ENTRY_SIZE, property->input_words[0]); output_string(property, text); output_string(property, "

\n"); output_string(property, "

\n"); output_string(property, "\n"); output_string(property, "\n"); output_string(property, "

\n"); output_string(property, "
\n"); /* * Oputput an HTML footer. */ output_html_footer(property); } /* * Output word search input form as HTML. * (path = ///exactword) */ void output_exactword_form(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; /* * Oputput an HTML header. */ output_html_header(property, "完全一致検索"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); output_string(property, "→完全一致検索\n"); output_string(property, ")

\n"); /* * Output an input form. */ sprintf(text, "
\n", property->book->name, property->subbook_name); output_string(property, text); output_string(property, "

\n"); sprintf(text, "単語:
\n"); output_string(property, text); sprintf(text, "
\n", INPUT_TEXT_ENTRY_SIZE, property->input_words[0]); output_string(property, text); output_string(property, "

\n"); output_string(property, "

\n"); output_string(property, "\n"); output_string(property, "\n"); output_string(property, "

\n"); output_string(property, "
\n"); /* * Oputput an HTML footer. */ output_html_footer(property); } /* * Output word search input form as HTML. * (path = ///endword) */ void output_endword_form(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; /* * Oputput an HTML header. */ output_html_header(property, "後方一致検索"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); output_string(property, "→後方一致検索\n"); output_string(property, ")

\n"); /* * Output an input form. */ sprintf(text, "
\n", property->book->name, property->subbook_name); output_string(property, text); output_string(property, "

\n"); sprintf(text, "単語:
\n"); output_string(property, text); sprintf(text, "
\n", INPUT_TEXT_ENTRY_SIZE, property->input_words[0]); output_string(property, text); output_string(property, "

\n"); output_string(property, "

\n"); output_string(property, "\n"); output_string(property, "\n"); output_string(property, "

\n"); output_string(property, "
\n"); /* * Oputput an HTML footer. */ output_html_footer(property); } /* * Output keyword search input form as HTML. * (path = ///keyword) */ void output_keyword_form(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; int i; /* * Oputput an HTML header. */ output_html_header(property, "条件検索"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); output_string(property, "→条件検索\n"); output_string(property, ")

\n"); /* * Output an input form. */ sprintf(text, "
\n", property->book->name, property->subbook_name); output_string(property, text); for (i = 0; i < EB_MAX_KEYWORDS; i++) { output_string(property, "

\n"); sprintf(text, "単語 %d:
\n", i + 1); output_string(property, text); output_string(property, "
\n", i + 1, INPUT_TEXT_ENTRY_SIZE, property->input_words[i]); output_string(property, text); output_string(property, "

\n"); } output_string(property, "

\n"); output_string(property, "\n"); output_string(property, "\n"); output_string(property, "

\n"); output_string(property, "
\n"); /* * Oputput an HTML footer. */ output_html_footer(property); } /* * Output multi search input form HTML. * (path = ///multi) */ void output_multi_form(property) Response_Property *property; { EB_Error_Code error_code; char multi_title[EB_MAX_MULTI_TITLE_LENGTH + 1]; char text[MAX_STRING_LENGTH + 1]; int entry_count; char entry_labels[EB_MAX_MULTI_ENTRIES][EB_MAX_MULTI_LABEL_LENGTH + 1]; EB_Position candidates_positions[EB_MAX_MULTI_ENTRIES]; int i; if (eb_multi_title(&property->book->book, property->multi_search, multi_title) != EB_SUCCESS) { sprintf(multi_title, "複合検索 %d", property->multi_search); } /* * Oputput an HTML header. */ output_html_header(property, multi_title); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); sprintf(text, "→%s\n", multi_title); output_string(property, text); output_string(property, ")

\n"); /* * Get the number of entries of the current multi search. */ error_code = eb_multi_entry_count(&property->book->book, property->multi_search, &entry_count); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } /* * Get an entry labels of the current multi search. */ for (i = 0; i < entry_count; i++) { error_code = eb_multi_entry_label(&property->book->book, property->multi_search, i, entry_labels[i]); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } } /* * Get candidate information of the current multi search. */ for (i = 0; i < entry_count; i++) { error_code = eb_multi_entry_candidates(&property->book->book, property->multi_search, i, &candidates_positions[i]); if (error_code == EB_ERR_NO_CANDIDATES) { candidates_positions[i].page = 0; candidates_positions[i].offset = 0; } else if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } } /* * Output an input form. */ sprintf(text, "
\n", property->book->name, property->subbook_name, property->multi_search); output_string(property, text); for (i = 0; i < entry_count; i++) { output_string(property, "

\n"); output_html_safe_string(property, entry_labels[i]); output_string(property, ":
\n"); sprintf(text, "\n", i + 1, INPUT_TEXT_ENTRY_SIZE, property->input_words[i]); output_string(property, text); if (candidates_positions[i].page != 0) { output_string(property, "\n", i + 1); output_string(property, text); } output_string(property, "
\n"); output_string(property, "

\n"); } output_string(property, "

\n"); sprintf(text, "\n", property->multi_search); output_string(property, text); output_string(property, "\n"); output_string(property, "\n"); output_string(property, "

\n"); output_string(property, "
\n"); /* * Oputput an HTML footer. */ footer: output_html_footer(property); } /* * Output word search result as HTML. * (path = ///search-word) */ void output_search_word(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; EB_Error_Code error_code; int next_whence; int previous_whence; /* * Oputput an HTML header. */ output_html_header(property, "検索結果"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); sprintf(text, "→前方一致検索\n", property->book->name, property->subbook_name); output_string(property, text); output_string(property, "→検索結果\n"); output_string(property, ")

\n"); /* * Submit a search. */ error_code = eb_search_word(&property->book->book, property->input_words[0]); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } /* * Output hit list. */ output_hit_list(property, &next_whence, &previous_whence); /* * Generate [前へ] and [次へ] buttons. */ if (previous_whence != 0 || next_whence != 0) output_string(property, "

\n"); if (previous_whence != 0) { sprintf(text, "book->name, property->subbook_name, previous_whence); output_string(property, text); output_cgi_string(property, property->input_words[0]); output_string(property, "&submit=submit\">[前へ]\n"); } if (next_whence != 0) { sprintf(text, "book->name, property->subbook_name, next_whence); output_string(property, text); output_cgi_string(property, property->input_words[0]); output_string(property, "&submit=submit\">[次へ]\n"); } if (previous_whence != 0 || next_whence != 0) output_string(property, "

\n"); /* * Oputput an HTML footer. */ footer: output_html_footer(property); } /* * Output end-word search result as HTML. * (path = ///search-exactword) */ void output_search_exactword(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; EB_Error_Code error_code; int next_whence; int previous_whence; /* * Oputput an HTML header. */ output_html_header(property, "検索結果"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); sprintf(text, "→完全一致検索\n", property->book->name, property->subbook_name); output_string(property, text); output_string(property, "→検索結果\n"); output_string(property, ")

\n"); /* * Submit a search. */ error_code = eb_search_exactword(&property->book->book, property->input_words[0]); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } /* * Output hit list. */ output_hit_list(property, &next_whence, &previous_whence); /* * Generate [前へ] and [次へ] buttons. */ if (previous_whence != 0 || next_whence != 0) output_string(property, "

\n"); if (previous_whence != 0) { sprintf(text, "book->name, property->subbook_name, previous_whence); output_string(property, text); output_cgi_string(property, property->input_words[0]); output_string(property, "&submit=submit\">[前へ]\n"); } if (next_whence != 0) { sprintf(text, "book->name, property->subbook_name, next_whence); output_string(property, text); output_cgi_string(property, property->input_words[0]); output_string(property, "&submit=submit\">[次へ]\n"); } if (previous_whence != 0 || next_whence != 0) output_string(property, "

\n"); /* * Oputput an HTML footer. */ footer: output_html_footer(property); } /* * Output end-word search result as HTML. * (path = ///search-endword) */ void output_search_endword(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; EB_Error_Code error_code; int next_whence; int previous_whence; /* * Oputput an HTML header. */ output_html_header(property, "検索結果"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); sprintf(text, "→後方一致検索\n", property->book->name, property->subbook_name); output_string(property, text); output_string(property, "→検索結果\n"); output_string(property, ")

\n"); /* * Submit a search. */ error_code = eb_search_endword(&property->book->book, property->input_words[0]); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } /* * Output hit list. */ output_hit_list(property, &next_whence, &previous_whence); /* * Generate [前へ] and [次へ] buttons. */ if (previous_whence != 0 || next_whence != 0) output_string(property, "

\n"); if (previous_whence != 0) { sprintf(text, "book->name, property->subbook_name, previous_whence); output_string(property, text); output_cgi_string(property, property->input_words[0]); output_string(property, "&submit=submit\">[前へ]\n"); } if (next_whence != 0) { sprintf(text, "book->name, property->subbook_name, next_whence); output_string(property, text); output_cgi_string(property, property->input_words[0]); output_string(property, "&submit=submit\">[次へ]\n"); } if (previous_whence != 0 || next_whence != 0) output_string(property, "

\n"); /* * Oputput an HTML footer. */ footer: output_html_footer(property); } /* * Output keyword search result as HTML. * (path = ///search-keyword) */ void output_search_keyword(property) Response_Property *property; { char *keywords[EB_MAX_KEYWORDS + 1]; char text[MAX_STRING_LENGTH + 1]; EB_Error_Code error_code; int next_whence; int previous_whence; int i; /* * Oputput an HTML header. */ output_html_header(property, "検索結果"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); sprintf(text, "→条件一致検索\n", property->book->name, property->subbook_name); output_string(property, text); output_string(property, "→検索結果\n"); output_string(property, ")

\n"); /* * Submit a search. */ for (i = 0; i < EB_MAX_KEYWORDS; i++) keywords[i] = property->input_words[i]; keywords[i] = NULL; error_code = eb_search_keyword(&property->book->book, (const char * const *)keywords); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } /* * Output hit list. */ output_hit_list(property, &next_whence, &previous_whence); /* * Generate [前へ] and [次へ] buttons. */ if (previous_whence != 0 || next_whence != 0) output_string(property, "

\n"); if (previous_whence != 0) { sprintf(text, "book->name, property->subbook_name, previous_whence); output_string(property, text); output_word_list(property); output_string(property, "&submit=submit\">[前へ]\n"); } if (next_whence != 0) { sprintf(text, "book->name, property->subbook_name, next_whence); output_string(property, text); output_word_list(property); output_string(property, "&submit=submit\">[次へ]\n"); } if (previous_whence != 0 || next_whence != 0) output_string(property, "

\n"); /* * Oputput an HTML footer. */ footer: output_html_footer(property); } /* * Output result of multi search or candidates for multi search. * (path = ////search-multi) */ void output_search_multi(property) Response_Property *property; { if (0 <= property->multi_entry) output_search_mutli_select(property); else output_search_mutli_result(property); } /* * Output candidates of multi search. */ static void output_search_mutli_select(property) Response_Property *property; { EB_Error_Code error_code; char multi_title[EB_MAX_MULTI_TITLE_LENGTH + 1]; char text[MAX_STRING_LENGTH + 1]; EB_Position *position; EB_Position candidates_position; if (eb_multi_title(&property->book->book, property->multi_search, multi_title) != EB_SUCCESS) { sprintf(multi_title, "複合検索 %d", property->multi_search); } /* * Oputput an HTML header. */ output_html_header(property, "候補選択"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); sprintf(text, "→%s\n", property->book->name, property->subbook_name, property->multi_search, multi_title); output_string(property, text); output_string(property, "→候補選択\n"); output_string(property, ")

\n"); /* * Galcurate position of candidates list. */ if (0 < property->position.page) position = &property->position; else { error_code = eb_multi_entry_candidates(&property->book->book, property->multi_search, property->multi_entry, &candidates_position); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } position = &candidates_position; } /* * Output text. */ output_string(property, "

"); output_text_internal(property, position); output_string(property, "

"); /* * Oputput an HTML footer. */ footer: output_html_footer(property); } /* * Output multi search result as HTML. */ static void output_search_mutli_result(property) Response_Property *property; { char *keywords[EB_MAX_KEYWORDS + 1]; char multi_title[EB_MAX_MULTI_TITLE_LENGTH + 1]; char text[MAX_STRING_LENGTH + 1]; int entry_count; EB_Error_Code error_code; int next_whence; int previous_whence; int i; if (eb_multi_title(&property->book->book, property->multi_search, multi_title) != EB_SUCCESS) { sprintf(multi_title, "複合検索 %d", property->multi_search); } /* * Oputput an HTML header. */ output_html_header(property, "検索結果"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); sprintf(text, "→%s\n", property->book->name, property->subbook_name, property->multi_search, multi_title); output_string(property, text); output_string(property, "→検索結果\n"); output_string(property, ")

\n"); /* * Get information about multi search entries. */ error_code = eb_multi_entry_count(&property->book->book, property->multi_search, &entry_count); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } /* * Submit a search. */ for (i = 0; i < entry_count; i++) keywords[i] = property->input_words[i]; keywords[i] = NULL; error_code = eb_search_multi(&property->book->book, property->multi_search, (const char * const *)keywords); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); goto footer; } /* * Output hit list. */ output_hit_list(property, &next_whence, &previous_whence); /* * Generate [前へ] and [次へ] buttons. */ if (previous_whence != 0 || next_whence != 0) output_string(property, "

\n"); if (previous_whence != 0) { sprintf(text, "book->name, property->subbook_name, property->multi_search, previous_whence); output_string(property, text); output_word_list(property); output_string(property, "&submit=submit\">[前へ]\n"); } if (next_whence != 0) { sprintf(text, "book->name, property->subbook_name, property->multi_search, next_whence); output_string(property, text); output_word_list(property); output_string(property, "&submit=submit\">[次へ]\n"); } if (previous_whence != 0 || next_whence != 0) output_string(property, "

\n"); /* * Oputput an HTML footer. */ footer: output_html_footer(property); } /* * The maximum number of hit entries for tomporary hit lists. * This is used in eb_hit_list(). */ #define HIT_LIST_LENGTH 50 static void output_hit_list(property, next_whence, previous_whence) Response_Property *property; int *next_whence; int *previous_whence; { char text[MAX_STRING_LENGTH + 1]; EB_Error_Code error_code; EB_Hit hit_list[HIT_LIST_LENGTH]; char heading_buffer1[MAX_STRING_LENGTH + 1]; char heading_buffer2[MAX_STRING_LENGTH + 1]; char *heading; char *previous_heading; EB_Position previous_position; ssize_t heading_length; int hit_count; int total_hit_count = 0; int whence; int i; heading = heading_buffer1; previous_heading = heading_buffer2; *previous_heading = '\0'; previous_position.page = 0; previous_position.offset = 0; whence = 1; *next_whence = 0; output_string(property, "
    \n"); /* * Discard hit entries in front of `property->whence'. */ while (whence < property->whence) { if (whence + HIT_LIST_LENGTH <= property->whence) { error_code = eb_hit_list(&property->book->book, HIT_LIST_LENGTH, hit_list, &hit_count); } else { error_code = eb_hit_list(&property->book->book, property->whence - whence, hit_list, &hit_count); } if (error_code != EB_SUCCESS || hit_count == 0) break; whence += hit_count; } i = 0; hit_count = 0; while (total_hit_count < max_hits || max_hits == 0) { /* * Get hit entries. */ i++; if (hit_count <= i) { error_code = eb_hit_list(&property->book->book, HIT_LIST_LENGTH, hit_list, &hit_count); if (error_code != EB_SUCCESS || hit_count == 0) break; i = 0; } /* * Seek the current subbook. */ error_code = eb_seek_text(&property->book->book, &hit_list[i].heading); if (error_code != EB_SUCCESS) continue; /* * Get heading. */ error_code = eb_read_heading(&property->book->book, &property->book->appendix, property->hookset, (VOID *)property, MAX_STRING_LENGTH, heading, &heading_length); if (error_code != EB_SUCCESS || heading_length == 0) continue; *(heading + heading_length) = '\0'; /* * Ignore a hit entry if its heading and text location are * equal to those of the previous hit entry. */ if (previous_position.page == hit_list[i].text.page && previous_position.offset == hit_list[i].text.offset && strcmp(heading, previous_heading) == 0) continue; total_hit_count++; /* * Output the heading. */ sprintf(text, "
  • %d: ", whence, property->book->name, property->subbook_name, hit_list[i].text.page, hit_list[i].text.offset); output_string(property, text); output_string(property, heading); output_string(property, "\n"); /* * Keep the last message, page, and offset, to remove * duplicated entries. */ if (heading == heading_buffer1) { heading = heading_buffer2; previous_heading = heading_buffer1; } else { heading = heading_buffer1; previous_heading = heading_buffer2; } previous_position.page = hit_list[i].text.page; previous_position.offset = hit_list[i].text.offset; whence++; } output_string(property, "
\n"); /* * Get one more hit entry in order to set `next_whence'. */ if (max_hits <= total_hit_count && max_hits != 0) { error_code = eb_hit_list(&property->book->book, 1, hit_list, &hit_count); if (0 < hit_count) *next_whence = whence; } /* * Set `previous_whence'. */ if (1 < property->whence) *previous_whence = property->whence - max_hits; else *previous_whence = 0; } /* * Output text as HTML. * (path = ///text) */ void output_text(property) Response_Property *property; { char text[EB_SIZE_PAGE]; output_html_header(property, "本文"); output_string(property, "

(\n"); output_string(property, "→書籍一覧\n"); sprintf(text, "→", property->book->name); output_string(property, text); output_html_safe_string(property, property->book->title); output_string(property, ":副本一覧\n"); sprintf(text, "→", property->book->name, property->subbook_name); output_string(property, text); output_html_safe_string(property, property->subbook_title); output_string(property, ":検索方式一覧\n"); output_string(property, "→本文\n"); output_string(property, ")

\n"); output_string(property, "

"); output_text_internal(property, &property->position); output_string(property, "

"); output_html_footer(property); } /* * Internal function for output_text() and output_search_multi_select(). */ static void output_text_internal(property, position) Response_Property *property; EB_Position *position; { char text[EB_SIZE_PAGE]; EB_Error_Code error_code; size_t rest_text_length; size_t text_length_argument; ssize_t actual_text_length; /* * Seek the current subbook. */ error_code = eb_seek_text(&property->book->book, position); if (error_code != EB_SUCCESS) { sprintf(text, "%s\n", eb_error_message(error_code)); output_string(property, text); return; } rest_text_length = max_text_size; for (;;) { /* * Determine how many bytes I should read. */ if (EB_SIZE_PAGE - 1 < rest_text_length || max_text_size == 0) text_length_argument = EB_SIZE_PAGE - 1; else text_length_argument = rest_text_length; if (text_length_argument <= 0) break; /* * Read text. */ error_code = eb_read_text(&property->book->book, &property->book->appendix, property->hookset, (VOID *)property, text_length_argument, text, &actual_text_length); if (error_code != EB_SUCCESS || actual_text_length == 0) break; rest_text_length -= actual_text_length; *(text + actual_text_length) = '\0'; output_string(property, text); } } /* * Output glyph of a narrow local character as GIF. * (path = ///narrow.gif) */ void output_narrow_font_character(property) Response_Property *property; { char bitmap[EB_SIZE_NARROW_FONT_16]; char gif[EB_SIZE_NARROW_FONT_16_GIF]; size_t gif_length; EB_Error_Code error_code; error_code = eb_narrow_font_character_bitmap(&property->book->book, property->local_character, bitmap); if (error_code != EB_SUCCESS) memset(bitmap, 0x00, EB_SIZE_NARROW_FONT_16); eb_bitmap_to_gif(bitmap, EB_WIDTH_NARROW_FONT_16, EB_HEIGHT_FONT_16, gif, &gif_length); output_data(property, gif, EB_SIZE_NARROW_FONT_16_GIF); } /* * Output glyph of a wide local character as GIF. * (path = ///wide.gif) */ void output_wide_font_character(property) Response_Property *property; { char bitmap[EB_SIZE_WIDE_FONT_16]; char gif[EB_SIZE_WIDE_FONT_16_GIF]; size_t gif_length; EB_Error_Code error_code; error_code = eb_wide_font_character_bitmap(&property->book->book, property->local_character, bitmap); if (error_code != EB_SUCCESS) memset(bitmap, 0x00, EB_SIZE_WIDE_FONT_16); eb_bitmap_to_gif(bitmap, EB_WIDTH_WIDE_FONT_16, EB_HEIGHT_FONT_16, gif, &gif_length); output_data(property, gif, EB_SIZE_WIDE_FONT_16_GIF); } /* * Output color graphic data. * (path = ///color.bmp * or ///color.jpg) */ void output_color_graphic(property) Response_Property *property; { char binary_data[EB_SIZE_PAGE]; EB_Error_Code error_code; ssize_t read_length; error_code = eb_set_binary_color_graphic(&property->book->book, &property->position); if (error_code != EB_SUCCESS) return; for (;;) { error_code = eb_read_binary(&property->book->book, EB_SIZE_PAGE, binary_data, &read_length); if (error_code != EB_SUCCESS || read_length == 0) return; output_data(property, binary_data, read_length); } /* not reached */ return; } /* * Output monochrome (2 colors) graphic data. * (path = ///mono.bmp) */ void output_mono_graphic(property) Response_Property *property; { char binary_data[EB_SIZE_PAGE]; EB_Error_Code error_code; ssize_t read_length; error_code = eb_set_binary_mono_graphic(&property->book->book, &property->position, property->width, property->height); if (error_code != EB_SUCCESS) return; for (;;) { error_code = eb_read_binary(&property->book->book, EB_SIZE_PAGE, binary_data, &read_length); if (error_code != EB_SUCCESS || read_length == 0) return; output_data(property, binary_data, read_length); } /* not reached */ return; } /* * Output gray scale graphic data. * (path = ///mono.bmp) */ void output_gray_graphic(property) Response_Property *property; { char binary_data[EB_SIZE_PAGE]; EB_Error_Code error_code; ssize_t read_length; error_code = eb_set_binary_gray_graphic(&property->book->book, &property->position, property->width, property->height); if (error_code != EB_SUCCESS) return; for (;;) { error_code = eb_read_binary(&property->book->book, EB_SIZE_PAGE, binary_data, &read_length); if (error_code != EB_SUCCESS || read_length == 0) return; output_data(property, binary_data, read_length); } /* not reached */ return; } /* * Output WAVE sound data. * (path = ///sound.wav) */ void output_wave(property) Response_Property *property; { char binary_data[EB_SIZE_PAGE]; EB_Error_Code error_code; EB_Position end_position; ssize_t read_length; /* * Calcurate positoin where the sound data is terminated. */ end_position.page = property->position.page + (property->size / EB_SIZE_PAGE); end_position.offset = property->position.offset + (property->size % EB_SIZE_PAGE); if (EB_SIZE_PAGE <= end_position.offset) { end_position.offset -= EB_SIZE_PAGE; end_position.page++; } /* * Read sound data. */ error_code = eb_set_binary_wave(&property->book->book, &property->position, &end_position); if (error_code != EB_SUCCESS) return; for (;;) { error_code = eb_read_binary(&property->book->book, EB_SIZE_PAGE, binary_data, &read_length); if (error_code != EB_SUCCESS || read_length == 0) return; output_data(property, binary_data, read_length); } /* not reached */ return; } /* * Output MPEG movie data. * (path = ///movie.mpg) */ void output_mpeg(property) Response_Property *property; { char binary_data[EB_SIZE_PAGE]; unsigned int argv[4]; EB_Error_Code error_code; ssize_t read_length; if (eb_decompose_movie_file_name(argv, &property->file_name) != EB_SUCCESS) return; error_code = eb_set_binary_mpeg(&property->book->book, argv); if (error_code != EB_SUCCESS) return; for (;;) { error_code = eb_read_binary(&property->book->book, EB_SIZE_PAGE, binary_data, &read_length); if (error_code != EB_SUCCESS || read_length == 0) return; output_data(property, binary_data, read_length); } /* not reached */ return; } ebnetd-1.0.dfsg.1/ebhttpd/hookset.c0000644000175000017500000005305507673055336016512 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "defs.h" #include "http.h" #include "entity.h" #ifdef __STDC__ #define VOID void #else #define VOID char #endif /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) /* * Unexported functions. */ static EB_Error_Code hook_initialize EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_reference EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_width_height EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_mono_bmp EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_gray_bmp EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_color_bmp EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_color_jpeg EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_wave EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_mpeg EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_candidate_leaf EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_candidate_group EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_newline EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_narrow_font_character EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_wide_font_character EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_begin_superscript EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_end_superscript EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_begin_subscript EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_end_subscript EBNETD_P((EB_Book *, EB_Appendix *, void *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_euc_to_ascii EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static EB_Error_Code hook_latin1_to_entity EBNETD_P((EB_Book *, EB_Appendix *, VOID *, EB_Hook_Code, int, const unsigned int *)); static void write_text_input_word EBNETD_P((EB_Book *, const char *)); /* * Hooks. */ static const EB_Hook html_hooks[] = { {EB_HOOK_INITIALIZE, hook_initialize}, {EB_HOOK_NEWLINE, hook_newline}, {EB_HOOK_NARROW_FONT, hook_narrow_font_character}, {EB_HOOK_WIDE_FONT, hook_wide_font_character}, {EB_HOOK_END_REFERENCE, hook_reference}, {EB_HOOK_BEGIN_MONO_GRAPHIC, hook_width_height}, {EB_HOOK_BEGIN_GRAY_GRAPHIC, hook_width_height}, {EB_HOOK_END_MONO_GRAPHIC, hook_mono_bmp}, {EB_HOOK_END_GRAY_GRAPHIC, hook_gray_bmp}, {EB_HOOK_BEGIN_COLOR_BMP, hook_color_bmp}, {EB_HOOK_BEGIN_COLOR_JPEG, hook_color_jpeg}, {EB_HOOK_BEGIN_WAVE, hook_wave}, {EB_HOOK_BEGIN_MPEG, hook_mpeg}, {EB_HOOK_END_CANDIDATE_LEAF, hook_candidate_leaf}, {EB_HOOK_END_CANDIDATE_GROUP, hook_candidate_group}, {EB_HOOK_BEGIN_SUPERSCRIPT, hook_begin_superscript}, {EB_HOOK_END_SUPERSCRIPT, hook_end_superscript}, {EB_HOOK_BEGIN_SUBSCRIPT, hook_begin_subscript}, {EB_HOOK_END_SUBSCRIPT, hook_end_subscript}, {EB_HOOK_NARROW_JISX0208, hook_euc_to_ascii}, {EB_HOOK_ISO8859_1, hook_latin1_to_entity}, {EB_HOOK_NULL, NULL} }; static int graphic_width; static int graphic_height; /* * Set `html_hooks[]' to `hookset'. */ void set_html_hooks(EB_Hookset *hookset) { eb_set_hooks(hookset, (EB_Hook *)html_hooks); } /* * Hook for a reference to text. */ static int hook_initialize(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { graphic_width = 0; graphic_height = 0; return EB_SUCCESS; } /* * Hook for a reference to text. */ static int hook_reference(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char text[MAX_STRING_LENGTH + 1]; sprintf(text, "(→参照)", property->book->name, property->subbook_name, argv[1], argv[2]); eb_write_text_string(book, text); return EB_SUCCESS; } /* * Hook for a reference to text. */ static int hook_width_height(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { graphic_width = argv[3]; graphic_height = argv[2]; return EB_SUCCESS; } /* * Hook for a reference to monochrome (2 colors) graphic data. */ static int hook_mono_bmp(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char text[MAX_STRING_LENGTH + 1]; if (argv[1] == 0 || argv[2] == 0) return EB_SUCCESS; sprintf(text,"book->name, property->subbook_name); eb_write_text_string(book, text); sprintf(text, "?page=0x%x&offset=0x%x&width=%d&height=%d\">(→図版)", argv[1], argv[2], graphic_width, graphic_height); eb_write_text_string(book, text); return EB_SUCCESS; } /* * Hook for a reference to gray scale graphic data. */ static int hook_gray_bmp(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char text[MAX_STRING_LENGTH + 1]; sprintf(text,"book->name, property->subbook_name); eb_write_text_string(book, text); sprintf(text, "?page=0x%x&offset=0x%x&width=%d&height=%d\">(→図版)", argv[1], argv[2], graphic_width, graphic_height); eb_write_text_string(book, text); return EB_SUCCESS; } /* * Hook for a reference to BMP graphic data. */ static int hook_color_bmp(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char text[MAX_STRING_LENGTH + 1]; sprintf(text, "(→図版)", property->book->name, property->subbook_name, argv[2], argv[3]); eb_write_text_string(book, text); return EB_SUCCESS; } /* * Hook for a reference to JPEG graphic data. */ static int hook_color_jpeg(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char text[MAX_STRING_LENGTH + 1]; sprintf(text, "(→図版)", property->book->name, property->subbook_name, argv[2], argv[3]); eb_write_text_string(book, text); return EB_SUCCESS; } /* * Hook for a reference to WAVE sound data. */ static int hook_wave(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char text[MAX_STRING_LENGTH + 1]; off_t start_location; off_t end_location; size_t data_size; /* * Set binary context. */ start_location = (off_t)(argv[2] - 1) * EB_SIZE_PAGE + argv[3]; end_location = (off_t)(argv[4] - 1) * EB_SIZE_PAGE + argv[5]; data_size = end_location - start_location; sprintf(text, "book->name, property->subbook_name, argv[2], argv[3], (int)data_size); eb_write_text_string(book, text); eb_write_text_string(book, "\">(→音声)"); return EB_SUCCESS; } /* * Hook for a reference to MPEG movie data. */ static int hook_mpeg(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char file_name[EB_MAX_DIRECTORY_NAME_LENGTH + 1]; char text[MAX_STRING_LENGTH + 1]; if (eb_compose_movie_file_name(argv + 2, file_name) != EB_SUCCESS) return EB_SUCCESS; sprintf(text, "(→動画)", property->book->name, property->subbook_name, file_name); eb_write_text_string(book, text); return EB_SUCCESS; } /* * Hook for the current candidate of leaf type. */ static int hook_candidate_leaf(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char text[MAX_STRING_LENGTH + 1]; int i; sprintf(text, "book->name, property->subbook_name, property->multi_search); eb_write_text_string(book, text); for (i = 0; i < EB_MAX_KEYWORDS; i++) { sprintf(text, "&word%d=", i + 1); eb_write_text_string(book, text); if (i == property->multi_entry) write_text_input_word(book, eb_current_candidate(book)); else write_text_input_word(book, property->input_words[i]); } eb_write_text_string(book, "\">(→選択)"); return EB_SUCCESS; } /* * Hook for the current candidate of group type. */ static int hook_candidate_group(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char text[MAX_STRING_LENGTH + 1]; int i; if (property->multi_search == EB_MULTI_INVALID) return hook_reference(book, appendix, container, code, argc, argv); sprintf(text, "book->name, property->subbook_name, property->multi_search); eb_write_text_string(book, text); sprintf(text, "?select%d=&page=0x%x&offset=0x%x", property->multi_entry + 1, argv[1], argv[2]); eb_write_text_string(book, text); for (i = 0; i < EB_MAX_KEYWORDS; i++) { sprintf(text, "&word%d=", i + 1); eb_write_text_string(book, text); write_text_input_word(book, property->input_words[i]); } eb_write_text_string(book, "\">(→詳細...)"); return EB_SUCCESS; } /* * Hook for a reference to text. */ static int hook_newline(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code code; int argc; const unsigned int *argv; { eb_write_text_string(book, "
\n"); return EB_SUCCESS; } /* * Hook for narrow local character. */ EB_Error_Code hook_narrow_font_character(book, appendix, container, hook_code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code hook_code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char text[MAX_STRING_LENGTH + 1]; char alt_text[EB_MAX_ALTERNATION_TEXT_LENGTH + 1]; unsigned char *alt_p; sprintf(text, "\"",book->name, property->subbook_name, argv[0]); eb_write_text_string(book, text); if (appendix != NULL && eb_narrow_alt_character_text(appendix, argv[0], alt_text) == EB_SUCCESS) { for (alt_p = (unsigned char *)alt_text; *alt_p != '\0'; alt_p++) { if (*alt_p <= 0x7f && latin1_entity_name_table[*alt_p] != NULL) { eb_write_text_byte1(book, '&'); eb_write_text_string(book, latin1_entity_name_table[*alt_p]); eb_write_text_byte1(book, ';'); } else { eb_write_text_byte1(book, *alt_p); } } } else { eb_write_text_byte1(book, '?'); } eb_write_text_string(book, "\" width=\"8\" height=\"16\">"); return EB_SUCCESS; } /* * Hook for wide local character. */ EB_Error_Code hook_wide_font_character(book, appendix, container, hook_code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code hook_code; int argc; const unsigned int *argv; { Response_Property *property = (Response_Property *)container; char text[MAX_STRING_LENGTH + 1]; char alt_text[EB_MAX_ALTERNATION_TEXT_LENGTH + 1]; unsigned char *alt_p; sprintf(text, "\"",book->name, property->subbook_name, argv[0]); eb_write_text_string(book, text); if (appendix != NULL && eb_wide_alt_character_text(appendix, argv[0], alt_text) == EB_SUCCESS) { for (alt_p = (unsigned char *)alt_text; *alt_p != '\0'; alt_p++) { if (*alt_p <= 0x7f && latin1_entity_name_table[*alt_p] != NULL) { eb_write_text_byte1(book, '&'); eb_write_text_string(book, latin1_entity_name_table[*alt_p]); eb_write_text_byte1(book, ';'); } else { eb_write_text_byte1(book, *alt_p); } } } else { eb_write_text_byte1(book, '?'); } eb_write_text_string(book, "\" width=\"16\" height=\"16\">"); return EB_SUCCESS; } /* * Hook for beginning of superscript. */ static int hook_begin_superscript(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { eb_write_text_string(book, ""); return EB_SUCCESS; } /* * Hook for end of superscript. */ static int hook_end_superscript(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { eb_write_text_string(book, ""); return EB_SUCCESS; } /* * Hook for beginning of subscript. */ static int hook_begin_subscript(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { eb_write_text_string(book, ""); return EB_SUCCESS; } /* * Hook for end of subscript. */ static int hook_end_subscript(book, appendix, container, code, argc, argv) EB_Book *book; EB_Appendix *appendix; void *container; EB_Hook_Code code; int argc; const unsigned int *argv; { eb_write_text_string(book, ""); return EB_SUCCESS; } /* * EUC JP to ASCII conversion table. */ #define EUC_TO_ASCII_TABLE_START 0xa0 #define EUC_TO_ASCII_TABLE_END 0xff static const unsigned char euc_a1_to_ascii_table[] = { 0x00, 0x20, 0x00, 0x00, 0x2c, 0x2e, 0x00, 0x3a, /* 0xa0 */ 0x3b, 0x3f, 0x21, 0x00, 0x00, 0x00, 0x60, 0x00, /* 0xa8 */ 0x5e, 0x7e, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x2f, /* 0xb8 */ 0x5c, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x27, /* 0xc0 */ 0x00, 0x22, 0x28, 0x29, 0x00, 0x00, 0x5b, 0x5d, /* 0xc8 */ 0x7b, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0 */ 0x00, 0x00, 0x00, 0x00, 0x2b, 0x2d, 0x00, 0x00, /* 0xd8 */ 0x00, 0x3d, 0x00, 0x3c, 0x3e, 0x00, 0x00, 0x00, /* 0xe0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, /* 0xe8 */ 0x24, 0x00, 0x00, 0x25, 0x23, 0x26, 0x2a, 0x40, /* 0xf0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8 */ }; static const unsigned char euc_a3_to_ascii_table[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0xb0 */ 0x38, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8 */ 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0xc0 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0xc8 */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0xd0 */ 0x58, 0x59, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8 */ 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0xe0 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0xe8 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0xf0 */ 0x78, 0x79, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8 */ }; /* * Hook which converts a character from EUC-JP to ASCII. */ EB_Error_Code hook_euc_to_ascii(book, appendix, container, hook_code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code hook_code; int argc; const unsigned int *argv; { int in_code1, in_code2; int out_code = 0; const char *entity; in_code1 = argv[0] >> 8; in_code2 = argv[0] & 0xff; if (in_code2 < EUC_TO_ASCII_TABLE_START || EUC_TO_ASCII_TABLE_END < in_code2) { out_code = 0; } else if (in_code1 == 0xa1) { out_code = euc_a1_to_ascii_table[in_code2 - EUC_TO_ASCII_TABLE_START]; } else if (in_code1 == 0xa3) { out_code = euc_a3_to_ascii_table[in_code2 - EUC_TO_ASCII_TABLE_START]; } if (out_code == 0) eb_write_text_byte2(book, in_code1, in_code2); else { entity = latin1_entity_name_table[out_code]; if (entity != NULL) { eb_write_text_byte1(book, '&'); eb_write_text_string(book, entity); eb_write_text_byte1(book, ';'); } else { eb_write_text_byte1(book, out_code); } } return EB_SUCCESS; } /* * Hook which converts a Latin-1 character to entity reference. * (e.g. 'A --> Á */ EB_Error_Code hook_latin1_to_entity(book, appendix, container, hook_code, argc, argv) EB_Book *book; EB_Appendix *appendix; VOID *container; EB_Hook_Code hook_code; int argc; const unsigned int *argv; { const char *entity; entity = latin1_entity_name_table[argv[0]]; if (entity != NULL) { eb_write_text_byte1(book, '&'); eb_write_text_string(book, entity); eb_write_text_byte1(book, ';'); } else { eb_write_text_byte1(book, argv[0]); } return EB_SUCCESS; } /* * Encode an input word with CGI encoding scheme, and write the result * to text. */ static void write_text_input_word(book, word) EB_Book *book; const char *word; { static const char hex_characters[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; char encoded_word[EB_MAX_WORD_LENGTH + 1]; size_t encoded_length; unsigned char *word_p; unsigned char *encoded_p; encoded_p = (unsigned char *)encoded_word; encoded_length = 0; for (word_p = (unsigned char *)word; *word_p != '\0'; word_p++) { /* * Send encoded word when `encoded_p' reaches to near of * the end of `encoded_word'. */ if (EB_MAX_WORD_LENGTH - 3 < encoded_length) { *encoded_p = '\0'; eb_write_text_string(book, encoded_word); encoded_p = (unsigned char *)encoded_word; encoded_length = 0; } /* * Alphabet, digit, '$", '-', '_', and ',' are simply copied. * ' ' is converted to `+'. * Other characters are converted to "% HEX HEX". */ if (isalnum(*word_p) || *word_p == '$' || *word_p == '-' || *word_p == '_' || *word_p == '.') { *encoded_p++ = *word_p; encoded_length++; } else if (*word_p == ' ') { *encoded_p++ = '+'; encoded_length++; } else { *encoded_p++ = '%'; *encoded_p++ = hex_characters[(*word_p >> 4) & 0x0f]; *encoded_p++ = hex_characters[(*word_p) & 0x0f]; encoded_length += 3; } } if (0 < encoded_length) { *encoded_p = '\0'; eb_write_text_string(book, encoded_word); } } ebnetd-1.0.dfsg.1/ebhttpd/httpdate.c0000644000175000017500000002657707773152621016660 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef TIME_WITH_SYS_TIME #include #include #else #ifdef HAVE_SYS_TIME_H #include #else #include #endif #endif #include "httpdate.h" #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif /* not HAVE_MEMCPY */ #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) /* * Abbreviated months names. */ static const char *abbreviated_months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; /* * Abbreviated weekdays names. */ static const char *abbreviated_weekdays[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; /* * Full weekdays names. */ static const char *full_weekdays[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; /* * String length of full weekdays names. * `Full_weekdays_len[i]' is equal to `strlen(full_weekdays[i])'. */ static const int full_weekdays_length[] = {6, 6, 7, 9, 8, 6, 8}; /* * Unexported function. */ #ifdef __STDC__ static int http_parse_date_internal(struct tm *, const char *, const char *); #else static int http_parse_date_internal(); #endif /* * Generate currnet date string like this: * * "Tue, 25 Jun 1997 03:57:33 GMT" * * The format of date is described in RFC 1123. * `string' must refer to the buffer with 30 bytes or larger. * If succeeds to generate, 0 is returned. Otherwise -1 is returned. */ int http_make_date(string) char *string; { time_t t; struct tm *gmt; if (time(&t) == (time_t)-1) return -1; gmt = gmtime(&t); if (gmt == NULL) return -1; sprintf(string, "%s, %02d %s %4d %02d:%02d:%02d GMT", abbreviated_weekdays[gmt->tm_wday], gmt->tm_mday, abbreviated_months[gmt->tm_mon], gmt->tm_year + 1900, gmt->tm_hour, gmt->tm_min, gmt->tm_sec); return 0; } /* * Generate a string of particular date. The string is like as: * * "Tue, 25 Jun 1997 03:57:33 GMT" * * This date format is described in RFC 1123. * `string' must refer to the buffer with 30 bytes or larger. * If succeeds to generate, returns 0. Otherwise returns -1. */ int http_make_date2(string, date) char *string; const struct tm *date; { sprintf(string, "%s, %02d %s %4d %02d:%02d:%02d GMT", abbreviated_weekdays[date->tm_wday], date->tm_mday, abbreviated_months[date->tm_mon], date->tm_year + 1900, date->tm_hour, date->tm_min, date->tm_sec); return 0; } /* * Print date `date' to standard out. */ void http_print_date(date) const struct tm *date; { char string[HTTP_DATE_STRING_LENGTH + 1]; http_make_date2(string, date); fputs(string, stdout); } /* * Compare two dates. * * If `date1' is later than `date2', returns an integer greater than 0. * If `date1' is earlier than `date2', returns an integer less than 0. * If `date1' is equal to `date2', returns 0. */ int http_compare_date(date1, date2) struct tm *date1; struct tm *date2; { /* * Not to compare yday(day of year). `Date1' and/or `date2' may * be set by parse_http_date(). The function does not set yday. */ if (date1->tm_year != date2->tm_year) return (date1->tm_year - date2->tm_year); if (date1->tm_mon != date2->tm_mon) return (date1->tm_mon - date2->tm_mon); if (date1->tm_mday != date2->tm_mday) return (date1->tm_mday - date2->tm_mday); if (date1->tm_hour != date2->tm_hour) return (date1->tm_hour - date2->tm_hour); if (date1->tm_min != date2->tm_min) return (date1->tm_min - date2->tm_min); return (date1->tm_sec - date2->tm_sec); } /* * Set orign date to `date'. * The origin date means "Mon, 01 Jan 2000 00:00:00 GMT". */ void http_set_origin_date(date) struct tm *date; { date->tm_year = 0; date->tm_mon = 0; date->tm_mday = 1; date->tm_hour = 0; date->tm_min = 0; date->tm_sec = 0; date->tm_wday = 1; } /* * Parse a date string used in HTTP. Its format must be one of: * * Wed, 09 Nov 1994 08:49:37 GMT ; RFC1123 format * Wednesday, 09-Nov-94 08:49:37 GMT ; RFC850 format * Wed Nov 9 08:49:37 1994 ; asctime() format. * * Year, month, day of month, hour, minute, second, and weekday is * stored into `date'. * * If date is invalid, return -1. Otherwise return 0. */ int http_parse_date(string, date) const char *string; struct tm *date; { struct tm temporary_date; /* * Try RFC1123 format (e.g. "Wed, 09 Nov 1994 08:49:37 GMT"). */ if (http_parse_date_internal(&temporary_date, string, "%a, %d %b %Y %T GMT") == 0) { memcpy(date, &temporary_date, sizeof(struct tm)); return 0; } /* * Try RFC850 format (e.g. "Wednesday, 09-Nov-94 08:49:37 GMT"). */ if (http_parse_date_internal(&temporary_date, string, "%A, %d-%b-%y %T GMT") == 0) { memcpy(date, &temporary_date, sizeof(struct tm)); return 0; } /* * Try asctime() format (e.g. "Wed Nov 9 08:49:37 1994"). */ if (http_parse_date_internal(&temporary_date, string, "%a %b %D %T %Y") == 0) { memcpy(date, &temporary_date, sizeof(struct tm)); return 0; } return -1; } /* * Convert a string of 1 digit to an integer. */ #define char1_to_int(s) (*(s) - '0') /* * Convert a string of 2 digits to an integer. */ #define char2_to_int(s) ((*(s) - '0') * 10 + (*((s) + 1) - '0')) /* * Convert a string of 4 digits to an integer. */ #define char4_to_int(s) ((*(s) - '0') * 1000 + (*((s) + 1) - '0') * 100 \ + (*((s) + 2) - '0') * 10 + (*((s) + 3) - '0')) static int http_parse_date_internal(date, string, format) struct tm *date; const char *string; const char *format; { const char *string_p; const char *format_p; int i; /* * Parse `date' according to `format'. */ format_p = format; string_p = string; while (*format_p != '\0') { if (*format_p == ' ') { /* * Space -- Allows one or greater number of spaces or tabs. */ if (*string_p != ' ' && *string_p != '\t') return -1; format_p++; string_p++; while (*string_p == ' ' || *string_p == '\t') string_p++; continue; } else if (*format_p == '%') { /* * `%' -- Leads special translation. */ switch(*(format_p + 1)) { case 'a': /* * '%a' -- Abbreviated weekday name. (Sunday -- Saturday) */ for (i = 0; i < 7; i++) { if (strncasecmp(abbreviated_weekdays[i], string_p, 3) == 0) break; } if (7 <= i) return -1; string_p += 3; date->tm_wday = i; break; case 'A': /* * '%A' -- Full weekday name. (Sunday -- Saturday) */ for (i = 0; i < 7; i++) { if (strncasecmp(full_weekdays[i], string_p, full_weekdays_length[i]) == 0) break; } if (7 <= i) return -1; string_p += full_weekdays_length[i]; date->tm_wday = i; break; case 'b': /* * '%b' -- Abbreviated month name. (Jan -- Dec) */ for (i = 0; i < 12; i++) { if (strncasecmp(abbreviated_months[i], string_p, 3) == 0) break; } if (12 <= i) return -1; string_p += 3; date->tm_mon = i; break; case 'd': /* * '%d' -- Day of month. (00 -- 31) */ if (!isdigit(*string_p) || !isdigit(*(string_p + 1))) return -1; date->tm_mday = char2_to_int(string_p); string_p += 2; break; case 'D': /* * '%D' -- Day of month. A space is inserted if less * than 10. ( 0 -- 31) */ if (!isdigit(*string_p)) return -1; if (!isdigit(*(string_p + 1))) { date->tm_mday = char1_to_int(string_p); string_p++; } else { date->tm_mday = char2_to_int(string_p); string_p += 2; } break; case 'T': /* * '%T' -- time in 24-hour U.S usual format. HH:MM:SS. * (00:00:00 -- 23:59:59) */ if (!isdigit(*string_p) || !isdigit(*(string_p + 1)) || *(string_p + 2) != ':' || !isdigit(*(string_p + 3)) || !isdigit(*(string_p + 4)) || *(string_p + 5) != ':' || !isdigit(*(string_p + 6)) || !isdigit(*(string_p + 7))) return -1; date->tm_hour = char2_to_int(string_p); date->tm_min = char2_to_int(string_p + 3); date->tm_sec = char2_to_int(string_p + 6); string_p += 8; break; case 'y': /* * '%y' -- Year without century. (00 -- 99) */ if (!isdigit(*string_p) || !isdigit(*(string_p + 1))) return -1; date->tm_year = char2_to_int(string_p); if (date->tm_year < 70) date->tm_year += 100; string_p += 2; break; case 'Y': /* * '%Y' -- Year with century. (1900 -- 9999) */ if (!isdigit(*string_p) || !isdigit(*(string_p + 1)) || !isdigit(*(string_p + 2)) || !isdigit(*(string_p + 3))) return -1; date->tm_year = char4_to_int(string_p) - 1900; string_p += 4; break; } format_p += 2; } else { /* * neither `%' nor ` '. */ if (*format_p != *string_p) return -1; format_p++; string_p++; } } if (*string_p != '\0') return -1; return 0; } /* * Main for test. */ #ifdef TEST int main(argc, argv) int argc; char *argv[]; { struct tm date; if (argc < 2) { fprintf(stderr, "usage: %s date-string\n", argv[0]); exit(1); } if (http_parse_date(&date, argv[1]) < 0) { fprintf(stderr, "bad date string -- \"%s\"\n", argv[1]); exit(1); } printf("year = %d\n", date.tm_year); printf("mon = %d\n", date.tm_mon); printf("mday = %d\n", date.tm_mday); printf("wday = %d\n", date.tm_wday); printf("hour = %d\n", date.tm_hour); printf("min = %d\n", date.tm_min); printf("sec = %d\n", date.tm_sec); } #endif ebnetd-1.0.dfsg.1/ebhttpd/http.c0000644000175000017500000006167707673055337016027 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include "ioall.h" #include "linebuf.h" #include "pathparts.h" #include "defs.h" #include "cgiquery.h" #include "httpdate.h" #include "httprequest.h" #include "http.h" #include "entity.h" #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) /* * Entity generator table. */ static const Entity_Generator entity_generator_table[] = { {"/", "text/html", "euc-jp", output_book_list }, {"/*/", "text/html", "euc-jp", output_subbook_list }, {"/*/*/", "text/html", "euc-jp", output_method_list }, {"/*/*/word", "text/html", "euc-jp", output_word_form }, {"/*/*/exactword", "text/html", "euc-jp", output_exactword_form }, {"/*/*/endword", "text/html", "euc-jp", output_endword_form }, {"/*/*/keyword", "text/html", "euc-jp", output_keyword_form }, {"/*/*/*/multi", "text/html", "euc-jp", output_multi_form }, {"/*/*/search-word", "text/html", "euc-jp", output_search_word }, {"/*/*/search-exactword", "text/html", "euc-jp", output_search_exactword }, {"/*/*/search-endword", "text/html", "euc-jp", output_search_endword }, {"/*/*/search-keyword", "text/html", "euc-jp", output_search_keyword }, {"/*/*/*/search-multi", "text/html", "euc-jp", output_search_multi }, {"/*/*/text", "text/html", "euc-jp", output_text }, {"/*/*/narrow.gif", "image/gif", "euc-jp", output_narrow_font_character }, {"/*/*/wide.gif", "image/gif", NULL, output_wide_font_character }, {"/*/*/mono.bmp", "image/x-bmp", NULL, output_mono_graphic }, {"/*/*/gray.bmp", "image/x-bmp", NULL, output_gray_graphic }, {"/*/*/color.jpg", "image/jpeg", NULL, output_color_graphic }, {"/*/*/color.bmp", "image/x-bmp", NULL, output_color_graphic }, {"/*/*/sound.wav", "audio/wave", NULL, output_wave }, {"/*/*/movie.mpg", "video/mpeg", NULL, output_mpeg }, {NULL, NULL, NULL} }; const Entity_Generator error_entity_generator = { "", "text/html", "us-ascii", output_error_message }; /* * Hookset for text. */ static EB_Hookset html_hookset; /* * Unexported functions. */ static void output_response EBNETD_P((Response_Property *)); static void output_string_asis EBNETD_P((Response_Property *, const char *)); static void output_data_asis EBNETD_P((Response_Property *, const char *, size_t)); static void output_data_chunked EBNETD_P((Response_Property *, const char *, size_t)); static void output_terminator_chunk EBNETD_P((Response_Property *)); static void initialize_property EBNETD_P((Response_Property *)); static void finalize_property EBNETD_P((Response_Property *)); static const Entity_Generator *find_entity_generator EBNETD_P((const char *)); static int parse_path EBNETD_P((HTTP_Request *, Response_Property *)); static int parse_query EBNETD_P((HTTP_Request *, Response_Property *)); /* * Communicate with a client by HTTP. */ int protocol_main() { HTTP_Request request; HTTP_Method_Code method; Response_Property property; Line_Buffer line_buffer; HTTP_Status_Code request_status; struct tm last_modified; struct stat status; eb_initialize_hookset(&html_hookset); set_html_hooks(&html_hookset); initialize_line_buffer(&line_buffer); bind_file_to_line_buffer(&line_buffer, accepted_in_file); set_html_hooks(&html_hookset); /* * Set last-modified-time using the configuration file. */ if (stat(configuration_file_name, &status) < 0) http_set_origin_date(&last_modified); else memcpy(&last_modified, gmtime(&status.st_mtime), sizeof(struct tm)); for (;;) { /* * Initialize resources for a request. */ http_initialize_request(&request); initialize_property(&property); /* * Receive an HTTP request. */ alarm(idle_timeout); if (http_receive_request(&request, &line_buffer) < 0) goto die; /* * Copy response-code, status in `request' to `property'. */ method = http_request_method(&request); if (method != HTTP_METHOD_GET && method != HTTP_METHOD_HEAD) property.response_code = HTTP_RESPONSE_METHOD_NOT_ALLOWED; else property.response_code = http_request_response_code(&request); property.status = http_request_status(&request); /* * To HTTP/1.1 client, we send entity with `chunked' transfer * encoding, and keep the connection unless the client claims * `Connection: close'. * * To HTTP/0.9 and HTTP/1.0 clients, we send entity without * transfer encoding, and close after sending the entity even * when an HTTP/1.0 client claims `Connection: keep-alive'. */ if (HTTP_VERSION_1_1 <= http_request_version(&request)) property.entity_transfer_mode = ENTITY_TRANSFER_CHUNKED; /* * Parse the request. */ parse_path(&request, &property); parse_query(&request, &property); /* * Check "If-Modified-Since". */ if (property.response_code == HTTP_RESPONSE_OK && http_compare_date(&last_modified, http_request_if_modified_since(&request)) <= 0) { property.response_code = HTTP_RESPONSE_NOT_MODIFIED; property.entity_transfer_mode = ENTITY_TRANSFER_NONE; } /* * Check method "HEAD". */ if (method == HTTP_METHOD_HEAD) property.entity_transfer_mode = ENTITY_TRANSFER_NONE; /* * Output response code, headers, and entity. */ alarm(idle_timeout); output_response(&property); syslog(LOG_INFO, "response: code=%03d host=%s(%s) method=%s url=%s version=HTTP/%s", property.response_code, client_host_name, client_address, http_request_method_string(&request), http_request_url(&request), http_request_version_string(&request)); /* * Finalize resources for a request. */ request_status = property.status; http_finalize_request(&request); finalize_property(&property); if (request_status == HTTP_STATUS_CLOSE_AFTER_RESPOND) break; } alarm(0); return 0; die: alarm(0); return -1; } /* * Output HTTP response; HTTP status line, header and entity. */ static void output_response(property) Response_Property *property; { char text[MAX_STRING_LENGTH + 1]; char date_string[HTTP_DATE_STRING_LENGTH + 1]; const char *response_code_message; /* * Send a response code line. */ response_code_message = http_response_code_message(property->response_code); if (response_code_message == NULL) response_code_message = "Unknown"; sprintf(text, "HTTP/1.1 %03d %s\r\n", property->response_code, response_code_message); output_string_asis(property, text); /* * Send HTTP header fields. */ if (http_make_date(date_string) == 0) { sprintf(text, "Date: %s\r\n", date_string); output_string_asis(property, text); } sprintf(text, "Server: ebHTTPD %s\r\n", VERSION); output_string_asis(property, text); if (property->entity_generator->content_charset != NULL) { sprintf(text, "Content-Type: %s; charset=\"%s\"\n", property->entity_generator->content_type, property->entity_generator->content_charset); } else { sprintf(text, "Content-Type: %s\r\n", property->entity_generator->content_type); } output_string_asis(property, text); if (property->entity_transfer_mode == ENTITY_TRANSFER_CHUNKED) output_string_asis(property, "Transfer-Encoding: chunked\r\n"); output_string_asis(property, "\r\n"); /* * Send HTTP entity. */ if (property->entity_transfer_mode != ENTITY_TRANSFER_NONE) { property->entity_generator->function(property); if (property->entity_transfer_mode == ENTITY_TRANSFER_CHUNKED) output_terminator_chunk(property); } finalize_property(property); } /* * Send `string' as HTTP response without transfer encoding. */ static void output_string_asis(property, string) Response_Property *property; const char *string; { output_data_asis(property, string, strlen(string)); } /* * Send `data' as HTTP response without transfer encoding. */ static void output_data_asis(property, data, data_length) Response_Property *property; const char *data; size_t data_length; { if (property->response_error_flag) return; /* * Send data as it is. */ if (write_all(accepted_out_file, idle_timeout, data, data_length) < 0) { syslog(LOG_INFO, "failed to send response, %s", strerror(errno)); property->response_error_flag = 1; } } /* * Send `data' as HTTP response with "chunked" transer encoding. */ static void output_data_chunked(property, data, data_length) Response_Property *property; const char *data; size_t data_length; { /* log10(MAX_INT) + CR + LF + 1 < 16 */ char chunk_header[16]; if (property->response_error_flag) return; /* * Send data with "chunked" transfer encoding. */ sprintf(chunk_header, "%x\r\n", data_length); if (write_string_all(accepted_out_file, idle_timeout, chunk_header) < 0 || write_all(accepted_out_file, idle_timeout, data, data_length) < 0 || write_string_all(accepted_out_file, idle_timeout, "\r\n") < 0) { syslog(LOG_INFO, "failed to send response, %s", strerror(errno)); property->response_error_flag = 1; } } /* * Send `string' as HTTP response. */ void output_string(property, string) Response_Property *property; const char *string; { if (property->entity_transfer_mode == ENTITY_TRANSFER_CHUNKED) output_data_chunked(property, string, strlen(string)); else output_data_asis(property, string, strlen(string)); } /* * Send `data' as HTTP response. */ void output_data(property, data, data_length) Response_Property *property; const char *data; size_t data_length; { if (property->entity_transfer_mode == ENTITY_TRANSFER_CHUNKED) output_data_chunked(property, data, data_length); else output_data_asis(property, data, data_length); } /* * Encode `string' with CGI encoding, and send the result. */ void output_cgi_string(property, string) Response_Property *property; const char *string; { static const char hex_characters[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; char encoded_string[MAX_STRING_LENGTH + 1]; size_t encoded_length; unsigned char *string_p; unsigned char *encoded_p; encoded_p = (unsigned char *)encoded_string; encoded_length = 0; for (string_p = (unsigned char *)string; *string_p != '\0'; string_p++) { /* * Send encoded string when `encoded_p' reaches to near of * the end of `encoded_string'. */ if (MAX_STRING_LENGTH - 3 < encoded_length) { *encoded_p = '\0'; output_string(property, encoded_string); encoded_p = (unsigned char *)encoded_string; encoded_length = 0; } /* * Alphabet, digit, '$", '-', '_', and ',' are simply copied. * ' ' is converted to `+'. * Other characters are converted to "% HEX HEX". */ if (isalnum(*string_p) || *string_p == '$' || *string_p == '-' || *string_p == '_' || *string_p == '.') { *encoded_p++ = *string_p; encoded_length++; } else if (*string_p == ' ') { *encoded_p++ = '+'; encoded_length++; } else { *encoded_p++ = '%'; *encoded_p++ = hex_characters[(*string_p >> 4) & 0x0f]; *encoded_p++ = hex_characters[(*string_p) & 0x0f]; encoded_length += 3; } } if (0 < encoded_length) { *encoded_p = '\0'; output_string(property, encoded_string); } } /* * Encode `string', and send the result. * It assumes the character code of the string is the safe as that of * the current book. */ void output_html_safe_string(property, string) Response_Property *property; const char *string; { EB_Character_Code character_code; EB_Error_Code error_code; error_code = eb_character_code(&property->book->book, &character_code); if (error_code == EB_SUCCESS) { if (character_code == EB_CHARCODE_ISO8859_1) output_latin1_html_safe_string(property, string); else output_euc_html_safe_string(property, string); } } /* * Encode `string' written in EUC-JP to HTML text, and send the result. */ void output_euc_html_safe_string(property, string) Response_Property *property; const char *string; { char encoded_string[MAX_STRING_LENGTH + 1]; char *encoded_p; size_t encoded_length; const char *string_p; const char *entity; size_t entity_length; encoded_p = encoded_string; encoded_length = 0; for (string_p = string; *string_p != '\0'; string_p++) { /* * Send encoded string when `encoded_p' reaches to near of * the end of `encoded_string'. */ if (MAX_STRING_LENGTH - MAX_ENTITY_NAME_LENGTH < encoded_length) { *encoded_p = '\0'; output_string(property, encoded_string); encoded_p = encoded_string; encoded_length = 0; } if (0x21 <= *string_p && *string_p <= 0x7e) entity = latin1_entity_name_table[*(unsigned char *)string_p]; else entity = NULL; if (entity != NULL) { entity_length = strlen(entity); *encoded_p++ = '&'; memcpy(encoded_p, entity, entity_length); encoded_p += entity_length; *encoded_p++ = ';'; encoded_length += entity_length + 2; } else { *encoded_p++ = *string_p; encoded_length++; } } if (0 < encoded_length) { *encoded_p = '\0'; output_string(property, encoded_string); } } /* * Encode `string' written in ISO 8859-1 to HTML text, and send the result. */ void output_latin1_html_safe_string(property, string) Response_Property *property; const char *string; { char encoded_string[MAX_STRING_LENGTH + 1]; char *encoded_p; size_t encoded_length; const char *string_p; const char *entity; size_t entity_length; encoded_p = encoded_string; encoded_length = 0; for (string_p = string; *string_p != '\0'; string_p++) { /* * Send encoded string when `encoded_p' reaches to near of * the end of `encoded_string'. */ if (MAX_STRING_LENGTH - MAX_ENTITY_NAME_LENGTH < encoded_length) { *encoded_p = '\0'; output_string(property, encoded_string); encoded_p = encoded_string; encoded_length = 0; } entity = latin1_entity_name_table[*(unsigned char *)string_p]; if (entity != NULL) { entity_length = strlen(entity); *encoded_p++ = '&'; memcpy(encoded_p, entity, entity_length); encoded_p += entity_length; *encoded_p++ = ';'; encoded_length += entity_length + 2; } else { *encoded_p++ = *string_p; encoded_length++; } } if (0 < encoded_length) { *encoded_p = '\0'; output_string(property, encoded_string); } } /* * Send a terminator chunk (zero-sized chunk). */ static void output_terminator_chunk(property) Response_Property *property; { if (property->response_error_flag) return; /* * Send a terminator. Entity header is empty. */ if (write_string_all(accepted_out_file, idle_timeout, "0\r\n\r\n") < 0) syslog(LOG_DEBUG, "send failed: (entity terminator)"); else syslog(LOG_DEBUG, "send succeeded: (entity terminator)"); } /* * Initialize request property. */ static void initialize_property(property) Response_Property *property; { int i; property->status = HTTP_STATUS_OPEN; property->entity_generator = NULL; property->entity_transfer_mode = ENTITY_TRANSFER_ASIS; property->response_error_flag = 0; property->response_code = HTTP_RESPONSE_OK; property->book = NULL; property->subbook_name[0] = '\0'; property->subbook_title[0] = '\0'; for (i = 0; i < EB_MAX_KEYWORDS; i++) property->input_words[i][0] = '\0'; property->multi_search = EB_MULTI_INVALID; property->multi_entry = -1; property->whence = 1; property->position.page = 0; property->position.offset = 0; property->local_character = 0; property->size = 0; property->width = 0; property->height = 0; property->file_name[0] = '\0'; property->hookset = &html_hookset; } /* * Finalize request property. */ static void finalize_property(property) Response_Property *property; { } /* * Find a command entity `command_name' in `entity_generator_table'. */ static const Entity_Generator * find_entity_generator(path) const char *path; { const Entity_Generator *command = entity_generator_table; const char *pattern_p; const char *path_p; int matched; while (command->pattern != NULL) { pattern_p = command->pattern; path_p = path; matched = 1; for (;;) { if (*pattern_p != *path_p) { matched = 0; break; } if (*pattern_p == '\0') break; if (*pattern_p == '/' && *(pattern_p + 1) == '*' && (*(pattern_p + 2) == '/' || *(pattern_p + 2) == '\0')) { pattern_p += 2; path_p++; while (*path_p != '/' && *path_p != '\0') path_p++; } else { pattern_p++; path_p++; } } if (matched) return command; command++; } return NULL; } /* * Parse the path of the received URL. */ static int parse_path(request, property) HTTP_Request *request; Response_Property *property; { EB_Error_Code error_code; const char *path_string; Path_Parts path_parts; const char *book_name; EB_Subbook_Code subbook; EB_Subbook_Code appendix_subbook; const char *subbook_name; const char *multi_search; /* * Initialize variables. */ path_string = http_request_url_path(request); if (*path_string == '\0') path_string = "/"; path_parts_initialize(&path_parts); if (path_parts_parse(&path_parts, path_string) < 0) { property->response_code = HTTP_RESPONSE_INTERNAL_SERVER_ERROR; property->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; goto failed; } /* * Return immediately when the response code is not OK (200). */ if (property->response_code != HTTP_RESPONSE_OK) goto failed; /* * Determine entity generator. */ property->entity_generator = find_entity_generator(path_string); if (property->entity_generator == NULL) goto failed; /* * Set the current book. */ book_name = path_parts_segment(&path_parts, 0); if (book_name == NULL) goto succeeded; property->book = find_book(book_name); if (property->book == NULL) { property->response_code = HTTP_RESPONSE_NOT_FOUND; goto failed; } if (!property->book->permission_flag) { property->response_code = HTTP_RESPONSE_FORBIDDEN; goto failed; } /* * Set the current subbook. */ subbook_name = path_parts_segment(&path_parts, 1); if (subbook_name == NULL) goto succeeded; subbook = find_subbook(property->book, subbook_name); appendix_subbook = find_appendix_subbook(property->book, subbook_name); if (subbook == EB_SUBBOOK_INVALID) { property->response_code = HTTP_RESPONSE_NOT_FOUND; goto failed; } error_code = eb_set_subbook(&property->book->book, subbook); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: book=%s", eb_error_message(error_code), property->book->name); property->response_code = HTTP_RESPONSE_INTERNAL_SERVER_ERROR; property->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; goto failed; } /* * Get canonical name and title of the subbook. */ error_code = eb_subbook_directory(&property->book->book, property->subbook_name); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: book=%s", eb_error_message(error_code), property->book->name); property->response_code = HTTP_RESPONSE_INTERNAL_SERVER_ERROR; property->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; goto failed; } error_code = eb_subbook_title(&property->book->book, property->subbook_title); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: book=%s", eb_error_message(error_code), property->book->name); property->response_code = HTTP_RESPONSE_INTERNAL_SERVER_ERROR; property->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; goto failed; } /* * Set font of the subbook. We ignore error. */ eb_set_font(&property->book->book, EB_FONT_16); /* * Set the current subbook of the current appendix. */ if (appendix_subbook != EB_SUBBOOK_INVALID) { error_code = eb_set_appendix_subbook(&property->book->appendix, appendix_subbook); if (error_code != EB_SUCCESS) { syslog(LOG_INFO, "%s: book=%s", eb_error_message(error_code), property->book->name); property->response_code = HTTP_RESPONSE_INTERNAL_SERVER_ERROR; property->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; goto failed; } } /* * Set multi search. */ multi_search = path_parts_segment(&path_parts, 2); if (multi_search != NULL) property->multi_search = atoi(multi_search); succeeded: path_parts_finalize(&path_parts); return 0; /* * An error occurs... */ failed: path_parts_finalize(&path_parts); if (property->response_code == HTTP_RESPONSE_OK) property->response_code = HTTP_RESPONSE_NOT_FOUND; property->entity_generator = &error_entity_generator; return -1; } /* * Get query elements from a CGI query string. */ static int parse_query(request, property) HTTP_Request *request; Response_Property *property; { const char *query_string; CGI_Query cgi_query; char query_name[16]; int i; /* * Initialize variables. */ query_string = http_request_url_query(request); cgi_query_initialize(&cgi_query); if (cgi_query_parse_string(&cgi_query, query_string) < 0) { property->response_code = HTTP_RESPONSE_INTERNAL_SERVER_ERROR; property->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; goto failed; } /* * Return immediately when the response code is not OK (200). */ if (property->response_code != HTTP_RESPONSE_OK) goto failed; /* * Get elements `word1', `word2', .... */ for (i = 0; i < EB_MAX_KEYWORDS; i++) { sprintf(query_name, "word%d", i + 1); strncpy(property->input_words[i], cgi_query_element_string_value(&cgi_query, query_name), EB_MAX_WORD_LENGTH); property->input_words[i][EB_MAX_WORD_LENGTH] = '\0'; } /* * Get elements `select*'. */ for (i = 0; i < EB_MAX_KEYWORDS; i++) { sprintf(query_name, "select%d", i + 1); if (cgi_query_element_value(&cgi_query, query_name) != NULL) { property->multi_entry = i; break; } } /* * Get other elements. */ property->whence = cgi_query_element_integer_value(&cgi_query, "whence"); property->position.page = cgi_query_element_integer_value(&cgi_query, "page"); property->position.offset = cgi_query_element_integer_value(&cgi_query, "offset"); property->size = cgi_query_element_integer_value(&cgi_query, "size"); property->width = cgi_query_element_integer_value(&cgi_query, "width"); property->height = cgi_query_element_integer_value(&cgi_query, "height"); property->local_character = cgi_query_element_integer_value(&cgi_query, "char"); strncpy(property->file_name, cgi_query_element_string_value(&cgi_query, "filename"), EB_MAX_DIRECTORY_NAME_LENGTH); property->file_name[EB_MAX_DIRECTORY_NAME_LENGTH] = '\0'; /* * Finalize variables. */ cgi_query_finalize(&cgi_query); return 0; /* * An error occurs... */ failed: cgi_query_finalize(&cgi_query); return -1; } ebnetd-1.0.dfsg.1/ebhttpd/httpmisc.c0000644000175000017500000004225107755372623016667 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) #include "httprequest.h" #ifdef __STDC__ static int http_skip_parameter(const char *, char **); static int http_skip_token(const char *, char **); static int http_skip_quoted_string(const char *, char **); #else static int http_skip_parameter(); static int http_skip_token(); static int http_skip_quoted_string(); #endif /* * Delete white spaces at the tail and beginning of the HTTP header. */ void http_remove_header_spaces(header) char *header; { char *non_space_start; char *non_space_end; /* * Delete white spaces at the tail of the string. */ non_space_end = header + strlen(header) - 1; while (header <= non_space_end && (*non_space_end == ' ' || *non_space_end == '\t')) *non_space_end-- = '\0'; non_space_end++; /* * Delete white spaces at the beginning of the string. */ non_space_start = header; while (*non_space_start == ' ' || *non_space_start == '\t') non_space_start++; memmove(header, non_space_start, non_space_end - non_space_start); *(header + (non_space_end - non_space_start)) = '\0'; } /* * Parse an HTTP method name, such as "GET", "HEAD" and so on. * * This function parses method name refered by `method_string'. * If the HTTP name is valid, the function puts the HTTP method code * corresponding to the name into `method_code', and returns 0. * Otherwise, it puts HTTP_METHOD_UNKNOWN and returns -1. */ int http_parse_method(method_string, method_code) const char *method_string; HTTP_Method_Code *method_code; { if (strcmp(method_string, "OPTIONS") == 0) *method_code = HTTP_METHOD_OPTIONS; else if (strcmp(method_string, "GET") == 0) *method_code = HTTP_METHOD_GET; else if (strcmp(method_string, "HEAD") == 0) *method_code = HTTP_METHOD_HEAD; else if (strcmp(method_string, "POST") == 0) *method_code = HTTP_METHOD_POST; else if (strcmp(method_string, "PUT") == 0) *method_code = HTTP_METHOD_PUT; else if (strcmp(method_string, "DELETE") == 0) *method_code = HTTP_METHOD_DELETE; else if (strcmp(method_string, "TRACE") == 0) *method_code = HTTP_METHOD_TRACE; else { *method_code = HTTP_METHOD_UNKNOWN; return -1; } return 0; } /* * Parse `Connection' header value. * * This function parses `connection_string' which records value part * of the HTTP header `Connection' such as "close". * * Connection = "Connection" ":" 1#(connection-token) * connection-token = token * * If the value is valid, the function puts the HTTP connection codes * corresponding to the value into `connection_codes', and returns 0. * Otherwise returns -1. */ int http_parse_connection(connection_string, connection_codes) const char *connection_string; HTTP_Connection_Code *connection_codes; { const char *string_p = connection_string; const char *end_p; int i; for (i = 0; i < HTTP_MAX_CONNECTIONS; i++) connection_codes[i] = 0; for (;;) { if (http_skip_token(string_p, (char **)&end_p) < 0) return -1; if (strncasecmp("close", string_p, end_p - string_p) == 0) connection_codes[HTTP_CONNECTION_CLOSE] = 1; string_p = end_p; while (*string_p == ' ' || *string_p == '\t') string_p++; if (*string_p == '\0') break; else if (*string_p != ',') return -1; string_p++; while (*string_p == ' ' || *string_p == '\t') string_p++; } return 0; } /* * Parse `Transfer-Coding' header value. * * This function parses `transfer_string' which records value part of * the HTTP header `Transfer-Encoding', such as "chunked". * * Transfer-Encoding = "Transfer-Encoding" ":" 1#transfer-coding * transfer-coding = "chunked" | transfer-extension * transfer-extension = token *( ";" parameter ) * * If the value is valid, the function puts the HTTP tarnsfer coding * codes corresponding to the value into `coding_codes', and returns 0. * Otherwise, returns -1. */ int http_parse_transfer_coding(transfer_string, transfer_codes) const char *transfer_string; HTTP_Transfer_Coding_Code *transfer_codes; { const char *string_p = transfer_string; const char *end_p; int i; for (i = 0; i < HTTP_MAX_TRANSFER_CODINGS; i++) transfer_codes[i] = 0; for (;;) { if (http_skip_token(string_p, (char **)&end_p) < 0) return -1; if (strncasecmp("chunked", string_p, end_p - string_p) == 0) transfer_codes[HTTP_TRANSFER_CODING_CHUNKED] = 1; string_p = end_p; while (*string_p == ' ' || *string_p == '\t') string_p++; if (*string_p == ';' && http_skip_parameter(string_p + 1, (char **)&string_p) < 0) return -1; while (*string_p == ' ' || *string_p == '\t') string_p++; if (*string_p == '\0') break; else if (*string_p != ',') return -1; string_p++; while (*string_p == ' ' || *string_p == '\t') string_p++; } return 0; } /* * Parse `Content-Length' header value. * * This function parses `length_string' which records value part of * the HTTP header `Content-Length'. * * If the value is valid, the function puts the length into `length', * and returns 0. Otherwise, it puts HTTP_TRANSFER_CODING_UNKNOWN * and returns -1. */ int http_parse_content_length(length_string, length) const char *length_string; size_t *length; { const char *string_p = length_string; size_t n = 0; *length = 0; while (isdigit(*string_p)) { n = n * 10 + (*string_p - '0'); string_p++; } if (*string_p != '\0') return -1; *length = n; return 0; } /* * Parse `Host' header value. * * This function parses `host_and_port' which records value part of the * HTTP header `Host-Coding'. The header valude must be host name * (e.g. "www.w3.org") or IP address (e.g. "192.168.20.1"), with optional * port number (e.g. "www.w3.org:80", "192.168.20.1:80"). * * Upon return, the given host name or IP address is copied to `host' * and port number is set to `*port'. `host' must refers to a buffer * with (HTTP_MAX_HOST_NAME_LENGTH + 1) bytes. * * If the header field is valid, 0 is returned. Otherwise, -1 is * returned. */ int http_parse_host(host_and_port, host, port) const char *host_and_port; char *host; in_port_t *port; { const char *host_start_p = NULL; const char *host_end_p = NULL; const char *port_start_p = NULL; size_t host_length; /* * We initially set `port' to 80, and `host' to empty string. */ *port = 80; *host = '\0'; /* * Parse host. */ if (*host_and_port == '[') { /* * IPv6 address surrounded by `[' and `]'. */ host_start_p = host_and_port + 1; host_end_p = strchr(host_and_port + 1, ']'); if (host_end_p == NULL) goto error; if (*(host_end_p + 1) == ':') port_start_p = host_end_p + 2; else if (*(host_end_p + 1) == '\0') port_start_p = NULL; else goto error; } else { /* * IPv4 address or host name. */ const char *colon; host_start_p = host_and_port; colon = strchr(host_and_port, ':'); if (colon == NULL) { host_end_p = host_and_port + strlen(host_and_port); port_start_p = NULL; } else { host_end_p = colon; port_start_p = colon + 1; } } /* * Parse port number if the header has it. */ if (port_start_p != NULL && *port_start_p != '\0') { const char *p; in_port_t n; for (p = port_start_p, n = 0; isdigit(*p); p++) n = n * 10 + (*p - '0'); if (*p != '\0') goto error; *port = n; } /* * Copy the host name to `host'. */ host_length = host_end_p - host_start_p; if (host_length == 0 || HTTP_MAX_HOST_NAME_LENGTH < host_length) goto error; memcpy(host, host_start_p, host_length); *(host + host_length) = '\0'; return 0; /* * An error occurs... */ error: *port = 80; *host = '\0'; return -1; } /* * Parse an HTTP version string. * * The string must begin with "HTTP/", and followed by a mojor * and minor versions separated by a comma (e.g. "HTTP/1.0"). * * This function returns 0 if the line is a valid string, and * returns -1 otherwise. */ int http_parse_version(version_string, version) const char *version_string; HTTP_Version_Code *version; { const char *string_p = version_string; int major_version = 0; int minor_version = 9; /* * Version string must be start with "HTTP/". */ if (strncasecmp(version_string, "HTTP/", 5) != 0) return -1; /* * Take one or more digits, as the major_version version_string. */ string_p = version_string + 5; if (!isdigit(*string_p)) return -1; major_version = *string_p - '0'; string_p++; while (isdigit(*string_p)) { major_version = major_version * 10 + (*string_p - '0'); string_p++; } /* * Major version_string must be followed by `.'. */ if (*string_p != '.') return -1; string_p++; /* * Take one or more digits, as the minor_version version_string. */ if (!isdigit(*string_p)) return -1; minor_version = *string_p - '0'; string_p++; while (isdigit(*string_p)) { minor_version = minor_version * 10 + (*string_p - '0'); string_p++; } /* * No character is permitted after the minor_version version_string. */ if (*string_p != '\0') return -1; /* * Set `version'. */ if (major_version == 1 && minor_version == 0) *version = HTTP_VERSION_1_0; else if (major_version == 1 && minor_version == 1) *version = HTTP_VERSION_1_1; else if (major_version == 1 && 2 <= minor_version) *version = HTTP_VERSION_HIGH; else if (2 <= major_version) *version = HTTP_VERSION_HIGH; else return -1; return 0; } /* * Skip a parameter. * * parameter = attribute "=" value * attribute = token * value = token | quoted-string * * Return 0 upon success, -1 otherwise. If `end_p' is non-NULL, * the position to next character of end of the token is stored in * `*end_p'. */ static int http_skip_parameter(string, end_p) const char *string; char **end_p; { const char *string_p = string; /* * Skip a token and whitespaces around it. */ while (*string_p == ' ' || *string_p == '\t') string_p++; if (http_skip_token(string_p, (char **)&string_p) < 0) return -1; while (*string_p == ' ' || *string_p == '\t') string_p++; /* * Skip "=". */ if (*string_p != '=') return -1; string_p++; /* * Skip a token or quoted-string, and whitespaces in front of it. */ while (*string_p == ' ' || *string_p == '\t') string_p++; if (*string_p == '\"') { if (http_skip_quoted_string(string_p, (char **)&string_p) < 0) return -1; } else { if (http_skip_token(string_p, (char **)&string_p) < 0) return -1; } *end_p = (char *)string_p; return 0; } /* * Table to test a given character is CTL or separator. * * CTL = * separators = "(" | ")" | "<" | ">" | "@" * | "," | ";" | ":" | "\" | <"> * | "/" | "[" | "]" | "?" | "=" * | "{" | "}" | SP | HT */ static const char ctl_separators_table[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x00 ... 0x0f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x10 ... 0x1f */ 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, /* !"#$%&'()*+,-./ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, /* 0123456789:;<=>? */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* @ABCDEFGHIJKLMNO */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, /* PQRSTUVWXYZ[\]^_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* `abcdefghijklmno */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, /* pqrstuvwxyz{|}~ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 ... 0x8f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 ... 0x9f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 ... 0xaf */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 ... 0xbf */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 ... 0xcf */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 ... 0xdf */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 ... 0xef */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 ... 0xff */ }; /* * Skip a token beginning at `string'. * * token = 1* * CTL = * separators = "(" | ")" | "<" | ">" | "@" * | "," | ";" | ":" | "\" | <"> * | "/" | "[" | "]" | "?" | "=" * | "{" | "}" | SP | HT * * Return 0 upon success, -1 otherwise. If `end_p' is non-NULL, * the position to next character of end of the token is stored in * `*end_p'. */ static int http_skip_token(string, end_p) const char *string; char **end_p; { const unsigned char *string_p = (const unsigned char *)string; while (*string_p != '\0') { if (ctl_separators_table[*string_p]) break; string_p++; } if (string_p == (const unsigned char *)string) return -1; if (end_p != NULL) *end_p = (char *)string_p; return 0; } /* * Skip a quoted string beginning at `string'. * * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) * qdtext = > * quoted-pair = "\" CHAR * * Return 0 upon success, -1 otherwise. If `end_p' is non-NULL, * the position to next character of end of the token is stored in * `*end_p'. */ static int http_skip_quoted_string(string, end_p) const char *string; char **end_p; { const char *p = string; if (*p != '\"') return -1; p++; for (;;) { if (*p == '\0') { return -1; } else if (*p == '\"') { p++; break; } else if (*p == '\\') { p++; if (*p == '\0') return -1; } p++; } if (end_p != NULL) *end_p = (char *)p; return 0; } /* * Return a method name corresponding with `method_code'. * This function does the reverse of http_parse_method(). */ const char * http_method_string(method_code) HTTP_Method_Code method_code; { switch (method_code) { case HTTP_METHOD_OPTIONS: return "OPTIONS"; case HTTP_METHOD_GET: return "GET"; case HTTP_METHOD_HEAD: return "HEAD"; case HTTP_METHOD_POST: return "POST"; case HTTP_METHOD_PUT: return "PUT"; case HTTP_METHOD_DELETE: return "DELETE"; case HTTP_METHOD_TRACE: return "TRACE"; } return "unknown"; } /* * Return a HTTP version string corresponding with `version_code'. */ const char * http_version_string(version_code) HTTP_Version_Code version_code; { switch (version_code) { case HTTP_VERSION_0_9: return "0.9"; case HTTP_VERSION_1_0: return "1.0"; case HTTP_VERSION_1_1: return "1.1"; case HTTP_VERSION_HIGH: return "greater-than-1.1"; } return "unknown"; } ebnetd-1.0.dfsg.1/ebhttpd/httprequest.c0000644000175000017500000005173007773152701017417 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifdef TIME_WITH_SYS_TIME #include #include #else #ifdef HAVE_SYS_TIME_H #include #else #include #endif #endif #ifdef HAVE_SYS_PARAMS_H #include #endif #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif #ifndef HAVE_STRCASECMP #ifdef __STDC__ int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #else /* not __STDC__ */ int strcasecmp(); int strncasecmp(); #endif /* not __STDC__ */ #endif /* not HAVE_STRCASECMP */ /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) #include "fakelog.h" #include "linebuf.h" #include "httprequest.h" #include "httpdate.h" /* * Length of short buffer. */ #define SHORT_BUFFER_LENGTH 15 /* * Unexported functions. */ #ifdef __STDC__ static void http_parse_header(HTTP_Request *, char *); static int http_receive_request_line(HTTP_Request *, Line_Buffer *); static int http_receive_request_headers(HTTP_Request *, Line_Buffer *); static ssize_t http_receive_request_entity(HTTP_Request *, Line_Buffer *); static ssize_t http_receive_request_chunked_entity(HTTP_Request *, Line_Buffer *); #else static void http_parse_header(); static int http_receive_request_line(); static int http_receive_request_headers(); static ssize_t http_receive_request_entity(); static ssize_t http_receive_request_chunked_entity(); #endif /* * Receive an HTTP request reading from `line_buffer'. * * The request generally consists of request line, header fields and * optinal entity. Information of the given request is set to `request'. */ int http_receive_request(request, line_buffer) HTTP_Request *request; Line_Buffer *line_buffer; { if (http_receive_request_line(request, line_buffer) < 0) return -1; if (HTTP_VERSION_1_0 <= request->version) { if (http_receive_request_headers(request, line_buffer) < 0) return -1; } /* * If the request is HTTP/1.0 or HTTP/0.9, or the request has the * "Connection: close" header field, the connection is closed after * responding. */ if (request->version <= HTTP_VERSION_1_0 || request->connections[HTTP_CONNECTION_CLOSE]) request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; /* * HTTP/1.1 and higher reuqire Host header field. */ if (HTTP_VERSION_1_1 <= request->version) { if (request->host[0] == '\0') { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; } } /* * Receive entity. */ if (request->transfer_codings[HTTP_TRANSFER_CODING_CHUNKED]) { if (http_receive_request_chunked_entity(request, line_buffer) < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } } else if (0 < request->content_length) { if (http_receive_request_entity(request, line_buffer) < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } } return 0; } /* * Parse an received header. */ static void http_parse_header(request, header) HTTP_Request *request; char *header; { char *header_name; char *header_value; char *colon; /* * Split the line into header name and its value. */ colon = strchr(header, ':'); if (colon == NULL) return; *colon = '\0'; /* * Delete white spaces at the beginning and tail of the name * and value. */ header_name = header; http_remove_header_spaces(header_name); header_value = colon + 1; http_remove_header_spaces(header_value); /* * Parse the HTTP header. */ if (strcasecmp(header_name, "Connection") == 0) { http_parse_connection(header_value, request->connections); } else if (strcasecmp(header_name, "Host") == 0) { if (http_parse_host(header_value, request->host, &request->port) < 0) { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; } } else if (strcasecmp(header_name, "Transfer-Encoding") == 0) { if (http_parse_transfer_coding(header_value, request->transfer_codings) < 0) { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; } } else if (strcasecmp(header_name, "Content-Length") == 0) { if (http_parse_content_length(header_value, &request->content_length) < 0) { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; } } else if (strcasecmp(header_name, "If-Modified-Since") == 0) { if (http_parse_date(header_value, &request->if_modified_since) < 0) { http_set_origin_date(&request->if_modified_since); } } } /* * Initialize `request'. */ void http_initialize_request(request) HTTP_Request *request; { int i; request->method = HTTP_METHOD_UNKNOWN; url_parts_initialize(&request->url); request->version = HTTP_VERSION_0_9; request->content_length = 0; request->host[0] = '\0'; request->port = 80; for (i = 0; i < HTTP_MAX_CONNECTIONS; i++) request->connections[i] = 0; for (i = 0; i < HTTP_MAX_TRANSFER_CODINGS; i++) request->transfer_codings[i] = 0; http_set_origin_date(&request->if_modified_since); request->response_code = HTTP_RESPONSE_OK; request->status = HTTP_STATUS_OPEN; } /* * Finalize `request'. */ void http_finalize_request(request) HTTP_Request *request; { url_parts_finalize(&request->url); } /* * Receive an HTTP request line reading from `line_buffer'. * Here is an example of request line. * * GET /some/where/index.html HTTP/1.1 * * It sets `method', `url', `version', of `request' struct members, * and also sets `response' and `status' if an error occurs. * * This function returns -1 upon critical error that `status' is set * to HTTP_STATUS_CLOSE_IMMEDIATELY. Otherwise, it returns 0. */ static int http_receive_request_line(request, line_buffer) HTTP_Request *request; Line_Buffer *line_buffer; { char line[HTTP_MAX_LINE_LENGTH + 1]; const char *line_p; ssize_t line_length; char method_string[HTTP_MAX_METHOD_LENGTH + 1]; char *method_p; size_t method_length; char uri_string[HTTP_MAX_URI_LENGTH + 1]; char *uri_p; size_t uri_length; char version_string[HTTP_MAX_VERSION_LENGTH + 1]; char *version_p; size_t version_length; /* * Read a request line. * * We give up parsing the request, when the received line is too long. * In this case, we suppose it is HTTP/1.0 request and method name is * unknown. This is negligence. */ for (;;) { line_length = read_line_buffer(line_buffer, line, HTTP_MAX_LINE_LENGTH); if (line_length < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } syslog(LOG_DEBUG, "debug: received line %s", line); if (HTTP_MAX_LINE_LENGTH < line_length) { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; request->method = HTTP_METHOD_UNKNOWN; *(line + SHORT_BUFFER_LENGTH) = '\0'; syslog(LOG_INFO, "too long request line: %s", line); if (skip_line_buffer(line_buffer) < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } return 0; } line_p = line; /* * Skip successive white spaces. * Ignore the line if there is non-white-space in it. */ while (*line_p == ' ' || *line_p == '\t') line_p++; if (*line_p != '\0') break; } /* * Get method. */ method_length = 0; method_p = method_string; while (*line_p != ' ' && *line_p != '\t' && *line_p != '\0') { method_length++; if (HTTP_MAX_METHOD_LENGTH < method_length) { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; *method_p = '\0'; syslog(LOG_INFO, "too long method name: %s", method_string); return 0; } *method_p++ = *line_p++; } *method_p = '\0'; /* * Parse method name. */ if (http_parse_method(method_string, &request->method) < 0) request->response_code = HTTP_RESPONSE_NOT_IMPLEMENTED; /* * Skip successive white spaces behind the method name. */ while (*line_p == ' ' || *line_p == '\t') line_p++; if (*line_p == '\0') { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; *method_p = '\0'; syslog(LOG_INFO, "request missing URI: %s", line); return 0; } /* * Get URI. */ uri_length = 0; uri_p = uri_string; while (*line_p != ' ' && *line_p != '\t' && *line_p != '\0') { uri_length++; if (HTTP_MAX_URI_LENGTH < uri_length) { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; *uri_p = '\0'; syslog(LOG_INFO, "too long URI: %s", uri_string); return 0; } *uri_p++ = *line_p++; } *uri_p = '\0'; /* * Parse URI as URL. */ if (url_parts_parse(&request->url, uri_string) < 0) { request->response_code = HTTP_RESPONSE_INTERNAL_SERVER_ERROR; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; syslog(LOG_INFO, "memory exhausted"); return 0; } /* * Skip successive white spaces behind the URI. * If reachs to the end of line, HTTP/0.9 simple request is assumed. */ while (*line_p == ' ' || *line_p == '\t') line_p++; if (*line_p == '\0') { request->version = HTTP_VERSION_0_9; return 0; } /* * Get HTTP version. */ version_length = 0; version_p = version_string; while (*line_p != ' ' && *line_p != '\t' && *line_p != '\0') { version_length++; if (HTTP_MAX_VERSION_LENGTH < version_length) { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; *version_string = '\0'; syslog(LOG_INFO, "too long HTTP version: %s", version_string); return 0; } *version_p++ = *line_p++; } *version_p = '\0'; /* * Parse HTTP version. */ if (http_parse_version(version_string, &request->version) < 0) { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; syslog(LOG_INFO, "invalid HTTP version: %s", version_string); return 0; } /* * Skip successive white spaces behind the HTTP version. * It is bad request if an extra argument is found. */ while (*line_p == ' ' || *line_p == '\t') line_p++; if (*line_p != '\0') { request->response_code = HTTP_RESPONSE_BAD_REQUEST; request->status = HTTP_STATUS_CLOSE_AFTER_RESPOND; syslog(LOG_INFO, "request has an extra argument: %s", line_p); return 0; } return 0; } /* * Receive HTTP request header fields reading from `line_buffer'. * Here is an example of request header fields. * * Host: www.w3.org * Connection: close * User-Agent: Internet Exploder 1.0 * * It sets header related members in `request', and also sets `response' * and `status' if an error occurs. * * This function returns -1 upon critical error that `status' is set * to HTTP_STATUS_CLOSE_IMMEDIATELY. Otherwise, it returns 0. */ static int http_receive_request_headers(request, line_buffer) HTTP_Request *request; Line_Buffer *line_buffer; { size_t header_length; ssize_t line_length; char line[HTTP_MAX_LINE_LENGTH + 1]; char header[HTTP_MAX_HEADER_LENGTH + 1]; /* * Read header fields. */ header_length = 0; for (;;) { /* * Read a next line. */ line_length = read_line_buffer(line_buffer, line, HTTP_MAX_LINE_LENGTH); if (line_length < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } syslog(LOG_DEBUG, "debug: received line %s", line); /* * If the first character of the received line is not a whitespace, * it terminates a privous header field. Parse the header. */ if (*line != ' ' && *line != '\t' && 0 < header_length) http_parse_header(request, header); /* * An empty line means the end of header fields. */ if (line_length == 0) break; if (HTTP_MAX_LINE_LENGTH < line_length) { /* * The received line is too long. * An unterminted header field is discarded if having. */ if (skip_line_buffer(line_buffer) < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } *header = '\0'; header_length = 0; } else if (*line == ' ' || *line == '\t') { /* * Since the line with a whitespace as the first character * is a continuous line, we add it to the previous header * line unless the total length of the header doesn't exceeds * HTTP_MAX_HEADER_LENGTH. */ if (header_length == 0) { ; /* nothing to do */ } else if (HTTP_MAX_HEADER_LENGTH < header_length + line_length + 1) { *header = '\0'; header_length = 0; } else { memcpy(header + header_length, line, line_length); *(header + header_length + line_length) = ' '; *(header + header_length + line_length + 1) = '\0'; header_length += line_length + 1; } } else { /* * The first character of the line is not a whitespace. * It creates a new header field. Copy the line to `header'. */ memcpy(header, line, line_length); *(header + line_length) = ' '; *(header + line_length + 1) = '\0'; header_length = line_length + 1; } } return 0; } /* * Read request entity. */ static ssize_t http_receive_request_entity(request, line_buffer) HTTP_Request *request; Line_Buffer *line_buffer; { char entity_buffer[HTTP_MAX_LINE_LENGTH + 1]; size_t rest_length = request->content_length; size_t read_length; while (0 < rest_length) { if (HTTP_MAX_LINE_LENGTH + 1 < rest_length) read_length = HTTP_MAX_LINE_LENGTH + 1; else read_length = rest_length; if (binary_read_line_buffer(line_buffer, entity_buffer, read_length) < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } rest_length -= read_length; } syslog(LOG_DEBUG, "debug: received entity (%d bytes)", request->content_length); return request->content_length; } /* * Read request entity with chunked transder encoding. */ static ssize_t http_receive_request_chunked_entity(request, line_buffer) HTTP_Request *request; Line_Buffer *line_buffer; { ssize_t line_length; size_t chunk_length; size_t chunk_rest_length; ssize_t chunk_read_length; char *end_p; char line[HTTP_MAX_LINE_LENGTH + 1]; char *line_p; request->content_length = 0; /* * Read chunks. */ for (;;) { /* * Read a line which contains chunk size and chunk-extension. */ line_length = read_line_buffer(line_buffer, line, HTTP_MAX_LINE_LENGTH); if (line_length < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } line_p = line; while (*line_p == ' ' || *line_p == '\t') line_p++; if (!isdigit(*line_p)) { syslog(LOG_INFO, "invalid chunked entity transfer"); request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } chunk_length = (size_t) strtol(line, &end_p, 16); while (*end_p == ' ' || *end_p == '\t') end_p++; if (*end_p != ';' && *end_p != '\0') return -1; if (chunk_length == 0) break; /* * Read chunk-data. */ chunk_rest_length = chunk_length; while (0 < chunk_rest_length) { if (HTTP_MAX_LINE_LENGTH + 1 < chunk_rest_length) chunk_read_length = HTTP_MAX_LINE_LENGTH + 1; else chunk_read_length = chunk_rest_length; if (binary_read_line_buffer(line_buffer, line, chunk_read_length) < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } chunk_rest_length -= chunk_read_length; } request->content_length += chunk_length; } syslog(LOG_DEBUG, "debug: received entity (%d bytes)", request->content_length); /* * Read a trailer. */ for (;;) { /* * Read a next line. */ line_length = read_line_buffer(line_buffer, line, HTTP_MAX_LINE_LENGTH); if (line_length < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } syslog(LOG_DEBUG, "debug: received chunked trailer %s", line); /* * An empty line means the end of the trailer. */ if (line_length == 0) break; /* * If the received line is too long, skip the line. */ if (HTTP_MAX_LINE_LENGTH < line_length && skip_line_buffer(line_buffer) < 0) { request->status = HTTP_STATUS_CLOSE_IMMEDIATELY; return -1; } } return request->content_length; } /* * Functions to access members in `request'. */ HTTP_Method_Code http_request_method(request) HTTP_Request *request; { return request->method; } const char * http_request_method_string(request) HTTP_Request *request; { return http_method_string(request->method); } const char * http_request_url(request) HTTP_Request *request; { const char *part; part = url_parts_url(&request->url); return (part != NULL) ? part : ""; } const char * http_request_url_scheme(request) HTTP_Request *request; { const char *part; part = url_parts_scheme(&request->url); return (part != NULL) ? part : ""; } const char * http_request_url_user(request) HTTP_Request *request; { const char *part; part = url_parts_user(&request->url); return (part != NULL) ? part : ""; } const char * http_request_url_password(request) HTTP_Request *request; { const char *part; part = url_parts_password(&request->url); return (part != NULL) ? part : ""; } const char * http_request_url_host(request) HTTP_Request *request; { const char *part; part = url_parts_host(&request->url); return (part != NULL) ? part : ""; } const char * http_request_url_port(request) HTTP_Request *request; { const char *part; part = url_parts_port(&request->url); return (part != NULL) ? part : ""; } const char * http_request_url_path(request) HTTP_Request *request; { const char *part; part = url_parts_path(&request->url); return (part != NULL) ? part : ""; } const char * http_request_url_params(request) HTTP_Request *request; { const char *part; part = url_parts_params(&request->url); return (part != NULL) ? part : ""; } const char * http_request_url_query(request) HTTP_Request *request; { const char *part; part = url_parts_query(&request->url); return (part != NULL) ? part : ""; } const char * http_request_url_fragment(request) HTTP_Request *request; { const char *part; part = url_parts_fragment(&request->url); return (part != NULL) ? part : ""; } HTTP_Version_Code http_request_version(request) HTTP_Request *request; { return request->version; } const char * http_request_version_string(request) HTTP_Request *request; { return http_version_string(request->version); } size_t http_request_content_length(request) HTTP_Request *request; { return request->content_length; } const char * http_request_host(request) HTTP_Request *request; { return request->host; } int http_request_port(request) HTTP_Request *request; { return request->port; } struct tm * http_request_if_modified_since(request) HTTP_Request *request; { return &(request->if_modified_since); } HTTP_Response_Code http_request_response_code(request) HTTP_Request *request; { return request->response_code; } HTTP_Status_Code http_request_status(request) HTTP_Request *request; { return request->status; } ebnetd-1.0.dfsg.1/ebhttpd/httprescode.c0000644000175000017500000000574107673055341017355 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "httprescode.h" /* * HTTP response codes. */ /* 1xx -- Informational */ #define RESPONSE_CODE_COUNT_1XX 2 static const char *response_code_messages_1xx[] = { "Continue", "Switching Protocols" }; /* 2xx -- Successful */ #define RESPONSE_CODE_COUNT_2XX 7 static const char *response_code_messages_2xx[] = { "Ok", "Created", "Accepted", "Non Authoritative Information", "No Content", "Reset Content", "Partial Content" }; /* 3xx -- Redirection */ #define RESPONSE_CODE_COUNT_3XX 6 static const char *response_code_messages_3xx[] = { "Multipul Choises", "Moved Permanently", "Moved Temporarily", "See Other", "Not Modified", "Use Proxy" }; /* 4xx -- Error */ #define RESPONSE_CODE_COUNT_4XX 16 static const char *response_code_messages_4xx[] = { "Bad Request", "Unauthorized", "Payment Required", "Forbidden", "Not Found", "Method Not Allowed", "Not Acceptable", "Proxy Authentication Required", "Request Time Out", "Conflict", "Gone", "Length Required", "Precondition Failed", "Request Entity Too Large", "Request URI Too Large", "Unsupported Media Type" }; /* 5xx -- Server Error */ #define RESPONSE_CODE_COUNT_5XX 6 static const char *response_code_messages_5xx[] = { "Internal Server Error", "Not Implemented", "Bad Gateway", "Service Unavailable", "Gateway Time Out", "HTTP Version Not Supported" }; const char * http_response_code_message(code) HTTP_Response_Code code; { const char *message; int code_type; int code_index; if (code < 100 || 600 <= code) return NULL; code_type = code / 100 * 100; code_index = code % 100; message = NULL; switch (code_type) { case 100: if (code_index < RESPONSE_CODE_COUNT_1XX) message = response_code_messages_1xx[code_index]; break; case 200: if (code_index < RESPONSE_CODE_COUNT_2XX) message = response_code_messages_2xx[code_index]; break; case 300: if (code_index < RESPONSE_CODE_COUNT_3XX) message = response_code_messages_3xx[code_index]; break; case 400: if (code_index < RESPONSE_CODE_COUNT_4XX) message = response_code_messages_4xx[code_index]; break; case 500: if (code_index < RESPONSE_CODE_COUNT_5XX) message = response_code_messages_5xx[code_index]; break; } return message; } ebnetd-1.0.dfsg.1/ebhttpd/pathparts.c0000644000175000017500000001426607673055335017044 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy((s), (d), (n)) #ifdef __STDC__ void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #else /* not __STDC__ */ char *memchr(); int memcmp(); char *memmove(); char *memset(); #endif /* not __STDC__ */ #endif #include "pathparts.h" /* * Initialize `path_segments'. */ void path_parts_initialize(path_parts) Path_Parts *path_parts; { path_parts->is_absolute = 0; path_parts->segment_count = 0; path_parts->segments = NULL; path_parts->leaf = 0; path_parts->buffer = NULL; } /* * Finalize `path_parts'. */ void path_parts_finalize(path_parts) Path_Parts *path_parts; { if (path_parts->segments != NULL) { free(path_parts->segments); path_parts->segments = NULL; } path_parts->is_absolute = 0; path_parts->segment_count = 0; path_parts->leaf = 0; if (path_parts->buffer != NULL) { free(path_parts->buffer); path_parts->buffer = NULL; } } /* * Split a `path' into `path_parts' an a list of segments. * If succeeds, 0 is returned. Otherwise -1 is returned. */ int path_parts_parse(path_parts, path) Path_Parts *path_parts; const char *path; { char *buffer_p; size_t buffer_length; const char *first_segment; int i; /* * Test whether `path' is absolute or relative path. */ if (*path == '/') { path_parts->is_absolute = 1; first_segment = path + 1; } else { path_parts->is_absolute = 0; first_segment = path; } /* * Re-initialize `path_parts' if it has already been used. */ if (path_parts->buffer != NULL || path_parts->segments != NULL) { path_parts_finalize(path_parts); path_parts_initialize(path_parts); } /* * Allocate memories to `path_parts->buffer', and copy `path' * to there. However, a slash (`/') at the beginning of `path' * is not copied. */ buffer_length = strlen(first_segment) + 1; path_parts->buffer = (char *) malloc(buffer_length); if (path_parts->buffer == NULL) goto failed; memcpy(path_parts->buffer, first_segment, buffer_length); /* * Count the number of slashes (`/') in `path_parts->buffer'. */ buffer_p = path_parts->buffer; path_parts->segment_count = 0; while (*buffer_p != '\0') { if (*buffer_p == '/') { path_parts->segment_count++; } buffer_p++; } /* * Allocate memory for `path_parts->segments'. */ path_parts->segments = (char **) malloc(sizeof(char *) * path_parts->segment_count + 1); if (path_parts->segments == NULL) goto failed; /* * Split `path_parts->buffer' with a separator `/'. */ buffer_p = path_parts->buffer; for (i = 0; i < path_parts->segment_count; i++) { *(path_parts->segments + i) = buffer_p; while (*buffer_p != '/' && *buffer_p != '\0') buffer_p++; *buffer_p = '\0'; buffer_p++; } *(path_parts->segments + i) = NULL; /* * Set leaf, if exists. */ if (buffer_p - path_parts->buffer + 1 < buffer_length) path_parts->leaf = buffer_p; return 0; /* * If an error occurs... */ failed: path_parts_initialize(path_parts); return -1; } /* * Return the number of segments in a path parsed by `path_parts' * in previous. */ int path_parts_segment_count(path_parts) Path_Parts *path_parts; { return path_parts->segment_count; } /* * Return an `n'th segments of a path parsed by `path_parts' * in previous. NULL is returned if there is no `n'th segments in * the path or `n' is negative. */ const char * path_parts_segment(path_parts, n) Path_Parts *path_parts; int n; { if (n < 0 || path_parts->segment_count <= n) return NULL; return *(path_parts->segments + n); } /* * Return a leaf part of a path parsed by `path_parts' in previous. * If the path lacks a leaf, NULL is returned. */ const char * path_parts_leaf(path_parts) Path_Parts *path_parts; { return path_parts->leaf; } /* * Test whether a path parsed by `path_parts' in previous is absolute * path. It returns 1 if it is, and 0 otherwise. */ int path_parts_is_absolute(path_parts) Path_Parts *path_parts; { return path_parts->is_absolute; } /* * Test whether a path parsed by `path_parts' in previous is relative * path. It returns 1 if it is, and 0 otherwise. */ int path_parts_is_relative(path_parts) Path_Parts *path_parts; { return !(path_parts->is_absolute); } #ifdef TEST int main(argc, argv) int argc; char *argv[]; { Path_Parts path_parts; int segment_count; const char *segment; const char *leaf; int i; path_parts_initialize(&path_parts); if (argc != 2) { fprintf(stderr, "usage: %s path\n", argv[0]); exit(1); } if (path_parts_parse(&path_parts, argv[1]) < 0) { fprintf(stderr, "%s: bad path\n", argv[0]); exit(1); } segment_count = path_parts_segment_count(&path_parts); for (i = 0; i < segment_count; i++) { segment = path_parts_segment(&path_parts, i); printf("segments %d: %s\n", i, segment); } leaf = path_parts_leaf(&path_parts); if (leaf != NULL) printf("leaf: %s\n", leaf); path_parts_finalize(&path_parts); } #endif ebnetd-1.0.dfsg.1/ebhttpd/urlparts.c0000644000175000017500000004041007673055336016701 0ustar mhattamhatta/* * Copyright (c) 2000, 01 * Motoyuki Kasahara * * This program 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, or (at your option) * any later version. * * This program 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) #include #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ #include #endif /* not STDC_HEADERS and not HAVE_STRING_H */ #ifdef HAVE_STDLIB_H #include #endif #ifndef HAVE_STRCHR #define strchr index #define strrchr rindex #endif /* HAVE_STRCHR */ /* * Character type tests and conversions. */ #define isdigit(c) ('0' <= (c) && (c) <= '9') #define isupper(c) ('A' <= (c) && (c) <= 'Z') #define islower(c) ('a' <= (c) && (c) <= 'z') #define isalpha(c) (isupper(c) || islower(c)) #define isalnum(c) (isupper(c) || islower(c) || isdigit(c)) #define isxdigit(c) \ (isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) #define toupper(c) (('a' <= (c) && (c) <= 'z') ? (c) - 0x20 : (c)) #define tolower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 0x20 : (c)) #include "urlparts.h" /* * Unexported functions. */ #ifdef __STDC__ static void url_parts_canonicalize_path(char *); static void url_parts_expand_hex(char *); static void url_parts_convert_to_lower(char *); #else static void url_parts_canonicalize_path(); static void url_parts_expand_hex(); static void url_parts_convert_to_lower(); #endif /* * Initialize a query. */ void url_parts_initialize(parts) URL_Parts *parts; { /* * Set all URL parts and whole URL to NULL. */ parts->url = NULL; parts->scheme = NULL; parts->user = NULL; parts->password = NULL; parts->host = NULL; parts->port = NULL; parts->path = NULL; parts->params = NULL; parts->query = NULL; parts->fragment = NULL; parts->buffer = NULL; } /* * Finalize a query. * All allocated memories in `queue' are also disposed. */ void url_parts_finalize(parts) URL_Parts *parts; { /* * Set all URL parts and whole URL to NULL. */ parts->scheme = NULL; parts->user = NULL; parts->password = NULL; parts->host = NULL; parts->port = NULL; parts->path = NULL; parts->params = NULL; parts->query = NULL; parts->fragment = NULL; /* * Dispose memories assigned to `parts->url' and `parts->buffer'. */ if (parts->url != NULL) { free(parts->url); parts->url = NULL; } if (parts->buffer != NULL) { free(parts->buffer); parts->buffer = NULL; } } /* * Return whole URL of a parsed URL. */ const char * url_parts_url(parts) URL_Parts *parts; { return parts->url; } /* * Return scheme part of a parsed URL. */ const char * url_parts_scheme(parts) URL_Parts *parts; { return parts->scheme; } /* * Return user part of a parsed URL. */ const char * url_parts_user(parts) URL_Parts *parts; { return parts->user; } /* * Return password part of a parsed URL. */ const char * url_parts_password(parts) URL_Parts *parts; { return parts->password; } /* * Return host part of a parsed URL. */ const char * url_parts_host(parts) URL_Parts *parts; { return parts->host; } /* * Return port part of a parsed URL. */ const char * url_parts_port(parts) URL_Parts *parts; { return parts->port; } /* * Return path part of a parsed URL. */ const char * url_parts_path(parts) URL_Parts *parts; { return parts->path; } /* * Return params part of a parsed URL. */ const char * url_parts_params(parts) URL_Parts *parts; { return parts->params; } /* * Return query part of a parsed URL. */ const char * url_parts_query(parts) URL_Parts *parts; { return parts->query; } /* * Return fragment part of a parsed URL. */ const char * url_parts_fragment(parts) URL_Parts *parts; { return parts->fragment; } /* * Parse an URL and fragment. * * `url' is an absolute or relative URL and optional fragment. * The function resolves the `url' into 9 parts; scheme, user, password, * host, port, path, params, query and fragment. * * [scheme ":"] ["//" [][":" password] "@"]["host" [":" port]] * ["/" path] [";" params] ["?" query] ["#" fragment] * * The result is put into `parts'. This functions fails only when * memory is exhausted. The function returns -1 in this case. * It returns 0, upon successful. */ int url_parts_parse(parts, url) URL_Parts *parts; const char *url; { char *separator; char *url_p; size_t url_length; char *right_bracket; /* * Re-initialize if `url' has already been used. */ if (parts->buffer != NULL) { url_parts_finalize(parts); url_parts_initialize(parts); } /* * Copy `url' to `parts->url' and `parts->buffer'. */ url_length = strlen(url); parts->url = (char *)malloc(url_length + 1); if (parts->url == NULL) goto failed; memcpy(parts->url, url, url_length + 1); parts->buffer = (char *)malloc(url_length + 1); if (parts->buffer == NULL) goto failed; memcpy(parts->buffer, url, url_length + 1); /* * Get a fragment. */ url_p = parts->buffer; separator = strchr(url_p, '#'); if (separator != NULL) { if (*(separator + 1) != '\0') parts->fragment = separator + 1; *separator = '\0'; } /* * Get a scheme name. */ separator = strchr(url_p, ':'); if (separator != NULL) { char *p; for (p = url_p; *p != ':'; p++) { if (!isalnum(*p) && *p != '+' && *p != '.' && *p != '-') break; } if (*p == ':') { parts->scheme = url_p; *p = '\0'; url_p = p + 1; } } /* * Get a network location. */ if (*url_p == '/' && *(url_p + 1) == '/') { char *netloc = NULL; char *hostport = NULL; char *userpass = NULL; char *p1, *p2; /* * Shift left 2 characters to insert a terminator ('\0') for * the network location, and a missed slash (`/'). * * "//www.foo.co.jp/path..." --> "www.foo.co.jp\0\0/path..." * "//www.foo.co.jp\0" --> "www.foo.co.jp\0/\0" */ netloc = url_p; for (p1 = url_p + 2, p2 = url_p; *p1 != '/' && *p1 != '\0'; p1++, p2++) *p2 = *p1; *p2++ = '\0'; if (*p1 != '\0') url_p = p1; else { *p2 = '/'; url_p = p2; } /* * Separate `netloc' into ":" and ":". */ separator = strchr(netloc, '@'); if (separator != NULL) { if (separator != netloc) userpass = netloc; if (*(separator + 1) != '\0') hostport = separator + 1; *separator = '\0'; } else { hostport = netloc; userpass = NULL; } /* * Get user and password. */ if (userpass != NULL) { separator = strchr(userpass, ':'); if (separator != NULL) { if (separator != userpass) parts->user = userpass; if (*(separator + 1) != '\0') parts->password = separator + 1; *separator = '\0'; } else { parts->user = userpass; } } /* * Get host and port. * IPv6 address is enclosed in `[' and `]'. */ if (*hostport == '[') { right_bracket = strchr(hostport + 1, ']'); if (right_bracket == NULL) separator = NULL; else { if (*(right_bracket + 1) == ':' || *(right_bracket + 1) == '\0') { hostport++; *right_bracket = '\0'; } separator = strchr(right_bracket + 1, ':'); } } else { separator = strchr(hostport, ':'); } if (separator != NULL) { if (separator != hostport) parts->host = hostport; if (*(separator + 1) != '\0') parts->port = separator + 1; *separator = '\0'; } else { parts->host = hostport; } } /* * Parse query. */ separator = strchr(url_p, '?'); if (separator != NULL) { if (*(separator + 1) != '\0') parts->query = separator + 1; *separator = '\0'; } /* * Parse parameters. * The part is deleted if present. */ separator = strchr(url_p, ';'); if (separator != NULL) { if (*(separator + 1) != '\0') parts->params = separator + 1; *separator = '\0'; } /* * Parse path. */ if (*url_p != '\0') parts->path = url_p; /* * Normalize parts. */ if (parts->scheme != NULL) { url_parts_expand_hex(parts->scheme); url_parts_convert_to_lower(parts->scheme); } if (parts->user != NULL) { url_parts_expand_hex(parts->user); } if (parts->password != NULL) { url_parts_expand_hex(parts->password); } if (parts->host != NULL) { url_parts_expand_hex(parts->host); url_parts_convert_to_lower(parts->host); } if (parts->port != NULL) { url_parts_expand_hex(parts->port); } if (parts->path != NULL) { url_parts_expand_hex(parts->path); url_parts_canonicalize_path(parts->path); } if (parts->params != NULL) { url_parts_expand_hex(parts->params); } if (parts->query != NULL) { url_parts_expand_hex(parts->query); } if (parts->fragment != NULL) { url_parts_expand_hex(parts->fragment); } return 0; /* * An error occurs... */ failed: url_parts_finalize(parts); return -1; } /* * Canonicalize the path in URL. * * Replace "." and ".." segments in the path. * All occurrences of "." segment are removed. * All occurrences of "/.." segments where is not * equal to "..", are removed. This process is repeated until no * match pattern remains. * * For example: * "/A/./a.html" ---> "/A/a.html" * "/A/../a.html" ---> "/a.html" * "/A/B/C/../../a.html" ---> "/A/a.html" * "/../a.html" ---> "/../a.html" (*1) * * (*1) If a correspondig parent segment is not exist in the path, * we don't remove "/..". */ static void url_parts_canonicalize_path(path) char *path; { char *source = path; char *destination = path; char *unfixed_root = path; char *slash; while (*source != '\0') { if (*source != '/') { *destination++ = *source++; continue; } /* * `*source' is slash (`/'). */ if (*(source + 1) == '/') { /* * "//" -- Ignore 2nd slash ("/"). */ source++; } else if (*(source + 1) == '.' && *(source + 2) == '/') { /* * "/./" -- Current segment itself. Removed. */ if (unfixed_root != destination) { source += 2; } else { *destination++ = *source++; *destination++ = *source++; unfixed_root += 2; } } else if (*(source + 1) == '.' && *(source + 2) == '.' && *(source + 3) == '/') { /* * "/../" -- Back to the parent segment. */ if (unfixed_root != destination) { source += 3; *destination = '\0'; slash = strrchr(unfixed_root, '/'); if (slash != NULL) destination = slash; else destination = path; } else { *destination++ = *source++; *destination++ = *source++; *destination++ = *source++; unfixed_root += 3; } } else { /* * "/" -- Single "/". */ *destination++ = *source++; } } *destination = '\0'; slash = strrchr(unfixed_root, '/'); if (slash != NULL && slash != unfixed_root && *(slash + 1) == '.' && *(slash + 2) == '\0') { /* * The path is end with "/.", Remove ".". * After the canonicalization, the path is end with "/". */ *(slash + 1) = '\0'; } else if (slash != NULL && slash != unfixed_root && *(slash + 1) == '.' && *(slash + 2) == '.' && *(slash + 3) == '\0') { /* * The path is end with "/..", Back to the parent segment. * After the canonicalization, the path is end with "/". */ *slash = '\0'; slash = strrchr(unfixed_root, '/'); if (slash == NULL) { *path = '/'; *(path + 1) = '\0'; } else *(slash + 1) = '\0'; } } /* * All characters except for the followings are expandable characters. * Converting "%" to that character doesn't affect URL parsing. * * unsafe ::= CTL | SP | <"> | "#" | "%" | "<" | ">" * reserved ::= ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" * * `expandable_hex_table[]' is used to examine whether a character is * expandable or not. */ static const char expandable_hex_table[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 ... 0x0f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 ... 0x1f */ 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, /* !"#$%&'()*+,-./ */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 0123456789:;<=>? */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* @ABCDEFGHIJKLMNO */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* PQRSTUVWXYZ[\]^_ */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* `abcdefghijklmno */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* pqrstuvwxyz{|}~ */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x80 ... 0x8f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x90 ... 0x9f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xa0 ... 0xaf */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xb0 ... 0xbf */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xc0 ... 0xcf */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xd0 ... 0xdf */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xe0 ... 0xef */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xf0 ... 0xff */ }; /* * Expand all "%" in an URL part to original characters. */ static void url_parts_expand_hex(string) char *string; { char *source = string; char *destination = string; int hex1; int hex2; int c; while (*source != '\0') { /* * "%" occurs. * Unescape it if the character is not unsafe or reserved. */ if (*source == '%' && isxdigit(*(source + 1)) && isxdigit(*(source + 2))) { hex1 = *(source + 1); hex2 = *(source + 2); c = 0; if ('0' <= hex1 && hex1 <= '9') c += (hex1 - '0') << 4; else if ('A' <= hex1 && hex1 <= 'F') c += (hex1 - 'A' + 0x0a) << 4; else if ('a' <= hex1 && hex1 <= 'f') c += (hex1 - 'a' + 0x0a) << 4; if ('0' <= hex2 && hex2 <= '9') c += (hex2 - '0'); else if ('A' <= hex2 && hex2 <= 'F') c += (hex2 - 'A' + 0x0a); else if ('a' <= hex2 && hex2 <= 'f') c += (hex2 - 'a' + 0x0a); if (expandable_hex_table[c]) *(unsigned char *)destination++ = c; else { *destination++ = '%'; *destination++ = hex1; *destination++ = hex2; } source += 3; } else *destination++ = *source++; } *destination = '\0'; } /* * Convert upper case letters in a stinrg `string' to lower case. * This function is for the `scheme' and `host' parts in an URL, * since they are case insensitive, */ static void url_parts_convert_to_lower(string) char *string; { char *p; for (p = string; *p != '\0'; p++) { if (isupper(*p)) *p = 'a' + (*p - 'A'); } } void url_parts_print(parts) URL_Parts *parts; { printf("url parts = {\n"); if (parts->scheme != NULL) printf(" scheme = %s\n", parts->scheme); if (parts->user != NULL) printf(" user = %s\n", parts->user); if (parts->password != NULL) printf(" password = %s\n", parts->password); if (parts->host != NULL) printf(" host = %s\n", parts->host); if (parts->port != NULL) printf(" port = %s\n", parts->port); if (parts->path != NULL) printf(" path = %s\n", parts->path); if (parts->params != NULL) printf(" params = %s\n", parts->params); if (parts->query != NULL) printf(" query = %s\n", parts->query); if (parts->fragment != NULL) printf(" fragment = %s\n", parts->fragment); printf("}\n"); fflush(stdout); } /* * Main for test. */ #ifdef TEST int main(argc, argv) int argc; char *argv[]; { URL_Parts url; int i; if (argc < 2) { fprintf(stderr, "usage: %s URL\n", argv[0]); exit(1); } url_parts_initialize(&url); url_parts_parse(&url, argv[1]); url_parts_print(&url); fflush(stdout); url_parts_finalize(&url); } #endif ebnetd-1.0.dfsg.1/ebhttpd/ebhtstat.in0000644000175000017500000001477607673055334017045 0ustar mhattamhatta#! @PERL@ eval 'exec @PERL@ -S $0 ${1+"$@"}' if 0; # -*- Perl -*- # Copyright (c) 1997 - 2003 # Motoyuki Kasahara # # This program 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, or (at your option) # any later version. # # This program 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. # # Program name, program version and mailing address. $progname ='ndtpstat'; $version = '@VERSION@'; $mailing_address = '@MAILING_ADDRESS@'; $help = "Usage: $progname [option...] [syslog-file...] Options: -h --help display this help, then exit -v --version display version number, then exit Arguments: syslog-file syslog file Report bugs to $mailing_address. "; # Copyright message. $copyright = "Copyright (c) 1997 - 2003 Motoyuki Kasahara "; $tryhelp = "try \`$0 --help\' for more information\n"; @option_list = ('-h --help no-argument', '-v --version no-argument'); # # Parse command line options. # &getopt_initialize(@option_list); while (($opt, $arg) = &getopt_long) { if ($opt eq '-h') { print $help; exit(0); } elsif ($opt eq '-v') { print "$progname (EBNETD) version $version\n"; exit(0); } else { die $tryhelp; } } # # Scan logs. # while (<>) { next unless (s/^.* ebhttpd\[\d+\]: ([^:]+): //); $status = $1; foreach $i (split(/ /)) { next unless (($name, $value) = ($i =~ /^([^=]+)=(.*)$/)); if ($name eq 'host') { $value =~ s/^\?\((.*)\)$/$1/; $value =~ s/^(.*)\(.*\)$/$1/; $value = '(test-mode)' if ($value =~ /^\//); } $field{$name} = $value; } if ($status =~ /connected$/) { $permconn{$field{'host'}}++; $permconn_total++; } elsif ($status =~ /connection denied$/) { $denyconn{$field{'host'}}++; $denyconn_total++; } elsif ($status =~ /response$/) { if ($field{'url'} =~ m|^/([^/]+)/|) { $book = $1; } else { $book = '/'; } if ($field{'code'} / 100 == 2 || $field{'code'} / 100 == 3) { if ($field{'method'} eq 'GET') { $get_ok{$book}++; $get_ok_total++; $get_total++; } elsif ($field{'method'} eq 'HEAD') { $head_ok{$book}++; $head_ok_total++; $head_total++; } else { $unknown_ok{$book}++; $unknown_ok_total++; $unknown_total++; } $ok{$book}++; $ok_total++; $access_total++; } elsif ($field{'code'} / 100 == 4) { if ($field{'method'} eq 'GET') { $get_error{$book}++; $get_error_total++; $get_total++; } elsif ($field{'method'} eq 'HEAD') { $head_error{$book}++; $head_error_total++; $head_total++; } else { $unknown_error{$book}++; $unknown_error_total++; $unknown_total++; } $error{$book}++; $error_total++; $access_total++; } else { if ($field{'method'} eq 'GET') { $get_others{$book}++; $get_others_total++; $get_others++; } elsif ($field{'method'} eq 'HEAD') { $head_others{$book}++; $head_others_total++; $head_others++; } else { $unknown_others{$book}++; $unknown_others_total++; $unknown_total++; } $others{$book}++; $others_total++; $access_total++; } } } # # Output header. # print "############################################################################\n"; print "# ebHTTPD statistics\n"; print "############################################################################\n\n"; if ($permconn_total == 0 && $denyconn_total == 0 && $access_total == 0) { print "(no access from client)\n"; exit; } # # Output the `Permitted Connections to the server' list. # print "Permitted Connections to the server:\n\n"; printf "%-32s %7s\n", 'client', 'counts'; print "-----------------------------------------\n"; foreach $i (sort {$permconn{$b} <=> $permconn{$a}} keys(%permconn)) { printf "%-32s %7d\n", $i, $permconn{$i}; } print "-----------------------------------------\n"; printf "%-32s %7d\n\n\n", 'total', $permconn_total; # # Output the `Denied connections to the server' list. # print "Denied connections to the server:\n\n"; printf "%-32s %7s\n", 'client', 'counts'; print "-----------------------------------------\n"; foreach $i (sort {$denyconn{$b} <=> $denyconn{$a}} keys(%denyconn)) { printf "%-32s %7d\n", $i, $denyconn{$i}; } print "-----------------------------------------\n"; printf "%-32s %7d\n\n\n", 'total', $denyconn_total; # # Output the `Successful & Redirection Accesses' list. # print "Successful & Redirection Accesses:\n\n"; printf "%-24s %8s (= %6s + %7s + %7s)\n", 'book', 'access', 'get', 'head', 'unknown'; print "------------------------------------------------------------------\n"; foreach $i (sort {$ok{$b} <=> $ok{$a}} keys(%ok)) { printf "%-24s %8d (= %6d + %7d + %7d)\n", $i, $ok{$i}, $get_ok{$i}, $head_ok{$i}, $unknown_ok{$i}; } print "------------------------------------------------------------------\n"; printf "%-24s %8d (= %6d + %7d + %7d)\n\n\n", 'total', $ok_total, $get_ok_total, $head_ok_total, $unknown_ok_total; # # Output the `Error Accesses' list. # print "Error Accesses:\n\n"; printf "%-24s %8s (= %6s + %7s + %7s)\n", 'book', 'access', 'get', 'head', 'unknown'; print "------------------------------------------------------------------\n"; foreach $i (sort {$error{$b} <=> $error{$a}} keys(%error)) { printf "%-24s %8d (= %6d + %7d + %7d)\n", $i, $error{$i}, $get_error{$i}, $head_error{$i}, $unknown_error{$i}; } print "------------------------------------------------------------------\n"; printf "%-24s %8d (= %6d + %7d + %7d)\n\n\n", 'total', $error_total, $get_error_total, $head_error_total, $unknown_error_total; # # Output the `Other Accesses' list. # print "Other Accesses:\n\n"; printf "%-24s %8s (= %6s + %7s + %7s)\n", 'book', 'access', 'get', 'head', 'unknown'; print "------------------------------------------------------------------\n"; foreach $i (sort {$others{$b} <=> $others{$a}} keys(%others)) { printf "%-24s %8d (= %6d + %7d + %7d)\n", $i, $others{$i}, $get_others{$i}, $head_others{$i}, $unknown_others{$i}; } print "------------------------------------------------------------------\n"; printf "%-24s %8d (= %6d + %7d + %7d)\n\n\n", 'total', $others_total, $get_others_total, $head_others_total, $unknown_others_total; # Local Variables: # mode: perl # End: ebnetd-1.0.dfsg.1/doc/0000755000175000017500000000000007773515160013772 5ustar mhattamhattaebnetd-1.0.dfsg.1/doc/Makefile.am0000644000175000017500000000003407673055362016025 0ustar mhattamhattainfo_TEXINFOS = ebnetd.texi ebnetd-1.0.dfsg.1/doc/Makefile.in0000644000175000017500000003532507773515023016045 0ustar mhattamhatta# Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ # Copyright (C) 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. # 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/stamp-vti $(srcdir)/version.texi mdate-sh \ texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/eb4.m4 \ $(top_srcdir)/m4/herrno.m4 $(top_srcdir)/m4/in6addr.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/sockaddrin6.m4 \ $(top_srcdir)/m4/sockinttypes.m4 $(top_srcdir)/m4/unionwait.m4 \ $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = INFO_DEPS = $(srcdir)/ebnetd.info am__TEXINFO_TEX_DIR = $(srcdir) DVIS = ebnetd.dvi PDFS = ebnetd.pdf PSS = ebnetd.ps HTMLS = ebnetd.html TEXINFOS = ebnetd.texi TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips am__installdirs = $(DESTDIR)$(infodir) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS = @COMPRESS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ EBCONF_EBINCS = @EBCONF_EBINCS@ EBCONF_EBLIBS = @EBCONF_EBLIBS@ EBCONF_INTLINCS = @EBCONF_INTLINCS@ EBCONF_INTLLIBS = @EBCONF_INTLLIBS@ EBCONF_PTHREAD_CFLAGS = @EBCONF_PTHREAD_CFLAGS@ EBCONF_PTHREAD_CPPFLAGS = @EBCONF_PTHREAD_CPPFLAGS@ EBCONF_PTHREAD_LDFLAGS = @EBCONF_PTHREAD_LDFLAGS@ EBCONF_ZLIBINCS = @EBCONF_ZLIBINCS@ EBCONF_ZLIBLIBS = @EBCONF_ZLIBLIBS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GZIPCMD = @GZIPCMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAILING_ADDRESS = @MAILING_ADDRESS@ MAILX = @MAILX@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ info_TEXINFOS = ebnetd.texi all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool .texi.info: restore=: && \ backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then \ mv $$f $$backupdir; \ restore=mv; \ fi; \ done; \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ cd $(srcdir); \ else \ rc=$$?; \ cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; \ exit $$rc .texi.dvi: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $< .texi.pdf: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $< .texi.html: $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $< if test ! -d $@ && test -d $(@:.html=); then \ mv $(@:.html=) $@; else :; fi $(srcdir)/ebnetd.info: ebnetd.texi $(srcdir)/version.texi ebnetd.dvi: ebnetd.texi $(srcdir)/version.texi ebnetd.pdf: ebnetd.texi $(srcdir)/version.texi ebnetd.html: ebnetd.texi $(srcdir)/version.texi $(srcdir)/version.texi: $(srcdir)/stamp-vti $(srcdir)/stamp-vti: ebnetd.texi $(top_srcdir)/configure @(dir=.; test -f ./ebnetd.texi || dir=$(srcdir); \ set `$(SHELL) $(srcdir)/mdate-sh $$dir/ebnetd.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > vti.tmp @cmp -s vti.tmp $(srcdir)/version.texi \ || (echo "Updating $(srcdir)/version.texi"; \ cp vti.tmp $(srcdir)/version.texi) -@rm -f vti.tmp @cp $(srcdir)/version.texi $@ mostlyclean-vti: -rm -f vti.tmp maintainer-clean-vti: -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi .dvi.ps: $(DVIPS) -o $@ $< uninstall-info-am: $(PRE_UNINSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \ install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if cd $(DESTDIR)$(infodir); then \ echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ for file in $$d/$$base*; do \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f $(distdir)/$$relfile || \ cp -p $$file $(distdir)/$$relfile; \ done; \ done mostlyclean-aminfo: -rm -rf ebnetd.aux ebnetd.cp ebnetd.cps ebnetd.fn ebnetd.fns ebnetd.ky \ ebnetd.kys ebnetd.log ebnetd.pg ebnetd.pgs ebnetd.tmp \ ebnetd.toc ebnetd.tp ebnetd.tps ebnetd.vr ebnetd.vrs \ ebnetd.dvi ebnetd.pdf ebnetd.ps ebnetd.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: 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"; \ $(mkdir_p) "$(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 $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) installdirs: $(mkdir_p) $(DESTDIR)$(infodir) 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-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-info-am install-exec-am: install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(infodir) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \ $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile || :;\ done; \ else : ; fi install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ mostlyclean-libtool mostlyclean-vti pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ dist-info distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am 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-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean \ mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool \ mostlyclean-vti pdf pdf-am ps ps-am uninstall uninstall-am \ 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: ebnetd-1.0.dfsg.1/doc/stamp-vti0000644000175000017500000000014207773515126015640 0ustar mhattamhatta@set UPDATED 3 September 2003 @set UPDATED-MONTH September 2003 @set EDITION 1.0 @set VERSION 1.0 ebnetd-1.0.dfsg.1/doc/version.texi0000644000175000017500000000014207773447717016363 0ustar mhattamhatta@set UPDATED 3 September 2003 @set UPDATED-MONTH September 2003 @set EDITION 1.0 @set VERSION 1.0 ebnetd-1.0.dfsg.1/doc/mdate-sh0000755000175000017500000001013007760003774015414 0ustar mhattamhatta#!/bin/sh # Get modification time of a file or directory and pretty-print it. # Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program 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, or (at your option) # any later version. # # This program 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 this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME save_arg1="$1" # Find out how to get the extended ls output of a file or directory. if ls -L /dev/null 1>/dev/null 2>&1; then ls_command='ls -L -l -d' else ls_command='ls -l -d' fi # A `ls -l' line looks as follows on OS/2. # drwxrwx--- 0 Aug 11 2001 foo # This differs from Unix, which adds ownership information. # drwxrwx--- 2 root root 4096 Aug 11 2001 foo # # To find the date, we split the line on spaces and iterate on words # until we find a month. This cannot work with files whose owner is a # user named `Jan', or `Feb', etc. However, it's unlikely that `/' # will be owned by a user whose name is a month. So we first look at # the extended ls output of the root directory to decide how many # words should be skipped to get the date. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. set - x`$ls_command /` # Find which argument is the month. month= command= until test $month do shift # Add another shift to the command. command="$command shift;" case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done # Get the extended ls output of the file or directory. set - x`eval "$ls_command \"\$save_arg1\""` # Remove all preceding arguments eval $command # Get the month. Next argument is day, followed by the year or time. case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac day=$2 # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year ebnetd-1.0.dfsg.1/doc/texinfo.tex0000644000175000017500000054427707673055364016217 0ustar mhattamhatta% texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{1998-10-27}% % % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98 % Free Software Foundation, Inc. % % This texinfo.tex file 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, or (at % your option) any later version. % % This texinfo.tex file 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 this texinfo.tex file; see the file COPYING. If not, write % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, % Boston, MA 02111-1307, USA. % % In other words, you are welcome to use, share and improve this program. % You are forbidden to forbid anyone else to use, share and improve % what you give them. Help stamp out software-hoarding! % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % ftp://ftp.gnu.org/pub/gnu/texinfo.tex % /home/gd/gnu/doc/texinfo.tex on the GNU machines. % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) % ftp://tug.org/tex/texinfo.tex % ftp://ctan.org/macros/texinfo/texinfo.tex % (and all CTAN mirrors, finger ctan@ctan.org for a list). % The texinfo.tex in the texinfo distribution itself could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. % Please include a precise test case in each bug report, % including a complete document with which we can reproduce the problem. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For simple % manuals, however, you can get away with: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever, to process the dvi file. % The extra runs of TeX get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} % Save some parts of plain tex whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexi=\i \let\ptexlbrace=\{ \let\ptexrbrace=\} \let\ptexstar=\* \let\ptext=\t % We never want plain's outer \+ definition in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax \message{Basics,} \chardef\other=12 % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortContents\undefined \gdef\putwordShortContents{Short Contents}\fi \ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi % Ignore a token. % \def\gobble#1{} \hyphenation{ap-pen-dix} \hyphenation{mini-buf-fer mini-buf-fers} \hyphenation{eshell} \hyphenation{white-space} % Margin to add to right of even pages, to left of odd pages. \newdimen \bindingoffset \newdimen \normaloffset \newdimen\pagewidth \newdimen\pageheight % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \ifx\eTeXversion\undefined \def\loggingall{\tracingcommands2 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% \else \def\loggingall{\tracingcommands3 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \tracingscantokens1 \tracingassigns1 \tracingifs1 \tracinggroups1 \tracingnesting2 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% \fi % For @cropmarks command. % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \escapechar = `\\ % use backslash in output files. \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. \shipout\vbox{% \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingxxx.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 2\baselineskip \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \turnoffactive \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1 \unvbox#1 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg#1{% \let\next = #1% \begingroup \obeylines \futurelet\temp\parseargx } % If the next token is an obeyed space (from an @example environment or % the like), remove it and recurse. Otherwise, we're done. \def\parseargx{% % \obeyedspace is defined far below, after the definition of \sepspaces. \ifx\obeyedspace\temp \expandafter\parseargdiscardspace \else \expandafter\parseargline \fi } % Remove a single space (as the delimiter token to the macro call). {\obeyspaces % \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. % % First remove any @c comment, then any @comment. % Result of each macro is put in \toks0. \argremovec #1\c\relax % \expandafter\argremovecomment \the\toks0 \comment\relax % % % Call the caller's macro, saved as \next in \parsearg. \expandafter\next\expandafter{\the\toks0}% }% } % Since all \c{,omment} does is throw away the argument, we can let TeX % do that for us. The \relax here is matched by the \relax in the call % in \parseargline; it could be more or less anything, its purpose is % just to delimit the argument to the \c. \def\argremovec#1\c#2\relax{\toks0 = {#1}} \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} % \argremovec{,omment} might leave us with trailing spaces, though; e.g., % @end itemize @c foo % will have two active spaces as part of the argument with the % `itemize'. Here we remove all active spaces from #1, and assign the % result to \toks0. % % This loses if there are any *other* active characters besides spaces % in the argument -- _ ^ +, for example -- since they get expanded. % Fortunately, Texinfo does not define any such commands. (If it ever % does, the catcode of the characters in questionwill have to be changed % here.) But this means we cannot call \removeactivespaces as part of % \argremovec{,omment}, since @c uses \parsearg, and thus the argument % that \parsearg gets might well have any character at all in it. % \def\removeactivespaces#1{% \begingroup \ignoreactivespaces \edef\temp{#1}% \global\toks0 = \expandafter{\temp}% \endgroup } % Change the active space to expand to nothing. % \begingroup \obeyspaces \gdef\ignoreactivespaces{\obeyspaces\let =\empty} \endgroup \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} %% These are used to keep @begin/@end levels from running away %% Call \inENV within environments (after a \begingroup) \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} \def\ENVcheck{% \ifENV\errmessage{Still within an environment; press RETURN to continue} \endgroup\fi} % This is not perfect, but it should reduce lossage % @begin foo is the same as @foo, for now. \newhelp\EMsimple{Press RETURN to continue.} \outer\def\begin{\parsearg\beginxxx} \def\beginxxx #1{% \expandafter\ifx\csname #1\endcsname\relax {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else \csname #1\endcsname\fi} % @end foo executes the definition of \Efoo. % \def\end{\parsearg\endxxx} \def\endxxx #1{% \removeactivespaces{#1}% \edef\endthing{\the\toks0}% % \expandafter\ifx\csname E\endthing\endcsname\relax \expandafter\ifx\csname \endthing\endcsname\relax % There's no \foo, i.e., no ``environment'' foo. \errhelp = \EMsimple \errmessage{Undefined command `@end \endthing'}% \else \unmatchedenderror\endthing \fi \else % Everything's ok; the right environment has been started. \csname E\endthing\endcsname \fi } % There is an environment #1, but it hasn't been started. Give an error. % \def\unmatchedenderror#1{% \errhelp = \EMsimple \errmessage{This `@end #1' doesn't have a matching `@#1'}% } % Define the control sequence \E#1 to give an unmatched @end error. % \def\defineunmatchedend#1{% \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% } % Single-spacing is done by various environments (specifically, in % \nonfillstart and \quotations). \newskip\singlespaceskip \singlespaceskip = 12.5pt \def\singlespace{% % Why was this kern here? It messes up equalizing space above and below % environments. --karl, 6may93 %{\advance \baselineskip by -\singlespaceskip %\kern \baselineskip}% \setleading \singlespaceskip } %% Simple single-character @ commands % @@ prints an @ % Kludge this until the fonts are right (grr). \def\@{{\tt\char64}} % This is turned off because it was never documented % and you can use @w{...} around a quote to suppress ligatures. %% Define @` and @' to be the same as ` and ' %% but suppressing ligatures. %\def\`{{`}} %\def\'{{'}} % Used to generate quoted braces. \def\mylbrace {{\tt\char123}} \def\myrbrace {{\tt\char125}} \let\{=\mylbrace \let\}=\myrbrace \begingroup % Definitions to produce actual \{ & \} command in an index. \catcode`\{ = 12 \catcode`\} = 12 \catcode`\[ = 1 \catcode`\] = 2 \catcode`\@ = 0 \catcode`\\ = 12 @gdef@lbracecmd[\{]% @gdef@rbracecmd[\}]% @endgroup % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. \let\, = \c \let\dotaccent = \. \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \t \let\ubaraccent = \b \let\udotaccent = \d % Other special characters: @questiondown @exclamdown % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ptexi \else\ifx\temp\jmacro \j \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} % @. is an end-of-sentence period. \def\.{.\spacefactor=3000 } % @! is an end-of-sentence bang. \def\!{!\spacefactor=3000 } % @? is an end-of-sentence query. \def\?{?\spacefactor=3000 } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % \def\group{\begingroup \ifnum\catcode13=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi % % The \vtop we start below produces a box with normal height and large % depth; thus, TeX puts \baselineskip glue before it, and (when the % next line of text is done) \lineskip glue after it. (See p.82 of % the TeXbook.) Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% \egroup % End the \vtop. \endgroup % End the \group. }% % \vtop\bgroup % We have to put a strut on the last line in case the @group is in % the midst of an example, rather than completely enclosing it. % Otherwise, the interline space between the last line of the group % and the first line afterwards is too small. But we can't put the % strut in \Egroup, since there it would be on a line by itself. % Hence this just inserts a strut at the beginning of each line. \everypar = {\strut}% % % Since we have a strut on every line, we don't need any of TeX's % normal interline spacing. \offinterlineskip % % OK, but now we have to do something about blank % lines in the input in @example-like environments, which normally % just turn into \lisppar, which will insert no space now that we've % turned off the interline space. Simplest is to make them be an % empty paragraph. \ifx\par\lisppar \edef\par{\leavevmode \par}% % % Reset ^^M's definition to new definition of \par. \obeylines \fi % % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \def\need{\parsearg\needx} % Old definition--didn't work. %\def\needx #1{\par % %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak %\prevdepth=-1000pt %}} \def\needx#1{% % Go into vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % Don't add any leading before our big empty box, but allow a page % break, since the best break might be right here. \allowbreak \nointerlineskip \vtop to #1\mil{\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak } % @br forces paragraph break \let\br = \par % @dots{} output an ellipsis using the current font. % We do .5em per period so that it has the same spacing in a typewriter % font as three actual period characters. % \def\dots{% \leavevmode \hbox to 1.5em{% \hskip 0pt plus 0.25fil minus 0.25fil .\hss.\hss.% \hskip 0pt plus 0.5fil minus 0.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \leavevmode \hbox to 2em{% \hskip 0pt plus 0.25fil minus 0.25fil .\hss.\hss.\hss.% \hskip 0pt plus 0.5fil minus 0.5fil }% \spacefactor=3000 } % @page forces the start of a new page % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \def\exdent{\parsearg\exdentyyy} \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} % This defn is used inside nofill environments such as @example. \def\nofillexdent{\parsearg\nofillexdentyyy} \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph. \def\inmargin#1{% \strut\vadjust{\nobreak\kern-\strutdepth \vtop to \strutdepth{\baselineskip\strutdepth\vss \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}} \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} %\hbox{{\rm#1}}\hfil\break}} % @include file insert text of that file as input. % Allow normal characters that we make active in the argument (a file name). \def\include{\begingroup \catcode`\\=12 \catcode`~=12 \catcode`^=12 \catcode`_=12 \catcode`|=12 \catcode`<=12 \catcode`>=12 \catcode`+=12 \parsearg\includezzz} % Restore active chars for included file. \def\includezzz#1{\endgroup\begingroup % Read the included file in a group so nested @include's work. \def\thisfile{#1}% \input\thisfile \endgroup} \def\thisfile{} % @center line outputs that line, centered \def\center{\parsearg\centerzzz} \def\centerzzz #1{{\advance\hsize by -\leftskip \advance\hsize by -\rightskip \centerline{#1}}} % @sp n outputs n lines of vertical space \def\sp{\parsearg\spxxx} \def\spxxx #1{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} \let\c=\comment % @paragraphindent is defined for the Info formatting commands only. \let\paragraphindent=\comment % Prevent errors for section commands. % Used in @ignore and in failing conditionals. \def\ignoresections{% \let\chapter=\relax \let\unnumbered=\relax \let\top=\relax \let\unnumberedsec=\relax \let\unnumberedsection=\relax \let\unnumberedsubsec=\relax \let\unnumberedsubsection=\relax \let\unnumberedsubsubsec=\relax \let\unnumberedsubsubsection=\relax \let\section=\relax \let\subsec=\relax \let\subsubsec=\relax \let\subsection=\relax \let\subsubsection=\relax \let\appendix=\relax \let\appendixsec=\relax \let\appendixsection=\relax \let\appendixsubsec=\relax \let\appendixsubsection=\relax \let\appendixsubsubsec=\relax \let\appendixsubsubsection=\relax \let\contents=\relax \let\smallbook=\relax \let\titlepage=\relax } % Used in nested conditionals, where we have to parse the Texinfo source % and so want to turn off most commands, in case they are used % incorrectly. % \def\ignoremorecommands{% \let\defcodeindex = \relax \let\defcv = \relax \let\deffn = \relax \let\deffnx = \relax \let\defindex = \relax \let\defivar = \relax \let\defmac = \relax \let\defmethod = \relax \let\defop = \relax \let\defopt = \relax \let\defspec = \relax \let\deftp = \relax \let\deftypefn = \relax \let\deftypefun = \relax \let\deftypevar = \relax \let\deftypevr = \relax \let\defun = \relax \let\defvar = \relax \let\defvr = \relax \let\ref = \relax \let\xref = \relax \let\printindex = \relax \let\pxref = \relax \let\settitle = \relax \let\setchapternewpage = \relax \let\setchapterstyle = \relax \let\everyheading = \relax \let\evenheading = \relax \let\oddheading = \relax \let\everyfooting = \relax \let\evenfooting = \relax \let\oddfooting = \relax \let\headings = \relax \let\include = \relax \let\lowersections = \relax \let\down = \relax \let\raisesections = \relax \let\up = \relax \let\set = \relax \let\clear = \relax \let\item = \relax } % Ignore @ignore ... @end ignore. % \def\ignore{\doignore{ignore}} % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. % \def\ifinfo{\doignore{ifinfo}} \def\ifhtml{\doignore{ifhtml}} \def\ifnottex{\doignore{ifnottex}} \def\html{\doignore{html}} \def\menu{\doignore{menu}} \def\direntry{\doignore{direntry}} % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory = \comment % Ignore text until a line `@end #1'. % \def\doignore#1{\begingroup % Don't complain about control sequences we have declared \outer. \ignoresections % % Define a command to swallow text until we reach `@end #1'. % This @ is a catcode 12 token (that is the normal catcode of @ in % this texinfo.tex file). We change the catcode of @ below to match. \long\def\doignoretext##1@end #1{\enddoignore}% % % Make sure that spaces turn into tokens that match what \doignoretext wants. \catcode32 = 10 % % Ignore braces, too, so mismatched braces don't cause trouble. \catcode`\{ = 9 \catcode`\} = 9 % % We must not have @c interpreted as a control sequence. \catcode`\@ = 12 % % Make the letter c a comment character so that the rest of the line % will be ignored. This way, the document can have (for example) % @c @end ifinfo % and the @end ifinfo will be properly ignored. % (We've just changed @ to catcode 12.) \catcode`\c = 14 % % And now expand that command. \doignoretext } % What we do to finish off ignored text. % \def\enddoignore{\endgroup\ignorespaces}% \newif\ifwarnedobs\warnedobsfalse \def\obstexwarn{% \ifwarnedobs\relax\else % We need to warn folks that they may have trouble with TeX 3.0. % This uses \immediate\write16 rather than \message to get newlines. \immediate\write16{} \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} \immediate\write16{If you are running another version of TeX, relax.} \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} \immediate\write16{ Then upgrade your TeX installation if you can.} \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} \immediate\write16{If you are stuck with version 3.0, run the} \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} \immediate\write16{ to use a workaround.} \immediate\write16{} \global\warnedobstrue \fi } % **In TeX 3.0, setting text in \nullfont hangs tex. For a % workaround (which requires the file ``dummy.tfm'' to be installed), % uncomment the following line: %%%%%\font\nullfont=dummy\let\obstexwarn=\relax % Ignore text, except that we keep track of conditional commands for % purposes of nesting, up to an `@end #1' command. % \def\nestedignore#1{% \obstexwarn % We must actually expand the ignored text to look for the @end % command, so that nested ignore constructs work. Thus, we put the % text into a \vbox and then do nothing with the result. To minimize % the change of memory overflow, we follow the approach outlined on % page 401 of the TeXbook: make the current font be a dummy font. % \setbox0 = \vbox\bgroup % Don't complain about control sequences we have declared \outer. \ignoresections % % Define `@end #1' to end the box, which will in turn undefine the % @end command again. \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% % % We are going to be parsing Texinfo commands. Most cause no % trouble when they are used incorrectly, but some commands do % complicated argument parsing or otherwise get confused, so we % undefine them. % % We can't do anything about stray @-signs, unfortunately; % they'll produce `undefined control sequence' errors. \ignoremorecommands % % Set the current font to be \nullfont, a TeX primitive, and define % all the font commands to also use \nullfont. We don't use % dummy.tfm, as suggested in the TeXbook, because not all sites % might have that installed. Therefore, math mode will still % produce output, but that should be an extremely small amount of % stuff compared to the main input. % \nullfont \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont \let\tensf = \nullfont % Similarly for index fonts (mostly for their use in % smallexample) \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont \let\indsf = \nullfont % % Don't complain when characters are missing from the fonts. \tracinglostchars = 0 % % Don't bother to do space factor calculations. \frenchspacing % % Don't report underfull hboxes. \hbadness = 10000 % % Do minimal line-breaking. \pretolerance = 10000 % % Do not execute instructions in @tex \def\tex{\doignore{tex}}% % Do not execute macro definitions. % `c' is a comment character, so the word `macro' will get cut off. \def\macro{\doignore{ma}}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. Make sure the catcode of space is correct to avoid % losing inside @example, for instance. % \def\set{\begingroup\catcode` =10 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. \parsearg\setxxx} \def\setxxx#1{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% \def\temp{#2}% \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. \fi \endgroup } % Can't use \xdef to pre-expand #2 and save some time, since \temp or % \next or other control sequences that we've defined might get us into % an infinite loop. Consider `@set foo @cite{bar}'. \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} % @clear VAR clears (i.e., unsets) the variable VAR. % \def\clear{\parsearg\clearxxx} \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} % @value{foo} gets the text saved in variable foo. % { \catcode`\_ = \active % % We might end up with active _ or - characters in the argument if % we're called from @code, as @code{@value{foo-bar_}}. So \let any % such active characters to their normal equivalents. \gdef\value{\begingroup \catcode`\-=12 \catcode`\_=12 \indexbreaks \let_\normalunderscore \valuexxx} } \def\valuexxx#1{\expandablevalue{#1}\endgroup} % We have this subroutine so that we can handle at least some @value's % properly in indexes (we \let\value to this in \indexdummies). Ones % whose names contain - or _ still won't work, but we can't do anything % about that. The command has to be fully expandable, since the result % winds up in the index file. This means that if the variable's value % contains other Texinfo commands, it's almost certain it will fail % (although perhaps we could fix that with sufficient work to do a % one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']v}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % \def\ifset{\parsearg\ifsetxxx} \def\ifsetxxx #1{% \expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifsetfail \else \expandafter\ifsetsucceed \fi } \def\ifsetsucceed{\conditionalsucceed{ifset}} \def\ifsetfail{\nestedignore{ifset}} \defineunmatchedend{ifset} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % \def\ifclear{\parsearg\ifclearxxx} \def\ifclearxxx #1{% \expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifclearsucceed \else \expandafter\ifclearfail \fi } \def\ifclearsucceed{\conditionalsucceed{ifclear}} \def\ifclearfail{\nestedignore{ifclear}} \defineunmatchedend{ifclear} % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text % following, through the first @end iftex (etc.). Make `@end iftex' % (etc.) valid only after an @iftex. % \def\iftex{\conditionalsucceed{iftex}} \def\ifnothtml{\conditionalsucceed{ifnothtml}} \def\ifnotinfo{\conditionalsucceed{ifnotinfo}} \defineunmatchedend{iftex} \defineunmatchedend{ifnothtml} \defineunmatchedend{ifnotinfo} % We can't just want to start a group at @iftex (for example) and end it % at @end iftex, since then @set commands inside the conditional have no % effect (they'd get reverted at the end of the group). So we must % define \Eiftex to redefine itself to be its previous value. (We can't % just define it to fail again with an ``unmatched end'' error, since % the @ifset might be nested.) % \def\conditionalsucceed#1{% \edef\temp{% % Remember the current value of \E#1. \let\nece{prevE#1} = \nece{E#1}% % % At the `@end #1', redefine \E#1 to be its previous value. \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% }% \temp } % We need to expand lots of \csname's, but we don't want to expand the % control sequences after we've constructed them. % \def\nece#1{\expandafter\noexpand\csname#1\endcsname} % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math means output in math mode. % We don't use $'s directly in the definition of \math because control % sequences like \math are expanded when the toc file is written. Then, % we read the toc file back, the $'s will be normal characters (as they % should be, according to the definition of Texinfo). So we must use a % control sequence to switch into and out of math mode. % % This isn't quite enough for @math to work properly in indices, but it % seems unlikely it will ever be needed there. % \let\implicitmath = $ \def\math#1{\implicitmath #1\implicitmath} % @bullet and @minus need the same treatment as @math, just above. \def\bullet{\implicitmath\ptexbullet\implicitmath} \def\minus{\implicitmath-\implicitmath} % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \iflinks \readauxfile \fi % \openindices needs to do some work in any case. \openindices \fixbackslash % Turn off hack to swallow `\input texinfo'. \global\let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. % Just to be on the safe side, close the input stream before the \input. \openin 1 texinfo.cnf \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi \closein1 \temp % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{fonts,} % Font-change commands. % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf analogous to plain's \rm, etc. \newfam\sffam \def\sf{\fam=\sffam \tensf} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this one. \def\ttsl{\tenttsl} % Use Computer Modern fonts at \magstephalf (11pt). \newcount\mainmagstep \mainmagstep=\magstephalf % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). % #3 is the font's design size, #4 is a scale factor \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\undefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} %where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} \ifx\bigger\relax \let\mainmagstep=\magstep1 \setfont\textrm\rmshape{12}{1000} \setfont\texttt\ttshape{12}{1000} \else \setfont\textrm\rmshape{10}{\mainmagstep} \setfont\texttt\ttshape{10}{\mainmagstep} \fi % Instead of cmb10, you many want to use cmbx10. % cmbx10 is a prettier font on its own, but cmb10 % looks better when embedded in a line with cmr10. \setfont\textbf\bfshape{10}{\mainmagstep} \setfont\textit\itshape{10}{\mainmagstep} \setfont\textsl\slshape{10}{\mainmagstep} \setfont\textsf\sfshape{10}{\mainmagstep} \setfont\textsc\scshape{10}{\mainmagstep} \setfont\textttsl\ttslshape{10}{\mainmagstep} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep % A few fonts for @defun, etc. \setfont\defbf\bxshape{10}{\magstep1} %was 1314 \setfont\deftt\ttshape{10}{\magstep1} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} % Fonts for indices and small examples (9pt). % We actually use the slanted font rather than the italic, % because texinfo normally uses the slanted fonts for that. % Do not make many font distinctions in general in the index, since they % aren't very useful. \setfont\ninett\ttshape{9}{1000} \setfont\ninettsl\ttslshape{10}{900} \setfont\indrm\rmshape{9}{1000} \setfont\indit\itshape{9}{1000} \setfont\indsl\slshape{9}{1000} \let\indtt=\ninett \let\indttsl=\ninettsl \let\indsf=\indrm \let\indbf=\indrm \setfont\indsc\scshape{10}{900} \font\indi=cmmi9 \font\indsy=cmsy9 % Fonts for title page: \setfont\titlerm\rmbshape{12}{\magstep3} \setfont\titleit\itbshape{10}{\magstep4} \setfont\titlesl\slbshape{10}{\magstep4} \setfont\titlett\ttbshape{12}{\magstep3} \setfont\titlettsl\ttslshape{10}{\magstep4} \setfont\titlesf\sfbshape{17}{\magstep1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\authorrm{\secrm} % Chapter (and unnumbered) fonts (17.28pt). \setfont\chaprm\rmbshape{12}{\magstep2} \setfont\chapit\itbshape{10}{\magstep3} \setfont\chapsl\slbshape{10}{\magstep3} \setfont\chaptt\ttbshape{12}{\magstep2} \setfont\chapttsl\ttslshape{10}{\magstep3} \setfont\chapsf\sfbshape{17}{1000} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 % Section fonts (14.4pt). \setfont\secrm\rmbshape{12}{\magstep1} \setfont\secit\itbshape{10}{\magstep2} \setfont\secsl\slbshape{10}{\magstep2} \setfont\sectt\ttbshape{12}{\magstep1} \setfont\secttsl\ttslshape{10}{\magstep2} \setfont\secsf\sfbshape{12}{\magstep1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad. % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded. % \setfont\ssecsl\slshape{10}{\magstep1} % \setfont\ssectt\ttshape{10}{\magstep1} % \setfont\ssecsf\sfshape{10}{\magstep1} %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. %\setfont\ssectt\ttshape{10}{1315} %\setfont\ssecsf\sfshape{10}{1315} %\let\ssecbf=\ssecrm % Subsection fonts (13.15pt). \setfont\ssecrm\rmbshape{12}{\magstephalf} \setfont\ssecit\itbshape{10}{1315} \setfont\ssecsl\slbshape{10}{1315} \setfont\ssectt\ttbshape{12}{\magstephalf} \setfont\ssecttsl\ttslshape{10}{1315} \setfont\ssecsf\sfbshape{12}{\magstephalf} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{\magstep1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, % but that is not a standard magnification. % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts, we % don't bother to reset \scriptfont and \scriptscriptfont (which would % also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf \textfont\ttfam = \tentt \textfont\sffam = \tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this so that font changes will continue to work % in math mode, where it is the current \fam that is relevant in most % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam % \tenbf}, for example. By redefining \tenbf, we obviate the need to % redefine \bf itself. \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \resetmathfonts} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \resetmathfonts \setleading{25pt}} \def\titlefont#1{{\titlefonts\rm #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? \def\indexfonts{% \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl \resetmathfonts \setleading{12pt}} % Set up the default fonts, so we can use them for creating boxes. % \textfonts % Define these so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000} \setfont\shortcontbf\bxshape{12}{1000} \setfont\shortcontsl\slshape{12}{1000} %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} \let\i=\smartitalic \let\var=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic \let\cite=\smartslanted \def\b#1{{\bf #1}} \let\strong=\b % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } \def\t#1{% {\tt \rawbackslash \frenchspacing #1}% \null } \let\ttfont=\t \def\samp#1{`\tclose{#1}'\null} \setfont\smallrm\rmshape{8}{1000} \font\smallsy=cmsy9 \def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% \vbox{\hrule\kern-0.4pt \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% \kern-0.4pt\hrule}% \kern-.06em\raise0.4pt\hbox{\angleright}}}} % The old definition, with no lozenge: %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @file, @option are the same as @samp. \let\file=\samp \let\option=\samp % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \frenchspacing #1% }% \null } % We *must* turn on hyphenation at `-' and `_' in \code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active % \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex } % % If we end up with any active - characters when handling the index, % just treat them as a normal -. \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} } \def\realdash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} \def\codex #1{\tclose{#1}\endgroup} %\let\exp=\tclose %Was temporary % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \def\kbdinputstyle{\parsearg\kbdinputstylexxx} \def\kbdinputstylexxx#1{% \def\arg{#1}% \ifx\arg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\arg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\arg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is kbdinputdistinct. (Too much of a hassle to call the macro, % the catcodes are wrong for parsearg to work.) \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\look}}\fi \else{\tclose{\kbdfont\look}}\fi} % For @url, @env, @command quotes seem unnecessary, so use \code. \let\url=\code \let\env=\code \let\command=\code % @uref (abbreviation for `urlref') takes an optional second argument % specifying the text to display. First (mandatory) arg is the url. % Perhaps eventually put in a hypertex \special here. % \def\uref#1{\urefxxx #1,,\finish} \def\urefxxx#1,#2,#3\finish{% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \unhbox0\ (\code{#1})% \else \code{#1}% \fi } % rms does not like the angle brackets --karl, 17may97. % So now @email is just like @uref. %\def\email#1{\angleleft{\tt #1}\angleright} \let\email=\uref % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @acronym downcases the argument and prints in smallcaps. \def\acronym#1{{\smallcaps \lowercase{#1}}} % @pounds{} is a sterling sign. \def\pounds{{\it\$}} \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @contentsaftertitlepage or @shortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \def\shorttitlepage{\parsearg\shorttitlepagezzz} \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \def\titlepage{\begingroup \parindent=0pt \textfonts \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% % \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% % % Leave some space at the very top of the page. \vglue\titlepagetopglue % % Now you can print the title using @title. \def\title{\parsearg\titlezzz}% \def\titlezzz##1{\leftline{\titlefonts\rm ##1} % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Now you can put text using @subtitle. \def\subtitle{\parsearg\subtitlezzz}% \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% % % @author should come last, but may come many times. \def\author{\parsearg\authorzzz}% \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi {\authorfont \leftline{##1}}}% % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \oldpage \let\page = \oldpage \hbox{}}% % \def\page{\oldpage \hbox{}} } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi % \HEADINGSon } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } %%% Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make Tex use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\oddheading{\parsearg\oddheadingxxx} \def\everyheading{\parsearg\everyheadingxxx} \def\evenfooting{\parsearg\evenfootingxxx} \def\oddfooting{\parsearg\oddfootingxxx} \def\everyfooting{\parsearg\everyfootingxxx} {\catcode`\@=0 % \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -\baselineskip \global\advance\vsize by -\baselineskip } \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} % }% unbind the catcode of @. % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\HEADINGSoff{ \global\evenheadline={\hfil} \global\evenfootline={\hfil} \global\oddheadline={\hfil} \global\oddfootline={\hfil}} \HEADINGSoff % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{ \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{ \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % Produces Day Month Year style of output. \def\today{\number\day\space \ifcase\month\or January\or February\or March\or April\or May\or June\or July\or August\or September\or October\or November\or December\fi \space\number\year} % Use this if you want the Month Day, Year style of output. %\def\today{\ifcase\month\or %January\or February\or March\or April\or May\or June\or %July\or August\or September\or October\or November\or December\fi %\space\number\day, \number\year} % @settitle line... specifies the title of the document, for headings % It generates no output of its own \def\thistitle{No Title} \def\settitle{\parsearg\settitlezzz} \def\settitlezzz #1{\gdef\thistitle{#1}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @vtable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} \def\internalBkitem{\smallbreak \parsearg\kitemzzz} \def\internalBkitemx{\itemxpar \parsearg\kitemzzz} \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% \itemzzz {#1}} \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% \itemzzz {#1}} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemfont{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. Unfortunately % we can't prevent a possible page break at the following % \baselineskip glue. \nobreak \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a table}} \def\itemx{\errmessage{@itemx while not in a table}} \def\kitem{\errmessage{@kitem while not in a table}} \def\kitemx{\errmessage{@kitemx while not in a table}} \def\xitem{\errmessage{@xitem while not in a table}} \def\xitemx{\errmessage{@xitemx while not in a table}} % Contains a kludge to get @end[description] to work. \def\description{\tablez{\dontindex}{1}{}{}{}{}} % @table, @ftable, @vtable. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} {\obeylines\obeyspaces% \gdef\tablex #1^^M{% \tabley\dontindex#1 \endtabley}} \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} {\obeylines\obeyspaces% \gdef\ftablex #1^^M{% \tabley\fnitemindex#1 \endtabley \def\Eftable{\endgraf\afterenvbreak\endgroup}% \let\Etable=\relax}} \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} {\obeylines\obeyspaces% \gdef\vtablex #1^^M{% \tabley\vritemindex#1 \endtabley \def\Evtable{\endgraf\afterenvbreak\endgroup}% \let\Etable=\relax}} \def\dontindex #1{} \def\fnitemindex #1{\doind {fn}{\code{#1}}}% \def\vritemindex #1{\doind {vr}{\code{#1}}}% {\obeyspaces % \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% \tablez{#1}{#2}{#3}{#4}{#5}{#6}}} \def\tablez #1#2#3#4#5#6{% \aboveenvbreak % \begingroup % \def\Edescription{\Etable}% Necessary kludge. \let\itemindex=#1% \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % \ifnum 0#4>0 \tableindent=#4\mil \fi % \ifnum 0#5>0 \advance \rightskip by #5\mil \fi % \def\itemfont{#2}% \itemmax=\tableindent % \advance \itemmax by -\itemmargin % \advance \leftskip by \tableindent % \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi% \def\Etable{\endgraf\afterenvbreak\endgroup}% \let\item = \internalBitem % \let\itemx = \internalBitemx % \let\kitem = \internalBkitem % \let\kitemx = \internalBkitemx % \let\xitem = \internalBxitem % \let\xitemx = \internalBxitemx % } % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \def\itemize{\parsearg\itemizezzz} \def\itemizezzz #1{% \begingroup % ended by the @end itemize \itemizey {#1}{\Eitemize} } \def\itemizey #1#2{% \aboveenvbreak % \itemmax=\itemindent % \advance \itemmax by -\itemmargin % \advance \leftskip by \itemindent % \exdentamount=\itemindent \parindent = 0pt % \parskip = \smallskipamount % \ifdim \parskip=0pt \parskip=2pt \fi% \def#2{\endgraf\afterenvbreak\endgroup}% \def\itemcontents{#1}% \let\item=\itemizeitem} % Set sfcode to normal for the chars that usually have another value. % These are `.?!:;,' \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \def\enumerate{\parsearg\enumeratezzz} \def\enumeratezzz #1{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% \begingroup % ended by the @end enumerate % % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call itemizey, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \itemizey{#1.}\Eenumerate\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % Definition of @item while inside @itemize. \def\itemizeitem{% \advance\itemno by 1 {\let\par=\endgraf \smallbreak}% \ifhmode \errmessage{In hmode at itemizeitem}\fi {\parskip=0in \hskip 0pt \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% \vadjust{\penalty 1200}}% \flushcr} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % % For those who want to use more than one line's worth of words in % the preamble, break the line within one argument and it % will parse correctly, i.e., % % @multitable {Column 1 template} {Column 2 template} {Column 3 % template} % Not: % @multitable {Column 1 template} {Column 2 template} % {Column 3 template} % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab, @multitable or @end multitable do not need to be on their % own lines, but it will not hurt if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % 2/1/96, to allow fractions to be given with more than one digit. \def\pickupwholefraction#1 {\global\advance\colcount by1 % \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% \setuptable} \newcount\colcount \def\setuptable#1{\def\firstarg{#1}% \ifx\firstarg\xendsetuptable\let\go\relax% \else \ifx\firstarg\xcolumnfractions\global\setpercenttrue% \else \ifsetpercent \let\go\pickupwholefraction % In this case arg of setuptable % is the decimal point before the % number given in percent of hsize. % We don't need this so we don't use it. \else \global\advance\colcount by1 \setbox0=\hbox{#1 }% Add a normal word space as a separator; % typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi% \fi% \ifx\go\pickupwholefraction\else\let\go\setuptable\fi% \fi\go} % multitable syntax \def\tab{&\hskip1sp\relax} % 2/2/96 % tiny skip here makes sure this column space is % maintained, even if it is never used. % @multitable ... @end multitable definitions: \def\multitable{\parsearg\dotable} \def\dotable#1{\bgroup \vskip\parskip \let\item\crcr \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% % % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % \everycr will reset column counter, \colcount, at the end of % each line. Every column entry will cause \colcount to advance by one. % The table preamble % looks at the current \colcount to find the correct column width. \everycr{\noalign{% % % \filbreak%% keeps underfull box messages off when table breaks over pages. % Maybe so, but it also creates really weird page breaks when the table % breaks over pages. Wouldn't \vfil be better? Wait until the problem % manifests itself, so it can be fixed for real --karl. \global\colcount=0\relax}}% % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup&\global\advance\colcount by 1\relax \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively marking % characters. \noindent\ignorespaces##\unskip\multistrut}\cr } \def\setmultitablespacing{% test to see if user has set \multitablelinespace. % If so, do nothing. If not, give it an appropriate dimension based on % current baselineskip. \ifdim\multitablelinespace=0pt %% strut to put in table in case some entry doesn't have descenders, %% to keep lines equally spaced \let\multistrut = \strut %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. \else \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 width0pt\relax} \fi \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi} \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within \newindex. {\catcode`\@=11 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}} } \def\defcodeindex{\parsearg\newcodeindex} % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \def\synindex#1 #2 {% \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname \expandafter\closeout\csname#1indfile\endcsname \expandafter\let\csname#1indfile\endcsname=\synindexfoo \expandafter\xdef\csname#1index\endcsname{% define \xxxindex \noexpand\doindex{#2}}% } % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. \def\syncodeindex#1 #2 {% \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname \expandafter\closeout\csname#1indfile\endcsname \expandafter\let\csname#1indfile\endcsname=\synindexfoo \expandafter\xdef\csname#1index\endcsname{% define \xxxindex \noexpand\docodeindex{#2}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} \def\indexdummies{% \def\ { }% % Take care of the plain tex accent commands. \def\"{\realbackslash "}% \def\`{\realbackslash `}% \def\'{\realbackslash '}% \def\^{\realbackslash ^}% \def\~{\realbackslash ~}% \def\={\realbackslash =}% \def\b{\realbackslash b}% \def\c{\realbackslash c}% \def\d{\realbackslash d}% \def\u{\realbackslash u}% \def\v{\realbackslash v}% \def\H{\realbackslash H}% % Take care of the plain tex special European modified letters. \def\oe{\realbackslash oe}% \def\ae{\realbackslash ae}% \def\aa{\realbackslash aa}% \def\OE{\realbackslash OE}% \def\AE{\realbackslash AE}% \def\AA{\realbackslash AA}% \def\o{\realbackslash o}% \def\O{\realbackslash O}% \def\l{\realbackslash l}% \def\L{\realbackslash L}% \def\ss{\realbackslash ss}% % Take care of texinfo commands likely to appear in an index entry. % (Must be a way to avoid doing expansion at all, and thus not have to % laboriously list every single command here.) \def\@{@}% will be @@ when we switch to @ as escape char. %\let\{ = \lbracecmd %\let\} = \rbracecmd \def\_{{\realbackslash _}}% \def\w{\realbackslash w }% \def\bf{\realbackslash bf }% %\def\rm{\realbackslash rm }% \def\sl{\realbackslash sl }% \def\sf{\realbackslash sf}% \def\tt{\realbackslash tt}% \def\gtr{\realbackslash gtr}% \def\less{\realbackslash less}% \def\hat{\realbackslash hat}% \def\TeX{\realbackslash TeX}% \def\dots{\realbackslash dots }% \def\result{\realbackslash result}% \def\equiv{\realbackslash equiv}% \def\expansion{\realbackslash expansion}% \def\print{\realbackslash print}% \def\error{\realbackslash error}% \def\point{\realbackslash point}% \def\copyright{\realbackslash copyright}% \def\tclose##1{\realbackslash tclose {##1}}% \def\code##1{\realbackslash code {##1}}% \def\env##1{\realbackslash env {##1}}% \def\command##1{\realbackslash command {##1}}% \def\option##1{\realbackslash option {##1}}% \def\dotless##1{\realbackslash dotless {##1}}% \def\samp##1{\realbackslash samp {##1}}% \def\,##1{\realbackslash ,{##1}}% \def\t##1{\realbackslash t {##1}}% \def\r##1{\realbackslash r {##1}}% \def\i##1{\realbackslash i {##1}}% \def\b##1{\realbackslash b {##1}}% \def\sc##1{\realbackslash sc {##1}}% \def\cite##1{\realbackslash cite {##1}}% \def\key##1{\realbackslash key {##1}}% \def\file##1{\realbackslash file {##1}}% \def\var##1{\realbackslash var {##1}}% \def\kbd##1{\realbackslash kbd {##1}}% \def\dfn##1{\realbackslash dfn {##1}}% \def\emph##1{\realbackslash emph {##1}}% \def\acronym##1{\realbackslash acronym {##1}}% % % Handle some cases of @value -- where the variable name does not % contain - or _, and the value does not contain any % (non-fully-expandable) commands. \let\value = \expandablevalue % \unsepspaces } % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\\leavevmode \penalty \@M \ ). {\obeyspaces \gdef\unsepspaces{\obeyspaces\let =\space}} % \indexnofonts no-ops all font-change commands. % This is used when outputting the strings to sort the index by. \def\indexdummyfont#1{#1} \def\indexdummytex{TeX} \def\indexdummydots{...} \def\indexnofonts{% % Just ignore accents. \let\,=\indexdummyfont \let\"=\indexdummyfont \let\`=\indexdummyfont \let\'=\indexdummyfont \let\^=\indexdummyfont \let\~=\indexdummyfont \let\==\indexdummyfont \let\b=\indexdummyfont \let\c=\indexdummyfont \let\d=\indexdummyfont \let\u=\indexdummyfont \let\v=\indexdummyfont \let\H=\indexdummyfont \let\dotless=\indexdummyfont % Take care of the plain tex special European modified letters. \def\oe{oe}% \def\ae{ae}% \def\aa{aa}% \def\OE{OE}% \def\AE{AE}% \def\AA{AA}% \def\o{o}% \def\O{O}% \def\l{l}% \def\L{L}% \def\ss{ss}% \let\w=\indexdummyfont \let\t=\indexdummyfont \let\r=\indexdummyfont \let\i=\indexdummyfont \let\b=\indexdummyfont \let\emph=\indexdummyfont \let\strong=\indexdummyfont \let\cite=\indexdummyfont \let\sc=\indexdummyfont %Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |... %\let\tt=\indexdummyfont \let\tclose=\indexdummyfont \let\code=\indexdummyfont \let\env=\indexdummyfont \let\command=\indexdummyfont \let\option=\indexdummyfont \let\file=\indexdummyfont \let\samp=\indexdummyfont \let\kbd=\indexdummyfont \let\key=\indexdummyfont \let\var=\indexdummyfont \let\TeX=\indexdummytex \let\dots=\indexdummydots \def\@{@}% } % To define \realbackslash, we must make \ not be an escape. % We must first make another character (@) an escape % so we do not become unable to do a definition. {\catcode`\@=0 \catcode`\\=\other @gdef@realbackslash{\}} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % For \ifx comparisons. \def\emptymacro{\empty} % Most index entries go through here, but \dosubind is the general case. % \def\doind#1#2{\dosubind{#1}{#2}\empty} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % \empty if called from \doind, as we usually are. The main exception % is with defuns, which call us directly. % \def\dosubind#1#2#3{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% \fi {% \count255=\lastpenalty {% \indexdummies % Must do this here, since \bf, etc expand at this stage \escapechar=`\\ {% \let\folio = 0% We will expand all macros now EXCEPT \folio. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % \def\thirdarg{#3}% % % If third arg is present, precede it with space in sort key. \ifx\thirdarg\emptymacro \let\subentry = \empty \else \def\subentry{ #3}% \fi % % First process the index-string with all font commands turned off % to get the string to sort by. {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% % % Now produce the complete index entry, with both the sort key and the % original text, including any font commands. \toks0 = {#2}% \edef\temp{% \write\csname#1indfile\endcsname{% \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% }% % % If third (subentry) arg is present, add it to the index string. \ifx\thirdarg\emptymacro \else \toks0 = {#3}% \edef\temp{\temp{\the\toks0}}% \fi % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write will make \lastskip zero. The result is that sequences % like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % \iflinks \ifvmode \skip0 = \lastskip \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi \fi % \temp % do the write % % \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi \fi }% }% \penalty\count255 }% } % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \def\printindex{\parsearg\doprintindex} \def\doprintindex#1{\begingroup \dobreak \chapheadingskip{10000}% % \indexfonts \rm \tolerance = 9500 \indexbreaks % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. (Index is nonexistent) \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 (Index is empty) \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\rawbackslashxx}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \penalty -300 % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% \vskip .33\baselineskip plus .1\baselineskip % % Do our best not to break after the initial. \nobreak }} % This typesets a paragraph consisting of #1, dot leaders, and then #2 % flush to the right margin. It is used for index and table of contents % entries. The paragraph is indented by \leftskip. % \def\entry#1#2{\begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing columns. \vskip 0pt plus1pt % % Start a ``paragraph'' for the index entry so the line breaking % parameters we've set above will have an effect. \noindent % % Insert the text of the index entry. TeX will do line-breaking on it. #1% % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \def\tempa{{\rm }}% \def\tempb{#2}% \edef\tempc{\tempa}% \edef\tempd{\tempb}% \ifx\tempc\tempd\ \else% % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ #2% The page number ends the paragraph. \fi% \par \endgroup} % Like \dotfill except takes at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary #1#2{ {\parfillskip=0in \parskip=0in \hangindent =1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {\global\setbox\partialpage = \vbox{% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case, we must prevent the second \partialpage from % simply overwriting the first, causing us to lose the page. % This will preserve it until a real output routine can ship it % out. Generally, \partialpage will be empty when this runs and % this will be a no-op. \unvbox\partialpage % % Unvbox the main output page. \unvbox255 \kern-\topskip \kern\baselineskip }}% \eject % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \advance\vsize by -\ht\partialpage \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } \def\pagesofar{% % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \advance\vsize by \ht\partialpage \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } \def\enddoublecolumns{% \output = {% % Split the last of the double-column material. Leave on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize. \pagegoal = \vsize }% \eject \endgroup % started in \begindoublecolumns } \def\balancecolumns{% % Called at the end of the double column material. \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Define chapters, sections, etc. \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ \def\appendixletter{\char\the\appendixno} % Each @chapter defines this as the name of the chapter. % page headings and footings can use it. @section does likewise. \def\thischapter{} \def\thissection{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raise/lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % Choose a numbered-heading macro % #1 is heading level if unmodified by @raisesections or @lowersections % #2 is text for heading \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \chapterzzz{#2} \or \seczzz{#2} \or \numberedsubseczzz{#2} \or \numberedsubsubseczzz{#2} \else \ifnum \absseclevel<0 \chapterzzz{#2} \else \numberedsubsubseczzz{#2} \fi \fi } % like \numhead, but chooses appendix heading levels \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \appendixzzz{#2} \or \appendixsectionzzz{#2} \or \appendixsubseczzz{#2} \or \appendixsubsubseczzz{#2} \else \ifnum \absseclevel<0 \appendixzzz{#2} \else \appendixsubsubseczzz{#2} \fi \fi } % like \numhead, but chooses numberless heading levels \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \unnumberedzzz{#2} \or \unnumberedseczzz{#2} \or \unnumberedsubseczzz{#2} \or \unnumberedsubsubseczzz{#2} \else \ifnum \absseclevel<0 \unnumberedzzz{#2} \else \unnumberedsubsubseczzz{#2} \fi \fi } % @chapter, @appendix, @unnumbered. \def\thischaptername{No Chapter Title} \outer\def\chapter{\parsearg\chapteryyy} \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% \chapmacro {#1}{\the\chapno}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% % We don't substitute the actual chapter name into \thischapter % because we don't want its macros evaluated now. \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% {\the\chapno}}}% \temp \donoderef \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\def\appendix{\parsearg\appendixyyy} \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz \def\appendixzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \appendixno by 1 \message{\putwordAppendix\space \appendixletter}% \chapmacro {#1}{\putwordAppendix{} \appendixletter}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% {\putwordAppendix{} \appendixletter}}}% \temp \appendixnoderef \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\def\centerchap{\parsearg\centerchapyyy} \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} % @top is like @unnumbered. \outer\def\top{\parsearg\unnumberedyyy} \outer\def\unnumbered{\parsearg\unnumberedyyy} \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz \def\unnumberedzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}\message{(\the\toks0)}% % \unnumbchapmacro {#1}% \gdef\thischapter{#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% \temp \unnumbnoderef \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % Sections. \outer\def\numberedsec{\parsearg\secyyy} \def\secyyy #1{\numhead1{#1}} % normally calls seczzz \def\seczzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% {\the\chapno}{\the\secno}}}% \temp \donoderef \nobreak } \outer\def\appendixsection{\parsearg\appendixsecyyy} \outer\def\appendixsec{\parsearg\appendixsecyyy} \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz \def\appendixsectionzzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% {\appendixletter}{\the\secno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz \def\unnumberedseczzz #1{% \plainsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% \temp \unnumbnoderef \nobreak } % Subsections. \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz \def\numberedsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% {\the\chapno}{\the\secno}{\the\subsecno}}}% \temp \donoderef \nobreak } \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz \def\appendixsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% {\appendixletter}{\the\secno}{\the\subsecno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz \def\unnumberedsubseczzz #1{% \plainsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% {\the\toks0}}}% \temp \unnumbnoderef \nobreak } % Subsubsections. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz \def\numberedsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \temp \donoderef \nobreak } \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz \def\appendixsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz \def\unnumberedsubsubseczzz #1{% \plainsubsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% {\the\toks0}}}% \temp \unnumbnoderef \nobreak } % These are variants which are not "outer", so they can appear in @ifinfo. % Actually, they should now be obsolete; ordinary section commands should work. \def\infotop{\parsearg\unnumberedzzz} \def\infounnumbered{\parsearg\unnumberedzzz} \def\infounnumberedsec{\parsearg\unnumberedseczzz} \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} \def\infoappendix{\parsearg\appendixzzz} \def\infoappendixsec{\parsearg\appendixseczzz} \def\infoappendixsubsec{\parsearg\appendixsubseczzz} \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} \def\infochapter{\parsearg\chapterzzz} \def\infosection{\parsearg\sectionzzz} \def\infosubsection{\parsearg\subsectionzzz} \def\infosubsubsection{\parsearg\subsubsectionzzz} % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading % NOTE on use of \vbox for chapter headings, section headings, and such: % 1) We use \vbox rather than the earlier \line to permit % overlong headings to fold. % 2) \hyphenpenalty is set to 10000 because hyphenation in a % heading is obnoxious; this forbids it. % 3) Likewise, headings look best if no \parindent is used, and % if justification is not attempted. Hence \raggedright. \def\majorheading{\parsearg\majorheadingzzz} \def\majorheadingzzz #1{% {\advance\chapheadingskip by 10pt \chapbreak }% {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\penalty 200} \def\chapheading{\parsearg\chapheadingzzz} \def\chapheadingzzz #1{\chapbreak % {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\penalty 200} % @heading, @subheading, @subsubheading. \def\heading{\parsearg\plainsecheading} \def\subheading{\parsearg\plainsubsecheading} \def\subsubheading{\parsearg\plainsubsubsecheading} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. %%% Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{ \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon \def\CHAPFplain{ \global\let\chapmacro=\chfplain \global\let\unnumbchapmacro=\unnchfplain \global\let\centerchapmacro=\centerchfplain} % Plain chapter opening. % #1 is the text, #2 the chapter number or empty if unnumbered. \def\chfplain#1#2{% \pchapsepmacro {% \chapfonts \rm \def\chapnum{#2}% \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent = \wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % Plain opening for unnumbered. \def\unnchfplain#1{\chfplain{#1}{}} % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerchfplain#1{{% \def\centerparametersmaybe{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt }% \chfplain{#1}{}% }} \CHAPFplain % The default \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt \hfill {\rm #1}\hfill}}\bigskip \par\nobreak } \def\CHAPFopen{ \global\let\chapmacro=\chfopen \global\let\unnumbchapmacro=\unnchfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip {-1000}} \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} \def\plainsecheading#1{\sectionheading{sec}{}{#1}} % Subsection titles. \newskip \subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} % Subsubsection titles. \let\subsubsecheadingskip = \subsecheadingskip \let\subsubsecheadingbreak = \subsecheadingbreak \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} % Print any size section title. % % #1 is the section type (sec/subsec/subsubsec), #2 is the section % number (maybe empty), #3 the text. \def\sectionheading#1#2#3{% {% \expandafter\advance\csname #1headingskip\endcsname by \parskip \csname #1headingbreak\endcsname }% {% % Switch to the right set of fonts. \csname #1fonts\endcsname \rm % % Only insert the separating space if we have a section number. \def\secnum{#2}% \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% % \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent = \wd0 % zero if no section number \unhbox0 #3}% }% \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak } \message{toc,} \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. We supply {\folio} at the end of the % argument, which will end up as the last argument to the \...entry macro. % % We open the .toc file here instead of at @setfilename or any other % given time so that @contents can be put in the document anywhere. % \newif\iftocfileopened \def\writetocentry#1{% \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi \iflinks \write\tocfile{#1{\folio}}\fi } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Finish up the main text and prepare to read what we've written % to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \unnumbchapmacro{#1}\def\thischapter{}% \savepageno = \pageno \begingroup % Set up to handle contents files properly. \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 % We can't do this, because then an actual ^ in a section % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \pageno = \lastnegativepageno \fi } % Normal (long) toc. \def\contents{% \startcontents{\putwordTableofContents}% \openin 1 \jobname.toc \ifeof 1 \else \closein 1 \input \jobname.toc \fi \vfill \eject \endgroup \lastnegativepageno = \pageno \pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortContents}% % \let\chapentry = \shortchapentry \let\unnumbchapentry = \shortunnumberedentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\secentry ##1##2##3##4{} \def\unnumbsecentry ##1##2{} \def\subsecentry ##1##2##3##4##5{} \def\unnumbsubsecentry ##1##2{} \def\subsubsecentry ##1##2##3##4##5##6{} \def\unnumbsubsubsecentry ##1##2{} \openin 1 \jobname.toc \ifeof 1 \else \closein 1 \input \jobname.toc \fi \vfill \eject \endgroup \lastnegativepageno = \pageno \pageno = \savepageno } \let\shortcontents = \summarycontents % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Chapter-level things, for both the long and short contents. \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} % See comments in \dochapentry re vbox and related settings \def\shortchapentry#1#2#3{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}% } % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter. % We could simplify the code here by writing out an \appendixentry % command in the toc file for appendices, instead of using \chapentry % for both, but it doesn't seem worth it. \setbox0 = \hbox{\shortcontrm \putwordAppendix } \newdimen\shortappendixwidth \shortappendixwidth = \wd0 \def\shortchaplabel#1{% % We typeset #1 in a box of constant width, regardless of the text of % #1, so the chapter titles will come out aligned. \setbox0 = \hbox{#1}% \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi % % This space should be plenty, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) \advance\dimen0 by 1.1em \hbox to \dimen0{#1\hfil}% } \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}} % Sections. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} % Subsections. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} % And subsubsections. \def\subsubsecentry#1#2#3#4#5#6{% \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} % This parameter controls the indentation of the various levels. \newdimen\tocindent \tocindent = 3pc % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno{#2}}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno{#2}}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno{#2}}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno{#2}}% \endgroup} % Final typesetting of a toc entry; we use the same \entry macro as for % the index entries, but we want to suppress hyphenation here. (We % can't do that in the \entry macro, since index entries might consist % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) \def\tocentry#1#2{\begingroup \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks % Do not use \turnoffactive in these arguments. Since the toc is % typeset in cmr, so characters such as _ would come out wrong; we % have to do the usual translation tricks. \entry{#1}{#2}% \endgroup} % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \let\subsecentryfonts = \textfonts \let\subsubsecentryfonts = \textfonts \message{environments,} % Since these characters are used in examples, it should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % Furthermore, these definitions must come after we define our fonts. \newbox\dblarrowbox \newbox\longdblarrowbox \newbox\pushcharbox \newbox\bullbox \newbox\equivbox \newbox\errorbox %{\tentt %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil} % Adapted from the manmac format (p.420 of TeXbook) %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex % depth .1ex\hfil} %} % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. \def\point{$\star$} \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} % Adapted from the TeXbook's \boxit. {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} \global\setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{ \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % The @error{} command. \def\error{\leavevmode\lower.7ex\copy\errorbox} % @tex ... @end tex escapes into raw Tex temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain tex @ character. \def\tex{\begingroup \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie \catcode `\%=14 \catcode 43=12 % plus \catcode`\"=12 \catcode`\==12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \escapechar=`\\ % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\*=\ptexstar \let\t=\ptext % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% \let\Etex=\endgroup} % Define @lisp ... @endlisp. % @lisp does a \begingroup so it can rebind things, % including the definition of @endlisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % {\obeyspaces % \gdef\sepspaces{\obeyspaces\let =\tie}} % Define \obeyedspace to be our active space, whatever it is. This is % for use in \parsearg. {\sepspaces% \global\let\obeyedspace= } % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip % \def\aboveenvbreak{{\advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip \penalty-50 \vskip\envskipamount \fi}} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \long\def\cartouche{% \begingroup \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt %we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing=\comment \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \hsize=\cartinner \kern3pt \begingroup \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \def\Ecartouche{% \endgroup \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \endgroup }} % This macro is called at the beginning of all the @example variants, % inside a group. \def\nonfillstart{% \aboveenvbreak \inENV % This group ends at the end of the body \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \singlespace \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt \parindent = 0pt \emergencystretch = 0pt % don't try to avoid overfull boxes % @cartouche defines \nonarrowing to inhibit narrowing % at next level down. \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \let\exdent=\nofillexdent \let\nonarrowing=\relax \fi } % Define the \E... control sequence only if we are inside the particular % environment, so the error checking in \end will work. % % To end an @example-like environment, we first end the paragraph (via % \afterenvbreak's vertical glue), and then the group. That way we keep % the zero \parskip that the environments set -- \parskip glue will be % inserted at the beginning of the next paragraph in the document, after % the environment. % \def\nonfillfinish{\afterenvbreak\endgroup} % @lisp: indented, narrowed, typewriter font. \def\lisp{\begingroup \nonfillstart \let\Elisp = \nonfillfinish \tt \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @example: Same as @lisp. \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} % @small... is usually equivalent to the non-small (@smallbook % redefines). We must call \example (or whatever) last in the % definition, since it reads the return following the @example (or % whatever) command. % % This actually allows (for example) @end display inside an % @smalldisplay. Too bad, but makeinfo will catch the error anyway. % \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. % Originally contributed by Pavel@xerox. \def\smalllispx{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}% \def\Esmallexample{\nonfillfinish\endgroup}% \indexfonts \lisp } % @display: same as @lisp except keep current font. % \def\display{\begingroup \nonfillstart \let\Edisplay = \nonfillfinish \gobble } % @smalldisplay (when @smallbook): @display plus smaller fonts. % \def\smalldisplayx{\begingroup \def\Esmalldisplay{\nonfillfinish\endgroup}% \indexfonts \rm \display } % @format: same as @display except don't narrow margins. % \def\format{\begingroup \let\nonarrowing = t \nonfillstart \let\Eformat = \nonfillfinish \gobble } % @smallformat (when @smallbook): @format plus smaller fonts. % \def\smallformatx{\begingroup \def\Esmallformat{\nonfillfinish\endgroup}% \indexfonts \rm \format } % @flushleft (same as @format). % \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} % @flushright. % \def\flushright{\begingroup \let\nonarrowing = t \nonfillstart \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill \gobble } % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. % \def\quotation{% \begingroup\inENV %This group ends at the end of the @quotation body {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \singlespace \parindent=0pt % We have retained a nonzero parskip for the environment, since we're % doing normal filling. So to avoid extra space below the environment... \def\Equotation{\parskip = 0pt \nonfillfinish}% % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \advance\rightskip by \lispnarrowing \exdentamount = \lispnarrowing \let\nonarrowing = \relax \fi } \message{defuns,} % Define formatter for defuns % First, allow user to change definition object font (\df) internally \def\setdeffont #1 {\csname DEF#1\endcsname} \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deftypemargin \deftypemargin=12pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\parencount % define \functionparens, which makes ( and ) and & do special things. % \functionparens affects the group it is contained in. \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active \catcode`\[=\active \catcode`\]=\active} % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) {\activeparens % Now, smart parens don't turn on until &foo (see \amprm) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} % This is used to turn on special parens % but make & act ordinary (given that it's active). \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} % Definitions of (, ) and & used in args for functions. % This is the definition of ( outside of all parentheses. \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested \global\advance\parencount by 1 } % % This is the definition of ( when already inside a level of parens. \gdef\opnested{\char`\(\global\advance\parencount by 1 } % \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. % also in that case restore the outer-level definition of (. \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi \global\advance \parencount by -1 } % If we encounter &foo, then turn on ()-hacking afterwards \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } % \gdef\normalparens{\boldbrax\let&=\ampnr} } % End of definition inside \activeparens %% These parens (in \boldbrax) actually are a little bolder than the %% contained text. This is especially needed for [ and ] \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } \def\ampnr{\&} \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} % First, defname, which formats the header line itself. % #1 should be the function name. % #2 should be the type of definition, such as "Function". \def\defname #1#2{% % Get the values of \leftskip and \rightskip as they were % outside the @def... \dimen2=\leftskip \advance\dimen2 by -\defbodyindent \noindent \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations \parshape 2 0in \dimen0 \defargsindent \dimen1 % Now output arg 2 ("Function" or some such) % ending at \deftypemargin from the right margin, % but stuck inside a box of width 0 so it does not interfere with linebreaking {% Adjust \hsize to exclude the ambient margins, % so that \rightline will obey them. \advance \hsize by -\dimen2 \rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% % Make all lines underfull and no complaints: \tolerance=10000 \hbadness=10000 \advance\leftskip by -\defbodyindent \exdentamount=\defbodyindent {\df #1}\enskip % Generate function name } % Actually process the body of a definition % #1 should be the terminating control sequence, such as \Edefun. % #2 should be the "another name" control sequence, such as \defunx. % #3 should be the control sequence that actually processes the header, % such as \defunheader. \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\activeparens\spacesplit#3}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % 61 is `=' \obeylines\activeparens\spacesplit#3} % #1 is the \E... control sequence to end the definition (which we define). % #2 is the \...x control sequence for consecutive fns (which we define). % #3 is the control sequence to call to resume processing. % #4, delimited by the space, is the class name. % \def\defmethparsebody#1#2#3#4 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#4}}} % @deftypemethod has an extra argument that nothing else does. Sigh. % #1 is the \E... control sequence to end the definition (which we define). % #2 is the \...x control sequence for consecutive fns (which we define). % #3 is the control sequence to call to resume processing. % #4, delimited by the space, is the class name. % #5 is the method's return type. % \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#5}}} % These parsing functions are similar to the preceding ones % except that they do not make parens into active characters. % These are used for "variables" since they have no arguments. \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\spacesplit#3}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % \obeylines\spacesplit#3} % This is used for \def{tp,vr}parsebody. It could probably be used for % some of the others, too, with some judicious conditionals. % \def\parsebodycommon#1#2#3{% \begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines } \def\defvrparsebody#1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% \spacesplit{#3{#4}}% } % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the % type is just `struct', because we lose the braces in `{struct % termios}' when \spacesplit reads its undelimited argument. Sigh. % \let\deftpparsebody=\defvrparsebody % % So, to get around this, we put \empty in with the type name. That % way, TeX won't find exactly `{...}' as an undelimited argument, and % won't strip off the braces. % \def\deftpparsebody #1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% \spacesplit{\parsetpheaderline{#3{#4}}}\empty } % Fine, but then we have to eventually remove the \empty *and* the % braces (if any). That's what this does. % \def\removeemptybraces\empty#1\relax{#1} % After \spacesplit has done its work, this is called -- #1 is the final % thing to call, #2 the type name (which starts with \empty), and #3 % (which might be empty) the arguments. % \def\parsetpheaderline#1#2#3{% #1{\removeemptybraces#2\relax}{#3}% }% \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\spacesplit{#3{##2}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\spacesplit{#3{#5}}} % Split up #2 at the first space token. % call #1 with two arguments: % the first is all of #2 before the space token, % the second is all of #2 after that space token. % If #2 contains no space token, all of it is passed as the first arg % and the second is passed as empty. {\obeylines \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% \ifx\relax #3% #1{#2}{}\else #1{#2}{#3#4}\fi}} % So much for the things common to all kinds of definitions. % Define @defun. % First, define the processing that is wanted for arguments of \defun % Use this to expand the args and terminate the paragraph they make up \def\defunargs #1{\functionparens \sl % Expand, preventing hyphenation at `-' chars. % Note that groups don't affect changes in \hyphenchar. \hyphenchar\tensl=0 #1% \hyphenchar\tensl=45 \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil \endgraf\nobreak\vskip -\parskip\nobreak } \def\deftypefunargs #1{% % Expand, preventing hyphenation at `-' chars. % Note that groups don't affect changes in \hyphenchar. % Use \boldbraxnoamp, not \functionparens, so that & is not special. \boldbraxnoamp \tclose{#1}% avoid \code because of side effects on active chars \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil \endgraf\nobreak\vskip -\parskip\nobreak } % Do complete processing of one @defun or @defunx line already parsed. % @deffn Command forward-char nchars \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defun == @deffn Function \def\defun{\defparsebody\Edefun\defunx\defunheader} \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{Function}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @deftypefun int foobar (int @var{foo}, float @var{bar}) \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} % #1 is the data type. #2 is the name and args. \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} % #1 is the data type, #2 the name, #3 the args. \def\deftypefunheaderx #1#2 #3\relax{% \doind {fn}{\code{#2}}% Make entry in function index \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}% \deftypefunargs {#3}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} % \defheaderxcond#1\relax$$$ % puts #1 in @code, followed by a space, but does nothing if #1 is null. \def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi} % #1 is the classification. #2 is the data type. #3 is the name and args. \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} % #1 is the classification, #2 the data type, #3 the name, #4 the args. \def\deftypefnheaderx #1#2#3 #4\relax{% \doind {fn}{\code{#3}}% Make entry in function index \begingroup \normalparens % notably, turn off `&' magic, which prevents % at least some C++ text from working \defname {\defheaderxcond#2\relax$$$#3}{#1}% \deftypefunargs {#4}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defmac == @deffn Macro \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{Macro}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defspec == @deffn Special Form \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{Special Form}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % This definition is run if you use @defunx % anywhere other than immediately after a @defun or @defunx. \def\deffnx #1 {\errmessage{@deffnx in invalid context}} \def\defunx #1 {\errmessage{@defunx in invalid context}} \def\defmacx #1 {\errmessage{@defmacx in invalid context}} \def\defspecx #1 {\errmessage{@defspecx in invalid context}} \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}} \def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}} % @defmethod, and so on % @defop CATEGORY CLASS OPERATION ARG... \def\defop #1 {\def\defoptype{#1}% \defopparsebody\Edefop\defopx\defopheader\defoptype} \def\defopheader #1#2#3{% \dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index \begingroup\defname {#2}{\defoptype{} on #1}% \defunargs {#3}\endgroup % } % @deftypemethod CLASS RETURN-TYPE METHOD ARG... % \def\deftypemethod{% \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} % % #1 is the class name, #2 the data type, #3 the method name, #4 the args. \def\deftypemethodheader#1#2#3#4{% \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index \begingroup \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}% \deftypefunargs{#4}% \endgroup } % @defmethod == @defop Method % \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} % % #1 is the class name, #2 the method name, #3 the args. \def\defmethodheader#1#2#3{% \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index \begingroup \defname{#2}{\putwordMethodon\ \code{#1}}% \defunargs{#3}% \endgroup } % @defcv {Class Option} foo-class foo-flag \def\defcv #1 {\def\defcvtype{#1}% \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} \def\defcvarheader #1#2#3{% \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index \begingroup\defname {#2}{\defcvtype{} of #1}% \defvarargs {#3}\endgroup % } % @defivar == @defcv {Instance Variable} \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} \def\defivarheader #1#2#3{% \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index \begingroup\defname {#2}{Instance Variable of #1}% \defvarargs {#3}\endgroup % } % These definitions are run if you use @defmethodx, etc., % anywhere other than immediately after a @defmethod, etc. \def\defopx #1 {\errmessage{@defopx in invalid context}} \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}} \def\defcvx #1 {\errmessage{@defcvx in invalid context}} \def\defivarx #1 {\errmessage{@defivarx in invalid context}} % Now @defvar % First, define the processing that is wanted for arguments of @defvar. % This is actually simple: just print them in roman. % This must expand the args and terminate the paragraph they make up \def\defvarargs #1{\normalparens #1% \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak} % @defvr Counter foo-count \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} % @defvar == @defvr Variable \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index \begingroup\defname {#1}{Variable}% \defvarargs {#2}\endgroup % } % @defopt == @defvr {User Option} \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index \begingroup\defname {#1}{User Option}% \defvarargs {#2}\endgroup % } % @deftypevar int foobar \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} % #1 is the data type. #2 is the name, perhaps followed by text that % is actually part of the data type, which should not be put into the index. \def\deftypevarheader #1#2{% \dovarind#2 \relax% Make entry in variables index \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak \endgroup} \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} % @deftypevr {Global Flag} int enable \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} \def\deftypevrheader #1#2#3{\dovarind#3 \relax% \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak \endgroup} % This definition is run if you use @defvarx % anywhere other than immediately after a @defvar or @defvarx. \def\defvrx #1 {\errmessage{@defvrx in invalid context}} \def\defvarx #1 {\errmessage{@defvarx in invalid context}} \def\defoptx #1 {\errmessage{@defoptx in invalid context}} \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}} \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}} % Now define @deftp % Args are printed in bold, a slight difference from @defvar. \def\deftpargs #1{\bf \defvarargs{#1}} % @deftp Class window height width ... \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} % This definition is run if you use @deftpx, etc % anywhere other than immediately after a @deftp, etc. \def\deftpx #1 {\errmessage{@deftpx in invalid context}} \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\undefined \newwrite\macscribble \def\scanmacro#1{% \begingroup \newlinechar`\^^M \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{#1}% \immediate\closeout\macscribble \let\xeatspaces\eatspaces \input \jobname.tmp \endgroup } \else \def\scanmacro#1{% \begingroup \newlinechar`\^^M \let\xeatspaces\eatspaces\scantokens{#1}\endgroup} \fi \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % Utility routines. % Thisdoes \let #1 = #2, except with \csnames. \def\cslet#1#2{% \expandafter\expandafter \expandafter\let \expandafter\expandafter \csname#1\endcsname \csname#2\endcsname} % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=12\catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \. % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. \def\macrobodyctxt{% \catcode`\~=12 \catcode`\^=12 \catcode`\_=12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \catcode`\+=12 \catcode`\{=12 \catcode`\}=12 \catcode`\@=12 \catcode`\^^M=12 \usembodybackslash} \def\macroargctxt{% \catcode`\~=12 \catcode`\^=12 \catcode`\_=12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \catcode`\+=12 \catcode`\@=12 \catcode`\\=12} % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0% \else \expandafter\parsemargdef \argl;% \fi \expandafter\ifx \csname macsave.\the\macname\endcsname \relax \cslet{macsave.\the\macname}{\the\macname}% \else \message{Warning: redefining \the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \def\unmacro{\parsearg\unmacroxxx} \def\unmacroxxx#1{% \expandafter\ifx \csname macsave.\the\macname\endcsname \relax \errmessage{Macro \the\macname\ not defined.}% \else \cslet{#1}{macsave.#1}% \expandafter\let \csname macsave.\the\macname\endcsname \undefined \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname #1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.blah for each blah % in the params list, to be ##N where N is the position in that list. % That gets used by \mbodybackslash (above). % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. \def\parsemargdef#1;{\paramno=0\def\paramlist{}% \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1% \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% % This defines the macro itself. There are six cases: recursive and % nonrecursive macros of zero, one, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname} \expandafter\xdef\csname\the\macname xx\endcsname##1{% \csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname} \expandafter\xdef\csname\the\macname xx\endcsname##1{% \csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \fi \fi} \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg) \def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \next} \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's job is to define \lastnode. \def\node{\ENVcheck\parsearg\nodezzz} \def\nodezzz#1{\nodexxx [#1,]} \def\nodexxx[#1,#2]{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\relax % The sectioning commands (@chapter, etc.) call these. \def\donoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}% {Ysectionnumberandtype}% \global\let\lastnode=\relax \fi } \def\unnumbnoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% \global\let\lastnode=\relax \fi } \def\appendixnoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}% {Yappendixletterandtype}% \global\let\lastnode=\relax \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \def\anchor#1{\setref{#1}{Ynothing}} % \setref{NAME}{SNT} defines a cross-reference point NAME, namely % NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have % to set \indexdummies so commands such as @code in a section title % aren't expanded. It would be nicer not to expand the titles in the % first place, but there's so many layers that that is hard to do. % \def\setref#1#2{{% \indexdummies \dosetq{#1-title}{Ytitle}% \dosetq{#1-pg}{Ypagenumber}% \dosetq{#1-snt}{#2} }} % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \def\printedmanual{\ignorespaces #5}% \def\printednodename{\ignorespaces #3}% \setbox1=\hbox{\printedmanual}% \setbox0=\hbox{\printednodename}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. \def\printednodename{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. \def\printednodename{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. \def\printednodename{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printednodename{\ignorespaces #1}% \fi% \fi \fi \fi % % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not % insert empty discretionaries after hyphens, which means that it will % not find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, this % is a loss. Therefore, we give the text of the node name again, so it % is as if TeX is seeing it for the first time. \ifdim \wd1 > 0pt \putwordsection{} ``\printednodename'' in \cite{\printedmanual}% \else % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\normalturnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % [mynode], [\printednodename],\space % page 3 \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi \endgroup} % \dosetq is the interface for calls from other macros % Use \normalturnoffactive so that punctuation chars such as underscore % and backslash work in node names. (\turnoffactive doesn't do \.) \def\dosetq#1#2{% {\let\folio=0 \normalturnoffactive \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% \iflinks \next \fi }% } % \internalsetq {foo}{page} expands into % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} % When the aux file is read, ' is the escape character \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} % Things to be expanded by \internalsetq \def\Ypagenumber{\folio} \def\Ytitle{\thissection} \def\Ynothing{} \def\Ysectionnumberandtype{% \ifnum\secno=0 \putwordChapter\xreftie\the\chapno % \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % \else \ifnum \subsubsecno=0 % \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % \else % \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % \fi \fi \fi } \def\Yappendixletterandtype{% \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % \else \ifnum \subsubsecno=0 % \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % \else % \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % \fi \fi \fi } \gdef\xreftie{'tie} % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Non-3.0. \else \def\linenumber{\the\inputlineno:\space} \fi % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. \def\refx#1#2{% \expandafter\ifx\csname X#1\endcsname\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs \message{\linenumber Undefined cross reference `#1'.}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \csname X#1\endcsname \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. % \def\xrdef#1{\begingroup % Reenable \ as an escape while reading the second argument. \catcode`\\ = 0 \afterassignment\endgroup \expandafter\gdef\csname X#1\endcsname } % Read the last existing aux file, if any. No error if none exists. \def\readauxfile{\begingroup \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other \catcode`\@=\other \catcode`\^=\other % It was suggested to define this as 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % Make the characters 128-255 be printing characters {% \count 1=128 \def\loop{% \catcode\count 1=\other \advance\count 1 by 1 \ifnum \count 1<256 \loop \fi }% }% % The aux file uses ' as the escape (for now). % Turn off \ as an escape so we do not lose on % entries which were dumped with control sequences in their names. % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ % Reference to such entries still does not work the way one would wish, % but at least they do not bomb out when the aux file is read in. \catcode`\{=1 \catcode`\}=2 \catcode`\%=\other \catcode`\'=0 \catcode`\\=\other % \openin 1 \jobname.aux \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue \global\warnedobstrue \fi % Open the new aux file. TeX will close it automatically at exit. \openout\auxfile=\jobname.aux \endgroup} % Footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment \let\ptexfootnote=\footnote {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \footnotezzz }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset and anything else that uses % \parseargline fail inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \long\gdef\footnotezzz{\insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % % Hang the footnote text off the number. \hang \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut \futurelet\next\fo@t } \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t \else\let\next\f@t\fi \next} \def\f@@t{\bgroup\aftergroup\@foot\let\next} \def\f@t#1{#1\@foot} \def\@foot{\strut\egroup} }%end \catcode `\@=11 % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % \def\setleading#1{% \normalbaselineskip = #1\relax \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt} % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else \closein 1 % Do not bother showing banner with post-v2.7 epsf.tex (available in % doc/epsf.tex until it shows up on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi % \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://ftp.tug.org/tex/epsf.tex.} % % Only complain once about lack of epsf.tex. \def\image#1{% \ifx\epsfbox\undefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is just the usual extra ignored arg for parsing this stuff. \def\imagexxx#1,#2,#3,#4\finish{% % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi % If the image is by itself, center it. \ifvmode \nobreak\medskip \nobreak \centerline{\epsfbox{#1.eps}}% \bigbreak \else \epsfbox{#1.eps}% \fi } \message{paper sizes,} % And other related parameters. \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be so finicky about underfull hboxes, either. \hbadness = 2000 % Following George Bush, just get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. This makes it come to about 9pt for the 8.5x11 format. We % call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = \hsize \divide\emergencystretch by 45 \fi } % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; % 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can % set \parskip and call \setleading for \baselineskip. % \def\internalpagesizes#1#2#3#4#5#6{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 0.6in \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \setleading{13.2pt}% % % If page is nothing but text, make it come out even. \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% }} % Use @smallbook to reset parameters for 7x9.5 (or so) format. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \setleading{12pt}% % \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \deftypemargin = 0pt \defbodyindent = .5cm % \let\smalldisplay = \smalldisplayx \let\smallexample = \smalllispx \let\smallformat = \smallformatx \let\smalllisp = \smalllispx }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \setleading{12pt}% \parskip = 3pt plus 2pt minus 1pt % \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% % \tolerance = 700 \hfuzz = 1pt }} % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin % 29mm, hence bottom margin 28mm, nominal side margin 3cm. \def\afourlatex{{\globaldefs = 1 \setleading{13.6pt}% % \afourpaper \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% % \globaldefs = 0 }} % Use @afourwide to print on European A4 paper in wide format. \def\afourwide{% \afourpaper \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% % \globaldefs = 0 } % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \def\pagesizes{\parsearg\pagesizesxxx} \def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{13.2pt}% % \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \catcode`\~=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\+=\other \def\normaldoublequote{"} \def\normaltilde{~} \def\normalcaret{^} \def\normalunderscore{_} \def\normalverticalbar{|} \def\normalless{<} \def\normalgreater{>} \def\normalplus{+} % This macro is used to make a character print one way in ttfont % where it can probably just be output, and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} % Subroutine for the previous macro. \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} %\catcode 27=\active %\def^^[{$\diamondsuit$} % Set up an active definition for =, but don't enable it most of the time. {\catcode`\==\active \global\def={{\tt \char 61}}} \catcode`+=\active \catcode`\_=\active % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} \catcode`\@=0 % \rawbackslashxx output one backslash character in current font \global\chardef\rawbackslashxx=`\\ %{\catcode`\\=\other %@gdef@rawbackslashxx{\}} % \rawbackslash redefines \ as input to do \rawbackslashxx. {\catcode`\\=\active @gdef@rawbackslash{@let\=@rawbackslashxx }} % \normalbackslash outputs one backslash in fixed width font. \def\normalbackslash{{\tt\rawbackslashxx}} % Say @foo, not \foo, in error messages. \escapechar=`\@ % \catcode 17=0 % Define control-q \catcode`\\=\active % Used sometimes to turn off (effectively) the active characters % even after parsing them. @def@turnoffactive{@let"=@normaldoublequote @let\=@realbackslash @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater @let+=@normalplus} @def@normalturnoffactive{@let"=@normaldoublequote @let\=@normalbackslash @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater @let+=@normalplus} % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\{ in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also back turn on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active} % These look ok in all fonts, so just make them not special. The @rm below % makes sure that the current font starts out as the newly loaded cmr10 @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other @textfonts @rm @c Local variables: @c page-delimiter: "^\\\\message" @c update-date-leading-regexp: "def\\texinfoversion{" @c update-date-date-regexp: "[-0-9.]+" @c update-date-format-string: "%Y-%m-%d" @c update-date-trailing-regexp: "}" @c eval: (and(load "update-date" t t)(add-hook 'write-file-hooks 'update-date)) @c End: ebnetd-1.0.dfsg.1/doc/ebnetd.texi0000644000175000017500000022717607725347757016161 0ustar mhattamhatta\input texinfo @c -*-texinfo-*- @c %** start of header @setfilename ebnetd.info @settitle EBNETD/ebHTTPD/NDTPD @c %** end of header @include version.texi @dircategory CD-ROM Book Utilities @direntry * EBNETD: (ebnetd). Network EB Library server. * NDTPD: (ndtpd). Server for accessing CD-ROM books with NDTP. * ebHTTPD: (ebhttpd). Server for accessing CD-ROM books with HTTP. @end direntry @ifinfo EBNETD/NDTPD/ebHTTPD: CD-ROM Book Servers, by Motoyuki Kasahara. Copyright @copyright{} 1997, 98, 99, 2000, 01, 03 Motoyuki Kasahara Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Free Software Foundation, Inc. @end ifinfo @titlepage @title EBNETD/NDTPD/ebHTTPD @subtitle CD-ROM Book Servers. @subtitle Edition @value{EDITION} for EBNETD version @value{VERSION} @subtitle @value{UPDATED} @author by Motoyuki Kasahara @page @vskip 0pt plus 1filll Copyright @copyright{} 1997, 98, 99, 2000, 01, 03 Motoyuki Kasahara Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Free Software Foundation, Inc. @end titlepage @node Top, Introduction, (dir), (dir) @ifinfo This is edition @value{EDITION}, for EBNETD version @value{VERSION}. @end ifinfo @menu * Introduction:: Introduction. * Installation:: Installation of NDTPD. * Configuration File:: How to write a configuration file. * Configuration Checker:: How to check a configuration file. * Setup Your Environment:: Setup your environment. * Start ebnetd:: Start @code{ebnetd}. * Start ndtpd:: Start @code{ndtpd}. * Start ebhttpd:: Start @code{ebhttpd}. * Terminate and Restart:: How to terminate and restart @code{ebnetd}. * Daily Works:: Daily administrative works. * Network License:: Network License. @detailmenu --- The Detailed Node Listing --- Installation of EBNETD * Basic Installation:: Basic installation. * Compilers and Options:: Choose compilers and its options. * Multiple Architectures:: Compile EBNETD on multiple Architectures. * Installation Names:: Change installation Names. * Optional Features:: Selecting optional features. * System Type:: Specifying the system type. * Sharing Defaults:: Set default values for @code{configure} scripts to share. * Operation Controls:: Control @code{configure} operation. * Optional Feature List:: Optional features this package supports. Configuration File * Single Directive:: Common form of single directive. * Single Directive List:: Single directive list. * Group Directive:: Common form of group directive. * Book Group Directive:: Book group directive list. * Sample Configuration:: Sample configuration file. Configuration Checker * Invoking ebncheck:: Invoking @code{ebncheck}. * ebncheck Options:: Summary of options to @code{ebncheck}. Setup Your Environment * Services:: Setup your @file{services} file. * Syslog:: Setup your @file{syslog.conf} file. * Working Directory:: Make a working directory. * Mount CD-ROM Books:: Mount your CD-ROM books. * Appendix Package:: Copy appendix package. Start @code{ebnetd} * ebnetd Standalone:: Run @code{ebnetd} as a standard daemon. * ebnetd Child of inetd:: Run @code{ebnetd} as a child of @code{inetd}. * ebnetd Child of xinetd:: Run @code{ebnetd} as a child of @code{xinetd}. * ebnetd Test with telnet:: Test @code{ebnetd} with @code{telnet}. * ebnetd Options:: Summary of options to @code{ebnetd}. Start @code{ndtpd} * ndtpd Standalone:: Run @code{ndtpd} as a standard daemon. * ndtpd Child of inetd:: Run @code{ndtpd} as a child of @code{inetd}. * ndtpd Child of xinetd:: Run @code{ndtpd} as a child of @code{xinetd}. * ndtpd Test with telnet:: Test @code{ndtpd} with @code{telnet}. * ndtpd Options:: Options to @code{ndtpd}. Start @code{ebhttpd} * ebhttpd Standalone:: Run @code{ebhttpd} as a standard daemon. * ebhttpd Child of inetd:: Run @code{ebhttpd} as a child of @code{inetd}. * ebhttpd Child of xinetd:: Run @code{ebhttpd} as a child of @code{xinetd}. * ebhttpd Test with telnet:: Test @code{ebhttpd} with @code{telnet}. * ebhttpd Options:: Options to @code{ebhttpd}. Terminate and Restart the Servers * Invoke Server Controler:: Invoke Server Control Commands * Server Controler Options:: Summary of Options to Server Control Commands Daily Administrative Works * ebndaily Options:: Summary of options to @code{ebndaily}. @end detailmenu @end menu @c =================================================================== @node Introduction, Installation, Top, Top @chapter Introduction This EBNETD distribution contains three server commands: @code{ebnetd}, @code{ndtpd} and @code{ebhttpd}. They are servers for accessing CD-ROM book on remote host via TCP/IP. They can run on UNIX derived systems. @table @code @item ebnetd @code{ebnetd} is a server of EBNET protocol which is designed to communicate with @dfn{EB Library}. EB Library is a C library for accessing CD-ROM book. Also @code{ndtpd} and @code{ebhttpd} use EB Library. Using @code{ebnetd}, EB Library applications can access CD-ROM books on a remote server. For more details about EB Library, see @url{http://www.sra.co.jp/m-kasahr/eb/}. @item ndtpd @code{ndtpd} is an NDTP (Network Dictionary Transfer Protocol) server. The first implementation of the NDTP server is @dfn{dserver}. @code{ndtpd} has upper compatibility with dserver-2.2. The web page @url{http://www.sra.co.jp/m-kasahr/ndtpd/related.html} lists NDTP clients which can talk with @code{ndtpd}. @item ebhttpd @code{ebhttpd} is a WWW (World Wide Web) server. It supprts HTTP/1.0 and HTTP/1.1 (Hypertext Transfer Protocol version 1.0 and 1.1). @end table The servers support CD-ROM books of EB, EBG, EBXA, EBXA-C, S-EBXA and EPWING formats. CD-ROM books of those formats are popular in Japan. Since CD-ROM books themseves are stands on the ISO 9660 format, you can mount the discs by the same way as other ISO 9660 discs. The servers can run as a standalone daemons by default, but can also run as children of @code{inetd}. EBNETD 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, or (at your option) any later version. EBNETD 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. In addition, you must follow the licenses of your CD-ROM books. Though EBNETD is free software, your books may not be free. Don't open your books to unlicensed hosts nor users. In addition, you must follow the licenses of your CD-ROM books. EBNETD is free software, your books may not be free. Don't open your books to unlicensed hosts nor users. This edition corresponds to version @value{VERSION} of EBNETD. You can get the latest EBNETD from @url{ftp://ftp.sra.co.jp/pub/misc/eb/}. You can get information about EBNETD from @url{http://www.sra.co.jp/people/m-kasahr/ebnetd/}. Mail comments and bug reports to @email{m-kasahr@@sra.co.jp} in Japanese or English. @c =================================================================== @node Installation, Configuration File, Introduction, Top @chapter Installation of EBNETD Before installing EBNETD, you need to install EB Library 3.3 or later version. You can get the latest EB Library from @url{ftp://ftp.sra.co.jp/pub/misc/eb/}. You can get information about EB Library from @url{http://www.sra.co.jp/people/m-kasahr/eb/}. @menu * Basic Installation:: Basic installation. * Compilers and Options:: Choose compilers and its options. * Multiple Architectures:: Compile EBNETD on multiple Architectures. * Installation Names:: Change installation Names. * Optional Features:: Selecting optional features. * System Type:: Specifying the system type. * Sharing Defaults:: Set default values for @code{configure} scripts to share. * Operation Controls:: Control @code{configure} operation. * Optional Feature List:: Optional features this package supports. @end menu @c ------------------------------------------------------------------- @node Basic Installation, Compilers and Options, Installation, Installation @section Basic Installation These are generic installation instructions. The @code{configure} shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a @file{Makefile} in each directory of the package. It may also create one or more @file{.h} files containing system-dependent definitions. Finally, it creates a shell script @file{config.status} that you can run in the future to recreate the current configuration, a file @file{config.cache} that saves the results of its tests to speed up reconfiguring, and a file @file{config.log} containing compiler output (useful mainly for debugging @code{configure}). If you need to do unusual things to compile the package, please try to figure out how @code{configure} could check whether to do them, and mail diffs or instructions to the address given in the @file{README} so they can be considered for the next release. If at some point @file{config.cache} contains results you don't want to keep, you may remove or edit it. The file @file{configure.in} is used to create @file{configure} by a program called @code{autoconf}. You only need @file{configure.in} if you want to change it or regenerate @file{configure} using a newer version of @code{autoconf}. @noindent The simplest way to compile this package is: @enumerate @item @code{cd} to the directory containing the package's source code and type @samp{./configure} to configure the package for your system. If you're using @code{csh} on an old version of System V, you might need to type @samp{sh ./configure} instead to prevent @code{csh} from trying to execute @code{configure} itself. Running @code{configure} takes awhile. While running, it prints some messages telling which features it is checking for. @item Type @samp{make} to compile the package. @item Optionally, type @samp{make check} to run any self-tests that come with the package. @item Type @samp{make install} to install the programs and any data files and documentation. @item You can remove the program binaries and object files from the source code directory by typing @samp{make clean}. To also remove the files that @code{configure} created (so you can compile the package for a different kind of computer), type @samp{make distclean}. There is also a @samp{make maintainer-clean} target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. @end enumerate @c ------------------------------------------------------------------- @node Compilers and Options, Multiple Architectures, Basic Installation, Installation @section Compilers and Options Some systems require unusual options for compilation or linking that the @code{configure} script does not know about. You can give @code{configure} initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: @example CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure @end example @noindent Or on systems that have the @code{env} program, you can do it like this: @example env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure @end example @c ------------------------------------------------------------------- @node Multiple Architectures, Installation Names, Compilers and Options, Installation @section Compiling For Multiple Architectures You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of @code{make} that supports the @code{VPATH} variable, such as GNU @code{make}. @code{cd} to the directory where you want the object files and executables to go and run the @code{configure} script. @code{configure} automatically checks for the source code in the directory that @code{configure} is in and in @file{..}. If you have to use a @code{make} that does not supports the @code{VPATH} variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use @samp{make distclean} before reconfiguring for another architecture. @c ------------------------------------------------------------------- @node Installation Names, Optional Features, Multiple Architectures, Installation @section Installation Names By default, @samp{make install} will install the package's files in @file{/usr/local/bin}, @file{/usr/local/man}, etc. You can specify an installation prefix other than @file{/usr/local} by giving @code{configure} the option @samp{--prefix=@var{path}}. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give @code{configure} the option @samp{--exec-prefix=@var{path}}, the package will use @var{path} as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like @samp{--bindir=@var{path}} to specify different values for particular kinds of files. Run @samp{configure --help} for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving @code{configure} the option @samp{--program-prefix=@var{PREFIX}} or @samp{--program-suffix=@var{SUFFIX}}. @c ------------------------------------------------------------------- @node Optional Features, System Type, Installation Names, Installation @section Optional Features Some packages pay attention to @samp{--enable-@var{feature}} options to @code{configure}, where @var{feature} indicates an optional part of the package. They may also pay attention to @samp{--with-@var{package}} options, where @var{package} is something like @samp{gnu-as} or @samp{x} (for the X Window System). The @file{README} should mention any @samp{--enable-} and @samp{--with-} options that the package recognizes. For packages that use the X Window System, @code{configure} can usually find the X include and library files automatically, but if it doesn't, you can use the @code{configure} options @samp{--x-includes=@var{dir}} and @samp{--x-libraries=@var{dir}} to specify their locations. @c ------------------------------------------------------------------- @node System Type, Sharing Defaults, Optional Features, Installation @section Specifying the System Type There may be some features @code{configure} can not figure out automatically, but needs to determine by the type of host the package will run on. Usually @code{configure} can figure that out, but if it prints a message saying it can not guess the host type, give it the @samp{--host=@var{type}} option. @var{type} can either be a short name for the system type, such as @samp{sun4}, or a canonical name with three fields: @example @var{cpu}-@var{company}-@var{system} @end example @noindent See the file @file{config.sub} for the possible values of each field. If @file{config.sub} isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the @samp{--target=@var{type}} option to select the type of system they will produce code for and the @samp{--build=@var{type}} option to select the type of system on which you are compiling the package. @c ------------------------------------------------------------------- @node Sharing Defaults, Operation Controls, System Type, Installation @section Sharing Defaults If you want to set default values for @code{configure} scripts to share, you can create a site shell script called @file{config.site} that gives default values for variables like @code{CC}, @code{cache_file}, and @code{prefix}. @code{configure} looks for @file{@var{prefix}/share/config.site} if it exists, then @file{@var{prefix}/etc/config.site} if it exists. Or, you can set the @code{CONFIG_SITE} environment variable to the location of the site script. A warning: not all @code{configure} scripts look for a site script. @c ------------------------------------------------------------------- @node Operation Controls, Optional Feature List, Sharing Defaults, Installation @section Operation Controls @code{configure} recognizes the following options to control how it operates. @table @code @item --cache-file=@var{file} Use and save the results of the tests in @var{file} instead of @file{./config.cache}. Set @var{file} to @file{/dev/null} to disable caching, for debugging @code{configure}. @item --help Print a summary of the options to @code{configure}, and exit. @item --quiet @itemx --silent @itemx -q Do not print messages saying which checks are being made. @item --srcdir=@var{dir} Look for the package's source code in directory @var{dir}. Usually @code{configure} can determine that directory automatically. @item --version Print the version of Autoconf used to generate the @code{configure} script, and exit. @end table @c ------------------------------------------------------------------- @node Optional Feature List, , Operation Controls, Installation @section Optional Feature List @code{configure} in this package recognizes the following @samp{--enable-} and @samp{--with-} options. @table @code @item --with-logdir=@var{dir} Syslog files that @code{ebndaily} rotates by default are placed on @var{dir}. The default value is @samp{@var{localstatedir}/ebnetd/log}. @item --with-eb-conf=@var{file} Read EB Libfary configuration file in @var{file}. The default value is @samp{@var{sysconfdir}/eb.conf}. @item --with-gnu-ld Assume the C compiler uses GNU ld. The default value is @samp{no}. @item --enable-ipv6 Support IPv6. The default value is @samp{yes} if the system supports IPv6. @end table @c =================================================================== @node Configuration File, Configuration Checker, Installation, Top @chapter Configuration File To start @code{ebnetd}, @code{ndtpd} or @code{ebhttpd}, you have to edit a configuration file. The server reads the file when it starts and restarts. The file determines various server behaviors. The configuration file is @file{/usr/local/etc/ebnetd.conf} by default, if EBNETD has been installed under @file{/usr/local}, and if a directory for read-only single-machine data (@code{sysconfdir}) has not been changed at the installation. It can be changed by the command line option @samp{--configuration-file} (or @samp{-c}) (@pxref{ebnetd Options}). In the configuration file, blank lines and lines whose first non-blank character is a hash (@samp{#}) are ignored. Any other lines must be @dfn{single directive} or @dfn{group directive}. The order of single and group directives is not matter. Each line including newline character must be 511 characters maximum. @menu * Single Directive:: Common form of single directive. * Single Directive List:: Single directive list. * Group Directive:: Common form of group directive. * Book Group Directive:: Book group directive list. * Sample Configuration:: Sample configuration file. @end menu @c ------------------------------------------------------------------- @node Single Directive, Single Directive List, Configuration File, Configuration File @section Common Form of Single Directive Single directive is a directive terminated in a line. The common form of a single directive is: @example @var{directive-name} @var{directive-value} @end example @noindent In the following example, @code{syslog-facility} is a directive name, and @file{local0} is a directive value. @example syslog-facility local0 @end example @noindent Since directive names are case sensitive, you cannot type @samp{syslog-facility} instead of @samp{Syslog-Facility}. Spaces and tabs separate a directive name with a directive value. A sequence of spaces and tabs in the head of a directive name and in the tail of a line are ignored. @c ------------------------------------------------------------------- @node Single Directive List, Group Directive, Single Directive, Configuration File @section Single Directive List The following single directives are recognized. @table @code @item ebnet-port The @code{ebnet-port} directive specifies a port number which @code{ebnetd} binds. The value of the directive must be a service name on TCP (e.g. @samp{EBNET}) or a port number (e.g. @samp{22010}). The directive is ignored when @code{ebnetd} is invoked by @code{inetd}. The directive is optional, and cannot be defined more than once. The default value is @samp{EBNET}. @code{ndtpd} and @code{ebhttpd} always ignore the directive. @item ndtp-port The @code{ndtp-port} directive specifies a port number which @code{ndtpd} binds. The value of the directive must be a service name on TCP (e.g. @samp{NDTP}) or a port number (e.g. @samp{2010}). The directive is ignored when @code{ndtpd} is invoked by @code{inetd}. The directive is optional, and cannot be defined more than once. The default value is @samp{NDTP}. @code{ebnetd} and @code{ebhttpd} always ignore the directive. @item http-port The @code{http-port} directive specifies a port number which @code{ebhttpd} binds. The value of the directive must be a service name on TCP (e.g. @samp{HTTP}) or a port number (e.g. @samp{80}). The directive is ignored when @code{ebhttpd} is invoked by @code{inetd}. The directive is optional, and cannot be defined more than once. The default value is @samp{HTTP}. @code{ebnetd} and @code{ndtpd} always ignore the directive. @item user The @code{user} directive specifies an owner of server processes. The value of the directive must be an user name (e.g. @samp{nobody}) or an user ID (e.g. @samp{65535}). To change an owner to another user, you must start a server process with super user's privilege. If a server fails to change an owner, it gives up running. The directive is optional, and cannot be defined more than once. If the directive is not defined, owner is unchanged. We recommend you to create a dummy user account such as @samp{ebnetuser}, and use it for this directive. @item group The @code{group} directive specifies a group of server processes. The value of the directive must be an group name (e.g. @samp{nogroup}) or a group ID (e.g. @samp{65534}). The directive is optional, and cannot be defined more than once. If a server fails to change a group, it gives up running. If the directive is not defined, group ID is unchanged. We recommend you to create a dummy group account such as @samp{ebnetgrp}, and use it for this directive. @item max-clients The @code{max-clients} directive specifies how many clients can be connected to a server at the same time. The value of the directive must be an integer not less than zero. The directive is optional, and cannot be defined more than once. The default value is @samp{1}. If the value is set to @samp{0}, the limitation is disabled. @item hosts The @code{hosts} directive specifies which hosts can or cannot connect to the servers. The value of the directive must be a hostname, IP address or @var{address/netmask} pattern. In addition, you can insert a leading optional exclamation mark (@samp{!}) for each pattern. If the value of the directive starts with an exclamation mark, it means that hosts matched to the following IP address or hostsname are denied to connect to the servers. Otherwise, hosts matched to the value are permitted to connect to the servers. @sp 1 @example @group # permit to connect from `host.xxx.yyy.jp'. hosts host.xxx.yyy.jp # permit to connect from `127.0.0.1'. hosts 127.0.0.1 # deny to connect from `192.24.1.0/24. hosts !192.24.1.0/24 @end group @end example @noindent In a hostname pattern, you can use asterisk (@samp{*}) and question mark (@samp{?}). An asterisk matches to any sequence of zero or more characters except for a leading exclamation mark. @sp 1 @example @group # deny to connect hosts under the `xxx.yyy.jp' domain hosts !*.xxx.yyy.jp # permit to connect from any hosts. hosts * @end group @end example @noindent An question mark represents @dfn{unknown hostname}. @sp 1 @example @group # deny to connect from hosts with unknown hostname. hosts !? @end group @end example @noindent The @code{host} directive is optional, and can be defined any number of times. A configuration file without @code{host} directive is valid, but nobody can connect to the servers! Please note that only one hostname, IP address or @var{address/netmask} pattern can be defined in a directive. Hosts not matched to any @code{hosts} directives are denied to connect. When a host matches to two or more @code{hosts} directives, nearest one to the top of the configuration file is chosen. In the following example, hosts under the @samp{sub1.xxx.yyy.jp} domain are denied to connect, but any other hosts under the @samp{xxx.yyy.jp} domain are permitted to connect to the servers. @sp 1 @example @group hosts !*.sub1.xxx.yyy.jp hosts *.xxx.yyy.jp @end group @end example In this example, the order of the directives are significant. If the order is reversed, all hosts under the @samp{xxx.yyy.jp} domain including @samp{sub1.xxx.yyy.jp} are permitted to connect to the servers. @sp 1 @example @group # wrong!!! hosts *.xxx.yyy.jp hosts !*.sub1.xxx.yyy.jp @end group @end example In comprison of hostnames, @code{ndptd} always uses canonical hostname of a client, which is gotten by an address of the client with name resolution service such as DNS. Please note that aliases of the client is never used. Specifying IPv6 address and @var{IPv6 address/netmask} pattern are also permitted. The servers built without IPv6 support can talk to IPv4 clients only, but they can interpret IPv6 addresses specified in a configuration file. @sp 1 @example @group # permit to connect from `12ab:0:0:cd3::/60' and `::1'. hosts ::1 hosts 12ab:0:0:cd3::/60 @end group @end example @noindent In the @code{hosts} directive, IPv4 address (e.g. @samp{192.168.1.1}) and the corresponding IPv4 mapped IPv6 address (e.g. @samp{::ffff:192.168.1.1}) are eqeivalent. That is to say that IPv4 client @samp{192.168.1.1} matches to @code{hosts} directive @samp{::ffff:192.168.1.1}, and IPv6 client @samp{::ffff:192.168.1.1} matches to @code{hosts} directive @samp{192.168.1.1}. @item timeout The @code{timeout} directive specifies timeout seconds until a server disconnects an idle connection. The value of the directive must be an integer not less than zero. The directive is optional, and cannot be defined more than once. The default value is @samp{900} (15 minutes). If the value is set to @samp{0}, timeout never occurs. @item work-path The @code{work-path} directive specifies the path of a working directory for @code{ebnetd} (@pxref{Working Directory}). The value of the directive must be an absolute path. @code{ebnetd} creates some work files under the directory, and a core file is dumped at there when @code{ebnetd} aborts. The directive is optional, and cannot be defined more than once. The default value is @file{/usr/local/var/ebnetd}, if EBNETD has installed under @file{/usr/local}, and if a directory for modifiable single-machine data (@code{localstatedir}) has not been changed at the installation. @item max-hits The @code{max-hits} directive specifies how many hit entries @code{ebnetd} tries to find at a search. When @code{ebnetd} has find the number of hit entries specified by the directive, @code{ebnetd} stops searching immediately. The directive is optional, and cannot be defined more than once. The default value is @samp{50}. If it is set to @samp{0}, @code{ebnetd} tries to find all hit entires in a subbook. @code{ebnetd} always ignores the directive. @item max-text-size The @code{max-text-size} directive restricts the maximum bytes of text which @code{ebnetd} sends to a client as a response to him. The directive is optional, and cannot be defined more than once. The default value is @samp{32768}. If it is set to @samp{0}, the size restriction is disabled. @code{ebnetd} always ignores the directive. @item syslog-facility The @code{syslog-facility} directive specifies a syslog facility (e.g. @samp{daemon}, @samp{local0}, and so on). The directive is optional, and cannot be defined more than once. The facility @samp{daemon} is used by default. Please note that syslog facility @samp{daemon} is used until @code{ebnetd} finish reading a configuration file. @end table @c ------------------------------------------------------------------- @node Group Directive, Book Group Directive, Single Directive List, Configuration File @section Group Directive Group directive is a directive whose description is across some lines in a configuration file. The common form of a group directive is: @example @group begin @var{group-name} @var{sub-directive-name} @var{sub-directive-value} : : (repeated) : end @end group @end example @noindent The keyword @code{begin} indicates the beginning of the group directive. It leads an argument @var{group-name}. They are separated by spaces or tabs, and they must be placed in a line. The keyword @code{end} indicates the end of the group directive. It is solely placed at a line. In EBNETD version @value{VERSION}, only @code{book} can be prescribed as the group-name. Each @dfn{sub-directive} in the group is defined between @code{begin} and @code{end} lines. Generic description rules about sub-directive are the same as those of single directives; @var{sub-directive-name} and @var{sub-directive-value} are separated by space or tabs, and so on. This is an example of the @code{book} group directive. @example @group begin book name EJDICT title English Japanese Dictionary path /mnt/cdrom hosts 127.0.0.1 hosts host.your.domain end @end group @end example @c ------------------------------------------------------------------- @node Book Group Directive, Sample Configuration, Group Directive, Configuration File @section @code{book} Group directive A @code{book} group directive corresponds to a CD-ROM book, so that you have to define the group directive for each CD-ROM book. EBNETD recognizes following sub-directives in the @code{book} group directives. @table @code @item name The @code{name} sub-directive specifies a name of the book. The value of the sub-directive must consist of lower letters (@samp{a}..@samp{z}), digits (@samp{0}..@samp{9}), underscore (@samp{_}) and hypen (@samp{-}). Its length must be up to 14 bytes. Since the name is used to identify the book, each book name in a configuration file must be unique. The sub-directive is required in each @code{book} group directive, but cannot be defined more than once in a group directive. @item title The @code{title} sub-directive specifies a title of the book. The value of the sub-directive can be a sequences of any characters except for newline and NULL (@samp{\0}) character. Its length must be up to 80 bytes. The title must be written in ISO 8859 1 or Japanese EUC (Extended Unix Code). Spaces or tabs are also accepted and they are taken literally. The sub-directive is required in each @code{book} group directive, but cannot be defined more than once in a group directive. @item path The @code{path} sub-directive specifies an absolute path to the book. The path must point to the top directory of the book where the file @file{catalog} or @file{catalogs} resides. EBNET remote access identifier (e.g. @samp{ebnet://host/book}) is not allowed. The sub-directive is required in each @code{book} group directive, but cannot be defined more than once in a group directive. @item appendix-path The @code{appendix-path} sub-directive specifies an absolute path to the appendix data of the book (@pxref{Appendix Package}). The path must point to the top directory of the appendix package where the file @file{catalog} or @file{catalogs} resides. EBNET remote access identifier (e.g. @samp{ebnet://host/book.app}) is not allowed. The sub-directive is optional and cannot be defined more than once in a @code{book} group directive. To use a book, appendix package is not required, but a book without appendix package may be difficult for users to read since some characters are unreadable. @item max-clients The @code{max-clients} sub-directive specifies how many clients can be accessed to the book at the same time. The value of the directive must be an integer not less than zero. The directive is optional, and cannot be defined more than once in a @code{book} group directive. The default value is @samp{1}. If the value is set to @samp{0}, the limitation is disabled. Count of clients are shared by @code{ebnetd}, @code{ndtpd} and @code{ebhttpd}, if they use the same @code{work-path} (@pxref{Working Directory}). For example, if two @code{ebnetd} clients and three @code{ndtpd} clients access a book at the same time, the servers cosider the book is accessed by five clients. @item hosts The @code{hosts} sub-directive specifies which hosts can or cannot access the book. The sub-directive is optional, and can be defined any number of times. A @code{book} group directive without @code{hosts} sub-directive is valid, but nobody can access to the book! The notation is same as the @code{hosts} single directive. @end table @c -------------------------------------------------------------------- @node Sample Configuration, , Book Group Directive, Configuration File @section Sample Configuration File The sample configuration file has been installed as @file{/usr/local/etc/ebnetd.conf.sample}, if EBNETD has been installed under @file{/usr/local}, and if a directory for read-only single-machine data (@code{sysconfdir}) has not been changed at the installation. @example ###################################################################### # Configuration file for ebnetd/ndtpd/ebhttpd. # (Copy this file to `ebnetd.conf', and edit it.) ###################################################################### ### Port number `ebnetd' binds. ### (default: ebnet) # ebnet-port ebnet ### Port number `ndtpd' binds. ### (default: ndtp) # ndtp-port ndtp ### Port number `ebhttpd' binds. ### (default: http) # http-port http ### Owner of the server process. ### (default: none) user ebnetuser ### Group of the server process. ### (default: none) group ebnetgrp ### How many clients can be connected to the server at the same time. ### (default: 1) # max-clients 1 ### Which hosts can or cannot connect to the server. ### (default: none) hosts 127.0.0.1 hosts ::1 hosts !? hosts host.your.domain ### Timeout seconds until the server disconnects an idle connection. ### (default: 900) # timeout 900 ### Path to a working directory. ### Please create the directory and make it be writable for the server ### processes before executing the server. ### (default: /usr/local/var/ebnetd) # work-path /usr/local/var/ebnetd ### How many hit entries the server tries to find at a search. ### (default: 50) # max-hits 50 ### Maxmimum size of tex the server may send to a client as a response ### to him. ### (default: 32768) # max-text-size 32768 ### Syslog facility ### (default: daemon) syslog-facility local0 ### ### Book entry ### begin book ### Name of the book. ### (required) name JITENBAN97 ### Title of the book. ### (required) title Jitenban 97 ### Path to a top directory of the book. ### (required) path /cdrom ### Path to a top directory of the appdendix package of the book. ### (default: none) appendix-path /usr/local/share/eb/appendix/jitenban97-2.1 ### How many clients can access the book at the same time. ### (default: 1) # max-clients 1 ### Which hosts can or cannot access to the book. ### (default: none) hosts 127.0.0.1 hosts ::1 hosts !? hosts host.your.domain end ### Add a book group directive (lines between `begin book' and `end'), ### if you want to read another CD-ROM book. A book group directive ### is required for each book. @end example @c =================================================================== @node Configuration Checker, Setup Your Environment, Configuration File, Top @chapter Configuration Checker To check for the configuration file you have edit, you can use the configuration checker named @code{ebncheck}. The @code{ebncheck} command has been installed at @file{/usr/local/sbin}, if EBNETD has been installed under @file{/usr/local}, and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. Because of historical reason, also @code{ndtpcheck} and @code{ebhtcheck} commands are available for @code{ndtpd} and @code{ebhttpd}, but they has no differences. @menu * Invoking ebncheck:: Invoking @code{ebncheck}. * ebncheck Options:: Summary of options to @code{ebncheck}. @end menu @c ------------------------------------------------------------------- @node Invoking ebncheck, ebncheck Options, Configuration Checker, Configuration Checker @section Invoking @code{ebncheck} The @code{ebncheck} command reads and checks a configuration file as the same way as @code{ebnetd} does. The usual way to execute @code{ebncheck} is as follows: @example % /usr/local/sbin/ebncheck @end example @noindent It assumes that EBNETD has been installed under @file{/usr/local} and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. If an error occurs, @code{ebncheck} outputs messages to standard error like as follows. @example /usr/local/etc/ebnetd.conf:12: unknown user: noboy configuration failure @end example @c ------------------------------------------------------------------- @node ebncheck Options, , Invoking ebncheck, Configuration Checker @section Summary of options to @code{ebncheck} The @code{ebncheck} command supports both traditional single-letter options and mnemonic long option names. Long option names are indicated with @samp{--} instead of @samp{-}. Abbreviations for option names are allowed as long as they are unique. The @code{ebncheck} command recognizes these command line options. @table @code @item -c @var{file} @itemx --configuration-file @var{file} Specify a configuration file. The default filename is shown in the help message. @item -d @itemx --debug @itemx --verbose Print debugging information to standard error. Debugging information shows how each line in a configuration file is processed. @item -h @itemx --help Output help message to standard error, then exit. @item -v @itemx --version Output version number to standard error, then exit. @end table @c =================================================================== @node Setup Your Environment, Start ebnetd, Configuration Checker, Top @chapter Setup Your Environment You may have to setup system environment around the server. Super user's priviledge may be required to do it. @menu * Services:: Setup your @file{services} file. * Syslog:: Setup your @file{syslog.conf} file. * Working Directory:: Make a working directory. * Mount CD-ROM Books:: Mount your CD-ROM books. * Appendix Package:: Copy appendix package. @end menu @c ------------------------------------------------------------------- @node Services, Syslog, Setup Your Environment, Setup Your Environment @section @file{services} File The service names @samp{ebnet}, @samp{ndtp} and @samp{http} must be added to your @file{services} file (usually, @file{/etc/services}), if missing. If your host runs as NIS client, you have to edit the NIS map on the NIS server, instead. This lines shuold be added, if missing: @example http 80/tcp ndtp 2010/tcp ebnet 22010/tcp @end example @noindent The configuration file on your system may have had the line with a different service name, like that: @example search 2010/tcp @end example @noindent In this case, please add the service name as an alias: @example search 2010/tcp ebnet @end example @noindent (For details, please read the manual for your system.) @c ------------------------------------------------------------------- @node Syslog, Working Directory, Services, Setup Your Environment @section @file{syslog.conf} File @code{ebnetd}, @code{ndtpd} and @code{ebhttpd} use @code{syslog} to record their log messages. Insert a line like as below into the configuration file for @code{syslogd} (usually @file{/etc/syslog.conf}). Care must be taken not to use space to separete fields, because only TAB is allowed in general. @example local0.info /usr/local/var/ebnetd/log/ebnetd.log @end example @noindent Please remember that the syslog facility of the servers can be determined at the @code{syslog-facility} directive in the configuration file for @code{ebnetd} (@pxref{Single Directive List, , @code{syslog-facility}}). @noindent Create an empty log file if missing. @example @group % touch /usr/local/var/ebnetd/log/ebnetd.log % chmod 644 /usr/local/var/ebnetd/log/ebnetd.log @end group @end example @noindent Find the PID of the running @code{syslogd} process. In BSD based sytems, type the following. @example % ps axuww | grep syslogd @end example @noindent In SYSV based sytems, type the following. @example % ps -ef | grep syslogd @end example @noindent (For details, please read the manual for your system.) @* If @code{syslogd} is running, you can find a line like as below. @example root 63 0.0 1.1 188 316 ?? Is 10:04PM 0:00.16 syslogd @end example @noindent Send a hung-up signal (@code{SIGHUP}) to @code{syslogd}, and then @code{syslogd} re-reads @file{syslog.conf}. @example % kill -HUP 63 @end example @noindent If your system has the @code{logger} command, you can send a test message to @code{syslogd} like as follows: @example % logger -p local0.info "test message" @end example @c ------------------------------------------------------------------- @node Working Directory, Mount CD-ROM Books, Syslog, Setup Your Environment @section Working Directory @code{ebnetd}, @code{ndtpd} and @code{ebhttpd} create some files under a working directory. The directory can be specified by @code{work-path} in the configuration file (@pxref{Single Directive List, , @code{work-path}}). Please create the directory and make it be writable for the server processes and super user only. @example # mkdir /usr/local/var/ebnetd # chown ebnetuser /usr/local/var/ebnetd # chmod 755 /usr/local/var/ebnetd @end example @noindent It assumes that owner of server processes on your system is @samp{ebnetuser}. Please remember that owner and group of the server processes are defined at the @code{user} and @code{group} directives in the configuration file (@pxref{Single Directive List, , @code{user}}, and @pxref{Single Directive List, , @code{group}}). @c ------------------------------------------------------------------- @node Mount CD-ROM Books, Appendix Package, Working Directory, Setup Your Environment @section Mount Your CD-ROM Books As mentioned before, CD-ROM books themseves are stands on ISO 9660 format. You can mount your CD-ROM books by the same way as other ISO 9660 discs. Please read the manual for your system, if you don't know the way of mounting ISO 9660 discs on your system. The servers can access CD-ROM books compressed by @code{ebzip}. See @xref{Compression, , Compression, ebzip, ebzip}, for more details. @c ------------------------------------------------------------------- @node Appendix Package, , Mount CD-ROM Books, Setup Your Environment @section Setup Appendix Package @dfn{appendix} is supplementary data for CD-ROM book. It is not provided by publishers of CD-ROM Book. It is peculiar to EB Library. (Remember that all the servers in the EBNET distribution are related closely to EB Library. @code{ebnetd} is remote access server for EB Library. @code{ndtpd} and @code{ebhttpd} use EB Library to access CD-ROM Books.) Appendix provides the following data for CD-ROM book: @table @asis @item Text stop code When you look up a word in a CD-ROM dictionary using EB Library, you might wish EB Library stops displaying dictionary's text at the point where explanation of the word ends. Howerver, the software cannot ensure it, since CD-ROM book has no marker in its text which indicates end of paragraph. Fortunately, many CD-ROM books have a @dfn{text stop code} which could be used for substitute for end of paragraph. EB Library guesses text stop code automatically by default, but sometimes takes a false code. Appanedix's stop code is used to tell EB Library a correct stop code of the CD-ROM book. @item Alternation text for local defined characters Many CD-ROM books define their local characters, and use them in text. To display the local character, client applications have to draw its bitmap font provided by the CD-ROM book. Appendix can define alternation text for each local defined character. Instead of drawing the bitmap font, application may output the alternation text. @end table The layout of appendix package is similar to that of CD-ROM book. It has the @code{catalog} or @code{catalogs} file at its top directory, and data for each subbook are arranged in the corresponding sub-directory. To use an appendix, set the @code{appendix-path} sub-directive of the @code{book} group directive in a configuration file (@pxref{Group Directive, , @code{appendix-path}}). There are some appendix packages in the EB Library official FTP site (@url{ftp://ftp.sra.co.jp/pub/misc/eb/appendix/}). If you want to create an appendx package for a CD-ROM book not listed here, use the @code{ebappendix} command to format appendix data files. @c =================================================================== @node Start ebnetd, Start ndtpd, Setup Your Environment, Top @chapter Start @code{ebnetd} @code{ebnetd} can run as a standalone daemon, or as a child process of @code{inted}. By default, @code{ebnetd} runs as a standalone daemon. If connections aren't come frequently to the server, it may be better to run @code{ebnetd} as a child of @code{inetd} to save consumption of memory resource. However, each time invoked by @code{inetd}, @code{ebnetd} reads a configuration file and reads some data from CD-ROM books for initialization. If connections are come frequently to the server, it may be better to run @code{ebnetd} as a standalone daemon. If you don't have to run @code{ebnetd} on your system, skip rest of this chapter. @menu * ebnetd Standalone:: Run @code{ebnetd} as a standard daemon. * ebnetd Child of inetd:: Run @code{ebnetd} as a child of @code{inetd}. * ebnetd Child of xinetd:: Run @code{ebnetd} as a child of @code{xinetd}. * ebnetd Test with telnet:: Test @code{ebnetd} with @code{telnet}. * ebnetd Options:: Summary of options to @code{ebnetd}. @end menu @c ------------------------------------------------------------------- @node ebnetd Standalone, ebnetd Child of inetd, Start ebnetd, Start ebnetd @section Run @code{ebnetd} as a standard daemon To start @code{ebnetd} as a standalone daemon, type the following command. Super user's priviledge may be required. @example % /usr/local/sbin/ebnetd @end example @noindent It assumes that EBNETD has been installed under @file{/usr/local}, and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. @c ------------------------------------------------------------------- @node ebnetd Child of inetd, ebnetd Child of xinetd, ebnetd Standalone, Start ebnetd @section Run @code{ebnetd} as a child of @code{inetd}. To start @code{ebnetd} from @code{inetd}, following processes are needed. Add the following entry to the @file{inetd.conf} file (usually @file{/etc/inetd.conf}). Don't forget to add the @samp{--inetd} (or @samp{-i}) option. @example ebnet stream tcp nowait root /usr/local/sbin/ebnetd ebnetd --inetd @end example @noindent It assumes that EBNETD has been installed under @file{/usr/local} and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. Find the PID of the running @code{inetd} process. @example % ps axuww | grep inetd @end example @noindent (For details, please read the manual for your system.) @* If @code{inetd} is running, you can find a line like as below. @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd @end example @noindent If found, send a hung-up signal (@code{SIGHUP}) to @code{inetd} to re-read @file{inetd.conf}. Super user's priviledge may be required. @example % kill -HUP 79 @end example @c ------------------------------------------------------------------- @node ebnetd Child of xinetd, ebnetd Test with telnet, ebnetd Child of inetd, Start ebnetd @section Run @code{ebnetd} as a Child Proccess of @code{xinetd} Some Linux systems use @code{xinetd} instead of traditional @code{inetd}. The configuration file format of @code{xinetd} is different from that of traditional @code{inetd}. To start @code{ebnetd} from @code{xinetd}, following processes are needed. Add the following entry to the configuration file (usually @file{/etc/xinetd.d/ebnet}). Don't forget to specify the @samp{--inetd} (or @samp{-i}) option as @code{server_args}. @example @group # default: off # description: The ebnet server service ebnet @{ disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ebnetd server_args = --inetd log_on_failure += USERID @} @end group @end example @noindent It assumes that EBNETD has been installed under @file{/usr/local} and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. Find the PID of the running @code{xinetd} process. In BSD based sytems, type the following. @example % ps axuww | grep xinetd @end example @noindent In SYSV based sytems, type the following. @example % ps -ef | grep xinetd @end example @noindent (For details, please read the manual for your system.) @* If @code{xinetd} is running, you can find a line like as below. @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd @end example @noindent If found, send an USER2 signal (@code{SIGUSR2}) to @code{xinetd} to re-read the configuration. Super user's priviledge may be required. @example % kill -USR2 79 @end example @c ------------------------------------------------------------------- @node ebnetd Test with telnet, ebnetd Options, ebnetd Child of xinetd, Start ebnetd @section Test @code{ebnetd} with @code{telnet} When all the setup has been completed, try to connect to @code{ebnetd} with the @code{telnet} command. At first, type as follows. In this example, we try to connect to @code{ebnetd} on localhost. @example % telnet localhost ebnet @end example @noindent The following message is displayed if @code{ebnetd} accepts a connection. @example Connected to localhost. Escape character is '^]'. @end example @noindent Then, tpye @key{BOOKLIST} and @key{Enter}. @example BOOKLIST @end example @noindent If @code{ebnetd} is running correctly, it outputs a list of CD-ROM book names like this: @example !OK; book list follows chujiten kojien colloc colloc.app @end example @noindent To close the connection, type @key{QUIT} and @key{Enter}. @example QUIT Connection closed by foreign host. @end example @c ------------------------------------------------------------------- @node ebnetd Options, , ebnetd Test with telnet, Start ebnetd @section Summary of options to @code{ebnetd} @code{ebnetd} supports both traditional single-letter options and mnemonic long option names. Long option names are indicated with @samp{--} instead of @samp{-}. Abbreviations for option names are allowed as long as they are unique. @code{ebnetd} recognizes following command line options. @table @code @item -c @var{file} @itemx --configuration-file @var{file} Specify a configuration file read by @code{ebnetd}. The default filename is shown in the help message. @item -h @itemx --help Output help message to standard error, then exit. @item -i @itemx --inetd @code{inetd} mode. It must be specified when @code{ebnetd} is invoked by @code{inetd}. @item -t @itemx --test Test mode. The @code{ebnetd} process runs in foreground, and never forks. Requests to the server are input from standard in and responses to a client are output to srandard out. Standard in and out can be file descriptors associated with terminals. In addition, access permission is never checked, so that you can access all CD-ROM books defined in a configuration file. @item -v @itemx --version Output version number to standard error, then exit. @end table @c =================================================================== @node Start ndtpd, Start ebhttpd, Start ebnetd, Top @chapter Start @code{ndtpd} If you don't have to run @code{ndtpd} on your system, skip this chapter. Also @code{ndtpd} has two running mode, standalone daemon and child process of @code{inted}. By default, @code{ndtpd} runs as a standalone daemon. @menu * ndtpd Standalone:: Run @code{ndtpd} as a standard daemon. * ndtpd Child of inetd:: Run @code{ndtpd} as a child of @code{inetd}. * ndtpd Child of xinetd:: Run @code{ndtpd} as a child of @code{xinetd}. * ndtpd Test with telnet:: Test @code{ndtpd} with @code{telnet}. * ndtpd Options:: Options to @code{ndtpd}. @end menu @c ------------------------------------------------------------------- @node ndtpd Standalone, ndtpd Child of inetd, Start ndtpd, Start ndtpd @section Run @code{ndtpd} as a standard daemon To start @code{ndtpd} as a standalone daemon, type the following command. Super user's priviledge may be required. @example % /usr/local/sbin/ndtpd @end example @noindent It assumes that EBNETD has been installed under @file{/usr/local}, and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. @c ------------------------------------------------------------------- @node ndtpd Child of inetd, ndtpd Child of xinetd, ndtpd Standalone, Start ndtpd @section Run @code{ndtpd} as a child of @code{inetd} To start @code{ndtpd} from @code{inetd}, following processes are needed. Add the following entry to the @file{inetd.conf} file (usually @file{/etc/inetd.conf}). Don't forget to add the @samp{--inetd} (or @samp{-i}) option. @example ndtp stream tcp nowait root /usr/local/sbin/ndtpd ndtpd --inetd @end example @noindent It assumes that EBNETD has been installed under @file{/usr/local} and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. Find the PID of the running @code{inetd} process. @example % ps axuww | grep inetd @end example @noindent (For details, please read the manual for your system.) @* If @code{inetd} is running, you can find a line like as below. @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd @end example @noindent If found, send a hung-up signal (@code{SIGHUP}) to @code{inetd} to re-read @file{inetd.conf}. Super user's priviledge may be required. @example % kill -HUP 79 @end example @c ------------------------------------------------------------------- @node ndtpd Child of xinetd, ndtpd Test with telnet, ndtpd Child of inetd, Start ndtpd @section Run @code{ndtpd} as a child of @code{xinetd} Some Linux systems use @code{xinetd} instead of traditional @code{inetd}. The configuration file format of @code{xinetd} is different from that of traditional @code{inetd}. To start @code{ndtpd} from @code{xinetd}, following processes are needed. Add the following entry to the configuration file (usually @file{/etc/xinetd.d/ndtp}). Don't forget to specify the @samp{--inetd} (or @samp{-i}) option as @code{server_args}. @example @group # default: off # description: The ndtp server service ndtp @{ disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ndtpd server_args = --inetd log_on_failure += USERID @} @end group @end example @noindent It assumes that EBNETD has been installed under @file{/usr/local} and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. Find the PID of the running @code{xinetd} process. In BSD based sytems, type the following. @example % ps axuww | grep xinetd @end example @noindent In SYSV based sytems, type the following. @example % ps -ef | grep xinetd @end example @noindent (For details, please read the manual for your system.) @* If @code{xinetd} is running, you can find a line like as below. @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd @end example @noindent If found, send an USER2 signal (@code{SIGUSR2}) to @code{xinetd} to re-read the configuration. Super user's priviledge may be required. @example % kill -USR2 79 @end example @c ------------------------------------------------------------------- @node ndtpd Test with telnet, ndtpd Options, ndtpd Child of xinetd, Start ndtpd @section Test @code{ndtpd} with @code{telnet} When all the setup has been completed, try to connect to @code{ndtpd} with the @code{telnet} command. At first, type as follows. In this example, we try to connect to @code{ndtpd} on localhost. @example % telnet localhost ndtp @end example @noindent The following message is displayed if @code{ndtpd} accepts a connection. @example Connected to localhost. Escape character is '^]'. @end example @noindent Then, tpye @key{t} and @key{Enter}. If @code{ndtpd} is running correctly, it outputs a list of available CD-ROM books like this: @example t 1 Oxford Dictionary/Thesaurus edict/oxford 0 0 0 2 Quick Tour edict/quick 0 0 0 3 User's Guide edict/user 0 0 0 4 About This Disc edict/about 0 0 0 $* @end example @noindent To close the connection, type @key{Q} and @key{Enter}. @example Q Connection closed by foreign host. @end example @c ------------------------------------------------------------------- @node ndtpd Options, , ndtpd Test with telnet, Start ndtpd @section Options to @code{ndtpd} The command line usage of @code{ndtpd} is the same as that of @code{ebnetd}. See @pxref{ebnetd Options, , Summary of @code{ebnetd} options}, for more details. @c =================================================================== @node Start ebhttpd, Terminate and Restart, Start ndtpd, Top @chapter Start @code{ebhttpd} If you don't have to run @code{ebhttpd} on your system, skip this chapter. Also @code{ebhttpd} has two running mode, standalone daemon and child process of @code{inted}. By default, @code{ebhttpd} runs as a standalone daemon. @menu * ebhttpd Standalone:: Run @code{ebhttpd} as a standard daemon. * ebhttpd Child of inetd:: Run @code{ebhttpd} as a child of @code{inetd}. * ebhttpd Child of xinetd:: Run @code{ebhttpd} as a child of @code{xinetd}. * ebhttpd Test with telnet:: Test @code{ebhttpd} with @code{telnet}. * ebhttpd Options:: Options to @code{ebhttpd}. @end menu @c ------------------------------------------------------------------- @node ebhttpd Standalone, ebhttpd Child of inetd, Start ebhttpd, Start ebhttpd @section Run @code{ebhttpd} as a standard daemon To start @code{ebhttpd} as a standalone daemon, type the following command. Super user's priviledge may be required. @example % /usr/local/sbin/ebhttpd @end example @noindent It assumes that EBNETD has been installed under @file{/usr/local}, and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. @c ------------------------------------------------------------------- @node ebhttpd Child of inetd, ebhttpd Child of xinetd, ebhttpd Standalone, Start ebhttpd @section Run @code{ebhttpd} as a child of @code{inetd} To start @code{ebhttpd} from @code{inetd}, following processes are needed. Add the following entry to the @file{inetd.conf} file (usually @file{/etc/inetd.conf}). Don't forget to add the @samp{--inetd} (or @samp{-i}) option. @example http stream tcp nowait root /usr/local/sbin/ebhttpd ebhttpd --inetd @end example @noindent It assumes that EBNETD has been installed under @file{/usr/local} and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. Find the PID of the running @code{inetd} process. @example % ps axuww | grep inetd @end example @noindent (For details, please read the manual for your system.) @* If @code{inetd} is running, you can find a line like as below. @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd @end example @noindent If found, send a hung-up signal (@code{SIGHUP}) to @code{inetd} to re-read @file{inetd.conf}. Super user's priviledge may be required. @example % kill -HUP 79 @end example @c ------------------------------------------------------------------- @node ebhttpd Child of xinetd, ebhttpd Test with telnet, ebhttpd Child of inetd, Start ebhttpd @section Run @code{ebhttpd} as a child of @code{xinetd} Some Linux systems use @code{xinetd} instead of traditional @code{inetd}. The configuration file format of @code{xinetd} is different from that of traditional @code{inetd}. To start @code{ebhttpd} from @code{xinetd}, following processes are needed. Add the following entry to the configuration file (usually @file{/etc/xinetd.d/ndtp}). Don't forget to specify the @samp{--inetd} (or @samp{-i}) option as @code{server_args}. @example @group # default: off # description: The ndtp server service http @{ disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ebhttpd server_args = --inetd log_on_failure += USERID @} @end group @end example @noindent It assumes that EBNETD has been installed under @file{/usr/local} and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. Find the PID of the running @code{xinetd} process. In BSD based sytems, type the following. @example % ps axuww | grep xinetd @end example @noindent In SYSV based sytems, type the following. @example % ps -ef | grep xinetd @end example @noindent (For details, please read the manual for your system.) @* If @code{xinetd} is running, you can find a line like as below. @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd @end example @noindent If found, send an USER2 signal (@code{SIGUSR2}) to @code{xinetd} to re-read the configuration. Super user's priviledge may be required. @example % kill -USR2 79 @end example @c ------------------------------------------------------------------- @node ebhttpd Test with telnet, ebhttpd Options, ebhttpd Child of xinetd, Start ebhttpd @section Test @code{ebhttpd} with @code{telnet} When all the setup has been completed, try to connect to @code{ebhttpd} with the @code{telnet} command. At first, type as follows. In this example, we try to connect to @code{ebhttpd} on localhost. @example % telnet localhost http @end example @noindent The following message is displayed if @code{ebhttpd} accepts a connection. @example Connected to localhost. Escape character is '^]'. @end example @noindent Then, tpye a request like: @example GET / HTTP/1.0 @end example @noindent Note that the request consists of two lines and the second line is empty. If @code{ebhttpd} accepts the request, the following response will be shown. @example HTTP/1.1 200 Ok Date: Fri, 16 May 2003 13:11:12 GMT Server: ebHTTPD 0.0 Content-Type: text/html; charset="euc-jp" (snip) @end example @c ------------------------------------------------------------------- @node ebhttpd Options, , ebhttpd Test with telnet, Start ebhttpd @section Options to @code{ebhttpd} The command line usage of @code{ebhttpd} is the same as that of @code{ebnetd}. See @xref{ndtpd Options, , Summary of @code{ebnetd} options}, for more details. @c =================================================================== @node Terminate and Restart, Daily Works, Start ebhttpd, Top @chapter Terminate and Restart the Servers You can use the @code{ebncontrol} command to terminate, kill and restart the @code{ebnetd} precess running as a standalone daemon. @code{ebncontrol} has been installed at @file{/usr/local/sbin}, if EBNETD has been installed under @file{/usr/local}, and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. You can terminate the running @code{ebnetd} process like as follows: @example % /usr/local/sbin/ebncontrol terminate @end example @code{ebnetd} logs its PID to the file @file{ebnetd.pid} at the working directory (@pxref{Working Directory}). @code{ebncontrol} reads contents of the PID file to get a PID of the running @code{ebnetd} process, and then @code{ebncontrol} sends a signal to the PID. The PID file is deleted by @code{ebnetd} when it is terminated normally. However, the PID file is not deleted when @code{ebnetd} aborts. The PID logged in the remained PID file will be assigned to another process, in this case. Be careful invoking @code{ebncontrol}. @code{ebncontrol} doesn't examine whether the @code{ebnetd} process really exists. If the pid file is obsolete, @code{ebncontrol} may send a signal to another process. @code{ebncontrol} reads the configuration file for @code{ebnetd} in order to get a location of the working directory. It can be defined at the @code{work-path} single directive in the configuration file (@pxref{Single Directive List, , @code{work-path}}). The default filename of the configuration file and default value of the @code{work-path} single directive are the same as those of @code{ebnetd}. Also the @code{ndtpcontrol} and @code{ebhtcontrol} commands are available to terminate @code{ndtpd} and @code{ebhttpd}. Command line usage of @code{ndtpcontrol} and @code{ebhtcontrol} are the same as that of @code{ebncontrol}. @menu * Invoke Server Controler:: Invoke Server Control Commands * Server Controler Options:: Summary of Options to Server Control Commands @end menu @c ------------------------------------------------------------------- @node Invoke Server Controler, Server Controler Options, Terminate and Restart, Terminate and Restart @section Invoke Server Control Commands As described before, @code{ebncontrol}, @code{ndtpcontrol} and @code{ebhtcontrol} take the same command line arguments. The usual ways to invoke the commands are as follows: @example % /usr/local/sbin/ebncontrol @var{sub-command} % /usr/local/sbin/ndtpcontrol @var{sub-command} % /usr/local/sbin/ebhtcontrol @var{sub-command} @end example They recognize the following @var{sub-commands}. Abbreviations for sub-command names are allowed as long as they are unique. @table @code @item kill Kill the running server process (send the @code{SIGKILL} signal). It also deletes the server's PID file. Before trying the @code{kill} sub-command, you should try @code{terminate} sub-command. @item restart Restart the server. (send the @code{SIGHUP} signal). The server process closes all connections, and reads a configuration file again. @item status Examine whether the server is running or not, and output the result to standard error. This sub-command doesn't send any signal to the server. @item terminate Terminate the running server process (send the @code{SIGTERM} signal). @end table @c ------------------------------------------------------------------- @node Server Controler Options, , Invoke Server Controler, Terminate and Restart @section Summary of Options to Server Control Commands The @code{ebncontrol}, @code{ndtpcontrol} and @code{ebhtcontrol} commands support both traditional single-letter options and mnemonic long option names. Long option names are indicated with @samp{--} instead of @samp{-}. Abbreviations for option names are allowed as long as they are unique. @code{ebncontrol}, @code{ndtpcontrol} and @code{ebhtcontrol} recognize the command line options below. @table @code @item -c @var{file} @itemx --configuration-file @var{file} Specify a configuration file. The default filename is shown in the help message. @item -h @itemx --help Output help message to standard error, then exit. @item -v @itemx --version Output version number to standard error, then exit. @end table @c =================================================================== @node Daily Works, Network License, Terminate and Restart, Top @chapter Daily Administrative Works The @code{ebndaily} command generates statistics summary from a latest syslog file of the servers (@code{ebnetd}, @code{ndtpd} and @code{ebhttpd}), rotates syslog files, and then mails the results to administrators specified by command line arguments. @code{ebndaily} has been installed at @file{/usr/local/sbin}, if EBNETD has been installed under @file{/usr/local}, and if a directory for system administrative executables (@code{sbindir}) has not been changed at the installation. Its usual way to invoke @code{ebndaily} is as follows: @example % /usr/local/sbin/ebndaily @var{mail-address}... @end example @noindent For example, @example % /usr/local/sbin/ebndaily root@@host.your.domain @end example @noindent Two or more mail addresses can be accepted: @example % /usr/local/sbin/ebndaily root@@host.your.domain root@@dept.your.domain @end example @sp 1 To execute @code{ebndaily} once a day automatically, add an entry like as follows on your @file{crontab}. @example 0 0 * * * /usr/local/sbin/ebndaily root@@host.your.domain @end example @noindent (For details, please read the manual for your system.) @* By default, @code{ebndaily} keeps 7 ages of old syslog files. If the current syslog file is @file{/usr/local/var/ebnetd/log/ebnetd.log}, the old syslog files are kept as: @example /usr/local/var/ebnetd/log/ebnetd.log.0 /usr/local/var/ebnetd/log/ebnetd.log.1 /usr/local/var/ebnetd/log/ebnetd.log.2 /usr/local/var/ebnetd/log/ebnetd.log.3 /usr/local/var/ebnetd/log/ebnetd.log.4 /usr/local/var/ebnetd/log/ebnetd.log.5 /usr/local/var/ebnetd/log/ebnetd.log.6 @end example @noindent These syslog files are rotated by the following processes: @enumerate @item The eldest syslog file @file{ebnetd.log.6} is removed. @item Other @file{ebnetd.log.@var{n}} files are moved to @file{ebnetd.log.@var{n+1}}. @item The current syslog file @file{ebnetd.log} is copied to @file{ebnetd.log.0}. @item The current syslog file @file{ebnetd.log} is cleared. @end enumerate @menu * ebndaily Options:: Summary of options to @code{ebndaily}. @end menu @c ------------------------------------------------------------------- @node ebndaily Options, , Daily Works, Daily Works @section Summary of Options to @code{ebndaily} The @code{ebndaily} command supports both traditional single-letter options and mnemonic long option names. Long option names are indicated with @samp{--} instead of @samp{-}. Abbreviations for option names are allowed as long as they are unique. The @code{ebndaily} command recognizes following command line options. @table @code @item -a @var{integer} @itemx --ages @var{integer} Keep @var{integer} ages of old syslog files. The default value is @samp{7}. @item -c @var{compressor} @itemx --compressor @var{compressor} Specify a commpression program to compress old syslog files. The @var{compressor} must be @samp{compress}, @samp{gzip}, @samp{bzip2} or @samp{none}. The default value is @samp{none}. When @samp{compress} is specified or no @samp{--compressor} (@samp{-c}) option is specified, the @samp{compress} command is used for compression and the suffix @file{.Z} are added to the old syslog files. When @samp{gzip} is specified, the @code{gzip} command is used for compression and the suffix @file{.gz} are added to the old syslog files. When @samp{bzip2} is specified, the @code{bzip2} command is used for compression and the suffix @file{.bz2} are added to the old syslog files. When @samp{none} is specified, no compression program is used and no suffix is added to the old syslog files. @item -l @var{file} @itemx --log-file @var{file} Specify the current syslog file. @* The default value is @file{/usr/local/var/ebnetd/log/ebnetd.log}, if EBNETD has been installed under @file{/usr/local}, and if a directory for modifiable single-machine data (@code{localstatedir}) and a directory for log files (specified by @code{--with-logdir}) have not been changed at the installation. The default filename is shown in the help message. @item -h @itemx --help Output help message to standard error, then exit. @item -v @itemx --version Output version number to standard error, then exit. @item -@var{n} @itemx --fast @itemx --best These options are passed to @code{gzip} and @code{bzip2} (@pxref{Invoking gzip, , Invoking @code{gzip}, gzip, Gzip User's Manual}, for more details). If neither @code{gzip} nor @code{bzip2} is used, these options are merely ignored. @end table @c =================================================================== @node Network License, , Daily Works, Top @chapter Network License Some CD-ROM book publishers optionally provide network license. It allows multiple users on your LAN to access the book. The license may limit the maximum number of users accessing to the book at the same time (since the contents of network license is various, please contact publishers of your book for more details). In the configuration file (usually @code{ebnetd.conf}), there are two @code{max-clients} parameters. One is single directive (@pxref{Single Directive List, ,@code{max-clients}}), and another is sub-directive in the @code{book} (@pxref{Book Group Directive, , @code{max-clients}}). group directive. Both limits the maximum number of clients. They help follow the the network license, but they are not perfect. The book should be readable to an user only while his client connects to a server, but neither server or client doesn't check connection status frequently. For example, server closes the connection when idle timeout occurs. However, client keeps displaying contents of the CD-ROM book until user requests another contents. Setting @code{max-clients} for network license is still a good idea. It is important that you don't overestimate the abilities of @code{max-clients}. @c ------------------------------------------------------------------- @contents @bye ebnetd-1.0.dfsg.1/doc/ebnetd.info0000644000175000017500000000536707773515126016125 0ustar mhattamhattaThis is ./ebnetd.info, produced by makeinfo version 4.2 from ./ebnetd.texi. INFO-DIR-SECTION CD-ROM Book Utilities START-INFO-DIR-ENTRY * EBNETD: (ebnetd). Network EB Library server. * NDTPD: (ndtpd). Server for accessing CD-ROM books with NDTP. * ebHTTPD: (ebhttpd). Server for accessing CD-ROM books with HTTP. END-INFO-DIR-ENTRY EBNETD/NDTPD/ebHTTPD: CD-ROM Book Servers, by Motoyuki Kasahara. Copyright (C) 1997, 98, 99, 2000, 01, 03 Motoyuki Kasahara Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Free Software Foundation, Inc.  Indirect: ebnetd.info-1: 1178 ebnetd.info-2: 50283  Tag Table: (Indirect) Node: Top1178 Node: Introduction4690 Node: Installation7357 Node: Basic Installation8395 Node: Compilers and Options10988 Node: Multiple Architectures11629 Node: Installation Names12607 Node: Optional Features13783 Node: System Type14545 Node: Sharing Defaults15559 Node: Operation Controls16175 Node: Optional Feature List17006 Node: Configuration File17691 Node: Single Directive18981 Node: Single Directive List19724 Node: Group Directive28198 Node: Book Group Directive29555 Node: Sample Configuration33015 Node: Configuration Checker36201 Node: Invoking ebncheck36976 Node: ebncheck Options37675 Node: Setup Your Environment38593 Node: Services39171 Node: Syslog39952 Node: Working Directory41423 Node: Mount CD-ROM Books42296 Node: Appendix Package42861 Node: Start ebnetd45103 Node: ebnetd Standalone46181 Node: ebnetd Child of inetd46687 Node: ebnetd Child of xinetd47751 Node: ebnetd Test with telnet49427 Node: ebnetd Options50283 Node: Start ndtpd51528 Node: ndtpd Standalone52183 Node: ndtpd Child of inetd52681 Node: ndtpd Child of xinetd53733 Node: ndtpd Test with telnet55381 Node: ndtpd Options56392 Node: Start ebhttpd56668 Node: ebhttpd Standalone57352 Node: ebhttpd Child of inetd57867 Node: ebhttpd Child of xinetd58936 Node: ebhttpd Test with telnet60599 Node: ebhttpd Options61576 Node: Terminate and Restart61862 Node: Invoke Server Controler63865 Node: Server Controler Options65114 Node: Daily Works65960 Node: ebndaily Options67940 Node: Network License70105  End Tag Table ebnetd-1.0.dfsg.1/doc/ebnetd.info-10000644000175000017500000014215307773515126016256 0ustar mhattamhattaThis is ./ebnetd.info, produced by makeinfo version 4.2 from ./ebnetd.texi. INFO-DIR-SECTION CD-ROM Book Utilities START-INFO-DIR-ENTRY * EBNETD: (ebnetd). Network EB Library server. * NDTPD: (ndtpd). Server for accessing CD-ROM books with NDTP. * ebHTTPD: (ebhttpd). Server for accessing CD-ROM books with HTTP. END-INFO-DIR-ENTRY EBNETD/NDTPD/ebHTTPD: CD-ROM Book Servers, by Motoyuki Kasahara. Copyright (C) 1997, 98, 99, 2000, 01, 03 Motoyuki Kasahara Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Free Software Foundation, Inc.  File: ebnetd.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) This is edition 1.0, for EBNETD version 1.0. * Menu: * Introduction:: Introduction. * Installation:: Installation of NDTPD. * Configuration File:: How to write a configuration file. * Configuration Checker:: How to check a configuration file. * Setup Your Environment:: Setup your environment. * Start ebnetd:: Start `ebnetd'. * Start ndtpd:: Start `ndtpd'. * Start ebhttpd:: Start `ebhttpd'. * Terminate and Restart:: How to terminate and restart `ebnetd'. * Daily Works:: Daily administrative works. * Network License:: Network License. --- The Detailed Node Listing --- Installation of EBNETD * Basic Installation:: Basic installation. * Compilers and Options:: Choose compilers and its options. * Multiple Architectures:: Compile EBNETD on multiple Architectures. * Installation Names:: Change installation Names. * Optional Features:: Selecting optional features. * System Type:: Specifying the system type. * Sharing Defaults:: Set default values for `configure' scripts to share. * Operation Controls:: Control `configure' operation. * Optional Feature List:: Optional features this package supports. Configuration File * Single Directive:: Common form of single directive. * Single Directive List:: Single directive list. * Group Directive:: Common form of group directive. * Book Group Directive:: Book group directive list. * Sample Configuration:: Sample configuration file. Configuration Checker * Invoking ebncheck:: Invoking `ebncheck'. * ebncheck Options:: Summary of options to `ebncheck'. Setup Your Environment * Services:: Setup your `services' file. * Syslog:: Setup your `syslog.conf' file. * Working Directory:: Make a working directory. * Mount CD-ROM Books:: Mount your CD-ROM books. * Appendix Package:: Copy appendix package. Start `ebnetd' * ebnetd Standalone:: Run `ebnetd' as a standard daemon. * ebnetd Child of inetd:: Run `ebnetd' as a child of `inetd'. * ebnetd Child of xinetd:: Run `ebnetd' as a child of `xinetd'. * ebnetd Test with telnet:: Test `ebnetd' with `telnet'. * ebnetd Options:: Summary of options to `ebnetd'. Start `ndtpd' * ndtpd Standalone:: Run `ndtpd' as a standard daemon. * ndtpd Child of inetd:: Run `ndtpd' as a child of `inetd'. * ndtpd Child of xinetd:: Run `ndtpd' as a child of `xinetd'. * ndtpd Test with telnet:: Test `ndtpd' with `telnet'. * ndtpd Options:: Options to `ndtpd'. Start `ebhttpd' * ebhttpd Standalone:: Run `ebhttpd' as a standard daemon. * ebhttpd Child of inetd:: Run `ebhttpd' as a child of `inetd'. * ebhttpd Child of xinetd:: Run `ebhttpd' as a child of `xinetd'. * ebhttpd Test with telnet:: Test `ebhttpd' with `telnet'. * ebhttpd Options:: Options to `ebhttpd'. Terminate and Restart the Servers * Invoke Server Controler:: Invoke Server Control Commands * Server Controler Options:: Summary of Options to Server Control Commands Daily Administrative Works * ebndaily Options:: Summary of options to `ebndaily'.  File: ebnetd.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top Introduction ************ This EBNETD distribution contains three server commands: `ebnetd', `ndtpd' and `ebhttpd'. They are servers for accessing CD-ROM book on remote host via TCP/IP. They can run on UNIX derived systems. `ebnetd' `ebnetd' is a server of EBNET protocol which is designed to communicate with "EB Library". EB Library is a C library for accessing CD-ROM book. Also `ndtpd' and `ebhttpd' use EB Library. Using `ebnetd', EB Library applications can access CD-ROM books on a remote server. For more details about EB Library, see . `ndtpd' `ndtpd' is an NDTP (Network Dictionary Transfer Protocol) server. The first implementation of the NDTP server is "dserver". `ndtpd' has upper compatibility with dserver-2.2. The web page lists NDTP clients which can talk with `ndtpd'. `ebhttpd' `ebhttpd' is a WWW (World Wide Web) server. It supprts HTTP/1.0 and HTTP/1.1 (Hypertext Transfer Protocol version 1.0 and 1.1). The servers support CD-ROM books of EB, EBG, EBXA, EBXA-C, S-EBXA and EPWING formats. CD-ROM books of those formats are popular in Japan. Since CD-ROM books themseves are stands on the ISO 9660 format, you can mount the discs by the same way as other ISO 9660 discs. The servers can run as a standalone daemons by default, but can also run as children of `inetd'. EBNETD 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, or (at your option) any later version. EBNETD 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. In addition, you must follow the licenses of your CD-ROM books. Though EBNETD is free software, your books may not be free. Don't open your books to unlicensed hosts nor users. In addition, you must follow the licenses of your CD-ROM books. EBNETD is free software, your books may not be free. Don't open your books to unlicensed hosts nor users. This edition corresponds to version 1.0 of EBNETD. You can get the latest EBNETD from . You can get information about EBNETD from . Mail comments and bug reports to in Japanese or English.  File: ebnetd.info, Node: Installation, Next: Configuration File, Prev: Introduction, Up: Top Installation of EBNETD ********************** Before installing EBNETD, you need to install EB Library 3.3 or later version. You can get the latest EB Library from . You can get information about EB Library from . * Menu: * Basic Installation:: Basic installation. * Compilers and Options:: Choose compilers and its options. * Multiple Architectures:: Compile EBNETD on multiple Architectures. * Installation Names:: Change installation Names. * Optional Features:: Selecting optional features. * System Type:: Specifying the system type. * Sharing Defaults:: Set default values for `configure' scripts to share. * Operation Controls:: Control `configure' operation. * Optional Feature List:: Optional features this package supports.  File: ebnetd.info, Node: Basic Installation, Next: Compilers and Options, Prev: Installation, Up: Installation Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution.  File: ebnetd.info, Node: Compilers and Options, Next: Multiple Architectures, Prev: Basic Installation, Up: Installation Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure  File: ebnetd.info, Node: Multiple Architectures, Next: Installation Names, Prev: Compilers and Options, Up: Installation Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture.  File: ebnetd.info, Node: Installation Names, Next: Optional Features, Prev: Multiple Architectures, Up: Installation Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.  File: ebnetd.info, Node: Optional Features, Next: System Type, Prev: Installation Names, Up: Installation Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations.  File: ebnetd.info, Node: System Type, Next: Sharing Defaults, Prev: Optional Features, Up: Installation Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package.  File: ebnetd.info, Node: Sharing Defaults, Next: Operation Controls, Prev: System Type, Up: Installation Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script.  File: ebnetd.info, Node: Operation Controls, Next: Optional Feature List, Prev: Sharing Defaults, Up: Installation Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit.  File: ebnetd.info, Node: Optional Feature List, Prev: Operation Controls, Up: Installation Optional Feature List ===================== `configure' in this package recognizes the following `--enable-' and `--with-' options. `--with-logdir=DIR' Syslog files that `ebndaily' rotates by default are placed on DIR. The default value is `LOCALSTATEDIR/ebnetd/log'. `--with-eb-conf=FILE' Read EB Libfary configuration file in FILE. The default value is `SYSCONFDIR/eb.conf'. `--with-gnu-ld' Assume the C compiler uses GNU ld. The default value is `no'. `--enable-ipv6' Support IPv6. The default value is `yes' if the system supports IPv6.  File: ebnetd.info, Node: Configuration File, Next: Configuration Checker, Prev: Installation, Up: Top Configuration File ****************** To start `ebnetd', `ndtpd' or `ebhttpd', you have to edit a configuration file. The server reads the file when it starts and restarts. The file determines various server behaviors. The configuration file is `/usr/local/etc/ebnetd.conf' by default, if EBNETD has been installed under `/usr/local', and if a directory for read-only single-machine data (`sysconfdir') has not been changed at the installation. It can be changed by the command line option `--configuration-file' (or `-c') (*note ebnetd Options::). In the configuration file, blank lines and lines whose first non-blank character is a hash (`#') are ignored. Any other lines must be "single directive" or "group directive". The order of single and group directives is not matter. Each line including newline character must be 511 characters maximum. * Menu: * Single Directive:: Common form of single directive. * Single Directive List:: Single directive list. * Group Directive:: Common form of group directive. * Book Group Directive:: Book group directive list. * Sample Configuration:: Sample configuration file.  File: ebnetd.info, Node: Single Directive, Next: Single Directive List, Prev: Configuration File, Up: Configuration File Common Form of Single Directive =============================== Single directive is a directive terminated in a line. The common form of a single directive is: DIRECTIVE-NAME DIRECTIVE-VALUE In the following example, `syslog-facility' is a directive name, and `local0' is a directive value. syslog-facility local0 Since directive names are case sensitive, you cannot type `syslog-facility' instead of `Syslog-Facility'. Spaces and tabs separate a directive name with a directive value. A sequence of spaces and tabs in the head of a directive name and in the tail of a line are ignored.  File: ebnetd.info, Node: Single Directive List, Next: Group Directive, Prev: Single Directive, Up: Configuration File Single Directive List ===================== The following single directives are recognized. `ebnet-port' The `ebnet-port' directive specifies a port number which `ebnetd' binds. The value of the directive must be a service name on TCP (e.g. `EBNET') or a port number (e.g. `22010'). The directive is ignored when `ebnetd' is invoked by `inetd'. The directive is optional, and cannot be defined more than once. The default value is `EBNET'. `ndtpd' and `ebhttpd' always ignore the directive. `ndtp-port' The `ndtp-port' directive specifies a port number which `ndtpd' binds. The value of the directive must be a service name on TCP (e.g. `NDTP') or a port number (e.g. `2010'). The directive is ignored when `ndtpd' is invoked by `inetd'. The directive is optional, and cannot be defined more than once. The default value is `NDTP'. `ebnetd' and `ebhttpd' always ignore the directive. `http-port' The `http-port' directive specifies a port number which `ebhttpd' binds. The value of the directive must be a service name on TCP (e.g. `HTTP') or a port number (e.g. `80'). The directive is ignored when `ebhttpd' is invoked by `inetd'. The directive is optional, and cannot be defined more than once. The default value is `HTTP'. `ebnetd' and `ndtpd' always ignore the directive. `user' The `user' directive specifies an owner of server processes. The value of the directive must be an user name (e.g. `nobody') or an user ID (e.g. `65535'). To change an owner to another user, you must start a server process with super user's privilege. If a server fails to change an owner, it gives up running. The directive is optional, and cannot be defined more than once. If the directive is not defined, owner is unchanged. We recommend you to create a dummy user account such as `ebnetuser', and use it for this directive. `group' The `group' directive specifies a group of server processes. The value of the directive must be an group name (e.g. `nogroup') or a group ID (e.g. `65534'). The directive is optional, and cannot be defined more than once. If a server fails to change a group, it gives up running. If the directive is not defined, group ID is unchanged. We recommend you to create a dummy group account such as `ebnetgrp', and use it for this directive. `max-clients' The `max-clients' directive specifies how many clients can be connected to a server at the same time. The value of the directive must be an integer not less than zero. The directive is optional, and cannot be defined more than once. The default value is `1'. If the value is set to `0', the limitation is disabled. `hosts' The `hosts' directive specifies which hosts can or cannot connect to the servers. The value of the directive must be a hostname, IP address or ADDRESS/NETMASK pattern. In addition, you can insert a leading optional exclamation mark (`!') for each pattern. If the value of the directive starts with an exclamation mark, it means that hosts matched to the following IP address or hostsname are denied to connect to the servers. Otherwise, hosts matched to the value are permitted to connect to the servers. # permit to connect from `host.xxx.yyy.jp'. hosts host.xxx.yyy.jp # permit to connect from `127.0.0.1'. hosts 127.0.0.1 # deny to connect from `192.24.1.0/24. hosts !192.24.1.0/24 In a hostname pattern, you can use asterisk (`*') and question mark (`?'). An asterisk matches to any sequence of zero or more characters except for a leading exclamation mark. # deny to connect hosts under the `xxx.yyy.jp' domain hosts !*.xxx.yyy.jp # permit to connect from any hosts. hosts * An question mark represents "unknown hostname". # deny to connect from hosts with unknown hostname. hosts !? The `host' directive is optional, and can be defined any number of times. A configuration file without `host' directive is valid, but nobody can connect to the servers! Please note that only one hostname, IP address or ADDRESS/NETMASK pattern can be defined in a directive. Hosts not matched to any `hosts' directives are denied to connect. When a host matches to two or more `hosts' directives, nearest one to the top of the configuration file is chosen. In the following example, hosts under the `sub1.xxx.yyy.jp' domain are denied to connect, but any other hosts under the `xxx.yyy.jp' domain are permitted to connect to the servers. hosts !*.sub1.xxx.yyy.jp hosts *.xxx.yyy.jp In this example, the order of the directives are significant. If the order is reversed, all hosts under the `xxx.yyy.jp' domain including `sub1.xxx.yyy.jp' are permitted to connect to the servers. # wrong!!! hosts *.xxx.yyy.jp hosts !*.sub1.xxx.yyy.jp In comprison of hostnames, `ndptd' always uses canonical hostname of a client, which is gotten by an address of the client with name resolution service such as DNS. Please note that aliases of the client is never used. Specifying IPv6 address and IPV6 ADDRESS/NETMASK pattern are also permitted. The servers built without IPv6 support can talk to IPv4 clients only, but they can interpret IPv6 addresses specified in a configuration file. # permit to connect from `12ab:0:0:cd3::/60' and `::1'. hosts ::1 hosts 12ab:0:0:cd3::/60 In the `hosts' directive, IPv4 address (e.g. `192.168.1.1') and the corresponding IPv4 mapped IPv6 address (e.g. `::ffff:192.168.1.1') are eqeivalent. That is to say that IPv4 client `192.168.1.1' matches to `hosts' directive `::ffff:192.168.1.1', and IPv6 client `::ffff:192.168.1.1' matches to `hosts' directive `192.168.1.1'. `timeout' The `timeout' directive specifies timeout seconds until a server disconnects an idle connection. The value of the directive must be an integer not less than zero. The directive is optional, and cannot be defined more than once. The default value is `900' (15 minutes). If the value is set to `0', timeout never occurs. `work-path' The `work-path' directive specifies the path of a working directory for `ebnetd' (*note Working Directory::). The value of the directive must be an absolute path. `ebnetd' creates some work files under the directory, and a core file is dumped at there when `ebnetd' aborts. The directive is optional, and cannot be defined more than once. The default value is `/usr/local/var/ebnetd', if EBNETD has installed under `/usr/local', and if a directory for modifiable single-machine data (`localstatedir') has not been changed at the installation. `max-hits' The `max-hits' directive specifies how many hit entries `ebnetd' tries to find at a search. When `ebnetd' has find the number of hit entries specified by the directive, `ebnetd' stops searching immediately. The directive is optional, and cannot be defined more than once. The default value is `50'. If it is set to `0', `ebnetd' tries to find all hit entires in a subbook. `ebnetd' always ignores the directive. `max-text-size' The `max-text-size' directive restricts the maximum bytes of text which `ebnetd' sends to a client as a response to him. The directive is optional, and cannot be defined more than once. The default value is `32768'. If it is set to `0', the size restriction is disabled. `ebnetd' always ignores the directive. `syslog-facility' The `syslog-facility' directive specifies a syslog facility (e.g. `daemon', `local0', and so on). The directive is optional, and cannot be defined more than once. The facility `daemon' is used by default. Please note that syslog facility `daemon' is used until `ebnetd' finish reading a configuration file.  File: ebnetd.info, Node: Group Directive, Next: Book Group Directive, Prev: Single Directive List, Up: Configuration File Group Directive =============== Group directive is a directive whose description is across some lines in a configuration file. The common form of a group directive is: begin GROUP-NAME SUB-DIRECTIVE-NAME SUB-DIRECTIVE-VALUE : : (repeated) : end The keyword `begin' indicates the beginning of the group directive. It leads an argument GROUP-NAME. They are separated by spaces or tabs, and they must be placed in a line. The keyword `end' indicates the end of the group directive. It is solely placed at a line. In EBNETD version 1.0, only `book' can be prescribed as the group-name. Each "sub-directive" in the group is defined between `begin' and `end' lines. Generic description rules about sub-directive are the same as those of single directives; SUB-DIRECTIVE-NAME and SUB-DIRECTIVE-VALUE are separated by space or tabs, and so on. This is an example of the `book' group directive. begin book name EJDICT title English Japanese Dictionary path /mnt/cdrom hosts 127.0.0.1 hosts host.your.domain end  File: ebnetd.info, Node: Book Group Directive, Next: Sample Configuration, Prev: Group Directive, Up: Configuration File `book' Group directive ====================== A `book' group directive corresponds to a CD-ROM book, so that you have to define the group directive for each CD-ROM book. EBNETD recognizes following sub-directives in the `book' group directives. `name' The `name' sub-directive specifies a name of the book. The value of the sub-directive must consist of lower letters (`a'..`z'), digits (`0'..`9'), underscore (`_') and hypen (`-'). Its length must be up to 14 bytes. Since the name is used to identify the book, each book name in a configuration file must be unique. The sub-directive is required in each `book' group directive, but cannot be defined more than once in a group directive. `title' The `title' sub-directive specifies a title of the book. The value of the sub-directive can be a sequences of any characters except for newline and NULL (`\0') character. Its length must be up to 80 bytes. The title must be written in ISO 8859 1 or Japanese EUC (Extended Unix Code). Spaces or tabs are also accepted and they are taken literally. The sub-directive is required in each `book' group directive, but cannot be defined more than once in a group directive. `path' The `path' sub-directive specifies an absolute path to the book. The path must point to the top directory of the book where the file `catalog' or `catalogs' resides. EBNET remote access identifier (e.g. `ebnet://host/book') is not allowed. The sub-directive is required in each `book' group directive, but cannot be defined more than once in a group directive. `appendix-path' The `appendix-path' sub-directive specifies an absolute path to the appendix data of the book (*note Appendix Package::). The path must point to the top directory of the appendix package where the file `catalog' or `catalogs' resides. EBNET remote access identifier (e.g. `ebnet://host/book.app') is not allowed. The sub-directive is optional and cannot be defined more than once in a `book' group directive. To use a book, appendix package is not required, but a book without appendix package may be difficult for users to read since some characters are unreadable. `max-clients' The `max-clients' sub-directive specifies how many clients can be accessed to the book at the same time. The value of the directive must be an integer not less than zero. The directive is optional, and cannot be defined more than once in a `book' group directive. The default value is `1'. If the value is set to `0', the limitation is disabled. Count of clients are shared by `ebnetd', `ndtpd' and `ebhttpd', if they use the same `work-path' (*note Working Directory::). For example, if two `ebnetd' clients and three `ndtpd' clients access a book at the same time, the servers cosider the book is accessed by five clients. `hosts' The `hosts' sub-directive specifies which hosts can or cannot access the book. The sub-directive is optional, and can be defined any number of times. A `book' group directive without `hosts' sub-directive is valid, but nobody can access to the book! The notation is same as the `hosts' single directive.  File: ebnetd.info, Node: Sample Configuration, Prev: Book Group Directive, Up: Configuration File Sample Configuration File ========================= The sample configuration file has been installed as `/usr/local/etc/ebnetd.conf.sample', if EBNETD has been installed under `/usr/local', and if a directory for read-only single-machine data (`sysconfdir') has not been changed at the installation. ###################################################################### # Configuration file for ebnetd/ndtpd/ebhttpd. # (Copy this file to `ebnetd.conf', and edit it.) ###################################################################### ### Port number `ebnetd' binds. ### (default: ebnet) # ebnet-port ebnet ### Port number `ndtpd' binds. ### (default: ndtp) # ndtp-port ndtp ### Port number `ebhttpd' binds. ### (default: http) # http-port http ### Owner of the server process. ### (default: none) user ebnetuser ### Group of the server process. ### (default: none) group ebnetgrp ### How many clients can be connected to the server at the same time. ### (default: 1) # max-clients 1 ### Which hosts can or cannot connect to the server. ### (default: none) hosts 127.0.0.1 hosts ::1 hosts !? hosts host.your.domain ### Timeout seconds until the server disconnects an idle connection. ### (default: 900) # timeout 900 ### Path to a working directory. ### Please create the directory and make it be writable for the server ### processes before executing the server. ### (default: /usr/local/var/ebnetd) # work-path /usr/local/var/ebnetd ### How many hit entries the server tries to find at a search. ### (default: 50) # max-hits 50 ### Maxmimum size of tex the server may send to a client as a response ### to him. ### (default: 32768) # max-text-size 32768 ### Syslog facility ### (default: daemon) syslog-facility local0 ### ### Book entry ### begin book ### Name of the book. ### (required) name JITENBAN97 ### Title of the book. ### (required) title Jitenban 97 ### Path to a top directory of the book. ### (required) path /cdrom ### Path to a top directory of the appdendix package of the book. ### (default: none) appendix-path /usr/local/share/eb/appendix/jitenban97-2.1 ### How many clients can access the book at the same time. ### (default: 1) # max-clients 1 ### Which hosts can or cannot access to the book. ### (default: none) hosts 127.0.0.1 hosts ::1 hosts !? hosts host.your.domain end ### Add a book group directive (lines between `begin book' and `end'), ### if you want to read another CD-ROM book. A book group directive ### is required for each book.  File: ebnetd.info, Node: Configuration Checker, Next: Setup Your Environment, Prev: Configuration File, Up: Top Configuration Checker ********************* To check for the configuration file you have edit, you can use the configuration checker named `ebncheck'. The `ebncheck' command has been installed at `/usr/local/sbin', if EBNETD has been installed under `/usr/local', and if a directory for system administrative executables (`sbindir') has not been changed at the installation. Because of historical reason, also `ndtpcheck' and `ebhtcheck' commands are available for `ndtpd' and `ebhttpd', but they has no differences. * Menu: * Invoking ebncheck:: Invoking `ebncheck'. * ebncheck Options:: Summary of options to `ebncheck'.  File: ebnetd.info, Node: Invoking ebncheck, Next: ebncheck Options, Prev: Configuration Checker, Up: Configuration Checker Invoking `ebncheck' =================== The `ebncheck' command reads and checks a configuration file as the same way as `ebnetd' does. The usual way to execute `ebncheck' is as follows: % /usr/local/sbin/ebncheck It assumes that EBNETD has been installed under `/usr/local' and if a directory for system administrative executables (`sbindir') has not been changed at the installation. If an error occurs, `ebncheck' outputs messages to standard error like as follows. /usr/local/etc/ebnetd.conf:12: unknown user: noboy configuration failure  File: ebnetd.info, Node: ebncheck Options, Prev: Invoking ebncheck, Up: Configuration Checker Summary of options to `ebncheck' ================================ The `ebncheck' command supports both traditional single-letter options and mnemonic long option names. Long option names are indicated with `--' instead of `-'. Abbreviations for option names are allowed as long as they are unique. The `ebncheck' command recognizes these command line options. `-c FILE' `--configuration-file FILE' Specify a configuration file. The default filename is shown in the help message. `-d' `--debug' `--verbose' Print debugging information to standard error. Debugging information shows how each line in a configuration file is processed. `-h' `--help' Output help message to standard error, then exit. `-v' `--version' Output version number to standard error, then exit.  File: ebnetd.info, Node: Setup Your Environment, Next: Start ebnetd, Prev: Configuration Checker, Up: Top Setup Your Environment ********************** You may have to setup system environment around the server. Super user's priviledge may be required to do it. * Menu: * Services:: Setup your `services' file. * Syslog:: Setup your `syslog.conf' file. * Working Directory:: Make a working directory. * Mount CD-ROM Books:: Mount your CD-ROM books. * Appendix Package:: Copy appendix package.  File: ebnetd.info, Node: Services, Next: Syslog, Prev: Setup Your Environment, Up: Setup Your Environment `services' File =============== The service names `ebnet', `ndtp' and `http' must be added to your `services' file (usually, `/etc/services'), if missing. If your host runs as NIS client, you have to edit the NIS map on the NIS server, instead. This lines shuold be added, if missing: http 80/tcp ndtp 2010/tcp ebnet 22010/tcp The configuration file on your system may have had the line with a different service name, like that: search 2010/tcp In this case, please add the service name as an alias: search 2010/tcp ebnet (For details, please read the manual for your system.)  File: ebnetd.info, Node: Syslog, Next: Working Directory, Prev: Services, Up: Setup Your Environment `syslog.conf' File ================== `ebnetd', `ndtpd' and `ebhttpd' use `syslog' to record their log messages. Insert a line like as below into the configuration file for `syslogd' (usually `/etc/syslog.conf'). Care must be taken not to use space to separete fields, because only TAB is allowed in general. local0.info /usr/local/var/ebnetd/log/ebnetd.log Please remember that the syslog facility of the servers can be determined at the `syslog-facility' directive in the configuration file for `ebnetd' (*note `syslog-facility': Single Directive List.). Create an empty log file if missing. % touch /usr/local/var/ebnetd/log/ebnetd.log % chmod 644 /usr/local/var/ebnetd/log/ebnetd.log Find the PID of the running `syslogd' process. In BSD based sytems, type the following. % ps axuww | grep syslogd In SYSV based sytems, type the following. % ps -ef | grep syslogd (For details, please read the manual for your system.) If `syslogd' is running, you can find a line like as below. root 63 0.0 1.1 188 316 ?? Is 10:04PM 0:00.16 syslogd Send a hung-up signal (`SIGHUP') to `syslogd', and then `syslogd' re-reads `syslog.conf'. % kill -HUP 63 If your system has the `logger' command, you can send a test message to `syslogd' like as follows: % logger -p local0.info "test message"  File: ebnetd.info, Node: Working Directory, Next: Mount CD-ROM Books, Prev: Syslog, Up: Setup Your Environment Working Directory ================= `ebnetd', `ndtpd' and `ebhttpd' create some files under a working directory. The directory can be specified by `work-path' in the configuration file (*note `work-path': Single Directive List.). Please create the directory and make it be writable for the server processes and super user only. # mkdir /usr/local/var/ebnetd # chown ebnetuser /usr/local/var/ebnetd # chmod 755 /usr/local/var/ebnetd It assumes that owner of server processes on your system is `ebnetuser'. Please remember that owner and group of the server processes are defined at the `user' and `group' directives in the configuration file (*note `user': Single Directive List., and *note `group': Single Directive List.).  File: ebnetd.info, Node: Mount CD-ROM Books, Next: Appendix Package, Prev: Working Directory, Up: Setup Your Environment Mount Your CD-ROM Books ======================= As mentioned before, CD-ROM books themseves are stands on ISO 9660 format. You can mount your CD-ROM books by the same way as other ISO 9660 discs. Please read the manual for your system, if you don't know the way of mounting ISO 9660 discs on your system. The servers can access CD-ROM books compressed by `ebzip'. See *Note Compression: (ebzip)Compression, for more details.  File: ebnetd.info, Node: Appendix Package, Prev: Mount CD-ROM Books, Up: Setup Your Environment Setup Appendix Package ====================== "appendix" is supplementary data for CD-ROM book. It is not provided by publishers of CD-ROM Book. It is peculiar to EB Library. (Remember that all the servers in the EBNET distribution are related closely to EB Library. `ebnetd' is remote access server for EB Library. `ndtpd' and `ebhttpd' use EB Library to access CD-ROM Books.) Appendix provides the following data for CD-ROM book: Text stop code When you look up a word in a CD-ROM dictionary using EB Library, you might wish EB Library stops displaying dictionary's text at the point where explanation of the word ends. Howerver, the software cannot ensure it, since CD-ROM book has no marker in its text which indicates end of paragraph. Fortunately, many CD-ROM books have a "text stop code" which could be used for substitute for end of paragraph. EB Library guesses text stop code automatically by default, but sometimes takes a false code. Appanedix's stop code is used to tell EB Library a correct stop code of the CD-ROM book. Alternation text for local defined characters Many CD-ROM books define their local characters, and use them in text. To display the local character, client applications have to draw its bitmap font provided by the CD-ROM book. Appendix can define alternation text for each local defined character. Instead of drawing the bitmap font, application may output the alternation text. The layout of appendix package is similar to that of CD-ROM book. It has the `catalog' or `catalogs' file at its top directory, and data for each subbook are arranged in the corresponding sub-directory. To use an appendix, set the `appendix-path' sub-directive of the `book' group directive in a configuration file (*note `appendix-path': Group Directive.). There are some appendix packages in the EB Library official FTP site (). If you want to create an appendx package for a CD-ROM book not listed here, use the `ebappendix' command to format appendix data files.  File: ebnetd.info, Node: Start ebnetd, Next: Start ndtpd, Prev: Setup Your Environment, Up: Top Start `ebnetd' ************** `ebnetd' can run as a standalone daemon, or as a child process of `inted'. By default, `ebnetd' runs as a standalone daemon. If connections aren't come frequently to the server, it may be better to run `ebnetd' as a child of `inetd' to save consumption of memory resource. However, each time invoked by `inetd', `ebnetd' reads a configuration file and reads some data from CD-ROM books for initialization. If connections are come frequently to the server, it may be better to run `ebnetd' as a standalone daemon. If you don't have to run `ebnetd' on your system, skip rest of this chapter. * Menu: * ebnetd Standalone:: Run `ebnetd' as a standard daemon. * ebnetd Child of inetd:: Run `ebnetd' as a child of `inetd'. * ebnetd Child of xinetd:: Run `ebnetd' as a child of `xinetd'. * ebnetd Test with telnet:: Test `ebnetd' with `telnet'. * ebnetd Options:: Summary of options to `ebnetd'.  File: ebnetd.info, Node: ebnetd Standalone, Next: ebnetd Child of inetd, Prev: Start ebnetd, Up: Start ebnetd Run `ebnetd' as a standard daemon ================================= To start `ebnetd' as a standalone daemon, type the following command. Super user's priviledge may be required. % /usr/local/sbin/ebnetd It assumes that EBNETD has been installed under `/usr/local', and if a directory for system administrative executables (`sbindir') has not been changed at the installation.  File: ebnetd.info, Node: ebnetd Child of inetd, Next: ebnetd Child of xinetd, Prev: ebnetd Standalone, Up: Start ebnetd Run `ebnetd' as a child of `inetd'. =================================== To start `ebnetd' from `inetd', following processes are needed. Add the following entry to the `inetd.conf' file (usually `/etc/inetd.conf'). Don't forget to add the `--inetd' (or `-i') option. ebnet stream tcp nowait root /usr/local/sbin/ebnetd ebnetd --inetd It assumes that EBNETD has been installed under `/usr/local' and if a directory for system administrative executables (`sbindir') has not been changed at the installation. Find the PID of the running `inetd' process. % ps axuww | grep inetd (For details, please read the manual for your system.) If `inetd' is running, you can find a line like as below. root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd If found, send a hung-up signal (`SIGHUP') to `inetd' to re-read `inetd.conf'. Super user's priviledge may be required. % kill -HUP 79  File: ebnetd.info, Node: ebnetd Child of xinetd, Next: ebnetd Test with telnet, Prev: ebnetd Child of inetd, Up: Start ebnetd Run `ebnetd' as a Child Proccess of `xinetd' ============================================ Some Linux systems use `xinetd' instead of traditional `inetd'. The configuration file format of `xinetd' is different from that of traditional `inetd'. To start `ebnetd' from `xinetd', following processes are needed. Add the following entry to the configuration file (usually `/etc/xinetd.d/ebnet'). Don't forget to specify the `--inetd' (or `-i') option as `server_args'. # default: off # description: The ebnet server service ebnet { disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ebnetd server_args = --inetd log_on_failure += USERID } It assumes that EBNETD has been installed under `/usr/local' and if a directory for system administrative executables (`sbindir') has not been changed at the installation. Find the PID of the running `xinetd' process. In BSD based sytems, type the following. % ps axuww | grep xinetd In SYSV based sytems, type the following. % ps -ef | grep xinetd (For details, please read the manual for your system.) If `xinetd' is running, you can find a line like as below. root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd If found, send an USER2 signal (`SIGUSR2') to `xinetd' to re-read the configuration. Super user's priviledge may be required. % kill -USR2 79  File: ebnetd.info, Node: ebnetd Test with telnet, Next: ebnetd Options, Prev: ebnetd Child of xinetd, Up: Start ebnetd Test `ebnetd' with `telnet' =========================== When all the setup has been completed, try to connect to `ebnetd' with the `telnet' command. At first, type as follows. In this example, we try to connect to `ebnetd' on localhost. % telnet localhost ebnet The following message is displayed if `ebnetd' accepts a connection. Connected to localhost. Escape character is '^]'. Then, tpye and . BOOKLIST If `ebnetd' is running correctly, it outputs a list of CD-ROM book names like this: !OK; book list follows chujiten kojien colloc colloc.app To close the connection, type and . QUIT Connection closed by foreign host. ebnetd-1.0.dfsg.1/doc/ebnetd.info-20000644000175000017500000005342607773515126016263 0ustar mhattamhattaThis is ./ebnetd.info, produced by makeinfo version 4.2 from ./ebnetd.texi. INFO-DIR-SECTION CD-ROM Book Utilities START-INFO-DIR-ENTRY * EBNETD: (ebnetd). Network EB Library server. * NDTPD: (ndtpd). Server for accessing CD-ROM books with NDTP. * ebHTTPD: (ebhttpd). Server for accessing CD-ROM books with HTTP. END-INFO-DIR-ENTRY EBNETD/NDTPD/ebHTTPD: CD-ROM Book Servers, by Motoyuki Kasahara. Copyright (C) 1997, 98, 99, 2000, 01, 03 Motoyuki Kasahara Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Free Software Foundation, Inc.  File: ebnetd.info, Node: ebnetd Options, Prev: ebnetd Test with telnet, Up: Start ebnetd Summary of options to `ebnetd' ============================== `ebnetd' supports both traditional single-letter options and mnemonic long option names. Long option names are indicated with `--' instead of `-'. Abbreviations for option names are allowed as long as they are unique. `ebnetd' recognizes following command line options. `-c FILE' `--configuration-file FILE' Specify a configuration file read by `ebnetd'. The default filename is shown in the help message. `-h' `--help' Output help message to standard error, then exit. `-i' `--inetd' `inetd' mode. It must be specified when `ebnetd' is invoked by `inetd'. `-t' `--test' Test mode. The `ebnetd' process runs in foreground, and never forks. Requests to the server are input from standard in and responses to a client are output to srandard out. Standard in and out can be file descriptors associated with terminals. In addition, access permission is never checked, so that you can access all CD-ROM books defined in a configuration file. `-v' `--version' Output version number to standard error, then exit.  File: ebnetd.info, Node: Start ndtpd, Next: Start ebhttpd, Prev: Start ebnetd, Up: Top Start `ndtpd' ************* If you don't have to run `ndtpd' on your system, skip this chapter. Also `ndtpd' has two running mode, standalone daemon and child process of `inted'. By default, `ndtpd' runs as a standalone daemon. * Menu: * ndtpd Standalone:: Run `ndtpd' as a standard daemon. * ndtpd Child of inetd:: Run `ndtpd' as a child of `inetd'. * ndtpd Child of xinetd:: Run `ndtpd' as a child of `xinetd'. * ndtpd Test with telnet:: Test `ndtpd' with `telnet'. * ndtpd Options:: Options to `ndtpd'.  File: ebnetd.info, Node: ndtpd Standalone, Next: ndtpd Child of inetd, Prev: Start ndtpd, Up: Start ndtpd Run `ndtpd' as a standard daemon ================================ To start `ndtpd' as a standalone daemon, type the following command. Super user's priviledge may be required. % /usr/local/sbin/ndtpd It assumes that EBNETD has been installed under `/usr/local', and if a directory for system administrative executables (`sbindir') has not been changed at the installation.  File: ebnetd.info, Node: ndtpd Child of inetd, Next: ndtpd Child of xinetd, Prev: ndtpd Standalone, Up: Start ndtpd Run `ndtpd' as a child of `inetd' ================================= To start `ndtpd' from `inetd', following processes are needed. Add the following entry to the `inetd.conf' file (usually `/etc/inetd.conf'). Don't forget to add the `--inetd' (or `-i') option. ndtp stream tcp nowait root /usr/local/sbin/ndtpd ndtpd --inetd It assumes that EBNETD has been installed under `/usr/local' and if a directory for system administrative executables (`sbindir') has not been changed at the installation. Find the PID of the running `inetd' process. % ps axuww | grep inetd (For details, please read the manual for your system.) If `inetd' is running, you can find a line like as below. root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd If found, send a hung-up signal (`SIGHUP') to `inetd' to re-read `inetd.conf'. Super user's priviledge may be required. % kill -HUP 79  File: ebnetd.info, Node: ndtpd Child of xinetd, Next: ndtpd Test with telnet, Prev: ndtpd Child of inetd, Up: Start ndtpd Run `ndtpd' as a child of `xinetd' ================================== Some Linux systems use `xinetd' instead of traditional `inetd'. The configuration file format of `xinetd' is different from that of traditional `inetd'. To start `ndtpd' from `xinetd', following processes are needed. Add the following entry to the configuration file (usually `/etc/xinetd.d/ndtp'). Don't forget to specify the `--inetd' (or `-i') option as `server_args'. # default: off # description: The ndtp server service ndtp { disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ndtpd server_args = --inetd log_on_failure += USERID } It assumes that EBNETD has been installed under `/usr/local' and if a directory for system administrative executables (`sbindir') has not been changed at the installation. Find the PID of the running `xinetd' process. In BSD based sytems, type the following. % ps axuww | grep xinetd In SYSV based sytems, type the following. % ps -ef | grep xinetd (For details, please read the manual for your system.) If `xinetd' is running, you can find a line like as below. root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd If found, send an USER2 signal (`SIGUSR2') to `xinetd' to re-read the configuration. Super user's priviledge may be required. % kill -USR2 79  File: ebnetd.info, Node: ndtpd Test with telnet, Next: ndtpd Options, Prev: ndtpd Child of xinetd, Up: Start ndtpd Test `ndtpd' with `telnet' ========================== When all the setup has been completed, try to connect to `ndtpd' with the `telnet' command. At first, type as follows. In this example, we try to connect to `ndtpd' on localhost. % telnet localhost ndtp The following message is displayed if `ndtpd' accepts a connection. Connected to localhost. Escape character is '^]'. Then, tpye and . If `ndtpd' is running correctly, it outputs a list of available CD-ROM books like this: t 1 Oxford Dictionary/Thesaurus edict/oxford 0 0 0 2 Quick Tour edict/quick 0 0 0 3 User's Guide edict/user 0 0 0 4 About This Disc edict/about 0 0 0 $* To close the connection, type and . Q Connection closed by foreign host.  File: ebnetd.info, Node: ndtpd Options, Prev: ndtpd Test with telnet, Up: Start ndtpd Options to `ndtpd' ================== The command line usage of `ndtpd' is the same as that of `ebnetd'. See *note Summary of `ebnetd' options: ebnetd Options., for more details.  File: ebnetd.info, Node: Start ebhttpd, Next: Terminate and Restart, Prev: Start ndtpd, Up: Top Start `ebhttpd' *************** If you don't have to run `ebhttpd' on your system, skip this chapter. Also `ebhttpd' has two running mode, standalone daemon and child process of `inted'. By default, `ebhttpd' runs as a standalone daemon. * Menu: * ebhttpd Standalone:: Run `ebhttpd' as a standard daemon. * ebhttpd Child of inetd:: Run `ebhttpd' as a child of `inetd'. * ebhttpd Child of xinetd:: Run `ebhttpd' as a child of `xinetd'. * ebhttpd Test with telnet:: Test `ebhttpd' with `telnet'. * ebhttpd Options:: Options to `ebhttpd'.  File: ebnetd.info, Node: ebhttpd Standalone, Next: ebhttpd Child of inetd, Prev: Start ebhttpd, Up: Start ebhttpd Run `ebhttpd' as a standard daemon ================================== To start `ebhttpd' as a standalone daemon, type the following command. Super user's priviledge may be required. % /usr/local/sbin/ebhttpd It assumes that EBNETD has been installed under `/usr/local', and if a directory for system administrative executables (`sbindir') has not been changed at the installation.  File: ebnetd.info, Node: ebhttpd Child of inetd, Next: ebhttpd Child of xinetd, Prev: ebhttpd Standalone, Up: Start ebhttpd Run `ebhttpd' as a child of `inetd' =================================== To start `ebhttpd' from `inetd', following processes are needed. Add the following entry to the `inetd.conf' file (usually `/etc/inetd.conf'). Don't forget to add the `--inetd' (or `-i') option. http stream tcp nowait root /usr/local/sbin/ebhttpd ebhttpd --inetd It assumes that EBNETD has been installed under `/usr/local' and if a directory for system administrative executables (`sbindir') has not been changed at the installation. Find the PID of the running `inetd' process. % ps axuww | grep inetd (For details, please read the manual for your system.) If `inetd' is running, you can find a line like as below. root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd If found, send a hung-up signal (`SIGHUP') to `inetd' to re-read `inetd.conf'. Super user's priviledge may be required. % kill -HUP 79  File: ebnetd.info, Node: ebhttpd Child of xinetd, Next: ebhttpd Test with telnet, Prev: ebhttpd Child of inetd, Up: Start ebhttpd Run `ebhttpd' as a child of `xinetd' ==================================== Some Linux systems use `xinetd' instead of traditional `inetd'. The configuration file format of `xinetd' is different from that of traditional `inetd'. To start `ebhttpd' from `xinetd', following processes are needed. Add the following entry to the configuration file (usually `/etc/xinetd.d/ndtp'). Don't forget to specify the `--inetd' (or `-i') option as `server_args'. # default: off # description: The ndtp server service http { disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ebhttpd server_args = --inetd log_on_failure += USERID } It assumes that EBNETD has been installed under `/usr/local' and if a directory for system administrative executables (`sbindir') has not been changed at the installation. Find the PID of the running `xinetd' process. In BSD based sytems, type the following. % ps axuww | grep xinetd In SYSV based sytems, type the following. % ps -ef | grep xinetd (For details, please read the manual for your system.) If `xinetd' is running, you can find a line like as below. root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd If found, send an USER2 signal (`SIGUSR2') to `xinetd' to re-read the configuration. Super user's priviledge may be required. % kill -USR2 79  File: ebnetd.info, Node: ebhttpd Test with telnet, Next: ebhttpd Options, Prev: ebhttpd Child of xinetd, Up: Start ebhttpd Test `ebhttpd' with `telnet' ============================ When all the setup has been completed, try to connect to `ebhttpd' with the `telnet' command. At first, type as follows. In this example, we try to connect to `ebhttpd' on localhost. % telnet localhost http The following message is displayed if `ebhttpd' accepts a connection. Connected to localhost. Escape character is '^]'. Then, tpye a request like: GET / HTTP/1.0 Note that the request consists of two lines and the second line is empty. If `ebhttpd' accepts the request, the following response will be shown. HTTP/1.1 200 Ok Date: Fri, 16 May 2003 13:11:12 GMT Server: ebHTTPD 0.0 Content-Type: text/html; charset="euc-jp" (snip)  File: ebnetd.info, Node: ebhttpd Options, Prev: ebhttpd Test with telnet, Up: Start ebhttpd Options to `ebhttpd' ==================== The command line usage of `ebhttpd' is the same as that of `ebnetd'. See *Note Summary of `ebnetd' options: ndtpd Options, for more details.  File: ebnetd.info, Node: Terminate and Restart, Next: Daily Works, Prev: Start ebhttpd, Up: Top Terminate and Restart the Servers ********************************* You can use the `ebncontrol' command to terminate, kill and restart the `ebnetd' precess running as a standalone daemon. `ebncontrol' has been installed at `/usr/local/sbin', if EBNETD has been installed under `/usr/local', and if a directory for system administrative executables (`sbindir') has not been changed at the installation. You can terminate the running `ebnetd' process like as follows: % /usr/local/sbin/ebncontrol terminate `ebnetd' logs its PID to the file `ebnetd.pid' at the working directory (*note Working Directory::). `ebncontrol' reads contents of the PID file to get a PID of the running `ebnetd' process, and then `ebncontrol' sends a signal to the PID. The PID file is deleted by `ebnetd' when it is terminated normally. However, the PID file is not deleted when `ebnetd' aborts. The PID logged in the remained PID file will be assigned to another process, in this case. Be careful invoking `ebncontrol'. `ebncontrol' doesn't examine whether the `ebnetd' process really exists. If the pid file is obsolete, `ebncontrol' may send a signal to another process. `ebncontrol' reads the configuration file for `ebnetd' in order to get a location of the working directory. It can be defined at the `work-path' single directive in the configuration file (*note `work-path': Single Directive List.). The default filename of the configuration file and default value of the `work-path' single directive are the same as those of `ebnetd'. Also the `ndtpcontrol' and `ebhtcontrol' commands are available to terminate `ndtpd' and `ebhttpd'. Command line usage of `ndtpcontrol' and `ebhtcontrol' are the same as that of `ebncontrol'. * Menu: * Invoke Server Controler:: Invoke Server Control Commands * Server Controler Options:: Summary of Options to Server Control Commands  File: ebnetd.info, Node: Invoke Server Controler, Next: Server Controler Options, Prev: Terminate and Restart, Up: Terminate and Restart Invoke Server Control Commands ============================== As described before, `ebncontrol', `ndtpcontrol' and `ebhtcontrol' take the same command line arguments. The usual ways to invoke the commands are as follows: % /usr/local/sbin/ebncontrol SUB-COMMAND % /usr/local/sbin/ndtpcontrol SUB-COMMAND % /usr/local/sbin/ebhtcontrol SUB-COMMAND They recognize the following SUB-COMMANDS. Abbreviations for sub-command names are allowed as long as they are unique. `kill' Kill the running server process (send the `SIGKILL' signal). It also deletes the server's PID file. Before trying the `kill' sub-command, you should try `terminate' sub-command. `restart' Restart the server. (send the `SIGHUP' signal). The server process closes all connections, and reads a configuration file again. `status' Examine whether the server is running or not, and output the result to standard error. This sub-command doesn't send any signal to the server. `terminate' Terminate the running server process (send the `SIGTERM' signal).  File: ebnetd.info, Node: Server Controler Options, Prev: Invoke Server Controler, Up: Terminate and Restart Summary of Options to Server Control Commands ============================================= The `ebncontrol', `ndtpcontrol' and `ebhtcontrol' commands support both traditional single-letter options and mnemonic long option names. Long option names are indicated with `--' instead of `-'. Abbreviations for option names are allowed as long as they are unique. `ebncontrol', `ndtpcontrol' and `ebhtcontrol' recognize the command line options below. `-c FILE' `--configuration-file FILE' Specify a configuration file. The default filename is shown in the help message. `-h' `--help' Output help message to standard error, then exit. `-v' `--version' Output version number to standard error, then exit.  File: ebnetd.info, Node: Daily Works, Next: Network License, Prev: Terminate and Restart, Up: Top Daily Administrative Works ************************** The `ebndaily' command generates statistics summary from a latest syslog file of the servers (`ebnetd', `ndtpd' and `ebhttpd'), rotates syslog files, and then mails the results to administrators specified by command line arguments. `ebndaily' has been installed at `/usr/local/sbin', if EBNETD has been installed under `/usr/local', and if a directory for system administrative executables (`sbindir') has not been changed at the installation. Its usual way to invoke `ebndaily' is as follows: % /usr/local/sbin/ebndaily MAIL-ADDRESS... For example, % /usr/local/sbin/ebndaily root@host.your.domain Two or more mail addresses can be accepted: % /usr/local/sbin/ebndaily root@host.your.domain root@dept.your.domain To execute `ebndaily' once a day automatically, add an entry like as follows on your `crontab'. 0 0 * * * /usr/local/sbin/ebndaily root@host.your.domain (For details, please read the manual for your system.) By default, `ebndaily' keeps 7 ages of old syslog files. If the current syslog file is `/usr/local/var/ebnetd/log/ebnetd.log', the old syslog files are kept as: /usr/local/var/ebnetd/log/ebnetd.log.0 /usr/local/var/ebnetd/log/ebnetd.log.1 /usr/local/var/ebnetd/log/ebnetd.log.2 /usr/local/var/ebnetd/log/ebnetd.log.3 /usr/local/var/ebnetd/log/ebnetd.log.4 /usr/local/var/ebnetd/log/ebnetd.log.5 /usr/local/var/ebnetd/log/ebnetd.log.6 These syslog files are rotated by the following processes: 1. The eldest syslog file `ebnetd.log.6' is removed. 2. Other `ebnetd.log.N' files are moved to `ebnetd.log.N+1'. 3. The current syslog file `ebnetd.log' is copied to `ebnetd.log.0'. 4. The current syslog file `ebnetd.log' is cleared. * Menu: * ebndaily Options:: Summary of options to `ebndaily'.  File: ebnetd.info, Node: ebndaily Options, Prev: Daily Works, Up: Daily Works Summary of Options to `ebndaily' ================================ The `ebndaily' command supports both traditional single-letter options and mnemonic long option names. Long option names are indicated with `--' instead of `-'. Abbreviations for option names are allowed as long as they are unique. The `ebndaily' command recognizes following command line options. `-a INTEGER' `--ages INTEGER' Keep INTEGER ages of old syslog files. The default value is `7'. `-c COMPRESSOR' `--compressor COMPRESSOR' Specify a commpression program to compress old syslog files. The COMPRESSOR must be `compress', `gzip', `bzip2' or `none'. The default value is `none'. When `compress' is specified or no `--compressor' (`-c') option is specified, the `compress' command is used for compression and the suffix `.Z' are added to the old syslog files. When `gzip' is specified, the `gzip' command is used for compression and the suffix `.gz' are added to the old syslog files. When `bzip2' is specified, the `bzip2' command is used for compression and the suffix `.bz2' are added to the old syslog files. When `none' is specified, no compression program is used and no suffix is added to the old syslog files. `-l FILE' `--log-file FILE' Specify the current syslog file. The default value is `/usr/local/var/ebnetd/log/ebnetd.log', if EBNETD has been installed under `/usr/local', and if a directory for modifiable single-machine data (`localstatedir') and a directory for log files (specified by `--with-logdir') have not been changed at the installation. The default filename is shown in the help message. `-h' `--help' Output help message to standard error, then exit. `-v' `--version' Output version number to standard error, then exit. `-N' `--fast' `--best' These options are passed to `gzip' and `bzip2' (*note Invoking `gzip': (gzip)Invoking gzip., for more details). If neither `gzip' nor `bzip2' is used, these options are merely ignored.  File: ebnetd.info, Node: Network License, Prev: Daily Works, Up: Top Network License *************** Some CD-ROM book publishers optionally provide network license. It allows multiple users on your LAN to access the book. The license may limit the maximum number of users accessing to the book at the same time (since the contents of network license is various, please contact publishers of your book for more details). In the configuration file (usually `ebnetd.conf'), there are two `max-clients' parameters. One is single directive (*note `max-clients': Single Directive List.), and another is sub-directive in the `book' (*note `max-clients': Book Group Directive.). group directive. Both limits the maximum number of clients. They help follow the the network license, but they are not perfect. The book should be readable to an user only while his client connects to a server, but neither server or client doesn't check connection status frequently. For example, server closes the connection when idle timeout occurs. However, client keeps displaying contents of the CD-ROM book until user requests another contents. Setting `max-clients' for network license is still a good idea. It is important that you don't overestimate the abilities of `max-clients'. ebnetd-1.0.dfsg.1/doc-ja/0000755000175000017500000000000007773515160014362 5ustar mhattamhattaebnetd-1.0.dfsg.1/doc-ja/Makefile.am0000644000175000017500000000007407673055347016424 0ustar mhattamhattainfo_TEXINFOS = ebnetd-ja.texi EXTRA_DIST = texinfo-ja.tex ebnetd-1.0.dfsg.1/doc-ja/Makefile.in0000644000175000017500000003556107773515022016436 0ustar mhattamhatta# Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ # Copyright (C) 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. # 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ subdir = doc-ja DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/stamp-vti $(srcdir)/version.texi mdate-sh \ texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/eb4.m4 \ $(top_srcdir)/m4/herrno.m4 $(top_srcdir)/m4/in6addr.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/sockaddrin6.m4 \ $(top_srcdir)/m4/sockinttypes.m4 $(top_srcdir)/m4/unionwait.m4 \ $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = INFO_DEPS = $(srcdir)/ebnetd-ja.info am__TEXINFO_TEX_DIR = $(srcdir) DVIS = ebnetd-ja.dvi PDFS = ebnetd-ja.pdf PSS = ebnetd-ja.ps HTMLS = ebnetd-ja.html TEXINFOS = ebnetd-ja.texi TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips am__installdirs = $(DESTDIR)$(infodir) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPRESS = @COMPRESS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ EBCONF_EBINCS = @EBCONF_EBINCS@ EBCONF_EBLIBS = @EBCONF_EBLIBS@ EBCONF_INTLINCS = @EBCONF_INTLINCS@ EBCONF_INTLLIBS = @EBCONF_INTLLIBS@ EBCONF_PTHREAD_CFLAGS = @EBCONF_PTHREAD_CFLAGS@ EBCONF_PTHREAD_CPPFLAGS = @EBCONF_PTHREAD_CPPFLAGS@ EBCONF_PTHREAD_LDFLAGS = @EBCONF_PTHREAD_LDFLAGS@ EBCONF_ZLIBINCS = @EBCONF_ZLIBINCS@ EBCONF_ZLIBLIBS = @EBCONF_ZLIBLIBS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GZIPCMD = @GZIPCMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAILING_ADDRESS = @MAILING_ADDRESS@ MAILX = @MAILX@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ info_TEXINFOS = ebnetd-ja.texi EXTRA_DIST = texinfo-ja.tex all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc-ja/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu doc-ja/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool .texi.info: restore=: && \ backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then \ mv $$f $$backupdir; \ restore=mv; \ fi; \ done; \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ cd $(srcdir); \ else \ rc=$$?; \ cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; \ exit $$rc .texi.dvi: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $< .texi.pdf: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $< .texi.html: $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $< if test ! -d $@ && test -d $(@:.html=); then \ mv $(@:.html=) $@; else :; fi $(srcdir)/ebnetd-ja.info: ebnetd-ja.texi $(srcdir)/version.texi ebnetd-ja.dvi: ebnetd-ja.texi $(srcdir)/version.texi ebnetd-ja.pdf: ebnetd-ja.texi $(srcdir)/version.texi ebnetd-ja.html: ebnetd-ja.texi $(srcdir)/version.texi $(srcdir)/version.texi: $(srcdir)/stamp-vti $(srcdir)/stamp-vti: ebnetd-ja.texi $(top_srcdir)/configure @(dir=.; test -f ./ebnetd-ja.texi || dir=$(srcdir); \ set `$(SHELL) $(srcdir)/mdate-sh $$dir/ebnetd-ja.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > vti.tmp @cmp -s vti.tmp $(srcdir)/version.texi \ || (echo "Updating $(srcdir)/version.texi"; \ cp vti.tmp $(srcdir)/version.texi) -@rm -f vti.tmp @cp $(srcdir)/version.texi $@ mostlyclean-vti: -rm -f vti.tmp maintainer-clean-vti: -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi .dvi.ps: $(DVIPS) -o $@ $< uninstall-info-am: $(PRE_UNINSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \ install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if cd $(DESTDIR)$(infodir); then \ echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ for file in $$d/$$base*; do \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f $(distdir)/$$relfile || \ cp -p $$file $(distdir)/$$relfile; \ done; \ done mostlyclean-aminfo: -rm -rf ebnetd-ja.aux ebnetd-ja.cp ebnetd-ja.cps ebnetd-ja.fn ebnetd-ja.fns \ ebnetd-ja.ky ebnetd-ja.kys ebnetd-ja.log ebnetd-ja.pg \ ebnetd-ja.pgs ebnetd-ja.tmp ebnetd-ja.toc ebnetd-ja.tp \ ebnetd-ja.tps ebnetd-ja.vr ebnetd-ja.vrs ebnetd-ja.dvi \ ebnetd-ja.pdf ebnetd-ja.ps ebnetd-ja.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: 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"; \ $(mkdir_p) "$(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 $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) installdirs: $(mkdir_p) $(DESTDIR)$(infodir) 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-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-info-am install-exec-am: install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(infodir) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \ $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile || :;\ done; \ else : ; fi install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ mostlyclean-libtool mostlyclean-vti pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ dist-info distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am 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-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean \ mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool \ mostlyclean-vti pdf pdf-am ps ps-am uninstall uninstall-am \ 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: ebnetd-1.0.dfsg.1/doc-ja/stamp-vti0000644000175000017500000000012107773515126016225 0ustar mhattamhatta@set UPDATED 2003 年 9 @set UPDATED-MONTH 年 9 @set EDITION 1.0 @set VERSION 1.0 ebnetd-1.0.dfsg.1/doc-ja/version.texi0000644000175000017500000000012107773447717016750 0ustar mhattamhatta@set UPDATED 2003 年 9 @set UPDATED-MONTH 年 9 @set EDITION 1.0 @set VERSION 1.0 ebnetd-1.0.dfsg.1/doc-ja/mdate-sh0000755000175000017500000001014707760004604016005 0ustar mhattamhatta#!/bin/sh # Get modification time of a file or directory and pretty-print it. # Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program 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, or (at your option) # any later version. # # This program 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 this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME save_arg1="$1" # Find out how to get the extended ls output of a file or directory. if ls -L /dev/null 1>/dev/null 2>&1; then ls_command='ls -L -l -d' else ls_command='ls -l -d' fi # A `ls -l' line looks as follows on OS/2. # drwxrwx--- 0 Aug 11 2001 foo # This differs from Unix, which adds ownership information. # drwxrwx--- 2 root root 4096 Aug 11 2001 foo # # To find the date, we split the line on spaces and iterate on words # until we find a month. This cannot work with files whose owner is a # user named `Jan', or `Feb', etc. However, it's unlikely that `/' # will be owned by a user whose name is a month. So we first look at # the extended ls output of the root directory to decide how many # words should be skipped to get the date. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. set - x`$ls_command /` # Find which argument is the month. month= command= until test $month do shift # Add another shift to the command. command="$command shift;" case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done # Get the extended ls output of the file or directory. set - x`eval "$ls_command \"\$save_arg1\""` # Remove all preceding arguments eval $command # Get the month. Next argument is day, followed by the year or time. case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac day=$2 # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo "$year 年 $nummonth 月 $day 日" ebnetd-1.0.dfsg.1/doc-ja/texinfo.tex0000644000175000017500000055746207673055350016602 0ustar mhattamhatta% texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{1998-10-27}% % % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98 % Free Software Foundation, Inc. % % This texinfo.tex file 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, or (at % your option) any later version. % % This texinfo.tex file 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 this texinfo.tex file; see the file COPYING. If not, write % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, % Boston, MA 02111-1307, USA. % % In other words, you are welcome to use, share and improve this program. % You are forbidden to forbid anyone else to use, share and improve % what you give them. Help stamp out software-hoarding! % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % ftp://ftp.gnu.org/pub/gnu/texinfo.tex % /home/gd/gnu/doc/texinfo.tex on the GNU machines. % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) % ftp://tug.org/tex/texinfo.tex % ftp://ctan.org/macros/texinfo/texinfo.tex % (and all CTAN mirrors, finger ctan@ctan.org for a list). % The texinfo.tex in the texinfo distribution itself could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. % Please include a precise test case in each bug report, % including a complete document with which we can reproduce the problem. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For simple % manuals, however, you can get away with: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever, to process the dvi file. % The extra runs of TeX get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} % Save some parts of plain tex whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexi=\i \let\ptexlbrace=\{ \let\ptexrbrace=\} \let\ptexstar=\* \let\ptext=\t % We never want plain's outer \+ definition in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax %************************************************ % Patch for ASCII/NTT Jtexinfo by ntp@isl.mei.co.jp, kusumi@isl.mei.co.jp % Original patch for NTT Jtexinfo by S. Tomura %************************************************ \newif\ifisJTeX \newif\ifisASCII \expandafter\ifx\csname gtfam\endcsname\relax % not ASCIITeX \expandafter\ifx\csname jfont\endcsname\relax % nor NTTTeX \isJTeXfalse \else \isJTeXtrue \isASCIIfalse \fi \else \isJTeXtrue \isASCIItrue \fi \ifisJTeX \def\ASCJtexinfoversion{j1.05} \message{ with ASCII/NTT jtexinfo extension [Version \ASCJtexinfoversion]:} \ifisASCII \message{Hmm, Your Japanese-TeX seems to be an ASCII version. Loading.} \else \message{Hmm, Your Japanese-TeX seems to be an NTT version. Loading.} \fi \fi \message{Basics,} \chardef\other=12 % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortContents\undefined \gdef\putwordShortContents{Short Contents}\fi \ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi % Ignore a token. % \def\gobble#1{} \hyphenation{ap-pen-dix} \hyphenation{mini-buf-fer mini-buf-fers} \hyphenation{eshell} \hyphenation{white-space} % Margin to add to right of even pages, to left of odd pages. \newdimen \bindingoffset \newdimen \normaloffset \newdimen\pagewidth \newdimen\pageheight % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \ifx\eTeXversion\undefined \def\loggingall{\tracingcommands2 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% \else \def\loggingall{\tracingcommands3 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \tracingscantokens1 \tracingassigns1 \tracingifs1 \tracinggroups1 \tracingnesting2 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% \fi % For @cropmarks command. % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \escapechar = `\\ % use backslash in output files. \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. \shipout\vbox{% \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingxxx.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 2\baselineskip \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \turnoffactive \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1 \unvbox#1 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg#1{% \let\next = #1% \begingroup \obeylines \futurelet\temp\parseargx } % If the next token is an obeyed space (from an @example environment or % the like), remove it and recurse. Otherwise, we're done. \def\parseargx{% % \obeyedspace is defined far below, after the definition of \sepspaces. \ifx\obeyedspace\temp \expandafter\parseargdiscardspace \else \expandafter\parseargline \fi } % Remove a single space (as the delimiter token to the macro call). {\obeyspaces % \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. % % First remove any @c comment, then any @comment. % Result of each macro is put in \toks0. \argremovec #1\c\relax % \expandafter\argremovecomment \the\toks0 \comment\relax % % % Call the caller's macro, saved as \next in \parsearg. \expandafter\next\expandafter{\the\toks0}% }% } % Since all \c{,omment} does is throw away the argument, we can let TeX % do that for us. The \relax here is matched by the \relax in the call % in \parseargline; it could be more or less anything, its purpose is % just to delimit the argument to the \c. \def\argremovec#1\c#2\relax{\toks0 = {#1}} \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} % \argremovec{,omment} might leave us with trailing spaces, though; e.g., % @end itemize @c foo % will have two active spaces as part of the argument with the % `itemize'. Here we remove all active spaces from #1, and assign the % result to \toks0. % % This loses if there are any *other* active characters besides spaces % in the argument -- _ ^ +, for example -- since they get expanded. % Fortunately, Texinfo does not define any such commands. (If it ever % does, the catcode of the characters in questionwill have to be changed % here.) But this means we cannot call \removeactivespaces as part of % \argremovec{,omment}, since @c uses \parsearg, and thus the argument % that \parsearg gets might well have any character at all in it. % \def\removeactivespaces#1{% \begingroup \ignoreactivespaces \edef\temp{#1}% \global\toks0 = \expandafter{\temp}% \endgroup } % Change the active space to expand to nothing. % \begingroup \obeyspaces \gdef\ignoreactivespaces{\obeyspaces\let =\empty} \endgroup \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} %% These are used to keep @begin/@end levels from running away %% Call \inENV within environments (after a \begingroup) \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} \def\ENVcheck{% \ifENV\errmessage{Still within an environment; press RETURN to continue} \endgroup\fi} % This is not perfect, but it should reduce lossage % @begin foo is the same as @foo, for now. \newhelp\EMsimple{Press RETURN to continue.} \outer\def\begin{\parsearg\beginxxx} \def\beginxxx #1{% \expandafter\ifx\csname #1\endcsname\relax {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else \csname #1\endcsname\fi} % @end foo executes the definition of \Efoo. % \def\end{\parsearg\endxxx} \def\endxxx #1{% \removeactivespaces{#1}% \edef\endthing{\the\toks0}% % \expandafter\ifx\csname E\endthing\endcsname\relax \expandafter\ifx\csname \endthing\endcsname\relax % There's no \foo, i.e., no ``environment'' foo. \errhelp = \EMsimple \errmessage{Undefined command `@end \endthing'}% \else \unmatchedenderror\endthing \fi \else % Everything's ok; the right environment has been started. \csname E\endthing\endcsname \fi } % There is an environment #1, but it hasn't been started. Give an error. % \def\unmatchedenderror#1{% \errhelp = \EMsimple \errmessage{This `@end #1' doesn't have a matching `@#1'}% } % Define the control sequence \E#1 to give an unmatched @end error. % \def\defineunmatchedend#1{% \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% } % Single-spacing is done by various environments (specifically, in % \nonfillstart and \quotations). \newskip\singlespaceskip \singlespaceskip = 12.5pt \def\singlespace{% % Why was this kern here? It messes up equalizing space above and below % environments. --karl, 6may93 %{\advance \baselineskip by -\singlespaceskip %\kern \baselineskip}% \setleading \singlespaceskip } %% Simple single-character @ commands % @@ prints an @ % Kludge this until the fonts are right (grr). \def\@{{\tt\char64}} % This is turned off because it was never documented % and you can use @w{...} around a quote to suppress ligatures. %% Define @` and @' to be the same as ` and ' %% but suppressing ligatures. %\def\`{{`}} %\def\'{{'}} % Used to generate quoted braces. \def\mylbrace {{\tt\char123}} \def\myrbrace {{\tt\char125}} \let\{=\mylbrace \let\}=\myrbrace \begingroup % Definitions to produce actual \{ & \} command in an index. \catcode`\{ = 12 \catcode`\} = 12 \catcode`\[ = 1 \catcode`\] = 2 \catcode`\@ = 0 \catcode`\\ = 12 @gdef@lbracecmd[\{]% @gdef@rbracecmd[\}]% @endgroup % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. \let\, = \c \let\dotaccent = \. \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \t \let\ubaraccent = \b \let\udotaccent = \d % Other special characters: @questiondown @exclamdown % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ptexi \else\ifx\temp\jmacro \j \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} % @. is an end-of-sentence period. \def\.{.\spacefactor=3000 } % @! is an end-of-sentence bang. \def\!{!\spacefactor=3000 } % @? is an end-of-sentence query. \def\?{?\spacefactor=3000 } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % \def\group{\begingroup \ifnum\catcode13=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi % % The \vtop we start below produces a box with normal height and large % depth; thus, TeX puts \baselineskip glue before it, and (when the % next line of text is done) \lineskip glue after it. (See p.82 of % the TeXbook.) Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% \egroup % End the \vtop. \endgroup % End the \group. }% % \vtop\bgroup % We have to put a strut on the last line in case the @group is in % the midst of an example, rather than completely enclosing it. % Otherwise, the interline space between the last line of the group % and the first line afterwards is too small. But we can't put the % strut in \Egroup, since there it would be on a line by itself. % Hence this just inserts a strut at the beginning of each line. \everypar = {\strut}% % % Since we have a strut on every line, we don't need any of TeX's % normal interline spacing. \offinterlineskip % % OK, but now we have to do something about blank % lines in the input in @example-like environments, which normally % just turn into \lisppar, which will insert no space now that we've % turned off the interline space. Simplest is to make them be an % empty paragraph. \ifx\par\lisppar \edef\par{\leavevmode \par}% % % Reset ^^M's definition to new definition of \par. \obeylines \fi % % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \def\need{\parsearg\needx} % Old definition--didn't work. %\def\needx #1{\par % %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak %\prevdepth=-1000pt %}} \def\needx#1{% % Go into vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % Don't add any leading before our big empty box, but allow a page % break, since the best break might be right here. \allowbreak \nointerlineskip \vtop to #1\mil{\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak } % @br forces paragraph break \let\br = \par % @dots{} output an ellipsis using the current font. % We do .5em per period so that it has the same spacing in a typewriter % font as three actual period characters. % \def\dots{% \leavevmode \hbox to 1.5em{% \hskip 0pt plus 0.25fil minus 0.25fil .\hss.\hss.% \hskip 0pt plus 0.5fil minus 0.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \leavevmode \hbox to 2em{% \hskip 0pt plus 0.25fil minus 0.25fil .\hss.\hss.\hss.% \hskip 0pt plus 0.5fil minus 0.5fil }% \spacefactor=3000 } % @page forces the start of a new page % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \def\exdent{\parsearg\exdentyyy} \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} % This defn is used inside nofill environments such as @example. \def\nofillexdent{\parsearg\nofillexdentyyy} \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph. \def\inmargin#1{% \strut\vadjust{\nobreak\kern-\strutdepth \vtop to \strutdepth{\baselineskip\strutdepth\vss \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}} \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} %\hbox{{\rm#1}}\hfil\break}} % @include file insert text of that file as input. % Allow normal characters that we make active in the argument (a file name). \def\include{\begingroup \catcode`\\=12 \catcode`~=12 \catcode`^=12 \catcode`_=12 \catcode`|=12 \catcode`<=12 \catcode`>=12 \catcode`+=12 \parsearg\includezzz} % Restore active chars for included file. \def\includezzz#1{\endgroup\begingroup % Read the included file in a group so nested @include's work. \def\thisfile{#1}% \input\thisfile \endgroup} \def\thisfile{} % @center line outputs that line, centered \def\center{\parsearg\centerzzz} \def\centerzzz #1{{\advance\hsize by -\leftskip \advance\hsize by -\rightskip \centerline{#1}}} % @sp n outputs n lines of vertical space \def\sp{\parsearg\spxxx} \def\spxxx #1{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} \let\c=\comment % @paragraphindent is defined for the Info formatting commands only. \let\paragraphindent=\comment % Prevent errors for section commands. % Used in @ignore and in failing conditionals. \def\ignoresections{% \let\chapter=\relax \let\unnumbered=\relax \let\top=\relax \let\unnumberedsec=\relax \let\unnumberedsection=\relax \let\unnumberedsubsec=\relax \let\unnumberedsubsection=\relax \let\unnumberedsubsubsec=\relax \let\unnumberedsubsubsection=\relax \let\section=\relax \let\subsec=\relax \let\subsubsec=\relax \let\subsection=\relax \let\subsubsection=\relax \let\appendix=\relax \let\appendixsec=\relax \let\appendixsection=\relax \let\appendixsubsec=\relax \let\appendixsubsection=\relax \let\appendixsubsubsec=\relax \let\appendixsubsubsection=\relax \let\contents=\relax \let\smallbook=\relax \let\titlepage=\relax } % Used in nested conditionals, where we have to parse the Texinfo source % and so want to turn off most commands, in case they are used % incorrectly. % \def\ignoremorecommands{% \let\defcodeindex = \relax \let\defcv = \relax \let\deffn = \relax \let\deffnx = \relax \let\defindex = \relax \let\defivar = \relax \let\defmac = \relax \let\defmethod = \relax \let\defop = \relax \let\defopt = \relax \let\defspec = \relax \let\deftp = \relax \let\deftypefn = \relax \let\deftypefun = \relax \let\deftypevar = \relax \let\deftypevr = \relax \let\defun = \relax \let\defvar = \relax \let\defvr = \relax \let\ref = \relax \let\xref = \relax \let\printindex = \relax \let\pxref = \relax \let\settitle = \relax \let\setchapternewpage = \relax \let\setchapterstyle = \relax \let\everyheading = \relax \let\evenheading = \relax \let\oddheading = \relax \let\everyfooting = \relax \let\evenfooting = \relax \let\oddfooting = \relax \let\headings = \relax \let\include = \relax \let\lowersections = \relax \let\down = \relax \let\raisesections = \relax \let\up = \relax \let\set = \relax \let\clear = \relax \let\item = \relax } % Ignore @ignore ... @end ignore. % \def\ignore{\doignore{ignore}} % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. % \def\ifinfo{\doignore{ifinfo}} \def\ifhtml{\doignore{ifhtml}} \def\ifnottex{\doignore{ifnottex}} \def\html{\doignore{html}} \def\menu{\doignore{menu}} \def\direntry{\doignore{direntry}} % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory = \comment % Ignore text until a line `@end #1'. % \def\doignore#1{\begingroup % Don't complain about control sequences we have declared \outer. \ignoresections % % Define a command to swallow text until we reach `@end #1'. % This @ is a catcode 12 token (that is the normal catcode of @ in % this texinfo.tex file). We change the catcode of @ below to match. \long\def\doignoretext##1@end #1{\enddoignore}% % % Make sure that spaces turn into tokens that match what \doignoretext wants. \catcode32 = 10 % % Ignore braces, too, so mismatched braces don't cause trouble. \catcode`\{ = 9 \catcode`\} = 9 % % We must not have @c interpreted as a control sequence. \catcode`\@ = 12 % % Make the letter c a comment character so that the rest of the line % will be ignored. This way, the document can have (for example) % @c @end ifinfo % and the @end ifinfo will be properly ignored. % (We've just changed @ to catcode 12.) \catcode`\c = 14 % % And now expand that command. \doignoretext } % What we do to finish off ignored text. % \def\enddoignore{\endgroup\ignorespaces}% \newif\ifwarnedobs\warnedobsfalse \def\obstexwarn{% \ifwarnedobs\relax\else % We need to warn folks that they may have trouble with TeX 3.0. % This uses \immediate\write16 rather than \message to get newlines. \immediate\write16{} \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} \immediate\write16{If you are running another version of TeX, relax.} \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} \immediate\write16{ Then upgrade your TeX installation if you can.} \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} \immediate\write16{If you are stuck with version 3.0, run the} \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} \immediate\write16{ to use a workaround.} \immediate\write16{} \global\warnedobstrue \fi } % **In TeX 3.0, setting text in \nullfont hangs tex. For a % workaround (which requires the file ``dummy.tfm'' to be installed), % uncomment the following line: %%%%%\font\nullfont=dummy\let\obstexwarn=\relax % Ignore text, except that we keep track of conditional commands for % purposes of nesting, up to an `@end #1' command. % \def\nestedignore#1{% \obstexwarn % We must actually expand the ignored text to look for the @end % command, so that nested ignore constructs work. Thus, we put the % text into a \vbox and then do nothing with the result. To minimize % the change of memory overflow, we follow the approach outlined on % page 401 of the TeXbook: make the current font be a dummy font. % \setbox0 = \vbox\bgroup % Don't complain about control sequences we have declared \outer. \ignoresections % % Define `@end #1' to end the box, which will in turn undefine the % @end command again. \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% % % We are going to be parsing Texinfo commands. Most cause no % trouble when they are used incorrectly, but some commands do % complicated argument parsing or otherwise get confused, so we % undefine them. % % We can't do anything about stray @-signs, unfortunately; % they'll produce `undefined control sequence' errors. \ignoremorecommands % % Set the current font to be \nullfont, a TeX primitive, and define % all the font commands to also use \nullfont. We don't use % dummy.tfm, as suggested in the TeXbook, because not all sites % might have that installed. Therefore, math mode will still % produce output, but that should be an extremely small amount of % stuff compared to the main input. % \nullfont \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont \let\tensf = \nullfont % Similarly for index fonts (mostly for their use in % smallexample) \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont \let\indsf = \nullfont % % Don't complain when characters are missing from the fonts. \tracinglostchars = 0 % % Don't bother to do space factor calculations. \frenchspacing % % Don't report underfull hboxes. \hbadness = 10000 % % Do minimal line-breaking. \pretolerance = 10000 % % Do not execute instructions in @tex \def\tex{\doignore{tex}}% % Do not execute macro definitions. % `c' is a comment character, so the word `macro' will get cut off. \def\macro{\doignore{ma}}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. Make sure the catcode of space is correct to avoid % losing inside @example, for instance. % \def\set{\begingroup\catcode` =10 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. \parsearg\setxxx} \def\setxxx#1{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% \def\temp{#2}% \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. \fi \endgroup } % Can't use \xdef to pre-expand #2 and save some time, since \temp or % \next or other control sequences that we've defined might get us into % an infinite loop. Consider `@set foo @cite{bar}'. \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} % @clear VAR clears (i.e., unsets) the variable VAR. % \def\clear{\parsearg\clearxxx} \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} % @value{foo} gets the text saved in variable foo. % { \catcode`\_ = \active % % We might end up with active _ or - characters in the argument if % we're called from @code, as @code{@value{foo-bar_}}. So \let any % such active characters to their normal equivalents. \gdef\value{\begingroup \catcode`\-=12 \catcode`\_=12 \indexbreaks \let_\normalunderscore \valuexxx} } \def\valuexxx#1{\expandablevalue{#1}\endgroup} % We have this subroutine so that we can handle at least some @value's % properly in indexes (we \let\value to this in \indexdummies). Ones % whose names contain - or _ still won't work, but we can't do anything % about that. The command has to be fully expandable, since the result % winds up in the index file. This means that if the variable's value % contains other Texinfo commands, it's almost certain it will fail % (although perhaps we could fix that with sufficient work to do a % one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']v}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % \def\ifset{\parsearg\ifsetxxx} \def\ifsetxxx #1{% \expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifsetfail \else \expandafter\ifsetsucceed \fi } \def\ifsetsucceed{\conditionalsucceed{ifset}} \def\ifsetfail{\nestedignore{ifset}} \defineunmatchedend{ifset} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % \def\ifclear{\parsearg\ifclearxxx} \def\ifclearxxx #1{% \expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifclearsucceed \else \expandafter\ifclearfail \fi } \def\ifclearsucceed{\conditionalsucceed{ifclear}} \def\ifclearfail{\nestedignore{ifclear}} \defineunmatchedend{ifclear} % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text % following, through the first @end iftex (etc.). Make `@end iftex' % (etc.) valid only after an @iftex. % \def\iftex{\conditionalsucceed{iftex}} \def\ifnothtml{\conditionalsucceed{ifnothtml}} \def\ifnotinfo{\conditionalsucceed{ifnotinfo}} \defineunmatchedend{iftex} \defineunmatchedend{ifnothtml} \defineunmatchedend{ifnotinfo} % We can't just want to start a group at @iftex (for example) and end it % at @end iftex, since then @set commands inside the conditional have no % effect (they'd get reverted at the end of the group). So we must % define \Eiftex to redefine itself to be its previous value. (We can't % just define it to fail again with an ``unmatched end'' error, since % the @ifset might be nested.) % \def\conditionalsucceed#1{% \edef\temp{% % Remember the current value of \E#1. \let\nece{prevE#1} = \nece{E#1}% % % At the `@end #1', redefine \E#1 to be its previous value. \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% }% \temp } % We need to expand lots of \csname's, but we don't want to expand the % control sequences after we've constructed them. % \def\nece#1{\expandafter\noexpand\csname#1\endcsname} % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math means output in math mode. % We don't use $'s directly in the definition of \math because control % sequences like \math are expanded when the toc file is written. Then, % we read the toc file back, the $'s will be normal characters (as they % should be, according to the definition of Texinfo). So we must use a % control sequence to switch into and out of math mode. % % This isn't quite enough for @math to work properly in indices, but it % seems unlikely it will ever be needed there. % \let\implicitmath = $ \def\math#1{\implicitmath #1\implicitmath} % @bullet and @minus need the same treatment as @math, just above. \def\bullet{\implicitmath\ptexbullet\implicitmath} \def\minus{\implicitmath-\implicitmath} % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \iflinks \readauxfile \fi % \openindices needs to do some work in any case. \openindices \fixbackslash % Turn off hack to swallow `\input texinfo'. \global\let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. % Just to be on the safe side, close the input stream before the \input. \openin 1 texinfo.cnf \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi \closein1 \temp % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{fonts,} % Font-change commands. % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf analogous to plain's \rm, etc. \newfam\sffam \def\sf{\fam=\sffam \tensf} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this one. \def\ttsl{\tenttsl} %** % For NTT TeX, define dummy font families compatible with ASCII. % Unfortunately, \newfam in the \if..\fi raise an error, so we should % redefine \newfam even with ASCII Japanese TeX. % \newfam\minfam \def\mc{\fam\minfam\tenmin}% \newfam\gtfam \def\gt{\fam\gtfam\tengt}% \ifisJTeX\else \let\mc=\relax \let\gt=\relax \fi %** by ntp@isl.mei % Use Computer Modern fonts at \magstephalf (11pt). \newcount\mainmagstep \mainmagstep=\magstephalf % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). % #3 is the font's design size, #4 is a scale factor \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\undefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} %where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} %\def\ttslshape{sltt} \def\ttslshape{ti} \def\itshape{ti} \def\itbshape{ti} \def\slshape{sl} \def\slbshape{bx} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} \ifx\bigger\relax \let\mainmagstep=\magstep1 \setfont\textrm\rmshape{12}{1000} \setfont\texttt\ttshape{12}{1000} \else \setfont\textrm\rmshape{10}{\mainmagstep} \setfont\texttt\ttshape{10}{\mainmagstep} \fi % Instead of cmb10, you many want to use cmbx10. % cmbx10 is a prettier font on its own, but cmb10 % looks better when embedded in a line with cmr10. \setfont\textbf\bfshape{10}{\mainmagstep} \setfont\textit\itshape{10}{\mainmagstep} \setfont\textsl\slshape{10}{\mainmagstep} \setfont\textsf\sfshape{10}{\mainmagstep} \setfont\textsc\scshape{10}{\mainmagstep} \setfont\textttsl\ttslshape{10}{\mainmagstep} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep %** \ifisJTeX \ifisASCII \font\textmin=min10 scaled \mainmagstep \font\textgt=goth10 scaled \mainmagstep \else \jfont\textmin=dm10 scaled \mainmagstep \jfont\textgt=dg10 scaled \mainmagstep \fi \else \let\textmin=\relax \let\textgt=\relax \fi % ntp@isl.mei.co.jp %** % A few fonts for @defun, etc. \setfont\defbf\bxshape{10}{\magstep1} %was 1314 \setfont\deftt\ttshape{10}{\magstep1} %\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} %** \ifisJTeX \ifisASCII \font\defgt=min10 scaled \magstep1 \else \jfont\defgt=dg10 scaled \magstep1 \fi \else \let\defgt=\relax \fi \def\df{\let\tentt=\deftt\let\tenbf=\defbf \let\tengt=\defgt \bf\gt} % ntp % Fonts for indices and small examples (9pt). % We actually use the slanted font rather than the italic, % because texinfo normally uses the slanted fonts for that. % Do not make many font distinctions in general in the index, since they % aren't very useful. \setfont\ninett\ttshape{9}{1000} \setfont\ninettsl\ttslshape{10}{900} \setfont\indrm\rmshape{9}{1000} \setfont\indit\itshape{9}{1000} \setfont\indsl\slshape{9}{1000} \let\indtt=\ninett \let\indttsl=\ninettsl \let\indsf=\indrm \let\indbf=\indrm \setfont\indsc\scshape{10}{900} \font\indi=cmmi9 \font\indsy=cmsy9 \ifisJTeX \ifisASCII \font\indmin=min9 \font\indgt=goth9 \else \jfont\indmin=dm9 \jfont\indgt=dg9 \fi \else \let\indmin=\relax \let\indgt=\relax \fi \let\indmc=\indmin % ntp % Fonts for title page: \setfont\titlerm\rmbshape{12}{\magstep3} \setfont\titleit\itbshape{10}{\magstep4} \setfont\titlesl\slbshape{10}{\magstep4} \setfont\titlett\ttbshape{12}{\magstep3} \setfont\titlettsl\ttslshape{10}{\magstep4} \setfont\titlesf\sfbshape{17}{\magstep1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \ifisJTeX \ifisASCII \font\titlemc=goth10 scaled \magstep4 \else \jfont\titlemc=dg10 scaled \magstep4 \fi \else \let\titlemc=\relax \fi \def\authorrm{\secrm} % Chapter (and unnumbered) fonts (17.28pt). \setfont\chaprm\rmbshape{12}{\magstep2} \setfont\chapit\itbshape{10}{\magstep3} \setfont\chapsl\slbshape{10}{\magstep3} \setfont\chaptt\ttbshape{12}{\magstep2} \setfont\chapttsl\ttslshape{10}{\magstep3} \setfont\chapsf\sfbshape{17}{1000} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3} %\font\chapi=cmmi12 scaled \magstep2 \font\chapi=cmmi10 scaled \magstep3 % ntp \font\chapsy=cmsy10 scaled \magstep3 %** \ifisJTeX \ifisASCII \font\chapmin=goth10 scaled \magstep3 \else \jfont\chapmin=dg10 scaled \magstep3 \fi \else \let\chapmin=\relax \fi \let\chapgt=\chapmin %** % Section fonts (14.4pt). \setfont\secrm\rmbshape{12}{\magstep1} \setfont\secit\itbshape{10}{\magstep2} \setfont\secsl\slbshape{10}{\magstep2} \setfont\sectt\ttbshape{12}{\magstep1} \setfont\secttsl\ttslshape{10}{\magstep2} \setfont\secsf\sfbshape{12}{\magstep1} \let\secbf\secrm %** \ifisJTeX \ifisASCII \font\secmin=goth10 scaled \magstep2 \else \jfont\secmin=dg10 scaled \magstep2 \fi \else \let\secmin=\relax \fi \let\secgt=\secmin \ifisJTeX \let\authormc=\secmin \else \let\authormc=\relax \fi %** \setfont\secsc\scbshape{10}{\magstep2} %\font\seci=cmmi12 scaled \magstep1 \font\seci=cmmi10 scaled \magstep2 \font\secsy=cmsy10 scaled \magstep2 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad. % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded. % \setfont\ssecsl\slshape{10}{\magstep1} % \setfont\ssectt\ttshape{10}{\magstep1} % \setfont\ssecsf\sfshape{10}{\magstep1} %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. %\setfont\ssectt\ttshape{10}{1315} %\setfont\ssecsf\sfshape{10}{1315} %\let\ssecbf=\ssecrm % Subsection fonts (13.15pt). \setfont\ssecrm\rmbshape{12}{\magstephalf} \setfont\ssecit\itbshape{10}{1315} \setfont\ssecsl\slbshape{10}{1315} \setfont\ssectt\ttbshape{12}{\magstephalf} \setfont\ssecttsl\ttslshape{10}{1315} \setfont\ssecsf\sfbshape{12}{\magstephalf} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{\magstep1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 %** \ifisJTeX \ifisASCII \font\ssecmin=goth10 scaled \magstep1 \else \jfont\ssecmin=dg10 scaled \magstep1 \fi \else \let\ssecmin=\relax \fi \let\ssecgt=\ssecmin %** % The smallcaps and symbol fonts should actually be scaled \magstep1.5, % but that is not a standard magnification. % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts, we % don't bother to reset \scriptfont and \scriptscriptfont (which would % also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf \textfont\ttfam = \tentt \textfont\sffam = \tensf \ifisJTeX \ifisASCII \textfont\minfam = \tenmin \textfont\gtfam = \tengt % ntp \fi \fi } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this so that font changes will continue to work % in math mode, where it is the current \fam that is relevant in most % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam % \tenbf}, for example. By redefining \tenbf, we obviate the need to % redefine \bf itself. \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \let\tenmin=\textmin \let\tengt=\textgt % ntp@isl.mei.co.jp \resetmathfonts} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \resetmathfonts \setleading{25pt}} \def\titlefont#1{{\titlefonts\rm\titlemc #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \let\tenmin=\chapmin \let\tengt=\chapgt % ntp@isl.mei.co.jp \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \let\tenmin=\secmin \let\tengt=\secgt % ntp@isl.mei.co.jp \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \let\tenmin=\ssecmin \let\tengt=\ssecgt % ntp@isl.mei.co.jp \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? \def\indexfonts{% \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl \let\tenmin=\indmin \let\tengt=\indgt % ntp@isl.mei.co.jp \resetmathfonts \setleading{12pt}} % Set up the default fonts, so we can use them for creating boxes. % \textfonts % Define these so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000} \setfont\shortcontbf\bxshape{12}{1000} \setfont\shortcontsl\slshape{12}{1000} %** \ifisJTeX \ifisASCII \font\shortcontmc=min10 \font\shortcontgt=goth10 \else \jfont\shortcontmc=dm10 \jfont\shortcontgt=dg10 \fi \else \let\shortcontmc=\relax \let\shortcontgt=\relax \fi %** %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} \let\i=\smartitalic \let\var=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic \let\cite=\smartslanted \def\b#1{{\bf #1}} \let\strong=\b % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } \def\t#1{% {\tt \rawbackslash \frenchspacing #1}% \null } \let\ttfont=\t \def\samp#1{`\tclose{#1}'\null} \setfont\smallrm\rmshape{8}{1000} \font\smallsy=cmsy9 \def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% \vbox{\hrule\kern-0.4pt \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% \kern-0.4pt\hrule}% \kern-.06em\raise0.4pt\hbox{\angleright}}}} % The old definition, with no lozenge: %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @file, @option are the same as @samp. \let\file=\samp \let\option=\samp % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \frenchspacing #1% }% \null } % We *must* turn on hyphenation at `-' and `_' in \code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active % \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex } % % If we end up with any active - characters when handling the index, % just treat them as a normal -. \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} } \def\realdash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} \def\codex #1{\tclose{#1}\endgroup} %\let\exp=\tclose %Was temporary % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \def\kbdinputstyle{\parsearg\kbdinputstylexxx} \def\kbdinputstylexxx#1{% \def\arg{#1}% \ifx\arg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\arg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\arg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is kbdinputdistinct. (Too much of a hassle to call the macro, % the catcodes are wrong for parsearg to work.) \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\look}}\fi \else{\tclose{\kbdfont\look}}\fi} % For @url, @env, @command quotes seem unnecessary, so use \code. \let\url=\code \let\env=\code \let\command=\code % @uref (abbreviation for `urlref') takes an optional second argument % specifying the text to display. First (mandatory) arg is the url. % Perhaps eventually put in a hypertex \special here. % \def\uref#1{\urefxxx #1,,\finish} \def\urefxxx#1,#2,#3\finish{% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \unhbox0\ (\code{#1})% \else \code{#1}% \fi } % rms does not like the angle brackets --karl, 17may97. % So now @email is just like @uref. %\def\email#1{\angleleft{\tt #1}\angleright} \let\email=\uref % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % Explicit font changes: @r, @sc, undocumented @ii. %\def\r#1{{\rm #1}} % roman font \def\r#1{{\rm\mc #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @acronym downcases the argument and prints in smallcaps. \def\acronym#1{{\smallcaps \lowercase{#1}}} % @pounds{} is a sterling sign. \def\pounds{{\it\$}} \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @contentsaftertitlepage or @shortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \def\shorttitlepage{\parsearg\shorttitlepagezzz} \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \def\titlepage{\begingroup \parindent=0pt \textfonts \let\subtitlerm=\tenrm %** \let\subtitlemc=\tenmin %** % \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% %** \def\subtitlefont{\subtitlerm \subtitlemc \normalbaselineskip = 13pt \normalbaselines}% %** % % \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% %** \def\authorfont{\authorrm\authormc \normalbaselineskip = 16pt \normalbaselines}% %** % % Leave some space at the very top of the page. \vglue\titlepagetopglue % % Now you can print the title using @title. \def\title{\parsearg\titlezzz}% \def\titlezzz##1{\leftline{\titlefonts\rm ##1} % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Now you can put text using @subtitle. \def\subtitle{\parsearg\subtitlezzz}% \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% % % @author should come last, but may come many times. \def\author{\parsearg\authorzzz}% \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi {\authorfont \leftline{##1}}}% % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \oldpage \let\page = \oldpage \hbox{}}% % \def\page{\oldpage \hbox{}} } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi % \HEADINGSon } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } %%% Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make Tex use those variables \headline={{\textfonts\rm \mc \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \mc \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\oddheading{\parsearg\oddheadingxxx} \def\everyheading{\parsearg\everyheadingxxx} \def\evenfooting{\parsearg\evenfootingxxx} \def\oddfooting{\parsearg\oddfootingxxx} \def\everyfooting{\parsearg\everyfootingxxx} {\catcode`\@=0 % \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -\baselineskip \global\advance\vsize by -\baselineskip } \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} % }% unbind the catcode of @. % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\HEADINGSoff{ \global\evenheadline={\hfil} \global\evenfootline={\hfil} \global\oddheadline={\hfil} \global\oddfootline={\hfil}} \HEADINGSoff % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{ \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{ \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % Produces Day Month Year style of output. \def\today{\number\day\space \ifcase\month\or January\or February\or March\or April\or May\or June\or July\or August\or September\or October\or November\or December\fi \space\number\year} % Use this if you want the Month Day, Year style of output. %\def\today{\ifcase\month\or %January\or February\or March\or April\or May\or June\or %July\or August\or September\or October\or November\or December\fi %\space\number\day, \number\year} % @settitle line... specifies the title of the document, for headings % It generates no output of its own \def\thistitle{No Title} \def\settitle{\parsearg\settitlezzz} \def\settitlezzz #1{\gdef\thistitle{#1}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @vtable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} \def\internalBkitem{\smallbreak \parsearg\kitemzzz} \def\internalBkitemx{\itemxpar \parsearg\kitemzzz} \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% \itemzzz {#1}} \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% \itemzzz {#1}} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemfont{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. Unfortunately % we can't prevent a possible page break at the following % \baselineskip glue. \nobreak \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a table}} \def\itemx{\errmessage{@itemx while not in a table}} \def\kitem{\errmessage{@kitem while not in a table}} \def\kitemx{\errmessage{@kitemx while not in a table}} \def\xitem{\errmessage{@xitem while not in a table}} \def\xitemx{\errmessage{@xitemx while not in a table}} % Contains a kludge to get @end[description] to work. \def\description{\tablez{\dontindex}{1}{}{}{}{}} % @table, @ftable, @vtable. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} {\obeylines\obeyspaces% \gdef\tablex #1^^M{% \tabley\dontindex#1 \endtabley}} \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} {\obeylines\obeyspaces% \gdef\ftablex #1^^M{% \tabley\fnitemindex#1 \endtabley \def\Eftable{\endgraf\afterenvbreak\endgroup}% \let\Etable=\relax}} \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} {\obeylines\obeyspaces% \gdef\vtablex #1^^M{% \tabley\vritemindex#1 \endtabley \def\Evtable{\endgraf\afterenvbreak\endgroup}% \let\Etable=\relax}} \def\dontindex #1{} \def\fnitemindex #1{\doind {fn}{\code{#1}}}% \def\vritemindex #1{\doind {vr}{\code{#1}}}% {\obeyspaces % \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% \tablez{#1}{#2}{#3}{#4}{#5}{#6}}} \def\tablez #1#2#3#4#5#6{% \aboveenvbreak % \begingroup % \def\Edescription{\Etable}% Necessary kludge. \let\itemindex=#1% \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % \ifnum 0#4>0 \tableindent=#4\mil \fi % \ifnum 0#5>0 \advance \rightskip by #5\mil \fi % \def\itemfont{#2}% \itemmax=\tableindent % \advance \itemmax by -\itemmargin % \advance \leftskip by \tableindent % \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi% \def\Etable{\endgraf\afterenvbreak\endgroup}% \let\item = \internalBitem % \let\itemx = \internalBitemx % \let\kitem = \internalBkitem % \let\kitemx = \internalBkitemx % \let\xitem = \internalBxitem % \let\xitemx = \internalBxitemx % } % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \def\itemize{\parsearg\itemizezzz} \def\itemizezzz #1{% \begingroup % ended by the @end itemize \itemizey {#1}{\Eitemize} } \def\itemizey #1#2{% \aboveenvbreak % \itemmax=\itemindent % \advance \itemmax by -\itemmargin % \advance \leftskip by \itemindent % \exdentamount=\itemindent \parindent = 0pt % \parskip = \smallskipamount % \ifdim \parskip=0pt \parskip=2pt \fi% \def#2{\endgraf\afterenvbreak\endgroup}% \def\itemcontents{#1}% \let\item=\itemizeitem} % Set sfcode to normal for the chars that usually have another value. % These are `.?!:;,' \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \def\enumerate{\parsearg\enumeratezzz} \def\enumeratezzz #1{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% \begingroup % ended by the @end enumerate % % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call itemizey, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \itemizey{#1.}\Eenumerate\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % Definition of @item while inside @itemize. \def\itemizeitem{% \advance\itemno by 1 {\let\par=\endgraf \smallbreak}% \ifhmode \errmessage{In hmode at itemizeitem}\fi {\parskip=0in \hskip 0pt \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% \vadjust{\penalty 1200}}% \flushcr} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % % For those who want to use more than one line's worth of words in % the preamble, break the line within one argument and it % will parse correctly, i.e., % % @multitable {Column 1 template} {Column 2 template} {Column 3 % template} % Not: % @multitable {Column 1 template} {Column 2 template} % {Column 3 template} % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab, @multitable or @end multitable do not need to be on their % own lines, but it will not hurt if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % 2/1/96, to allow fractions to be given with more than one digit. \def\pickupwholefraction#1 {\global\advance\colcount by1 % \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% \setuptable} \newcount\colcount \def\setuptable#1{\def\firstarg{#1}% \ifx\firstarg\xendsetuptable\let\go\relax% \else \ifx\firstarg\xcolumnfractions\global\setpercenttrue% \else \ifsetpercent \let\go\pickupwholefraction % In this case arg of setuptable % is the decimal point before the % number given in percent of hsize. % We don't need this so we don't use it. \else \global\advance\colcount by1 \setbox0=\hbox{#1 }% Add a normal word space as a separator; % typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi% \fi% \ifx\go\pickupwholefraction\else\let\go\setuptable\fi% \fi\go} % multitable syntax \def\tab{&\hskip1sp\relax} % 2/2/96 % tiny skip here makes sure this column space is % maintained, even if it is never used. % @multitable ... @end multitable definitions: \def\multitable{\parsearg\dotable} \def\dotable#1{\bgroup \vskip\parskip \let\item\crcr \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% % % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % \everycr will reset column counter, \colcount, at the end of % each line. Every column entry will cause \colcount to advance by one. % The table preamble % looks at the current \colcount to find the correct column width. \everycr{\noalign{% % % \filbreak%% keeps underfull box messages off when table breaks over pages. % Maybe so, but it also creates really weird page breaks when the table % breaks over pages. Wouldn't \vfil be better? Wait until the problem % manifests itself, so it can be fixed for real --karl. \global\colcount=0\relax}}% % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup&\global\advance\colcount by 1\relax \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively marking % characters. \noindent\ignorespaces##\unskip\multistrut}\cr } \def\setmultitablespacing{% test to see if user has set \multitablelinespace. % If so, do nothing. If not, give it an appropriate dimension based on % current baselineskip. \ifdim\multitablelinespace=0pt %% strut to put in table in case some entry doesn't have descenders, %% to keep lines equally spaced \let\multistrut = \strut %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. \else \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 width0pt\relax} \fi \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi} \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within \newindex. {\catcode`\@=11 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}} } \def\defcodeindex{\parsearg\newcodeindex} % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \def\synindex#1 #2 {% \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname \expandafter\closeout\csname#1indfile\endcsname \expandafter\let\csname#1indfile\endcsname=\synindexfoo \expandafter\xdef\csname#1index\endcsname{% define \xxxindex \noexpand\doindex{#2}}% } % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. \def\syncodeindex#1 #2 {% \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname \expandafter\closeout\csname#1indfile\endcsname \expandafter\let\csname#1indfile\endcsname=\synindexfoo \expandafter\xdef\csname#1index\endcsname{% define \xxxindex \noexpand\docodeindex{#2}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} %********************************************* %*** For the compat'y with texinfo.tex.ntt %*** jtexinfo patch by S.Tomura 89-Dec-7 \def\Jempty{} \def\singleindexer #1{\singleindexerB#1[]\singleindexerA} \def\singleindexerB#1[#2]{\edef\Jone{#1}\edef\Jtwo{#2}% \ifx\Jempty\Jtwo\let\Jnext=\relax\let\singleindexerA=\singleindexerD% \else\let\Jnext=\singleindexerC\let\singleindexerA=\singleindexerE\fi% \Jnext} \def\singleindexerC#1[]{} \def\singleindexerD{\doind{\indexname}{\Jone}} \def\singleindexerE{\Jdoind{\indexname}{\Jone}{\Jtwo}} %**** end of patch %********************************************* % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} \def\indexdummies{% \def\ { }% % Take care of the plain tex accent commands. \def\"{\realbackslash "}% \def\`{\realbackslash `}% \def\'{\realbackslash '}% \def\^{\realbackslash ^}% \def\~{\realbackslash ~}% \def\={\realbackslash =}% \def\b{\realbackslash b}% \def\c{\realbackslash c}% \def\d{\realbackslash d}% \def\u{\realbackslash u}% \def\v{\realbackslash v}% \def\H{\realbackslash H}% % Take care of the plain tex special European modified letters. \def\oe{\realbackslash oe}% \def\ae{\realbackslash ae}% \def\aa{\realbackslash aa}% \def\OE{\realbackslash OE}% \def\AE{\realbackslash AE}% \def\AA{\realbackslash AA}% \def\o{\realbackslash o}% \def\O{\realbackslash O}% \def\l{\realbackslash l}% \def\L{\realbackslash L}% \def\ss{\realbackslash ss}% % Take care of texinfo commands likely to appear in an index entry. % (Must be a way to avoid doing expansion at all, and thus not have to % laboriously list every single command here.) \def\@{@}% will be @@ when we switch to @ as escape char. %\let\{ = \lbracecmd %\let\} = \rbracecmd \def\_{{\realbackslash _}}% \def\w{\realbackslash w }% \def\bf{\realbackslash bf }% %\def\rm{\realbackslash rm }% \def\sl{\realbackslash sl }% \def\sf{\realbackslash sf}% \def\tt{\realbackslash tt}% \def\gtr{\realbackslash gtr}% \def\less{\realbackslash less}% \def\hat{\realbackslash hat}% \def\TeX{\realbackslash TeX}% \def\dots{\realbackslash dots }% \def\result{\realbackslash result}% \def\equiv{\realbackslash equiv}% \def\expansion{\realbackslash expansion}% \def\print{\realbackslash print}% \def\error{\realbackslash error}% \def\point{\realbackslash point}% \def\copyright{\realbackslash copyright}% \def\tclose##1{\realbackslash tclose {##1}}% \def\code##1{\realbackslash code {##1}}% \def\env##1{\realbackslash env {##1}}% \def\command##1{\realbackslash command {##1}}% \def\option##1{\realbackslash option {##1}}% \def\dotless##1{\realbackslash dotless {##1}}% \def\samp##1{\realbackslash samp {##1}}% \def\,##1{\realbackslash ,{##1}}% \def\t##1{\realbackslash t {##1}}% \def\r##1{\realbackslash r {##1}}% \def\i##1{\realbackslash i {##1}}% \def\b##1{\realbackslash b {##1}}% \def\sc##1{\realbackslash sc {##1}}% \def\cite##1{\realbackslash cite {##1}}% \def\key##1{\realbackslash key {##1}}% \def\file##1{\realbackslash file {##1}}% \def\var##1{\realbackslash var {##1}}% \def\kbd##1{\realbackslash kbd {##1}}% \def\dfn##1{\realbackslash dfn {##1}}% \def\emph##1{\realbackslash emph {##1}}% \def\acronym##1{\realbackslash acronym {##1}}% % % Handle some cases of @value -- where the variable name does not % contain - or _, and the value does not contain any % (non-fully-expandable) commands. \let\value = \expandablevalue % \unsepspaces } % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\\leavevmode \penalty \@M \ ). {\obeyspaces \gdef\unsepspaces{\obeyspaces\let =\space}} % \indexnofonts no-ops all font-change commands. % This is used when outputting the strings to sort the index by. \def\indexdummyfont#1{#1} \def\indexdummytex{TeX} \def\indexdummydots{...} \def\indexnofonts{% % Just ignore accents. \let\,=\indexdummyfont \let\"=\indexdummyfont \let\`=\indexdummyfont \let\'=\indexdummyfont \let\^=\indexdummyfont \let\~=\indexdummyfont \let\==\indexdummyfont \let\b=\indexdummyfont \let\c=\indexdummyfont \let\d=\indexdummyfont \let\u=\indexdummyfont \let\v=\indexdummyfont \let\H=\indexdummyfont \let\dotless=\indexdummyfont % Take care of the plain tex special European modified letters. \def\oe{oe}% \def\ae{ae}% \def\aa{aa}% \def\OE{OE}% \def\AE{AE}% \def\AA{AA}% \def\o{o}% \def\O{O}% \def\l{l}% \def\L{L}% \def\ss{ss}% \let\w=\indexdummyfont \let\t=\indexdummyfont \let\r=\indexdummyfont \let\i=\indexdummyfont \let\b=\indexdummyfont \let\emph=\indexdummyfont \let\strong=\indexdummyfont \let\cite=\indexdummyfont \let\sc=\indexdummyfont %Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |... %\let\tt=\indexdummyfont \let\tclose=\indexdummyfont \let\code=\indexdummyfont \let\env=\indexdummyfont \let\command=\indexdummyfont \let\option=\indexdummyfont \let\file=\indexdummyfont \let\samp=\indexdummyfont \let\kbd=\indexdummyfont \let\key=\indexdummyfont \let\var=\indexdummyfont \let\TeX=\indexdummytex \let\dots=\indexdummydots \def\@{@}% } % To define \realbackslash, we must make \ not be an escape. % We must first make another character (@) an escape % so we do not become unable to do a definition. {\catcode`\@=0 \catcode`\\=\other @gdef@realbackslash{\}} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % For \ifx comparisons. \def\emptymacro{\empty} % Most index entries go through here, but \dosubind is the general case. % \def\doind#1#2{\dosubind{#1}{#2}\empty} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % \empty if called from \doind, as we usually are. The main exception % is with defuns, which call us directly. % \def\dosubind#1#2#3{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% \fi {% \count255=\lastpenalty {% \indexdummies % Must do this here, since \bf, etc expand at this stage \escapechar=`\\ {% \let\folio = 0% We will expand all macros now EXCEPT \folio. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % \def\thirdarg{#3}% % % If third arg is present, precede it with space in sort key. \ifx\thirdarg\emptymacro \let\subentry = \empty \else \def\subentry{ #3}% \fi % % First process the index-string with all font commands turned off % to get the string to sort by. {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% % % Now produce the complete index entry, with both the sort key and the % original text, including any font commands. \toks0 = {#2}% \edef\temp{% \write\csname#1indfile\endcsname{% \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% }% % % If third (subentry) arg is present, add it to the index string. \ifx\thirdarg\emptymacro \else \toks0 = {#3}% \edef\temp{\temp{\the\toks0}}% \fi % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write will make \lastskip zero. The result is that sequences % like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % \iflinks \ifvmode \skip0 = \lastskip \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi \fi % \temp % do the write % % \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi \fi }% }% \penalty\count255 }% } % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} %********************************************* %*** jtexinfo patch by S.Tomura 89-Nov-23 %*** \def\Jdoind #1#2#3{% {\indexdummies % Must do this here, since \bf, etc expand at this stage \count10=\lastpenalty % \escapechar=`\\% {\let\folio=0% Expand all macros now EXCEPT \folio \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash in the indx. % % Now process the index-string once, with all font commands turned off, % to get the string to sort the index by. {\indexnofonts \xdef\temp1{#3}% }% % Now produce the complete index entry. We process the index-string again, % this time with font commands expanded, to get what to print in the index. \edef\temp{% \write \csname#1indfile\endcsname{% \realbackslash entry {\temp1}{\folio}{#2}}}% \temp }% \penalty\count10}} %*** end of patch %********************************************* % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \def\printindex{\parsearg\doprintindex} \def\doprintindex#1{\begingroup \dobreak \chapheadingskip{10000}% % \indexfonts \rm \mc \tolerance = 9500 \indexbreaks % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. (Index is nonexistent) \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 (Index is empty) \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\rawbackslashxx}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \penalty -300 % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf\secgt #1}% \vskip .33\baselineskip plus .1\baselineskip % % Do our best not to break after the initial. \nobreak }} % This typesets a paragraph consisting of #1, dot leaders, and then #2 % flush to the right margin. It is used for index and table of contents % entries. The paragraph is indented by \leftskip. % \def\entry#1#2{\begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing columns. \vskip 0pt plus1pt % % Start a ``paragraph'' for the index entry so the line breaking % parameters we've set above will have an effect. \noindent % % Insert the text of the index entry. TeX will do line-breaking on it. #1% % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \def\tempa{{\rm }}% \def\tempb{#2}% \edef\tempc{\tempa}% \edef\tempd{\tempb}% \ifx\tempc\tempd\ \else% % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ #2% The page number ends the paragraph. \fi% \par \endgroup} % Like \dotfill except takes at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary #1#2{ {\parfillskip=0in \parskip=0in \hangindent =1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {\global\setbox\partialpage = \vbox{% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case, we must prevent the second \partialpage from % simply overwriting the first, causing us to lose the page. % This will preserve it until a real output routine can ship it % out. Generally, \partialpage will be empty when this runs and % this will be a no-op. \unvbox\partialpage % % Unvbox the main output page. \unvbox255 \kern-\topskip \kern\baselineskip }}% \eject % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \advance\vsize by -\ht\partialpage \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } \def\pagesofar{% % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \advance\vsize by \ht\partialpage \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } \def\enddoublecolumns{% \output = {% % Split the last of the double-column material. Leave on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize. \pagegoal = \vsize }% \eject \endgroup % started in \begindoublecolumns } \def\balancecolumns{% % Called at the end of the double column material. \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Define chapters, sections, etc. \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ \def\appendixletter{\char\the\appendixno} % Each @chapter defines this as the name of the chapter. % page headings and footings can use it. @section does likewise. \def\thischapter{} \def\thissection{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raise/lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % Choose a numbered-heading macro % #1 is heading level if unmodified by @raisesections or @lowersections % #2 is text for heading \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \chapterzzz{#2} \or \seczzz{#2} \or \numberedsubseczzz{#2} \or \numberedsubsubseczzz{#2} \else \ifnum \absseclevel<0 \chapterzzz{#2} \else \numberedsubsubseczzz{#2} \fi \fi } % like \numhead, but chooses appendix heading levels \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \appendixzzz{#2} \or \appendixsectionzzz{#2} \or \appendixsubseczzz{#2} \or \appendixsubsubseczzz{#2} \else \ifnum \absseclevel<0 \appendixzzz{#2} \else \appendixsubsubseczzz{#2} \fi \fi } % like \numhead, but chooses numberless heading levels \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \unnumberedzzz{#2} \or \unnumberedseczzz{#2} \or \unnumberedsubseczzz{#2} \or \unnumberedsubsubseczzz{#2} \else \ifnum \absseclevel<0 \unnumberedzzz{#2} \else \unnumberedsubsubseczzz{#2} \fi \fi } % @chapter, @appendix, @unnumbered. \def\thischaptername{No Chapter Title} \outer\def\chapter{\parsearg\chapteryyy} \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% \chapmacro {#1}{\the\chapno}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% % We don't substitute the actual chapter name into \thischapter % because we don't want its macros evaluated now. \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% {\the\chapno}}}% \temp \donoderef \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\def\appendix{\parsearg\appendixyyy} \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz \def\appendixzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \appendixno by 1 \message{\putwordAppendix\space \appendixletter}% \chapmacro {#1}{\putwordAppendix{} \appendixletter}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% {\putwordAppendix{} \appendixletter}}}% \temp \appendixnoderef \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\def\centerchap{\parsearg\centerchapyyy} \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} % @top is like @unnumbered. \outer\def\top{\parsearg\unnumberedyyy} \outer\def\unnumbered{\parsearg\unnumberedyyy} \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz \def\unnumberedzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}\message{(\the\toks0)}% % \unnumbchapmacro {#1}% \gdef\thischapter{#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% \temp \unnumbnoderef \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % Sections. \outer\def\numberedsec{\parsearg\secyyy} \def\secyyy #1{\numhead1{#1}} % normally calls seczzz \def\seczzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% {\the\chapno}{\the\secno}}}% \temp \donoderef \nobreak } \outer\def\appendixsection{\parsearg\appendixsecyyy} \outer\def\appendixsec{\parsearg\appendixsecyyy} \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz \def\appendixsectionzzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% {\appendixletter}{\the\secno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz \def\unnumberedseczzz #1{% \plainsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% \temp \unnumbnoderef \nobreak } % Subsections. \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz \def\numberedsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% {\the\chapno}{\the\secno}{\the\subsecno}}}% \temp \donoderef \nobreak } \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz \def\appendixsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% {\appendixletter}{\the\secno}{\the\subsecno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz \def\unnumberedsubseczzz #1{% \plainsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% {\the\toks0}}}% \temp \unnumbnoderef \nobreak } % Subsubsections. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz \def\numberedsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \temp \donoderef \nobreak } \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz \def\appendixsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz \def\unnumberedsubsubseczzz #1{% \plainsubsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% {\the\toks0}}}% \temp \unnumbnoderef \nobreak } % These are variants which are not "outer", so they can appear in @ifinfo. % Actually, they should now be obsolete; ordinary section commands should work. \def\infotop{\parsearg\unnumberedzzz} \def\infounnumbered{\parsearg\unnumberedzzz} \def\infounnumberedsec{\parsearg\unnumberedseczzz} \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} \def\infoappendix{\parsearg\appendixzzz} \def\infoappendixsec{\parsearg\appendixseczzz} \def\infoappendixsubsec{\parsearg\appendixsubseczzz} \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} \def\infochapter{\parsearg\chapterzzz} \def\infosection{\parsearg\sectionzzz} \def\infosubsection{\parsearg\subsectionzzz} \def\infosubsubsection{\parsearg\subsubsectionzzz} % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading % NOTE on use of \vbox for chapter headings, section headings, and such: % 1) We use \vbox rather than the earlier \line to permit % overlong headings to fold. % 2) \hyphenpenalty is set to 10000 because hyphenation in a % heading is obnoxious; this forbids it. % 3) Likewise, headings look best if no \parindent is used, and % if justification is not attempted. Hence \raggedright. \def\majorheading{\parsearg\majorheadingzzz} \def\majorheadingzzz #1{% {\advance\chapheadingskip by 10pt \chapbreak }% {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm\mc #1\hfill}}\bigskip \par\penalty 200} \def\chapheading{\parsearg\chapheadingzzz} \def\chapheadingzzz #1{\chapbreak % {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm\mc #1\hfill}}\bigskip \par\penalty 200} % @heading, @subheading, @subsubheading. \def\heading{\parsearg\plainsecheading} \def\subheading{\parsearg\plainsubsecheading} \def\subsubheading{\parsearg\plainsubsubsecheading} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. %%% Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{ \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon \def\CHAPFplain{ \global\let\chapmacro=\chfplain \global\let\unnumbchapmacro=\unnchfplain \global\let\centerchapmacro=\centerchfplain} % Plain chapter opening. % #1 is the text, #2 the chapter number or empty if unnumbered. \def\chfplain#1#2{% \pchapsepmacro {% \chapfonts \rm\mc \def\chapnum{#2}% \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent = \wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % Plain opening for unnumbered. \def\unnchfplain#1{\chfplain{#1}{}} % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerchfplain#1{{% \def\centerparametersmaybe{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt }% \chfplain{#1}{}% }} \CHAPFplain % The default \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm\mc #1\hfill}}\bigskip \par\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt \hfill {\rm\mc #1}\hfill}}\bigskip \par\nobreak } \def\CHAPFopen{ \global\let\chapmacro=\chfopen \global\let\unnumbchapmacro=\unnchfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip {-1000}} \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} \def\plainsecheading#1{\sectionheading{sec}{}{#1}} % Subsection titles. \newskip \subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} % Subsubsection titles. \let\subsubsecheadingskip = \subsecheadingskip \let\subsubsecheadingbreak = \subsecheadingbreak \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} % Print any size section title. % % #1 is the section type (sec/subsec/subsubsec), #2 is the section % number (maybe empty), #3 the text. \def\sectionheading#1#2#3{% {% \expandafter\advance\csname #1headingskip\endcsname by \parskip \csname #1headingbreak\endcsname }% {% % Switch to the right set of fonts. \csname #1fonts\endcsname \rm\mc % % Only insert the separating space if we have a section number. \def\secnum{#2}% \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% % \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent = \wd0 % zero if no section number \unhbox0 #3}% }% \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak } \message{toc,} \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. We supply {\folio} at the end of the % argument, which will end up as the last argument to the \...entry macro. % % We open the .toc file here instead of at @setfilename or any other % given time so that @contents can be put in the document anywhere. % \newif\iftocfileopened \def\writetocentry#1{% \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi \iflinks \write\tocfile{#1{\folio}}\fi } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Finish up the main text and prepare to read what we've written % to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \unnumbchapmacro{#1}\def\thischapter{}% \savepageno = \pageno \begingroup % Set up to handle contents files properly. \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 % We can't do this, because then an actual ^ in a section % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \pageno = \lastnegativepageno \fi } % Normal (long) toc. \def\contents{% \startcontents{\putwordTableofContents}% \openin 1 \jobname.toc \ifeof 1 \else \closein 1 \input \jobname.toc \fi \vfill \eject \endgroup \lastnegativepageno = \pageno \pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortContents}% % \let\chapentry = \shortchapentry \let\unnumbchapentry = \shortunnumberedentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \let\mc=\shortcontmc \let\gt=\shortcontgt \rm\mc \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\secentry ##1##2##3##4{} \def\unnumbsecentry ##1##2{} \def\subsecentry ##1##2##3##4##5{} \def\unnumbsubsecentry ##1##2{} \def\subsubsecentry ##1##2##3##4##5##6{} \def\unnumbsubsubsecentry ##1##2{} \openin 1 \jobname.toc \ifeof 1 \else \closein 1 \input \jobname.toc \fi \vfill \eject \endgroup \lastnegativepageno = \pageno \pageno = \savepageno } \let\shortcontents = \summarycontents % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Chapter-level things, for both the long and short contents. \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} % See comments in \dochapentry re vbox and related settings \def\shortchapentry#1#2#3{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}% } % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter. % We could simplify the code here by writing out an \appendixentry % command in the toc file for appendices, instead of using \chapentry % for both, but it doesn't seem worth it. \setbox0 = \hbox{\shortcontrm \putwordAppendix } \newdimen\shortappendixwidth \shortappendixwidth = \wd0 \def\shortchaplabel#1{% % We typeset #1 in a box of constant width, regardless of the text of % #1, so the chapter titles will come out aligned. \setbox0 = \hbox{#1}% \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi % % This space should be plenty, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) \advance\dimen0 by 1.1em \hbox to \dimen0{#1\hfil}% } \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}} % Sections. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} % Subsections. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} % And subsubsections. \def\subsubsecentry#1#2#3#4#5#6{% \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} % This parameter controls the indentation of the various levels. \newdimen\tocindent \tocindent = 3pc % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno{#2}}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno{#2}}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno{#2}}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno{#2}}% \endgroup} % Final typesetting of a toc entry; we use the same \entry macro as for % the index entries, but we want to suppress hyphenation here. (We % can't do that in the \entry macro, since index entries might consist % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) \def\tocentry#1#2{\begingroup \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks % Do not use \turnoffactive in these arguments. Since the toc is % typeset in cmr, so characters such as _ would come out wrong; we % have to do the usual translation tricks. \entry{#1}{#2}% \endgroup} % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm\mc #1}} \def\doshortpageno#1{{\rm\mc #1}} \def\chapentryfonts{\secfonts \rm\mc} \def\secentryfonts{\textfonts} \let\subsecentryfonts = \textfonts \let\subsubsecentryfonts = \textfonts \message{environments,} % Since these characters are used in examples, it should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % Furthermore, these definitions must come after we define our fonts. \newbox\dblarrowbox \newbox\longdblarrowbox \newbox\pushcharbox \newbox\bullbox \newbox\equivbox \newbox\errorbox %{\tentt %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil} % Adapted from the manmac format (p.420 of TeXbook) %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex % depth .1ex\hfil} %} % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. \def\point{$\star$} \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} % Adapted from the TeXbook's \boxit. {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} \global\setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{ \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % The @error{} command. \def\error{\leavevmode\lower.7ex\copy\errorbox} % @tex ... @end tex escapes into raw Tex temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain tex @ character. \def\tex{\begingroup \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie \catcode `\%=14 \catcode 43=12 % plus \catcode`\"=12 \catcode`\==12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \escapechar=`\\ % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\*=\ptexstar \let\t=\ptext % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% \let\Etex=\endgroup} % Define @lisp ... @endlisp. % @lisp does a \begingroup so it can rebind things, % including the definition of @endlisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % {\obeyspaces % \gdef\sepspaces{\obeyspaces\let =\tie}} % Define \obeyedspace to be our active space, whatever it is. This is % for use in \parsearg. {\sepspaces% \global\let\obeyedspace= } % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip % \def\aboveenvbreak{{\advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip \penalty-50 \vskip\envskipamount \fi}} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \long\def\cartouche{% \begingroup \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt %we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing=\comment \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \hsize=\cartinner \kern3pt \begingroup \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \def\Ecartouche{% \endgroup \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \endgroup }} % This macro is called at the beginning of all the @example variants, % inside a group. \def\nonfillstart{% \aboveenvbreak \inENV % This group ends at the end of the body \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \singlespace \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt \parindent = 0pt \emergencystretch = 0pt % don't try to avoid overfull boxes % @cartouche defines \nonarrowing to inhibit narrowing % at next level down. \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \let\exdent=\nofillexdent \let\nonarrowing=\relax \fi } % Define the \E... control sequence only if we are inside the particular % environment, so the error checking in \end will work. % % To end an @example-like environment, we first end the paragraph (via % \afterenvbreak's vertical glue), and then the group. That way we keep % the zero \parskip that the environments set -- \parskip glue will be % inserted at the beginning of the next paragraph in the document, after % the environment. % \def\nonfillfinish{\afterenvbreak\endgroup} % @lisp: indented, narrowed, typewriter font. \def\lisp{\begingroup \nonfillstart \let\Elisp = \nonfillfinish \tt \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @example: Same as @lisp. \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} % @small... is usually equivalent to the non-small (@smallbook % redefines). We must call \example (or whatever) last in the % definition, since it reads the return following the @example (or % whatever) command. % % This actually allows (for example) @end display inside an % @smalldisplay. Too bad, but makeinfo will catch the error anyway. % \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. % Originally contributed by Pavel@xerox. \def\smalllispx{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}% \def\Esmallexample{\nonfillfinish\endgroup}% \indexfonts \lisp } % @display: same as @lisp except keep current font. % \def\display{\begingroup \nonfillstart \let\Edisplay = \nonfillfinish \gobble } % @smalldisplay (when @smallbook): @display plus smaller fonts. % \def\smalldisplayx{\begingroup \def\Esmalldisplay{\nonfillfinish\endgroup}% \indexfonts \rm \mc \display } % @format: same as @display except don't narrow margins. % \def\format{\begingroup \let\nonarrowing = t \nonfillstart \let\Eformat = \nonfillfinish \gobble } % @smallformat (when @smallbook): @format plus smaller fonts. % \def\smallformatx{\begingroup \def\Esmallformat{\nonfillfinish\endgroup}% \indexfonts \rm \mc \format } % @flushleft (same as @format). % \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} % @flushright. % \def\flushright{\begingroup \let\nonarrowing = t \nonfillstart \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill \gobble } % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. % \def\quotation{% \begingroup\inENV %This group ends at the end of the @quotation body {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \singlespace \parindent=0pt % We have retained a nonzero parskip for the environment, since we're % doing normal filling. So to avoid extra space below the environment... \def\Equotation{\parskip = 0pt \nonfillfinish}% % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \advance\rightskip by \lispnarrowing \exdentamount = \lispnarrowing \let\nonarrowing = \relax \fi } \message{defuns,} % Define formatter for defuns % First, allow user to change definition object font (\df) internally \def\setdeffont #1 {\csname DEF#1\endcsname} \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deftypemargin \deftypemargin=12pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\parencount % define \functionparens, which makes ( and ) and & do special things. % \functionparens affects the group it is contained in. \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active \catcode`\[=\active \catcode`\]=\active} % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) {\activeparens % Now, smart parens don't turn on until &foo (see \amprm) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} % This is used to turn on special parens % but make & act ordinary (given that it's active). \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} % Definitions of (, ) and & used in args for functions. % This is the definition of ( outside of all parentheses. \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested \global\advance\parencount by 1 } % % This is the definition of ( when already inside a level of parens. \gdef\opnested{\char`\(\global\advance\parencount by 1 } % \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. % also in that case restore the outer-level definition of (. \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi \global\advance \parencount by -1 } % If we encounter &foo, then turn on ()-hacking afterwards \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } % \gdef\normalparens{\boldbrax\let&=\ampnr} } % End of definition inside \activeparens %% These parens (in \boldbrax) actually are a little bolder than the %% contained text. This is especially needed for [ and ] \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } \def\ampnr{\&} \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} % First, defname, which formats the header line itself. % #1 should be the function name. % #2 should be the type of definition, such as "Function". \def\defname #1#2{% % Get the values of \leftskip and \rightskip as they were % outside the @def... \dimen2=\leftskip \advance\dimen2 by -\defbodyindent \noindent \setbox0=\hbox{\hskip \deflastargmargin{\rm\mc #2}\hskip \deftypemargin}% \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations \parshape 2 0in \dimen0 \defargsindent \dimen1 % Now output arg 2 ("Function" or some such) % ending at \deftypemargin from the right margin, % but stuck inside a box of width 0 so it does not interfere with linebreaking {% Adjust \hsize to exclude the ambient margins, % so that \rightline will obey them. \advance \hsize by -\dimen2 \rlap{\rightline{{\rm\mc #2}\hskip -1.25pc }}}% % Make all lines underfull and no complaints: \tolerance=10000 \hbadness=10000 \advance\leftskip by -\defbodyindent \exdentamount=\defbodyindent {\df #1}\enskip % Generate function name } % Actually process the body of a definition % #1 should be the terminating control sequence, such as \Edefun. % #2 should be the "another name" control sequence, such as \defunx. % #3 should be the control sequence that actually processes the header, % such as \defunheader. \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\activeparens\spacesplit#3}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % 61 is `=' \obeylines\activeparens\spacesplit#3} % #1 is the \E... control sequence to end the definition (which we define). % #2 is the \...x control sequence for consecutive fns (which we define). % #3 is the control sequence to call to resume processing. % #4, delimited by the space, is the class name. % \def\defmethparsebody#1#2#3#4 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#4}}} % @deftypemethod has an extra argument that nothing else does. Sigh. % #1 is the \E... control sequence to end the definition (which we define). % #2 is the \...x control sequence for consecutive fns (which we define). % #3 is the control sequence to call to resume processing. % #4, delimited by the space, is the class name. % #5 is the method's return type. % \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#5}}} % These parsing functions are similar to the preceding ones % except that they do not make parens into active characters. % These are used for "variables" since they have no arguments. \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\spacesplit#3}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % \obeylines\spacesplit#3} % This is used for \def{tp,vr}parsebody. It could probably be used for % some of the others, too, with some judicious conditionals. % \def\parsebodycommon#1#2#3{% \begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines } \def\defvrparsebody#1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% \spacesplit{#3{#4}}% } % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the % type is just `struct', because we lose the braces in `{struct % termios}' when \spacesplit reads its undelimited argument. Sigh. % \let\deftpparsebody=\defvrparsebody % % So, to get around this, we put \empty in with the type name. That % way, TeX won't find exactly `{...}' as an undelimited argument, and % won't strip off the braces. % \def\deftpparsebody #1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% \spacesplit{\parsetpheaderline{#3{#4}}}\empty } % Fine, but then we have to eventually remove the \empty *and* the % braces (if any). That's what this does. % \def\removeemptybraces\empty#1\relax{#1} % After \spacesplit has done its work, this is called -- #1 is the final % thing to call, #2 the type name (which starts with \empty), and #3 % (which might be empty) the arguments. % \def\parsetpheaderline#1#2#3{% #1{\removeemptybraces#2\relax}{#3}% }% \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\spacesplit{#3{##2}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\spacesplit{#3{#5}}} % Split up #2 at the first space token. % call #1 with two arguments: % the first is all of #2 before the space token, % the second is all of #2 after that space token. % If #2 contains no space token, all of it is passed as the first arg % and the second is passed as empty. {\obeylines \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% \ifx\relax #3% #1{#2}{}\else #1{#2}{#3#4}\fi}} % So much for the things common to all kinds of definitions. % Define @defun. % First, define the processing that is wanted for arguments of \defun % Use this to expand the args and terminate the paragraph they make up \def\defunargs #1{\functionparens \sl % Expand, preventing hyphenation at `-' chars. % Note that groups don't affect changes in \hyphenchar. \hyphenchar\tensl=0 #1% \hyphenchar\tensl=45 \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil \endgraf\nobreak\vskip -\parskip\nobreak } \def\deftypefunargs #1{% % Expand, preventing hyphenation at `-' chars. % Note that groups don't affect changes in \hyphenchar. % Use \boldbraxnoamp, not \functionparens, so that & is not special. \boldbraxnoamp \tclose{#1}% avoid \code because of side effects on active chars \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil \endgraf\nobreak\vskip -\parskip\nobreak } % Do complete processing of one @defun or @defunx line already parsed. % @deffn Command forward-char nchars \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defun == @deffn Function \def\defun{\defparsebody\Edefun\defunx\defunheader} \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{Function}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @deftypefun int foobar (int @var{foo}, float @var{bar}) \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} % #1 is the data type. #2 is the name and args. \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} % #1 is the data type, #2 the name, #3 the args. \def\deftypefunheaderx #1#2 #3\relax{% \doind {fn}{\code{#2}}% Make entry in function index \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}% \deftypefunargs {#3}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} % \defheaderxcond#1\relax$$$ % puts #1 in @code, followed by a space, but does nothing if #1 is null. \def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi} % #1 is the classification. #2 is the data type. #3 is the name and args. \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} % #1 is the classification, #2 the data type, #3 the name, #4 the args. \def\deftypefnheaderx #1#2#3 #4\relax{% \doind {fn}{\code{#3}}% Make entry in function index \begingroup \normalparens % notably, turn off `&' magic, which prevents % at least some C++ text from working \defname {\defheaderxcond#2\relax$$$#3}{#1}% \deftypefunargs {#4}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defmac == @deffn Macro \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{Macro}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defspec == @deffn Special Form \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{Special Form}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % This definition is run if you use @defunx % anywhere other than immediately after a @defun or @defunx. \def\deffnx #1 {\errmessage{@deffnx in invalid context}} \def\defunx #1 {\errmessage{@defunx in invalid context}} \def\defmacx #1 {\errmessage{@defmacx in invalid context}} \def\defspecx #1 {\errmessage{@defspecx in invalid context}} \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}} \def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}} % @defmethod, and so on % @defop CATEGORY CLASS OPERATION ARG... \def\defop #1 {\def\defoptype{#1}% \defopparsebody\Edefop\defopx\defopheader\defoptype} \def\defopheader #1#2#3{% \dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index \begingroup\defname {#2}{\defoptype{} on #1}% \defunargs {#3}\endgroup % } % @deftypemethod CLASS RETURN-TYPE METHOD ARG... % \def\deftypemethod{% \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} % % #1 is the class name, #2 the data type, #3 the method name, #4 the args. \def\deftypemethodheader#1#2#3#4{% \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index \begingroup \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}% \deftypefunargs{#4}% \endgroup } % @defmethod == @defop Method % \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} % % #1 is the class name, #2 the method name, #3 the args. \def\defmethodheader#1#2#3{% \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index \begingroup \defname{#2}{\putwordMethodon\ \code{#1}}% \defunargs{#3}% \endgroup } % @defcv {Class Option} foo-class foo-flag \def\defcv #1 {\def\defcvtype{#1}% \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} \def\defcvarheader #1#2#3{% \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index \begingroup\defname {#2}{\defcvtype{} of #1}% \defvarargs {#3}\endgroup % } % @defivar == @defcv {Instance Variable} \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} \def\defivarheader #1#2#3{% \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index \begingroup\defname {#2}{Instance Variable of #1}% \defvarargs {#3}\endgroup % } % These definitions are run if you use @defmethodx, etc., % anywhere other than immediately after a @defmethod, etc. \def\defopx #1 {\errmessage{@defopx in invalid context}} \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}} \def\defcvx #1 {\errmessage{@defcvx in invalid context}} \def\defivarx #1 {\errmessage{@defivarx in invalid context}} % Now @defvar % First, define the processing that is wanted for arguments of @defvar. % This is actually simple: just print them in roman. % This must expand the args and terminate the paragraph they make up \def\defvarargs #1{\normalparens #1% \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak} % @defvr Counter foo-count \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} % @defvar == @defvr Variable \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index \begingroup\defname {#1}{Variable}% \defvarargs {#2}\endgroup % } % @defopt == @defvr {User Option} \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index \begingroup\defname {#1}{User Option}% \defvarargs {#2}\endgroup % } % @deftypevar int foobar \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} % #1 is the data type. #2 is the name, perhaps followed by text that % is actually part of the data type, which should not be put into the index. \def\deftypevarheader #1#2{% \dovarind#2 \relax% Make entry in variables index \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak \endgroup} \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} % @deftypevr {Global Flag} int enable \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} \def\deftypevrheader #1#2#3{\dovarind#3 \relax% \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak \endgroup} % This definition is run if you use @defvarx % anywhere other than immediately after a @defvar or @defvarx. \def\defvrx #1 {\errmessage{@defvrx in invalid context}} \def\defvarx #1 {\errmessage{@defvarx in invalid context}} \def\defoptx #1 {\errmessage{@defoptx in invalid context}} \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}} \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}} % Now define @deftp % Args are printed in bold, a slight difference from @defvar. \def\deftpargs #1{\bf \defvarargs{#1}} % @deftp Class window height width ... \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} % This definition is run if you use @deftpx, etc % anywhere other than immediately after a @deftp, etc. \def\deftpx #1 {\errmessage{@deftpx in invalid context}} \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\undefined \newwrite\macscribble \def\scanmacro#1{% \begingroup \newlinechar`\^^M \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{#1}% \immediate\closeout\macscribble \let\xeatspaces\eatspaces \input \jobname.tmp \endgroup } \else \def\scanmacro#1{% \begingroup \newlinechar`\^^M \let\xeatspaces\eatspaces\scantokens{#1}\endgroup} \fi \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % Utility routines. % Thisdoes \let #1 = #2, except with \csnames. \def\cslet#1#2{% \expandafter\expandafter \expandafter\let \expandafter\expandafter \csname#1\endcsname \csname#2\endcsname} % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=12\catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \. % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. \def\macrobodyctxt{% \catcode`\~=12 \catcode`\^=12 \catcode`\_=12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \catcode`\+=12 \catcode`\{=12 \catcode`\}=12 \catcode`\@=12 \catcode`\^^M=12 \usembodybackslash} \def\macroargctxt{% \catcode`\~=12 \catcode`\^=12 \catcode`\_=12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \catcode`\+=12 \catcode`\@=12 \catcode`\\=12} % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0% \else \expandafter\parsemargdef \argl;% \fi \expandafter\ifx \csname macsave.\the\macname\endcsname \relax \cslet{macsave.\the\macname}{\the\macname}% \else \message{Warning: redefining \the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \def\unmacro{\parsearg\unmacroxxx} \def\unmacroxxx#1{% \expandafter\ifx \csname macsave.\the\macname\endcsname \relax \errmessage{Macro \the\macname\ not defined.}% \else \cslet{#1}{macsave.#1}% \expandafter\let \csname macsave.\the\macname\endcsname \undefined \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname #1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.blah for each blah % in the params list, to be ##N where N is the position in that list. % That gets used by \mbodybackslash (above). % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. \def\parsemargdef#1;{\paramno=0\def\paramlist{}% \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1% \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% % This defines the macro itself. There are six cases: recursive and % nonrecursive macros of zero, one, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname} \expandafter\xdef\csname\the\macname xx\endcsname##1{% \csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname} \expandafter\xdef\csname\the\macname xx\endcsname##1{% \csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \fi \fi} \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg) \def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \next} \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's job is to define \lastnode. \def\node{\ENVcheck\parsearg\nodezzz} \def\nodezzz#1{\nodexxx [#1,]} \def\nodexxx[#1,#2]{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\relax % The sectioning commands (@chapter, etc.) call these. \def\donoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}% {Ysectionnumberandtype}% \global\let\lastnode=\relax \fi } \def\unnumbnoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% \global\let\lastnode=\relax \fi } \def\appendixnoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}% {Yappendixletterandtype}% \global\let\lastnode=\relax \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \def\anchor#1{\setref{#1}{Ynothing}} % \setref{NAME}{SNT} defines a cross-reference point NAME, namely % NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have % to set \indexdummies so commands such as @code in a section title % aren't expanded. It would be nicer not to expand the titles in the % first place, but there's so many layers that that is hard to do. % \def\setref#1#2{{% \indexdummies \dosetq{#1-title}{Ytitle}% \dosetq{#1-pg}{Ypagenumber}% \dosetq{#1-snt}{#2} }} % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \def\printedmanual{\ignorespaces #5}% \def\printednodename{\ignorespaces #3}% \setbox1=\hbox{\printedmanual}% \setbox0=\hbox{\printednodename}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. \def\printednodename{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. \def\printednodename{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. \def\printednodename{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printednodename{\ignorespaces #1}% \fi% \fi \fi \fi % % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not % insert empty discretionaries after hyphens, which means that it will % not find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, this % is a loss. Therefore, we give the text of the node name again, so it % is as if TeX is seeing it for the first time. \ifdim \wd1 > 0pt \putwordsection{} ``\printednodename'' in \cite{\printedmanual}% \else % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\normalturnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % [mynode], [\printednodename],\space % page 3 \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi \endgroup} % \dosetq is the interface for calls from other macros % Use \normalturnoffactive so that punctuation chars such as underscore % and backslash work in node names. (\turnoffactive doesn't do \.) \def\dosetq#1#2{% {\let\folio=0 \normalturnoffactive \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% \iflinks \next \fi }% } % \internalsetq {foo}{page} expands into % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} % When the aux file is read, ' is the escape character \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} % Things to be expanded by \internalsetq \def\Ypagenumber{\folio} \def\Ytitle{\thissection} \def\Ynothing{} \def\Ysectionnumberandtype{% \ifnum\secno=0 \putwordChapter\xreftie\the\chapno % \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % \else \ifnum \subsubsecno=0 % \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % \else % \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % \fi \fi \fi } \def\Yappendixletterandtype{% \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % \else \ifnum \subsubsecno=0 % \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % \else % \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % \fi \fi \fi } \gdef\xreftie{'tie} % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Non-3.0. \else \def\linenumber{\the\inputlineno:\space} \fi % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. \def\refx#1#2{% \expandafter\ifx\csname X#1\endcsname\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs \message{\linenumber Undefined cross reference `#1'.}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \csname X#1\endcsname \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. % \def\xrdef#1{\begingroup % Reenable \ as an escape while reading the second argument. \catcode`\\ = 0 \afterassignment\endgroup \expandafter\gdef\csname X#1\endcsname } % Read the last existing aux file, if any. No error if none exists. \def\readauxfile{\begingroup \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other \catcode`\@=\other \catcode`\^=\other % It was suggested to define this as 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % Make the characters 128-255 be printing characters {% \count 1=128 \def\loop{% \catcode\count 1=\other \advance\count 1 by 1 \ifnum \count 1<256 \loop \fi }% }% % The aux file uses ' as the escape (for now). % Turn off \ as an escape so we do not lose on % entries which were dumped with control sequences in their names. % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ % Reference to such entries still does not work the way one would wish, % but at least they do not bomb out when the aux file is read in. \catcode`\{=1 \catcode`\}=2 \catcode`\%=\other \catcode`\'=0 \catcode`\\=\other % \openin 1 \jobname.aux \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue \global\warnedobstrue \fi % Open the new aux file. TeX will close it automatically at exit. \openout\auxfile=\jobname.aux \endgroup} % Footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment \let\ptexfootnote=\footnote {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \footnotezzz }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset and anything else that uses % \parseargline fail inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \long\gdef\footnotezzz{\insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % % Hang the footnote text off the number. \hang \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut \futurelet\next\fo@t } \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t \else\let\next\f@t\fi \next} \def\f@@t{\bgroup\aftergroup\@foot\let\next} \def\f@t#1{#1\@foot} \def\@foot{\strut\egroup} }%end \catcode `\@=11 % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % \def\setleading#1{% \normalbaselineskip = #1\relax \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt} % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else \closein 1 % Do not bother showing banner with post-v2.7 epsf.tex (available in % doc/epsf.tex until it shows up on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi % \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://ftp.tug.org/tex/epsf.tex.} % % Only complain once about lack of epsf.tex. \def\image#1{% \ifx\epsfbox\undefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is just the usual extra ignored arg for parsing this stuff. \def\imagexxx#1,#2,#3,#4\finish{% % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi % If the image is by itself, center it. \ifvmode \nobreak\medskip \nobreak \centerline{\epsfbox{#1.eps}}% \bigbreak \else \epsfbox{#1.eps}% \fi } \message{paper sizes,} % And other related parameters. \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be so finicky about underfull hboxes, either. \hbadness = 2000 % Following George Bush, just get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. This makes it come to about 9pt for the 8.5x11 format. We % call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = \hsize \divide\emergencystretch by 45 \fi } % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; % 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can % set \parskip and call \setleading for \baselineskip. % \def\internalpagesizes#1#2#3#4#5#6{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 0.6in \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \setleading{13.2pt}% % % If page is nothing but text, make it come out even. \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% }} % Use @smallbook to reset parameters for 7x9.5 (or so) format. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \setleading{12pt}% % \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \deftypemargin = 0pt \defbodyindent = .5cm % \let\smalldisplay = \smalldisplayx \let\smallexample = \smalllispx \let\smallformat = \smallformatx \let\smalllisp = \smalllispx }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \setleading{12pt}% \parskip = 3pt plus 2pt minus 1pt % \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% % \tolerance = 700 \hfuzz = 1pt }} % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin % 29mm, hence bottom margin 28mm, nominal side margin 3cm. \def\afourlatex{{\globaldefs = 1 \setleading{13.6pt}% % \afourpaper \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% % \globaldefs = 0 }} % Use @afourwide to print on European A4 paper in wide format. \def\afourwide{% \afourpaper \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% % \globaldefs = 0 } % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \def\pagesizes{\parsearg\pagesizesxxx} \def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{13.2pt}% % \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% }} % Set default to letter. % \letterpaper \ifisJTeX % a4 is common alson in Japan \afourpaper \def\smallbook{\message{@smallbook is disabled in jtexinfo mode}} \input texinfo-ja.tex \else \def\strappendix{Appendix } \def\strchapapp{Chapter } \def\strchaptail{} \def\strsecapp{Section} \def\strsectail{} \def\strsecref{section ``\printednodename'' in \cite{\printedmanual}} \def\strseeapp{see } \def\strseetail{} \def\strSeeapp{See } \def\strSeetail{} \def\strpageapp{page} \def\strpagetail{} \def\strtoc{Table Of Contents} \def\strstoc{Short Contents} \fi \message{and turning on texinfo input format.} % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \catcode`\~=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\+=\other \def\normaldoublequote{"} \def\normaltilde{~} \def\normalcaret{^} \def\normalunderscore{_} \def\normalverticalbar{|} \def\normalless{<} \def\normalgreater{>} \def\normalplus{+} % This macro is used to make a character print one way in ttfont % where it can probably just be output, and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} % Subroutine for the previous macro. \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} %\catcode 27=\active %\def^^[{$\diamondsuit$} % Set up an active definition for =, but don't enable it most of the time. {\catcode`\==\active \global\def={{\tt \char 61}}} \catcode`+=\active \catcode`\_=\active % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} \catcode`\@=0 % \rawbackslashxx output one backslash character in current font \global\chardef\rawbackslashxx=`\\ %{\catcode`\\=\other %@gdef@rawbackslashxx{\}} % \rawbackslash redefines \ as input to do \rawbackslashxx. {\catcode`\\=\active @gdef@rawbackslash{@let\=@rawbackslashxx }} % \normalbackslash outputs one backslash in fixed width font. \def\normalbackslash{{\tt\rawbackslashxx}} % Say @foo, not \foo, in error messages. \escapechar=`\@ % \catcode 17=0 % Define control-q \catcode`\\=\active % Used sometimes to turn off (effectively) the active characters % even after parsing them. @def@turnoffactive{@let"=@normaldoublequote @let\=@realbackslash @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater @let+=@normalplus} @def@normalturnoffactive{@let"=@normaldoublequote @let\=@normalbackslash @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater @let+=@normalplus} % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\{ in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also back turn on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active} % These look ok in all fonts, so just make them not special. The @rm below % makes sure that the current font starts out as the newly loaded cmr10 @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other @textfonts @rm @c Local variables: @c page-delimiter: "^\\\\message" @c update-date-leading-regexp: "def\\texinfoversion{" @c update-date-date-regexp: "[-0-9.]+" @c update-date-format-string: "%Y-%m-%d" @c update-date-trailing-regexp: "}" @c eval: (and(load "update-date" t t)(add-hook 'write-file-hooks 'update-date)) @c End: ebnetd-1.0.dfsg.1/doc-ja/ebnetd-ja.texi0000644000175000017500000023315707725347757017135 0ustar mhattamhatta\input texinfo @c -*-texinfo-*- @c %** start of header @setfilename ebnetd-ja.info @settitle ebNETD @c %** end of header @include version.texi @dircategory CD-ROM Book Utilities @direntry * EBNETD: (ebnetd). Network EB Library server. * NDTPD: (ndtpd). Server for accessing CD-ROM books with NDTP. * ebHTTPD: (ebhttpd). Server for accessing CD-ROM books with HTTP. @end direntry @ifinfo EBNETD: CD-ROM 書籍サーバ群、笠原基之 Copyright @copyright{} 1997, 98, 99, 2000, 01, 03 Motoyuki Kasahara Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Free Software Foundation, Inc. @end ifinfo @titlepage @title ebNETD/NDTPD/ebHTTPD @subtitle CD-ROM 書籍サーバ群 @subtitle 第 @value{EDITION} 版 (EBNETD バージョン @value{VERSION} に対応) @subtitle @value{UPDATED} @author 笠原 基之 @page @vskip 0pt plus 1filll Copyright @copyright{} 1997, 98, 99, 2000, 01, 03 Motoyuki Kasahara Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Free Software Foundation, Inc. @end titlepage @node Top, Introduction, (dir), (dir) @ifinfo この文書は第 @value{EDITION} 版です。EBNETD バージョン @value{VERSION} に対応しています。 @end ifinfo @menu * Introduction:: はじめに * Installation:: EBNETD のインストール * Configuration File:: 設定ファイルの書き方 * Configuration Checker:: 設定ファイルの確認 * Setup Your Environment:: 環境設定 * Start ebnetd:: @code{ebnetd} の起動 * Start ndtpd:: @code{ndtpd} の起動 * Start ebhttpd:: @code{ebhttpd} の起動 * Terminate and Restart:: @code{ndtpd} の終了および再始動 * Daily Works:: 毎日の管理作業 * Network License:: ネットワークライセンス @detailmenu --- The Detailed Node Listing --- EBNETD のインストール * Basic Installation:: 基本的なインストール方法 * Compilers and Options:: コンパイラとコンパイルオプションの選択 * Multiple Architectures:: 複数のアーキテクチャでコンパイル * Installation Names:: インストール名の変更 * Optional Features:: 取捨選択の可能な機能 * System Type:: システムの種類 * Sharing Defaults:: @code{configure} スクリプトのデフォルト を共通の値に設定するには * Operation Controls:: @code{configure} の動作の制御 * Optional Feature List:: 取捨選択の可能な機能の一覧 設定ファイル * Single Directive:: 単独指示子の一般形 * Single Directive List:: 単独指示子の一覧 * Group Directive:: 複合指示子の一般形 * Book Group Directive:: 複合指示子の一覧 * Sample Configuration:: 設定ファイルの例 設定ファイルのチェックコマンド * Invoking ebncheck:: @code{ebncheck} の実行 * ebncheck Options:: @code{ebncheck} のオプション 環境設定 * Services:: @file{services} ファイルの設定 * Syslog:: @file{syslog.conf} ファイルの設定 * Working Directory:: EBNETD の作業用ディレクトリ * Mount CD-ROM Books:: CD-ROM 書籍のマウント * Appendix Package:: appendix パッケージの用意 @code{ebnetd} の起動 * ebnetd Standalone:: @code{ebnetd} をスタンドアロンで起動 * ebnetd Child of inetd:: @code{ebnetd} を @code{inetd} 経由で起動 * ebnetd Child of xinetd:: @code{ebnetd} を @code{xinetd} 経由で起動 * ebnetd Test with telnet:: @code{telnet} による @code{ebnetd} の確認 * ebnetd Options:: @code{ebnetd} のオプション @code{ndtpd} の起動 * ndtpd Standalone:: @code{ndtpd} をスタンドアロンで起動 * ndtpd Child of inetd:: @code{ndtpd} を @code{inetd} 経由で起動 * ndtpd Child of xinetd:: @code{ndtpd} を @code{xinetd} 経由で起動 * ndtpd Test with telnet:: @code{telnet} による @code{ndtpd} の確認 * ndtpd Options:: @code{ndtpd} のオプション @code{ebhttpd} の起動 * ebhttpd Standalone:: @code{ebhttpd} をスタンドアロンで起動 * ebhttpd Child of inetd:: @code{ebhttpd} を @code{inetd} 経由で起動 * ebhttpd Child of xinetd:: @code{ebhttpd} を @code{xinetd} 経由で起動 * ebhttpd Test with telnet:: @code{telnet} による @code{ebhttpd} の確認 * ebhttpd Options:: @code{ebhttpd} のオプション サーバの終了および再始動 * Invoke Server Controler:: サーバ制御コマンドの実行 * ebncontrol Options:: サーバ制御コマンドのオプション 毎日の管理作業 * ebndaily Options:: @code{ebndaily} のオプション @end detailmenu @end menu @c =================================================================== @node Introduction, Installation, Top, Top @chapter はじめに 本 EBNETD 配布パッケージには、@code{ebnetd}, @code{ndtpd}, @code{ebhttpd} という 3 つのサーバコマンドを収録しています。 これらはいずれも、TCP/IP を用いて遠隔ホストの CD-ROM 書籍にアクセスする ためのサーバです。 UNIX 系 OS のシステム上で動作させることができます。 @table @code @item ebnetd @code{ebnetd} は EBNET プロトコルのサーバで、EBNET は @dfn{EB ライブラリ} と通信を行うために設計されたプロトコルです。 EB ライブラリは、CD-ROM 書籍のアクセスを行う、C 言語のライブラリです。 @code{ndtpd}, @code{ebhttpd} も EB ライブラリを使用しています。 @code{ebnetd} を使用すると、EB ライブラリのアプリケーションは、遠隔ホスト の CD-ROM 書籍にアクセスできるようになります。 EB ライブラリについての詳細は、@url{http://www.sra.co.jp/m-kasahr/eb/} を参照して下さい。 @item ndtpd @code{ndtpd} は NDTP (Network Dictionary Transfer Protocol) サーバです。 NDTP を最初に実装したサーバは @dfn{dserver} で、@code{ndtpd} は dserver-2.2 と上位互換性があります。 Web ページ @url{http://www.sra.co.jp/m-kasahr/ndtpd/related.html} に @code{ndtpd} と通信可能な NDTP クライアントの一覧が載っています。 @item ebhttpd @code{ebhttpd} は WWW (World Wide Web) サーバです。 HTTP/1.0 および HTTP/1.1 (Hypertext Transfer Protocol version 1.0 および 1.1) に対応しています。 @end table これらサーバ群は、EB, EBG, EBXA, EBXA-C, S-EBXA および EPWING 形式の CD-ROM 書籍に対応しています。 これらの形式の CD-ROM 書籍は、日本で一般的に使われています。 CD-ROM 書籍自体は ISO 9660 形式になっていますので、他の ISO 9660 形式 と同じ要領でマウントすることができます。 サーバは、デフォルトではスタンドアロンで動作しますが、@code{inetd} 経由で起動するようにすることも可能です。 EBNETD はフリーソフトウェアです。あなたは、Free Software Foundation が 公表した GNU General Public License (GNU 一般公有使用許諾) バージョン 2 あるいはそれ以降の各バージョンの中からいずれかを選択し、そのバージョ ンが定める条項に従って本プログラムを再頒布または変更することができます。 EBNETD は有用とは思いますが、頒布にあたっては、市場性及び特定目的適合性 についての暗黙の保証を含めて、いかなる保証も行ないません。詳細について は GNU General Public License をお読み下さい。 加えて、あなたは自分の所有する CD-ROM 書籍の使用許諾も守らなくてはいけ ません。 EBNETD はフリーソフトウェアですが、あなたの書籍が自由に使えるものである とは限りません。 使用を許されていないホストやユーザに対して、あなたの書籍を公開しないで 下さい。 この文書は EBNETD バージョン @value{VERSION} に対応しています。 最新の EBNETD は @url{ftp://ftp.sra.co.jp/pub/misc/eb/} から入手できます。 EBNETD に関する情報は @url{http://www.sra.co.jp/people/m-kasahr/ebnetd/} から得ることができます。 コメントやバグの報告は @email{m-kasahr@@sra.co.jp} 宛に、日本語か英語でお送り下さい。 @c =================================================================== @node Installation, Configuration File, Introduction, Top @chapter EBNETD のインストール EBNETD は CD-ROM 書籍にアクセスするために、EB ライブラリを使用しています。 EBNETD をインストールする前に、EB ライブラリ 3.3 もしくはそれ以降の バージョンをインストールする必要があります。 最新の EB ライブラリは @url{ftp://ftp.sra.co.jp/pub/misc/eb/} から入手できます。 EB ライブラリに関する情報は @url{http://www.sra.co.jp/people/m-kasahr/eb/} から得ることができます。 @menu * Basic Installation:: 基本的なインストール方法 * Compilers and Options:: コンパイラとコンパイルオプションの選択 * Multiple Architectures:: 複数のアーキテクチャでコンパイル * Installation Names:: インストール名の変更 * Optional Features:: 取捨選択の可能な機能 * System Type:: システムの種類 * Sharing Defaults:: @code{configure} スクリプトのデフォルト を共通の値に設定するには * Operation Controls:: @code{configure} の動作の制御 * Optional Feature List:: 取捨選択の可能な機能の一覧 @end menu @c ------------------------------------------------------------------- @node Basic Installation, Compilers and Options, Installation, Installation @section 基本的なインストール方法 以下に記したのは、一般的なインストールの方法です。 @code{configure} シェルスクリプトは、コンパイル中に使用される、システム 依存のチェック項目の値を正しく推定しようと努めます。 @code{configure}は、判定した値を利用してパッケージ中の各ディレクトリの @file{Makefile}を生成します。 加えて、システムに依存する定義内容を記した @file{.h} ファイルを一つ もしくはいくつか生成することもあります。 最後に、@code{configure} は @code{config.status} というシェルスクリプト @file{config.cache}、@file{config.log} というファイルを生成します。 @code{config.status} は、現在のコンフィグレーションを後で再度生成すると きに用います。 @file{config.cache} は、再度コンフィグレーションを行うときにスピードアップ を図るために、テストの結果を保存してあります。 @file{config.log} には、(主に @code{configure} のデバッグに役立つような) コンピュータの出力が記録されています。 あなたがパッケージをコンパイルするにあたって、特別なことをしなければ ならなかったときは、@code{configure} がどのような判定をしていたのかを 調べてみて、@file{README} に記されたアドレスに宛てて、相違点や指摘を メールで送って下さい。 そうすれば、次回のリリースに向けて検討されると思います。 もし、@file{config.cache} に見られたくない結果が記録されている場合は、 その部分を削除したり編集したりしても構いません。 @file{configure.in} というファイルは、@code{autoconf} というプログラムが @file{configure} を生成するときに参照します。 あなたにとって @file{configure.in} というファイルが必要になるのは、 @file{configure.in} の内容を変更したい場合か、@code{autoconf} のもっと 新しいバージョンで @file{configure} を生成したい場合の、いずれかだけです。 @noindent パッケージの最も単純なコンパイル方法は次の通りです。 @enumerate @item パッケージのソースコードが置かれているディレクトリに移動 (@code{cd}) し、 あなたのシステム向けのコンフィグレーションを行うために @samp{./configure} を実行します。 あなたが古いバージョンの System V で @code{csh} を使用している場合は、 @code{csh} 自身がスクリプトを実行してしまわないように、 @samp{sh. /configure} とする必要があるかも知れません。 @code{configure} の実行には少々時間がかかります。 実行している間は、どのような項目をチェックしているのかを記したメッセージ が出力されます。 @item @samp{make} を実行してパッケージをコンパイルします。 @item 任意で、パッケージに付属しているセルフテストを実行する場合は、 @samp{make check} を実行します。 @item @samp{make install} を実行して、プログラムおよびデータファイル、 ドキュメントをインストールします。 @item @samp{make clean} を実行すると、生成されたプログラムのバイナリファイルや オブジェクトファイルを、ソースコードの置かれたディレクトリから消すことが できます。 一緒に @code{configure} が生成したファイルも消すには (こうすることで、 別の種類のコンピュータでパッケージをコンパイルできます)、 @samp{make distclean} を実行します。 @samp{make maintainer-clean} というターゲットも用意されていますが、 これは主にそのパッケージの開発者のためのものです。 @samp{make maintainer-clean} を実行してしまうと、パッケージに元々 含まれていたファイルを再生成するために、他のいろいろなプログラムを 入手しなくてはいけなくなるかも知れません。 @end enumerate @c ------------------------------------------------------------------- @node Compilers and Options, Multiple Architectures, Basic Installation, Installation @section コンパイラとコンパイルオプション システムによっては、@code{configure} スクリプトが理解していない、 コンパイルやリンクのための特別なオプションを与える必要があります。 環境変数を通して、@code{configure} に対して初期値を与えることができます。 Bourne シェルと互換性のあるシェルを使用している場合は、次のようにします。 @example CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure @end example @noindent @code{env} というコマンドがシステムにあるならば、次のようにすることも できます。 @example env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure @end example @c ------------------------------------------------------------------- @node Multiple Architectures, Installation Names, Compilers and Options, Installation @section 複数のアーキテクチャでのインストール オブジェクトファイルをアーキテクチャ毎に別々のディレクトリに置くように することにより、種類の異なる複数のコンピュータが、パッケージを同時に コンパイルできます。 これを行うには、GNU @code{make} のように、@code{VPATH} 変数に対応した @code{make} を使用する必要があります。 オブジェクトファイルや実行形式のファイルを置いておきたいディレクトリに 移動 (@code{cd}) して、そこで @code{configure} スクリプトを実行します。 @code{configure} は、自身の存在するディレクトリおよび @file{..} に ソースコードがあるかどうかを自動的に調べます。 @code{VPATH} 変数に対応していない @code{make} を使用している場合は、 ソースコードディレクトリの下で、一度に一つのアーキテクチャずつコンパイル していくしかありません。一つのアーキテクチャのコンパイルが終わったら、 別のアーキテクチャでコンパイルするために再コンフィグレーションを行う 前に @samp{make distclean} を実行して下さい。 @c ------------------------------------------------------------------- @node Installation Names, Optional Features, Multiple Architectures, Installation @section インストール名 デフォルトでは、@samp{make install} を実行すると、パッケージ中のファイル が @file{/usr/local/bin}、@file{/usr/local/man} などにインストール されます。 @code{configure} に対して @samp{--prefix=@var{パス}} オプションを指定 することで、@file{/usr/local} 以外のインストール先を指定するとができます。 アーキテクチャに依存したファイルとそうでないファイルを、それぞれ異なった インストール先にインストールすることも可能です。 @code{configure} に対して @samp{--exec-prefix=@var{パス}} を指定すると、 プログラムやライブラリなどのインストール先が @var{パス} に変わります。 ドキュメントや、データファイルなどは、通常のインストール先にインストール されます。 加えて、あなたが通常とは異なったディレクトリレイアウトを採用している場合 は、@samp{--bindir=@var{パス}} といったオプションを指定することで、特定 の種類のファイルのインストール先だけを変えることができます。 @samp{configure --help} を実行すると、どのようなディレクトリを変更できる のか、どのような種類のファイルがどのディレクトリにインストールされるのかが 分かります。 パッケージがサポートしているならば、@code{configure} に @samp{--program-prefix=@var{接頭辞}} や @samp{--program-suffix=@var{接尾辞}} というオプションを与えることで、 インストール時にプログラム名に接頭辞や接尾辞を付加することができます。 @c ------------------------------------------------------------------- @node Optional Features, System Type, Installation Names, Installation @section 取捨選択の可能な機能 パッケージによっては、@code{configure} が @samp{--enable-@var{機能}} オプションを認識することがあります。 ここで @var{機能} は、パッケージにおいて取捨選択の可能な機能を表します。 また、@samp{--with-@var{パッケージ}} オプションを認識することもあります。 ここで @var{パッケージ} は、@samp{gnu-as} や (X ウィンドウシステムの ための) @samp{x} といったものです。 @file{README} ファイルでは、どのような @samp{--enable-}、@samp{--with-} オプションをパッケージが認識するのか、記しておくべきです。 一般に、X ウィンドウシステムを使用しているパッケージでは、@code{configure} は X の include ファイルとライブラリファイルを自動的に見つけ出すことが できますが、見つけられない場合は、@code{configure} のオプション @samp{--x-includes=@var{ディレクトリ}} と @samp{--x-libraries=@var{ディレクトリ}} を用いることでディレクトリの 位置を明示的に指定することができます。 @c ------------------------------------------------------------------- @node System Type, Sharing Defaults, Optional Features, Installation @section システムの種類の指定 設定項目によっては、@code{configure} が自動的に識別できなくても、 パッケージが動作するホストの種類を基に決定しなければならないときもあります。 通常、@code{configure} はそのホストの種類を識別することができますが、 もしも @code{configure} がホストの種類を識別できないという旨のメッセージ を出力してきたときは、@samp{--host=@var{種類}} オプションを与えて下さい。 @var{種類} は @samp{sun4} のようなシステムの種類を表した短い名前か、 あるいは次のように 3 つの項からなる正式名称のいずれかです。 @example @var{CPU}-@var{社名}-@var{システム} @end example @noindent それぞれの項にどのような値が指定可能なのかについては、@file{config.sub} ファイルをご覧下さい。 パッケージが @file{config.sub} を含んでいないのであれば、そのパッケージ はホストの種類を識別する必要がないことを意味しています。 あなたがクロスコンパイルのためのコンパイラツールをインストールしようと している場合は、@samp{--target=@var{種類}} オプションを使用することで、 どのホスト向けのコードを生成させるのかを指定できます。そして、 @samp{--build=@var{種類}} オプションを使用することで、パッケージを コンパイルしようとしているシステムの種類を指定することができます。 @c ------------------------------------------------------------------- @node Sharing Defaults, Operation Controls, System Type, Installation @section デフォルト値の共有 複数の @code{configure} スクリプトに対して共通のデフォルト値を設定したい ときは、サイト毎に @file{config.site} というシェルスクリプトを作成し、 そこに @code{CC} や @code{cache_file}、@code{prefix} といった変数の デフォルト値を記述して下さい。 @code{configure} は @file{@var{prefix}/share/config.site} があれば、 それを調べ、次に @file{@var{prefix}/etc/config.site} があればそれを 調べます。 あるいは、環境変数 @code{CONFIG_SITE} を設定することで、サイト固有の スクリプトの位置を指定することもできます。 ただし、すべての @code{configure} スクリプトがサイト固有のスクリプトを見 に行くわけではありませんので、ご注意下さい。 @c ------------------------------------------------------------------- @node Operation Controls, Optional Feature List, Sharing Defaults, Installation @section @code{configure} の動作の制御 @code{configure} は次に記したオプションを認識します。 @table @code @item --cache-file=@var{ファイル} テストの結果の読み込みや書き出しに使用するファイルは、通常 @file{./config.cache} ですが、代わりに @var{ファイル} を用います。 @code{configure} をデバッグするときは、@var{ファイル} に @file{/dev/null} を指定することで、キャッシュを抑制することができます。 @item --help @code{configure} のオプションの一覧を表示して、終了します。 @item --quiet @itemx --silent @itemx -q どのチェック項目を行っているのかを示すメッセージを出力しません。 通常のメッセージ出力をすべて抑制するには、@file{/dev/null} へ リダイレクトして下さい (ただし、エラーメッセージについては出力されて しまいますが)。 @item --srcdir=@var{ディレクトリ} パッケージのソースコードを探し出す際に、@var{ディレクトリ} を探します。 通常、@code{configure} は自動的にディレクトリを決定します。 @item --version @code{configure} スクリプトがどのバージョンの Autoconf によって生成された のかを表示して、終了します。 @end table @noindent 役に立つ場面は限られますが、@code{configure} には他にもいくつかの オプションが用意されています。 @c ------------------------------------------------------------------- @node Optional Feature List, , Operation Controls, Installation @section 選択可能な機能の一覧 本パッケージの @code{configure} は以下に記した @samp{--enable-} および @samp{--with-} オプションを認識します。 @table @code @item --with-logdir=@var{dir} @code{ebndaily} がローテーションを行う syslog ファイル が置かれるディレクトリのデフォルトとして @var{dir} を指定します。 無指定時は、@samp{@var{localstatedir}/ebnetd/log} です。 @item --with-eb-conf=@var{file} EB ライブラリの設定ファイルとして @var{file} を読み込みます。 デフォルトは、@samp{@var{sysconfdir}/eb.conf} です。 @item --with-gnu-ld C コンパイラが GNU ld を使用していると仮定します。 デフォルトは、@samp{no} です。 @item --enable-ipv6 IPv6 に対応させます。 システムが IPv6 に対応している場合、 The default value is @samp{yes} if the system supports IPv6. @end table @c =================================================================== @node Configuration File, Configuration Checker, Installation, Top @chapter 設定ファイル @code{ebnetd}, @code{ndtpd}, @code{ebhttpd} を始動させるためには、まず 設定ファイルを編集する必要があります。 サーバは、始動時および再始動時にこのファイルを読み込みます。 このファイルの内容によって、サーバの様々な挙動が決定されます。 EBNETD を @file{/usr/local} 以下にインストールし、かつ、マシン固有の 読み込み専用のデータを置くディレクトリ (@code{sysconfdir}) の位置を 変更していなければ、無指定時に読み込まれる設定ファイルは @file{/usr/local/etc/ebnetd.conf} になります。 設定ファイルの位置は、コマンドラインオプション @samp{--configuration-file} (あるいは @samp{-c}) を用いることで変更が可能です (@pxref{ebnetd Options, , @code{ebnetd} のオプション})。 設定ファイルの中では、空行、および空白以外の最初の文字がハッシュ記号 (@samp{#}) である行は無視されます。 他の行はすべて、@dfn{単独指示子 (single directive)} か @dfn{複合指示子 (group directive)} のいずれかでなくてはなりません。 単独指示子と複合指示子は、どのような順序で定義しても差し支えありません。 各行は、改行文字を含め 511 文字を越えてはなりません。 @menu * Single Directive:: 単独指示子の一般形 * Single Directive List:: 単独指示子の一覧 * Group Directive:: 複合指示子の一般形 * Book Group Directive:: 複合指示子の一覧 * Sample Configuration:: 設定ファイルの例 @end menu @c ------------------------------------------------------------------- @node Single Directive, Single Directive List, Configuration File, Configuration File @section 単独指示子の一般形 単独指示子とは、1 行で完結する指示子です。 単独指示子の一般形は次の通りです。 @example @var{指示子の名前} @var{指示子の値} @end example @noindent 以下の例では、@code{syslog-facility} が指示子の名前、@samp{local0} が その値です。 @example syslog-facility local0 @end example @noindent 指示子名の大文字と小文字は区別されますので、@samp{syslog-facility} を @samp{Syslog-Facility} と書くことはできません。 指示子の名前と値の区切りには、空白かタブを用います。 連続した空白とタブが、行頭および行末にあった場合、それらは無視されます。 @c ------------------------------------------------------------------- @node Single Directive List, Group Directive, Single Directive, Configuration File @section 単独指示子の一覧 単独指示子には次のようなものがあります。 @table @code @item ebnet-port @code{ebnet-port} 指示子では、@code{ebnetd} が見張るポートの番号を指定 します。 指示子の値は、TCP のサービス名 (例: @samp{EBNET}) か、ポート番号 (例: @samp{22010}) でなくてはいけません。 @code{ebnetd} を @code{inetd} 経由で起動した場合は、この指示子は 無視されます。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は @samp{EBNET} です。 @code{ndtpd}, @code{ebhttpd} はこの指示子を常に無視します。 @item ndtp-port @code{ndtp-port} 指示子では、@code{ndtpd} が見張るポートの番号を指定 します。 指示子の値は、TCP のサービス名 (例: @samp{NDTP}) か、ポート番号 (例: @samp{2010}) でなくてはいけません。 @code{ebnetd} を @code{inetd} 経由で起動した場合は、この指示子は 無視されます。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は @samp{NDTP} です。 @code{ebnetd}, @code{ebhttpd} はこの指示子を常に無視します。 @item http-port @code{http-port} 指示子では、@code{ebhttpd} が見張るポートの番号を 指定します。 指示子の値は、TCP のサービス名 (例: @samp{HTTP}) か、ポート番号 (例: @samp{80}) でなくてはいけません。 @code{ebhttpd} を @code{inetd} 経由で起動した場合は、この指示子は 無視されます。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は @samp{HTTP} です。 @code{ebnetd}, @code{ebhttpd} はこの指示子を常に無視します。 @item user @code{user} 指示子では、サーバプロセスの実効ユーザを指定します。 指示子の値は、ユーザ名 (例: @samp{nobody}) か、ユーザ ID (例: @samp{65535}) でなくてはいけません。 別のユーザに実効ユーザを変える場合は、スーパユーザ特権を有した状態で サーバを起動しなくてはなりません。 実効ユーザの変更に失敗すると、サーバは走行の継続を断念します。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 この指示子を定義しなかった場合、サーバプロセスの実効ユーザは変化 しません。 @samp{ndtpuser} のようなダミーのユーザアカウントを一つ作って、それを この指示子で指定することをお薦めします。 @item group @code{group} 指示子では、サーバプロセスの実効グループを指定します。 指示子の値は、ユーザ名 (例: @samp{nogroup}) か、グループ ID (例: @samp{65534}) でなくてはいけません。 実効グループの変更に失敗すると、サーバは走行の継続を断念します。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することもできません。 この指示子を定義しなかった場合、サーバプロセスの実効グループは変化 しません。 @samp{ndtpgrp} のようなダミーのグループアカウントを一つ作って、それを この指示子で指定することをお薦めします。 @item max-clients @code{max-clients} 指示子では、同時にサーバに接続できるクライアントの 数の上限を指定します。 指示子の値は、0 以上の整数でなくてはいけません。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は @samp{1} です。 指示子の値を 0 に設定すると、無制限になります。 @item hosts @code{hosts} 指示子では、どのホストがサーバに接続でき、どのホストが 接続できないのかを指定します。 指示子の値は IP アドレス、ホスト名、@var{アドレス/ネットマスク} の いずれかです。 加えて、直前に感嘆符 (@samp{!}) を付けることができます。 指示子の値が感嘆符で始まっていた場合は、それに続く IP アドレスまたは ホスト名にマッチするホストからの接続要求は拒否します。 感嘆符がない場合は、指示子の値にマッチするホストからの接続要求は許可 します。 @sp 1 @example @group # `host.xxx.yyy.jp' からの接続を許可する。 hosts host.xxx.yyy.jp # `127.0.0.1' からの接続を許可する。 hosts 127.0.0.1 # `192.24.1.0/24'.からの接続を拒否する。 hosts !192.24.1.0/24 @end group @end example @noindent ホスト名に限り、アスタリスク (@samp{*}) と疑問符 (@samp{?}) を使う ことができます。 アスタリスクは、先頭の感嘆符を除いた任意の 0 文字以上の文字列にマッチ します。 @sp 1 @example @group # `xxx.yyy.jp' ドメインのホストからの接続を拒否する。 hosts !*.xxx.yyy.jp # どのホストからの接続も許可する。 hosts * @end group @end example @noindent 疑問符は @dfn{未知のホスト名} を表します。 @sp 1 @example @group # ホスト名が分からないホストからの接続を拒否する。 hosts !? @end group @end example @noindent この指示子は必ずしも定義する必要はありません。 また、何度でも定義することが可能です。 設定ファイルに @code{hosts} 指示子が無くてもエラーにはなりませんが、 どのクライアントもサーバにはアクセスできなくなります。 いずれの @code{hosts} 指示子にもマッチしないホストからの接続要求は拒否 されます。 複数の @code{hosts} にマッチする場合は、設定ファイルの先頭に最も近い ものが採用されます。 以下の例では、@samp{sub1.xxx.yyy.jp} ドメインに属するホストからの 接続要求は拒否していますが、それ以外の @samp{xxx.yyy.jp} ドメインに 属するホストからの接続要求は許可しています。 @sp 1 @example @group hosts !*.sub1.xxx.yyy.jp hosts *.xxx.yyy.jp @end group @end example この例では、指示子の順序は重要です。 順序を引っくり返してしまうと、@samp{sub1.xxx.yyy.jp} を含め、 @samp{xxx.yyy.jp} ドメインに属するすべてのホストがサーバに接続できて しまいます。 @sp 1 @example @group # 間違い!!! hosts *.xxx.yyy.jp hosts !*.sub1.xxx.yyy.jp @end group @end example ホスト名を比較する際、サーバは常にクライアントの正式ホスト名を使用 します。 ホスト名は、クライアントのアドレスから DNS などの名前解決のサービス を利用して取得します。 別名は使用されませんので、注意して下さい。 IPv6 アドレスおよび @var{IPv6 アドレス/ネットマスク} パターンを指定 することも可能です。 IPv6 対応機能を有効にしてコンパイルされていないサーバは IPv4 クライアントとしか通信できませんが、設定ファイルに書かれた IPv6 アドレスを解釈することはできます。 @sp 1 @example @group # `12ab:0:0:cd3::/60' と `::1' からの接続を許可する。 hosts ::1 hosts 12ab:0:0:cd3::/60 @end group @end example @noindent @code{hosts} 指示子では、IPv4 アドレス (例 @samp{192.168.1.1}) とそれ に対応する IPv4 射影 IPv6 アドレス (例 @samp{::ffff:192.168.1.1}) は 等価になります。 つまり、IPv4 クライアント @samp{192.168.1.1} は @code{hosts} 指示子 @samp{::ffff:192.168.1.1} にマッチし、IPv6 クライアント @samp{::ffff:192.168.1.1} は @code{hosts} 指示子 @samp{192.168.1.1} にマッチします。 @item timeout @code{timeout} 指示子では、交信が途絶えたクライアントとの接続を サーバが切断するまでの秒数を指定します。 指示子の値は、0 以上の整数でなくてはいけません。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は @samp{900} (15分) です。 指示子の値を 0 に設定すると、時間切れによる切断は行いません。 @item work-path @code{work-path} 指示子では、サーバの作業用ディレクトリ のパスを指定します (@pxref{Working Directory, , 作業用ディレクトリ})。 指示子の値は、絶対パスでなくてはいけません。 サーバはこのディレクトリの下に作業用のファイルをいくつか作成します。 また、異常終了によってコアファイルをダンプするときは、このディレクトリ に作成します。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 EBNETD を @file{/usr/local} 以下にインストールし、かつ、マシン固有の 更新されうるデータを置くディレクトリ (@code{localstatedir}) を変更して いなければ、無指定時の値は @file{/usr/local/var/ebnetd/} になります。 @item max-hits @code{max-hits} 指示子では、一回の検索でサーバが返すヒット数の上限を 指定します。 サーバは、この指示子で指定された値と同じだけのヒット数を見つけた時点 で、ただちに検索を中止します。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は @samp{50} です。 指示子の値を 0 に設定すると、無制限になります。 @code{ebnetd} はこの指示子を常に無視します。 @item max-text-size @code{max-text-size} 指示子は、サーバがクライアントへの応答 1 回で 返すテキストのバイト数の上限を指定します。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は @samp{32768} です。 指示子の値を 0 に設定すると、無制限になります。 @code{ebnetd} はこの指示子を常に無視します。 @item syslog-facility @code{syslog-facility} 指示子では、syslog のファシリティを指定します (例: @samp{daemon}, @samp{local0} など)。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時は @samp{daemon} を用います。 また、サーバが設定ファイルを読み込み終わるまでは、@samp{daemon} が 用いられます。 @end table @c ------------------------------------------------------------------- @node Group Directive, Book Group Directive, Single Directive List, Configuration File @section 複合指示子の一般形 複合指示子 (指示命令) とは、記述が設定ファイル内の複数行に渡る指示子です。 複合指示子の一般形は次の通りです。 @example @group begin @var{複合指示子の名前} @var{副指示子の名前} @var{副指示子の値} : : (繰り返し) : end @end group @end example @noindent キーワード @code{begin} は、複合指示子の開始を表します。 @code{begin} は後ろに @var{複合指示子の名前} を引数として取ります。 @code{begin} と @var{複合指示子の名前} は空白かタブで区切り、両方とも 同じ行の中に置きます。 キーワード @code{end} は、複合指示子の終了を表します。 @code{end} は、単独で 1 行にして置きます。 EBNETD バージョン @value{VERSION} では、使用できる複合指示子の名前は @code{book} だけです。 それぞれの @dfn{副指示子} は、@code{begin} と @code{end} の行の間に 置きます。 副指示子に関する記述の一般的な規則は、単独指示子と変わりません (たとえば、@var{副指示子の名前}と @var{副指示子の値} は空白かタブで 区切ることなど)。 以下は、 @code{book} 複合指示子の記述例です。 @example @group begin book name EJDICT title English Japanese Dictionary path /mnt/cdrom hosts 127.0.0.1 hosts host.your.domain end @end group @end example @c ------------------------------------------------------------------- @node Book Group Directive, Sample Configuration, Group Directive, Configuration File @section @code{book} 複合指示子 一つの @code{book} 複合指示子 は一冊の CD-ROM 書籍に対応しますので、 CD-ROM 書籍一冊ごとにこの複合指示子を定義しなくてはいけません。 @code{book} 複合指示子の副指示子として、EBNETD が認識するものは次の通り です。 @table @code @item name @code{name} 副指示子では、その書籍の名前を指定します。 副指示子の値に用いることができるのは、英小文字 (@samp{a}..@samp{z})、 数字 (@samp{0}..@samp{9})、下線 (@samp{_})、ハイフン (@samp{-}) だけで、 長さは 14 文字までです。 この名前は、書籍を識別するために使いますので、各書籍には異なる名前を 付けなくてはいけません。 この副指示子は、それぞれの @code{book} 複合指示子に必須です。 また、1 つの @code{book} 複合指示子で 2 度以上定義することはできません。 @item title @code{title} 副指示子では、その書籍の題名を指定します。 副指示子の値には、改行文字とナル文字 (@samp{\0}) を除く任意の文字を 使って指定することができますが、長さは 80 バイトまでです。 EUC (Extended Unix Code) を用いれば日本語の文字も使用可能です。 副指示子の値の中に空白やタブを用いることも可能で、これらは他の文字と 同じく一文字として解釈されます。 この副指示子は、それぞれの @code{book} 複合指示子に必須です。 また、1 つの @code{book} 複合指示子で 2 度以上定義することはできません。 @item path @code{path} 副指示子では、その書籍の絶対パスを指定します。 パスはその書籍のトップディレクトリ、つまり @file{catalog} または @file{catalogs} ファイルの存在するディレクトリを指してしなくては いけません。 この副指示子は、それぞれの @code{book} 複合指示子に必須です。 また、1 つの @code{book} 複合指示子で 2 度以上定義することはできません。 @item appendix-path @code{appendix-path} 副指示子では、その書籍に対応する appendix (付録) パッケージの絶対パスを指定します。 パスは appendix パッケージのトップディレクトリ、つまり @file{catalog} または @file{catalogs} ファイルの存在するディレクトリを指してしなくては いけません。 この副指示子は、必ずしも定義する必要はありません。 また、1 つの @code{book} 複合指示子で 2 度以上定義することはできません。 書籍を使う上で、appendix パッケージは必須ではありませんが、ないと外字が 識別不可能になるため、読みづらいかも知れません。 @item max-clients @code{max-clients} 副指示子には、この書籍を同時にいくつのクライアントが 使うことができるのかを指定します。 副指示子の値には、0 以上の整数を指定します。 この副指示子は、必ずしも定義する必要はありません。 また、1 つの @code{book} 複合指示子で 2 度以上定義することはできません。 無指定時の値は @samp{1} です。 0 を指定すると、無制限になります。 @code{work-path} (@pxref{Working Directory}) に共通の値をセットしておくと、 クライアントの数が @code{ebnetd}, @code{ndtpd}, @code{ebhttpd} 間で 共有されます。 たとえば、ある瞬間にある書籍をアクセスしている @code{ebnetd} クライアント が 2 つ、@code{ndtpd} クライアントが 3 つあったとすると、サーバは 5 つのクライアントが書籍にアクセスしているものと判断します。 @item hosts @code{hosts} 副指示子には、この書籍にどのホストがアクセスできて、どの ホストができないのかを指定します。 この副指示子は、必ずしも定義する必要はありません。 また、1 つの @code{book} 複合指示子で何度でも定義することが可能です。 @code{book} 複合指示子が @code{hosts} 副指示子を持たなくてもエラーには なりませんが、その書籍はどのクライアントからもアクセスできません。 この副指示子の表記方法は、単独指示子の @code{hosts} と同じです。 @end table @c -------------------------------------------------------------------- @node Sample Configuration, , Book Group Directive, Configuration File @section 設定ファイルの例 EBNETD を @file{/usr/local} 以下にインストールし、かつ、マシン固有の 読み込み専用のデータを置くディレクトリ (@code{sysconfdir}) の位置を変更 していなければ、この設定ファイルのサンプルは @file{/usr/local/etc/ebnetd.conf.sample} にインストールされています。 @example ###################################################################### # ebnetd/ndtpd/ebhttpd の設定ファイルのサンプル # (このファイルを `ebnetd.conf' にコピーして、編集して下さい) ###################################################################### ### `ebnetd' が見張るポート番号 ### (無指定の場合: ebnet) # ebnet-port ebnet ### `ndtpd' が見張るポート番号 ### (無指定の場合: ndtp) # ndtp-port ndtp ### `ebhttpd' が見張るポート番号 ### (無指定の場合: http) # http-port http ### サーバのプロセスの所有ユーザ ### (無指定の場合: なし) user ndtpuser ### サーバのプロセスのグループ ### (無指定の場合: なし) group ndtpgrp ### サーバに同時に接続できるクライアントの数 ### (無指定の場合: 1) # max-clients 1 ### サーバに接続できるホスト、できないホスト ### (無指定の場合: なし) hosts 127.0.0.1 hosts ::1 hosts !? hosts host.your.domain ### サーバが交信の途絶えたコネクションを切るまでの時間 ### (無指定の場合: 900) # timeout 900 ### 作業用ディレクトリのパス ### サーバを起動する前に、このディレクトリを作り、サーバプロセスが ### 書き込めるようにしておいて下さい。 ### (無指定の場合: /usr/local/var/ebnetd) # work-path /usr/local/var/ebnetd ### 一回の検索で、サーバが返す、ヒットしたエントリの最大個数 ### (無指定の場合: 50) # max-hits 50 ### クライアントへの一回の応答で、サーバが返すテキストの最大サイズ ### (default: 32768) # max-text-size 32768 ### syslog のファシリティ ### (無指定の場合: daemon) syslog-facility local0 ### ### 書籍のエントリ ### begin book ### 書籍名 ### (必須) name JITENBAN97 ### 書籍の題名 ### (必須) title Jitenban 97 ### 書籍のトップディレクトリ ### (必須) path /cdrom ### appendix (付録) パッケージのトップディレクトリ ### (無指定の場合: なし) appendix-path /usr/local/share/eb/appendix/jitenban97-2.1 ### 同時にアクセスできるクライアントの数 ### (無指定の場合: 1) max-clients 1 ### この書籍を利用できるホスト、できないホスト ### (無指定の場合: なし) hosts 127.0.0.1 hosts ::1 hosts !? hosts host.your.domain end ### もし、CD-ROM 書籍が他にもあるなら、`book' 複合指示子 (`begin book' ### から `end' の間の行) を追加して下さい。`book' 複合指示子は、 ### 書籍一冊毎に必要です。 @end example @c =================================================================== @node Configuration Checker, Setup Your Environment, Configuration File, Top @chapter 設定ファイルのチェックコマンド 編集し終えた設定ファイルをチェックするには、@code{ebncheck} という チェックコマンドを使うと良いでしょう。 EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (@code{sbindir}) の位置を変更していなければ、 @code{ebncheck} は @file{/usr/local/sbin} にインストールされています。 歴史的な経緯から、@code{ndtpd} のための @code{ndtpcheck}, @code{ebhttpd} のための @code{ebhtcheck} というコマンドも合わせて用意されていますが、 特に違いはありません。 @menu * Invoking ebncheck:: @code{ebncheck} の実行 * ebncheck Options:: @code{ebncheck} のオプション @end menu @c ------------------------------------------------------------------- @node Invoking ebncheck, ebncheck Options, Configuration Checker, Configuration Checker @section @code{ebncheck} の実行 @code{ebncheck} コマンドは、@code{ebnetd} と同じ要領で設定ファイルを 読み込んで、チェックします。 @code{ebncheck} コマンドの一般的な起動方法は次の通りです。 @example % /usr/local/sbin/ebncheck @end example @noindent ただし、EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (@code{sbindir}) の位置を変更して いないと仮定しています。 記述の誤りが発見されると、@code{ebncheck} は標準エラー出力に以下のような メッセージを出力します。 @example /usr/local/etc/ebnetd.conf:12: unknown user: noboy configuration failure @end example @c ------------------------------------------------------------------- @node ebncheck Options, , Invoking ebncheck, Configuration Checker @section @code{ebncheck} のオプション @code{ebncheck} コマンドは、伝統的な一文字オプション名と覚えやすい長い オプション名の両方を扱うことができます。 長いオプション名を表すには、@samp{-} ではなく @samp{--} を用います。 オプション名が一意に決まる範囲内で、名前の後方部分を省略することが できます。 @code{ebncheck} コマンドは以下に挙げたオプションを解釈することが できます。 @table @code @item -c @var{ファイル} @itemx --configuration-file @var{ファイル} 設定ファイルを指定します。 無指定時のファイル名は、ヘルプメッセージの中に記されています。 @item -d @itemx --debug @itemx --verbose デバッグ用の情報を標準エラー出力に出力します。 デバッグ用の情報は、設定ファイルの各行がどのように解釈されるのかを示して くれます。 @item -h @itemx --help ヘルプメッセージを標準出力に出力して、終了します。 @item -v @itemx --version バージョン番号を標準出力に出力して、終了します。 @end table @c =================================================================== @node Setup Your Environment, Start ebnetd, Configuration Checker, Top @chapter 環境設定 サーバ周辺のシステムの環境を設定をする必要があるかも知れません。 設定には、おそらくスーパーユーザの権限が必要になるでしょう。 @menu * Services:: @file{services} ファイルの設定 * Syslog:: @file{syslog.conf} ファイルの設定 * Working Directory:: EBNETD の作業用ディレクトリ * Mount CD-ROM Books:: CD-ROM 書籍のマウント * Appendix Package:: appendix パッケージの用意 @end menu @c ------------------------------------------------------------------- @node Services, Syslog, Setup Your Environment, Setup Your Environment @section @file{services} ファイル サービス名 @samp{ebnet}, @samp{ndtp}, @samp{http} があなたのシステムの @file{services} ファイルに無ければ、追加しなくてはなりません (大抵の場合 @file{/etc/services})。 もし、あなたのホストが NIS クライアントならば、代わりに NIS サーバ上に ある NIS のマップを修正しなくてはなりません。 もし、次の行が無ければ足します。 @example http 80/tcp ndtp 2010/tcp ebnet 22010/tcp @end example @noindent 次のように、システムの @file{services} ファイルには、すでに別のサービス 名でエントリが入っているかも知れません。 @example search 2010/tcp @end example @noindent この場合は、サービス名を別名としてその行に追加して下さい。 @example search 2010/tcp ndtp @end example @noindent (詳しくは、あなたのシステムのマニュアルをご覧下さい。) @c ------------------------------------------------------------------- @node Syslog, Working Directory, Services, Setup Your Environment @section @file{syslog.conf} ファイル @code{ebnetd}, @code{ndtpd}, @code{ebhttpd} は syslog を使って ログメッセージを記録します。 @code{syslogd} の設定ファイル (大抵の場合 @file{/etc/syslog.conf}) に、 次のような行を追加して下さい。 一般にフィールドの区切りにはタブしか許されていませんので、空白を 使わないように注意して下さい。 @example local0.info /usr/local/var/ebnetd/log/ebnetd.log @end example @noindent @code{ebnetd} が使用する syslog のファシリティは、@code{ebnetd} の 設定ファイルの @code{syslog-facility} 指示子で決まることに留意して 下さい (@pxref{Single Directive List, , @code{syslog-facility}})。 もしログファイルが存在しなければ、空のファイルを作成します。 @example @group % touch /usr/local/var/ebnetd/log/ebnetd.log % chmod 644 /usr/local/var/ebnetd/log/ebnetd.log @end group @end example @noindent 現在走行している @code{syslogd} プロセスの PID を調べます。 @example % ps axuww | grep syslogd @end example @noindent (詳しくは、あなたのシステムのマニュアルをご覧下さい。) @* @code{syslogd} が走っているならば、次のような行が見つかるはずです。 @example root 63 0.0 1.1 188 316 ?? Is 10:04PM 0:00.16 syslogd @end example @noindent ハングアップシグナル (@code{SIGHUP}) を @code{syslogd} に送ると、 @code{syslogd} は @file{syslog.conf} を読み込み直します。 @example % kill -HUP 63 @end example @noindent あなたのシステムに @code{logger} コマンドがあれば、次のようにして @code{syslogd} にテストメッセージを送ることができます。 @example % logger -p local0.info "test message" @end example @c ------------------------------------------------------------------- @node Working Directory, Mount CD-ROM Books, Syslog, Setup Your Environment @section 作業用ディレクトリ @code{ebnetd}, @code{ndtpd}, @code{ebhttpd} は作業用のディレクトリの下に いくつかのファイルを作成します。 このディレクトリは、設定ファイルの中の @code{work-path} 指示子 で指定することができます (@pxref{Single Directive List, ,@code{work-path}})。 このディレクトリを作り、サーバプロセスとスーパーユーザだけが書き 込めるようにしておいて下さい。 @example # mkdir /usr/local/var/ebnetd # chown ndtpuser /usr/local/var/ebnetd # chmod 755 /usr/local/var/ebnetd @end example @noindent (あなたのシステムでは、サーバプロセスを所有するユーザが @samp{ndtpuser} であると仮定しています。) ただし、サーバプロセスの所有ユーザとグループは、設定ファイルの中の @code{user}, @code{group} 指示子でそれぞれ決まりますので、注意 して下さい (@pxref{Single Directive List, , @code{user}}, および @pxref{Single Directive List, , @code{group}})。 @c ------------------------------------------------------------------- @node Mount CD-ROM Books, Appendix Package, Working Directory, Setup Your Environment @section CD-ROM 書籍のマウント 先に述べたように、CD-ROM 書籍自体は ISO 9660 形式に従っています。 CD-ROM 書籍は、他の ISO 9660 形式のディスクと同じ方法でマウントすること ができます。 もし、ISO 9660 の CD-ROM ディスクのマウント方法が分からなければ、あなた のシステムのマニュアルを調べて下さい。 サーバは @code{ebzip} で圧縮された辞書をアクセスすることができます (@pxref{Compression, , 圧縮, ebzip-ja, ebzip})。 @c ------------------------------------------------------------------- @node Appendix Package, , Mount CD-ROM Books, Setup Your Environment @section appendix パッケージの用意 @dfn{appendix} (@dfn{付録}) とは CD-ROM 書籍の補助データのことです。 appendix は CD-ROM 書籍の出版社から提供されているものではなく、 EB ライブラリに固有のものです。 (本 EBNET 配布パッケージのサーバは、いずれも EB ライブラリに深く 関係していることを思い出して下さい。 @code{ebnetd} は、EB ライブラリのための遠隔アクセスサーバです。 @code{ndtpd} と @code{ebhttpd}は、CD-ROM 書籍のアクセスに EB ライブラリ を使用しています。) appendix は以下のデータを CD-ROM 書籍に対して提供します。 @table @asis @item 本文の区切りコード あなたが EB ライブラリを使って CD-ROM 辞書の中のある単語を引く際、その 単語の説明が終了する箇所で、EB ライブラリが本文の出力を止めることを あなたは期待するのではないでしょうか。 しかし、EB ライブラリはそのような動作を保証することができません。 なぜなら、CD-ROM 書籍の本文には、項目の終わりを示す印が存在しないから です。 幸いにも、多くの CD-ROM 書籍には、項目の終わりを示す印の代替として 使える、@dfn{区切りコード} (@dfn{stop code}) というものを持っています。 通常、EB ライブラリはこの区切りコードを自動的に推測するようになって いるのですが、時々誤った区切りコードを導き出すことがあります。 appendix の区切りコードは、その書籍の正しい区切りコードを EB ライブラリ に教えてやるために用います。 @item 外字の代替文字列 多くの CD-ROM 書籍は、外字 (独自に定義した文字) を持っており、本文中で その外字を使っています。 CD-ROM 書籍では外字のビットマップフォントを用意しており、 クライアントアプリケーションが外字を出力するには、そのフォントを描画 しなくてはなりません。 appendix では、外字の @dfn{代替文字列} (@dfn{alternation text}) を定義 することができます。 アプリケーションは、ビットマップフォントを描画する代わりに、その 代替文字列を出力することにしても良いでしょう。 @end table appendix パッケージのレイアウトは CD-ROM 書籍のものとよく似ています。 トップディレクトリには @code{catalog} もしくは @code{catalogs} ファイルが存在し、各副本のデータは対応するサブディレクトリに配置されて います。 appendx を使うには、設定ファイルの中の、複合指示子 @code{book} の @code{appendix-path} 副指示子で指定します (@pxref{Group Directive, , @code{appendix-path}})。 EB ライブラリの公式な FTP サイト (@url{ftp://ftp.sra.co.jp/pub/misc/eb/appendix/}) に、appendix パッケージがいくつか置いてあります。 ここに載っていない CD-ROM 書籍用の appendix パッケージを作成する場合は、 @code{ebappendix} コマンドを使いましょう。 appendix のデータファイルの整形を行うことができます。 @c =================================================================== @node Start ebnetd, Start ndtpd, Setup Your Environment, Top @chapter @code{ebnetd} の起動 @code{ebnetd} は、スタンドアロンのデーモン、あるいは @code{inetd} の 子プロセスとして起動することができます。 指定がなければ、スタンドアロンのデーモンとして起動するようになっています。 サーバへコネクションが頻繁に来ないなら、メモリの消費を抑えるために @code{ebnetd} を @code{inetd} の子プロセスとして起動する方が良いでしょう。 しかし、@code{inetd} によって起動される度に、@code{ebnetd} は設定ファイル を読み込み、初期化のために CD-ROM 書籍からデータを部分的に読み込みます。 コネクションが頻繁に来るようなら、@code{ebnetd} をスタンドアロンのデーモン として起動した方が良いでしょう。 あなたのシステムでは @code{ebnetd} を必要としないなら、この章の残りの 部分は読み飛ばして下さい。 @menu * ebnetd Standalone:: @code{ebnetd} をスタンドアロンで起動 * ebnetd Child of inetd:: @code{ebnetd} を @code{inetd} 経由で起動 * ebnetd Child of xinetd:: @code{ebnetd} を @code{xinetd} 経由で起動 * ebnetd Test with telnet:: @code{telnet} による @code{ebnetd} の確認 * ebnetd Options:: @code{ebnetd} のオプション @end menu @c ------------------------------------------------------------------- @node ebnetd Standalone, ebnetd Child of inetd, Start ebnetd, Start ebnetd @section @code{ebnetd} をスタンドアロンで起動 @code{ebnetd} をスタンドアロンのデーモンとして起動するには、次のように コマンドを実行して下さい。 スーパーユーザの権限が必要かも知れません。 @example % /usr/local/sbin/ebnetd @end example @noindent EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (@code{sbindir}) の位置を変更していなければ、 @code{ebnetd} は @file{/usr/local/sbin} にインストールされています。 @c ------------------------------------------------------------------- @node ebnetd Child of inetd, ebnetd Child of xinetd, ebnetd Standalone, Start ebnetd @section @code{ebnetd} を @code{inetd} 経由で起動 @code{ebnetd} を @code{inetd} の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを @file{inetd.conf} ファイル (大抵の場合 @file{/etc/inetd.conf}) に加えます。 @samp{--inetd} (または @samp{-i}) オプションを足すのを忘れないようにして 下さい。 @example ebnet stream tcp nowait root /usr/local/sbin/ebnetd ebnetd --inetd @end example @noindent (ただし、EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (@code{sbindir}) の位置を変更していない と仮定しています。) 走行している @code{inetd} プロセスの PID を探し出します。 BSD 系のシステムでは、次のようにします。 @example % ps axuww | grep inetd @end example @noindent SYSV 系のシステムなら、次のようにします。 @example % ps -ef | grep inetd @end example @noindent (詳しくは、あなたのシステムのマニュアルをご覧下さい。) @* @code{inetd} が走っているならば、次のような行が見つかるはずです。 @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd @end example @noindent 見つかったならば、ハングアップシグナル (@code{SIGHUP}) を @code{inetd} に送ります。 おそらく、スーパーユーザの権限が必要です。 @example % kill -HUP 79 @end example @c ------------------------------------------------------------------- @node ebnetd Child of xinetd, ebnetd Test with telnet, ebnetd Child of inetd, Start ebnetd @section @code{ebnetd} を @code{xinetd} 経由で起動 Linux システムには、伝統的な @code{inetd} の代わりに @code{xinetd} を 使用しているものもあります。 @code{xinetd} の設定ファイルの文法は、伝統的な @code{inetd} の設定ファイル の文法とは異なります。 @code{ebnetd} を @code{xinetd} の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを設定ファイル (大抵の場合 @file{/etc/xinetd.d/ebnet}) に 加えます。 @samp{--inetd} (または @samp{-i}) オプションを足すのを忘れないようにして 下さい。 @example @group # default: off # description: The ebnet server service ebnet @{ disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ebnetd server_args = --inetd log_on_failure += USERID @} @end group @end example @noindent (ただし、EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (@code{sbindir}) の位置を変更していな いと仮定しています。) 走行している @code{xinetd} プロセスの PID を探し出します。 @example % ps axuww | grep xinetd @end example @* @code{xinetd} が走っているならば、次のような行が見つかるはずです。 @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd @end example @noindent 見つかったならば、USER2 シグナル (@code{SIGUSR2}) を @code{xinetd} に送ります。 おそらく、スーパーユーザの権限が必要です。 @example % kill -USR2 79 @end example @c ------------------------------------------------------------------- @node ebnetd Test with telnet, ebnetd Options, ebnetd Child of xinetd, Start ebnetd @section @code{telnet} による @code{ebnetd} の確認 セットアップがすべて完了したら、@code{telnet} コマンドを用いて @code{ebnetd} に接続してみましょう。 まず、次のように入力します。 この例では、localhost 上の @code{ebnetd} に接続しています。 @example % telnet localhost ebnet @end example @noindent @code{ebnetd} が接続を受け付ければ、次のようなメッセージが表示されます。 @example Connected to localhost. Escape character is '^]'. @end example @noindent ここで、@key{BOOKLIST} に続けて @key{Enter} を入力します。 @example BOOKLIST @end example @noindent @code{ebnetd} が正常に動いていれば、次のように利用可能な CD-ROM 書籍の一覧を出力します。 @example !OK; book list follows chujiten kojien colloc colloc.app @end example @noindent 接続を終えるには、@key{QUIT} に続けて @key{Enter} を入力します。 @example QUIT Connection closed by foreign host. @end example @c ------------------------------------------------------------------- @node ebnetd Options, , ebnetd Test with telnet, Start ebnetd @section @code{ebnetd} のオプション @code{ebnetd} コマンドは、伝統的な一文字オプション名と覚えやすい長い オプション名の両方を扱うことができます。 長いオプション名を表すには、@samp{-} ではなく @samp{--} を用います。 オプション名が一意に決まる範囲内で、名前の後方部分を省略することが できます。 @code{ebnetd} コマンドは以下に挙げたオプションを解釈することができます。 @table @code @item -c @var{ファイル} @itemx --configuration-file @var{ファイル} 設定ファイルを指定します。 無指定時のファイル名は、ヘルプメッセージの中に記されています。 @item -h @itemx --help ヘルプメッセージを標準出力に出力して、終了します。 @item -i @itemx --inetd @code{inetd} モード。 @code{ebnetd} を @code{inetd} から起動させるときは、このオプションを指定 する必要があります。 @item -t @itemx --test テストモード。 @code{ebnetd} はフォアグラウンドプロセスとして起動され、決して fork を 行いません。 サーバへのリクエストは標準入力から読み込まれ、クライアントへのレスポンス は標準出力へ出力されます。 標準入力および標準出力は、端末と結び付けられたファイル記述子であっても 構いません。 また、アクセスに対する識別チェックは行いませんので、すべての CD-ROM 書籍 にアクセス可能です。 @item -v @itemx --version バージョン番号を標準エラー出力に出力して、終了します。 @end table @c =================================================================== @node Start ndtpd, Start ebhttpd, Start ebnetd, Top @chapter @code{ndtpd} の起動 あなたのシステムでは @code{ndtpd} を必要としないなら、この章は読み飛ばして 下さい。 @code{ndtpd} も、スタンドアロンのデーモンとして起動するやり方と @code{inted} の子プロセスとして起動するやり方の、2 つの実行モードを 持っています。 指定がなければ、@code{ndtpd} はスタンドアロンのデーモンとして起動します。 @menu * ndtpd Standalone:: @code{ndtpd} をスタンドアロンで起動 * ndtpd Child of inetd:: @code{ndtpd} を @code{inetd} 経由で起動 * ndtpd Child of xinetd:: @code{ndtpd} を @code{xinetd} 経由で起動 * ndtpd Test with telnet:: @code{telnet} による @code{ndtpd} の確認 * ndtpd Options:: @code{ndtpd} のオプション @end menu @c ------------------------------------------------------------------- @node ndtpd Standalone, ndtpd Child of inetd, Start ndtpd, Start ndtpd @section @code{ndtpd} をスタンドアロンで起動 @code{ndtpd} をスタンドアロンのデーモンとして起動するには、次のように コマンドを実行して下さい。 スーパーユーザの権限が必要かも知れません。 @example % /usr/local/sbin/ndtpd @end example @noindent EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (@code{sbindir}) の位置を変更していなければ、 @code{ndtpd} は @file{/usr/local/sbin} にインストールされています。 @c ------------------------------------------------------------------- @node ndtpd Child of inetd, ndtpd Child of xinetd, ndtpd Standalone, Start ndtpd @section @code{ndtpd} を @code{inetd} 経由で起動 @code{ndtpd} を @code{inetd} の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを @file{inetd.conf} ファイル (大抵の場合 @file{/etc/inetd.conf}) に加えます。 @samp{--inetd} (または @samp{-i}) オプションを足すのを忘れないようにして 下さい。 @example ndtp stream tcp nowait root /usr/local/sbin/ndtpd ndtpd --inetd @end example @noindent (ただし、EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (@code{sbindir}) の位置を変更していない と仮定しています。) 走行している @code{inetd} プロセスの PID を探し出します。 BSD 系のシステムでは、次のようにします。 @example % ps axuww | grep inetd @end example @noindent SYSV 系のシステムなら、次のようにします。 @example % ps -ef | grep inetd @end example @noindent (詳しくは、あなたのシステムのマニュアルをご覧下さい。) @* @code{inetd} が走っているならば、次のような行が見つかるはずです。 @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd @end example @noindent 見つかったならば、ハングアップシグナル (@code{SIGHUP}) を @code{inetd} に送ります。 おそらく、スーパーユーザの権限が必要です。 @example % kill -HUP 79 @end example @c ------------------------------------------------------------------- @node ndtpd Child of xinetd, ndtpd Test with telnet, ndtpd Child of inetd, Start ndtpd @section @code{ndtpd} を @code{xinetd} 経由で起動 Linux システムには、伝統的な @code{inetd} の代わりに @code{xinetd} を 使用しているものもあります。 @code{xinetd} の設定ファイルの文法は、伝統的な @code{inetd} の設定ファイル の文法とは異なります。 @code{ndtpd} を @code{xinetd} の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを設定ファイル (大抵の場合 @file{/etc/xinetd.d/ndtp}) に 加えます。 @samp{--inetd} (または @samp{-i}) オプションを足すのを忘れないようにして 下さい。 @example @group # default: off # description: The ndtp server service ndtp @{ disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ndtpd server_args = --inetd log_on_failure += USERID @} @end group @end example @noindent (ただし、EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (@code{sbindir}) の位置を変更していな いと仮定しています。) 走行している @code{xinetd} プロセスの PID を探し出します。 @example % ps axuww | grep xinetd @end example @* @code{xinetd} が走っているならば、次のような行が見つかるはずです。 @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd @end example @noindent 見つかったならば、USER2 シグナル (@code{SIGUSR2}) を @code{xinetd} に送ります。 おそらく、スーパーユーザの権限が必要です。 @example % kill -USR2 79 @end example @c ------------------------------------------------------------------- @node ndtpd Test with telnet, ndtpd Options, ndtpd Child of xinetd, Start ndtpd @section @code{telnet} による @code{ndtpd} の確認 セットアップがすべて完了したら、@code{telnet} コマンドを用いて @code{ndtpd} に接続してみましょう。 まず、次のように入力します。 この例では、localhost 上の @code{ndtpd} に接続しています。 @example % telnet localhost ndtp @end example @noindent @code{ndtpd} が接続を受け付ければ、次のようなメッセージが表示されます。 @example Connected to localhost. Escape character is '^]'. @end example @noindent ここで、@key{t} に続けて @key{Enter} を入力します。 @code{ndtpd} が正常に動いていれば、次のように利用可能な CD-ROM 書籍の一覧を出力します。 @example t 1 Oxford Dictionary/Thesaurus edict/oxford 0 0 0 2 Quick Tour edict/quick 0 0 0 3 User's Guide edict/user 0 0 0 4 About This Disc edict/about 0 0 0 $* @end example @noindent 接続を終えるには、@key{Q} に続けて @key{Enter} を入力します。 @example Q Connection closed by foreign host. @end example @c ------------------------------------------------------------------- @node ndtpd Options, , ndtpd Test with telnet, Start ndtpd @section @code{ndtpd} のオプション @code{ndtpd} のコマンド行の指定方法は、@code{ebnetd} と同じです。 詳しくは、@pxref{ebnetd Options, , @code{ebnetd} のオプション} を 参照して下さい。 @c =================================================================== @node Start ebhttpd, Terminate and Restart, Start ndtpd, Top @chapter @code{ebhttpd} の起動 あなたのシステムでは @code{ebhttpd} を必要としないなら、この章は 読み飛ばして下さい。 @code{ebhttpd} も、スタンドアロンのデーモンとして起動するやり方と @code{inted} の子プロセスとして起動するやり方の、2 つの実行モードを 持っています。 指定がなければ、@code{ebhttpd} はスタンドアロンのデーモンとして起動します。 @menu * ebhttpd Standalone:: @code{ebhttpd} をスタンドアロンで起動 * ebhttpd Child of inetd:: @code{ebhttpd} を @code{inetd} 経由で起動 * ebhttpd Child of xinetd:: @code{ebhttpd} を @code{xinetd} 経由で起動 * ebhttpd Test with telnet:: @code{telnet} による @code{ebhttpd} の確認 * ebhttpd Options:: @code{ebhttpd} のオプション @end menu @c ------------------------------------------------------------------- @node ebhttpd Standalone, ebhttpd Child of inetd, Start ebhttpd, Start ebhttpd @section @code{ebhttpd} をスタンドアロンで起動 @code{ebhttpd} をスタンドアロンのデーモンとして起動するには、次のように コマンドを実行して下さい。スーパーユーザの権限が必要かも知れません。 @example % /usr/local/sbin/ebhttpd @end example @noindent EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (@code{sbindir}) の位置を変更していなければ、 @code{ebhttpd} は @file{/usr/local/sbin} にインストールされています。 @c ------------------------------------------------------------------- @node ebhttpd Child of inetd, ebhttpd Child of xinetd, ebhttpd Standalone, Start ebhttpd @section @code{ebhttpd} を @code{inetd} 経由で起動 @code{ebhttpd} を @code{inetd} の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを @file{inetd.conf} ファイル (大抵の場合 @file{/etc/inetd.conf}) に加えます。 @samp{--inetd} (または @samp{-i}) オプションを足すのを忘れないようにして 下さい。 @example http stream tcp nowait root /usr/local/sbin/ebhttpd ebhttpd --inetd @end example @noindent (ただし、EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (@code{sbindir}) の位置を変更していない と仮定しています。) 走行している @code{inetd} プロセスの PID を探し出します。 BSD 系のシステムでは、次のようにします。 @example % ps axuww | grep inetd @end example @noindent SYSV 系のシステムなら、次のようにします。 @example % ps -ef | grep inetd @end example @noindent (詳しくは、あなたのシステムのマニュアルをご覧下さい。) @* @code{inetd} が走っているならば、次のような行が見つかるはずです。 @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd @end example @noindent 見つかったならば、ハングアップシグナル (@code{SIGHUP}) を @code{inetd} に送ります。 おそらく、スーパーユーザの権限が必要です。 @example % kill -HUP 79 @end example @c ------------------------------------------------------------------- @node ebhttpd Child of xinetd, ebhttpd Test with telnet, ebhttpd Child of inetd, Start ebhttpd @section @code{ebhttpd} を @code{xinetd} 経由で起動 Linux システムには、伝統的な @code{inetd} の代わりに @code{xinetd} を 使用しているものもあります。 @code{xinetd} の設定ファイルの文法は、伝統的な @code{inetd} の設定ファイル の文法とは異なります。 @code{ebhttpd} を @code{xinetd} の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを設定ファイル (大抵の場合 @file{/etc/xinetd.d/http}) に 加えます。 @samp{--inetd} (または @samp{-i}) オプションを足すのを忘れないようにして 下さい。 @example @group # default: off # description: The http server service http @{ disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ebhttpd server_args = --inetd log_on_failure += USERID @} @end group @end example @noindent (ただし、EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (@code{sbindir}) の位置を変更していな いと仮定しています。) 走行している @code{xinetd} プロセスの PID を探し出します。 @example % ps axuww | grep xinetd @end example @* @code{xinetd} が走っているならば、次のような行が見つかるはずです。 @example root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd @end example @noindent 見つかったならば、USER2 シグナル (@code{SIGUSR2}) を @code{xinetd} に送ります。 おそらく、スーパーユーザの権限が必要です。 @example % kill -USR2 79 @end example @c ------------------------------------------------------------------- @node ebhttpd Test with telnet, ebhttpd Options, ebhttpd Child of xinetd, Start ebhttpd @section @code{telnet} による @code{ebhttpd} の確認 セットアップがすべて完了したら、@code{telnet} コマンドを用いて @code{ebhttpd} に接続してみましょう。 まず、次のように入力します。 この例では、localhost 上の @code{ebhttpd} に接続しています。 @example % telnet localhost http @end example @noindent @code{ebhttpd} が接続を受け付ければ、次のようなメッセージが表示されます。 @example Connected to localhost. Escape character is '^]'. @end example @noindent ここで、次のようにリクエストを入力します。 @example GET / HTTP/1.0 @end example @noindent このリクエストは 2 行からなり、2 行目は空行ですので、注意して下さい。 @code{ebhttpd} が正常に動いていれば、次のような応答が得られます。 @example HTTP/1.1 200 Ok Date: Fri, 16 May 2003 13:11:12 GMT Server: ebHTTPD 0.0 Content-Type: text/html; charset="euc-jp" (以下略) @end example @c ------------------------------------------------------------------- @node ebhttpd Options, , ebhttpd Test with telnet, Start ebhttpd @section @code{ebhttpd} のオプション @code{ebhttpd} のコマンド行の指定方法は、@code{ebnetd} と同じです。 詳しくは、@pxref{ebnetd Options, , @code{ebnetd} のオプション} を 参照して下さい。 @c =================================================================== @node Terminate and Restart, Daily Works, Start ebhttpd, Top @chapter サーバの終了および再始動 @code{ebncontrol} コマンドを用いることで、現在スタンドアロンのデーモン として走っている @code{ebnetd} プロセスを終了させたり、強制終了、再始動 させたりすることができます。 EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (@code{sbindir}) の位置を変更していなければ、 @code{ebncontrol} は @file{/usr/local/sbin} にインストールされています。 走行中の @code{ebnetd} を終了させるには次のようにします。 @example % /usr/local/sbin/ebncontrol terminate @end example @code{ebnetd} は自身の PID を作業用ディレクトリの下のファイル @file{ebnetd.pid} に記録します (@pxref{Working Directory, , 作業ディレクトリ})。 @code{ebncontrol} は、走行中の @code{ebnetd} プロセスの PID を知るために この PID ファイルの中身を読み、その PID に対してシグナルを送ります。 @code{ebnetd} が正常に終了すれば、PID ファイルは @code{ebnetd} 自身に よって削除されます。 しかしながら、@code{ebnetd} が異常終了したときは、PID ファイルは削除 されません。 この場合、残された PID ファイルに記述された PID は、後で他のプロセスに 割り当てられる可能性があります。 @code{ebncontrol} の実行は慎重に行って下さい。 @code{ebncontrol} は、本当に @code{ebnetd} プロセスが存在するかどうかに ついては、確かめません。 @code{ebnetd} プロセスが存在しないのに PID ファイルだけ残っていると、 @code{ebncontrol} は他のプロセスにシグナルを送ってしまうかも知れません。 @code{ebncontrol} は @code{ebnetd} の設定ファイルを読み込み、作業用 ディレクトリの位置を調べます。 ディレクトリの位置は、設定ファイル中の単独指示子 @code{work-path} で定義することができます (@pxref{Single Directive List, , @code{work-path}})。 無指定時の設定ファイルのファイル名、および単独指示子 @code{work-path} の値は @code{ebnetd} と同じです。 また、@code{ndtpd} および @code{ebhttpd} のために @code{ndtpcontrol}, @code{ebhtcontrol} がそれぞれ用意されています。 使用方法は、@code{ebncontrol} と同じです。 @menu * Invoke Server Controler:: サーバ制御コマンドの実行 * ebncontrol Options:: サーバ制御コマンドのオプション @end menu @c ------------------------------------------------------------------- @node Invoke Server Controler, ebncontrol Options, Terminate and Restart, Terminate and Restart @section サーバ制御コマンドの実行 前述のように、@code{ebncontrol}, @code{ndtpcontrol}, @code{ebhtcontrol} は、すべて同じコマンド行引数をとるようになっています。 これらのコマンドの一般的な実行方法は、次の通りです。 @example % /usr/local/sbin/ebncontrol @var{副コマンド} % /usr/local/sbin/ndtpcontrol @var{副コマンド} % /usr/local/sbin/ebhtcontrol @var{副コマンド} @end example 副コマンドは、以下のものを解釈することができます。 副コマンド名が一意に決まる範囲内で、名前の後方部分を省略することが できます。 @table @code @item kill 現在走っているサーバプロセスを強制終了させます (@code{SIGKILL} シグナル を送ります)。 また、サーバ制御コマンドが、サーバプロセスの PID ファイルを消去します。 この副コマンドを試す前に、まず @code{terminate} を先に試すべきです。 @item restart 現在走っているサーバプロセスを再始動させます (@code{SIGHUP} シグナルを送ります)。 サーバプロセスはすべての TCP コネクションを閉じ、設定ファイルを 読み込み直します。 @item status サーバプロセスが走っているかどうか調べ、結果を標準エラー出力に出力します。 この副コマンドは、サーバにシグナルを送ることはしません。 @item terminate 現在走っている サーバプロセスを終了させます (@code{SIGTERM} シグナルを送ります)。 @end table @c ------------------------------------------------------------------- @node ebncontrol Options, , Invoke Server Controler, Terminate and Restart @section @code{ebncontrol} のオプション @code{ebncontrol}, @code{ndtpcontrol}, @code{ebhtcontrol} コマンドは、 伝統的な一文字オプション名と覚えやすい長いオプション名の両方を扱うこと ができます。 長いオプション名を表すには、@samp{-} ではなく @samp{--} を用います。 オプション名が一意に決まる範囲内で、名前の後方部分を省略することが できます。 @code{ebncontrol}, @code{ndtpcontrol}, @code{ebhtcontrol} は以下に挙げた オプションを解釈することができます。 @table @code @item -c @var{ファイル} @itemx --configuration-file @var{ファイル} 設定ファイルを指定します。 無指定時のファイル名は、ヘルプメッセージの中に記されています。 @item -h @itemx --help ヘルプメッセージを標準出力に出力して、終了します。 @item -v @itemx --version バージョン番号を標準出力に出力して、終了します。 @end table @c =================================================================== @node Daily Works, Network License, Terminate and Restart, Top @chapter 毎日の管理作業 @code{ebndaily} コマンドは、@code{ebnetd}, @code{ndtpd}, @code{ebhttpd} の syslog ファイルのうち、最も新しいものを調べて統計情報を生成し、syslog ファイルのローテーションを行います。 その結果は、コマンド行の引数に指定された管理者に宛てて、メールで 送られます。 EBNETD を @file{/usr/local} 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (@code{sbindir}) の位置を変更していなければ、 @code{ebndaily} は @file{/usr/local/sbin} にインストールされています。 @code{ebndaily} を実行する一般的な方法は次の通りです。 @example % /usr/local/sbin/ebndaily @var{メールアドレス}... @end example @noindent 以下は実行例です。 @example % /usr/local/sbin/ebndaily root@@host.your.domain @end example @noindent 2 つ以上のメールアドレスを書くこともできます。 @example % /usr/local/sbin/ebndaily root@@host.your.domain root@@dept.your.domain @end example @sp 1 @code{ebndaily} を毎日一回、自動的に実行するには、以下のようなエントリ をあなたのシステムの @file{crontab} に加えて下さい。 @example 0 0 * * * /usr/local/sbin/ebndaily root@@host.your.domain @end example @noindent (詳しくは、あたなのシステムのマニュアルをご覧下さい。) @* とくに変更の指定がなければ、@code{ebndaily} は、古くなった syslog ファイルを @code{compress} コマンドで圧縮し、7 世代分保存します。 現在の syslog ファイルが @file{/usr/local/var/ebnetd/log/ebnetd.log} だとすると、古くなった syslog ファイルは次のように保存されます。 @example /usr/local/var/ebnetd/log/ebnetd.log.0.Z /usr/local/var/ebnetd/log/ebnetd.log.1.Z /usr/local/var/ebnetd/log/ebnetd.log.2.Z /usr/local/var/ebnetd/log/ebnetd.log.3.Z /usr/local/var/ebnetd/log/ebnetd.log.4.Z /usr/local/var/ebnetd/log/ebnetd.log.5.Z /usr/local/var/ebnetd/log/ebnetd.log.6.Z @end example @noindent これらの syslog は次の要領でローテーションされます。 @enumerate @item もっとも古い syslog ファイル @file{ebnetd.log.6.Z} が削除されます。 @item 他の @file{ebnetd.log.@var{n}.Z} ファイルは、 @file{ebnetd.log.@var{n+1}.Z} に改名されます。 @item 現在の syslog ファイル @file{ebnetd.log} は @file{ebnetd.log.0} に コピーされます。 @item @file{ebnetd.log.0} は、@code{compress} で圧縮され、ファイル名が @file{ebnetd.log.0.Z} に変わります。 @item 現在の syslog file @file{ebnetd.log} の内容がクリアされます。 @end enumerate @menu * ebndaily Options:: @code{ebndaily} のオプション @end menu @c ------------------------------------------------------------------- @node ebndaily Options, , Daily Works, Daily Works @section @code{ebndaily} のオプション @code{ebndaily} コマンドは、伝統的な一文字オプション名と覚えやすい長い オプション名の両方を扱うことができます。 長いオプション名を表すには、@samp{-} ではなく @samp{--} を用います。 オプション名が一意に決まる範囲内で、名前の後方部分を省略することが できます。 @code{ebndaily} コマンドは以下に挙げたオプションを解釈することが できます。 @table @code @item -a @var{整数} @itemx --ages @var{整数} 古い syslog ファイルを @var{整数} 世代分だけ保存します。 無指定時は @samp{7} です。 @item -c @var{圧縮プログラム} @itemx --compressor @var{圧縮プログラム} 古くなった syslog ファイルを圧縮するプログラムを指定します。 @var{圧縮プログラム} は、@samp{compress}、@samp{gzip}、@samp{bzip2}、 @samp{none} のうちのいずれかでなくてはなりません。 無指定時は、@samp{compress} です。 @samp{compress} を指定するか、@samp{--compressor} (@samp{-c}) オプション を用いなかった場合は、@samp{compress} コマンドによる圧縮が行われ、 圧縮されたファイルには拡張子 @file{.Z} が付加されます。 @samp{gzip} を指定した場合は、@samp{gzip} コマンドによる圧縮が行われ、 圧縮されたファイルには拡張子 @file{.gz} が付加されます。 @samp{bzip2} を指定した場合は、@samp{bzip2} コマンドによる圧縮が行われ、 圧縮されたファイルには拡張子 @file{.bz2} が付加されます。 @samp{none} を指定した場合は、圧縮は行われず、ファイルの拡張子も 変わりません。 @item -l @var{ファイル} @itemx --log-file @var{ファイル} 現在の syslog ファイルを指定します。 @* EBNETD を @file{/usr/local} 以下にインストールし、かつ、マシン固有の更新 されうるデータを置くディレクトリ (@code{localstatedir}) および ログファイルが置かれるディレクトリ (@code{--with-logdir} で指定) を変更 していなければ、無指定時では @file{/usr/local/var/ebnetd/log/ebnetd.log} になります。 無指定時のファイル名は、ヘルプメッセージの中に記されています。 @item -h @itemx --help ヘルプメッセージを標準出力に出力して、終了します。 @item -v @itemx --version バージョン番号を標準出力に出力して、終了します。 @item -@var{n} @itemx --fast @itemx --best これらのオプションは @code{gzip}, @code{bzip2} に渡されます (@pxref{Invoking gzip, , Invoking @code{gzip}, gzip, Gzip User's Manual})。 @code{gzip}, @code{bzip2} を使用しないときは、たんに無視されます。 @end table @c =================================================================== @node Network License, , Daily Works, Top @appendix ネットワークライセンス CD-ROM 書籍の出版社はオプションでネットワークライセンスを用意している ことがあります。 これは、あなたの LAN 上の複数のユーザに対して書籍へのアクセスを許可する ものです。 ネットワークライセンスでは、同時にその書籍へアクセスするユーザの最大数 が制限されることがあります (ライセンスの形態は様々ですので、詳しくは 出版社にお問い合わせ下さい)。 設定ファイル (通常 @code{ebnetd.conf}) には、2 つの @code{max-clients} というパラメタがあります。 一つは単独指示子で (@pxref{Single Directive List, ,@code{max-clients}})、 もう一つは @code{book} 複合指示子の副指示子です (@pxref{Book Group Directive, , @code{max-clients}})。 どちらもクライアントの最大数を制限します。 これらはネットワークライセンスの順守を補助しますが、完璧なものでは ありません。 たとえば、書籍がアクセスできるのは、ユーザの使用しているクライアントが サーバに接続している間だけにすべきですが、サーバにしてもクライアントに しても、接続状態を頻繁にチェックするわけではありません。 たとえば、サーバはタイムアウトが発生すると、クライアントとの接続を 切ります。 けれども、クライアントは CD-ROM 書籍の中身を表示し続け、ユーザが別の コンテンツの表示を要求するまでこの状態が続くのです。 それでも、ネットワークライセンスのために @code{max-clients} を設定する ことは良いことです。 重要なのは @code{max-clients} の能力を過信しないことです。 @contents @bye ebnetd-1.0.dfsg.1/doc-ja/texinfo-ja.tex0000644000175000017500000000161707673055347017162 0ustar mhattamhatta% Japanse Strings for texinfo.tex %This texinfo-js.tex file 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 this texinfo.tex file; see the file COPYING. If not, write %to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, %MA 02111-1307 USA. \def\strappendix{付録} \def\strchapapp{第} \def\strchaptail{章} \def\strsecapp{第} \def\strsectail{節} \def\strsecref{\cite{\printedmanual}の節「\printednodename 」} \def\strseeapp{} \def\strseetail{参照} \def\strSeeapp{} \def\strSeetail{参照} \def\strpageapp{} \def\strpagetail{ページ} \def\strtoc{目 次} \def\strstoc{目 次(抄)} \def\today{\number\year 年 \number\month 月 \number\day 日} ebnetd-1.0.dfsg.1/doc-ja/ebnetd-ja.info0000644000175000017500000000534207773515126017076 0ustar mhattamhattaThis is ./ebnetd-ja.info, produced by makeinfo version 4.2 from ./ebnetd-ja.texi. INFO-DIR-SECTION CD-ROM Book Utilities START-INFO-DIR-ENTRY * EBNETD: (ebnetd). Network EB Library server. * NDTPD: (ndtpd). Server for accessing CD-ROM books with NDTP. * ebHTTPD: (ebhttpd). Server for accessing CD-ROM books with HTTP. END-INFO-DIR-ENTRY EBNETD: CD-ROM 書籍サーバ群、笠原基之 Copyright (C) 1997, 98, 99, 2000, 01, 03 Motoyuki Kasahara Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Free Software Foundation, Inc.  Indirect: ebnetd-ja.info-1: 1157 ebnetd-ja.info-2: 50976  Tag Table: (Indirect) Node: Top1157 Node: Introduction4417 Node: Installation7186 Node: Basic Installation8303 Node: Compilers and Options11436 Node: Multiple Architectures12096 Node: Installation Names13112 Node: Optional Features14429 Node: System Type15349 Node: Sharing Defaults16519 Node: Operation Controls17236 Node: Optional Feature List18432 Node: Configuration File19244 Node: Single Directive20605 Node: Single Directive List21231 Node: Group Directive29633 Node: Book Group Directive30917 Node: Sample Configuration34346 Node: Configuration Checker37416 Node: Invoking ebncheck38170 Node: ebncheck Options38858 Node: Setup Your Environment39797 Node: Services40363 Node: Syslog41200 Node: Working Directory42604 Node: Mount CD-ROM Books43523 Node: Appendix Package44070 Node: Start ebnetd46621 Node: ebnetd Standalone47734 Node: ebnetd Child of inetd48286 Node: ebnetd Child of xinetd49482 Node: ebnetd Test with telnet50976 Node: ebnetd Options51857 Node: Start ndtpd53173 Node: ndtpd Standalone53908 Node: ndtpd Child of inetd54451 Node: ndtpd Child of xinetd55637 Node: ndtpd Test with telnet57120 Node: ndtpd Options58150 Node: Start ebhttpd58423 Node: ebhttpd Standalone59187 Node: ebhttpd Child of inetd59747 Node: ebhttpd Child of xinetd60951 Node: ebhttpd Test with telnet62450 Node: ebhttpd Options63432 Node: Terminate and Restart63717 Node: Invoke Server Controler65720 Node: ebncontrol Options67035 Node: Daily Works67869 Node: ebndaily Options70086 Node: Network License72209  End Tag Table ebnetd-1.0.dfsg.1/doc-ja/ebnetd-ja.info-10000644000175000017500000014344007773515126017236 0ustar mhattamhattaThis is ./ebnetd-ja.info, produced by makeinfo version 4.2 from ./ebnetd-ja.texi. INFO-DIR-SECTION CD-ROM Book Utilities START-INFO-DIR-ENTRY * EBNETD: (ebnetd). Network EB Library server. * NDTPD: (ndtpd). Server for accessing CD-ROM books with NDTP. * ebHTTPD: (ebhttpd). Server for accessing CD-ROM books with HTTP. END-INFO-DIR-ENTRY EBNETD: CD-ROM 書籍サーバ群、笠原基之 Copyright (C) 1997, 98, 99, 2000, 01, 03 Motoyuki Kasahara Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Free Software Foundation, Inc.  File: ebnetd-ja.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) この文書は第 1.0 版です。EBNETD バージョン 1.0 に対応しています。 * Menu: * Introduction:: はじめに * Installation:: EBNETD のインストール * Configuration File:: 設定ファイルの書き方 * Configuration Checker:: 設定ファイルの確認 * Setup Your Environment:: 環境設定 * Start ebnetd:: `ebnetd' の起動 * Start ndtpd:: `ndtpd' の起動 * Start ebhttpd:: `ebhttpd' の起動 * Terminate and Restart:: `ndtpd' の終了および再始動 * Daily Works:: 毎日の管理作業 * Network License:: ネットワークライセンス --- The Detailed Node Listing --- EBNETD のインストール * Basic Installation:: 基本的なインストール方法 * Compilers and Options:: コンパイラとコンパイルオプションの選択 * Multiple Architectures:: 複数のアーキテクチャでコンパイル * Installation Names:: インストール名の変更 * Optional Features:: 取捨選択の可能な機能 * System Type:: システムの種類 * Sharing Defaults:: `configure' スクリプトのデフォルト を共通の値に設定するには * Operation Controls:: `configure' の動作の制御 * Optional Feature List:: 取捨選択の可能な機能の一覧 設定ファイル * Single Directive:: 単独指示子の一般形 * Single Directive List:: 単独指示子の一覧 * Group Directive:: 複合指示子の一般形 * Book Group Directive:: 複合指示子の一覧 * Sample Configuration:: 設定ファイルの例 設定ファイルのチェックコマンド * Invoking ebncheck:: `ebncheck' の実行 * ebncheck Options:: `ebncheck' のオプション 環境設定 * Services:: `services' ファイルの設定 * Syslog:: `syslog.conf' ファイルの設定 * Working Directory:: EBNETD の作業用ディレクトリ * Mount CD-ROM Books:: CD-ROM 書籍のマウント * Appendix Package:: appendix パッケージの用意 `ebnetd' の起動 * ebnetd Standalone:: `ebnetd' をスタンドアロンで起動 * ebnetd Child of inetd:: `ebnetd' を `inetd' 経由で起動 * ebnetd Child of xinetd:: `ebnetd' を `xinetd' 経由で起動 * ebnetd Test with telnet:: `telnet' による `ebnetd' の確認 * ebnetd Options:: `ebnetd' のオプション `ndtpd' の起動 * ndtpd Standalone:: `ndtpd' をスタンドアロンで起動 * ndtpd Child of inetd:: `ndtpd' を `inetd' 経由で起動 * ndtpd Child of xinetd:: `ndtpd' を `xinetd' 経由で起動 * ndtpd Test with telnet:: `telnet' による `ndtpd' の確認 * ndtpd Options:: `ndtpd' のオプション `ebhttpd' の起動 * ebhttpd Standalone:: `ebhttpd' をスタンドアロンで起動 * ebhttpd Child of inetd:: `ebhttpd' を `inetd' 経由で起動 * ebhttpd Child of xinetd:: `ebhttpd' を `xinetd' 経由で起動 * ebhttpd Test with telnet:: `telnet' による `ebhttpd' の確認 * ebhttpd Options:: `ebhttpd' のオプション サーバの終了および再始動 * Invoke Server Controler:: サーバ制御コマンドの実行 * ebncontrol Options:: サーバ制御コマンドのオプション 毎日の管理作業 * ebndaily Options:: `ebndaily' のオプション  File: ebnetd-ja.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top はじめに ******** 本 EBNETD 配布パッケージには、`ebnetd', `ndtpd', `ebhttpd' という 3 つのサーバコマンドを収録しています。 これらはいずれも、TCP/IP を用いて遠隔ホストの CD-ROM 書籍にアクセスする ためのサーバです。 UNIX 系 OS のシステム上で動作させることができます。 `ebnetd' `ebnetd' は EBNET プロトコルのサーバで、EBNET は "EB ライブラリ" と通信を行うために設計されたプロトコルです。 EB ライブラリは、CD-ROM 書籍のアクセスを行う、C 言語のライブラリです。 `ndtpd', `ebhttpd' も EB ライブラリを使用しています。 `ebnetd' を使用すると、EB ライブラリのアプリケーションは、遠隔ホスト の CD-ROM 書籍にアクセスできるようになります。 EB ライブラリについての詳細は、 を参照して下さい。 `ndtpd' `ndtpd' は NDTP (Network Dictionary Transfer Protocol) サーバです。 NDTP を最初に実装したサーバは "dserver" で、`ndtpd' は dserver-2.2 と上位互換性があります。 Web ページ に `ndtpd' と通信可能な NDTP クライアントの一覧が載っています。 `ebhttpd' `ebhttpd' は WWW (World Wide Web) サーバです。 HTTP/1.0 および HTTP/1.1 (Hypertext Transfer Protocol version 1.0 および 1.1) に対応しています。 これらサーバ群は、EB, EBG, EBXA, EBXA-C, S-EBXA および EPWING 形式の CD-ROM 書籍に対応しています。 これらの形式の CD-ROM 書籍は、日本で一般的に使われています。 CD-ROM 書籍自体は ISO 9660 形式になっていますので、他の ISO 9660 形式 と同じ要領でマウントすることができます。 サーバは、デフォルトではスタンドアロンで動作しますが、`inetd' 経由で起動するようにすることも可能です。 EBNETD はフリーソフトウェアです。あなたは、Free Software Foundation が 公表した GNU General Public License (GNU 一般公有使用許諾) バージョン 2 あるいはそれ以降の各バージョンの中からいずれかを選択し、そのバージョ ンが定める条項に従って本プログラムを再頒布または変更することができます。 EBNETD は有用とは思いますが、頒布にあたっては、市場性及び特定目的適合性 についての暗黙の保証を含めて、いかなる保証も行ないません。詳細について は GNU General Public License をお読み下さい。 加えて、あなたは自分の所有する CD-ROM 書籍の使用許諾も守らなくてはいけ ません。 EBNETD はフリーソフトウェアですが、あなたの書籍が自由に使えるものである とは限りません。 使用を許されていないホストやユーザに対して、あなたの書籍を公開しないで 下さい。 この文書は EBNETD バージョン 1.0 に対応しています。 最新の EBNETD は から入手できます。 EBNETD に関する情報は から得ることができます。 コメントやバグの報告は 宛に、日本語か英語でお送り下さい。  File: ebnetd-ja.info, Node: Installation, Next: Configuration File, Prev: Introduction, Up: Top EBNETD のインストール ********************* EBNETD は CD-ROM 書籍にアクセスするために、EB ライブラリを使用しています。 EBNETD をインストールする前に、EB ライブラリ 3.3 もしくはそれ以降の バージョンをインストールする必要があります。 最新の EB ライブラリは から入手できます。 EB ライブラリに関する情報は から得ることができます。 * Menu: * Basic Installation:: 基本的なインストール方法 * Compilers and Options:: コンパイラとコンパイルオプションの選択 * Multiple Architectures:: 複数のアーキテクチャでコンパイル * Installation Names:: インストール名の変更 * Optional Features:: 取捨選択の可能な機能 * System Type:: システムの種類 * Sharing Defaults:: `configure' スクリプトのデフォルト を共通の値に設定するには * Operation Controls:: `configure' の動作の制御 * Optional Feature List:: 取捨選択の可能な機能の一覧  File: ebnetd-ja.info, Node: Basic Installation, Next: Compilers and Options, Prev: Installation, Up: Installation 基本的なインストール方法 ======================== 以下に記したのは、一般的なインストールの方法です。 `configure' シェルスクリプトは、コンパイル中に使用される、システム 依存のチェック項目の値を正しく推定しようと努めます。 `configure'は、判定した値を利用してパッケージ中の各ディレクトリの `Makefile'を生成します。 加えて、システムに依存する定義内容を記した `.h' ファイルを一つ もしくはいくつか生成することもあります。 最後に、`configure' は `config.status' というシェルスクリプト `config.cache'、`config.log' というファイルを生成します。 `config.status' は、現在のコンフィグレーションを後で再度生成すると きに用います。 `config.cache' は、再度コンフィグレーションを行うときにスピードアップ を図るために、テストの結果を保存してあります。 `config.log' には、(主に `configure' のデバッグに役立つような) コンピュータの出力が記録されています。 あなたがパッケージをコンパイルするにあたって、特別なことをしなければ ならなかったときは、`configure' がどのような判定をしていたのかを 調べてみて、`README' に記されたアドレスに宛てて、相違点や指摘を メールで送って下さい。 そうすれば、次回のリリースに向けて検討されると思います。 もし、`config.cache' に見られたくない結果が記録されている場合は、 その部分を削除したり編集したりしても構いません。 `configure.in' というファイルは、`autoconf' というプログラムが `configure' を生成するときに参照します。 あなたにとって `configure.in' というファイルが必要になるのは、 `configure.in' の内容を変更したい場合か、`autoconf' のもっと 新しいバージョンで `configure' を生成したい場合の、いずれかだけです。 パッケージの最も単純なコンパイル方法は次の通りです。 1. パッケージのソースコードが置かれているディレクトリに移動 (`cd') し、 あなたのシステム向けのコンフィグレーションを行うために `./configure' を実行します。 あなたが古いバージョンの System V で `csh' を使用している場合は、 `csh' 自身がスクリプトを実行してしまわないように、 `sh. /configure' とする必要があるかも知れません。 `configure' の実行には少々時間がかかります。 実行している間は、どのような項目をチェックしているのかを記したメッセージ が出力されます。 2. `make' を実行してパッケージをコンパイルします。 3. 任意で、パッケージに付属しているセルフテストを実行する場合は、 `make check' を実行します。 4. `make install' を実行して、プログラムおよびデータファイル、 ドキュメントをインストールします。 5. `make clean' を実行すると、生成されたプログラムのバイナリファイルや オブジェクトファイルを、ソースコードの置かれたディレクトリから消すことが できます。 一緒に `configure' が生成したファイルも消すには (こうすることで、 別の種類のコンピュータでパッケージをコンパイルできます)、 `make distclean' を実行します。 `make maintainer-clean' というターゲットも用意されていますが、 これは主にそのパッケージの開発者のためのものです。 `make maintainer-clean' を実行してしまうと、パッケージに元々 含まれていたファイルを再生成するために、他のいろいろなプログラムを 入手しなくてはいけなくなるかも知れません。  File: ebnetd-ja.info, Node: Compilers and Options, Next: Multiple Architectures, Prev: Basic Installation, Up: Installation コンパイラとコンパイルオプション ================================ システムによっては、`configure' スクリプトが理解していない、 コンパイルやリンクのための特別なオプションを与える必要があります。 環境変数を通して、`configure' に対して初期値を与えることができます。 Bourne シェルと互換性のあるシェルを使用している場合は、次のようにします。 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure `env' というコマンドがシステムにあるならば、次のようにすることも できます。 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure  File: ebnetd-ja.info, Node: Multiple Architectures, Next: Installation Names, Prev: Compilers and Options, Up: Installation 複数のアーキテクチャでのインストール ==================================== オブジェクトファイルをアーキテクチャ毎に別々のディレクトリに置くように することにより、種類の異なる複数のコンピュータが、パッケージを同時に コンパイルできます。 これを行うには、GNU `make' のように、`VPATH' 変数に対応した `make' を使用する必要があります。 オブジェクトファイルや実行形式のファイルを置いておきたいディレクトリに 移動 (`cd') して、そこで `configure' スクリプトを実行します。 `configure' は、自身の存在するディレクトリおよび `..' に ソースコードがあるかどうかを自動的に調べます。 `VPATH' 変数に対応していない `make' を使用している場合は、 ソースコードディレクトリの下で、一度に一つのアーキテクチャずつコンパイル していくしかありません。一つのアーキテクチャのコンパイルが終わったら、 別のアーキテクチャでコンパイルするために再コンフィグレーションを行う 前に `make distclean' を実行して下さい。  File: ebnetd-ja.info, Node: Installation Names, Next: Optional Features, Prev: Multiple Architectures, Up: Installation インストール名 ============== デフォルトでは、`make install' を実行すると、パッケージ中のファイル が `/usr/local/bin'、`/usr/local/man' などにインストール されます。 `configure' に対して `--prefix=パス' オプションを指定 することで、`/usr/local' 以外のインストール先を指定するとができます。 アーキテクチャに依存したファイルとそうでないファイルを、それぞれ異なった インストール先にインストールすることも可能です。 `configure' に対して `--exec-prefix=パス' を指定すると、 プログラムやライブラリなどのインストール先が パス に変わります。 ドキュメントや、データファイルなどは、通常のインストール先にインストール されます。 加えて、あなたが通常とは異なったディレクトリレイアウトを採用している場合 は、`--bindir=パス' といったオプションを指定することで、特定 の種類のファイルのインストール先だけを変えることができます。 `configure --help' を実行すると、どのようなディレクトリを変更できる のか、どのような種類のファイルがどのディレクトリにインストールされるのかが 分かります。 パッケージがサポートしているならば、`configure' に `--program-prefix=接頭辞' や `--program-suffix=接尾辞' というオプションを与えることで、 インストール時にプログラム名に接頭辞や接尾辞を付加することができます。  File: ebnetd-ja.info, Node: Optional Features, Next: System Type, Prev: Installation Names, Up: Installation 取捨選択の可能な機能 ==================== パッケージによっては、`configure' が `--enable-機能' オプションを認識することがあります。 ここで 機能 は、パッケージにおいて取捨選択の可能な機能を表します。 また、`--with-パッケージ' オプションを認識することもあります。 ここで パッケージ は、`gnu-as' や (X ウィンドウシステムの ための) `x' といったものです。 `README' ファイルでは、どのような `--enable-'、`--with-' オプションをパッケージが認識するのか、記しておくべきです。 一般に、X ウィンドウシステムを使用しているパッケージでは、`configure' は X の include ファイルとライブラリファイルを自動的に見つけ出すことが できますが、見つけられない場合は、`configure' のオプション `--x-includes=ディレクトリ' と `--x-libraries=ディレクトリ' を用いることでディレクトリの 位置を明示的に指定することができます。  File: ebnetd-ja.info, Node: System Type, Next: Sharing Defaults, Prev: Optional Features, Up: Installation システムの種類の指定 ==================== 設定項目によっては、`configure' が自動的に識別できなくても、 パッケージが動作するホストの種類を基に決定しなければならないときもあります。 通常、`configure' はそのホストの種類を識別することができますが、 もしも `configure' がホストの種類を識別できないという旨のメッセージ を出力してきたときは、`--host=種類' オプションを与えて下さい。 種類 は `sun4' のようなシステムの種類を表した短い名前か、 あるいは次のように 3 つの項からなる正式名称のいずれかです。 CPU-社名-システム それぞれの項にどのような値が指定可能なのかについては、`config.sub' ファイルをご覧下さい。 パッケージが `config.sub' を含んでいないのであれば、そのパッケージ はホストの種類を識別する必要がないことを意味しています。 あなたがクロスコンパイルのためのコンパイラツールをインストールしようと している場合は、`--target=種類' オプションを使用することで、 どのホスト向けのコードを生成させるのかを指定できます。そして、 `--build=種類' オプションを使用することで、パッケージを コンパイルしようとしているシステムの種類を指定することができます。  File: ebnetd-ja.info, Node: Sharing Defaults, Next: Operation Controls, Prev: System Type, Up: Installation デフォルト値の共有 ================== 複数の `configure' スクリプトに対して共通のデフォルト値を設定したい ときは、サイト毎に `config.site' というシェルスクリプトを作成し、 そこに `CC' や `cache_file'、`prefix' といった変数の デフォルト値を記述して下さい。 `configure' は `PREFIX/share/config.site' があれば、 それを調べ、次に `PREFIX/etc/config.site' があればそれを 調べます。 あるいは、環境変数 `CONFIG_SITE' を設定することで、サイト固有の スクリプトの位置を指定することもできます。 ただし、すべての `configure' スクリプトがサイト固有のスクリプトを見 に行くわけではありませんので、ご注意下さい。  File: ebnetd-ja.info, Node: Operation Controls, Next: Optional Feature List, Prev: Sharing Defaults, Up: Installation `configure' の動作の制御 ======================== `configure' は次に記したオプションを認識します。 `--cache-file=ファイル' テストの結果の読み込みや書き出しに使用するファイルは、通常 `./config.cache' ですが、代わりに ファイル を用います。 `configure' をデバッグするときは、ファイル に `/dev/null' を指定することで、キャッシュを抑制することができます。 `--help' `configure' のオプションの一覧を表示して、終了します。 `--quiet' `--silent' `-q' どのチェック項目を行っているのかを示すメッセージを出力しません。 通常のメッセージ出力をすべて抑制するには、`/dev/null' へ リダイレクトして下さい (ただし、エラーメッセージについては出力されて しまいますが)。 `--srcdir=ディレクトリ' パッケージのソースコードを探し出す際に、ディレクトリ を探します。 通常、`configure' は自動的にディレクトリを決定します。 `--version' `configure' スクリプトがどのバージョンの Autoconf によって生成された のかを表示して、終了します。 役に立つ場面は限られますが、`configure' には他にもいくつかの オプションが用意されています。  File: ebnetd-ja.info, Node: Optional Feature List, Prev: Operation Controls, Up: Installation 選択可能な機能の一覧 ==================== 本パッケージの `configure' は以下に記した `--enable-' および `--with-' オプションを認識します。 `--with-logdir=DIR' `ebndaily' がローテーションを行う syslog ファイル が置かれるディレクトリのデフォルトとして DIR を指定します。 無指定時は、`LOCALSTATEDIR/ebnetd/log' です。 `--with-eb-conf=FILE' EB ライブラリの設定ファイルとして FILE を読み込みます。 デフォルトは、`SYSCONFDIR/eb.conf' です。 `--with-gnu-ld' C コンパイラが GNU ld を使用していると仮定します。 デフォルトは、`no' です。 `--enable-ipv6' IPv6 に対応させます。 システムが IPv6 に対応している場合、 The default value is `yes' if the system supports IPv6.  File: ebnetd-ja.info, Node: Configuration File, Next: Configuration Checker, Prev: Installation, Up: Top 設定ファイル ************ `ebnetd', `ndtpd', `ebhttpd' を始動させるためには、まず 設定ファイルを編集する必要があります。 サーバは、始動時および再始動時にこのファイルを読み込みます。 このファイルの内容によって、サーバの様々な挙動が決定されます。 EBNETD を `/usr/local' 以下にインストールし、かつ、マシン固有の 読み込み専用のデータを置くディレクトリ (`sysconfdir') の位置を 変更していなければ、無指定時に読み込まれる設定ファイルは `/usr/local/etc/ebnetd.conf' になります。 設定ファイルの位置は、コマンドラインオプション `--configuration-file' (あるいは `-c') を用いることで変更が可能です (*note `ebnetd' のオプション: ebnetd Options.)。 設定ファイルの中では、空行、および空白以外の最初の文字がハッシュ記号 (`#') である行は無視されます。 他の行はすべて、"単独指示子 (single directive)" か "複合指示子 (group directive)" のいずれかでなくてはなりません。 単独指示子と複合指示子は、どのような順序で定義しても差し支えありません。 各行は、改行文字を含め 511 文字を越えてはなりません。 * Menu: * Single Directive:: 単独指示子の一般形 * Single Directive List:: 単独指示子の一覧 * Group Directive:: 複合指示子の一般形 * Book Group Directive:: 複合指示子の一覧 * Sample Configuration:: 設定ファイルの例  File: ebnetd-ja.info, Node: Single Directive, Next: Single Directive List, Prev: Configuration File, Up: Configuration File 単独指示子の一般形 ================== 単独指示子とは、1 行で完結する指示子です。 単独指示子の一般形は次の通りです。 指示子の名前 指示子の値 以下の例では、`syslog-facility' が指示子の名前、`local0' が その値です。 syslog-facility local0 指示子名の大文字と小文字は区別されますので、`syslog-facility' を `Syslog-Facility' と書くことはできません。 指示子の名前と値の区切りには、空白かタブを用います。 連続した空白とタブが、行頭および行末にあった場合、それらは無視されます。  File: ebnetd-ja.info, Node: Single Directive List, Next: Group Directive, Prev: Single Directive, Up: Configuration File 単独指示子の一覧 ================ 単独指示子には次のようなものがあります。 `ebnet-port' `ebnet-port' 指示子では、`ebnetd' が見張るポートの番号を指定 します。 指示子の値は、TCP のサービス名 (例: `EBNET') か、ポート番号 (例: `22010') でなくてはいけません。 `ebnetd' を `inetd' 経由で起動した場合は、この指示子は 無視されます。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は `EBNET' です。 `ndtpd', `ebhttpd' はこの指示子を常に無視します。 `ndtp-port' `ndtp-port' 指示子では、`ndtpd' が見張るポートの番号を指定 します。 指示子の値は、TCP のサービス名 (例: `NDTP') か、ポート番号 (例: `2010') でなくてはいけません。 `ebnetd' を `inetd' 経由で起動した場合は、この指示子は 無視されます。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は `NDTP' です。 `ebnetd', `ebhttpd' はこの指示子を常に無視します。 `http-port' `http-port' 指示子では、`ebhttpd' が見張るポートの番号を 指定します。 指示子の値は、TCP のサービス名 (例: `HTTP') か、ポート番号 (例: `80') でなくてはいけません。 `ebhttpd' を `inetd' 経由で起動した場合は、この指示子は 無視されます。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は `HTTP' です。 `ebnetd', `ebhttpd' はこの指示子を常に無視します。 `user' `user' 指示子では、サーバプロセスの実効ユーザを指定します。 指示子の値は、ユーザ名 (例: `nobody') か、ユーザ ID (例: `65535') でなくてはいけません。 別のユーザに実効ユーザを変える場合は、スーパユーザ特権を有した状態で サーバを起動しなくてはなりません。 実効ユーザの変更に失敗すると、サーバは走行の継続を断念します。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 この指示子を定義しなかった場合、サーバプロセスの実効ユーザは変化 しません。 `ndtpuser' のようなダミーのユーザアカウントを一つ作って、それを この指示子で指定することをお薦めします。 `group' `group' 指示子では、サーバプロセスの実効グループを指定します。 指示子の値は、ユーザ名 (例: `nogroup') か、グループ ID (例: `65534') でなくてはいけません。 実効グループの変更に失敗すると、サーバは走行の継続を断念します。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することもできません。 この指示子を定義しなかった場合、サーバプロセスの実効グループは変化 しません。 `ndtpgrp' のようなダミーのグループアカウントを一つ作って、それを この指示子で指定することをお薦めします。 `max-clients' `max-clients' 指示子では、同時にサーバに接続できるクライアントの 数の上限を指定します。 指示子の値は、0 以上の整数でなくてはいけません。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は `1' です。 指示子の値を 0 に設定すると、無制限になります。 `hosts' `hosts' 指示子では、どのホストがサーバに接続でき、どのホストが 接続できないのかを指定します。 指示子の値は IP アドレス、ホスト名、アドレス/ネットマスク の いずれかです。 加えて、直前に感嘆符 (`!') を付けることができます。 指示子の値が感嘆符で始まっていた場合は、それに続く IP アドレスまたは ホスト名にマッチするホストからの接続要求は拒否します。 感嘆符がない場合は、指示子の値にマッチするホストからの接続要求は許可 します。 # `host.xxx.yyy.jp' からの接続を許可する。 hosts host.xxx.yyy.jp # `127.0.0.1' からの接続を許可する。 hosts 127.0.0.1 # `192.24.1.0/24'.からの接続を拒否する。 hosts !192.24.1.0/24 ホスト名に限り、アスタリスク (`*') と疑問符 (`?') を使う ことができます。 アスタリスクは、先頭の感嘆符を除いた任意の 0 文字以上の文字列にマッチ します。 # `xxx.yyy.jp' ドメインのホストからの接続を拒否する。 hosts !*.xxx.yyy.jp # どのホストからの接続も許可する。 hosts * 疑問符は "未知のホスト名" を表します。 # ホスト名が分からないホストからの接続を拒否する。 hosts !? この指示子は必ずしも定義する必要はありません。 また、何度でも定義することが可能です。 設定ファイルに `hosts' 指示子が無くてもエラーにはなりませんが、 どのクライアントもサーバにはアクセスできなくなります。 いずれの `hosts' 指示子にもマッチしないホストからの接続要求は拒否 されます。 複数の `hosts' にマッチする場合は、設定ファイルの先頭に最も近い ものが採用されます。 以下の例では、`sub1.xxx.yyy.jp' ドメインに属するホストからの 接続要求は拒否していますが、それ以外の `xxx.yyy.jp' ドメインに 属するホストからの接続要求は許可しています。 hosts !*.sub1.xxx.yyy.jp hosts *.xxx.yyy.jp この例では、指示子の順序は重要です。 順序を引っくり返してしまうと、`sub1.xxx.yyy.jp' を含め、 `xxx.yyy.jp' ドメインに属するすべてのホストがサーバに接続できて しまいます。 # 間違い!!! hosts *.xxx.yyy.jp hosts !*.sub1.xxx.yyy.jp ホスト名を比較する際、サーバは常にクライアントの正式ホスト名を使用 します。 ホスト名は、クライアントのアドレスから DNS などの名前解決のサービス を利用して取得します。 別名は使用されませんので、注意して下さい。 IPv6 アドレスおよび IPV6 アドレス/ネットマスク パターンを指定 することも可能です。 IPv6 対応機能を有効にしてコンパイルされていないサーバは IPv4 クライアントとしか通信できませんが、設定ファイルに書かれた IPv6 アドレスを解釈することはできます。 # `12ab:0:0:cd3::/60' と `::1' からの接続を許可する。 hosts ::1 hosts 12ab:0:0:cd3::/60 `hosts' 指示子では、IPv4 アドレス (例 `192.168.1.1') とそれ に対応する IPv4 射影 IPv6 アドレス (例 `::ffff:192.168.1.1') は 等価になります。 つまり、IPv4 クライアント `192.168.1.1' は `hosts' 指示子 `::ffff:192.168.1.1' にマッチし、IPv6 クライアント `::ffff:192.168.1.1' は `hosts' 指示子 `192.168.1.1' にマッチします。 `timeout' `timeout' 指示子では、交信が途絶えたクライアントとの接続を サーバが切断するまでの秒数を指定します。 指示子の値は、0 以上の整数でなくてはいけません。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は `900' (15分) です。 指示子の値を 0 に設定すると、時間切れによる切断は行いません。 `work-path' `work-path' 指示子では、サーバの作業用ディレクトリ のパスを指定します (*note 作業用ディレクトリ: Working Directory.)。 指示子の値は、絶対パスでなくてはいけません。 サーバはこのディレクトリの下に作業用のファイルをいくつか作成します。 また、異常終了によってコアファイルをダンプするときは、このディレクトリ に作成します。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 EBNETD を `/usr/local' 以下にインストールし、かつ、マシン固有の 更新されうるデータを置くディレクトリ (`localstatedir') を変更して いなければ、無指定時の値は `/usr/local/var/ebnetd/' になります。 `max-hits' `max-hits' 指示子では、一回の検索でサーバが返すヒット数の上限を 指定します。 サーバは、この指示子で指定された値と同じだけのヒット数を見つけた時点 で、ただちに検索を中止します。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は `50' です。 指示子の値を 0 に設定すると、無制限になります。 `ebnetd' はこの指示子を常に無視します。 `max-text-size' `max-text-size' 指示子は、サーバがクライアントへの応答 1 回で 返すテキストのバイト数の上限を指定します。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時の値は `32768' です。 指示子の値を 0 に設定すると、無制限になります。 `ebnetd' はこの指示子を常に無視します。 `syslog-facility' `syslog-facility' 指示子では、syslog のファシリティを指定します (例: `daemon', `local0' など)。 この指示子は必ずしも定義する必要はありません。 また、2 度以上定義することはできません。 無指定時は `daemon' を用います。 また、サーバが設定ファイルを読み込み終わるまでは、`daemon' が 用いられます。  File: ebnetd-ja.info, Node: Group Directive, Next: Book Group Directive, Prev: Single Directive List, Up: Configuration File 複合指示子の一般形 ================== 複合指示子 (指示命令) とは、記述が設定ファイル内の複数行に渡る指示子です。 複合指示子の一般形は次の通りです。 begin 複合指示子の名前 副指示子の名前 副指示子の値 : : (繰り返し) : end キーワード `begin' は、複合指示子の開始を表します。 `begin' は後ろに 複合指示子の名前 を引数として取ります。 `begin' と 複合指示子の名前 は空白かタブで区切り、両方とも 同じ行の中に置きます。 キーワード `end' は、複合指示子の終了を表します。 `end' は、単独で 1 行にして置きます。 EBNETD バージョン 1.0 では、使用できる複合指示子の名前は `book' だけです。 それぞれの "副指示子" は、`begin' と `end' の行の間に 置きます。 副指示子に関する記述の一般的な規則は、単独指示子と変わりません (たとえば、副指示子の名前と 副指示子の値 は空白かタブで 区切ることなど)。 以下は、 `book' 複合指示子の記述例です。 begin book name EJDICT title English Japanese Dictionary path /mnt/cdrom hosts 127.0.0.1 hosts host.your.domain end  File: ebnetd-ja.info, Node: Book Group Directive, Next: Sample Configuration, Prev: Group Directive, Up: Configuration File `book' 複合指示子 ================= 一つの `book' 複合指示子 は一冊の CD-ROM 書籍に対応しますので、 CD-ROM 書籍一冊ごとにこの複合指示子を定義しなくてはいけません。 `book' 複合指示子の副指示子として、EBNETD が認識するものは次の通り です。 `name' `name' 副指示子では、その書籍の名前を指定します。 副指示子の値に用いることができるのは、英小文字 (`a'..`z')、 数字 (`0'..`9')、下線 (`_')、ハイフン (`-') だけで、 長さは 14 文字までです。 この名前は、書籍を識別するために使いますので、各書籍には異なる名前を 付けなくてはいけません。 この副指示子は、それぞれの `book' 複合指示子に必須です。 また、1 つの `book' 複合指示子で 2 度以上定義することはできません。 `title' `title' 副指示子では、その書籍の題名を指定します。 副指示子の値には、改行文字とナル文字 (`\0') を除く任意の文字を 使って指定することができますが、長さは 80 バイトまでです。 EUC (Extended Unix Code) を用いれば日本語の文字も使用可能です。 副指示子の値の中に空白やタブを用いることも可能で、これらは他の文字と 同じく一文字として解釈されます。 この副指示子は、それぞれの `book' 複合指示子に必須です。 また、1 つの `book' 複合指示子で 2 度以上定義することはできません。 `path' `path' 副指示子では、その書籍の絶対パスを指定します。 パスはその書籍のトップディレクトリ、つまり `catalog' または `catalogs' ファイルの存在するディレクトリを指してしなくては いけません。 この副指示子は、それぞれの `book' 複合指示子に必須です。 また、1 つの `book' 複合指示子で 2 度以上定義することはできません。 `appendix-path' `appendix-path' 副指示子では、その書籍に対応する appendix (付録) パッケージの絶対パスを指定します。 パスは appendix パッケージのトップディレクトリ、つまり `catalog' または `catalogs' ファイルの存在するディレクトリを指してしなくては いけません。 この副指示子は、必ずしも定義する必要はありません。 また、1 つの `book' 複合指示子で 2 度以上定義することはできません。 書籍を使う上で、appendix パッケージは必須ではありませんが、ないと外字が 識別不可能になるため、読みづらいかも知れません。 `max-clients' `max-clients' 副指示子には、この書籍を同時にいくつのクライアントが 使うことができるのかを指定します。 副指示子の値には、0 以上の整数を指定します。 この副指示子は、必ずしも定義する必要はありません。 また、1 つの `book' 複合指示子で 2 度以上定義することはできません。 無指定時の値は `1' です。 0 を指定すると、無制限になります。 `work-path' (*note Working Directory::) に共通の値をセットしておくと、 クライアントの数が `ebnetd', `ndtpd', `ebhttpd' 間で 共有されます。 たとえば、ある瞬間にある書籍をアクセスしている `ebnetd' クライアント が 2 つ、`ndtpd' クライアントが 3 つあったとすると、サーバは 5 つのクライアントが書籍にアクセスしているものと判断します。 `hosts' `hosts' 副指示子には、この書籍にどのホストがアクセスできて、どの ホストができないのかを指定します。 この副指示子は、必ずしも定義する必要はありません。 また、1 つの `book' 複合指示子で何度でも定義することが可能です。 `book' 複合指示子が `hosts' 副指示子を持たなくてもエラーには なりませんが、その書籍はどのクライアントからもアクセスできません。 この副指示子の表記方法は、単独指示子の `hosts' と同じです。  File: ebnetd-ja.info, Node: Sample Configuration, Prev: Book Group Directive, Up: Configuration File 設定ファイルの例 ================ EBNETD を `/usr/local' 以下にインストールし、かつ、マシン固有の 読み込み専用のデータを置くディレクトリ (`sysconfdir') の位置を変更 していなければ、この設定ファイルのサンプルは `/usr/local/etc/ebnetd.conf.sample' にインストールされています。 ###################################################################### # ebnetd/ndtpd/ebhttpd の設定ファイルのサンプル # (このファイルを `ebnetd.conf' にコピーして、編集して下さい) ###################################################################### ### `ebnetd' が見張るポート番号 ### (無指定の場合: ebnet) # ebnet-port ebnet ### `ndtpd' が見張るポート番号 ### (無指定の場合: ndtp) # ndtp-port ndtp ### `ebhttpd' が見張るポート番号 ### (無指定の場合: http) # http-port http ### サーバのプロセスの所有ユーザ ### (無指定の場合: なし) user ndtpuser ### サーバのプロセスのグループ ### (無指定の場合: なし) group ndtpgrp ### サーバに同時に接続できるクライアントの数 ### (無指定の場合: 1) # max-clients 1 ### サーバに接続できるホスト、できないホスト ### (無指定の場合: なし) hosts 127.0.0.1 hosts ::1 hosts !? hosts host.your.domain ### サーバが交信の途絶えたコネクションを切るまでの時間 ### (無指定の場合: 900) # timeout 900 ### 作業用ディレクトリのパス ### サーバを起動する前に、このディレクトリを作り、サーバプロセスが ### 書き込めるようにしておいて下さい。 ### (無指定の場合: /usr/local/var/ebnetd) # work-path /usr/local/var/ebnetd ### 一回の検索で、サーバが返す、ヒットしたエントリの最大個数 ### (無指定の場合: 50) # max-hits 50 ### クライアントへの一回の応答で、サーバが返すテキストの最大サイズ ### (default: 32768) # max-text-size 32768 ### syslog のファシリティ ### (無指定の場合: daemon) syslog-facility local0 ### ### 書籍のエントリ ### begin book ### 書籍名 ### (必須) name JITENBAN97 ### 書籍の題名 ### (必須) title Jitenban 97 ### 書籍のトップディレクトリ ### (必須) path /cdrom ### appendix (付録) パッケージのトップディレクトリ ### (無指定の場合: なし) appendix-path /usr/local/share/eb/appendix/jitenban97-2.1 ### 同時にアクセスできるクライアントの数 ### (無指定の場合: 1) max-clients 1 ### この書籍を利用できるホスト、できないホスト ### (無指定の場合: なし) hosts 127.0.0.1 hosts ::1 hosts !? hosts host.your.domain end ### もし、CD-ROM 書籍が他にもあるなら、`book' 複合指示子 (`begin book' ### から `end' の間の行) を追加して下さい。`book' 複合指示子は、 ### 書籍一冊毎に必要です。  File: ebnetd-ja.info, Node: Configuration Checker, Next: Setup Your Environment, Prev: Configuration File, Up: Top 設定ファイルのチェックコマンド ****************************** 編集し終えた設定ファイルをチェックするには、`ebncheck' という チェックコマンドを使うと良いでしょう。 EBNETD を `/usr/local' 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (`sbindir') の位置を変更していなければ、 `ebncheck' は `/usr/local/sbin' にインストールされています。 歴史的な経緯から、`ndtpd' のための `ndtpcheck', `ebhttpd' のための `ebhtcheck' というコマンドも合わせて用意されていますが、 特に違いはありません。 * Menu: * Invoking ebncheck:: `ebncheck' の実行 * ebncheck Options:: `ebncheck' のオプション  File: ebnetd-ja.info, Node: Invoking ebncheck, Next: ebncheck Options, Prev: Configuration Checker, Up: Configuration Checker `ebncheck' の実行 ================= `ebncheck' コマンドは、`ebnetd' と同じ要領で設定ファイルを 読み込んで、チェックします。 `ebncheck' コマンドの一般的な起動方法は次の通りです。 % /usr/local/sbin/ebncheck ただし、EBNETD を `/usr/local' 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (`sbindir') の位置を変更して いないと仮定しています。 記述の誤りが発見されると、`ebncheck' は標準エラー出力に以下のような メッセージを出力します。 /usr/local/etc/ebnetd.conf:12: unknown user: noboy configuration failure  File: ebnetd-ja.info, Node: ebncheck Options, Prev: Invoking ebncheck, Up: Configuration Checker `ebncheck' のオプション ======================= `ebncheck' コマンドは、伝統的な一文字オプション名と覚えやすい長い オプション名の両方を扱うことができます。 長いオプション名を表すには、`-' ではなく `--' を用います。 オプション名が一意に決まる範囲内で、名前の後方部分を省略することが できます。 `ebncheck' コマンドは以下に挙げたオプションを解釈することが できます。 `-c ファイル' `--configuration-file ファイル' 設定ファイルを指定します。 無指定時のファイル名は、ヘルプメッセージの中に記されています。 `-d' `--debug' `--verbose' デバッグ用の情報を標準エラー出力に出力します。 デバッグ用の情報は、設定ファイルの各行がどのように解釈されるのかを示して くれます。 `-h' `--help' ヘルプメッセージを標準出力に出力して、終了します。 `-v' `--version' バージョン番号を標準出力に出力して、終了します。  File: ebnetd-ja.info, Node: Setup Your Environment, Next: Start ebnetd, Prev: Configuration Checker, Up: Top 環境設定 ******** サーバ周辺のシステムの環境を設定をする必要があるかも知れません。 設定には、おそらくスーパーユーザの権限が必要になるでしょう。 * Menu: * Services:: `services' ファイルの設定 * Syslog:: `syslog.conf' ファイルの設定 * Working Directory:: EBNETD の作業用ディレクトリ * Mount CD-ROM Books:: CD-ROM 書籍のマウント * Appendix Package:: appendix パッケージの用意  File: ebnetd-ja.info, Node: Services, Next: Syslog, Prev: Setup Your Environment, Up: Setup Your Environment `services' ファイル =================== サービス名 `ebnet', `ndtp', `http' があなたのシステムの `services' ファイルに無ければ、追加しなくてはなりません (大抵の場合 `/etc/services')。 もし、あなたのホストが NIS クライアントならば、代わりに NIS サーバ上に ある NIS のマップを修正しなくてはなりません。 もし、次の行が無ければ足します。 http 80/tcp ndtp 2010/tcp ebnet 22010/tcp 次のように、システムの `services' ファイルには、すでに別のサービス 名でエントリが入っているかも知れません。 search 2010/tcp この場合は、サービス名を別名としてその行に追加して下さい。 search 2010/tcp ndtp (詳しくは、あなたのシステムのマニュアルをご覧下さい。)  File: ebnetd-ja.info, Node: Syslog, Next: Working Directory, Prev: Services, Up: Setup Your Environment `syslog.conf' ファイル ====================== `ebnetd', `ndtpd', `ebhttpd' は syslog を使って ログメッセージを記録します。 `syslogd' の設定ファイル (大抵の場合 `/etc/syslog.conf') に、 次のような行を追加して下さい。 一般にフィールドの区切りにはタブしか許されていませんので、空白を 使わないように注意して下さい。 local0.info /usr/local/var/ebnetd/log/ebnetd.log `ebnetd' が使用する syslog のファシリティは、`ebnetd' の 設定ファイルの `syslog-facility' 指示子で決まることに留意して 下さい (*note `syslog-facility': Single Directive List.)。 もしログファイルが存在しなければ、空のファイルを作成します。 % touch /usr/local/var/ebnetd/log/ebnetd.log % chmod 644 /usr/local/var/ebnetd/log/ebnetd.log 現在走行している `syslogd' プロセスの PID を調べます。 % ps axuww | grep syslogd (詳しくは、あなたのシステムのマニュアルをご覧下さい。) `syslogd' が走っているならば、次のような行が見つかるはずです。 root 63 0.0 1.1 188 316 ?? Is 10:04PM 0:00.16 syslogd ハングアップシグナル (`SIGHUP') を `syslogd' に送ると、 `syslogd' は `syslog.conf' を読み込み直します。 % kill -HUP 63 あなたのシステムに `logger' コマンドがあれば、次のようにして `syslogd' にテストメッセージを送ることができます。 % logger -p local0.info "test message"  File: ebnetd-ja.info, Node: Working Directory, Next: Mount CD-ROM Books, Prev: Syslog, Up: Setup Your Environment 作業用ディレクトリ ================== `ebnetd', `ndtpd', `ebhttpd' は作業用のディレクトリの下に いくつかのファイルを作成します。 このディレクトリは、設定ファイルの中の `work-path' 指示子 で指定することができます (*note `work-path': Single Directive List.)。 このディレクトリを作り、サーバプロセスとスーパーユーザだけが書き 込めるようにしておいて下さい。 # mkdir /usr/local/var/ebnetd # chown ndtpuser /usr/local/var/ebnetd # chmod 755 /usr/local/var/ebnetd (あなたのシステムでは、サーバプロセスを所有するユーザが `ndtpuser' であると仮定しています。) ただし、サーバプロセスの所有ユーザとグループは、設定ファイルの中の `user', `group' 指示子でそれぞれ決まりますので、注意 して下さい (*note `user': Single Directive List., および *note `group': Single Directive List.)。  File: ebnetd-ja.info, Node: Mount CD-ROM Books, Next: Appendix Package, Prev: Working Directory, Up: Setup Your Environment CD-ROM 書籍のマウント ===================== 先に述べたように、CD-ROM 書籍自体は ISO 9660 形式に従っています。 CD-ROM 書籍は、他の ISO 9660 形式のディスクと同じ方法でマウントすること ができます。 もし、ISO 9660 の CD-ROM ディスクのマウント方法が分からなければ、あなた のシステムのマニュアルを調べて下さい。 サーバは `ebzip' で圧縮された辞書をアクセスすることができます (*note 圧縮: (ebzip-ja)Compression.)。  File: ebnetd-ja.info, Node: Appendix Package, Prev: Mount CD-ROM Books, Up: Setup Your Environment appendix パッケージの用意 ========================= "appendix" ("付録") とは CD-ROM 書籍の補助データのことです。 appendix は CD-ROM 書籍の出版社から提供されているものではなく、 EB ライブラリに固有のものです。 (本 EBNET 配布パッケージのサーバは、いずれも EB ライブラリに深く 関係していることを思い出して下さい。 `ebnetd' は、EB ライブラリのための遠隔アクセスサーバです。 `ndtpd' と `ebhttpd'は、CD-ROM 書籍のアクセスに EB ライブラリ を使用しています。) appendix は以下のデータを CD-ROM 書籍に対して提供します。 本文の区切りコード あなたが EB ライブラリを使って CD-ROM 辞書の中のある単語を引く際、その 単語の説明が終了する箇所で、EB ライブラリが本文の出力を止めることを あなたは期待するのではないでしょうか。 しかし、EB ライブラリはそのような動作を保証することができません。 なぜなら、CD-ROM 書籍の本文には、項目の終わりを示す印が存在しないから です。 幸いにも、多くの CD-ROM 書籍には、項目の終わりを示す印の代替として 使える、"区切りコード" ("stop code") というものを持っています。 通常、EB ライブラリはこの区切りコードを自動的に推測するようになって いるのですが、時々誤った区切りコードを導き出すことがあります。 appendix の区切りコードは、その書籍の正しい区切りコードを EB ライブラリ に教えてやるために用います。 外字の代替文字列 多くの CD-ROM 書籍は、外字 (独自に定義した文字) を持っており、本文中で その外字を使っています。 CD-ROM 書籍では外字のビットマップフォントを用意しており、 クライアントアプリケーションが外字を出力するには、そのフォントを描画 しなくてはなりません。 appendix では、外字の "代替文字列" ("alternation text") を定義 することができます。 アプリケーションは、ビットマップフォントを描画する代わりに、その 代替文字列を出力することにしても良いでしょう。 appendix パッケージのレイアウトは CD-ROM 書籍のものとよく似ています。 トップディレクトリには `catalog' もしくは `catalogs' ファイルが存在し、各副本のデータは対応するサブディレクトリに配置されて います。 appendx を使うには、設定ファイルの中の、複合指示子 `book' の `appendix-path' 副指示子で指定します (*note `appendix-path': Group Directive.)。 EB ライブラリの公式な FTP サイト () に、appendix パッケージがいくつか置いてあります。 ここに載っていない CD-ROM 書籍用の appendix パッケージを作成する場合は、 `ebappendix' コマンドを使いましょう。 appendix のデータファイルの整形を行うことができます。  File: ebnetd-ja.info, Node: Start ebnetd, Next: Start ndtpd, Prev: Setup Your Environment, Up: Top `ebnetd' の起動 *************** `ebnetd' は、スタンドアロンのデーモン、あるいは `inetd' の 子プロセスとして起動することができます。 指定がなければ、スタンドアロンのデーモンとして起動するようになっています。 サーバへコネクションが頻繁に来ないなら、メモリの消費を抑えるために `ebnetd' を `inetd' の子プロセスとして起動する方が良いでしょう。 しかし、`inetd' によって起動される度に、`ebnetd' は設定ファイル を読み込み、初期化のために CD-ROM 書籍からデータを部分的に読み込みます。 コネクションが頻繁に来るようなら、`ebnetd' をスタンドアロンのデーモン として起動した方が良いでしょう。 あなたのシステムでは `ebnetd' を必要としないなら、この章の残りの 部分は読み飛ばして下さい。 * Menu: * ebnetd Standalone:: `ebnetd' をスタンドアロンで起動 * ebnetd Child of inetd:: `ebnetd' を `inetd' 経由で起動 * ebnetd Child of xinetd:: `ebnetd' を `xinetd' 経由で起動 * ebnetd Test with telnet:: `telnet' による `ebnetd' の確認 * ebnetd Options:: `ebnetd' のオプション  File: ebnetd-ja.info, Node: ebnetd Standalone, Next: ebnetd Child of inetd, Prev: Start ebnetd, Up: Start ebnetd `ebnetd' をスタンドアロンで起動 =============================== `ebnetd' をスタンドアロンのデーモンとして起動するには、次のように コマンドを実行して下さい。 スーパーユーザの権限が必要かも知れません。 % /usr/local/sbin/ebnetd EBNETD を `/usr/local' 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (`sbindir') の位置を変更していなければ、 `ebnetd' は `/usr/local/sbin' にインストールされています。  File: ebnetd-ja.info, Node: ebnetd Child of inetd, Next: ebnetd Child of xinetd, Prev: ebnetd Standalone, Up: Start ebnetd `ebnetd' を `inetd' 経由で起動 ============================== `ebnetd' を `inetd' の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを `inetd.conf' ファイル (大抵の場合 `/etc/inetd.conf') に加えます。 `--inetd' (または `-i') オプションを足すのを忘れないようにして 下さい。 ebnet stream tcp nowait root /usr/local/sbin/ebnetd ebnetd --inetd (ただし、EBNETD を `/usr/local' 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (`sbindir') の位置を変更していない と仮定しています。) 走行している `inetd' プロセスの PID を探し出します。 BSD 系のシステムでは、次のようにします。 % ps axuww | grep inetd SYSV 系のシステムなら、次のようにします。 % ps -ef | grep inetd (詳しくは、あなたのシステムのマニュアルをご覧下さい。) `inetd' が走っているならば、次のような行が見つかるはずです。 root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd 見つかったならば、ハングアップシグナル (`SIGHUP') を `inetd' に送ります。 おそらく、スーパーユーザの権限が必要です。 % kill -HUP 79  File: ebnetd-ja.info, Node: ebnetd Child of xinetd, Next: ebnetd Test with telnet, Prev: ebnetd Child of inetd, Up: Start ebnetd `ebnetd' を `xinetd' 経由で起動 =============================== Linux システムには、伝統的な `inetd' の代わりに `xinetd' を 使用しているものもあります。 `xinetd' の設定ファイルの文法は、伝統的な `inetd' の設定ファイル の文法とは異なります。 `ebnetd' を `xinetd' の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを設定ファイル (大抵の場合 `/etc/xinetd.d/ebnet') に 加えます。 `--inetd' (または `-i') オプションを足すのを忘れないようにして 下さい。 # default: off # description: The ebnet server service ebnet { disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ebnetd server_args = --inetd log_on_failure += USERID } (ただし、EBNETD を `/usr/local' 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (`sbindir') の位置を変更していな いと仮定しています。) 走行している `xinetd' プロセスの PID を探し出します。 % ps axuww | grep xinetd `xinetd' が走っているならば、次のような行が見つかるはずです。 root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd 見つかったならば、USER2 シグナル (`SIGUSR2') を `xinetd' に送ります。 おそらく、スーパーユーザの権限が必要です。 % kill -USR2 79 ebnetd-1.0.dfsg.1/doc-ja/ebnetd-ja.info-20000644000175000017500000005634407773515126017245 0ustar mhattamhattaThis is ./ebnetd-ja.info, produced by makeinfo version 4.2 from ./ebnetd-ja.texi. INFO-DIR-SECTION CD-ROM Book Utilities START-INFO-DIR-ENTRY * EBNETD: (ebnetd). Network EB Library server. * NDTPD: (ndtpd). Server for accessing CD-ROM books with NDTP. * ebHTTPD: (ebhttpd). Server for accessing CD-ROM books with HTTP. END-INFO-DIR-ENTRY EBNETD: CD-ROM 書籍サーバ群、笠原基之 Copyright (C) 1997, 98, 99, 2000, 01, 03 Motoyuki Kasahara Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Free Software Foundation, Inc.  File: ebnetd-ja.info, Node: ebnetd Test with telnet, Next: ebnetd Options, Prev: ebnetd Child of xinetd, Up: Start ebnetd `telnet' による `ebnetd' の確認 =============================== セットアップがすべて完了したら、`telnet' コマンドを用いて `ebnetd' に接続してみましょう。 まず、次のように入力します。 この例では、localhost 上の `ebnetd' に接続しています。 % telnet localhost ebnet `ebnetd' が接続を受け付ければ、次のようなメッセージが表示されます。 Connected to localhost. Escape character is '^]'. ここで、 に続けて を入力します。 BOOKLIST `ebnetd' が正常に動いていれば、次のように利用可能な CD-ROM 書籍の一覧を出力します。 !OK; book list follows chujiten kojien colloc colloc.app 接続を終えるには、 に続けて を入力します。 QUIT Connection closed by foreign host.  File: ebnetd-ja.info, Node: ebnetd Options, Prev: ebnetd Test with telnet, Up: Start ebnetd `ebnetd' のオプション ===================== `ebnetd' コマンドは、伝統的な一文字オプション名と覚えやすい長い オプション名の両方を扱うことができます。 長いオプション名を表すには、`-' ではなく `--' を用います。 オプション名が一意に決まる範囲内で、名前の後方部分を省略することが できます。 `ebnetd' コマンドは以下に挙げたオプションを解釈することができます。 `-c ファイル' `--configuration-file ファイル' 設定ファイルを指定します。 無指定時のファイル名は、ヘルプメッセージの中に記されています。 `-h' `--help' ヘルプメッセージを標準出力に出力して、終了します。 `-i' `--inetd' `inetd' モード。 `ebnetd' を `inetd' から起動させるときは、このオプションを指定 する必要があります。 `-t' `--test' テストモード。 `ebnetd' はフォアグラウンドプロセスとして起動され、決して fork を 行いません。 サーバへのリクエストは標準入力から読み込まれ、クライアントへのレスポンス は標準出力へ出力されます。 標準入力および標準出力は、端末と結び付けられたファイル記述子であっても 構いません。 また、アクセスに対する識別チェックは行いませんので、すべての CD-ROM 書籍 にアクセス可能です。 `-v' `--version' バージョン番号を標準エラー出力に出力して、終了します。  File: ebnetd-ja.info, Node: Start ndtpd, Next: Start ebhttpd, Prev: Start ebnetd, Up: Top `ndtpd' の起動 ************** あなたのシステムでは `ndtpd' を必要としないなら、この章は読み飛ばして 下さい。 `ndtpd' も、スタンドアロンのデーモンとして起動するやり方と `inted' の子プロセスとして起動するやり方の、2 つの実行モードを 持っています。 指定がなければ、`ndtpd' はスタンドアロンのデーモンとして起動します。 * Menu: * ndtpd Standalone:: `ndtpd' をスタンドアロンで起動 * ndtpd Child of inetd:: `ndtpd' を `inetd' 経由で起動 * ndtpd Child of xinetd:: `ndtpd' を `xinetd' 経由で起動 * ndtpd Test with telnet:: `telnet' による `ndtpd' の確認 * ndtpd Options:: `ndtpd' のオプション  File: ebnetd-ja.info, Node: ndtpd Standalone, Next: ndtpd Child of inetd, Prev: Start ndtpd, Up: Start ndtpd `ndtpd' をスタンドアロンで起動 ============================== `ndtpd' をスタンドアロンのデーモンとして起動するには、次のように コマンドを実行して下さい。 スーパーユーザの権限が必要かも知れません。 % /usr/local/sbin/ndtpd EBNETD を `/usr/local' 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (`sbindir') の位置を変更していなければ、 `ndtpd' は `/usr/local/sbin' にインストールされています。  File: ebnetd-ja.info, Node: ndtpd Child of inetd, Next: ndtpd Child of xinetd, Prev: ndtpd Standalone, Up: Start ndtpd `ndtpd' を `inetd' 経由で起動 ============================= `ndtpd' を `inetd' の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを `inetd.conf' ファイル (大抵の場合 `/etc/inetd.conf') に加えます。 `--inetd' (または `-i') オプションを足すのを忘れないようにして 下さい。 ndtp stream tcp nowait root /usr/local/sbin/ndtpd ndtpd --inetd (ただし、EBNETD を `/usr/local' 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (`sbindir') の位置を変更していない と仮定しています。) 走行している `inetd' プロセスの PID を探し出します。 BSD 系のシステムでは、次のようにします。 % ps axuww | grep inetd SYSV 系のシステムなら、次のようにします。 % ps -ef | grep inetd (詳しくは、あなたのシステムのマニュアルをご覧下さい。) `inetd' が走っているならば、次のような行が見つかるはずです。 root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd 見つかったならば、ハングアップシグナル (`SIGHUP') を `inetd' に送ります。 おそらく、スーパーユーザの権限が必要です。 % kill -HUP 79  File: ebnetd-ja.info, Node: ndtpd Child of xinetd, Next: ndtpd Test with telnet, Prev: ndtpd Child of inetd, Up: Start ndtpd `ndtpd' を `xinetd' 経由で起動 ============================== Linux システムには、伝統的な `inetd' の代わりに `xinetd' を 使用しているものもあります。 `xinetd' の設定ファイルの文法は、伝統的な `inetd' の設定ファイル の文法とは異なります。 `ndtpd' を `xinetd' の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを設定ファイル (大抵の場合 `/etc/xinetd.d/ndtp') に 加えます。 `--inetd' (または `-i') オプションを足すのを忘れないようにして 下さい。 # default: off # description: The ndtp server service ndtp { disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ndtpd server_args = --inetd log_on_failure += USERID } (ただし、EBNETD を `/usr/local' 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (`sbindir') の位置を変更していな いと仮定しています。) 走行している `xinetd' プロセスの PID を探し出します。 % ps axuww | grep xinetd `xinetd' が走っているならば、次のような行が見つかるはずです。 root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd 見つかったならば、USER2 シグナル (`SIGUSR2') を `xinetd' に送ります。 おそらく、スーパーユーザの権限が必要です。 % kill -USR2 79  File: ebnetd-ja.info, Node: ndtpd Test with telnet, Next: ndtpd Options, Prev: ndtpd Child of xinetd, Up: Start ndtpd `telnet' による `ndtpd' の確認 ============================== セットアップがすべて完了したら、`telnet' コマンドを用いて `ndtpd' に接続してみましょう。 まず、次のように入力します。 この例では、localhost 上の `ndtpd' に接続しています。 % telnet localhost ndtp `ndtpd' が接続を受け付ければ、次のようなメッセージが表示されます。 Connected to localhost. Escape character is '^]'. ここで、 に続けて を入力します。 `ndtpd' が正常に動いていれば、次のように利用可能な CD-ROM 書籍の一覧を出力します。 t 1 Oxford Dictionary/Thesaurus edict/oxford 0 0 0 2 Quick Tour edict/quick 0 0 0 3 User's Guide edict/user 0 0 0 4 About This Disc edict/about 0 0 0 $* 接続を終えるには、 に続けて を入力します。 Q Connection closed by foreign host.  File: ebnetd-ja.info, Node: ndtpd Options, Prev: ndtpd Test with telnet, Up: Start ndtpd `ndtpd' のオプション ==================== `ndtpd' のコマンド行の指定方法は、`ebnetd' と同じです。 詳しくは、*note `ebnetd' のオプション: ebnetd Options. を 参照して下さい。  File: ebnetd-ja.info, Node: Start ebhttpd, Next: Terminate and Restart, Prev: Start ndtpd, Up: Top `ebhttpd' の起動 **************** あなたのシステムでは `ebhttpd' を必要としないなら、この章は 読み飛ばして下さい。 `ebhttpd' も、スタンドアロンのデーモンとして起動するやり方と `inted' の子プロセスとして起動するやり方の、2 つの実行モードを 持っています。 指定がなければ、`ebhttpd' はスタンドアロンのデーモンとして起動します。 * Menu: * ebhttpd Standalone:: `ebhttpd' をスタンドアロンで起動 * ebhttpd Child of inetd:: `ebhttpd' を `inetd' 経由で起動 * ebhttpd Child of xinetd:: `ebhttpd' を `xinetd' 経由で起動 * ebhttpd Test with telnet:: `telnet' による `ebhttpd' の確認 * ebhttpd Options:: `ebhttpd' のオプション  File: ebnetd-ja.info, Node: ebhttpd Standalone, Next: ebhttpd Child of inetd, Prev: Start ebhttpd, Up: Start ebhttpd `ebhttpd' をスタンドアロンで起動 ================================ `ebhttpd' をスタンドアロンのデーモンとして起動するには、次のように コマンドを実行して下さい。スーパーユーザの権限が必要かも知れません。 % /usr/local/sbin/ebhttpd EBNETD を `/usr/local' 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (`sbindir') の位置を変更していなければ、 `ebhttpd' は `/usr/local/sbin' にインストールされています。  File: ebnetd-ja.info, Node: ebhttpd Child of inetd, Next: ebhttpd Child of xinetd, Prev: ebhttpd Standalone, Up: Start ebhttpd `ebhttpd' を `inetd' 経由で起動 =============================== `ebhttpd' を `inetd' の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを `inetd.conf' ファイル (大抵の場合 `/etc/inetd.conf') に加えます。 `--inetd' (または `-i') オプションを足すのを忘れないようにして 下さい。 http stream tcp nowait root /usr/local/sbin/ebhttpd ebhttpd --inetd (ただし、EBNETD を `/usr/local' 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (`sbindir') の位置を変更していない と仮定しています。) 走行している `inetd' プロセスの PID を探し出します。 BSD 系のシステムでは、次のようにします。 % ps axuww | grep inetd SYSV 系のシステムなら、次のようにします。 % ps -ef | grep inetd (詳しくは、あなたのシステムのマニュアルをご覧下さい。) `inetd' が走っているならば、次のような行が見つかるはずです。 root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 inetd 見つかったならば、ハングアップシグナル (`SIGHUP') を `inetd' に送ります。 おそらく、スーパーユーザの権限が必要です。 % kill -HUP 79  File: ebnetd-ja.info, Node: ebhttpd Child of xinetd, Next: ebhttpd Test with telnet, Prev: ebhttpd Child of inetd, Up: Start ebhttpd `ebhttpd' を `xinetd' 経由で起動 ================================ Linux システムには、伝統的な `inetd' の代わりに `xinetd' を 使用しているものもあります。 `xinetd' の設定ファイルの文法は、伝統的な `inetd' の設定ファイル の文法とは異なります。 `ebhttpd' を `xinetd' の子プロセスとして起動には、次の手順が必要 になります。 次のエントリを設定ファイル (大抵の場合 `/etc/xinetd.d/http') に 加えます。 `--inetd' (または `-i') オプションを足すのを忘れないようにして 下さい。 # default: off # description: The http server service http { disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/ebhttpd server_args = --inetd log_on_failure += USERID } (ただし、EBNETD を `/usr/local' 以下にインストールし、かつ、システム 管理用のコマンドを置くディレクトリ (`sbindir') の位置を変更していな いと仮定しています。) 走行している `xinetd' プロセスの PID を探し出します。 % ps axuww | grep xinetd `xinetd' が走っているならば、次のような行が見つかるはずです。 root 79 0.0 1.1 224 340 ?? Is 10:04PM 0:00.29 xinetd 見つかったならば、USER2 シグナル (`SIGUSR2') を `xinetd' に送ります。 おそらく、スーパーユーザの権限が必要です。 % kill -USR2 79  File: ebnetd-ja.info, Node: ebhttpd Test with telnet, Next: ebhttpd Options, Prev: ebhttpd Child of xinetd, Up: Start ebhttpd `telnet' による `ebhttpd' の確認 ================================ セットアップがすべて完了したら、`telnet' コマンドを用いて `ebhttpd' に接続してみましょう。 まず、次のように入力します。 この例では、localhost 上の `ebhttpd' に接続しています。 % telnet localhost http `ebhttpd' が接続を受け付ければ、次のようなメッセージが表示されます。 Connected to localhost. Escape character is '^]'. ここで、次のようにリクエストを入力します。 GET / HTTP/1.0 このリクエストは 2 行からなり、2 行目は空行ですので、注意して下さい。 `ebhttpd' が正常に動いていれば、次のような応答が得られます。 HTTP/1.1 200 Ok Date: Fri, 16 May 2003 13:11:12 GMT Server: ebHTTPD 0.0 Content-Type: text/html; charset="euc-jp" (以下略)  File: ebnetd-ja.info, Node: ebhttpd Options, Prev: ebhttpd Test with telnet, Up: Start ebhttpd `ebhttpd' のオプション ====================== `ebhttpd' のコマンド行の指定方法は、`ebnetd' と同じです。 詳しくは、*note `ebnetd' のオプション: ebnetd Options. を 参照して下さい。  File: ebnetd-ja.info, Node: Terminate and Restart, Next: Daily Works, Prev: Start ebhttpd, Up: Top サーバの終了および再始動 ************************ `ebncontrol' コマンドを用いることで、現在スタンドアロンのデーモン として走っている `ebnetd' プロセスを終了させたり、強制終了、再始動 させたりすることができます。 EBNETD を `/usr/local' 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (`sbindir') の位置を変更していなければ、 `ebncontrol' は `/usr/local/sbin' にインストールされています。 走行中の `ebnetd' を終了させるには次のようにします。 % /usr/local/sbin/ebncontrol terminate `ebnetd' は自身の PID を作業用ディレクトリの下のファイル `ebnetd.pid' に記録します (*note 作業ディレクトリ: Working Directory.)。 `ebncontrol' は、走行中の `ebnetd' プロセスの PID を知るために この PID ファイルの中身を読み、その PID に対してシグナルを送ります。 `ebnetd' が正常に終了すれば、PID ファイルは `ebnetd' 自身に よって削除されます。 しかしながら、`ebnetd' が異常終了したときは、PID ファイルは削除 されません。 この場合、残された PID ファイルに記述された PID は、後で他のプロセスに 割り当てられる可能性があります。 `ebncontrol' の実行は慎重に行って下さい。 `ebncontrol' は、本当に `ebnetd' プロセスが存在するかどうかに ついては、確かめません。 `ebnetd' プロセスが存在しないのに PID ファイルだけ残っていると、 `ebncontrol' は他のプロセスにシグナルを送ってしまうかも知れません。 `ebncontrol' は `ebnetd' の設定ファイルを読み込み、作業用 ディレクトリの位置を調べます。 ディレクトリの位置は、設定ファイル中の単独指示子 `work-path' で定義することができます (*note `work-path': Single Directive List.)。 無指定時の設定ファイルのファイル名、および単独指示子 `work-path' の値は `ebnetd' と同じです。 また、`ndtpd' および `ebhttpd' のために `ndtpcontrol', `ebhtcontrol' がそれぞれ用意されています。 使用方法は、`ebncontrol' と同じです。 * Menu: * Invoke Server Controler:: サーバ制御コマンドの実行 * ebncontrol Options:: サーバ制御コマンドのオプション  File: ebnetd-ja.info, Node: Invoke Server Controler, Next: ebncontrol Options, Prev: Terminate and Restart, Up: Terminate and Restart サーバ制御コマンドの実行 ======================== 前述のように、`ebncontrol', `ndtpcontrol', `ebhtcontrol' は、すべて同じコマンド行引数をとるようになっています。 これらのコマンドの一般的な実行方法は、次の通りです。 % /usr/local/sbin/ebncontrol 副コマンド % /usr/local/sbin/ndtpcontrol 副コマンド % /usr/local/sbin/ebhtcontrol 副コマンド 副コマンドは、以下のものを解釈することができます。 副コマンド名が一意に決まる範囲内で、名前の後方部分を省略することが できます。 `kill' 現在走っているサーバプロセスを強制終了させます (`SIGKILL' シグナル を送ります)。 また、サーバ制御コマンドが、サーバプロセスの PID ファイルを消去します。 この副コマンドを試す前に、まず `terminate' を先に試すべきです。 `restart' 現在走っているサーバプロセスを再始動させます (`SIGHUP' シグナルを送ります)。 サーバプロセスはすべての TCP コネクションを閉じ、設定ファイルを 読み込み直します。 `status' サーバプロセスが走っているかどうか調べ、結果を標準エラー出力に出力します。 この副コマンドは、サーバにシグナルを送ることはしません。 `terminate' 現在走っている サーバプロセスを終了させます (`SIGTERM' シグナルを送ります)。  File: ebnetd-ja.info, Node: ebncontrol Options, Prev: Invoke Server Controler, Up: Terminate and Restart `ebncontrol' のオプション ========================= `ebncontrol', `ndtpcontrol', `ebhtcontrol' コマンドは、 伝統的な一文字オプション名と覚えやすい長いオプション名の両方を扱うこと ができます。 長いオプション名を表すには、`-' ではなく `--' を用います。 オプション名が一意に決まる範囲内で、名前の後方部分を省略することが できます。 `ebncontrol', `ndtpcontrol', `ebhtcontrol' は以下に挙げた オプションを解釈することができます。 `-c ファイル' `--configuration-file ファイル' 設定ファイルを指定します。 無指定時のファイル名は、ヘルプメッセージの中に記されています。 `-h' `--help' ヘルプメッセージを標準出力に出力して、終了します。 `-v' `--version' バージョン番号を標準出力に出力して、終了します。  File: ebnetd-ja.info, Node: Daily Works, Next: Network License, Prev: Terminate and Restart, Up: Top 毎日の管理作業 ************** `ebndaily' コマンドは、`ebnetd', `ndtpd', `ebhttpd' の syslog ファイルのうち、最も新しいものを調べて統計情報を生成し、syslog ファイルのローテーションを行います。 その結果は、コマンド行の引数に指定された管理者に宛てて、メールで 送られます。 EBNETD を `/usr/local' 以下にインストールし、かつ、システム管理用の コマンドを置くディレクトリ (`sbindir') の位置を変更していなければ、 `ebndaily' は `/usr/local/sbin' にインストールされています。 `ebndaily' を実行する一般的な方法は次の通りです。 % /usr/local/sbin/ebndaily メールアドレス... 以下は実行例です。 % /usr/local/sbin/ebndaily root@host.your.domain 2 つ以上のメールアドレスを書くこともできます。 % /usr/local/sbin/ebndaily root@host.your.domain root@dept.your.domain `ebndaily' を毎日一回、自動的に実行するには、以下のようなエントリ をあなたのシステムの `crontab' に加えて下さい。 0 0 * * * /usr/local/sbin/ebndaily root@host.your.domain (詳しくは、あたなのシステムのマニュアルをご覧下さい。) とくに変更の指定がなければ、`ebndaily' は、古くなった syslog ファイルを `compress' コマンドで圧縮し、7 世代分保存します。 現在の syslog ファイルが `/usr/local/var/ebnetd/log/ebnetd.log' だとすると、古くなった syslog ファイルは次のように保存されます。 /usr/local/var/ebnetd/log/ebnetd.log.0.Z /usr/local/var/ebnetd/log/ebnetd.log.1.Z /usr/local/var/ebnetd/log/ebnetd.log.2.Z /usr/local/var/ebnetd/log/ebnetd.log.3.Z /usr/local/var/ebnetd/log/ebnetd.log.4.Z /usr/local/var/ebnetd/log/ebnetd.log.5.Z /usr/local/var/ebnetd/log/ebnetd.log.6.Z これらの syslog は次の要領でローテーションされます。 1. もっとも古い syslog ファイル `ebnetd.log.6.Z' が削除されます。 2. 他の `ebnetd.log.N.Z' ファイルは、 `ebnetd.log.N+1.Z' に改名されます。 3. 現在の syslog ファイル `ebnetd.log' は `ebnetd.log.0' に コピーされます。 4. `ebnetd.log.0' は、`compress' で圧縮され、ファイル名が `ebnetd.log.0.Z' に変わります。 5. 現在の syslog file `ebnetd.log' の内容がクリアされます。 * Menu: * ebndaily Options:: `ebndaily' のオプション  File: ebnetd-ja.info, Node: ebndaily Options, Prev: Daily Works, Up: Daily Works `ebndaily' のオプション ======================= `ebndaily' コマンドは、伝統的な一文字オプション名と覚えやすい長い オプション名の両方を扱うことができます。 長いオプション名を表すには、`-' ではなく `--' を用います。 オプション名が一意に決まる範囲内で、名前の後方部分を省略することが できます。 `ebndaily' コマンドは以下に挙げたオプションを解釈することが できます。 `-a 整数' `--ages 整数' 古い syslog ファイルを 整数 世代分だけ保存します。 無指定時は `7' です。 `-c 圧縮プログラム' `--compressor 圧縮プログラム' 古くなった syslog ファイルを圧縮するプログラムを指定します。 圧縮プログラム は、`compress'、`gzip'、`bzip2'、 `none' のうちのいずれかでなくてはなりません。 無指定時は、`compress' です。 `compress' を指定するか、`--compressor' (`-c') オプション を用いなかった場合は、`compress' コマンドによる圧縮が行われ、 圧縮されたファイルには拡張子 `.Z' が付加されます。 `gzip' を指定した場合は、`gzip' コマンドによる圧縮が行われ、 圧縮されたファイルには拡張子 `.gz' が付加されます。 `bzip2' を指定した場合は、`bzip2' コマンドによる圧縮が行われ、 圧縮されたファイルには拡張子 `.bz2' が付加されます。 `none' を指定した場合は、圧縮は行われず、ファイルの拡張子も 変わりません。 `-l ファイル' `--log-file ファイル' 現在の syslog ファイルを指定します。 EBNETD を `/usr/local' 以下にインストールし、かつ、マシン固有の更新 されうるデータを置くディレクトリ (`localstatedir') および ログファイルが置かれるディレクトリ (`--with-logdir' で指定) を変更 していなければ、無指定時では `/usr/local/var/ebnetd/log/ebnetd.log' になります。 無指定時のファイル名は、ヘルプメッセージの中に記されています。 `-h' `--help' ヘルプメッセージを標準出力に出力して、終了します。 `-v' `--version' バージョン番号を標準出力に出力して、終了します。 `-N' `--fast' `--best' これらのオプションは `gzip', `bzip2' に渡されます (*note Invoking `gzip': (gzip)Invoking gzip.)。 `gzip', `bzip2' を使用しないときは、たんに無視されます。  File: ebnetd-ja.info, Node: Network License, Prev: Daily Works, Up: Top ネットワークライセンス ********************** CD-ROM 書籍の出版社はオプションでネットワークライセンスを用意している ことがあります。 これは、あなたの LAN 上の複数のユーザに対して書籍へのアクセスを許可する ものです。 ネットワークライセンスでは、同時にその書籍へアクセスするユーザの最大数 が制限されることがあります (ライセンスの形態は様々ですので、詳しくは 出版社にお問い合わせ下さい)。 設定ファイル (通常 `ebnetd.conf') には、2 つの `max-clients' というパラメタがあります。 一つは単独指示子で (*note `max-clients': Single Directive List.)、 もう一つは `book' 複合指示子の副指示子です (*note `max-clients': Book Group Directive.)。 どちらもクライアントの最大数を制限します。 これらはネットワークライセンスの順守を補助しますが、完璧なものでは ありません。 たとえば、書籍がアクセスできるのは、ユーザの使用しているクライアントが サーバに接続している間だけにすべきですが、サーバにしてもクライアントに しても、接続状態を頻繁にチェックするわけではありません。 たとえば、サーバはタイムアウトが発生すると、クライアントとの接続を 切ります。 けれども、クライアントは CD-ROM 書籍の中身を表示し続け、ユーザが別の コンテンツの表示を要求するまでこの状態が続くのです。 それでも、ネットワークライセンスのために `max-clients' を設定する ことは良いことです。 重要なのは `max-clients' の能力を過信しないことです。