From 42ad1c0f93cadfe5520fbad8810441cae5d12214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=91=D0=BE=D1=80=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Tue, 15 Aug 2023 14:39:09 +0200 Subject: [PATCH] at work --- Makefile | 187 +++--- Makefile.am | 25 +- Makefile.in | 111 ++-- aclocal.m4 | 63 +- cfparser.c | 31 +- cfparser.h | 2 +- cfparser_test.c | 4 + clparser.c | 20 +- clparser_test.c | 7 +- compile | 6 +- config.guess | 134 ++--- config.h | 6 +- config.status | 363 ++++++------ config.sub | 1505 +++++++++++++++++++++++------------------------ cworker.c | 81 ++- cworker.h | 1 + defines.h | 26 +- defines.h.in | 12 +- logger.c | 41 +- main.c | 8 +- missing | 2 +- test.conf | 3 +- 22 files changed, 1338 insertions(+), 1300 deletions(-) diff --git a/Makefile b/Makefile index 94de9e0..b406bc4 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # Makefile. Generated from Makefile.in by configure. -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -86,8 +86,8 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = amd64-unknown-freebsd12.4 -host_triplet = amd64-unknown-freebsd12.4 +build_triplet = x86_64-pc-linux-gnu +host_triplet = x86_64-pc-linux-gnu sbin_PROGRAMS = cworker$(EXEEXT) noinst_PROGRAMS = $(am__EXEEXT_1) subdir = . @@ -103,39 +103,21 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = defines.h CONFIG_CLEAN_FILES = config.h CONFIG_CLEAN_VPATH_FILES = -am__EXEEXT_1 = cflexer_test$(EXEEXT) cfparser_test$(EXEEXT) \ - cllexer_test$(EXEEXT) clparser_test$(EXEEXT) \ - jlexer_test$(EXEEXT) jparser_test$(EXEEXT) \ - rcache_test$(EXEEXT) +am__EXEEXT_1 = cfparser_test$(EXEEXT) clparser_test$(EXEEXT) am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS) am__objects_1 = cflexer.$(OBJEXT) cfparser.$(OBJEXT) cllexer.$(OBJEXT) \ clparser.$(OBJEXT) jlexer.$(OBJEXT) jparser.$(OBJEXT) \ logger.$(OBJEXT) massert.$(OBJEXT) rcache.$(OBJEXT) -am_cflexer_test_OBJECTS = cflexer_test.$(OBJEXT) $(am__objects_1) -cflexer_test_OBJECTS = $(am_cflexer_test_OBJECTS) -cflexer_test_LDADD = $(LDADD) am_cfparser_test_OBJECTS = cfparser_test.$(OBJEXT) $(am__objects_1) cfparser_test_OBJECTS = $(am_cfparser_test_OBJECTS) cfparser_test_LDADD = $(LDADD) -am_cllexer_test_OBJECTS = cllexer_test.$(OBJEXT) $(am__objects_1) -cllexer_test_OBJECTS = $(am_cllexer_test_OBJECTS) -cllexer_test_LDADD = $(LDADD) am_clparser_test_OBJECTS = clparser_test.$(OBJEXT) $(am__objects_1) clparser_test_OBJECTS = $(am_clparser_test_OBJECTS) clparser_test_LDADD = $(LDADD) am_cworker_OBJECTS = main.$(OBJEXT) cworker.$(OBJEXT) $(am__objects_1) cworker_OBJECTS = $(am_cworker_OBJECTS) cworker_LDADD = $(LDADD) -am_jlexer_test_OBJECTS = jlexer_test.$(OBJEXT) $(am__objects_1) -jlexer_test_OBJECTS = $(am_jlexer_test_OBJECTS) -jlexer_test_LDADD = $(LDADD) -am_jparser_test_OBJECTS = jparser_test.$(OBJEXT) $(am__objects_1) -jparser_test_OBJECTS = $(am_jparser_test_OBJECTS) -jparser_test_LDADD = $(LDADD) -am_rcache_test_OBJECTS = rcache_test.$(OBJEXT) $(am__objects_1) -rcache_test_OBJECTS = $(am_rcache_test_OBJECTS) -rcache_test_LDADD = $(LDADD) AM_V_P = $(am__v_P_$(V)) am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) am__v_P_0 = false @@ -163,21 +145,17 @@ AM_V_CCLD = $(am__v_CCLD_$(V)) am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(cflexer_test_SOURCES) $(cfparser_test_SOURCES) \ - $(cllexer_test_SOURCES) $(clparser_test_SOURCES) \ - $(cworker_SOURCES) $(jlexer_test_SOURCES) \ - $(jparser_test_SOURCES) $(rcache_test_SOURCES) -DIST_SOURCES = $(cflexer_test_SOURCES) $(cfparser_test_SOURCES) \ - $(cllexer_test_SOURCES) $(clparser_test_SOURCES) \ - $(cworker_SOURCES) $(jlexer_test_SOURCES) \ - $(jparser_test_SOURCES) $(rcache_test_SOURCES) +SOURCES = $(cfparser_test_SOURCES) $(clparser_test_SOURCES) \ + $(cworker_SOURCES) +DIST_SOURCES = $(cfparser_test_SOURCES) $(clparser_test_SOURCES) \ + $(cworker_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)defines.h.in +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + defines.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -214,28 +192,31 @@ am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /home/ziggi/Projects/jcomp/missing aclocal +ACLOCAL = ${SHELL} '/dat2/home/ziggi/projects/cworker/missing' aclocal-1.16 AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 1 -APP_CACHEDIR = /home/ziggi/Projects/jcomp/cache -APP_CONFIGDIR = /home/ziggi/Projects/jcomp/ -APP_DATABASEDIR = /home/ziggi/Projects/jcomp/data -APP_LIBDIR = /home/ziggi/Projects/jcomp/lib -APP_LOGDIR = /home/ziggi/Projects/jcomp/log -APP_RUNDIR = /home/ziggi/Projects/jcomp/run -APP_USER = ziggi -AUTOCONF = ${SHELL} /home/ziggi/Projects/jcomp/missing autoconf -AUTOHEADER = ${SHELL} /home/ziggi/Projects/jcomp/missing autoheader -AUTOMAKE = ${SHELL} /home/ziggi/Projects/jcomp/missing automake +APP_CACHEDIR = /dat2/home/ziggi/projects/cworker/cache +APP_CONFIGDIR = /dat2/home/ziggi/projects/cworker/ +APP_DATABASEDIR = /dat2/home/ziggi/projects/cworker/data +APP_LIBDIR = /dat2/home/ziggi/projects/cworker/lib +APP_LOGDIR = /dat2/home/ziggi/projects/cworker/log +APP_RUNDIR = /dat2/home/ziggi/projects/cworker/run +APP_USER = root +AUTOCONF = ${SHELL} '/dat2/home/ziggi/projects/cworker/missing' autoconf +AUTOHEADER = ${SHELL} '/dat2/home/ziggi/projects/cworker/missing' autoheader +AUTOMAKE = ${SHELL} '/dat2/home/ziggi/projects/cworker/missing' automake-1.16 AWK = gawk CC = clang CCDEPMODE = depmode=none CFLAGS = -g -O2 -CP = /usr/local/bin/gcp +CP = +CPP = clang -E CPPFLAGS = CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H @@ -243,9 +224,11 @@ DEPDIR = .deps ECHO_C = ECHO_N = -n ECHO_T = +EGREP = /bin/grep -E EXEEXT = +GREP = /bin/grep HAVE_CP = true -INSTALL = /usr/bin/install -c +INSTALL = /bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} @@ -254,8 +237,8 @@ LDFLAGS = LIBOBJS = LIBS = LTLIBOBJS = -MAKEINFO = ${SHELL} /home/ziggi/Projects/jcomp/missing makeinfo -MKDIR_P = /usr/local/bin/gmkdir -p +MAKEINFO = ${SHELL} '/dat2/home/ziggi/projects/cworker/missing' makeinfo +MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = cworker PACKAGE_BUGREPORT = @@ -268,47 +251,47 @@ PATH_SEPARATOR = : SET_MAKE = SHELL = /bin/sh STRIP = -VALGRIND = /usr/local/bin/valgrind +VALGRIND = /bin/valgrind VERSION = 0.0.1 -abs_builddir = /home/ziggi/Projects/jcomp -abs_srcdir = /home/ziggi/Projects/jcomp -abs_top_builddir = /home/ziggi/Projects/jcomp -abs_top_srcdir = /home/ziggi/Projects/jcomp +abs_builddir = /dat2/home/ziggi/projects/cworker +abs_srcdir = /dat2/home/ziggi/projects/cworker +abs_top_builddir = /dat2/home/ziggi/projects/cworker +abs_top_srcdir = /dat2/home/ziggi/projects/cworker ac_ct_CC = clang am__include = include am__leading_dot = . am__quote = am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - -app_cachedir = /home/ziggi/Projects/jcomp/cache -app_configdir = /home/ziggi/Projects/jcomp/ -app_databasedir = /home/ziggi/Projects/jcomp/data -app_libdir = /home/ziggi/Projects/jcomp/lib -app_logdir = /home/ziggi/Projects/jcomp/log +app_cachedir = /dat2/home/ziggi/projects/cworker/cache +app_configdir = /dat2/home/ziggi/projects/cworker/ +app_databasedir = /dat2/home/ziggi/projects/cworker/data +app_libdir = /dat2/home/ziggi/projects/cworker/lib +app_logdir = /dat2/home/ziggi/projects/cworker/log app_name = cworker -app_rundir = /home/ziggi/Projects/jcomp/run -app_user = ziggi +app_rundir = /dat2/home/ziggi/projects/cworker/run +app_user = root bindir = ${exec_prefix}/bin -build = amd64-unknown-freebsd12.4 +build = x86_64-pc-linux-gnu build_alias = -build_cpu = amd64 -build_os = freebsd12.4 -build_vendor = unknown +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = pc builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} -host = amd64-unknown-freebsd12.4 +host = x86_64-pc-linux-gnu host_alias = -host_cpu = amd64 -host_os = freebsd12.4 -host_vendor = unknown +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = pc htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/ziggi/Projects/jcomp/install-sh +install_sh = ${SHELL} /dat2/home/ziggi/projects/cworker/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale @@ -356,13 +339,8 @@ common_SOURCES = \ #VALGRIND_OPT = --tool=memcheck bin_TESTS = \ - cflexer_test \ cfparser_test \ - cllexer_test \ - clparser_test \ - jlexer_test \ - jparser_test \ - rcache_test + clparser_test #TESTS = $(bin_TESTS) cflexer_test_SOURCES = cflexer_test.c $(common_SOURCES) @@ -473,18 +451,10 @@ uninstall-sbinPROGRAMS: clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) -cflexer_test$(EXEEXT): $(cflexer_test_OBJECTS) $(cflexer_test_DEPENDENCIES) $(EXTRA_cflexer_test_DEPENDENCIES) - @rm -f cflexer_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(cflexer_test_OBJECTS) $(cflexer_test_LDADD) $(LIBS) - cfparser_test$(EXEEXT): $(cfparser_test_OBJECTS) $(cfparser_test_DEPENDENCIES) $(EXTRA_cfparser_test_DEPENDENCIES) @rm -f cfparser_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cfparser_test_OBJECTS) $(cfparser_test_LDADD) $(LIBS) -cllexer_test$(EXEEXT): $(cllexer_test_OBJECTS) $(cllexer_test_DEPENDENCIES) $(EXTRA_cllexer_test_DEPENDENCIES) - @rm -f cllexer_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(cllexer_test_OBJECTS) $(cllexer_test_LDADD) $(LIBS) - clparser_test$(EXEEXT): $(clparser_test_OBJECTS) $(clparser_test_DEPENDENCIES) $(EXTRA_clparser_test_DEPENDENCIES) @rm -f clparser_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(clparser_test_OBJECTS) $(clparser_test_LDADD) $(LIBS) @@ -493,18 +463,6 @@ cworker$(EXEEXT): $(cworker_OBJECTS) $(cworker_DEPENDENCIES) $(EXTRA_cworker_DEP @rm -f cworker$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cworker_OBJECTS) $(cworker_LDADD) $(LIBS) -jlexer_test$(EXEEXT): $(jlexer_test_OBJECTS) $(jlexer_test_DEPENDENCIES) $(EXTRA_jlexer_test_DEPENDENCIES) - @rm -f jlexer_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(jlexer_test_OBJECTS) $(jlexer_test_LDADD) $(LIBS) - -jparser_test$(EXEEXT): $(jparser_test_OBJECTS) $(jparser_test_DEPENDENCIES) $(EXTRA_jparser_test_DEPENDENCIES) - @rm -f jparser_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(jparser_test_OBJECTS) $(jparser_test_LDADD) $(LIBS) - -rcache_test$(EXEEXT): $(rcache_test_OBJECTS) $(rcache_test_DEPENDENCIES) $(EXTRA_rcache_test_DEPENDENCIES) - @rm -f rcache_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(rcache_test_OBJECTS) $(rcache_test_LDADD) $(LIBS) - mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -631,6 +589,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -673,6 +635,8 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -688,7 +652,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -853,18 +817,18 @@ uninstall-am: uninstall-sbinPROGRAMS clean-cscope clean-generic clean-local clean-noinstPROGRAMS \ clean-sbinPROGRAMS cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-sbinPROGRAMS install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-sbinPROGRAMS + dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS .PRECIOUS: Makefile @@ -876,6 +840,13 @@ run: $(sbin_PROGRAMS) ./cworker --port=9002 test: $(bin_TESTS) + @for test in $(bin_TESTS); do \ + echo ======= Test $${test} ======; \ + ./$${test}; \ + echo ====== Done $${test} ======; \ + done + +valgrind: $(bin_TESTS) @for test in $(bin_TESTS); do \ echo ======= Test $${test} ======; \ $(VALGRIND) $(VALGRIND_OPT) ./$${test}; \ diff --git a/Makefile.am b/Makefile.am index 62b5416..72ccc2a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,6 +42,14 @@ VALGRIND_OPT = --tool=memcheck endif test: $(bin_TESTS) + @for test in $(bin_TESTS); do \ + echo ======= Test $${test} ======; \ + ./$${test}; \ + echo ====== Done $${test} ======; \ + done + + +valgrind: $(bin_TESTS) @for test in $(bin_TESTS); do \ echo ======= Test $${test} ======; \ $(VALGRIND) $(VALGRIND_OPT) ./$${test}; \ @@ -49,13 +57,18 @@ test: $(bin_TESTS) done bin_TESTS = \ - cflexer_test \ cfparser_test \ - cllexer_test \ - clparser_test \ - jlexer_test \ - jparser_test \ - rcache_test + clparser_test + + + +# cflexer_test \ +# cfparser_test \ +# cllexer_test \ +# clparser_test \ +# jlexer_test \ +# jparser_test \ +# rcache_test noinst_PROGRAMS = $(bin_TESTS) #TESTS = $(bin_TESTS) diff --git a/Makefile.in b/Makefile.in index e1073f9..17a5637 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -103,39 +103,21 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = defines.h CONFIG_CLEAN_FILES = config.h CONFIG_CLEAN_VPATH_FILES = -am__EXEEXT_1 = cflexer_test$(EXEEXT) cfparser_test$(EXEEXT) \ - cllexer_test$(EXEEXT) clparser_test$(EXEEXT) \ - jlexer_test$(EXEEXT) jparser_test$(EXEEXT) \ - rcache_test$(EXEEXT) +am__EXEEXT_1 = cfparser_test$(EXEEXT) clparser_test$(EXEEXT) am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS) am__objects_1 = cflexer.$(OBJEXT) cfparser.$(OBJEXT) cllexer.$(OBJEXT) \ clparser.$(OBJEXT) jlexer.$(OBJEXT) jparser.$(OBJEXT) \ logger.$(OBJEXT) massert.$(OBJEXT) rcache.$(OBJEXT) -am_cflexer_test_OBJECTS = cflexer_test.$(OBJEXT) $(am__objects_1) -cflexer_test_OBJECTS = $(am_cflexer_test_OBJECTS) -cflexer_test_LDADD = $(LDADD) am_cfparser_test_OBJECTS = cfparser_test.$(OBJEXT) $(am__objects_1) cfparser_test_OBJECTS = $(am_cfparser_test_OBJECTS) cfparser_test_LDADD = $(LDADD) -am_cllexer_test_OBJECTS = cllexer_test.$(OBJEXT) $(am__objects_1) -cllexer_test_OBJECTS = $(am_cllexer_test_OBJECTS) -cllexer_test_LDADD = $(LDADD) am_clparser_test_OBJECTS = clparser_test.$(OBJEXT) $(am__objects_1) clparser_test_OBJECTS = $(am_clparser_test_OBJECTS) clparser_test_LDADD = $(LDADD) am_cworker_OBJECTS = main.$(OBJEXT) cworker.$(OBJEXT) $(am__objects_1) cworker_OBJECTS = $(am_cworker_OBJECTS) cworker_LDADD = $(LDADD) -am_jlexer_test_OBJECTS = jlexer_test.$(OBJEXT) $(am__objects_1) -jlexer_test_OBJECTS = $(am_jlexer_test_OBJECTS) -jlexer_test_LDADD = $(LDADD) -am_jparser_test_OBJECTS = jparser_test.$(OBJEXT) $(am__objects_1) -jparser_test_OBJECTS = $(am_jparser_test_OBJECTS) -jparser_test_LDADD = $(LDADD) -am_rcache_test_OBJECTS = rcache_test.$(OBJEXT) $(am__objects_1) -rcache_test_OBJECTS = $(am_rcache_test_OBJECTS) -rcache_test_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -163,21 +145,17 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(cflexer_test_SOURCES) $(cfparser_test_SOURCES) \ - $(cllexer_test_SOURCES) $(clparser_test_SOURCES) \ - $(cworker_SOURCES) $(jlexer_test_SOURCES) \ - $(jparser_test_SOURCES) $(rcache_test_SOURCES) -DIST_SOURCES = $(cflexer_test_SOURCES) $(cfparser_test_SOURCES) \ - $(cllexer_test_SOURCES) $(clparser_test_SOURCES) \ - $(cworker_SOURCES) $(jlexer_test_SOURCES) \ - $(jparser_test_SOURCES) $(rcache_test_SOURCES) +SOURCES = $(cfparser_test_SOURCES) $(clparser_test_SOURCES) \ + $(cworker_SOURCES) +DIST_SOURCES = $(cfparser_test_SOURCES) $(clparser_test_SOURCES) \ + $(cworker_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)defines.h.in +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + defines.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -214,6 +192,8 @@ am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -236,6 +216,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -243,7 +224,9 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_CP = @HAVE_CP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -356,13 +339,8 @@ common_SOURCES = \ @HAVE_VALGRIND_TRUE@VALGRIND_OPT = --tool=memcheck bin_TESTS = \ - cflexer_test \ cfparser_test \ - cllexer_test \ - clparser_test \ - jlexer_test \ - jparser_test \ - rcache_test + clparser_test #TESTS = $(bin_TESTS) cflexer_test_SOURCES = cflexer_test.c $(common_SOURCES) @@ -473,18 +451,10 @@ uninstall-sbinPROGRAMS: clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) -cflexer_test$(EXEEXT): $(cflexer_test_OBJECTS) $(cflexer_test_DEPENDENCIES) $(EXTRA_cflexer_test_DEPENDENCIES) - @rm -f cflexer_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(cflexer_test_OBJECTS) $(cflexer_test_LDADD) $(LIBS) - cfparser_test$(EXEEXT): $(cfparser_test_OBJECTS) $(cfparser_test_DEPENDENCIES) $(EXTRA_cfparser_test_DEPENDENCIES) @rm -f cfparser_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cfparser_test_OBJECTS) $(cfparser_test_LDADD) $(LIBS) -cllexer_test$(EXEEXT): $(cllexer_test_OBJECTS) $(cllexer_test_DEPENDENCIES) $(EXTRA_cllexer_test_DEPENDENCIES) - @rm -f cllexer_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(cllexer_test_OBJECTS) $(cllexer_test_LDADD) $(LIBS) - clparser_test$(EXEEXT): $(clparser_test_OBJECTS) $(clparser_test_DEPENDENCIES) $(EXTRA_clparser_test_DEPENDENCIES) @rm -f clparser_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(clparser_test_OBJECTS) $(clparser_test_LDADD) $(LIBS) @@ -493,18 +463,6 @@ cworker$(EXEEXT): $(cworker_OBJECTS) $(cworker_DEPENDENCIES) $(EXTRA_cworker_DEP @rm -f cworker$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cworker_OBJECTS) $(cworker_LDADD) $(LIBS) -jlexer_test$(EXEEXT): $(jlexer_test_OBJECTS) $(jlexer_test_DEPENDENCIES) $(EXTRA_jlexer_test_DEPENDENCIES) - @rm -f jlexer_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(jlexer_test_OBJECTS) $(jlexer_test_LDADD) $(LIBS) - -jparser_test$(EXEEXT): $(jparser_test_OBJECTS) $(jparser_test_DEPENDENCIES) $(EXTRA_jparser_test_DEPENDENCIES) - @rm -f jparser_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(jparser_test_OBJECTS) $(jparser_test_LDADD) $(LIBS) - -rcache_test$(EXEEXT): $(rcache_test_OBJECTS) $(rcache_test_DEPENDENCIES) $(EXTRA_rcache_test_DEPENDENCIES) - @rm -f rcache_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(rcache_test_OBJECTS) $(rcache_test_LDADD) $(LIBS) - mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -631,6 +589,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -673,6 +635,8 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -688,7 +652,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -853,18 +817,18 @@ uninstall-am: uninstall-sbinPROGRAMS clean-cscope clean-generic clean-local clean-noinstPROGRAMS \ clean-sbinPROGRAMS cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-sbinPROGRAMS install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-sbinPROGRAMS + dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS .PRECIOUS: Makefile @@ -876,6 +840,13 @@ run: $(sbin_PROGRAMS) ./cworker --port=9002 test: $(bin_TESTS) + @for test in $(bin_TESTS); do \ + echo ======= Test $${test} ======; \ + ./$${test}; \ + echo ====== Done $${test} ======; \ + done + +valgrind: $(bin_TESTS) @for test in $(bin_TESTS); do \ echo ======= Test $${test} ======; \ $(VALGRIND) $(VALGRIND_OPT) ./$${test}; \ diff --git a/aclocal.m4 b/aclocal.m4 index 68152a7..6715ee0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.3 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], +m4_if([$1], [1.16.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl +[AM_AUTOMAKE_VERSION([1.16.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -371,7 +371,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi @@ -398,7 +400,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -475,9 +477,9 @@ _AM_IF_OPTION([no-define],, # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal]) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl @@ -595,7 +597,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -616,7 +618,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -637,7 +639,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -680,7 +682,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -701,12 +703,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -719,7 +716,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -748,7 +745,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -795,7 +792,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -814,7 +811,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -895,7 +892,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -955,7 +952,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -983,7 +980,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# Copyright (C) 2006-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1002,7 +999,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# Copyright (C) 2004-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/cfparser.c b/cfparser.c index 8cb7fda..26b54d4 100644 --- a/cfparser.c +++ b/cfparser.c @@ -6,9 +6,11 @@ #include #include #include - +#include #include +#include + #define INIT_BSIZE 64 @@ -55,22 +57,43 @@ void cfparser_init(cfparser_t * parser, cflexer_t * lexer) { parser->kvalsize = 0; } -void cfparser_bind(cfparser_t * parser, int type, char* key, void* ref) { +int cfparser_bind(cfparser_t * parser, int type, char* key, void* ref) { for (int i = 0; i < parser->kvalsize; i++) { if (strcmp(key, parser->kvalarr[i].key) == 0) { + char* key = parser->kvalarr[i].key; + char* val = parser->kvalarr[i].val; switch (type) { case CFVALTYPE_STR: { - *(char**)(ref) = strcopy(parser->kvalarr[i].val); + *(char**)(ref) = strcopy(val); break; } case CFVALTYPE_INT: { + for (size_t i = 0; i < strlen(val); i++) { + if (isdigit(val[i]) == 0 && val[i] != '-' ) { + log_error("wrong integer value: %s = %s", key, val); + return -1; + } + } char* eptr = NULL; - *(int64_t*)(ref) = (int64_t)strtol(parser->kvalarr[i].val, &eptr, 10); + *(int64_t*)(ref) = (int64_t)strtol(val, &eptr, 10); + break; + } + case CFVALTYPE_BOOL:{ + *(bool*)(ref) = false; + if (strcmp(val, "true") == 0) { + *(bool*)(ref) = true; + } else if (strcmp(val, "false") == 0) { + *(bool*)(ref) = false; + } else { + log_error("wrong boolean key value: %s = %s", key, val); + } break; } + } } } + return 0; } #define MAX_TOKEN_SIZE 1024 diff --git a/cfparser.h b/cfparser.h index 5efef6e..fa38aaa 100644 --- a/cfparser.h +++ b/cfparser.h @@ -24,7 +24,7 @@ typedef struct { void cfparser_init(cfparser_t* parser, cflexer_t* lexer); int cfparser_parse(cfparser_t* parser); -void cfparser_bind(cfparser_t* parser, int type, char* key, void* ref); +int cfparser_bind(cfparser_t* parser, int type, char* key, void* ref); void cfparser_destroy(cfparser_t * parser); #endif diff --git a/cfparser_test.c b/cfparser_test.c index e3d2cab..166cb22 100644 --- a/cfparser_test.c +++ b/cfparser_test.c @@ -35,7 +35,9 @@ int main(void) { int64_t id = 0; char* name = ""; + bool debug = false; + cfparser_bind(&parser, CFVALTYPE_BOOL, "debug", (void *)&debug); cfparser_bind(&parser, CFVALTYPE_INT, "id", (void *)&id); cfparser_bind(&parser, CFVALTYPE_STR, "name", (void *)&name); @@ -45,9 +47,11 @@ int main(void) { MASSERT(id == -123); MASSERT(strcmp(name, "qwerty\"567") == 0); + MASSERT(debug == true); printf("id = %ld\n", id); printf("name = %s\n", name); + printf("debug = %d\n", debug); return 0; } diff --git a/clparser.c b/clparser.c index 45f5d51..434c2b0 100644 --- a/clparser.c +++ b/clparser.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -155,15 +156,21 @@ int clparser_parse(clparser_t * parser, char** argv, int argc) { for (int i = 0; i < parser->bindsize; i++) { if (strcmp(parser->bindarr[i].key, key) == 0) { switch (parser->bindarr[i].type) { - case CLVALTYPE_INT:{ - char* eptr = NULL; - *(int *)(parser->bindarr[i].ref) = (int)strtol(val, &eptr, 10); + case CLVALTYPE_STR:{ + *(char **)(parser->bindarr[i].ref) = strcopy(val); free(key); free(val); break; } - case CLVALTYPE_STR:{ - *(char **)(parser->bindarr[i].ref) = strcopy(val); + case CLVALTYPE_INT:{ + for (size_t i = 0; i < strlen(val); i++) { + if (isdigit(val[i]) == 0 && val[i] != '-' ) { + log_error("wrong integer value: %s = %s", key, val); + //return -1; + } + } + char* eptr = NULL; + *(int *)(parser->bindarr[i].ref) = (int)strtol(val, &eptr, 10); free(key); free(val); break; @@ -175,7 +182,8 @@ int clparser_parse(clparser_t * parser, char** argv, int argc) { } else if (strcmp(val, "false") == 0) { *(bool*)(parser->bindarr[i].ref) = false; } else { - log_error("wrong boolean key value: %s = %s", key, val); + log_error("wrong boolean value: %s = %s", key, val); + //return -1; } free(key); free(val); diff --git a/clparser_test.c b/clparser_test.c index acba7aa..dc7f652 100644 --- a/clparser_test.c +++ b/clparser_test.c @@ -16,8 +16,8 @@ int main(void) { //(void)argc; //(void)argv; - char* argv[] = { "main", "--id=-123", "--name=qwerty12234" }; - int argc = 3; + char* argv[] = { "main", "--id=-123", "--name=qwerty12234", "--debug=truew" }; + int argc = 4; cllexer_t lexer; clparser_t parser; @@ -27,9 +27,11 @@ int main(void) { int id = 0; char* name = ""; + bool debug = false; clparser_bind(&parser, CLVALTYPE_INT, "id", (void *)&id); clparser_bind(&parser, CLVALTYPE_STR, "name", (void *)&name); + clparser_bind(&parser, CLVALTYPE_BOOL, "debug", (void *)&debug); if (clparser_parse(&parser, &argv[1], argc - 1) < 0) { printf("parse args error\n"); @@ -37,6 +39,7 @@ int main(void) { } printf("id = %d\n", id); printf("name = %s\n", name); + printf("debug = %d\n", debug); clparser_destroy(&parser); cllexer_destroy(&lexer); diff --git a/compile b/compile index 99e5052..23fcba0 100755 --- a/compile +++ b/compile @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff --git a/config.guess b/config.guess index b1f709e..f50dcdb 100755 --- a/config.guess +++ b/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2018-08-29' +timestamp='2018-02-24' # 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 @@ -84,6 +84,8 @@ if test $# != 0; then 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 @@ -94,39 +96,34 @@ fi # Portable tmp directory creation inspired by the Autoconf team. -tmp= -# shellcheck disable=SC2172 -trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 -trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 - -set_cc_for_build() { - : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } - dummy=$tmp/dummy - case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in - ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do - if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" - 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 -} +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 "$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 ; set_cc_for_build= ;' # 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 ; then +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi @@ -141,7 +138,7 @@ Linux|GNU|GNU/*) # We could probably try harder. LIBC=gnu - set_cc_for_build + eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) @@ -202,7 +199,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - set_cc_for_build + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -240,7 +237,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" + echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -392,15 +389,20 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - case `isainfo -b` in - 32) - echo i386-pc-solaris2"$UNAME_REL" - ;; - 64) - echo x86_64-pc-solaris2"$UNAME_REL" - ;; - esac + eval "$set_cc_for_build" + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -480,7 +482,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - set_cc_for_build + eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ @@ -577,7 +579,7 @@ EOF exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - set_cc_for_build + eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include @@ -658,7 +660,7 @@ EOF esac fi if [ "$HP_ARCH" = "" ]; then - set_cc_for_build + eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE @@ -698,7 +700,7 @@ EOF esac if [ "$HP_ARCH" = hppa2.0w ] then - set_cc_for_build + eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -724,7 +726,7 @@ EOF echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - set_cc_for_build + eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include int @@ -838,19 +840,14 @@ EOF *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; - arm:FreeBSD:*:*) - UNAME_PROCESSOR=`uname -p` - set_cc_for_build - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi - else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf - fi - exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` + case "$UNAME_PROCESSOR" in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) @@ -897,8 +894,8 @@ EOF # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; - *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix + i*86:Minix:*:*) + echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" @@ -925,7 +922,7 @@ EOF echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - set_cc_for_build + eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then @@ -974,7 +971,7 @@ EOF echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - set_cc_for_build + eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} @@ -1049,7 +1046,11 @@ EOF echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + if objdump -f /bin/sh | grep -q elf32-x86-64; then + echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 + else + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + fi exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" @@ -1288,7 +1289,7 @@ EOF exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - set_cc_for_build + eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi @@ -1361,7 +1362,6 @@ EOF # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - # shellcheck disable=SC2154 if test "$cputype" = 386; then UNAME_MACHINE=i386 else @@ -1473,7 +1473,7 @@ EOF exit 1 # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/config.h b/config.h index 4a4f9a1..fc5837a 100644 --- a/config.h +++ b/config.h @@ -2,8 +2,8 @@ #ifndef CONFIG_H_QWER #define CONFIG_H_QWER -static const char *srv_runpath = "/home/ziggi/Projects/jcomp/run/cworker.pid"; -static const char *srv_logpath = "/home/ziggi/Projects/jcomp/log/cworker.log"; -static const char *srv_configpath = "/home/ziggi/Projects/jcomp//cworker.conf"; +static const char *srv_runpath = "/dat2/home/ziggi/projects/cworker/run/cworker.pid"; +static const char *srv_logpath = "/dat2/home/ziggi/projects/cworker/log/cworker.log"; +static const char *srv_configpath = "/dat2/home/ziggi/projects/cworker//cworker.conf"; #endif diff --git a/config.status b/config.status index 4e767de..7de138e 100755 --- a/config.status +++ b/config.status @@ -16,16 +16,14 @@ export SHELL # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop +else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -35,46 +33,46 @@ esac fi - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi # The user is always right. -if ${PATH_SEPARATOR+false} :; then +if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -83,6 +81,13 @@ if ${PATH_SEPARATOR+false} :; then fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -91,12 +96,8 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS @@ -108,10 +109,30 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -124,14 +145,13 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + $as_echo "$as_me:${as_lineno-5844}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -158,20 +178,18 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset - # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' -else $as_nop +else as_fn_append () { eval $1=\$$1\$2 @@ -183,13 +201,12 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else $as_nop +else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -220,7 +237,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -242,10 +259,6 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -259,12 +272,6 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -306,7 +313,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -315,7 +322,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -374,7 +381,7 @@ exec 6>&1 # values after options handling. ac_log=" This file was extended by cworker $as_me 0.0.1, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -420,20 +427,20 @@ $config_commands Report bugs to the package provider." -ac_cs_config='--enable-devel-mode' +ac_cs_config="'--enable-devel-mode'" ac_cs_version="\ cworker config.status 0.0.1 -configured by ./configure, generated by GNU Autoconf 2.71, +configured by ./configure, generated by GNU Autoconf 2.69, with options \"$ac_cs_config\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -ac_pwd='/home/ziggi/Projects/jcomp' +ac_pwd='/dat2/home/ziggi/projects/cworker' srcdir='.' -INSTALL='/usr/bin/install -c' -MKDIR_P='/usr/local/bin/gmkdir -p' +INSTALL='/bin/install -c' +MKDIR_P='/bin/mkdir -p' AWK='gawk' test -n "$AWK" || AWK=awk # The default lists apply if the user does not specify any file. @@ -463,15 +470,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$ac_cs_config"; exit ;; + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -479,7 +486,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -488,7 +495,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - printf "%s\n" "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -514,7 +521,7 @@ fi if $ac_cs_recheck; then set X /bin/sh './configure' '--enable-devel-mode' $ac_configure_extra_args --no-create --no-recursion shift - \printf "%s\n" "running CONFIG_SHELL=/bin/sh $*" >&6 + $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6 CONFIG_SHELL='/bin/sh' export CONFIG_SHELL exec "$@" @@ -526,7 +533,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - printf "%s\n" "$ac_log" + $as_echo "$ac_log" } >&5 # @@ -544,7 +551,7 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "config.h") CONFIG_FILES="$CONFIG_FILES config.h" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "6283" 5;; esac done @@ -554,9 +561,9 @@ done # 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+y} || CONFIG_FILES=$config_files - test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers - test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -583,7 +590,7 @@ $debug || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "6322" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. @@ -612,40 +619,43 @@ S["am__EXEEXT_FALSE"]="" S["am__EXEEXT_TRUE"]="#" S["LTLIBOBJS"]="" S["app_name"]="cworker" -S["app_cachedir"]="/home/ziggi/Projects/jcomp/cache" -S["APP_CACHEDIR"]="/home/ziggi/Projects/jcomp/cache" -S["app_databasedir"]="/home/ziggi/Projects/jcomp/data" -S["APP_DATABASEDIR"]="/home/ziggi/Projects/jcomp/data" -S["app_user"]="ziggi" -S["APP_USER"]="ziggi" -S["app_libdir"]="/home/ziggi/Projects/jcomp/lib" -S["APP_LIBDIR"]="/home/ziggi/Projects/jcomp/lib" -S["app_rundir"]="/home/ziggi/Projects/jcomp/run" -S["APP_RUNDIR"]="/home/ziggi/Projects/jcomp/run" -S["app_logdir"]="/home/ziggi/Projects/jcomp/log" -S["APP_LOGDIR"]="/home/ziggi/Projects/jcomp/log" -S["app_configdir"]="/home/ziggi/Projects/jcomp/" -S["APP_CONFIGDIR"]="/home/ziggi/Projects/jcomp/" -S["SYSTEMD_FALSE"]="" -S["SYSTEMD_TRUE"]="#" -S["LINUX_OS_FALSE"]="" -S["LINUX_OS_TRUE"]="#" -S["FREEBSD_OS_FALSE"]="#" -S["FREEBSD_OS_TRUE"]="" -S["CP"]="/usr/local/bin/gcp" +S["app_cachedir"]="/dat2/home/ziggi/projects/cworker/cache" +S["APP_CACHEDIR"]="/dat2/home/ziggi/projects/cworker/cache" +S["app_databasedir"]="/dat2/home/ziggi/projects/cworker/data" +S["APP_DATABASEDIR"]="/dat2/home/ziggi/projects/cworker/data" +S["app_user"]="root" +S["APP_USER"]="root" +S["app_libdir"]="/dat2/home/ziggi/projects/cworker/lib" +S["APP_LIBDIR"]="/dat2/home/ziggi/projects/cworker/lib" +S["app_rundir"]="/dat2/home/ziggi/projects/cworker/run" +S["APP_RUNDIR"]="/dat2/home/ziggi/projects/cworker/run" +S["app_logdir"]="/dat2/home/ziggi/projects/cworker/log" +S["APP_LOGDIR"]="/dat2/home/ziggi/projects/cworker/log" +S["app_configdir"]="/dat2/home/ziggi/projects/cworker/" +S["APP_CONFIGDIR"]="/dat2/home/ziggi/projects/cworker/" +S["SYSTEMD_FALSE"]="#" +S["SYSTEMD_TRUE"]="" +S["LINUX_OS_FALSE"]="#" +S["LINUX_OS_TRUE"]="" +S["FREEBSD_OS_FALSE"]="" +S["FREEBSD_OS_TRUE"]="#" +S["host_os"]="linux-gnu" +S["host_vendor"]="pc" +S["host_cpu"]="x86_64" +S["host"]="x86_64-pc-linux-gnu" +S["build_os"]="linux-gnu" +S["build_vendor"]="pc" +S["build_cpu"]="x86_64" +S["build"]="x86_64-pc-linux-gnu" +S["CP"]="" S["HAVE_CP"]="true" S["LIBOBJS"]="" -S["host_os"]="freebsd12.4" -S["host_vendor"]="unknown" -S["host_cpu"]="amd64" -S["host"]="amd64-unknown-freebsd12.4" -S["build_os"]="freebsd12.4" -S["build_vendor"]="unknown" -S["build_cpu"]="amd64" -S["build"]="amd64-unknown-freebsd12.4" S["HAVE_VALGRIND_FALSE"]="" S["HAVE_VALGRIND_TRUE"]="#" -S["VALGRIND"]="/usr/local/bin/valgrind" +S["VALGRIND"]="/bin/valgrind" +S["EGREP"]="/bin/grep -E" +S["GREP"]="/bin/grep" +S["CPP"]="clang -E" S["am__fastdepCC_FALSE"]="" S["am__fastdepCC_TRUE"]="#" S["CCDEPMODE"]="depmode=none" @@ -673,15 +683,15 @@ S["am__leading_dot"]="." S["SET_MAKE"]="" S["AWK"]="gawk" S["mkdir_p"]="$(MKDIR_P)" -S["MKDIR_P"]="/usr/local/bin/gmkdir -p" +S["MKDIR_P"]="/bin/mkdir -p" S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" S["STRIP"]="" -S["install_sh"]="${SHELL} /home/ziggi/Projects/jcomp/install-sh" -S["MAKEINFO"]="${SHELL} /home/ziggi/Projects/jcomp/missing makeinfo" -S["AUTOHEADER"]="${SHELL} /home/ziggi/Projects/jcomp/missing autoheader" -S["AUTOMAKE"]="${SHELL} /home/ziggi/Projects/jcomp/missing automake" -S["AUTOCONF"]="${SHELL} /home/ziggi/Projects/jcomp/missing autoconf" -S["ACLOCAL"]="${SHELL} /home/ziggi/Projects/jcomp/missing aclocal" +S["install_sh"]="${SHELL} /dat2/home/ziggi/projects/cworker/install-sh" +S["MAKEINFO"]="${SHELL} '/dat2/home/ziggi/projects/cworker/missing' makeinfo" +S["AUTOHEADER"]="${SHELL} '/dat2/home/ziggi/projects/cworker/missing' autoheader" +S["AUTOMAKE"]="${SHELL} '/dat2/home/ziggi/projects/cworker/missing' automake-1.16" +S["AUTOCONF"]="${SHELL} '/dat2/home/ziggi/projects/cworker/missing' autoconf" +S["ACLOCAL"]="${SHELL} '/dat2/home/ziggi/projects/cworker/missing' aclocal-1.16" S["VERSION"]="0.0.1" S["PACKAGE"]="cworker" S["CYGPATH_W"]="echo" @@ -761,7 +771,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 + || as_fn_error $? "could not setup config files machinery" "6454" 5 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. @@ -778,16 +788,16 @@ D["PACKAGE_BUGREPORT"]=" \"\"" D["PACKAGE_URL"]=" \"\"" D["PACKAGE"]=" \"cworker\"" D["VERSION"]=" \"0.0.1\"" -D["HAVE_STDIO_H"]=" 1" +D["STDC_HEADERS"]=" 1" +D["HAVE_SYS_TYPES_H"]=" 1" +D["HAVE_SYS_STAT_H"]=" 1" D["HAVE_STDLIB_H"]=" 1" D["HAVE_STRING_H"]=" 1" +D["HAVE_MEMORY_H"]=" 1" +D["HAVE_STRINGS_H"]=" 1" D["HAVE_INTTYPES_H"]=" 1" D["HAVE_STDINT_H"]=" 1" -D["HAVE_STRINGS_H"]=" 1" -D["HAVE_SYS_STAT_H"]=" 1" -D["HAVE_SYS_TYPES_H"]=" 1" D["HAVE_UNISTD_H"]=" 1" -D["STDC_HEADERS"]=" 1" D["HAVE_ARPA_INET_H"]=" 1" D["HAVE_FCNTL_H"]=" 1" D["HAVE_LIMITS_H"]=" 1" @@ -806,6 +816,7 @@ D["HAVE_FORK"]=" 1" D["HAVE_VFORK"]=" 1" D["HAVE_WORKING_VFORK"]=" 1" D["HAVE_WORKING_FORK"]=" 1" +D["HAVE_STDLIB_H"]=" 1" D["HAVE_MALLOC"]=" 1" D["HAVE_CLOCK_GETTIME"]=" 1" D["HAVE_DUP2"]=" 1" @@ -813,13 +824,13 @@ D["HAVE_MEMSET"]=" 1" D["HAVE_MKDIR"]=" 1" D["HAVE_SETLOCALE"]=" 1" D["HAVE_SOCKET"]=" 1" -D["APP_CONFIGDIR"]=" \"/home/ziggi/Projects/jcomp/\"" -D["APP_LOGDIR"]=" \"/home/ziggi/Projects/jcomp/log\"" -D["APP_RUNDIR"]=" \"/home/ziggi/Projects/jcomp/run\"" -D["APP_LIBDIR"]=" \"/home/ziggi/Projects/jcomp/lib\"" -D["APP_USER"]=" \"ziggi\"" -D["APP_DATABASEDIR"]=" \"/home/ziggi/Projects/jcomp/data\"" -D["APP_CACHEDIR"]=" \"/home/ziggi/Projects/jcomp/cache\"" +D["APP_CONFIGDIR"]=" \"/dat2/home/ziggi/projects/cworker/\"" +D["APP_LOGDIR"]=" \"/dat2/home/ziggi/projects/cworker/log\"" +D["APP_RUNDIR"]=" \"/dat2/home/ziggi/projects/cworker/run\"" +D["APP_LIBDIR"]=" \"/dat2/home/ziggi/projects/cworker/lib\"" +D["APP_USER"]=" \"root\"" +D["APP_DATABASEDIR"]=" \"/dat2/home/ziggi/projects/cworker/data\"" +D["APP_CACHEDIR"]=" \"/dat2/home/ziggi/projects/cworker/cache\"" for (key in D) D_is_set[key] = 1 FS = "" } @@ -852,7 +863,7 @@ D["APP_CACHEDIR"]=" \"/home/ziggi/Projects/jcomp/cache\"" } { print } _ACAWK - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "6588" 5 fi # test -n "$CONFIG_HEADERS" @@ -865,7 +876,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "6601" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -893,9 +904,9 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "6629" 5;; esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -903,24 +914,24 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:${as_lineno-6643}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`printf "%s\n" "$configure_input" | + ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + || as_fn_error $? "could not create $ac_file" "6656" 5 ;; esac ;; esac @@ -930,7 +941,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -954,9 +965,9 @@ printf "%s\n" X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1015,8 +1026,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:${as_lineno-6754}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} ac_datarootdir_hack=' s&@datadir@&${datarootdir}&g s&@docdir@&${datarootdir}/doc/${PACKAGE_TARNAME}&g @@ -1059,15 +1070,15 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "6793" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:${as_lineno-6799}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -1075,7 +1086,7 @@ which seems to be undefined. Please make sure it is defined" >&2;} -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "6809" 5 ;; :H) # @@ -1083,22 +1094,22 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - printf "%s\n" "/* $configure_input */" >&1 \ + $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "6820" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + { $as_echo "$as_me:${as_lineno-6822}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "6827" 5 fi else - printf "%s\n" "/* $configure_input */" >&1 \ + $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 + || as_fn_error $? "could not create -" "6832" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -1116,7 +1127,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$_am_arg" | +$as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1136,8 +1147,8 @@ printf "%s\n" X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + :C) { $as_echo "$as_me:${as_lineno-6870}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -1163,7 +1174,7 @@ esac for am_mf do # Strip MF so we end up with the name of the file. - am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line @@ -1175,7 +1186,7 @@ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$am_mf" | +$as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1197,7 +1208,7 @@ printf "%s\n" X"$am_mf" | $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$am_mf" | +$as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -1211,24 +1222,26 @@ printf "%s\n" X/"$am_mf" | q } s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ + { echo "$as_me:6945: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:6952: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-6956}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "6964" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} diff --git a/config.sub b/config.sub index dad7123..1d8e98b 100755 --- a/config.sub +++ b/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2018-05-24' +timestamp='2018-02-22' # 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 @@ -110,455 +110,131 @@ case $# in exit 1;; esac -# Split fields of configuration type -IFS="-" read -r field1 field2 field3 field4 <&2 - exit 1 +### 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. ;; - *-*-*-*) - basic_machine=$field1-$field2 - os=$field3-$field4 + -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 | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 ;; - *-*-*) - # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two - # parts - maybe_os=$field2-$field3 - case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) - basic_machine=$field1 - os=$maybe_os - ;; - android-linux) - basic_machine=$field1-unknown - os=linux-android - ;; - *) - basic_machine=$field1-$field2 - os=$field3 - ;; - esac + -bluegene*) + os=-cnk ;; - *-*) - # Second component is usually, but not always the OS - case $field2 in - # Prevent following clause from handling this valid os - sun*os*) - basic_machine=$field1 - os=$field2 - ;; - # Manufacturers - 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 | knuth | cray | microblaze* \ - | sim | cisco | oki | wec | wrs | winbond) - basic_machine=$field1-$field2 - os= - ;; - *) - basic_machine=$field1 - os=$field2 - ;; - esac + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 ;; - *) - # Convert single-component short-hands not valid as part of - # multi-component configurations. - case $field1 in - 386bsd) - basic_machine=i386-pc - os=bsd - ;; - a29khif) - basic_machine=a29k-amd - os=udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=scout - ;; - am29k) - basic_machine=a29k-none - os=bsd - ;; - amdahl) - basic_machine=580-amdahl - os=sysv - ;; - 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 - ;; - aros) - basic_machine=i386-pc - os=aros - ;; - aux) - basic_machine=m68k-apple - os=aux - ;; - balance) - basic_machine=ns32k-sequent - os=dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=linux - ;; - cegcc) - basic_machine=arm-unknown - os=cegcc - ;; - cray) - basic_machine=j90-cray - os=unicos - ;; - craynv) - basic_machine=craynv-cray - os=unicosmp - ;; - delta88) - basic_machine=m88k-motorola - os=sysv3 - ;; - dicos) - basic_machine=i686-pc - os=dicos - ;; - djgpp) - basic_machine=i586-pc - os=msdosdjgpp - ;; - ebmon29k) - basic_machine=a29k-amd - os=ebmon - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=ose - ;; - gmicro) - basic_machine=tron-gmicro - os=sysv - ;; - go32) - basic_machine=i386-pc - os=go32 - ;; - 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 - ;; - hp300bsd) - basic_machine=m68k-hp - os=bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=hpux - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=proelf - ;; - i386mach) - basic_machine=i386-mach - os=mach - ;; - vsta) - basic_machine=i386-unknown - os=vsta - ;; - isi68 | isi) - basic_machine=m68k-isi - os=sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=linux - ;; - magnum | m3230) - basic_machine=mips-mips - os=sysv - ;; - merlin) - basic_machine=ns32k-utek - os=sysv - ;; - mingw64) - basic_machine=x86_64-pc - os=mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=mingw32ce - ;; - monitor) - basic_machine=m68k-rom68k - os=coff - ;; - morphos) - basic_machine=powerpc-unknown - os=morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=moxiebox - ;; - msdos) - basic_machine=i386-pc - os=msdos - ;; - msys) - basic_machine=i686-pc - os=msys - ;; - mvs) - basic_machine=i370-ibm - os=mvs - ;; - nacl) - basic_machine=le32-unknown - os=nacl - ;; - 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 - ;; - necv70) - basic_machine=v70-nec - os=sysv - ;; - 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 - ;; - os400) - basic_machine=powerpc-ibm - os=os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=ose - ;; - os68k) - basic_machine=m68k-none - os=os68k - ;; - paragon) - basic_machine=i860-intel - os=osf - ;; - parisc) - basic_machine=hppa-unknown - os=linux - ;; - pw32) - basic_machine=i586-unknown - os=pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=rdos - ;; - rdos32) - basic_machine=i386-pc - os=rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=coff - ;; - sa29200) - basic_machine=a29k-amd - os=udi - ;; - sei) - basic_machine=mips-sei - os=seiux - ;; - sps7) - basic_machine=m68k-bull - os=sysv2 - ;; - stratus) - basic_machine=i860-stratus - os=sysv4 - ;; - 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 - ;; - 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 - ;; - toad1) - basic_machine=pdp10-xkl - os=tops20 - ;; - tpf) - basic_machine=s390x-ibm - os=tpf - ;; - 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 - ;; - vxworks960) - basic_machine=i960-wrs - os=vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=vxworks - ;; - xbox) - basic_machine=i686-pc - os=mingw32 - ;; - ymp) - basic_machine=ymp-cray - os=unicos - ;; - *) - basic_machine=$1 - os= - ;; - esac + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -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/'` + ;; + -sco5v6*) + # 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*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint ;; esac @@ -573,12 +249,12 @@ case $basic_machine in | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ - | c4x | c8051 | clipper | csky \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ @@ -617,12 +293,11 @@ case $basic_machine in | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nfp \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ @@ -656,23 +331,20 @@ case $basic_machine in ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown - os=${os:-none} + os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; - m9s12z | m68hcs12z | hcs12z | s12z) - basic_machine=s12z-unknown - os=${os:-none} - ;; ms1) basic_machine=mt-unknown ;; + strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown - os=${os:-none} + os=-none ;; xscaleeb) basic_machine=armeb-unknown @@ -688,20 +360,25 @@ case $basic_machine in 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-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* | arceb-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -742,14 +419,13 @@ case $basic_machine in | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nfp-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | powerpcspe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ @@ -780,34 +456,92 @@ case $basic_machine in ;; # 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-pc + 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 + ;; abacus) basic_machine=abacus-unknown ;; + 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 + ;; + amd64-*) + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + 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 + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; asmjs) basic_machine=asmjs-unknown ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=linux + os=-linux ;; bluegene*) basic_machine=powerpc-ibm - os=cnk + os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` @@ -820,31 +554,43 @@ case $basic_machine in ;; c90) basic_machine=c90-cray - os=${os:-unicos} + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc ;; convex-c1) basic_machine=c1-convex - os=bsd + os=-bsd ;; convex-c2) basic_machine=c2-convex - os=bsd + os=-bsd ;; convex-c32) basic_machine=c32-convex - os=bsd + os=-bsd ;; convex-c34) basic_machine=c34-convex - os=bsd + os=-bsd ;; convex-c38) basic_machine=c38-convex - os=bsd + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown - os=${os:-elf} + os=-elf ;; crds | unos) basic_machine=m68k-crds @@ -857,7 +603,7 @@ case $basic_machine in ;; crx) basic_machine=crx-unknown - os=${os:-elf} + os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 @@ -867,23 +613,35 @@ case $basic_machine in ;; decsystem10* | dec10*) basic_machine=pdp10-dec - os=tops10 + os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec - os=tops20 + os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull - os=${os:-bosx} + os=-bosx ;; dpx2*) basic_machine=m68k-bull - os=sysv3 + os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown @@ -893,12 +651,20 @@ case $basic_machine in basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; - encore | umax | mmax) - basic_machine=ns32k-encore + ebmon29k) + basic_machine=a29k-amd + os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi - os=${os:-bsd} + 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 @@ -906,13 +672,45 @@ case $basic_machine in 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 + 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 ;; @@ -942,55 +740,95 @@ case $basic_machine in hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=sysv32 + os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=sysv4 + os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=sysv + os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=solaris2 + os=-solaris2 ;; - j90 | j90-cray) - basic_machine=j90-cray - os=${os:-unicos} + i386mach) + basic_machine=i386-mach + os=-mach + ;; + vsta) + basic_machine=i386-unknown + os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in - irix*) + -irix*) ;; *) - os=irix4 + os=-irix4 ;; esac ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=linux + os=-linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent ;; - *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari - os=mint + os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` @@ -998,26 +836,98 @@ case $basic_machine in mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + 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 + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in - nextstep* ) + -nextstep* ) ;; - ns2*) - os=nextstep2 + -ns2*) + os=-nextstep2 ;; *) - os=nextstep3 + 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 ;; @@ -1038,18 +948,38 @@ case $basic_machine in ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki - os=proelf + os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; pa-hitachi) basic_machine=hppa1.1-hitachi - os=hiuxwe2 + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=linux + os=-linux ;; pbd) basic_machine=sparc-tti @@ -1119,6 +1049,22 @@ case $basic_machine in ps2) basic_machine=i386-ibm ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; rm[46]00) basic_machine=mips-siemens ;; @@ -1131,6 +1077,10 @@ case $basic_machine in s390x | s390x-*) basic_machine=s390x-ibm ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; sb1) basic_machine=mipsisa64sb1-unknown ;; @@ -1139,7 +1089,11 @@ case $basic_machine in ;; sde) basic_machine=mipsisa32-sde - os=${os:-elf} + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux ;; sequent) basic_machine=i386-sequent @@ -1149,7 +1103,11 @@ case $basic_machine in ;; simso-wrs) basic_machine=sparclite-wrs - os=vxworks + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 ;; spur) basic_machine=spur-unknown @@ -1157,12 +1115,44 @@ case $basic_machine in st2000) basic_machine=m68k-tandem ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; 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 ;; @@ -1172,9 +1162,25 @@ case $basic_machine in 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 + ;; tile*) basic_machine=$basic_machine-unknown - os=linux-gnu + os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown @@ -1182,32 +1188,80 @@ case $basic_machine in tx39el) basic_machine=mipstx39el-unknown ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; tower | tower-32) basic_machine=m68k-ncr ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + 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 + os=-none ;; w89k-*) basic_machine=hppa1.1-winbond - os=proelf + os=-proelf ;; x64) basic_machine=x86_64-pc ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; none) basic_machine=none-none - os=${os:-none} + os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in @@ -1280,245 +1334,199 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x$os != x ] +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. - auroraux) - os=auroraux - ;; - bluegene*) - os=cnk + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux ;; - solaris1 | solaris1.*) + -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; - solaris) - os=solaris2 + -solaris) + os=-solaris2 ;; - unixware*) - os=sysv4.2uw + -unixware*) + os=-sysv4.2uw ;; - gnu/linux*) + -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) - es1800*) - os=ose - ;; - # Some version numbers need modification - chorusos*) - os=chorusos - ;; - isc) - os=isc2.2 - ;; - sco6) - os=sco5v6 - ;; - sco5) - os=sco3.2v5 - ;; - sco4) - os=sco3.2v4 - ;; - sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - ;; - sco3.2v[4-9]* | sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - ;; - scout) - # Don't match below - ;; - sco*) - os=sco3.2v2 - ;; - psos*) - os=psos + -es1800*) + os=-ose ;; # Now 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* | esix* | aix* | cnk* | sunos | sunos[34]*\ - | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ - | sym* | kopensolaris* | plan9* \ - | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ - | aos* | aros* | cloudabi* | sortix* \ - | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ - | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \ - | knetbsd* | mirbsd* | netbsd* \ - | bitrig* | openbsd* | solidbsd* | libertybsd* \ - | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ - | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ - | chorusrdb* | cegcc* | glidix* \ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ - | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ - | linux-newlib* | linux-musl* | linux-uclibc* \ - | uxpv* | beos* | mpeix* | udk* | moxiebox* \ - | interix* | uwin* | mks* | rhapsody* | darwin* \ - | openstep* | oskit* | conix* | pw32* | nonstopux* \ - | storm-chaos* | tops10* | tenex* | tops20* | its* \ - | os2* | vos* | palmos* | uclinux* | nucleus* \ - | morphos* | superux* | rtmk* | windiss* \ - | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ - | skyos* | haiku* | rdos* | toppers* | drops* | es* \ - | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ - | midnightbsd*) + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; - qnx*) + -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) - os=nto-$os + os=-nto$os ;; esac ;; - hiux*) - os=hiuxwe2 + -nto-qnx*) ;; - nto-qnx*) - ;; - nto*) + -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - sim | xray | os68k* | v88r* \ - | windows* | osx | abug | netware* | os9* \ - | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) - ;; - linux-dietlibc) - os=linux-dietlibc - ;; - linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - lynx*178) - os=lynxos178 - ;; - lynx*5) - os=lynxos5 - ;; - lynx*) - os=lynxos + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; - mac*) + -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; - opened*) - os=openedition + -linux-dietlibc) + os=-linux-dietlibc ;; - os400*) - os=os400 + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; - sunos5*) + -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - sunos6*) + -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - wince*) - os=wince + -opened*) + os=-openedition ;; - utek*) - os=bsd + -os400*) + os=-os400 ;; - dynix*) - os=bsd + -wince*) + os=-wince ;; - acis*) - os=aos + -utek*) + os=-bsd ;; - atheos*) - os=atheos + -dynix*) + os=-bsd ;; - syllable*) - os=syllable + -acis*) + os=-aos ;; - 386bsd) - os=bsd + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable ;; - ctix* | uts*) - os=sysv + -386bsd) + os=-bsd ;; - nova*) - os=rtmk-nova + -ctix* | -uts*) + os=-sysv ;; - ns2) - os=nextstep2 + -nova*) + os=-rtmk-nova ;; - nsk*) - os=nsk + -ns2) + os=-nextstep2 + ;; + -nsk*) + os=-nsk ;; # Preserve the version number of sinix5. - sinix5.*) + -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; - sinix*) - os=sysv4 + -sinix*) + os=-sysv4 ;; - tpf*) - os=tpf + -tpf*) + os=-tpf ;; - triton*) - os=sysv3 + -triton*) + os=-sysv3 ;; - oss*) - os=sysv3 + -oss*) + os=-sysv3 ;; - svr4*) - os=sysv4 + -svr4*) + os=-sysv4 ;; - svr3) - os=sysv3 + -svr3) + os=-sysv3 ;; - sysvr4) - os=sysv4 + -sysvr4) + os=-sysv4 ;; - # This must come after sysvr4. - sysv*) + # This must come after -sysvr4. + -sysv*) ;; - ose*) - os=ose + -ose*) + os=-ose ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) - os=mint + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint ;; - zvmoe) - os=zvmoe + -zvmoe) + os=-zvmoe ;; - dicos*) - os=dicos + -dicos*) + os=-dicos ;; - pikeos*) + -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) - os=eabi + os=-eabi ;; *) - os=elf + os=-elf ;; esac ;; - nacl*) + -nacl*) ;; - ios) + -ios) ;; - none) - ;; - *-eabi) + -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 ;; @@ -1537,179 +1545,173 @@ else case $basic_machine in score-*) - os=elf + os=-elf ;; spu-*) - os=elf + os=-elf ;; *-acorn) - os=riscix1.2 + os=-riscix1.2 ;; arm*-rebel) - os=linux + os=-linux ;; arm*-semi) - os=aout + os=-aout ;; c4x-* | tic4x-*) - os=coff + os=-coff ;; c8051-*) - os=elf - ;; - clipper-intergraph) - os=clix + os=-elf ;; hexagon-*) - os=elf + os=-elf ;; tic54x-*) - os=coff + os=-coff ;; tic55x-*) - os=coff + os=-coff ;; tic6x-*) - os=coff + os=-coff ;; # This must come before the *-dec entry. pdp10-*) - os=tops20 + os=-tops20 ;; pdp11-*) - os=none + os=-none ;; *-dec | vax-*) - os=ultrix4.2 + os=-ultrix4.2 ;; m68*-apollo) - os=domain + os=-domain ;; i386-sun) - os=sunos4.0.2 + os=-sunos4.0.2 ;; m68000-sun) - os=sunos3 + os=-sunos3 ;; m68*-cisco) - os=aout + os=-aout ;; mep-*) - os=elf + os=-elf ;; mips*-cisco) - os=elf + os=-elf ;; mips*-*) - os=elf + os=-elf ;; or32-*) - os=coff + os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=sysv3 + os=-sysv3 ;; sparc-* | *-sun) - os=sunos4.1.1 + os=-sunos4.1.1 ;; pru-*) - os=elf + os=-elf ;; *-be) - os=beos + os=-beos ;; *-ibm) - os=aix + os=-aix ;; *-knuth) - os=mmixware + os=-mmixware ;; *-wec) - os=proelf + os=-proelf ;; *-winbond) - os=proelf + os=-proelf ;; *-oki) - os=proelf + os=-proelf ;; *-hp) - os=hpux + os=-hpux ;; *-hitachi) - os=hiux + os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=sysv + os=-sysv ;; *-cbm) - os=amigaos + os=-amigaos ;; *-dg) - os=dgux + os=-dgux ;; *-dolphin) - os=sysv3 + os=-sysv3 ;; m68k-ccur) - os=rtu + os=-rtu ;; m88k-omron*) - os=luna + os=-luna ;; *-next) - os=nextstep + os=-nextstep ;; *-sequent) - os=ptx + os=-ptx ;; *-crds) - os=unos + os=-unos ;; *-ns) - os=genix + os=-genix ;; i370-*) - os=mvs + os=-mvs ;; *-gould) - os=sysv + os=-sysv ;; *-highlevel) - os=bsd + os=-bsd ;; *-encore) - os=bsd + os=-bsd ;; *-sgi) - os=irix + os=-irix ;; *-siemens) - os=sysv4 + os=-sysv4 ;; *-masscomp) - os=rtu + os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=uxpv + os=-uxpv ;; *-rom68k) - os=coff + os=-coff ;; *-*bug) - os=coff + os=-coff ;; *-apple) - os=macos + os=-macos ;; *-atari*) - os=mint - ;; - *-wrs) - os=vxworks + os=-mint ;; *) - os=none + os=-none ;; esac fi @@ -1720,70 +1722,67 @@ vendor=unknown case $basic_machine in *-unknown) case $os in - riscix*) + -riscix*) vendor=acorn ;; - sunos*) + -sunos*) vendor=sun ;; - cnk*|-aix*) + -cnk*|-aix*) vendor=ibm ;; - beos*) + -beos*) vendor=be ;; - hpux*) + -hpux*) vendor=hp ;; - mpeix*) + -mpeix*) vendor=hp ;; - hiux*) + -hiux*) vendor=hitachi ;; - unos*) + -unos*) vendor=crds ;; - dgux*) + -dgux*) vendor=dg ;; - luna*) + -luna*) vendor=omron ;; - genix*) + -genix*) vendor=ns ;; - clix*) - vendor=intergraph - ;; - mvs* | opened*) + -mvs* | -opened*) vendor=ibm ;; - os400*) + -os400*) vendor=ibm ;; - ptx*) + -ptx*) vendor=sequent ;; - tpf*) + -tpf*) vendor=ibm ;; - vxsim* | vxworks* | windiss*) + -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; - aux*) + -aux*) vendor=apple ;; - hms*) + -hms*) vendor=hitachi ;; - mpw* | macos*) + -mpw* | -macos*) vendor=apple ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; - vos*) + -vos*) vendor=stratus ;; esac @@ -1791,11 +1790,11 @@ case $basic_machine in ;; esac -echo "$basic_machine-$os" +echo "$basic_machine$os" exit # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/cworker.c b/cworker.c index b75e849..846e80f 100644 --- a/cworker.c +++ b/cworker.c @@ -4,10 +4,15 @@ * */ -#include -#include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include #include @@ -16,7 +21,13 @@ #include #include -int cworker_readconf(cworker_t* worker) { +#include +#include +#include + +int log_fd = 0; + +static int cworker_readconf(cworker_t* worker) { log_debug("reading configiration"); int conf_fd = -1; @@ -47,8 +58,7 @@ int cworker_readconf(cworker_t* worker) { return 0; } - -int cworker_readopts(cworker_t* worker, char** argv, int argc) { +static int cworker_readopts(cworker_t* worker, char** argv, int argc) { log_debug("reading options"); cllexer_t lexer; @@ -60,27 +70,59 @@ int cworker_readopts(cworker_t* worker, char** argv, int argc) { clparser_bind(&parser, CLVALTYPE_INT, "port", (void *)&(worker->port)); if (clparser_parse(&parser, &argv[1], argc - 1) < 0) { - log_error("parse args error\n"); + log_error("parse args error"); return -1; } return 0; } +static int cworker_openlog(cworker_t* worker) { + log_debug("redirect output"); + + if ((log_fd = open(srv_logpath, O_WRONLY|O_APPEND|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP)) < 0) { + log_error("open log file error %s %s", strerror(errno), srv_logpath); + return -1; + } + dup2(log_fd, STDOUT_FILENO); + dup2(log_fd, STDERR_FILENO); + + return 0; +} + +int cworker_writepid(cworker_t* worker) { + log_debug("write pid file"); + int pid_fd = -1; + if ((pid_fd = open(srv_runpath, O_WRONLY|O_TRUNC|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP)) < 0) { + log_error("open pid file error %s %s", strerror(errno), srv_runpath); + return -1; + } + if (dprintf(pid_fd, "%d", getpid()) < 0) { + log_error("cannon write pid, error %s %s", strerror(errno), srv_runpath); + close(pid_fd); + return -1; + } + close(pid_fd); + return 0; +} + const int64_t default_port = 9701; int cworker_init(cworker_t* worker, char** argv, int argc) { + if (cworker_openlog(worker) < 0) { + log_error("openlog error"); + return -1; + } log_debug("init service"); - worker->port = default_port; if (cworker_readconf(worker) < 0) { - log_error("reading config error\n"); + log_error("reading config error"); return -1; } if (cworker_readopts(worker, argv, argc) < 0) { - log_error("reading config error\n"); + log_error("reading config error"); return -1; } @@ -89,14 +131,23 @@ int cworker_init(cworker_t* worker, char** argv, int argc) { return 0; } - int cworker_detach(cworker_t* worker) { log_debug("detach service"); - return 0; -} -int cworker_configure(cworker_t* worker) { - log_debug("configure service"); + int childpid = -1; + if((childpid = fork()) < 0) { + log_error("fork error: %s", strerror(errno)); + return -1; + } + + if (childpid == 0) { + // child + } else { + // parent + int status = 0; + waitpid(childpid, &status, 0); + exit(0); + } return 0; } diff --git a/cworker.h b/cworker.h index 306a478..202414c 100644 --- a/cworker.h +++ b/cworker.h @@ -11,6 +11,7 @@ typedef struct { int cworker_init(cworker_t* worker, char** argv, int argc); int cworker_detach(cworker_t* worker); +int cworker_writepid(cworker_t* worker); int cworker_configure(cworker_t* worker); int cworker_build(cworker_t* worker); int cworker_run(cworker_t* worker); diff --git a/defines.h b/defines.h index 49bcb20..21d5651 100644 --- a/defines.h +++ b/defines.h @@ -2,25 +2,25 @@ /* defines.h.in. Generated from configure.ac by autoheader. */ /* location of cache dir */ -#define APP_CACHEDIR "/home/ziggi/Projects/jcomp/cache" +#define APP_CACHEDIR "/dat2/home/ziggi/projects/cworker/cache" /* location of configuration files for ${PACKAGE} */ -#define APP_CONFIGDIR "/home/ziggi/Projects/jcomp/" +#define APP_CONFIGDIR "/dat2/home/ziggi/projects/cworker/" /* location of database dir */ -#define APP_DATABASEDIR "/home/ziggi/Projects/jcomp/data" +#define APP_DATABASEDIR "/dat2/home/ziggi/projects/cworker/data" /* location of libs */ -#define APP_LIBDIR "/home/ziggi/Projects/jcomp/lib" +#define APP_LIBDIR "/dat2/home/ziggi/projects/cworker/lib" /* location of ${PACKAGE} logdir */ -#define APP_LOGDIR "/home/ziggi/Projects/jcomp/log" +#define APP_LOGDIR "/dat2/home/ziggi/projects/cworker/log" /* location of pid file */ -#define APP_RUNDIR "/home/ziggi/Projects/jcomp/run" +#define APP_RUNDIR "/dat2/home/ziggi/projects/cworker/run" /* effective user */ -#define APP_USER "ziggi" +#define APP_USER "root" /* Define to 1 if you have the header file. */ #define HAVE_ARPA_INET_H 1 @@ -54,6 +54,9 @@ to 0 otherwise. */ #define HAVE_MALLOC 1 +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 @@ -72,9 +75,6 @@ /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_STDIO_H 1 - /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 @@ -149,9 +149,7 @@ /* Define to the version of this package. */ #define PACKAGE_VERSION "0.0.1" -/* Define to 1 if all of the C90 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ +/* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if your declares `struct tm'. */ @@ -169,7 +167,7 @@ /* Define to `int' if does not define. */ /* #undef mode_t */ -/* Define as a signed integer type capable of holding a process identifier. */ +/* Define to `int' if does not define. */ /* #undef pid_t */ /* Define to `int' if does not define. */ diff --git a/defines.h.in b/defines.h.in index 824b3dd..d421bef 100644 --- a/defines.h.in +++ b/defines.h.in @@ -53,6 +53,9 @@ to 0 otherwise. */ #undef HAVE_MALLOC +/* 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 @@ -71,9 +74,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -148,9 +148,7 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if all of the C90 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ +/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if your declares `struct tm'. */ @@ -168,7 +166,7 @@ /* Define to `int' if does not define. */ #undef mode_t -/* Define as a signed integer type capable of holding a process identifier. */ +/* Define to `int' if does not define. */ #undef pid_t /* Define to `int' if does not define. */ diff --git a/logger.c b/logger.c index f824bec..886b230 100644 --- a/logger.c +++ b/logger.c @@ -4,20 +4,16 @@ * */ -#include #include -#include -#include -#include -#include -#include #include #include -#define MAX_TS_LEN 256 +#define _CLOCK_SOURCE CLOCK_MONOTONIC +//#define CLOCK_SOURCE CLOCK_REALTIME_PRECISE -void log_error(const char* format, ...) { +#define MAX_TS_LEN 256 +void static set_timestamp(char* buffer) { time_t now = time(NULL); if (now < 0) { return; @@ -27,13 +23,18 @@ void log_error(const char* format, ...) { return; } struct timespec tv; - char timestamp[MAX_TS_LEN]; - clock_gettime(CLOCK_REALTIME_PRECISE, &tv); - memset(timestamp, 0, MAX_TS_LEN); - sprintf(timestamp, "%04d-%02d-%02dT%02d:%02d:%02d.%ld+%s", + clock_gettime(_CLOCK_SOURCE, &tv); + memset(buffer, '\0', MAX_TS_LEN); + sprintf(buffer, "%04d-%02d-%02dT%02d:%02d:%02d.%ld+%s", ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec, tv.tv_nsec, ptm->tm_zone); +} + +void log_error(const char* format, ...) { + + char timestamp[MAX_TS_LEN]; + set_timestamp(timestamp); va_list args; fprintf(stderr, "%s error: ", timestamp); @@ -45,22 +46,8 @@ void log_error(const char* format, ...) { void log_debug(const char* format, ...) { - time_t now = time(NULL); - if (now < 0) { - return; - } - struct tm* ptm = localtime(&now); - if (ptm == NULL) { - return; - } - struct timespec tv; char timestamp[MAX_TS_LEN]; - - clock_gettime(CLOCK_REALTIME_PRECISE, &tv); - memset(timestamp, 0, MAX_TS_LEN); - sprintf(timestamp, "%04d-%02d-%02dT%02d:%02d:%02d.%ld+%s", - ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, - ptm->tm_min, ptm->tm_sec, tv.tv_nsec, ptm->tm_zone); + set_timestamp(timestamp); va_list args; fprintf(stderr, "%s debug: ", timestamp); diff --git a/main.c b/main.c index b571acc..6b029dc 100644 --- a/main.c +++ b/main.c @@ -17,14 +17,14 @@ int main(int argc, char **argv) { log_error("cannot init service"); return 1; } - if (cworker_configure(&worker) < 0) { - log_error("cannot configure service"); - return 1; - } if (cworker_detach(&worker) < 0) { log_error("cannot detach service"); return 1; } + if (cworker_writepid(&worker) < 0) { + log_error("cannot build service"); + return 1; + } if (cworker_build(&worker) < 0) { log_error("cannot build service"); return 1; diff --git a/missing b/missing index 625aeb1..8d0eaad 100755 --- a/missing +++ b/missing @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff --git a/test.conf b/test.conf index 95365d3..c745734 100644 --- a/test.conf +++ b/test.conf @@ -1,4 +1,5 @@ -"id" = -123\" +"id" = -123 +debug = true name = "qwerty\"567" foo = bar # bbbb "aaa