finit-4.14/0000755000175100001660000000000015054341601006314 5finit-4.14/aclocal.m40000644000175100001660000015372415054341565010121 # generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. 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. 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'.])]) # pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- # serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurrence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------ dnl dnl Prepare a "--with-" configure option using the lowercase dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and dnl PKG_CHECK_MODULES in a single macro. AC_DEFUN([PKG_WITH_MODULES], [ m4_pushdef([with_arg], m4_tolower([$1])) m4_pushdef([description], [m4_default([$5], [build with ]with_arg[ support])]) m4_pushdef([def_arg], [m4_default([$6], [auto])]) m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) m4_case(def_arg, [yes],[m4_pushdef([with_without], [--without-]with_arg)], [m4_pushdef([with_without],[--with-]with_arg)]) AC_ARG_WITH(with_arg, AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, [AS_TR_SH([with_]with_arg)=def_arg]) AS_CASE([$AS_TR_SH([with_]with_arg)], [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], [auto],[PKG_CHECK_MODULES([$1],[$2], [m4_n([def_action_if_found]) $3], [m4_n([def_action_if_not_found]) $4])]) m4_popdef([with_arg]) m4_popdef([description]) m4_popdef([def_arg]) ])dnl PKG_WITH_MODULES dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ----------------------------------------------- dnl dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES dnl check._[VARIABLE-PREFIX] is exported as make variable. AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) AM_CONDITIONAL([HAVE_][$1], [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) ])dnl PKG_HAVE_WITH_MODULES dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------------------ dnl dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make dnl and preprocessor variable. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], [ PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) 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.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_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.5])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-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. 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 # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments 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 AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. 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 MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/expand.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/plugin.m4]) finit-4.14/README.md0000644000175100001660000000444615054341541007526 [![License Badge][]][License] [![GitHub Status][]][GitHub] [![Coverity Status][]][Coverity Scan] Finit: Fast Init Finit is an alternative to [SysV init](https://en.wikipedia.org/wiki/Init) and [systemd](https://www.freedesktop.org/wiki/Software/systemd/), focused on small and embedded Linux systems, although fully usable on server and [desktop systems][finix]. > Reverse engineered from the [EeePC fastinit][] > "gaps filled with frog DNA …" > — [Claudio Matsuoka][] For detailed information, explore our extensive documentation :books: ****
Alpine screenshot
For working examples, see the :rocket: [contrib/](contrib/) section or these tutorials: * :hammer_and_wrench: [Buildroot embedded Linux](https://troglobit.com/post/2022-12-26-buildroot-demo-of-fastinit-finit/), * :package: [Debian GNU/Linux](contrib/debian/), * :mountain: [Alpine Linux](contrib/alpine/), and * :milky_way: [Void Linux](contrib/void/) > [!NOTE] > Support for various Linux distributions does not mean Finit installs > easily on all architectures. Bundled install scripts are examples for > standard installations, tested on amd64 (x86_64) systems. Custom > setups, e.g., for embedded systems, can be found in the following > [Buildroot][] based examples: [myLinux][], [Infix][], or the plain > [br2-finit-demo](https://github.com/troglobit/br2-finit-demo). [finix]: https://github.com/aanderse/finix [Buildroot]: https://buildroot.org [Infix]: https://kernelkit.github.io [myLinux]: https://github.com/troglobit/myLinux/ [EeePC fastinit]: https://web.archive.org/web/20071208212450/http://wiki.eeeuser.com/boot_process:the_boot_process [Claudio Matsuoka]: https://github.com/cmatsuoka [License]: https://en.wikipedia.org/wiki/MIT_License [License Badge]: https://img.shields.io/badge/License-MIT-teal.svg [GitHub]: https://github.com/troglobit/finit/actions/workflows/build.yml/ [GitHub Status]: https://github.com/troglobit/finit/actions/workflows/build.yml/badge.svg [Coverity Scan]: https://scan.coverity.com/projects/3545 [Coverity Status]: https://scan.coverity.com/projects/3545/badge.svg finit-4.14/libsystemd/0000755000175100001660000000000015054341601010473 5finit-4.14/libsystemd/sd-daemon.h0000644000175100001660000000232715054341541012442 #ifndef SD_DAEMON_H_ #define SD_DAEMON_H_ #include #include #define SD_LISTEN_FDS_START 3 /* systemd logging defines for stderr parsing by Finit */ #define SD_EMERG "<0>" /* system is unusable */ #define SD_ALERT "<1>" /* action must be taken immediately */ #define SD_CRIT "<2>" /* critical conditions */ #define SD_ERR "<3>" /* error conditions */ #define SD_WARNING "<4>" /* warning conditions */ #define SD_NOTICE "<5>" /* normal but significant condition */ #define SD_INFO "<6>" /* informational */ #define SD_DEBUG "<7>" /* debug-level messages */ /* Basic notification function */ int sd_notify(int unset_environment, const char *state); /* Printf-style notification functions */ int sd_notifyf(int unset_environment, const char *format, ...); /* PID-specific notification functions */ int sd_pid_notify(pid_t pid, int unset_environment, const char *state); int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...); /* Socket activation stubs */ int sd_listen_fds(int unset_environment); /* Watchdog stub */ int sd_watchdog_enabled(int unset_environment, uint64_t *usec); /* System detection */ int sd_booted(void); #endif /* SD_DAEMON_H_ */ finit-4.14/libsystemd/sd-daemon.c0000644000175100001660000001004715054341541012433 /* SPDX-License-Identifier: MIT-0 */ /* * systemd notify protocol, supporting readiness notification on startup * and reloading, according to the protocol defined at: * https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html * * This protocol is guaranteed to be stable as per: * https://systemd.io/PORTABILITY_AND_STABILITY/ */ #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "sd-daemon.h" /* * NOTE: As per spec., this function does not return POSIX OK(0) but * rather "a positive value", i.e., 1. */ int sd_notify(int unset_environment, const char *state) { struct sockaddr_un sun = { .sun_family = AF_UNIX, }; size_t len, sun_len; const char *path; ssize_t written; int sd; if (!state) return -EINVAL; len = strlen(state); if (len == 0) return -EINVAL; /* If the variable is not set, the protocol is a noop */ path = getenv("NOTIFY_SOCKET"); if (!path) return 0; /* Not set? Nothing to do */ /* Only AF_UNIX is supported, with path or abstract sockets */ if (path[0] != '/' && path[0] != '@') return -EAFNOSUPPORT; /* Ensure there is room for NUL byte */ sun_len = strlen(path); if (sun_len >= sizeof(sun.sun_path)) return -E2BIG; strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); if (sun.sun_path[0] == '@') sun.sun_path[0] = 0; sd = socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0); if (sd == -1) return -errno; if (connect(sd, (struct sockaddr *)&sun, offsetof(struct sockaddr_un, sun_path) + sun_len) == -1) { close(sd); return -errno; } if (unset_environment) unsetenv("NOTIFY_SOCKET"); written = write(sd, state, len); close(sd); if (written != (ssize_t) len) return written < 0 ? -errno : -EPROTO; return 1; } /* * Printf-style notification function */ int sd_notifyf(int unset_environment, const char *format, ...) { va_list ap; char *state; int ret; if (!format) return -EINVAL; va_start(ap, format); ret = vasprintf(&state, format, ap); va_end(ap); if (ret < 0) return -ENOMEM; ret = sd_notify(unset_environment, state); free(state); return ret; } /* * PID-specific notification function */ int sd_pid_notify(pid_t pid, int unset_environment, const char *state) { char path[256], *env; size_t len; int ret; if (!state) return -EINVAL; len = strlen(state); if (len == 0) return -EINVAL; if (pid == 0) pid = getpid(); env = getenv("NOTIFY_SOCKET"); if (env) { env = strdup(env); if (!env) return -errno; } snprintf(path, sizeof(path), "@run/finit/notify/%d", pid); setenv("NOTIFY_SOCKET", path, 1); ret = sd_notify(unset_environment, state); if (env) { setenv("NOTIFY_SOCKET", env, 1); free(env); } return ret; } /* * PID-specific printf-style notification function */ int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...) { va_list ap; char *state; int ret; if (!format) return -EINVAL; va_start(ap, format); ret = vasprintf(&state, format, ap); va_end(ap); if (ret < 0) return -ENOMEM; ret = sd_pid_notify(pid, unset_environment, state); free(state); return ret; } /* * Socket activation stub - Finit doesn't support socket activation yet * Returns 0 (no file descriptors passed) */ int sd_listen_fds(int unset_environment) { if (unset_environment) { unsetenv("LISTEN_PID"); unsetenv("LISTEN_FDS"); unsetenv("LISTEN_FDNAMES"); } return 0; } /* * Watchdog stub - Finit doesn't support watchdog yet * Returns 0 (no watchdog enabled) */ int sd_watchdog_enabled(int unset_environment, uint64_t *usec) { if (unset_environment) { unsetenv("WATCHDOG_PID"); unsetenv("WATCHDOG_USEC"); } if (usec) *usec = 0; return 0; } /* * System detection function * Returns 1 to indicate systemd compatibility (trick applications) */ int sd_booted(void) { return 1; } finit-4.14/libsystemd/Makefile.in0000644000175100001660000006056215054341567012504 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libsystemd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(systemd_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = libsystemd.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(systemddir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libsystemd_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libsystemd_la_OBJECTS = libsystemd_la-sd-daemon.lo libsystemd_la_OBJECTS = $(am_libsystemd_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libsystemd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libsystemd_la_CFLAGS) \ $(CFLAGS) $(libsystemd_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libsystemd_la-sd-daemon.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ 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 = $(libsystemd_la_SOURCES) DIST_SOURCES = $(libsystemd_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgconfig_DATA) HEADERS = $(systemd_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libsystemd.pc.in \ $(top_srcdir)/aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ # libsystemd replacement library lib_LTLIBRARIES = libsystemd.la libsystemd_la_SOURCES = sd-daemon.c sd-daemon.h libsystemd_la_LDFLAGS = -version-info 0:0:0 libsystemd_la_CFLAGS = $(lite_CFLAGS) libsystemd_la_LIBADD = $(lite_LIBS) # pkg-config support pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libsystemd.pc # Install header to systemd/ subdirectory systemddir = $(includedir)/systemd systemd_HEADERS = sd-daemon.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libsystemd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libsystemd/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libsystemd.pc: $(top_builddir)/config.status $(srcdir)/libsystemd.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libsystemd.la: $(libsystemd_la_OBJECTS) $(libsystemd_la_DEPENDENCIES) $(EXTRA_libsystemd_la_DEPENDENCIES) $(AM_V_CCLD)$(libsystemd_la_LINK) -rpath $(libdir) $(libsystemd_la_OBJECTS) $(libsystemd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsystemd_la-sd-daemon.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libsystemd_la-sd-daemon.lo: sd-daemon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_la_CFLAGS) $(CFLAGS) -MT libsystemd_la-sd-daemon.lo -MD -MP -MF $(DEPDIR)/libsystemd_la-sd-daemon.Tpo -c -o libsystemd_la-sd-daemon.lo `test -f 'sd-daemon.c' || echo '$(srcdir)/'`sd-daemon.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsystemd_la-sd-daemon.Tpo $(DEPDIR)/libsystemd_la-sd-daemon.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sd-daemon.c' object='libsystemd_la-sd-daemon.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsystemd_la_CFLAGS) $(CFLAGS) -c -o libsystemd_la-sd-daemon.lo `test -f 'sd-daemon.c' || echo '$(srcdir)/'`sd-daemon.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-systemdHEADERS: $(systemd_HEADERS) @$(NORMAL_INSTALL) @list='$(systemd_HEADERS)'; test -n "$(systemddir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(systemddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(systemddir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(systemddir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(systemddir)" || exit $$?; \ done uninstall-systemdHEADERS: @$(NORMAL_UNINSTALL) @list='$(systemd_HEADERS)'; test -n "$(systemddir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(systemddir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(systemddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libsystemd_la-sd-daemon.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgconfigDATA install-systemdHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libsystemd_la-sd-daemon.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ uninstall-systemdHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip install-systemdHEADERS installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA uninstall-systemdHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/libsystemd/Makefile.am0000644000175100001660000000070215054341541012451 # libsystemd replacement library lib_LTLIBRARIES = libsystemd.la libsystemd_la_SOURCES = sd-daemon.c sd-daemon.h libsystemd_la_LDFLAGS = -version-info 0:0:0 libsystemd_la_CFLAGS = $(lite_CFLAGS) libsystemd_la_LIBADD = $(lite_LIBS) # pkg-config support pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libsystemd.pc # Install header to systemd/ subdirectory systemddir = $(includedir)/systemd systemd_HEADERS = sd-daemon.h finit-4.14/libsystemd/libsystemd.pc.in0000644000175100001660000000036215054341541013527 prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libsystemd Description: Finit replacement for systemd notification library Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lsystemd Cflags: -I${includedir}finit-4.14/LICENSE0000644000175100001660000000217615054341541007252 Copyright (c) 2008-2010 Claudio Matsuoka Copyright (c) 2008-2025 Joachim Wiberg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. finit-4.14/config.h.in0000644000175100001660000001523015054341566010272 /* config.h.in. Generated from configure.ac by autoheader. */ /* Finit automatically does `initctl reload` on any .conf change */ #undef AUTO_RELOAD /* Autodetect cgroup v2 support from /sys/fs/cgroup */ #undef CGROUP2_ENABLED /* For /run/finit/socket */ #undef DEFGROUP /* For /etc/hostname */ #undef DEFHOST /* Built-in default: /usr/lib/finit/plugins:/usr/local/lib/finit/plugins */ #undef EXTERNAL_PLUGIN_PATH /* Skip fsck check on filesystems listed in /etc/fstab */ #undef FAST_BOOT /* Main Finit configuration file, default /etc/finit.conf */ #undef FINIT_CONF /* Finit libexec path */ #undef FINIT_EXECPATH_ /* No built-in default fstab */ #undef FINIT_FSTAB /* Finit rcS.d/, default /etc/finit.d */ #undef FINIT_RCSD /* Compat SysV /etc/rc.local file to run last at boot. */ #undef FINIT_RC_LOCAL /* Finit runtime dynamic system services */ #undef FINIT_RUNPATH_ /* System environment, default /etc/default & /etc/conf.d */ #undef FINIT_SYSCONFIG /* Static services, previously generated at runtime by plugins */ #undef FINIT_SYSPATH_ /* Finit tmpfiles.d/ .conf path */ #undef FINIT_TMPFILES /* Run fsck fix mode (options: -yf) on filesystems listed in /etc/fstab */ #undef FSCK_FIX /* Define to 1 if the alsa-utils plugin is enabled. */ #undef HAVE_ALSA_UTILS_PLUGIN /* Define to 1 if the dbus plugin is enabled. */ #undef HAVE_DBUS_PLUGIN /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `getmntent' function. */ #undef HAVE_GETMNTENT /* Define to 1 if you have the `getmntent_r' function. */ #undef HAVE_GETMNTENT_R /* Define to 1 if you have the `getopt' function. */ #undef HAVE_GETOPT /* Define to 1 if the hook-scripts plugin is enabled. */ #undef HAVE_HOOK_SCRIPTS_PLUGIN /* Define to 1 if the hotplug plugin is enabled. */ #undef HAVE_HOTPLUG_PLUGIN /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Build replacement libsystemd library support */ #undef HAVE_LIBSYSTEMD /* Define to 1 if you have the header file. */ #undef HAVE_MNTENT_H /* Define to 1 if the modprobe plugin is enabled. */ #undef HAVE_MODPROBE_PLUGIN /* Define to 1 if the modules-load plugin is enabled. */ #undef HAVE_MODULES_LOAD_PLUGIN /* Define to 1 if the netlink plugin is enabled. */ #undef HAVE_NETLINK_PLUGIN /* Define to 1 if the resolvconf plugin is enabled. */ #undef HAVE_RESOLVCONF_PLUGIN /* Define to 1 if the rtc plugin is enabled. */ #undef HAVE_RTC_PLUGIN /* 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 /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSMACROS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if the testserv plugin is enabled. */ #undef HAVE_TESTSERV_PLUGIN /* Define to 1 if the tty plugin is enabled. */ #undef HAVE_TTY_PLUGIN /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the urandom plugin is enabled. */ #undef HAVE_URANDOM_PLUGIN /* Define to 1 if the x11-common plugin is enabled. */ #undef HAVE_X11_COMMON_PLUGIN /* Displayed by Finit at boot, defaults to /etc/os-release PRETTY_NAME */ #undef INIT_OSHEADING /* Dumpster diving after init args from /proc/cmdline */ #undef KERNEL_CMDLINE /* Keep kernel warn/err logs to console */ #undef KERNEL_LOGGING /* Enable built-in rotation of /var/log/wtmp et al. */ #undef LOGROTATE_ENABLED /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Built-in default: $libexecdir/finit */ #undef PLUGIN_HOOK_SCRIPTS_PATH /* Finit plugin path */ #undef PLUGIN_PATH /* Improve random at boot by seeding it with sth from before. */ #undef RANDOMSEED /* Enable redirection of service output to /dev/null */ #undef REDIRECT_OUTPUT /* Finit rescue mode .conf */ #undef RESCUE_CONF /* Define to enable support for rescue mode. */ #undef RESCUE_MODE /* Save and restore system time from this file if /dev/rtc is missing. */ #undef RTC_FILE /* Custom RTC restore date, default: 2000-01-01 00:00 */ #undef RTC_TIMESTAMP_CUSTOM /* Runlevel to start after S */ #undef RUNLEVEL /* Finit sameple.conf for initctl create */ #undef SAMPLE_CONF /* 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. */ #undef STDC_HEADERS /* Built-in sulogin user, default: root */ #undef SULOGIN_USER /* Main tmpfiles.d/, override in /etc */ #undef TMPFILES_PATH_ /* Version number of package */ #undef VERSION /* Built-in watchdog device node */ #undef WDT_DEVNODE /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t finit-4.14/system/0000755000175100001660000000000015054341601007640 5finit-4.14/system/90-testserv.conf0000644000175100001660000000033215054341541012535 # Test service, only used for `make check`, not for public use service [S123456789] name:testserv pid:!/run/testserv.pid \ cgroup.system notify:none \ /sbin/serv -n -p -i testserv -- Test serv daemon finit-4.14/system/10-hotplug.conf.in0000644000175100001660000000713315054341541012743 # System hotplug handled by udev, mdevd, or mdev (preferred order) # # Your system usually has either udevd, mdev, or mdevd. They probe the system # for devices, loading modules and any firmware needed. Since the bootstrap # often needs to be synchronized carefully, we suggest using your system log # daemon as the barrier for all other services. E.g.: # # service if:udevd [S0123456789] syslogd -F -- System log daemon # service if:mdev [S0123456789] syslogd -F -- System log daemon # service if:mdevd [S0123456789] syslogd -F -- System log daemon # # This provdes a condition that can act as a barrier for all # other services. Notice the `if:` statement and the condition for starting # syslogd is only considered if either udevd or mdev (service) is loaded and # is guaranteed to run after each respective run stanza have completed. # # Override this file by copying it to /etc/finit.d/, using the same name, then # change the contents any way you like, it can even be empty. # Check for systemd-udevd and eudev, if we find both, we opt for the latter. service nowarn cgroup.system name:udevd notify:none env:-/etc/default/udevd pid:udevd log \ [S12345789] /lib/systemd/systemd-udevd $UDEVD_ARGS -- Device event daemon (udev) service nowarn cgroup.system name:udevd notify:none env:-/etc/default/udevd pid:udevd log \ [S12345789] udevd $UDEVD_ARGS -- Device event daemon (udev) # Wait for udevd to start, then trigger coldplug events and module loading. # The last 'settle' call waits for it to finalize processing all uevents. run nowarn if:udevd cgroup.init :1 [S] log udevadm settle -t 0 -- run nowarn if:udevd cgroup.init :2 [S] log udevadm control --reload -- run nowarn if:udevd cgroup.init :3 [S] log udevadm trigger -c add -t devices -- Requesting device events run nowarn if:udevd cgroup.init :4 [S] log udevadm trigger -c add -t subsystems -- Requesting subsystem events run nowarn if:udevd cgroup.init :5 [S] log udevadm settle -t 30 -- Waiting for udev to finish # If udevd is not available, check for mdevd. Unlike plain 'mdev -df', the # mdevd-coldplug process exits when mdevd has completed. So the condition # (same as for plain mdev below) can be relied on as a # barrier for services that, e.g., need to probe for switchcore ports or PHYs # that require firmware loading before they show up. service nowarn conflict:udevd,mdev cgroup.init notify:none if:!udevd \ [S12345789] notify:s6 mdevd -O 4 -D %n -- Device event daemon (mdevd) run nowarn conflict:udevd,mdev cgroup.init name:coldplug \ [S] mdevd-coldplug -- Cold plugging system # If neither udevd or mdevd are available, fall back to mdev. The new daemon # mode calls `mdev -s` internally but does not create a PID file when that is # done, so synchronization with coldplug is fragile. service nowarn conflict:udevd,mdevd cgroup.init notify:none if:!udevd,!mdevd \ [S12345789] mdev -df -S -- Device event daemon (mdev) # Trigger a replay of all uevents from boot, before userspace was up and the # filesystem mounted. Compared to udevd, we don't know when 'mdev -df' has # finished processing all events, i.e., depending on is # not an indicator of all devices having been (re)discovered and fully set up. run nowarn conflict:udevd,mdevd cgroup.init name:coldplug if:mdev \ [S] @pkglibexecdir@/coldplug -- Cold plugging system finit-4.14/system/Makefile.in0000644000175100001660000003765415054341567011657 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @BUILD_HOTPLUG_PLUGIN_TRUE@am__append_1 = 10-hotplug.conf @BUILD_TESTSERV_PLUGIN_TRUE@am__append_2 = 90-testserv.conf subdir = system ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_system_DATA_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = 10-hotplug.conf CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_system_DATA_DIST = 90-testserv.conf am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(systemdir)" "$(DESTDIR)$(systemdir)" DATA = $(dist_system_DATA) $(system_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/10-hotplug.conf.in $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ EXTRA_DIST = 10-hotplug.conf.in systemdir = $(system_path) system_DATA = $(am__append_1) dist_system_DATA = $(am__append_2) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign system/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign system/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 10-hotplug.conf: $(top_builddir)/config.status $(srcdir)/10-hotplug.conf.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_systemDATA: $(dist_system_DATA) @$(NORMAL_INSTALL) @list='$(dist_system_DATA)'; test -n "$(systemdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(systemdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(systemdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdir)" || exit $$?; \ done uninstall-dist_systemDATA: @$(NORMAL_UNINSTALL) @list='$(dist_system_DATA)'; test -n "$(systemdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(systemdir)'; $(am__uninstall_files_from_dir) install-systemDATA: $(system_DATA) @$(NORMAL_INSTALL) @list='$(system_DATA)'; test -n "$(systemdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(systemdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(systemdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdir)" || exit $$?; \ done uninstall-systemDATA: @$(NORMAL_UNINSTALL) @list='$(system_DATA)'; test -n "$(systemdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(systemdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(systemdir)" "$(DESTDIR)$(systemdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_systemDATA install-systemDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_systemDATA uninstall-systemDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_systemDATA 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-strip \ install-systemDATA installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-dist_systemDATA \ uninstall-systemDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/system/Makefile.am0000644000175100001660000000037215054341541011621 EXTRA_DIST = 10-hotplug.conf.in systemdir = $(system_path) system_DATA = dist_system_DATA = if BUILD_HOTPLUG_PLUGIN system_DATA += 10-hotplug.conf endif if BUILD_TESTSERV_PLUGIN dist_system_DATA += 90-testserv.conf endif finit-4.14/configure.ac0000644000175100001660000004443315054341541010535 AC_INIT([Finit], [4.14], [https://github.com/troglobit/finit/issues], [finit], [https://troglobit.com/projects/finit/]) AC_CONFIG_AUX_DIR(aux) AM_INIT_AUTOMAKE([1.11 foreign subdir-objects]) AM_SILENT_RULES([yes]) AC_CONFIG_SRCDIR([src/finit.c]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile contrib/Makefile contrib/alpine/Makefile contrib/alpine/finit.d/Makefile contrib/alpine/finit.d/available/Makefile contrib/debian/Makefile contrib/debian/finit.d/Makefile contrib/debian/finit.d/available/Makefile contrib/void/Makefile contrib/void/finit.d/Makefile contrib/void/finit.d/available/Makefile doc/Makefile doc/config/Makefile libsystemd/Makefile libsystemd/libsystemd.pc man/Makefile plugins/Makefile src/Makefile system/Makefile system/10-hotplug.conf test/test.env test/Makefile test/lib/Makefile test/src/Makefile tmpfiles.d/Makefile]) # Older versions of autoconf (<2.58) do not have AC_CONFIG_MACRO_DIR() #m4_include([m4/plugin.m4]) #m4_include([m4/expand.m4]) AC_CONFIG_MACRO_DIR([m4]) # Handle building plugins either as dynamically loadable, or built-in LT_INIT([shared disable-static dlopen aix-soname=both disable-fast-install]) # Checks for programs. AC_PROG_CC AC_PROG_LN_S AC_PROG_INSTALL AC_PROG_MKDIR_P # Configuration. AC_CHECK_HEADERS([termios.h sys/ioctl.h mntent.h sys/sysmacros.h]) AC_CHECK_FUNCS([strstr getopt getmntent getmntent_r]) # Check for uint[8,16,32]_t AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T # Check for pkg-config first, warn if it's not installed PKG_PROG_PKG_CONFIG # Check for required libraries PKG_CHECK_MODULES([uev], [libuev >= 2.2.0]) PKG_CHECK_MODULES([lite], [libite >= 2.2.0]) # Check for configured Finit features AC_ARG_ENABLE(auto_reload, AS_HELP_STRING([--enable-auto-reload], [Automatic reload on any .conf change]),,[ enable_auto_reload=no]) AC_ARG_ENABLE(kernel_cmdline, AS_HELP_STRING([--enable-kernel-cmdline], [Parse init args from /proc/cmdline (don't use!)]),,[ enable_kernel_cmdline=no]) AC_ARG_ENABLE(fastboot, AS_HELP_STRING([--enable-fastboot], [Skip fsck check on filesystems listed in /etc/fstab]),,[ enable_fastboot=no]) AC_ARG_ENABLE(fsckfix, AS_HELP_STRING([--enable-fsckfix], [Run fsck fix mode (options: -yf) on filesystems listed in /etc/fstab]),,[ enable_fsckfix=no]) AC_ARG_ENABLE(cgroup, AS_HELP_STRING([--disable-cgroup], [Disable cgroup v2 support, default: autodetect from /sys/fs/cgroup]),,[ enable_cgroup=yes]) AC_ARG_ENABLE(redirect, AS_HELP_STRING([--disable-redirect], [Disable redirection of service output to /dev/null]),,[ enable_redirect=yes]) AC_ARG_ENABLE(kernel_logging, AS_HELP_STRING([--disable-kernel-logging], [Disable kernel logging to console (use 'quiet' instead!]),,[ enable_kernel_logging=yes]) AC_ARG_ENABLE(logrotate, AS_HELP_STRING([--disable-logrotate], [Disable built-in rotation of /var/log/wtmp]),,[ enable_logrotate=yes]) AC_ARG_ENABLE(doc, AS_HELP_STRING([--disable-doc], [Disable build and install of doc/ section]),,[ enable_doc=yes]) AC_ARG_ENABLE(contrib, AS_HELP_STRING([--disable-contrib], [Disable build and install of contrib section]),,[ enable_contrib=yes]) AC_ARG_ENABLE([rescue], AS_HELP_STRING([--disable-rescue], [Disable potentially unsafe rescue mode]),, [enable_rescue=yes]) # Check for extra plugins to enable AC_ARG_ENABLE(all_plugins, AS_HELP_STRING([--enable-all-plugins], [Enable all plugins, default: auto]), enable_all_plugins=$enableval, enable_all_plugins=auto) AC_PLUGIN([alsa-utils], [no], [Save and restore ALSA sound settings using alsactl]) AC_PLUGIN([dbus], [no], [Setup and start system message bus, D-Bus]) AC_PLUGIN([modules-load], [no], [Scans /etc/modules-load.d for modules to load]) AC_PLUGIN([modprobe], [no], [Coldplug modules using modalias magic]) AC_PLUGIN([resolvconf], [no], [Setup necessary files for resolvconf]) AC_PLUGIN([x11-common], [no], [Console setup (for X)]) AC_PLUGIN([netlink], [yes], [Basic netlink plugin for IFUP/IFDN and GW events. Can be replaced with externally built plugin that links with libnl or similar.]) AC_PLUGIN([hook-scripts], [no], [Trigger script execution from hook points]) AC_PLUGIN([hotplug], [yes], [Start udevd or mdev kernel event datamon]) AC_PLUGIN([rtc], [yes], [Save and restore RTC using hwclock]) AC_PLUGIN([tty], [yes], [Automatically activate new TTYs, e.g. USB-to-serial]) AC_PLUGIN([urandom], [yes], [Setup and save random seed at boot/shutdown]) AC_PLUGIN([testserv], [no], [Test plugin to start test serv daemon]) # Check for extra arguments or packages AC_ARG_WITH([bash-completion-dir], AS_HELP_STRING([--with-bash-completion-dir[=PATH]], [Directory to install Bash completion, default: auto]), [bash_dir=$withval], [bash_dir=yes]) AC_ARG_WITH(fstab, AS_HELP_STRING([--with-fstab=FILE], [System default fstab, default $sysconfdir/fstab]), [fstab=$withval], [fstab=yes]) AC_ARG_WITH(heading, AS_HELP_STRING([--with-heading=GREET], [Heading for boot progress. Default: PRETTY_NAME from /etc/os-release, fallback to "Finit vX.YY"]), [heading=$withval], [heading=yes]) AC_ARG_WITH(config, AS_HELP_STRING([--with-config=CONFIG], [Finit bootstrap config file, default /etc/finit.conf]), [conf=$withval], [conf=yes]) AC_ARG_WITH(rcsd, AS_HELP_STRING([--with-rcsd=DIR], [Finit rcS.d/ directory, default /etc/finit.d]), [rcsd=$withval], [rcsd=yes]) AC_ARG_WITH(rc-local, AS_HELP_STRING([--with-rc-local=FILE], [SysV init /etc/rc.local file, default /etc/rc.local]), [rclocal=$withval], [rclocal=yes]) AC_ARG_WITH(sysconfig, AS_HELP_STRING([--with-sysconfig=DIR], [System environment directory, sourced by .conf files, default /etc/default & /etc/conf.d]), [sysconfig=$withval], [sysconfig=default]) AC_ARG_WITH(group, AS_HELP_STRING([--with-group=NAME], [Group for /run/finit/socket (initctl), default: root]), [group=$withval], [group=root]) AC_ARG_WITH(hostname, AS_HELP_STRING([--with-hostname=NAME], [If /etc/hostname is missing, default: noname]), [hostname=$withval], [hostname=yes]) AC_ARG_WITH(runlevel, AS_HELP_STRING([--with-runlevel=N], [Runlevel to switch to after bootstrap [1-9], default: 2]), [runlevel=$withval], [runlevel=yes]) AC_ARG_WITH(random-seed, AS_HELP_STRING([--with-random-seed=FILE], [Save a random seed for /dev/urandom across reboots, default /var/lib/misc/random-seed]), [random_seed=$withval], [random_seed=yes]) AC_ARG_WITH(keventd, AS_HELP_STRING([--with-keventd], [Enable built-in keventd, default: no]),, [with_keventd=no]) AC_ARG_WITH(sulogin, AS_HELP_STRING([--with-sulogin@<:@=USER@:>@], [Enable built-in sulogin, optional USER to request password for (default root), default: no.]),[sulogin=$withval],[with_sulogin=no]) AC_ARG_WITH(watchdog, AS_HELP_STRING([--with-watchdog@<:@=DEV@:>@], [Enable built-in watchdog, default: /dev/watchdog]), [watchdog=$withval], [with_watchdog=no watchdog=]) AC_ARG_WITH(libsystemd, AS_HELP_STRING([--with-libsystemd], [Build replacement libsystemd library, default: yes]), [with_libsystemd=$withval], [with_libsystemd=no]) AC_ARG_WITH(hook-scripts-path, AS_HELP_STRING([--with-hook-scripts-path=DIR], [Base directory for hook scripts, default $libexecdir/finit/hook]), [hook_scripts_path=$withval], [hook_scripts_path=yes]) AC_ARG_WITH(plugin-path, AS_HELP_STRING([--with-plugin-path=DIR], [Search path for external plugins, default /usr/lib/finit/plugins:/usr/local/lib/finit/plugins]), [plugin_path=$withval], [plugin_path=yes]) AC_ARG_WITH(rtc-date, AS_HELP_STRING([--with-rtc-date=DATE], [If RTC date/time is too old, restore to DATE, format "YYYY-MM-DD HH:MM:SS", default "2000-01-01 00:00:00"]), [rtc_date=$withval], [rtc_date=no]) AC_ARG_WITH(rtc-file, AS_HELP_STRING([--with-rtc-file=FILE], [If RTC is missing, save and restore system clock from this file, default: no]), [rtc_file=$withval], [rtc_file=no]) ### Enable features ########################################################################### # Create config.h from selected features and fallback defaults AS_IF([test "x$enable_auto_reload" = "xyes"], [ AC_DEFINE(AUTO_RELOAD, 1, [Finit automatically does `initctl reload` on any .conf change])]) AS_IF([test "x$enable_kernel_cmdline" = "xyes"], [ AC_DEFINE(KERNEL_CMDLINE, 1, [Dumpster diving after init args from /proc/cmdline])]) AS_IF([test "x$enable_kernel_logging" = "xyes"], [ AC_DEFINE(KERNEL_LOGGING, 1, [Keep kernel warn/err logs to console])]) AS_IF([test "x$enable_cgroup" = "xyes"], [ AC_DEFINE(CGROUP2_ENABLED, 1, [Autodetect cgroup v2 support from /sys/fs/cgroup])]) AS_IF([test "x$enable_fastboot" = "xyes"], [ AC_DEFINE(FAST_BOOT, 1, [Skip fsck check on filesystems listed in /etc/fstab])]) AS_IF([test "x$enable_fsckfix" = "xyes"], [ AC_DEFINE(FSCK_FIX, 1, [Run fsck fix mode (options: -yf) on filesystems listed in /etc/fstab])]) AS_IF([test "x$enable_redirect" = "xyes"], [ AC_DEFINE(REDIRECT_OUTPUT, 1, [Enable redirection of service output to /dev/null])]) ### Disable features ########################################################################### AS_IF([test "x$enable_logrotate" != "xno"], [ AC_DEFINE(LOGROTATE_ENABLED, 1, [Enable built-in rotation of /var/log/wtmp et al.])]) AS_IF([test "x$enable_rescue" != "xno"], [ AC_DEFINE([RESCUE_MODE], 1, [Define to enable support for rescue mode.])]) AM_CONDITIONAL(LOGROTATE, [test "x$enable_logrotate" = "xyes"]) ### With features ############################################################################## AS_IF([test "x$bash_dir" = "xyes"], [ PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [BASH_DIR="$(pkg-config --variable=completionsdir bash-completion)"], [BASH_DIR="$datadir/bash-completion/completions"])], [ BASH_DIR="$bash_dir"]) AS_IF([test "x$with_fstab" != "xno"], [ AS_IF([test "x$fstab" = "xyes"], [fstab=$sysconfdir/fstab]) AC_EXPAND_DIR(fstab_path, "$fstab") AC_DEFINE_UNQUOTED(FINIT_FSTAB, "$fstab_path", [Built-in default: /etc/fstab])],[ AC_DEFINE_UNQUOTED(FINIT_FSTAB, NULL, [No built-in default fstab])]) AS_IF([test "x$with_config" != "xno"], [ AS_IF([test "x$conf" = "xyes"], [ conf=$sysconfdir/finit.conf])]) AC_EXPAND_DIR(conf_path, "$conf") AC_DEFINE_UNQUOTED(FINIT_CONF, "$conf_path", [Main Finit configuration file, default /etc/finit.conf]) AC_SUBST(FINIT_CONF, "$conf_path") AS_IF([test "x$with_rcsd" != "xno"], [ AS_IF([test "x$rcsd" = "xyes"], [ rcsd=$sysconfdir/finit.d])]) AC_EXPAND_DIR(rcsd_path, "$rcsd") AC_DEFINE_UNQUOTED(FINIT_RCSD, "$rcsd_path", [Finit rcS.d/, default /etc/finit.d]) AC_SUBST(FINIT_RCSD, "$rcsd_path") AS_IF([test "x$with_rc_local" != "xno"], [ AS_IF([test "x$rclocal" = "xyes"], [rclocal=$sysconfdir/rc.local]) AC_EXPAND_DIR(rclocal_path, "$rclocal") AC_DEFINE_UNQUOTED(FINIT_RC_LOCAL, "$rclocal_path", [Compat SysV /etc/rc.local file to run last at boot.])]) AS_IF([test "x$with_sysconfig" != "xno"], [ AS_IF([test "x$sysconfig" != "xdefault"], [ AC_EXPAND_DIR(sysconfig_path, "$sysconfig") AC_DEFINE_UNQUOTED(FINIT_SYSCONFIG, "$sysconfig_path", [System environment, default /etc/default & /etc/conf.d])])]) AS_IF([test "x$with_heading" != "xno"], [ AS_IF([test "x$heading" = "xyes"], [heading=""]) AC_DEFINE_UNQUOTED(INIT_OSHEADING, "$heading", [Displayed by Finit at boot, defaults to /etc/os-release PRETTY_NAME])]) AS_IF([test "x$with_group" != "xno"], [ AS_IF([test "x$group" = "xyes"], [ group=root])]) AC_DEFINE_UNQUOTED(DEFGROUP, "$group", [For /run/finit/socket]) AS_IF([test "x$with_hostname" != "xno"], [ AS_IF([test "x$hostname" = "xyes"], [ hostname=noname])]) AC_DEFINE_UNQUOTED(DEFHOST, "$hostname", [For /etc/hostname]) AS_IF([test "x$with_runlevel" != "xno"], [ AS_IF([test "x$runlevel" = "xyes"], [ runlevel=2 AC_DEFINE_UNQUOTED(RUNLEVEL, $runlevel, [Default runlevel to start after S])]) AC_DEFINE_UNQUOTED(RUNLEVEL, $runlevel, [Runlevel to start after S])]) AS_IF([test "x$with_random_seed" != "xno"], [ AS_IF([test "x$random_seed" = "xyes"], [ random_seed=/var/lib/misc/random-seed]) AC_EXPAND_DIR(random_path, "$random_seed") AC_DEFINE_UNQUOTED(RANDOMSEED, "$random_path", [Improve random at boot by seeding it with sth from before.])]) AS_IF([test "x$rtc_date" != "xno"], [ AC_DEFINE_UNQUOTED(RTC_TIMESTAMP_CUSTOM, "$rtc_date", [Custom RTC restore date, default: 2000-01-01 00:00])], [ rtc_date=""]) AS_IF([test "x$rtc_file" != "xno"], [ AS_IF([test "x$rtc_file" = "xyes"], [ rtc_file=/var/lib/misc/rtc]) AC_EXPAND_DIR(rtcfile_path, "$rtc_file") AC_DEFINE_UNQUOTED(RTC_FILE, "$rtcfile_path", [Save and restore system time from this file if /dev/rtc is missing.])],[ AC_DEFINE_UNQUOTED(RTC_FILE, NULL)]) AS_IF([test "x$with_keventd" != "xno"], [with_keventd=yes]) AS_IF([test "x$with_sulogin" != "xno"], [ AS_IF([test "x$sulogin" = "xyes"], [ sulogin=root]) with_sulogin=yes AC_DEFINE_UNQUOTED(SULOGIN_USER, "$sulogin", [Built-in sulogin user, default: root])], [ sulogin=]) AS_IF([test "x$with_watchdog" != "xno"], [ AS_IF([test "x$watchdog" = "xyes"], [ watchdog=/dev/watchdog]) with_watchdog=yes AC_DEFINE_UNQUOTED(WDT_DEVNODE, "$watchdog", [Built-in watchdog device node])], [ watchdog=]) AS_IF([test "x$with_libsystemd" != "xno"], [ AC_DEFINE(HAVE_LIBSYSTEMD, 1, [Build replacement libsystemd library support])]) AS_IF([test "x$enable_hook_scripts_plugin" != "xno"], [ AS_IF([test "x$hook_scripts_path" = "xyes"], [hook_scripts_path=$libexecdir/finit/hook]) AC_EXPAND_DIR(hook_scripts_path, "$hook_scripts_path") AC_DEFINE_UNQUOTED(PLUGIN_HOOK_SCRIPTS_PATH, "$hook_scripts_path", [Built-in default: $libexecdir/finit])]) AS_IF([test "x$with_plugin_path" != "xno"], [ AS_IF([test "x$plugin_path" = "xyes"], [plugin_path=/usr/lib/finit/plugins:/usr/local/lib/finit/plugins]) AC_EXPAND_DIR(plugin_path, "$plugin_path") AC_DEFINE_UNQUOTED(EXTERNAL_PLUGIN_PATH, "$plugin_path", [Built-in default: /usr/lib/finit/plugins:/usr/local/lib/finit/plugins])]) # Control build with automake flags AM_CONDITIONAL(BASH, [test "x$bash_dir" != "xno"]) AM_CONDITIONAL(STATIC, [test "x$enable_static" = "xyes"]) AM_CONDITIONAL(KEVENTD, [test "x$with_keventd" != "xno"]) AM_CONDITIONAL(SULOGIN, [test "x$with_sulogin" != "xno"]) AM_CONDITIONAL(WATCHDOGD, [test "x$with_watchdog" != "xno"]) AM_CONDITIONAL(LIBSYSTEMD, [test "x$with_libsystemd" != "xno"]) AM_CONDITIONAL(DOC, [test "x$enable_doc" = "xyes"]) AM_CONDITIONAL(CONTRIB, [test "x$enable_contrib" = "xyes"]) AM_CONDITIONAL(TESTSERV, [test "x$enable_testserv_plugin" = "xyes"]) # Workaround for as-of-yet unreleased runstatedir support, planned for # autoconf 2.70, which some major distros have backported. AS_IF([test -z "$runstatedir"], runstatedir="$localstatedir/run") AC_SUBST(runstatedir) # Override default libdir, used for plugins and rescue.conf pkglibdir=$libdir/finit AC_SUBST(pkglibexecdir) AC_EXPAND_DIR(pkglibexecdir, "$libexecdir/finit") AC_DEFINE_UNQUOTED(FINIT_EXECPATH_, "$pkglibexecdir", [Finit libexec path]) AC_EXPAND_DIR(finit_runpath, "$runstatedir/finit/system") AC_DEFINE_UNQUOTED(FINIT_RUNPATH_, "$finit_runpath", [Finit runtime dynamic system services]) AC_EXPAND_DIR(plugin_path, "$pkglibdir/plugins") AC_SUBST(plugin_path) AC_DEFINE_UNQUOTED(PLUGIN_PATH, "$plugin_path", [Finit plugin path]) AC_EXPAND_DIR(tmpfiles_path, "$libdir/tmpfiles.d") AC_SUBST(tmpfiles_path) AC_DEFINE_UNQUOTED(TMPFILES_PATH_, "$tmpfiles_path", [Main tmpfiles.d/, override in /etc]) AC_EXPAND_DIR(finit_tmpfiles, "$pkglibdir/tmpfiles.d") AC_SUBST(finit_tmpfiles) AC_DEFINE_UNQUOTED(FINIT_TMPFILES, "$finit_tmpfiles", [Finit tmpfiles.d/ .conf path]) AC_EXPAND_DIR(system_path, "$pkglibdir/system") AC_SUBST(system_path) AC_DEFINE_UNQUOTED(FINIT_SYSPATH_, "$system_path", [Static services, previously generated at runtime by plugins]) AC_EXPAND_DIR(rescue_conf, "$pkglibdir/rescue.conf") AC_DEFINE_UNQUOTED(RESCUE_CONF, "$rescue_conf", [Finit rescue mode .conf]) AC_EXPAND_DIR(sample_conf, "$pkglibdir/sample.conf") AC_DEFINE_UNQUOTED(SAMPLE_CONF, "$sample_conf", [Finit sameple.conf for initctl create]) AC_EXPAND_DIR(bash_completion_dir, "$BASH_DIR") AC_SUBST(BASH_DIR, "$bash_completion_dir") AS_IF([test "$heading" = ""], [heading=""]) AS_IF([test "$heading" = "no"], [heading=""]) RTC_DATE=$rtc_date AS_IF([test "$rtc_date" = ""], [RTC_DATE=""]) AS_IF([test "$rtc_date" = "no"], [RTC_DATE=""]) # Generate all files AC_OUTPUT cat < [!TIP] > As of Finit v4.4, `.conf` lines can be broken up using the standard UNIX > continuation character (`\`), trailing comments are also supported. The > latter means you must escape any hashes used in directives and descriptions > (`\#`). For more on this and examples, see the [finit.conf(5)][] manual or > the [Configuration](config/index.md) section. ```ApacheConf # Fallback if /etc/hostname is missing host default # Runlevel to start after bootstrap, 'S', default: 2 #runlevel 2 # Support for setting global environment variables, using foo=bar syntax # be careful though with variables like PATH, SHELL, LOGNAME, etc. #PATH=/usr/bin:/bin:/usr/sbin:/sbin # Max file size for each log file: 100 kiB, rotate max 4 copies: # log => log.1 => log.2.gz => log.3.gz => log.4.gz log size=100k count=4 # Services to be monitored and respawned as needed service [S12345] env:-/etc/conf.d/watchdog watchdog $WATCHDOG_OPTS $WATCHDOG_DEV -- System watchdog daemon service [S12345] env:-/etc/conf.d/syslog syslogd -n $SYSLOGD_OPTS -- System log daemon service [S12345] env:-/etc/conf.d/klogd klogd -n $KLOGD_OPTS -- Kernel log daemon service [2345] env:-/etc/conf.d/lldpd lldpd -d $LLDPD_OPTS -- LLDP daemon (IEEE 802.1ab) # The BusyBox ntpd does not use syslog when running in the foreground # So we use this trick to redirect stdout/stderr to a log file. The # log file is rotated with the above settings. The condition declares # a dependency on a system default route (gateway) to be set. A single # at the beginning means ntpd does not respect SIGHUP for restart. service [2345] log:/var/log/ntpd.log ntpd -n -l -I eth0 -- NTP daemon # For multiple instances of the same service, add :ID somewhere between # the service/run/task keyword and the command. service :80 [2345] merecat -n -p 80 /var/www -- Web server service :8080 [2345] merecat -n -p 8080 /var/www -- Old web server # Alternative method instead of below runparts, can also use /etc/rc.local #sysv [S] /etc/init.d/keyboard-setup -- Setting up preliminary keymap #sysv [S] /etc/init.d/acpid -- Starting ACPI Daemon #task [S] /etc/init.d/kbd -- Preparing console # Hidden from boot progress, using empty `--` description #sysv [S] /etc/init.d/keyboard-setup -- #sysv [S] /etc/init.d/acpid -- #task [S] /etc/init.d/kbd -- # Run start scripts from this directory # runparts /etc/start.d # Virtual consoles run BusyBox getty, keep kernel default speed tty [12345] /sbin/getty -L 0 /dev/tty1 linux nowait noclear tty [2345] /sbin/getty -L 0 /dev/tty2 linux nowait noclear tty [2345] /sbin/getty -L 0 /dev/tty3 linux nowait noclear # Use built-in getty for serial port and USB serial #tty [12345] /dev/ttyAMA0 noclear nowait #tty [12345] /dev/ttyUSB0 noclear # Just give me a shell, I need to debug this embedded system! #tty [12345] console noclear nologin ``` The `service` stanza, as well as `task`, `run` and others are described in full in the [Services Syntax](config/services.md) section. Here's a quick overview of some of the most common components needed to start a UNIX daemon: ``` service [LVLS] log env:[-]/etc/default/daemon daemon ARGS -- Example daemon ^ ^ ^ ^ ^ ^ ^ ^ | | | | | | | `---------- Optional description | | | | | | `------------------ Daemon arguments | | | | | `------------------------- Path to daemon | | | | `---------------------------------------------------- Optional env. file | | | `-------------------------------------------------------- Redirect output to log | | `--------------------------------------------------------------- Optional conditions | `---------------------------------------------------------------------- Optional Runlevels `------------------------------------------------------------------------------ Supervised program (daemon) ``` Some components are optional: runlevel(s), condition(s) and description, making it easy to create simple start scripts and still possible for more advanced uses as well: service /usr/sbin/sshd -D Dependencies are handled using [conditions](conditions.md). One of the most common conditions is to wait for basic networking to become available: service nginx -- High performance HTTP server Here is another example where we instruct Finit to not start BusyBox `ntpd` until `syslogd` has started properly. Finit waits for `syslogd` to create its PID file, by default `/var/run/syslogd.pid`. service [2345] log ntpd -n -N -p pool.ntp.org service [S12345] syslogd -n -- Syslog daemon Notice the `log` keyword, BusyBox `ntpd` uses `stderr` for logging when run in the foreground. With `log` Finit redirects `stdout` + `stderr` to the system log daemon using the command line `logger(1)` tool. A service, or task, can have multiple dependencies listed. Here we wait for *both* `syslogd` to have started and basic networking to be up: service [2345] log ntpd -n -N -p pool.ntp.org If either condition fails, e.g. loss of networking, `ntpd` is stopped and as soon as it comes back up again `ntpd` is restarted automatically. > [!NOTE] > Make sure daemons do *not* fork and detach themselves from the controlling > TTY, usually an `-n` or `-f` flag, or `-D` as in the case of OpenSSH above. > If it detaches itself, Finit cannot monitor it and will instead try to > restart it. [finit.conf(5)]: https://man.troglobit.com/man5/finit.conf.5.html [infix]: https://kernelkit.github.io [myLinux]: https://github.com/troglobit/myLinux/ [contrib]: https://github.com/troglobit/finit/tree/master/contrib finit-4.14/doc/README.md0000644000175100001660000000655415054341541010275 Introduction ============ ![Alpine screenshot](img/alpine-screenshot2.png){ align=right } > Reverse engineered from the [EeePC fastinit][] > "gaps filled with frog DNA …" > — [Claudio Matsuoka][] Finit is a process starter and [supervisor][1] designed to run as PID 1 on Linux systems. It consists of a set of [plugins](plugins.md) and can be set up using [configuration files](config/files.md). Plugins start at [hook points](plugins.md#hooks) and can run various set up tasks and/or install event handlers that later provide runtime services, e.g., PID file monitoring, or [conditions](conditions.md). Features -------- * [Runlevels][5], defined per service * One-shot tasks, services (daemons), or [SysV init][4] start/stop scripts * Runparts and `/etc/rc.local` support * Process supervision similar to [systemd][] * Sourcing environment files * Conditions for network/process/custom dependencies * Readiness notification; PID files (native) for synchronizing system startup, support for systemd [sd_notify()][], or [s6 style][] too * Limited support for [tmpfiles.d(5)][] (no aging, attributes, or subvolumes) * Pre/Post script actions * Rudimentary [templating support](config/templating.md) * Tooling to enable/disable services * Built-in getty * Built-in watchdog, with support for hand-over to [watchdogd][] * Built-in support for Debian/BusyBox [`/etc/network/interfaces`][3] * Cgroups v2, both configuration and monitoring in `initctl top` * Plugin support for customization * Proper rescue mode with bundled `sulogin` for protected maintenance shell * Integration with [watchdogd][] for full system supervision * Logging to kernel ring buffer before `syslogd` has started, see the recommended [sysklogd][] project for complete logging integration and how to log to the kernel ring buffer from scripts using `logger` For a more thorough overview, see the [Features](features.md) section. > [!TIP] > See [SysV Init Compatibility](config/sysv.md) for help to > quickly get going with an existing SysV or BusyBox init setup. Origin ------ This project is based on the [original finit][] by [Claudio Matsuoka][] which was reverse engineered from syscalls of the [EeePC fastinit][]. Finit is developed and maintained by [Joachim Wiberg][] at [GitHub][6]. Please file bug reports, clone it, or send pull requests for bug fixes and proposed extensions. [1]: https://en.wikipedia.org/wiki/Process_supervision [3]: https://manpages.debian.org/unstable/ifupdown2/interfaces.5.en.html [4]: https://en.wikipedia.org/wiki/Init [5]: https://en.wikipedia.org/wiki/Runlevel [6]: https://github.com/troglobit/finit [systemd]: https://www.freedesktop.org/wiki/Software/systemd/ [sd_notify()]: https://www.freedesktop.org/software/systemd/man/sd_notify.html [s6 style]: https://skarnet.org/software/s6/notifywhenup.html [tmpfiles.d(5)]: https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html [EeePC fastinit]: https://web.archive.org/web/20071208212450/http://wiki.eeeuser.com/boot_process:the_boot_process [original finit]: http://helllabs.org/finit/ [Claudio Matsuoka]: https://github.com/cmatsuoka [Joachim Wiberg]: https://troglobit.com [watchdogd]: https://troglobit.com/watchdogd.html [sysklogd]: https://github.com/troglobit/sysklogd/ finit-4.14/doc/cmdline.md0000644000175100001660000001253115054341541010743 Tips & Tricks with the kernel cmdline ===================================== This document summarizes the different boot parameters that can be passed on the Linux kernel command line. Not limited to Finit. > [!IMPORTANT] > Remember to use `--` to separate kernel parameters from parameters to > init. E.g., `init=/sbin/finit -- finit.debug rescue` The `bool` setting is one of `on, off, true false, 1, 0`. * `debug`: Enable kernel debug. Debug messages are printed to the console until Finit starts up, unless `loglevel=7` (below) is used. * `fsck.mode=`, default: `auto`, unless built with `configure --enable-fastboot`, in which case the default is `skip` * `fsck.repair=`, default: `preen`, unless built with `configure --enable-fsckfix`, in which case the default is `yes`. This configure option also sets `fsck.mode=force`, unless fastboot is selected at the same time. I.e., the `--enable-fastboot` build option overrides the `fsck.mode` default value. * `finit.cond=foo[,bar[,baz]]`: set `` condition, optionally multiple conditions can be set using the same option, separated with a comma. Alternatively, multiple `foo.cond=arg` can be given. Each will result in a `` condition being set to control the rest of the system bootstrap. Very useful for selecting different boot modes, e.g. manufacturing test, firmware upgrade, or [rescue mode][rescue]. > [!NOTE] > `` conditions cannot be cleared with `initctl`! * `finit.config=/path/to/alternative/finit.conf`: override the compile-time bootstrap config file, default: ./configure --with-config=/etc/finit.conf Useful when starting up in various [rescue mode][rescue], factory, or production test setups. Use the top-level configuration file directive `rcsd /path/to/finit.d` to override the default rcS.d directory. * `finit.debug[=bool]`: Enable finit debug. This is operated independently of the kernel `debug` setting. New as of Finit v4. * `finit.fstab=`: Tell Finit to use an alternate `fstab` to mount the file system from. Remember, this file must be on the `root=...` file system provided to Finit from the kernel. By default the built-in fstab is used, which itself defaults to `/etc/fstab`, but can be changed at build time with: ./configure --with-fstab=/path/to/fstab It is even possible to disable a built-in default using: ./configure --without-fstab Making `finit.fstab=/path/to/fstab` a *mandatory* command line option. Note, if the command line fstab is missing, Finit falls back to the built-in fstab, and if both are missing, the system treats this as a bad `fsck` and thus calls `sulogin`. If, in turn, `sulogin` is not available on the system, Finit calls reboot, which is also what will happen when a user exits from `sulogin`. * `finit.status[=bool]`: Control finit boot progress, including banner. (Used to be `finit.show_status`, which works but is deprecated.) * `finit.status_style=`: Set Finit boot progress style, when enabled. * `init=/bin/sh`: Bypass system default init and tell kernel to start a shell. Note, this shell is very limited and does not support signals and has no job control. Recommend using, and modifying, [`rescue` mode][rescue] instead. * `loglevel=<0-7>`, sets the kernel's log level, which is more granular than `debug`. Also, when `loglevel=7`, Finit will *not disable* kernel logs to the console. This is very useful when debugging the kernel at system bring-up. Since `loglevel=7` is the same as `debug` this means you have to use `quiet` for a quiet boot, until sysklogd takes over logging of kernel events. * `panic=SEC`: By default the kernel does not reboot after a kernel panic. This setting will cause a kernel reboot after SEC seconds. * `quiet`: Suppress kernel logging to console, except for warnings and errors. Also, see `loglevel` and `quiet` above. * `rescue`: Start [rescue/maintenance mode][rescue]. If your system comes with the bundled `sulogin` program (Finit, or from util-linux, or Busybox), you will be given a root login to a maintenance shell. However, if `sulogin` is missing, the file `/lib/finit/rescue.conf` is read and the system booted in a limited fallback mode. This option can be disabled with `configure --without-rescue` **Note:** in this mode `initctl` will not work. Correct the problem and use `reboot -f` to force reboot. * `single`, or `S`: Overrides the configured runlevel (default: 2) to go to after bootstrap by forcing it to runlevel 1, this is also known as single user mode. Useful to debug startup problems. All services and TTYs in `[1]` will be started, so a `tty [1] @console nologin` configuration presents you with a root console without login. * `1-9`, except `6`: override the configured `runlevel`. Like the `S` and `rescue`, giving a single number on the kernel command line tells Finit to ignore any `runlevel` in `/etc/finit.conf` as well as the configure fallback `--with-runlevel=N` setting. Remember, `6` is the reboot runlevel and is not permitted. Any other values are ignored. For more on kernel boot parameters, see the man page [bootparam(7)][]. [rescue]: config/rescue.md [bootparam(7)]: https://www.man7.org/linux/man-pages/man7/bootparam.7.html finit-4.14/doc/state-machine.md0000644000175100001660000000223715054341541012054 State Machine ============= A service is bound to a state machine that is in one of ten states. For run/tasks there is an additional end state called `DONE`. All processes managed by Finit start in the `HALTED` state. The image shows how both conditions and commands drive the machine. ![The service state machine](img/svc-machine.png "The service state machine") The current state depends on the two following conditions: * `E`: Service enabled. In order for `E` to be satisfied, the service must be allowed to run in the current runlevel and not be stopped. A service may be stopped, or blocked, for several reasons: - The user has manually stopped the service using `initctl stop NAME` - The program exits immediately. I.e. keeps crashing (make sure to use the 'run this service in the foreground' command line option) - The binary is missing in the filesystem * `C`: Service conditions are satisfied: - `on` (+): The condition is asserted. - `off` (-): The condition is deasserted. - `flux` (~): The condition state is unknown. For a detailed description of conditions, and how to debug them, see the [Finit Conditions](conditions.md) document. finit-4.14/doc/index.md0000644000175100001660000000655415054341541010447 Introduction ============ ![Alpine screenshot](img/alpine-screenshot2.png){ align=right } > Reverse engineered from the [EeePC fastinit][] > "gaps filled with frog DNA …" > — [Claudio Matsuoka][] Finit is a process starter and [supervisor][1] designed to run as PID 1 on Linux systems. It consists of a set of [plugins](plugins.md) and can be set up using [configuration files](config/files.md). Plugins start at [hook points](plugins.md#hooks) and can run various set up tasks and/or install event handlers that later provide runtime services, e.g., PID file monitoring, or [conditions](conditions.md). Features -------- * [Runlevels][5], defined per service * One-shot tasks, services (daemons), or [SysV init][4] start/stop scripts * Runparts and `/etc/rc.local` support * Process supervision similar to [systemd][] * Sourcing environment files * Conditions for network/process/custom dependencies * Readiness notification; PID files (native) for synchronizing system startup, support for systemd [sd_notify()][], or [s6 style][] too * Limited support for [tmpfiles.d(5)][] (no aging, attributes, or subvolumes) * Pre/Post script actions * Rudimentary [templating support](config/templating.md) * Tooling to enable/disable services * Built-in getty * Built-in watchdog, with support for hand-over to [watchdogd][] * Built-in support for Debian/BusyBox [`/etc/network/interfaces`][3] * Cgroups v2, both configuration and monitoring in `initctl top` * Plugin support for customization * Proper rescue mode with bundled `sulogin` for protected maintenance shell * Integration with [watchdogd][] for full system supervision * Logging to kernel ring buffer before `syslogd` has started, see the recommended [sysklogd][] project for complete logging integration and how to log to the kernel ring buffer from scripts using `logger` For a more thorough overview, see the [Features](features.md) section. > [!TIP] > See [SysV Init Compatibility](config/sysv.md) for help to > quickly get going with an existing SysV or BusyBox init setup. Origin ------ This project is based on the [original finit][] by [Claudio Matsuoka][] which was reverse engineered from syscalls of the [EeePC fastinit][]. Finit is developed and maintained by [Joachim Wiberg][] at [GitHub][6]. Please file bug reports, clone it, or send pull requests for bug fixes and proposed extensions. [1]: https://en.wikipedia.org/wiki/Process_supervision [3]: https://manpages.debian.org/unstable/ifupdown2/interfaces.5.en.html [4]: https://en.wikipedia.org/wiki/Init [5]: https://en.wikipedia.org/wiki/Runlevel [6]: https://github.com/troglobit/finit [systemd]: https://www.freedesktop.org/wiki/Software/systemd/ [sd_notify()]: https://www.freedesktop.org/software/systemd/man/sd_notify.html [s6 style]: https://skarnet.org/software/s6/notifywhenup.html [tmpfiles.d(5)]: https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html [EeePC fastinit]: https://web.archive.org/web/20071208212450/http://wiki.eeeuser.com/boot_process:the_boot_process [original finit]: http://helllabs.org/finit/ [Claudio Matsuoka]: https://github.com/cmatsuoka [Joachim Wiberg]: https://troglobit.com [watchdogd]: https://troglobit.com/watchdogd.html [sysklogd]: https://github.com/troglobit/sysklogd/ finit-4.14/doc/plugins.md0000644000175100001660000002156015054341541011013 Hooks & Plugins =============== Finit can be extended to add general functionality in the form of I/O monitors, or hook plugins. It is even possible to run scripts at these hook points, see below. The following sections detail existing plugins and hook points. For more information, see the plugins listed below. Plugins ------- For your convenience a set of *optional* plugins are available: * *alsa-utils.so*: Restore and save ALSA sound settings on startup/shutdown. _Optional plugin._ * *bootmisc.so*: Setup necessary files and system directories for, e.g., UTMP (tracks logins at boot). This plugin is central to get a working system and runs at `HOOK_BASEFS_UP`. The `/var`, `/run`, and `/dev` file systems must be writable for this plugin to work. This plugin is a wrapper for the [tmpfiles.d(5)][] implementation that Finit has. Capable but limited: no aging, attributes, or subvolumes. By default, `/lib/finit/tmpfiles.d` carries all the default .conf files distributed with Finit. It is read first but can be overridden by any of the standard tmpfiles.d directories, e.g. `/etc/tmpfiles.d`. > [!NOTE] > On an embedded system both `/var` and `/run` can be `tmpfs` RAM > disks and `/dev` is usually a `devtmpfs`. This must be defined in > the `/etc/fstab` file and in the Linux kernel config. * *dbus.so*: Setup and start system message bus, D-Bus, at boot. _Optional plugin._ * *hook-scripts.so*: Trigger the execution of scripts from plugin hook points (see [Hooks](#hooks)). _Optional plugin._ This plugin is particularly useful for early boot debugging that needs to take place before regular services are available. For example, say that you want to enable some kernel tracing before modules are loaded. With hook scripts, you can just drop in a shell script in `/libexec/finit/hook/mount/all/` that will poke the right control files in tracefs. Scripts are located in `/libexec/finit/hook` by default, this can be customized at build-time using the `--with-hook-scripts-path=PATH` argument to `configure`. * *hotplug.so*: Replaced with `/lib/finit/system/10-hotplug.conf`, which checks for `udevd` and `mdev` at boot. This file can be overridden by a file in `/etc/finit.d/10-hotplug.conf`. Enabled by default. > [!TIP] > See the [Services](config/services.md) section in the configuration > guide for an example how to run `mdevd`, alternative to plain mdev. * *rtc.so*: Restore and save system clock from/to RTC on boot/halt. Enabled by default. * *modules-load.so*: Scans `/etc/modules-load.d/*.conf` for modules to load using `modprobe`. Each file can contain multiple lines with the name of the module to load. Any line starting with the standard UNIX comment character, `#`, or `;`, is skipped. Modules are by default loaded in runlevel `S` using the `task` stanza. Each module gets a unique `name:modprobe.foo`, and optional`:ID`. The runlevel can be changed per file using: set runlevel 2345 The `:ID` is a globally incremented index, which can be disabled per file (anywhere) using the following config line: set noindex To change the index used by the plugin: set index 1234 Since these tasks run in the background, they return `[ OK ]` at boot, unless the modprobe tool does not exist. Check syslog for warnings and the actual status of the operation using `initctl`. > [!IMPORTANT] > Unlike the traditional .conf `module` directive, which load any listed > module immediately, this plugin creates a background `task` which load > the module(s) in the background. The program is modprobe, > `/sbin/modprobe`, which you can override per .conf file: > > set modprobe /path/to/maybe-a-modprobe-wrapper * *netlink.so*: Listens to Linux kernel Netlink events for gateway and interfaces. These events are then sent to the Finit service monitor for services that may want to be SIGHUP'ed on new default route or interfaces going up/down. Enabled by default. * *resolvconf.so*: Setup necessary files for `resolvconf` at startup. _Optional plugin._ * *tty.so*: Watches `/dev`, using inotify, for new device nodes (TTY's) to start/stop getty consoles on them on demand. Useful when plugging in a usb2serial converter to login to your embedded device. Enabled by default. * *urandom.so*: Setup random seed at startup. Enabled by default. * *x11-common.so*: Setup necessary files for X-Window. _Optional plugin._ Usually you want to hook into the boot process once, simple hook plugins like `bootmisc.so` are great for that purpose. They are called at each hook point in the boot process, useful to insert some pre-bootstrap mechanisms, like generating configuration files, restoring HW device state, etc. Available hook points are: Hooks ----- In the below listings, the first label is the hook point for a C plugin, the second is the condition name and hook script path. A hook script is a plain shell script, or program, that does a very small dedicated job at the below hook points. See [Run-parts Scripts](config/runparts.md) for details on the requirements, possibilities, and *limitations* of hook scripts. All hook scripts are called with at least one environment variable set, the hook name, useful when reusing the same hook script for multiple hook points: - `FINIT_HOOK_NAME`: set to the second label, e.g., `hook/net/up` - `FINIT_SHUTDOWN`: set for `hook/sys/shutdown` and later to one of `halt`, `poweroff`, or `reboot`. **Example:** $ mkdir -p /libexec/finit/hook/sys/down $ cat </libexec/finit/hook/sys/down/foo.sh #!/bin/sh echo 'I run just before the reboot() syscall at shutdown/reboot' echo 'I have access to /dev since devtmpfs is exempt from umount' echo "FINIT_HOOK_NAME: $FINIT_HOOK_NAME" if [ -n "$FINIT_SHUTDOWN" ]; then echo "FINIT_SHUTDOWN: $FINIT_SHUTDOWN" fi exit 0 EOF $ chmod +x /libexec/finit/hook/sys/down/foo.sh > [!IMPORTANT] > To use hook scripts, even for pre-bootstrap and pre-shutdown tasks, > you must build with `configure --enable-hook-scripts-plugin`. ### Bootstrap Hooks * `HOOK_BANNER`, `hook/sys/banner`: The very first point at which a plugin can run. Intended to be used as a banner replacement. Essentially this runs just before entering runlevel S. Assume nothing is available, so be prepared to use absolute paths, etc. * `HOOK_ROOTFS_UP`, `hook/mount/root`: When `finit.conf` has been read and `/` has is mounted — very early * `HOOK_MOUNT_ERROR`, `hook/mount/error`: executed if `mount -a` fails * `HOOK_MOUNT_POST`, `hook/mount/post`: always executed after `mount -a` * `HOOK_BASEFS_UP`, `hook/mount/all`: All of `/etc/fstab` is mounted, swap is available and default init signals are setup * `HOOK_SVC_PLUGIN`, `hook/svc/plugin`: Called in `conf_init()` right before loading `/etc/finit.conf`. For plugins to register any early run/task/services, please do NOT use any earlier hook point. That will cause uninitialized rlimits that lead to unpredictable results when Finit later tries to start the run/task/service. * `HOOK_NETWORK_UP`, `hook/net/up`: System bootstrap, runlevel S, has completed and networking is up (`lo` is up and the `network` script has run) * `HOOK_SVC_UP`, `hook/svc/up`: All services in the active runlevel have been launched * `HOOK_SYSTEM_UP`, `hook/sys/up`: All services *and* everything in `/etc/finit.d` has been launched ### Runtime Hooks * `HOOK_SVC_RECONF`, N/A: Called when the user has changed something in the `/etc/finit.d` directory and issued `SIGHUP`. The hook is called when all modified/removed services have been stopped. When the hook has completed, Finit continues to start all modified and new services. * `HOOK_RUNLEVEL_CHANGE`, N/A: Called when the user has issued a runlevel change. The hook is called when services not matching the new runlevel have been been stopped. When the hook has completed, Finit continues to start all services in the new runlevel. ### Shutdown Hooks * `HOOK_NETWORK_DN`, `hook/net/down`: Called right after having changed to runlevel 6, or 0, when all services have received their 'stop' signal. * `HOOK_SHUTDOWN`, `hook/sys/shutdown`: Called at shutdown/reboot, right before all services are sent `SIGTERM` * `HOOK_SVC_DN`, `hook/svc/down`: In shutdown/reboot, all services and non-reserved processes have been killed. **Note:** only hook scripts can run here! * `HOOK_SYSTEM_DN`, `hook/sys/down`: In shutdown/reboot, called after all non-reserved file systems have been unmounted, just before Finit tells the kernel to reboot or shut down. **Note:** only hook scripts can run here! Plugins like `tty.so` extend finit by acting on events, they are called I/O plugins and are called from the finit main loop when `poll()` detects an event. See the source code for `plugins/*.c` for more help and ideas. [tmpfiles.d(5)]: https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html finit-4.14/doc/service.md0000644000175100001660000000420515054341541010767 Starting & Monitoring ===================== Finit can start and monitor the following types of daemons: * Forks to background, creates a PID file * Runs in foreground and signals ready by: - creating a PID file - does not create a PID file -- Finit can create it for you (optional) - [other mechanism][1] (systemd, s6) Finit can *not* start and monitor a daemon that: * Forks to background and does *not* create a PID file | | Forking | Creates PID File | Finit creates PID File | |---|---------|------------------|------------------------| | ✔ | Yes | Yes | No | | ✔ | No | Yes | No | | ✔ | No | No | Yes, optionally | | ✘ | Yes | No | No | > [!NOTE] > PID files is one mechanism used to assert conditions to synchronize > the start and stop of other, dependent, services. Other mechanisms > are described in the [Service Synchronization][1] section. ### Forks to bg w/ PID file There are two syntax variants, type 1 and type 2. The former is the traditional one used also for `sysv` start/stop scripts, and the latter is inspired by systemd, with a twist -- it lets Finit guess the pifdile to look for based on the standard path and the basename of the command. service pid:!/run/serv.pid serv -- Forking service, type 1 service type:forking serv -- Forking service, type 2 In this example the resulting files to watch for are `/run/serv.pid` and `/var/run/serv.pid`, respectively. On most modern Linux systems this is the same directory (`/var/run` is a symlink to `../run`). ### Runs in fg w/ PID file service serv -n -p -- Foreground service w/ PID file ### Runs in fg w/o PID file Same as previous, but we tell Finit to create the PID file, because we need it to synchronize start/stop of a dependent service. service pid:/run/serv.pid serv -n -- Foreground service w/o PID file ### Runs in fg w/ custom PID file service pid:/run/servy.pid serv -n -p -P /run/servy.pid -- Foreground service w/ custom PID file [1]: config/service-sync.md finit-4.14/doc/config/0000755000175100001660000000000015054341601010326 5finit-4.14/doc/config/task-and-run.md0000644000175100001660000000277115054341541013106 run (sequence) -------------- **Syntax:** `run [LVLS] /path/to/cmd ARGS -- Optional description` > `` is described in the [Services](services.md) section. One-shot command to run in sequence when entering a runlevel, with optional arguments and description. `run` commands are guaranteed to be completed before running the next command. Useful when serialization is required. > [!WARNING] > Try to avoid the `run` command. It blocks much of the functionality > in Finit, like (re)starting other (perhaps crashing) services while a > `run` task is executing. Use other synchronization mechanisms > instead, like conditions. Incomplete list of unsupported `initctl` commands in `run` tasks: - `initctl runlevel N`, setting runlevel - `initctl reboot` - `initctl halt` - `initctl poweroff` - `initctl suspend` To prevent `initctl` from calling Finit when enabling and disabling services from inside a `run` task, use the `--force` option. See also the `--quiet` and `--batch` options. task (parallel) --------------- **Syntax:** `task [LVLS] /path/to/cmd ARGS -- Optional description` > `` is described in the [Services](services.md) section. One-shot like 'run', but starts in parallel with the next command. Both `run` and `task` commands are run in a shell, so basic pipes and redirects can be used: task [s] echo "foo" | cat >/tmp/bar Please note, `;`, `&&`, `||`, and similar are *not supported*. Any non-trivial constructs are better placed in a separate shell script. finit-4.14/doc/config/logging.md0000644000175100001660000000235615054341541012227 General Logging =============== **Syntax:** `log size:200k count:5` Log rotation for run/task/services using the `log` sub-option with redirection to a log file. Global setting, applies to all services. The size can be given as bytes, without a specifier, or in `k`, `M`, or `G`, e.g. `size:10M`, or `size:3G`. A value of `size:0` disables log rotation. The default is `200k`. The count value is recommended to be between 1-5, with a default 5. Setting count to 0 means the logfile will be truncated when the MAX size limit is reached. Redirecting Output ------------------ The `run`, `task`, and `service` stanzas also allow the keyword `log` to redirect `stderr` and `stdout` of the application to a file or syslog using the native `logit` tool. This is useful for programs that do not support syslog on their own, which is sometimes the case when running in the foreground. The full syntax is: log:/path/to/file log:prio:facility.level,tag:ident log:console log:null log Default `prio` is `daemon.info` and default `tag` is the basename of the service or run/task command. Log rotation is controlled using the global `log` setting. **Example:** service log:prio:user.warn,tag:ntpd /sbin/ntpd pool.ntp.org -- NTP daemon finit-4.14/doc/config/README.md0000644000175100001660000000220015054341541011522 This section provides an overview of Finit's configuration system. For detailed information on specific topics, see the individual sections in the navigation menu. Configuration File Syntax -------------------------- The file format is line based, empty lines and comments, lines starting with `#`, are ignored. A configuration directive starts with a keyword followed by a space and the rest of the line is treated as the value. As of Finit v4.4, configuration directives can be broken up in multiple lines using the continuation character `\`, and trailing comments are also allowed. Example: ```aconf # Escape \# chars if you want them literal in, e.g., descriptions service name:sysklogd [S123456789] \ env:-/etc/default/sysklogd \ syslogd -F $SYSLOGD_ARGS \ -- System log daemon \# 1 # Comments allowed ``` The .conf files `/etc/finit.conf` and `/etc/finit.d/*` support many directives. Some are restricted, e.g., only available at bootstrap, runlevel `S`. Read on in [Files & Layout](files.md) for more on how to structure your .conf files. For details on restrictions, see [Limitations](limitations.md). finit-4.14/doc/config/service-env.md0000644000175100001660000000175715054341541013033 Service Environment ------------------- Finit supports sourcing environment variables from `/etc/default/*`, or similar `--with-sysconfig=DIR`. This is a common pattern from SysV init scripts, where the start-stop script is a generic script for the given service, `foo`, and the options for the service are sourced from the file `/etc/default/foo`. Like this: * `/etc/default/foo`: FOO_OPTIONS=--extra-arg="bar" -s -x * `/etc/finit.conf`: service [2345] env:-/etc/default/foo foo -n $FOO_OPTIONS -- Example foo daemon Here the service `foo` is started with `-n`, to make sure it runs in the foreground, and the with the options found in the environment file. With the `ps` command we can see that the process is started with: foo -n --extra-arg=bar -s -x > [!NOTE] > The leading `-` in `env:` determines if Finit should treat a missing > environment file as blocking the start of the service or not. When > `-` is used, a missing environment file does *not* block the start. finit-4.14/doc/config/sysv.md0000644000175100001660000000721515054341541011604 SysV Init Compatibility ======================= It is not possible to run unmodified SysV init systems with Finit. This was never the intention and is not the strength of Finit. However, it comes with a few SysV Init compatibility features to ease the transition from a serialized boot process. SysV Init Scripts ----------------- **Syntax:** `sysv [LVLS] /path/to/init-script -- Optional description` > `` is described in the [Services](services.md) section. Similar to `task` is the `sysv` stanza, which can be used to call SysV style scripts. The primary intention for this command is to be able to reuse much of existing setup and init scripts in Linux distributions. When entering an allowed runlevel, Finit calls `init-script start`, when entering a disallowed runlevel, Finit calls `init-script stop`, and if the Finit .conf, where `sysv` stanza is declared, is modified, Finit calls `init-script restart` on `initctl reload`. Similar to how `service` stanzas work. Forking services started with `sysv` scripts can be monitored by Finit by declaring the PID file to look for: `pid:!/path/to/pidfile.pid`. Notice the leading `!`, it signifies Finit should not try to create the file, but rather watch that file for the resulting forked-off PID. This syntax also works for forking daemons that do not have a command line option to run it in the foreground, more on this below in `service`. > [!TIP] > See also [SysV Init Compatibility](#sysv-init-compatibility). `runparts DIRECTORY` -------------------- For a directory with traditional start/stop scripts that should run, in order, at bootstrap, Finit provides the `runparts` directive. It runs in runlevel S, at the very end of it (before calling `/etc/rc.local`) making it perfect for most scenarios. For syntax details, see the [Run-parts Scripts](runparts.md) section. Here is an example take from a Debian installation: runparts /etc/rc2.d Files in these directories are usually named `SNNfoo` and `KNNfoo`, which Finit knows about and automatically appends the correct argument: /bin/sh -c /etc/rc2.d/S01openbsd-inetd start or /bin/sh -c /etc/rc0.d/K01openbsd-inetd stop Files that do not match this pattern are started similarly but without the extra command line argument. Start/Stop Scripts ------------------ For syntax details, see [SysV Init Scripts](#sysv-init-scripts), above. Here follows an example taken from a Debian installation: sysv [2345] /etc/init.d/openbsd-inetd -- OpenBSD inet daemon The init script header could be parsed to extract `Default-Start:` and other parameters for the `sysv` command to Finit. There is currently no way to detail a generic syslogd dependency in Finit, so `Should-Start:` in the header must be mapped to the condition system in Finit using an absolute reference, here we depend on the sysklogd project's syslogd. `/etc/rc.local` --------------- One often requested feature, early on, was a way to run a site specific script to set up, e.g., static routes or firewall rules. A user can add a `task` or `run` command in the Finit configuration for this, but for compatibility reasons the more widely know `/etc/rc.local` is used if it exists, and is executable. It is called very late in the boot process when the system has left runlevel S, stopped all old and started all new services in the target runlevel (default 2). > In Finit releases before v4.5 this script blocked Finit execution and > made it as good as impossible to call `initctl` during that time. `init q` -------- When `/sbin/finit` is installed as `/sbin/init`, it is possible to use `init q` to reload the configuration. This is the same as calling `initctl reload`. finit-4.14/doc/config/tty.md0000644000175100001660000000670215054341541011420 TTYs and Consoles ================= **Syntax:** `tty [LVLS] DEV [BAUD] [noclear] [nowait] [nologin] [TERM]` `tty [LVLS] CMD [noclear] [nowait]` `tty [LVLS] [notty] [rescue]` The first variant of this option uses the built-in getty on the given TTY device DEV, in the given runlevels. DEV may be the special keyword `@console`, which is expanded from `/sys/class/tty/console/active`, useful on embedded systems. The default baud rate is 0, i.e., keep kernel default. > The `tty` stanza inherits runlevel, condition (and other feature) > parsing from the `service` stanza. So TTYs can run in one or many > runlevels and depend on any condition supported by Finit. This is > useful e.g. to depend on `` before starting a TTY. **Example:** tty [12345] /dev/ttyAMA0 115200 noclear vt220 The second `tty` syntax variant is for using an external getty, like agetty or the BusyBox getty. The third variant is for board bringup and the `rescue` boot mode. No device node is required in this variant, the same output that the kernel uses is reused for stdio. If the `rescue` option is omitted, a shell is started (`nologin`, `noclear`, and `nowait` are implied), if the rescue option is set the bundled `/libexec/finit/sulogin` is started to present a bare-bones root login prompt. If the root (uid:0, gid:0) user does not have a password set, no rescue is possible. For more information, see the [Rescue Mode](rescue.md) section. By default, the first two syntax variants *clear* the TTY and *wait* for the user to press enter before starting getty. **Example:** tty [12345] /sbin/getty -L 115200 /dev/ttyAMA0 vt100 tty [12345] /sbin/agetty -L ttyAMA0 115200 vt100 nowait The `noclear` option disables clearing the TTY after each session. Clearing the TTY when a user logs out is usually preferable. The `nowait` option disables the `press Enter to activate console` message before actually starting the getty program. On small and embedded systems running multiple unused getty wastes both memory and CPU cycles, so `wait` is the preferred default. The `nologin` option disables getty and `/bin/login`, and gives the user a root (login) shell on the given TTY `` immediately. Needless to say, this is a rather insecure option, but can be very useful for developer builds, during board bringup, or similar. Notice the ordering, the `TERM` option to the built-in getty must be the last argument. Embedded systems may want to enable automatic `DEV` by supplying the special `@console` device. This works regardless weather the system uses `ttyS0`, `ttyAMA0`, `ttyMXC0`, or anything else. Finit figures it out by querying sysfs: `/sys/class/tty/console/active`. The speed can be omitted to keep the kernel default. > Most systems get by fine by just using `console`, which will evaluate > to `/dev/console`. If you have to use `@console` to get any output, > you may have some issue with your kernel config. **Example:** tty [12345] @console noclear vt220 On really bare bones systems, or for board bringup, Finit can give you a shell prompt as soon as bootstrap is done, without opening any device node: tty [12345789] notty This should of course not be enabled on production systems. Because it may give a user root access without having to log in. However, for board bringup and system debugging it can come in handy. One can also use the `service` stanza to start a stand-alone shell: service [12345] /bin/sh -lfinit-4.14/doc/config/index.md0000644000175100001660000000220015054341541011674 This section provides an overview of Finit's configuration system. For detailed information on specific topics, see the individual sections in the navigation menu. Configuration File Syntax -------------------------- The file format is line based, empty lines and comments, lines starting with `#`, are ignored. A configuration directive starts with a keyword followed by a space and the rest of the line is treated as the value. As of Finit v4.4, configuration directives can be broken up in multiple lines using the continuation character `\`, and trailing comments are also allowed. Example: ```aconf # Escape \# chars if you want them literal in, e.g., descriptions service name:sysklogd [S123456789] \ env:-/etc/default/sysklogd \ syslogd -F $SYSLOGD_ARGS \ -- System log daemon \# 1 # Comments allowed ``` The .conf files `/etc/finit.conf` and `/etc/finit.d/*` support many directives. Some are restricted, e.g., only available at bootstrap, runlevel `S`. Read on in [Files & Layout](files.md) for more on how to structure your .conf files. For details on restrictions, see [Limitations](limitations.md). finit-4.14/doc/config/service-opts.md0000644000175100001660000001417215054341541013223 Service Options =============== The run/task/tty/service/sysv directives take modifiers, or options, to control their behavior. This section lists them with their limitations. All modifiers must be placed between the directive and its command. The name of a service, shown by the `initctl` tool, defaults to the basename of the service executable. It can be changed with the `name:` option: name: For multiple instances of a service, with the same `name`, set the identifier `:ID` to prevent Finit from replacing previous instances: service name:ssdp :eth1 ssdpd eth1 -- Windows discovery on eth1 service name:ssdp :eth2 ssdpd eth2 -- Windows discovery on eth2 The [`initctl`](../initctl.md) tool will list these two services as: - ssdp:eth1 - ssdp:eth2 Conflicting services that must be prevented from starting, use the `conflict:` option: service [S12345789] udevd -- Device event management daemon run [S] conflict:udevd mdev -s -- Populating device tree Multiple conflicting services can be separated using `,`: service :1 abc service :2 abc service conflict:abc:1,abc:2 cde If a service should not be automatically started, it can be configured as manual with the optional `manual` argument. The service can then be started at any time by running `initctl start `. manual:yes Other run/task/service options are: * `cgroups:...` -- see the [Cgroups](cgroups.md) section * `env:[-]/path/to/env` -- see the [Service Environment](service-env.md) section * `log:...` -- see [Redirecting Output](logging.md#redirecting-output) * `nowarn` -- see [Conditional Loading](services.md#conditional-loading) * `notify:...` -- see [Service Synchronization](service-sync.md) * `if:...` -- see [Conditional Execution](services.md#conditional-execution) * `type:forking` -- see description of the [service](services.md) directive As mentioned previously, services are automatically started, restarted, and stopped, depending on the configuration and conditions. Within the confines of that the following options are available: * `restart:NUM` -- number of times Finit tries to restart a crashing service, default: 10, max: 255. When this limit is reached the service is marked *crashed* and must be restarted manually with `initctl restart NAME` * `restart_sec:SEC` -- number of seconds before Finit tries to restart a crashing service, default: 2 seconds for the first five retries, then back-off to 5 seconds. The maximum of this configured value and the above (2 and 5) will be used * `restart:always` -- no upper limit on the number of times Finit tries to restart a crashing service. Same as `restart:-1` * `norestart` -- dont restart on failures, same as `restart:0` * `respawn` -- bypasses the `restart` mechanism completely, allows endless restarts. Useful in many use-cases, but not what `service` was originally designed for so not the default behavior * `oncrash:reboot` -- when all retries have failed, and the service has *crashed*, if this option is set the system is rebooted * `oncrash:script` -- similarly, but instead of rebooting, call the `post:script` action with exit code `crashed`, see below * `reload:'script [args]'` -- some services do not support `SIGHUP` but may have other ways to update the configuration of a running daemon. When `reload:script` is defined it is preferred over `SIGHUP`. Like systemd, Finit sets `$MAINPID` as a convenience to scripts, which in effect also allow `reload:'kill -HUP $MAINPID'` * `stop:'script [args]'` -- some services may require alternate methods to be stopped. If a `stop:script` is defined it is preferred over `SIGTERM` and `stop`, for `service` and `sysv`, respectively. Similar to `reload:script`, Finit sets `$MAINPID` > [!CAUTION] > Both `reload:script` and `stop:script` are called as PID 1, without > any timeout! Meaning, it is up to you to ensure the script is not > blocking for seconds at a time or never terminates. When stopping a service (run/task/sysv/service), either manually or when moving to another runlevel, Finit starts by sending `SIGTERM`, to allow the process to shut down gracefully (unless a `stop:'script'` is used). However, if the process has not been collected within 3 seconds, Finit will send `SIGKILL`. To stop the process using a different signal than `SIGTERM`, use `halt:SIGNAL`, e.g., `halt:SIGPWR`. To change the delay between the stop signal and KILL, use the option `kill:<1-60>`, e.g., `kill:10` to wait 10 seconds before sending `SIGKILL`. Services, including the `sysv` variant, support pre/post/ready and cleanup scripts: * `pre:[0-3600,]script` -- called before the sysv/service is stated * `post:[0-3600,]script` -- called after the sysv/service has stopped * `ready:[0-3600,]script` -- called when the sysv/service is ready * `cleanup:[0-3600,]script` -- called when run/task/sysv/service is removed The optional number (0-3600) is the timeout before Finit kills the script, it defaults to the kill delay value and can be disabled by setting it to zero. These scripts run as the same `@USER:GROUP` as the service itself, with any `env:file` sourced. The scripts are executed from the `$HOME` of the given user. The scripts are not called with any argument, but get a set of environment variables: * `SERVICE_IDENT=foo:1` * `SERVICE_NAME=foo` * `SERVICE_ID=1` The `post:script` is called with an additional set of environment variables. Yes, the text is correct, the naming was an accident: - `EXIT_CODE=[exited,signal,crashed]`: normal exit, signaled, or crashed - `EXIT_STATUS=[num,SIGNAME]`: set to one of exit status code from the program, if it exited normally, or the signal name (`HUP`, `TERM`, etc.) if it exited due to signal When a run/task/sys/service is removed (disable + reload) it is first stopped and then removed from the runlevel. The `post:script` always runs when the process has stopped, and the `cleanup:script` runs when the the stanza has been removed from the runlevel. > [!IMPORTANT] > These script actions are intended for setup, cleanup, and readiness > notification. It is up to the user to ensure the scripts terminate. finit-4.14/doc/config/limitations.md0000644000175100001660000000163615054341541013135 Limitations =========== As of Finit v4 there are no limitations to where `.conf` settings can be placed. Except for the system/global `rlimit` and `cgroup` top-level group declarations, which can only be set from `/etc/finit.conf`, since it is the first `.conf` file Finit reads. Originally, `/etc/finit.conf` was the only way to set up a Finit system. Today it is mainly used for bootstrap settings like system hostname, early module loading for watchdogd, network bringup and system shutdown. These can now also be set in any `.conf` file in `/etc/finit.d`. There is, however, nothing preventing you from having all configuration settings in `/etc/finit.conf`. > [!IMPORTANT] > The default `rcsd`, i.e., `/etc/finit.d`, was previously the Finit > [runparts](runparts.md) directory. Finit >=v4.0 no longer has a > default `runparts` directory, make sure to update your setup, or the > finit configuration, accordingly. finit-4.14/doc/config/service-sync.md0000644000175100001660000000614715054341541013215 Service Synchronization ======================= Finit was created for fast booting systems. Faster than a regular SysV Init based system at the time. Early on the need for a guaranteed start order of services (daemons) arose. I.e., service `A` must be guaranteed to have started (and be ready!) before `B`. The model that was chosen to determine this was very simple: PID files. Early on in UNIX daemons were controlled with basic IPC like signals, and the way for a user to know that a daemon was ready to respond to signals (minimally having set up its signal handler), was to tell the user; > "Hey, you can send signals to me using the PID in this file: > `/var/run/daemon.pid`". Since most systems run fairly unchanged after boot, Finit could rely on the PID file for `A` being created before launching `B`. This method has worked well for a long time, and for systems based on Open Source it was easy to either add PID file support to a daemon without support for it, or fix ordering issues (PID file created before signal handler is set up) in existing daemons. However, with the advent of other Init systems (Finit is rather old), most notably systemd and s6, other methods for signaling "readiness" arrived and daemons were adapted to these new schemes to a larger extent. As of Finit v4.4 partial support for systemd and s6 style readiness notification is available, and the native PID file mode of operation is, as of Finit v4.6 optional, by default it is still enabled, but this can be changed in `finit.conf`: readiness none This will be made the default in Finit 5.0. In this mode of operation, every service needs to explicitly declare their readiness notification, like this: service notify:pid watchdogd service notify:systemd foo service notify:s6 bar service notify:none qux The `notify:none` syntax is for completeness in systems which run in `readiness pid` mode (default). Services declared with `notify:none` will transition to ready as soon as Finit has started them, e.g., `service/qux/ready`. To synchronize two services the following condition can be used: service notify:pid watchdogd service stress-ng --cpu 8 For details on the syntax and options, see below. > [!NOTE] > On `initctl reload` conditions are set in "flux", while figuring out > which services to stop, start or restart. Services that need to be > restarted have their `ready` condition removed before Finit issue a > SIGHUP (if they support that), or stop-starting them. A daemon is > expected to reassert its readiness, e.g. systemd style daemons to > write `READY=1\n`. > > However, the s6 notify mode does not support this because in s6 you > are expected to close your notify descriptor after having written > `\n`. This means s6 style daemons currently must be stop-started. > (Declare the service with `` in its condition statement.) > > For default, PID file style readiness notification, daemons are > expected to either create their PID files, or touch it using > `utimensat()` to reassert readiness. Triggering both the `` > and `<.../ready>` conditions. finit-4.14/doc/config/files.md0000644000175100001660000001665215054341541011707 Files & Layout ============== Originally Finit was configured using a single file, `/etc/finit.conf`, and although still possible to use a single configuration file, today the following layout is recommended: / |- etc/ | |- finit.d/ | | |- available/ | | | `- my-service.conf | : |- enabled/ | : | `- my-service.conf -> ../available/my-service.conf | : : | : |- static-service.conf | : `- another-static.conf | : | `- finit.conf |- lib | `- finit/ | `- system/ | |- 10-hotplug.conf | `- ... `- run/ `- finit/ `- system/ |- dbus.conf |- keventd.conf |- runparts.conf |- watchdogd.conf `- ... Configuration files in `/etc` are provided by the user, or projects like [finit-skel](https://github.com/troglobit/finit-skel) and extended by the user. The files in `/lib/finit/system/*.conf` are system critical services and setup provided by Finit, e.g. udev/mdev that must run very early at system bootstrap. This system directory was introduced in Finit v4.4 to replace the hard-coded services provided by plugins before. All .conf files in this directory be either replaced by a system administrator or overridden by a file with the same name in `/etc/finit.d/`. The files in `/run/finit/system/*.conf` are created by plugins and Finit bundled services like runparts, [watchdog](../watchdog.md), and [`keventd`](../keventd.md) if they are enabled. Like `/lib/finit/system/*.conf`, these files can be overridden by file with the same name in `/etc/finit.d/`. Services in the `available/` and `enabled/` sub-directories are called dynamic services, in contrast to static services -- the only difference being where they are installed and if the `initctl` tool can manage them with the `enable` and `disable` commands. An administrator can always create files and symlinks manually. At bootstrap, and `initctl reload`, all .conf files are read, starting with `finit.conf`, then `/lib/finit/system/*.conf`, `finit.d/*.conf`, and finally all `finit.d/enabled/*.conf` files. Each directory is a unique group, where files within each group are sorted alphabetically. **Example:** /lib/finit/system/10-hotplug.conf /lib/finit/system/90-testserv.conf /run/finit/system/dbus.conf /run/finit/system/runparts.conf /etc/finit.d/10-abc.conf /etc/finit.d/20-abc.conf /etc/finit.d/enabled/1-aaa.conf /etc/finit.d/enabled/1-abc.conf The resulting combined configuration is read line by line, each `run`, `task`, and `service` added to an ordered list that ensures they are started in the same order. This is important because of the blocking properties of the `run` statement. For an example on the relation of `service` and `run` statements, and dependency handling between them, see [Conditional Loading](services.md#conditional-loading), below. > [!NOTE] > The names `finit.conf` and `finit.d/` are only defaults. They can be > changed at compile-time with two `configure` options: > `--with-config=/etc/foo.conf` and `--with-rcsd=/var/foo.d`. > > They can also be overridden from the [kernel command line](../cmdline.md) > using: `-- finit.config=/etc/bar.conf` and in that file use the > top-level configuration directive `rcsd /path/to/finit.d`. Filesystem Layout ----------------- Finit is most comfortable with a traditional style Linux filesystem layout, as specified in the [FHS][]: /. |- bin/ |- dev/ # Mounted automatically if devtmpfs is available | |- pts/ # Mounted automatically by Finit if it exists | `- shm/ # Mounted automatically by Finit if it exists |- etc/ | |- finit.d/ | | |- available/ | | `- enabled/ | `- finit.conf |- home/ |- lib/ |- libexec/ |- mnt/ |- proc/ # Mounted automatically by Finit if it exists |- root/ |- run/ # Mounted automatically by Finit if it exists | `- lock/ # Created automatically if Finit mounts /run |- sbin/ |- sys/ # Mounted automatically by Finit if it exists |- tmp/ # Mounted automatically by Finit if it exists |- usr/ `- var/ |- cache/ |- db/ |- lib/ | `- misc/ |- lock/ |- log/ |- run -> ../run |- spool/ `- tmp/ Finit starts by mounting the critical file systems `/dev`, `/proc/`, and `/sys`, unless they are already mounted. When all plugins and other, core Finit functions, have been set up, all relevant filesystems (where `PASS > 0`) are checked and mounted from the selected `fstab`, either the default `/etc/fstab`, or any custom one selected from the command line, or at build time. To provide a smooth ride, file system not listed in the given `fstab`, e.g. `/tmp` and `/run`, are automatically mounted by Finit, as listed above, provided their respective mount point exists. With all filesystems mounted, Finit calls `swapon`. > [!TIP] > To see what happens when all filesystems are mounted, have a look at > the [`bootmisc.so` plugin](../plugins.md). At shutdown, and after having stopped all services and other lingering processes have been killed, filesystems are unmounted in the reverse order, and `swapoff` is called. [FHS]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html Managing Services ----------------- Using `initctl disable my-service` the symlink (above) is removed and the service is queued for removal. Several changes can be made to the system, but it is not until `initctl reload` is called that the changes are activated. To add a new static service, drop a `.conf` file in `/etc/finit.d/` and run `initctl reload`. (It is also possible to `SIGHUP` PID 1, or call `finit q`, but that has been deprecated with the `initctl` tool). Finit monitors all known active `.conf` files, so if you want to force a restart of any service you can touch its corresponding `.conf` file in `/etc/finit.d` and call `initctl reload`. Finit handles all conditions and dependencies between services automatically, see the section on [Service Synchronization](service-sync.md) for more details. On `initctl reload` the following is checked for all services: - If a service's `.conf` file has been removed, or its conditions are no longer satisfied, the service is stopped. - If the file is modified, or a service it depends on has been reloaded, the service is reloaded (stopped and started). - If a new service is added it is automatically started — respecting runlevels and return values from any callbacks. For more info on the different states of a service, see the separate document [Finit Services](../service.md). Alternate finit.d/ ------------------ **Syntax:** `rcsd /path/to/finit.d` The Finit rcS.d directory is set at compile time with: ./configure --with-rcsd=/etc/finit.d A system with multiple use-cases may be bootstrapped with different configurations, starting with the kernel command line option: -- finit.config=/etc/factory.conf This file in turn can use the `rcsd` directive to tell Finit to use another set of .conf files, e.g.: rcsd /etc/factory.d > [!NOTE] > This directive is only available from the top-level bootstrap .conf > file, usually `/etc/finit.conf`. Including Finit Configs ------------------------ **Syntax:** `include ` Include another configuration file. Absolute path required. finit-4.14/doc/config/env.md0000644000175100001660000000222115054341541011360 Environment Variables --------------------- In Finit v4.3 support for setting environment variables in `finit.conf`, and any `*.conf`, was added. It is worth noting that these are global and *shared with all* services -- the only way to have a service-local environment is detailed in [Services Environment](service-env.md). The syntax for global environment variables is straight forward. In Finit v4.4 the `set` keyword was added for completeness, but the old syntax (without the `set ` prefix) is still honored: set foo=bar set baz="qux" On reload of .conf files, all tracked environment variables are cleared so if `foo=bar` is removed from `finit.conf`, or any `finit.d/*.conf` file, it will no longer be used by Finit or any new (!) started run/tasks or services. The environment of already started processes can not be changed. The only variables reset to sane defaults on .conf reload are: PATH=_PATH_STDPATH SHELL=_PATH_BSHELL LOGNAME=root USER=root It is entirely possible to override these as well from the .conf files, but be careful. Changing SHELL changes the behavior of `system()` and a lot of other commands as well. finit-4.14/doc/config/runlevels.md0000644000175100001660000001346515054341541012623 Runlevels ========= Finit supports runlevels, but unlike other init systems runlevels are declared per service/run/task/sysv command. When booting up a system Finit pass through three phases: 1. Setting up the console, parsing any command line options, and other housekeeping tasks like mounting all filesystems, and calling `fsck` 2. Starting all run/task/services in runlevel S, then waiting for all services to have started, and all run/tasks to have completed 3. Go to runlevel 2, or whatever the user has set in the configuration Available runlevels: - ` S`: bootStrap - ` 1`: Single user mode - `2-5`: traditional multi-user mode - ` 6`: reboot - `7-9`: multi-user mode (extra) - ` 0`: shutdown Runlevel S (bootStrap), is for tasks supposed to run once at boot, and services like `syslogd`, which need to start early and run throughout the lifetime of your system. Example: task [S] /lib/console-setup/console-setup.sh service [S12345] env:-/etc/default/rsyslog rsyslogd -n $RSYSLOGD_ARGS When bootstrap has completed, Finit moves to runlevel 2. This can be changed in `/etc/finit.conf` using the `runlevel N` directive, or by a script running in runlevel S that calls, e.g., `initctl runlevel 9`. The latter is useful if startup scripts detect problems outside of Finit's control, e.g., critical services/devices missing or hardware problems. Each runlevel must be allowed to "complete". Meaning, all services in runlevel S must have started and all run/tasks have been started and collected (exited). Finit waits 120 seconds for all run/tasks in S to complete before proceeding to 2. Finit first stops everything that is not allowed to run in 2, and then brings up networking. Networking is expected to be available in all runlevels except: S, 1 (single user level), 6, and 0. Networking is enabled either by the `network script` directive, or if you have an `/etc/network/interfaces` file, Finit calls `ifup -a` -- at the very least the loopback interface is brought up. > [!NOTE] > When moving from runlevel S to 2, all run/task/services that were > constrained to runlevel S only are dropped from bookkeeping. So when > reaching the prompt, `initctl` will not show these run/tasks. This is > a safety mechanism to prevent bootstrap-only tasks from accidentally > being run again. E.g., `console-setup.sh` above. Runlevel Configuration ---------------------- **Syntax:** `runlevel ` The system runlevel to go to after bootstrap (S) has completed. `N` is the runlevel number 0-9, where 6 is reserved for reboot and 0 for halt. Completed in this context means all services have been started and all run/tasks have been started and collected. It is recommended to keep runlevel 1 as single-user mode, because Finit disables networking in this mode. *Default:* 2 > [!NOTE] > Only read and executed in runlevel S (bootstrap). Networking ---------- **Syntax:** `network ` Script or program to bring up networking, with optional arguments. Deprecated. We recommend using dedicated task/run stanzas per runlevel, or `/etc/network/interfaces` if you have a system with `ifupdown`, like Debian, Ubuntu, Linux Mint, or an embedded BusyBox system. > [!NOTE] > Only read and executed in runlevel S (bootstrap). System Hostname --------------- **Syntax:** `host `, or `hostname ` Set system hostname to NAME, unless `/etc/hostname` exists in which case the contents of that file is used. Deprecated. We recommend using `/etc/hostname` instead. > [!NOTE] > Only read and executed in runlevel S (bootstrap). Kernel Modules -------------- **Syntax:** `module [ARGS]` Load a kernel module, with optional arguments. Similar to `insmod` command line tool. Deprecated, there is both a `modules-load.so` and a `modprobe.so` plugin that can handle module loading better. The former supports loading from `/etc/modules-load.d/`, the latter uses kernel modinfo to automatically load (or coldplug) every required module. For hotplug we recommend the BusyBox mdev tool, add to `/etc/mdev.conf`: $MODALIAS=.* root:root 0660 @modprobe -b "$MODALIAS" > [!NOTE] > Only read and executed in runlevel S (bootstrap). Resource Limits --------------- **Syntax:** `rlimit [hard|soft] RESOURCE ` Set the hard or soft limit for a resource, or both if that argument is omitted. `RESOURCE` is the lower-case `RLIMIT_` string constants from `setrlimit(2)`, without prefix. E.g. to set `RLIMIT_CPU`, use `cpu`. LIMIT is an integer that depends on the resource being modified, see the man page, or the kernel `/proc/PID/limits` file, for details. Finit versions before v3.1 used `infinity` for `unlimited`, which is still supported, albeit deprecated. # No process is allowed more than 8MB of address space rlimit hard as 8388608 # Core dumps may be arbitrarily large rlimit soft core infinity # CPU limit for all services, soft & hard = 10 sec rlimit cpu 10 `rlimit` can be set globally, in `/etc/finit.conf`, or locally per each `/etc/finit.d/*.conf` read. I.e., a set of task/run/service stanzas can share the same rlimits if they are in the same .conf. Miscellaneous Settings ---------------------- **Syntax:** `reboot-delay <0-60>` Optional delay at reboot (or shutdown or halt) to allow kernel filesystem threads to complete after calling `sync(2)` before rebooting. This applies primarily to filesystems that do not have a reboot notifier implemented. At the point of writing, the only known filesystems affected are: ubifs, jffs2. *Default:* 0 (disabled) When enabled (non-zero), this delay runs after file systems have been unmounted and the root filesystem has been remounted read-only, and sync(2) has been called, twice. > "On Linux, sync is only guaranteed to schedule the dirty blocks for > writing; it can actually take a short time before all the blocks are > finally written.finit-4.14/doc/config/templating.md0000644000175100001660000000242615054341541012743 Templating ========== Finit comes with rudimentary support for templating, similar to that of systemd. Best illustrated with an example: $ initctl show avahi-autoipd@ service :%i avahi-autoipd --syslog %i -- ZeroConf for %i To enable ZeroConf for, e.g., `eth0`, use $ initctl enable avahi-autoipd@eth0.conf The enabled symlink will be set up to `avahi-autoipd@.conf` and every instance of `%i` will in the instantiated directive be replaced with `eth0`. Inspect the resulting instantiated template with `initctl show avahi-autoipd:eth0` and check the status of a running instance with: ``` $ initctl status avahi-autoipd:eth0 Status : running Identity : avahi-autoipd:eth0 Description : ZeroConf for eth0 Origin : /etc/finit.d/enabled/avahi-autoipd@eth0.conf Environment : -/etc/default/avahi-autoipd-eth0 Command : avahi-autoipd $AVAHI_AUTOIPD_ARGS eth0 PID file : /run/avahi-autoipd.eth0.pid PID : 4190 User : root Group : root Uptime : 24 sec Restarts : 0 (0/10) Runlevels : [---2345-789] Memory : 20.0k CGroup : /system/avahi-autoipd@eth0 cpu 0 [100, max] mem [0, max] └─ 4190 avahi-autoipd: [eth0] bound 169.254.1.9 Jul 8 11:51:42 infix-c0-ff-ee finit[1]: Starting avahi-autoipd:eth0[4190] ``` finit-4.14/doc/config/runparts.md0000644000175100001660000000416015054341541012452 Run-parts Scripts ----------------- **Syntax:** `runparts [progress] [sysv] ` Call [run-parts(8)][] on `DIR` to run start scripts. All executable files in the directory are called, in alphabetic order. The scripts in this directory are executed at the very end of runlevel `S`. A common use-case for runparts scripts is to create and enable/disable services, which Finit will then apply when changing runlevel from S to whatever the next runlevel is set to be (default 2). E.g., generate a `/etc/chrony.conf` and call `initctl enable chronyd`. **Options:** - `progress`: display the progress of each script being executed - `sysv`: run only SysV style scripts, i.e., `SNNfoo`, or `KNNbar`, where `NN` is a number (0-99). If global debug mode is enabled, the `runparts` program is also called with the debug flag. **Limitations:** Scripts called from `runparts`, or hook scripts (see below), are limited in their interaction with Finit. Like the standalone `run` stanza and the `/etc/rc.local` shell script, Finit waits for their completion before continuing. None of them can issue commands to start, stop, or restart other services. Also, ensure all your services and programs either terminate or start in the background or you will block Finit. > [!NOTE] > `runparts` scripts are only read and executed in runlevel S. See > [hook scripts](../plugins.md#hooks) for other ways to run scripts at > certain points during the complete lifetime of the system. **Recommendations:** It can be beneficial to use `01-name`, `02-othername`, etc., to ensure the scripts are started in that order, e.g., if there is a dependency order between scripts. Symlinks to existing daemons can talso be used, but make sure they daemonize (background) themselves properly, otherwise Finit will lock up. If `S[0-9]foo` and `K[0-9]bar` style naming is used, the executable will be called with an extra argument, `start` and `stop`, respectively. E.g., `S01foo` will be called as `S01foo start`. Of course, `S01foo` and `K01foo` may be a symlink to to `another/directory/foo`. [run-parts(8)]: http://manpages.debian.org/cgi-bin/man.cgi?query=run-parts finit-4.14/doc/config/Makefile.in0000644000175100001660000003550715054341567012340 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/config ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_docs_DATA) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(dist_docs_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ docsdir := @docdir@/doc/config dist_docs_DATA = cgroups.md env.md files.md index.md limitations.md \ logging.md rescue.md runlevels.md runparts.md \ service-env.md service-opts.md service-sync.md \ service-wrappers.md services.md sysv.md \ task-and-run.md templating.md tty.md all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/config/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/config/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_docsDATA: $(dist_docs_DATA) @$(NORMAL_INSTALL) @list='$(dist_docs_DATA)'; test -n "$(docsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-dist_docsDATA: @$(NORMAL_UNINSTALL) @list='$(dist_docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_docsDATA 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-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_docsDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/doc/config/services.md0000644000175100001660000002070215054341541012417 Services ======== **Syntax:** `service [LVLS] /path/to/daemon ARGS -- Optional description` Service, or daemon, to be monitored and automatically restarted if it exits prematurely. Finit tries to restart services that die, by default 10 times before giving up and marking them as *crashed*. After which they have to be manually restarted with `initctl restart NAME`. The limits controlling this are configurable, see the options below. > [!TIP] > To allow endless restarts, see the [`respawn` option](service-opts.md) For daemons that support it, we recommend appending `--foreground`, `--no-background`, `-n`, `-F`, or similar command line argument to prevent them from forking off a sub-process in the background. This is the most reliable way to monitor a service. However, not all daemons support running in the foreground, or they may start logging to the foreground as well, these are forking daemons and are supported using the same syntax as forking `sysv` services, using the `pid:!/path/to/pidfile.pid` syntax. There is an alternative syntax that may be more intuitive, where Finit can also guess the PID file based on the daemon's command name: service type:forking ntpd -- NTP daemon This example lets BusyBox `ntpd` daemonize itself. Finit uses the basename of the binary to guess the PID file to watch for the PID: `/var/run/ntpd.pid`. If Finit guesses wrong, you have to submit the full `pid:!/path/to/file.pid`. **Example:** In the case of `ospfd` (below), we omit the `-d` flag (daemonize) to prevent it from forking to the background: service [2345] /sbin/ospfd -- OSPF daemon `[2345]` denote the runlevels `ospfd` is allowed to run in, they are optional and default to level 2-5 if omitted. `<...>` is the condition for starting `ospfd`. In this example Finit waits for another service, `zebra`, to have created its PID file in `/var/run/quagga/zebra.pid` before starting `ospfd`. Finit watches *all* files in `/var/run`, for each file named `*.pid`, or `*/pid`, Finit opens it and find the matching `NAME:ID` using the PID. Some services do not maintain a PID file and rather than patching each application Finit provides a workaround. A `pid` keyword can be set to have Finit automatically create (when starting) and later remove (when stopping) the PID file. The file is created in the `/var/run` directory using the `basename(1)` of the service. The default can be modified with an optional `pid:`-argument: pid[:[/path/to/]filename[.pid]] For example, by adding `pid:/run/bar.pid` to the service `/sbin/bar`, that PID file will, not only be created and removed automatically, but also be used by the Finit condition subsystem. So a service/run/task can depend on ``, like this foo will not be started until bar has started: service pid:/run/bar.pid bar -- Bar Service service foo -- Foo Service Needless to say, it is better if `bar` creates its own PID file when it has completed starting up and is ready for service. As an alternative "readiness" notification, Finit supports both systemd and s6 style notification. This can be enabled by using the `notify` option: * `notify:systemd` -- tells Finit the service uses the `sd_notify()` API to signal PID 1 when it has completed its startup and is ready to service events. The [sd_notify()][] API expects `NOTIFY_SOCKET` to be set to the socket where the application can send `"READY=1\n"` when it is starting up or has processed a `SIGHUP`. * `notify:s6` -- puts Finit in s6 compatibility mode. Compared to the systemd notification, [s6 expect][] compliant daemons to send `"\n"` and then close their socket. Finit takes care of "hard-wiring" the READY state as long as the application is running, events across any `SIGHUP`. Since s6 can give its applications the descriptor number (must be >3) on then command line, Finit provides the following syntax (`%n` is replaced by Finit with then descriptor number): service [S12345789] notify:s6 mdevd -O 4 -D %n [sd_notify()]: https://www.freedesktop.org/software/systemd/man/sd_notify.html [s6 expect]: https://skarnet.org/software/s6/notifywhenup.html When a service is ready, either by Finit detecting its PID file, or their respective readiness mechanism has been triggered, Finit creates then service's ready condition which other services can depend on: $ initctl -v cond get service/mdevd/ready on This can be used to synchronize the start of another run/task/service: task [S] @root:root mdevd-coldplug Finit waits for `mdevd` to notify it, before starting `mdevd-coldplug`. Notice how both start in runlevel S, and the coldplug task only runs in S. When the system moves to runlevel 2 (the default), coldplug is no longer part of the running configuration (`initctl show`), this is to ensure that coldplug is not called more than once. > For a detailed description of conditions, and how to debug them, > see the [Finit Conditions](../conditions.md) document. Non-privileged Services ----------------------- Every `run`, `task`, or `service` can also list the privileges the `/path/to/cmd` should be executed with. Prefix the command with `@USR[:GRP]`, group is optional, like this: run [2345] @joe:users logger "Hello world" For multiple instances of the same command, e.g. a DHCP client or multiple web servers, add `:ID` somewhere between the `run`, `task`, `service` keyword and the command, like this: service :80 [2345] httpd -f -h /http -p 80 -- Web server service :8080[2345] httpd -f -h /http -p 8080 -- Old web server Without the `:ID` to the service the latter will overwrite the former and only the old web server would be started and supervised. Conditional Loading ------------------- Finit support conditional loading of stanzas. The following example is take from the `system/hotplug.conf` file in the Finit distribution. Here we only show a simplified subset. Starting with the `nowarn` option. service nowarn name:udevd pid:udevd /lib/systemd/systemd-udevd service nowarn name:udevd pid:udevd udevd When loading the .conf file Finit looks for `/lib/systemd/systemd-udevd` if that is not found Finit automatically logs a warning. The `nowarn` option disables this warning so that the second line can be evaluated, which also provides a service named `udevd`. run nowarn if:udevd :1 udevadm settle -t 0 This line is only loaded if we know of a service named `udevd`. Again, we do not warn if `udevadm` is not found, execution will also stop here until the PID condition is asserted, i.e., Finit detecting udevd has started. run nowarn conflict:udevd [S] mdev -s -- Populating device tree If `udevd` is not available, we try to run `mdev`, but if that is not found, again we do not warn. Conditional loading statements can also be negated, so the previous stanza can also be written as: run nowarn if:!udevd [S] mdev -s -- Populating device tree The reason for using `conflict` in this example is that a conflict can be resolved. Stanzas marked with `conflict:foo` are rechecked at runtime. Conditional Execution --------------------- Similar to conditional loading of stanzas there is conditional runtime execution. This can be confusing at first, since Finit already has a condition subsystem, but this is more akin to the qualification to a runlevel. E.g., a `task [123]` is qualified to run only in runlevel 1, 2, and 3. It is not considered for other runlevels. Conditional execution qualify a run/task/service based on a condition. Consider this (simplified) example from the Infix operating system: run [S] name:startup confd -b --load startup-config run [S] if: name:failure confd --load failure-config The two run statements reside in the same .conf file so Finit runs them in true sequence. If loading the file `startup-config` fails confd sets the condition `usr/fail-startup`, thus allowing the next run statement to load `failure-config`. Notice the critical difference between the `` condition and `if:`. The former is a condition for starting and the latter is a condition to check if a run/task/service is qualified to even be considered. Conditional execution statements can also be negated, so provided the file loaded did the opposite, i.e., set a condition on success, the previous stanza can also be written as: run [S] if: name:failure confd ... finit-4.14/doc/config/service-wrappers.md0000644000175100001660000000176415054341541014104 Service Wrapper Scripts ======================= If your service requires to run additional commands, executed before the service is actually started, like the systemd `ExecStartPre`, you can use a wrapper shell script to start your service. The Finit service `.conf` file can be put into `/etc/finit.d/available`, so you can control the service using `initctl`. Then use the path to the wrapper script in the Finit `.conf` service stanza. The following example employs a wrapper script in `/etc/start.d`. **Example:** * `/etc/finit.d/available/program.conf`: service [235] /etc/start.d/program -- Example Program * `/etc/start.d/program:` #!/bin/sh # Prepare the command line options OPTIONS="-u $(cat /etc/username)" # Execute the program exec /usr/bin/program $OPTIONS > [!NOTE] > The example sets `` to denote that it doesn't support `SIGHUP`. > That way Finit will stop/start the service instead of sending SIGHUP > at restart/reload events. finit-4.14/doc/config/Makefile.am0000644000175100001660000000045715054341541012313 docsdir := @docdir@/doc/config dist_docs_DATA = cgroups.md env.md files.md index.md limitations.md \ logging.md rescue.md runlevels.md runparts.md \ service-env.md service-opts.md service-sync.md \ service-wrappers.md services.md sysv.md \ task-and-run.md templating.md tty.md finit-4.14/doc/config/cgroups.md0000644000175100001660000000473715054341541012270 There are three major cgroup configuration directives: 1. Global top-level group: `init`, `system`, `user`, or a custom group 2. Selecting a top-level group for a set of run/task/services 3. Per run/task/service limits > [!NOTE] > Linux cgroups and details surrounding values are not explained in the > Finit documentation. The Linux admin-guide cover this well: > Top-level Group Configuration ----------------------------- # Top-level cgroups and their default settings. All groups mandatory # but more can be added, max 8 groups in total currently. The cgroup # 'root' is also available, reserved for RT processes. Settings are # as-is, only one shorthand 'mem.' exists, other than that it's the # cgroup v2 controller default names. cgroup init cpu.weight:100 cgroup user cpu.weight:100 cgroup system cpu.weight:9800 Adding an extra cgroup `maint/` will require you to adjust the weight of the above three. We leave `init/` and `user/` as-is reducing weight of `system/` to 9700. cgroup system cpu.weight:9700 # Example extra cgroup 'maint' cgroup maint cpu.weight:100 By default, the `system/` cgroup is selected for almost everything. The `init/` cgroup is reserved for PID 1 itself and its closest relatives. The `user/` cgroup is for local TTY logins spawned by getty. Selecting Cgroups ------------------ To select a different top-level cgroup, e.g. `maint/`, one can either define it for a group of run/task/service directives in a `.conf` or per each stanza: cgroup.maint service [...] <...> /path/to/foo args -- description service [...] <...> /path/to/bar args -- description or service [...] <...> cgroup.maint /path/to/foo args -- description The latter form also allows per-stanza limits on the form: service [...] <...> cgroup.maint:cpu.max:10000,mem.max:655360 /path/to/foo args -- description Notice the comma separation and the `mem.` exception to the rule: every cgroup setting maps directly to cgroup v2 syntax. I.e., `cpu.max` maps to the file `/sys/fs/cgroup/maint/foo/cpu.max`. There is no filtering, except for expanding the shorthand `mem.` to `memory.`, if the file is not available, either the cgroup controller is not available in your Linux kernel, or the name is misspelled. A daemon using `SCHED_RR` currently need to run outside the default cgroups. service [...] <...> cgroup.root /path/to/daemon arg -- Real-Time process finit-4.14/doc/config/rescue.md0000644000175100001660000000426615054341541012071 Rescue Mode =========== Finit supports a rescue mode which is activated by the `rescue` option on the kernel command line. See [cmdline docs](../cmdline.md) for how to activate it. This rescue mode can be disabled at configure time using: configure --without-rescue The rescue mode comes in two flavors; *traditional* and *fallback*. > [!NOTE] > In this mode `initctl` will not work. Use the `-f` flag to force > `reboot`, `shutdown`, or `poweroff`. Traditional ----------- This is what most users expect. A very early maintenance login prompt, served by the system `sulogin` program from util-linux, or BusyBox. If that is not found in `$PATH`, the bundled `/libexec/finit/sulogin` program is used instead. If a successful login is made, or if the user exits (Ctrl-D), the rescue mode is ended and the system boots up normally. > [!WARNING] > The bundled sulogin in Finit can at configure time be given another > user than the default (root). If the sulogin user does not have a > password, or __the account is locked__, the user is presented with a > prompt: `"Press enter to enter maintenance mode."`, which will open > up a root shell *without prompting for password*! Fallback -------- If no `sulogin` program is found, Finit tries to bring up as much of its own functionality as possible, yet limiting many aspects, meaning; no network, no `fsck` of file systems in `/etc/fstab`, no `/etc/rc.local`, no `runparts`, and most plugins are skipped (except those that provide functionality for the condition subsystem). Instead of reading `/etc/finit.conf` et al, system configuration is read from `/lib/finit/rescue.conf`, which can be freely modified by the system administrator. The bundled default `rescue.conf` contains nothing more than: runlevel 1 tty [12345] rescue The `tty` has the `rescue` option set, which works similar to the board bring-up tty option `notty`. The major difference being that `sulogin` is started to query for root/admin password. If `sulogin` is not found, `rescue` behaves like `notty` and gives a plain root shell prompt. If Finit cannot find `/lib/finit/rescue.conf` it defaults to: tty [12345] rescue There is no way to exit the *fallback* rescue mode.finit-4.14/doc/signals.md0000644000175100001660000000340715054341541010772 Finit Signals ============= Finit is often used on embedded and small Linux systems with BusyBox. Though Finit comes with its own tools for (poweroff, halt, reboot), for compatibility with the existing BusyBox toolset the following signals have been adopted: `SIGHUP` -------- Same effect as `finit q`, `init q`, or `initctl reload`, reloads all *.conf files in `/etc/finit.d/` This also restarts the API (initctl) socket, like SysV init and systemd does on USR1 with their FIFO/D-Bus. `SIGUSR1` --------- Since Finit 4.1 this signal causes Finit to restart its API (initctl) socket, like SysV init and systemd does on USR1 with their FIFO/D-Bus. Finit <= 4.0 performed a system halt (like USR2 without power-off), but this caused compatibility problems with systemd and sysvinit on desktop systems. Hence, since Finit 4.1 it is no longer possible to halt a system with a signal. `SIGUSR2` --------- Calls shutdown hooks, including `HOOK_SHUTDOWN`, stopping all running processes, and unmounts all file systems. Then tells kernel to power off the system, if ACPI or similar exists to actually do this. If the kernel fails power-off, Finit falls back to halt. SysV init N/A, systemd dumps its internal state to log. `SIGTERM` --------- Like `SIGUSR2`, but tell kernel to reboot the system when done. SysV init N/A, systemd rexecutes itself. `SIGINT` -------- Sent from kernel when the CTRL-ALT-DEL key combo is pressed. SysV init and systemd default to reboot with `shutdown -r`. Finit currently forwards this to `SIGTERM`. `SIGPWR` -------- Sent from a power daemon, like `powstatd(8)`, on changes to the UPS status. Traditionally SysV init read /etc/powerstatus and acted on "OK", "FAIL", or "LOW" and then removed the file. Finit currently forwards this to `SIGUSR2`. finit-4.14/doc/build.md0000644000175100001660000001433715054341541010435 Building Finit ============== Finit comes with a traditional configure script to control features and optional plugins to enable. It depends on two external libraries: - [libuEv][], the event loop - [libite][] (-lite), much needed frog DNA > [!IMPORTANT] > Most free/open source software packages that use `configure` default > to install to `/usr/local`. However, some Linux distributions do no > longer search that path for installed software, e.g. Fedora and Alpine > Linux. To get finit's configure script to find its dependencies you > have to help the `pkg-config` tool a bit if you do not change the > default prefix path: > > PKG_CONFIG_LIBDIR=/usr/local/lib/pkgconfig ./configure The configure script checks for all dependencies, including the correct version of the above mentioned libraries. Currently required versions: - libite v2.2.0, or later - libuEv v2.2.0, or later Configure --------- Below are a few of the main switches to configure: * `--prefix=..`: Usually you want to set this to `/usr`, default is the GNU default: `/usr/local` * `--exec-prefix=..`: This you want to set to the empty string, or `/`, to ensure the programs `finit` and `initctl` are installed to the proper locations. Linux expects an "init" in `/sbin`, default: `--prefix` * `--sysconfdir=..`: follows `--prefix`, you likely want it to be `/etc` * `--localstatedir=..`: follows `--prefix`, you likely want `/var` * `--enable-static`: Build Finit statically. The plugins will be built-ins (.o files) and all external libraries, except the C library will be linked statically. * `--enable-kernel-cmdline`: Enable Finit pre-4.1 parsing of init args from `/proc/cmdline`, this is *not recommended* since Finit may be running as the init for container apps that can see the host's `/proc` filesystem * `--enable-alsa-utils-plugin`: Enable the optional `alsa-utils.so` sound plugin. * `--enable-dbus-plugin`: Enable the optional D-Bus `dbus.so` plugin. * `--enable-resolvconf-plugin`: Enable the `resolvconf.so` optional plugin. * `--enable-x11-common-plugin`: Enable the optional X Window `x11-common.so` plugin. * `--with-sulogin`: Enable bundled `sulogin` program. Default is to use the system `sulogin(8)`. The sulogin shipped with Finit *allows password-less* login if the `root` user is disabled or has no password at all. For more configure flags, see ./configure --help > [!NOTE] > The configure script is not available in the GIT sources. It is > however included in (officially supported) released tarballs. The > idea is that you should not need GNU autotools to build, only the > above mentioned dependencies, a POSIX shell, a C compiler and make. > Any contributing to Finit can generate it from `configure.ac` using > the `autogen.sh` script. Example ------- First, unpack the archive: ```shell $ tar xf finit-4.3.tar.gz $ cd finit-4.3/ ``` Then configure, build and install: ```shell $ ./configure --prefix=/usr --exec-prefix= \ --sysconfdir=/etc --localstatedir=/var \ --with-keventd --with-watchdog $ make . . . $ DESTDIR=/tmp/finit make install ``` In this example the [finit-4.3.tar.gz][1] archive is unpacked to the user's home directory, configured, built and installed to a temporary staging directory. The environment variable `DESTDIR` controls the destination directory when installing, very useful for building binary standalone packages. Finit 4.1 and later can detect if it runs on an embedded system, or a system that use BusyBox tools instead of udev & C:o. On such systems `mdev` instead of `udev` is used. However, remember to also change the Linux config to: CONFIG_UEVENT_HELPER_PATH="/sbin/mdev" > [!TIP] > If you run into problems starting Finit, take a look at `finit.c`. > One of the most common problems is a custom Linux kernel build that > lack `CONFIG_DEVTMPFS`. Another is too much cruft in the system > `/etc/fstab`. Running ------- Having successfully built Finit it is now be time to take it for a test drive. The `make install` attempts to set up finit as the system system init, `/sbin/init`, but this is usually a symlink pointing to the current init. So either change the symlink, or change your boot loader (GRUB, LOADLIN, LILO, U-Boot/Barebox or RedBoot) configuration to append the following to the kernel command line: ```shell append="init=/sbin/finit" ``` Remember to also set up an initial `/etc/finit.conf` before rebooting! Recovery -------- To rescue a system with Finit, append the following to the kernel command line: ```shell append="init=/sbin/finit rescue" ``` This tells Finit to start in a very limited recovery mode, no services are loaded, no filesystems are mounted or checked, and no networking is enabled. The default Finit rescue mode configuration is installed into `/lib/finit/rescue.conf`, which can be safely removed or changed. By default the a root shell, without login, is started. > [!IMPORTANT] > In rescue mode `initctl` will not work, the same goes for `reboot`, > `shutdown`, and `poweroff` commands, provided they are the Finit > versions of these commands. Use the `-f` flag to force the action. Debugging --------- Edit, or append to, the kernel command line: remove `quiet` to enable kernel messages and add `finit.debug` to enable Finit debug messages. ```shell append="init=/sbin/finit -- finit.debug" ``` Notice the `--` separator. To debug startup issues, in particular issues with getty/login, add the following to your Finit .conf file: tty [12345789] notty noclear The `notty` option ensures reusing the stdin/stdout set up by the kernel. Remember, this is only for debugging and would leave your production system potentially wide open. There is also a rescue shell available, in case Finit crashes and the kernel usually reboots: `configure --enable-emergency-shell`. However, the behavior of Finit is severely limited when this is enabled, so use it only for debugging start up issues when Finit crashes. > [!CAUTION] > None of these options should be enabled on production systems since > they can potentially give a user root access. [1]: ftp://troglobit.com/finit/finit-4.3.tar.gz [libuEv]: https://github.com/troglobit/libuev [libite]: https://github.com/troglobit/libite finit-4.14/doc/AUTHORS0000644000175100001660000000056615054341541010063 Current Maintainer(s): * Joachim Wiberg Major Contributors: * Tobias Waldekranz * Mattias Walström * Jonas Johansson * Jacques de Laval * Magnus Malm Original Author(s): * Claudio Matsuoka finit-4.14/doc/distro.md0000644000175100001660000000523715054341541010641 Distro Recommendations ====================== By default Finit uses the following directories for configuration files: ``` /etc/ |-- finit.d/ -- Regular (enabled) services | |-- lighttpd.conf | `- *.conf |-- finit.conf -- Bootstrap tasks and services : ``` To enable a service one simply drops a small configuration file in the `/etc/finit.d/` directory. This practice works with systems that keep disabled services elsewhere, or generates them as needed from some other tool. Distributions, however, may want a clearer separation of enabled and available (installed but not enabled) services. They may even want to customize the directories used, for brand labeling or uniformity. To that end Finit allows for a sub-directory `/etc/finit.d/available/` where installed but disabled services can reside. Adding a symlink to a configuration in this sub-directory enables the service, but it will not be started. To change the default configuration directory and configuration file names the Finit `configure` script offers the following two options at build time: ```sh ./configure --with-rcsd=/etc/init.d --with-config=/etc/init.d/init.conf ``` > [!IMPORTANT] > Remember `--prefix` et al as well, the default is likely *not* what > you want. See the [build docs][1] for details. The resulting directory structure is depicted below. Please notice how `/etc/finit.conf` now resides in the same sub-directory as a non-symlink `/etc/init.d/init.conf`: ``` /etc/ |-- init.d/ | |-- available/ -- Regular (disabled) services | | |-- httpd.conf | | |-- ntpd.conf | | `-- sshd.conf | |-- sshd.conf -- Symlink to available/sshd.conf | `- init.conf -- Bootstrap tasks and services : ``` To facilitate the task of managing configurations, be it a service, task, run, or other stanza, the `initctl` tool has a a few built-in commands: ``` list List all .conf in /etc/finit.d/ enable Enable .conf in /etc/finit.d/available/ disable Disable .conf in /etc/finit.d/[enabled/] reload Reload *.conf in /etc/finit.d/ (activates changes) ``` To enable a service like `sshd.conf`, above, use initctl enable sshd The `.conf` suffix is not needed, `initctl` adds it implicitly if it is missing. The `disable` command works in a similar fashion. Note, however, that `initctl` only operates on symlinks and it always requires the `available/` sub-directory. Any non-symlink in the parent directory, here `/etc/init.d/`, will be considered a system override by `initctl`. [1]: build.md#configure finit-4.14/doc/runlevels.md0000644000175100001660000000517215054341541011352 Runlevel Support ================ Basic support for [runlevels][5] is included in Finit from v1.8. By default all services, tasks, run commands and TTYs listed without a set of runlevels get a default set `[234]` assigned. The default runlevel after boot is 2. Finit supports runlevels 0-9, and S, with 0 reserved for halt, 6 reboot and S for services that only run at bootstrap. Runlevel 1 is the single user level, where usually no networking is enabled. In Finit this is more of a policy for the user to define. Normally only runlevels 1-6 are used, and even more commonly, only the default runlevel is used. To specify an allowed set of runlevels for a `service`, `run` command, `task`, or `tty`, add `[NNN]` to your `/etc/finit.conf`, like this: ``` service [S12345] syslogd -n -x -- System log daemon run [S] /etc/init.d/acpid start -- Starting ACPI Daemon task [S] /etc/init.d/kbd start -- Preparing console service [S12345] klogd -n -x -- Kernel log daemon tty [12345] /dev/tty1 tty [2] /dev/tty2 tty [2] /dev/tty3 tty [2] /dev/tty4 tty [2] /dev/tty5 tty [2] /dev/tty6 ``` In this example syslogd is first started, in parallel, and then acpid is called using a conventional SysV init script. It is called with the run command, meaning the following task command to start the kbd script is not called until the acpid init script has fully completed. Then the keyboard setup script is called in parallel with klogd as a monitored service. Again, tasks and services are started in parallel, while run commands are called in the order listed and subsequent commands are not started until a run command has completed. Also, task and run commands are run in a shell, so pipes and redirects can be used. The following examples illustrate this. Bootstrap task and run commands are also removed when they have completed, `initctl show` will not list them. ``` task [S] echo "foo" | cat >/tmp/bar run [S] echo "$HOME" >/tmp/secret ``` Switching between runlevels can be done by calling init with a single argument, e.g. init 5, or using `initctl runlevel 5`, both switch to runlevel 5. When changing runlevels Finit also automatically reloads all `.conf` files in the `/etc/finit.d/` directory. So if you want to set a new system config, switch to runlevel 1, change all config files in the system, and touch all `.conf` files in `/etc/finit.d` before switching back to the previous runlevel again — that way Finit can both stop old services and start any new ones for you, without rebooting the system. [5]: https://en.wikipedia.org/wiki/Runlevel finit-4.14/doc/img/0000755000175100001660000000000015054341601007635 5finit-4.14/doc/img/svc-machine.png0000644000175100001660000120032315054341541012464 PNG  IHDRٰtEXtmxfile%3Cmxfile%20host%3D%22app.diagrams.net%22%20agent%3D%22Mozilla%2F5.0%20(X11%3B%20Linux%20x86_64%3B%20rv%3A135.0)%20Gecko%2F20100101%20Firefox%2F135.0%22%20version%3D%2226.0.15%22%20scale%3D%221%22%20border%3D%220%22%3E%0A%20%20%3Cdiagram%20name%3D%22Page-1%22%20id%3D%22kWPdbQoWPzZlr4t6VDQV%22%3E%0A%20%20%20%20%3CmxGraphModel%20dx%3D%221434%22%20dy%3D%22766%22%20grid%3D%220%22%20gridSize%3D%2210%22%20guides%3D%221%22%20tooltips%3D%221%22%20connect%3D%221%22%20arrows%3D%221%22%20fold%3D%221%22%20page%3D%221%22%20pageScale%3D%221%22%20pageWidth%3D%22827%22%20pageHeight%3D%221169%22%20math%3D%220%22%20shadow%3D%220%22%3E%0A%20%20%20%20%20%20%3Croot%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%220%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%221%22%20parent%3D%220%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%222%22%20value%3D%22%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D0%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20edge%3D%221%22%20source%3D%224%22%20target%3D%227%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%223%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D1%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BentryX%3D0.5%3BentryY%3D0%3BentryDx%3D0%3BentryDy%3D0%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20edge%3D%221%22%20source%3D%224%22%20target%3D%2219%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22421%22%20y%3D%22328%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22265%22%20y%3D%22328%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22183%22%20y%3D%22329%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%224%22%20value%3D%22%26lt%3Bfont%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%26gt%3B%26lt%3Bb%26gt%3B%26lt%3Bfont%20data-font-src%3D%26quot%3Bhttps%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter%26quot%3B%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%20face%3D%26quot%3BArchitects%20Daughter%26quot%3B%26gt%3BSTOPPING%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fb%26gt%3B%26lt%3B%2Ffont%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23f8cecc%3BstrokeColor%3D%23b85450%3Bsketch%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22360.89%22%20y%3D%22226%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%225%22%20value%3D%22%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D1%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BexitX%3D0.25%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3BentryX%3D0.5%3BentryY%3D0%3BentryDx%3D0%3BentryDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2210%22%20target%3D%2221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22390.89%22%20y%3D%22729%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22264.89%22%20y%3D%22729%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%226%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D0%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BentryX%3D0.25%3BentryY%3D0%3BentryDx%3D0%3BentryDy%3D0%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BexitX%3D0.25%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3B%22%20edge%3D%221%22%20source%3D%227%22%20target%3D%2210%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%227%22%20value%3D%22%26lt%3Bfont%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%26gt%3B%26lt%3Bb%26gt%3B%26lt%3Bfont%20data-font-src%3D%26quot%3Bhttps%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter%26quot%3B%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%20face%3D%26quot%3BArchitects%20Daughter%26quot%3B%26gt%3BHALTED%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fb%26gt%3B%26lt%3B%2Ffont%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23f8cecc%3BstrokeColor%3D%23b85450%3Bsketch%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22360.89%22%20y%3D%22526%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%228%22%20value%3D%22%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D0%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BfillColor%3D%23d5e8d4%3BstrokeColor%3D%2382b366%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3BentryX%3D0.5%3BentryY%3D0%3BentryDx%3D0%3BentryDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2210%22%20target%3D%2238%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22421.89%22%20y%3D%22868%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%229%22%20value%3D%22%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D0%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BentryX%3D0.75%3BentryY%3D1%3BentryDx%3D0%3BentryDy%3D0%3BexitX%3D0.75%3BexitY%3D0%3BexitDx%3D0%3BexitDy%3D0%3BfillColor%3D%23f8cecc%3BstrokeColor%3D%23b85450%3B%22%20edge%3D%221%22%20source%3D%2210%22%20target%3D%227%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2210%22%20value%3D%22%26lt%3Bfont%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%26gt%3B%26lt%3Bb%26gt%3B%26lt%3Bfont%20data-font-src%3D%26quot%3Bhttps%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter%26quot%3B%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%20face%3D%26quot%3BArchitects%20Daughter%26quot%3B%26gt%3BWAITING%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fb%26gt%3B%26lt%3B%2Ffont%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23f5f5f5%3BstrokeColor%3D%23666666%3Bsketch%3D1%3BfontColor%3D%23333333%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22360.89%22%20y%3D%22634%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2211%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D1%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BexitX%3D0%3BexitY%3D0.5%3BexitDx%3D0%3BexitDy%3D0%3BfillColor%3D%23f8cecc%3BstrokeColor%3D%23b85450%3BentryX%3D0%3BentryY%3D0.5%3BentryDx%3D0%3BentryDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2213%22%20target%3D%224%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22160.89%22%20y%3D%22576%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%2261%22%20y%3D%221037%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%2261%22%20y%3D%22257%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22361%22%20y%3D%22257%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2212%22%20value%3D%22%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D0%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BexitX%3D1%3BexitY%3D0.75%3BexitDx%3D0%3BexitDy%3D0%3BentryX%3D0%3BentryY%3D0.75%3BentryDx%3D0%3BentryDy%3D0%3BfillColor%3D%23d5e8d4%3BstrokeColor%3D%2382b366%3B%22%20edge%3D%221%22%20source%3D%2213%22%20target%3D%2217%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2213%22%20value%3D%22%26lt%3Bfont%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%26gt%3B%26lt%3Bb%26gt%3B%26lt%3Bfont%20data-font-src%3D%26quot%3Bhttps%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter%26quot%3B%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%20face%3D%26quot%3BArchitects%20Daughter%26quot%3B%26gt%3BPAUSED%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fb%26gt%3B%26lt%3B%2Ffont%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23dae8fc%3BstrokeColor%3D%236c8ebf%3Bsketch%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22150.89%22%20y%3D%221007%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2214%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D0%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2213%22%20target%3D%2213%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2215%22%20value%3D%22%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D1%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BfillColor%3D%23f8cecc%3BstrokeColor%3D%23b85450%3BexitX%3D0.991%3BexitY%3D0.434%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3BentryX%3D1%3BentryY%3D0.5%3BentryDx%3D0%3BentryDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2217%22%20target%3D%224%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22480.89%22%20y%3D%22296%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22481%22%20y%3D%221037%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22776%22%20y%3D%221037%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22776%22%20y%3D%22256%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22484.89%22%20y%3D%221119%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2216%22%20value%3D%22%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D0%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BexitX%3D0%3BexitY%3D0.25%3BexitDx%3D0%3BexitDy%3D0%3BentryX%3D1%3BentryY%3D0.25%3BentryDx%3D0%3BentryDy%3D0%3BfillColor%3D%23dae8fc%3BstrokeColor%3D%236c8ebf%3B%22%20edge%3D%221%22%20source%3D%2217%22%20target%3D%2213%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2217%22%20value%3D%22%26lt%3Bdiv%26gt%3B%26lt%3Bfont%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%26gt%3B%26lt%3Bb%26gt%3B%26lt%3Bfont%20data-font-src%3D%26quot%3Bhttps%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter%26quot%3B%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%20face%3D%26quot%3BArchitects%20Daughter%26quot%3B%26gt%3BRUNNING%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fb%26gt%3B%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fdiv%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23d5e8d4%3BstrokeColor%3D%2382b366%3Bsketch%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22361.89%22%20y%3D%221007%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2218%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D1%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2219%22%20target%3D%227%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2219%22%20value%3D%22%26lt%3Bfont%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%26gt%3B%26lt%3Bb%26gt%3B%26lt%3Bfont%20data-font-src%3D%26quot%3Bhttps%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter%26quot%3B%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%20face%3D%26quot%3BArchitects%20Daughter%26quot%3B%26gt%3BTEARDOWN%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fb%26gt%3B%26lt%3B%2Ffont%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23fff2cc%3BstrokeColor%3D%23d6b656%3Bsketch%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22112.99999999999999%22%20y%3D%22377%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2220%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D1%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BentryX%3D0.217%3BentryY%3D-0.002%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20source%3D%2221%22%20target%3D%2238%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22264.89%22%20y%3D%22842%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22388.89%22%20y%3D%22842%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22388.89%22%20y%3D%22877%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22388.89%22%20y%3D%22867%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2221%22%20value%3D%22%26lt%3Bfont%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%26gt%3B%26lt%3Bb%26gt%3B%26lt%3Bfont%20data-font-src%3D%26quot%3Bhttps%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter%26quot%3B%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%20face%3D%26quot%3BArchitects%20Daughter%26quot%3B%26gt%3BSETUP%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fb%26gt%3B%26lt%3B%2Ffont%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23fff2cc%3BstrokeColor%3D%23d6b656%3Bsketch%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22204.89%22%20y%3D%22756%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2222%22%20value%3D%22post%3Ascript%20runs%20first%20if%20both%20exist%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22173%22%20y%3D%22305%22%20width%3D%22233.22%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2223%22%20value%3D%22~C%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22290.89%22%20y%3D%221002%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2224%22%20value%3D%22-C%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%2290.88999999999999%22%20y%3D%221017%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2225%22%20value%3D%22%2BC%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22290.89%22%20y%3D%221052%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2226%22%20value%3D%22-E%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22451.89000000000004%22%20y%3D%22611%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2227%22%20value%3D%22%2BC%20and%20pre%3Ascript%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22266.95%22%20y%3D%22708%22%20width%3D%22122%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2228%22%20value%3D%22-E%20or%20-C%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22547.9499999999999%22%20y%3D%221015%22%20width%3D%2260%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2229%22%20value%3D%22%2BC%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22421.89%22%20y%3D%22847%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2230%22%20value%3D%22%22%20style%3D%22endArrow%3Dclassic%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BentryX%3D0%3BentryY%3D0.5%3BentryDx%3D0%3BentryDy%3D0%3Bsketch%3D1%3B%22%20edge%3D%221%22%20target%3D%227%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22100.88999999999999%22%20y%3D%22556%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22550.89%22%20y%3D%22676%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2231%22%20value%3D%22new%20run%2Ftask%2Fsysv%2Fservice%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22101.95%22%20y%3D%22534%22%20width%3D%22194.05%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2232%22%20value%3D%22%2BE%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22349.89%22%20y%3D%22611%22%20width%3D%2240%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2233%22%20value%3D%22%26lt%3Bdiv%20align%3D%26quot%3Bleft%26quot%3B%26gt%3BE%20-%20Enabled%26lt%3B%2Fdiv%26gt%3B%26lt%3Bdiv%20align%3D%26quot%3Bleft%26quot%3B%26gt%3BC%20-%20Condition(s)%26lt%3B%2Fdiv%26gt%3B%26lt%3Bdiv%20align%3D%26quot%3Bleft%26quot%3B%26gt%3BP%20-%20PID%20file%20ready%26lt%3Bbr%26gt%3B%26lt%3B%2Fdiv%26gt%3B%26lt%3Bdiv%20align%3D%26quot%3Bleft%26quot%3B%26gt%3BR%20-%20Readiness%26lt%3Bbr%26gt%3B%26lt%3B%2Fdiv%26gt%3B%26lt%3Bdiv%20align%3D%26quot%3Bleft%26quot%3B%26gt%3Bpre%3A%20-%20pre-script%26lt%3B%2Fdiv%26gt%3B%26lt%3Bdiv%20align%3D%26quot%3Bleft%26quot%3B%26gt%3Bpost%3A%20-%20post-script%26lt%3B%2Fdiv%26gt%3B%22%20style%3D%22text%3Bhtml%3D1%3BfillColor%3Dnone%3Balign%3Dleft%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BlabelBorderColor%3Dnone%3Bspacing%3D4%3BspacingTop%3D0%3BspacingLeft%3D0%3BperimeterSpacing%3D0%3BstrokeColor%3D%23000000%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22603.94%22%20y%3D%22607.5%22%20width%3D%22128.06%22%20height%3D%22113%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2234%22%20value%3D%22%26lt%3Bfont%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%26gt%3B%26lt%3Bb%26gt%3B%26lt%3Bfont%20data-font-src%3D%26quot%3Bhttps%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter%26quot%3B%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%20face%3D%26quot%3BArchitects%20Daughter%26quot%3B%26gt%3BDONE%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fb%26gt%3B%26lt%3B%2Ffont%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23f5f5f5%3BstrokeColor%3D%23666666%3Bsketch%3D1%3BfontColor%3D%23333333%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22443.94999999999993%22%20y%3D%22375%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2235%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D1%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BentryX%3D0.5%3BentryY%3D0%3BentryDx%3D0%3BentryDy%3D0%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3B%22%20edge%3D%221%22%20source%3D%224%22%20target%3D%2234%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22421%22%20y%3D%22326%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22419%22%20y%3D%22326%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22582%22%20y%3D%22327%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22430.89%22%20y%3D%22336%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22480.89%22%20y%3D%22415%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2236%22%20value%3D%22run%2Ftask%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22436%22%20y%3D%22310%22%20width%3D%2266%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2237%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D1%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2234%22%20target%3D%227%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22274.89%22%20y%3D%22462%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22419.89%22%20y%3D%22504%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2238%22%20value%3D%22%26lt%3Bdiv%26gt%3B%26lt%3Bfont%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%26gt%3B%26lt%3Bb%26gt%3B%26lt%3Bfont%20data-font-src%3D%26quot%3Bhttps%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter%26quot%3B%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%20face%3D%26quot%3BArchitects%20Daughter%26quot%3B%26gt%3BSTARTING%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fb%26gt%3B%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fdiv%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23d5e8d4%3BstrokeColor%3D%2382b366%3Bsketch%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22361.89%22%20y%3D%22877%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2239%22%20value%3D%22%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D0%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BfillColor%3D%23d5e8d4%3BstrokeColor%3D%2382b366%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2238%22%20target%3D%2217%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22430.89%22%20y%3D%22704%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22431.89%22%20y%3D%22887%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2240%22%20value%3D%22pre%3Ascript%20done%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22262.92%22%20y%3D%22820%22%20width%3D%22120.06%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2241%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3Bcurved%3D1%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2242%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22147.95000000000005%22%20y%3D%221014%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22175%22%20y%3D%22976%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22126%22%20y%3D%22976%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22126%22%20y%3D%221014%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2242%22%20value%3D%22initctl%20reload%26lt%3Bbr%26gt%3B%26lt%3Bbr%26gt%3BSIGSTOP%20while%20figuring%20out%20if%20process%20should%20be%20in%20this%20.conf%20generation%22%20style%3D%22text%3Bhtml%3D1%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D1%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BstrokeColor%3D%23000000%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%2287.94999999999999%22%20y%3D%22856%22%20width%3D%22173%22%20height%3D%22108%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2243%22%20value%3D%22initctl%20reload%26lt%3Bbr%26gt%3B%26lt%3Bbr%26gt%3BEnabled%20and%20READY%20but%20waiting%20for%20a%20condition%2C%20e.g.%20another%20process.%22%20style%3D%22text%3Bhtml%3D1%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D1%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BstrokeColor%3D%23000000%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%2290.88999999999987%22%20y%3D%22606%22%20width%3D%22173%22%20height%3D%22108%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2244%22%20value%3D%22ready%3Ascript%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22379.95%22%20y%3D%221132%22%20width%3D%2285%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2245%22%20value%3D%22%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Brounded%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BfillColor%3D%23d5e8d4%3BstrokeColor%3D%2382b366%3Bsketch%3D1%3BentryX%3D0.75%3BentryY%3D1%3BentryDx%3D0%3BentryDy%3D0%3BexitX%3D0.25%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3Bdashed%3D1%3B%22%20edge%3D%221%22%20source%3D%2217%22%20target%3D%2217%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22394.95%22%20y%3D%221102%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22421.95%22%20y%3D%221088%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22391.95%22%20y%3D%221127%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22451.95%22%20y%3D%221127%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2246%22%20value%3D%22%26lt%3Bdiv%26gt%3B%2BR%26lt%3B%2Fdiv%26gt%3B%26lt%3Bdiv%26gt%3B%26amp%3Bnbsp%3Bor%20%2BP%26lt%3Bbr%26gt%3B%26lt%3B%2Fdiv%26gt%3B%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22393.39%22%20y%3D%221084%22%20width%3D%2255%22%20height%3D%2224%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2247%22%20style%3D%22edgeStyle%3DorthogonalEdgeStyle%3Bsketch%3D1%3BorthogonalLoop%3D1%3BjettySize%3Dauto%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3Bcurved%3D1%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2248%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22463.95%22%20y%3D%221105%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22646%22%20y%3D%22996%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22512%22%20y%3D%22996%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22512%22%20y%3D%221105%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2248%22%20value%3D%22When%20service%20signals%20%26%2339%3Bready%26%2339%3B%20we%20call%20the%20ready%20script%20and%20then%20emit%20the%20%26amp%3Blt%3Bsvc%26amp%3Bgt%3B%20condtion%20to%20trigger%20other%20run%2Ftask%2Fservices%22%20style%3D%22text%3Bhtml%3D1%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D1%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BstrokeColor%3D%23000000%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22559.9999999999999%22%20y%3D%22853%22%20width%3D%22172%22%20height%3D%2288%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2249%22%20value%3D%22%22%20style%3D%22curved%3D1%3BendArrow%3Dclassic%3Bhtml%3D1%3Brounded%3D1%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D16%3BexitX%3D1%3BexitY%3D0.5%3BexitDx%3D0%3BexitDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2243%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22597.9499999999999%22%20y%3D%22694%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22342%22%20y%3D%22662%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22294%22%20y%3D%22652%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2250%22%20value%3D%22NULL%20conditions%20are%20also%20conditions%20...%22%20style%3D%22text%3Bhtml%3D1%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3BlabelBorderColor%3Dnone%3Bspacing%3D4%3BspacingTop%3D0%3BspacingLeft%3D0%3BperimeterSpacing%3D0%3BstrokeColor%3D%23000000%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22440.39%22%20y%3D%22762%22%20width%3D%22143%22%20height%3D%2251%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2251%22%20value%3D%22%22%20style%3D%22endArrow%3Dclassic%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3Bsketch%3D1%3BentryX%3D0.539%3BentryY%3D-0.017%3BentryDx%3D0%3BentryDy%3D0%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20source%3D%224%22%20target%3D%2257%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22506%22%20y%3D%22533%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22671.9499999999998%22%20y%3D%22634%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22420%22%20y%3D%22327%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22390%22%20y%3D%22329%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22342%22%20y%3D%22327%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2252%22%20value%3D%22cleanup%3Ascript%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22237.89%22%20y%3D%22346%22%20width%3D%2293%22%20height%3D%2229%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2253%22%20value%3D%22%22%20style%3D%22verticalLabelPosition%3Dbottom%3BverticalAlign%3Dtop%3Bhtml%3D1%3Bshape%3Dmxgraph.flowchart.or%3Bsketch%3D1%3BcurveFitting%3D1%3Bjiggle%3D2%3BfillColor%3D%23f8cecc%3BstrokeColor%3D%23b85450%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22554.9000000000001%22%20y%3D%22526%22%20width%3D%2253.05%22%20height%3D%2252%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2254%22%20value%3D%22%22%20style%3D%22endArrow%3Dclassic%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3Bsketch%3D1%3BexitX%3D1%3BexitY%3D0.5%3BexitDx%3D0%3BexitDy%3D0%3BentryX%3D0.043%3BentryY%3D0.57%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3B%22%20edge%3D%221%22%20source%3D%227%22%20target%3D%2253%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22671.9499999999998%22%20y%3D%22714%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22563%22%20y%3D%22556%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2255%22%20value%3D%22%22%20style%3D%22shape%3Dimage%3Bhtml%3D1%3BverticalAlign%3Dtop%3BverticalLabelPosition%3Dbottom%3BlabelBackgroundColor%3D%23ffffff%3BimageAspect%3D0%3Baspect%3Dfixed%3Bimage%3Dhttps%3A%2F%2Fcdn2.iconfinder.com%2Fdata%2Ficons%2Fhalloween-scarry-hand-drawn-black-1%2F257%2F16-halloween-skull-bones-scarry-skeleton-128.png%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22614%22%20y%3D%22531%22%20width%3D%2242%22%20height%3D%2242%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2256%22%20value%3D%22Wait%20here%20until%20the%20PID%20has%20been%20reaped%22%20style%3D%22whiteSpace%3Dwrap%3Bhtml%3D1%3Bshape%3Dmxgraph.basic.oval_callout%3Bsketch%3D1%3BcurveFitting%3D1%3Bjiggle%3D2%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3Bspacing%3D9%3BfillColor%3D%23f5f5f5%3BfontColor%3D%23333333%3BstrokeColor%3D%23666666%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22481.89%22%20y%3D%22147%22%20width%3D%22112.11%22%20height%3D%2291%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2257%22%20value%3D%22%26lt%3Bfont%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%26gt%3B%26lt%3Bb%26gt%3B%26lt%3Bfont%20data-font-src%3D%26quot%3Bhttps%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter%26quot%3B%20style%3D%26quot%3Bfont-size%3A%2016px%26quot%3B%20face%3D%26quot%3BArchitects%20Daughter%26quot%3B%26gt%3BCLEANUP%26lt%3B%2Ffont%26gt%3B%26lt%3B%2Fb%26gt%3B%26lt%3B%2Ffont%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23ffe6cc%3BstrokeColor%3D%23d79b00%3Bsketch%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22276.9999999999999%22%20y%3D%22377%22%20width%3D%22120%22%20height%3D%2260%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2258%22%20value%3D%22%22%20style%3D%22endArrow%3Dclassic%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3Bsketch%3D1%3BentryX%3D0.004%3BentryY%3D0.563%3BentryDx%3D0%3BentryDy%3D0%3BentryPerimeter%3D0%3BexitX%3D1.012%3BexitY%3D0.544%3BexitDx%3D0%3BexitDy%3D0%3BexitPerimeter%3D0%3B%22%20edge%3D%221%22%20source%3D%2219%22%20target%3D%2257%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22671.9499999999998%22%20y%3D%22704%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22672%22%20y%3D%22771%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2259%22%20value%3D%22%22%20style%3D%22endArrow%3Dclassic%3Bhtml%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3Bsketch%3D1%3BentryX%3D0.5%3BentryY%3D0%3BentryDx%3D0%3BentryDy%3D0%3BexitX%3D0.5%3BexitY%3D1%3BexitDx%3D0%3BexitDy%3D0%3B%22%20edge%3D%221%22%20source%3D%2257%22%20target%3D%227%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20width%3D%2250%22%20height%3D%2250%22%20relative%3D%221%22%20as%3D%22geometry%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22530.7799999999999%22%20y%3D%22530%22%20as%3D%22sourcePoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22530.83%22%20y%3D%22597%22%20as%3D%22targetPoint%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CArray%20as%3D%22points%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22338%22%20y%3D%22483%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmxPoint%20x%3D%22421%22%20y%3D%22483%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FArray%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FmxGeometry%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2260%22%20value%3D%22removed%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22484.86%22%20y%3D%22534%22%20width%3D%2271.14%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2261%22%20value%3D%22scripts%20done%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22241.32%22%20y%3D%22459%22%20width%3D%2289.57%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2262%22%20value%3D%22*%20manual%20%2B%20(re)start%26lt%3Bbr%26gt%3B%26lt%3Bdiv%20align%3D%26quot%3Bleft%26quot%3B%26gt%3B*%20runlevel%20change%26lt%3Bbr%26gt%3B*%20removed%26lt%3B%2Fdiv%26gt%3B%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22509%22%20y%3D%22441%22%20width%3D%22137.05%22%20height%3D%2246%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%20%20%3CmxCell%20id%3D%2263%22%20value%3D%22only%20if%20removed%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3Bsketch%3D1%3BfontFamily%3DArchitects%20Daughter%3BfontSource%3Dhttps%253A%252F%252Ffonts.googleapis.com%252Fcss%253Ffamily%253DArchitects%252BDaughter%3BfontSize%3D14%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CmxGeometry%20x%3D%22280%22%20y%3D%22415%22%20width%3D%22114%22%20height%3D%2220%22%20as%3D%22geometry%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FmxCell%3E%0A%20%20%20%20%20%20%3C%2Froot%3E%0A%20%20%20%20%3C%2FmxGraphModel%3E%0A%20%20%3C%2Fdiagram%3E%0A%3C%2Fmxfile%3E%0A+E IDATx^Uօ9c@L95sbX0Y5D1#`@qUAPT@&Uu" 驮t}s-%8#8#8s'sS?#8#8#8pGpGp'uGp!{~&OMVSRR5jTӢEK-[ﲲ2pNCtGaȑ#dCYfq?ӧA0aBvvYi'H>jG#d~y#8.SLQ;qD%#Fƍ &MRRUYdE5ʵ1)gx;vlk_}8'58##***СCç~??hTZH.V^yZk)qyꪪ*!ж~ ǏWLqU _nŠ+?< 4(poa 7GP9#e{%F!ѣG+` :4i2-mH{>:UlH48n7VoFt6 +mۆ֭[S*0`>ҥKر\F8AɷqGX/|duŒb 1)Vjko[j[ǾqcsL4,,Fƺk~P_}UU!lZ;'}?#8@CkZ?Xe뮻23R̾,uHyLc[H5?lkJ7bJa?O> }ҍ ?W^{6m9}@@CDvC|UGp0'|2曪<kF׮]5R=;sm,!f)PcE܈6M6"}ql1c2 UV~;wwp??o8#xh[AcQzl~#A繼z 5 ܬLm (Yo:#ڐjȻd66lX8p`;ca l׍G8#0u]=u0zP::GpL˾cm.|~줄y62m #v>SLhCc?x#y;)6&RX{16|?c; ' % tG0ٳgXjGjo[P,%p^.Ɏ-)Hu73 6u#3sֹcVBw7z p 's8#P@}衇kNpGOFw sV_-.,FrЈ)d8km*zm$mphpox5> |$N8# PȪ-q)yB= 7Ķ([uֱ$>q 'y$zℕhǓb H6 .@niܹs=3|G8#'#peo6`w(2V{ylEY͵ڈ]+Fg vml_ĩ%6^Gq~1юUs>{>mayW×_~{pUWO?]8#dGpK/^xgTIʘhiܐ?+\42rbGŞlK")NGjS-;NLmslkoXeJy +bXjBrwaϫ/ĦrwSN9E?C_Eg4R@>hF#lSmq3|HMbx1msaiK/@"Nߐ!CTfmoN;:t7PZHGp_~EmND2$s9GI47o%˨gu<Ѷ8iӦ[L'/J6r#?^Y32oռ-#栵%Xgɘ` h:nj_~ 2~\8G^†n??.Ļ{Gy$/×ws$N8/}p7jcSvr 7pZ@ [lEx+."?f.}Y8ctoJ9G|ᩧ: +mb8em9O?v>dnO #G ^{mԚ˜ F2L,0>ڮs.]yc.0?xhi&NDm^u=d/#Pm#Gp=(hkLbT5XCoJSHI.pm)YtBtctLp?x"\YږAC,*X1 {J飪/O?4l<1,-,}^V 5j?ŒE 4AUK?p%猗+zJ3 znF)ɧqu ͚5S+-fg+Qw}up{/8ٞۈGp)?(k^$W҉O2*/do߾Jb!޽{VR GF,O2Eۓ?*6plU>S@8$@ɨSN w\h۶m8C#DŒG 0>TE]4ԣH^Uk&lgw1|JQmC>[~m3Oֳ',%O=T_N˖-'s:N+sG)?,FGdyVR+}>CUQ9֠AیB߯ɐtTf,c+ 9>焔CzmL&s'2r̈́aذaJ/[g$ϹT"6?K%Ra+ l3`Au]07NSWPzm7ͤI%\ũ`DN_Gɶ#8  VH-F t{D[TjZ[uml&op/NPr I1|oFG :CQ)xyb!c ~[K.)L믿VO:v"[jdYEl (ьBbUn\q3yd=>Pɘ!6&g=g2|ppl=8#@@ Sb kn~/ۈ6r\Gu bMk\k+Dy6ia=lb9/<ېq8 $Jcښs}4cg*YϘI/`A5Gpl=8#b !1#N0h9F|@ĈhܚݔۘdDk<ߴ6m]|8üŢqxqykcDŽݲc u]b'!ud_Gɶ#8 #F㦛nGAɶ #8S_~y%QiC5V (Ffcewn24)F!>tQbKh"uŊ.ի*㶘jG h4&\i& C!#GTъ+~A;E1f?b7_*,sb-8xs|)|nE` &|jGp#8@@?6J3d` dsW7|M%VH!N;xԩڊbBN.+4':(m1Ps!(۟~m5>JckdBNb cA{9m.΅z|I'u0#MOlq@P jVkThC}z{lXy啵 ޫdž!xCiӦ:.9 {982 fC{x0`2f5;/{=#9#?xU<,O2jKc9F6 LC!Xo۶KT6mڄ^ZU`Ts)p'|2˚6{ ޺\r8yk m-Q-ۇ mi3Nn=8Ј6ن4CQiqM.9-!t;-ё̹XP }=3wpD1grLo> ~JGN"dN,>(GpEꫯVB/ږÇkŊwYZ`(bT\xms8mQlc#yꩧTنNz}Ѵ !b2yc;v֭[e]VIEa!ZwP j & r=lH;aR%R&*~ݤ@Qsٶ_|JڷrKGp#8@B$!~Cc )Ґf|RO,w]}LJCxY,m NBpS!f02b0z'h#@;t׀%}*ƞ!n;9acἌv˖-u Yqv6v(xQyh?Ekd`̄Gp#8@CV1lX{|+v'6 ضXҖ +$|G5/Y=&<_[7Hkn$7>Vb 6pCU)ŒG ;R.6\QnA3p'tGG&uli0hd5O !JK.IyѶs Hs1mg;421uTM )+ȾuZ3bvS-c,nM G)p#d Gpioa5TbH0OxchIt"bikkc~;c%6 t#6!nJ<1@:|s#8s'sL?#8Gu0 YJXg Y3#q SJ v\iœԉ IDATҜKUwɮMbM1}Ǔ |\+a)h'%\6mG'~w8#4(~pwk}6mTܘ#F!ֶ|XLŃYK1JL- T;zĉe]~<ȓXN7Bmœ^zv$gG9NqGhp~ڄƢb|a1+Շzh۵"'i6[%p >v{キm縜_5It$;4#iC_?s9u}=q\rɰ&;LCǞ={#Fh u3d<0O8gŜ$F(V< g2s=zEY;~AFFԏ8#P'袋|^y:bDRJA#14K ]%頸+*q ]ts|JiDCF.]k]tQUw[o=M/~dr 7n6H2t<<<,i/ h3 `L̦S'^l#Pp]_#8mYgڥQZ]lrg`["$>PݪU+=?9tD F7nn!ِuK/$:SҤSN!:drIC=ݲ_y믇? 0!.m\gӦM%/#0{8ٞ=|+Gpz ncػgW[rG1Em ElE 80xjԛCQF?}͛bbû?l?̎#8(a$Dl6S8|#ֈoy%бGGÝo>0cZkd]v Gu𴝇[1%~%OnJa4~srovkUoxwKC_~‹/[ ʺ/#pGp)_|fCc8#=3][v\< a-b+ن:0Z5 4G۰uO?I%+f{;vwnw{N%?To\Ѯ7{#d{>Gpy?/$xv kf)LX2\2nnCo m ;/ع l1Ds0F#qgbD9cB"#9N;pG"'=vm nL-+yTVDo z3dG#LA7`=onluaҤIUAp[na;u'u8#C#?ZibMwj~xt$ۯI7vF;#`"p'kk;*q{͏ qk+d{kn;+֭Hۦ>o.53^W^9t9 Wl#8u{/w}=(dMf( ̷-/fFM rl3)Vo#fq Q>2amnܸ[mUlB֭ #q(N 8#P7xc؈Gzuq$^hs/\5qYg1ڥLwfR,$Vcm>NBq8bpb}Ȑ!Zx8W]uЩS8'l?#8Em>n-X[gQ˞~4d 6PĉhI&ڱ*$Km&q/ĴEq Q}t裏R nEK,,8^@_xlGpD~駟#8BUꫯZ/ GBCZuYJ< 6<>ͥؒmD5o\/.JݢE ]oD9VMUXf2=z0n8%$y۴i`2گ+8ٮ+pGOGڵS2$OĻ+ꪫ(׶@k%cǎ _53m*5u,-(SL|᜛}i9ߴiS[nON 7pG"@^z_gyF;HWKAB>}}衇 $vq[Pyj5VVXA_|98'w?#8@=_9mj6-/hXD?{!!:QG9ۦ*[Q#Ņ{V[H.]/# N5p,|;* ӗ_*6_kfT)&.nM,*Q ӟ\(3+ut_%7%լ3V{P#)' )A0ޚsm_D^tf:1ǘg±sק:&v=1Q*u.&"e&4]\Ljȑ?8{9WyFn-qZ8do1ky|'Gp!d Gzixm&}B<RW)Jj(XL˅6kH%KcSRgUSBKYRP'EiX)%FM)r~#Ԧ6E}f˜(dUkͶ1;^J<21`lt[/M# ]fp{wxb2r5pgk[u_G8ٞhG` 0¨ Kw"jH?B S2tQK/_FjJȱd$JM\$PRTD@؉BtTPsgQŪRǪL(2Ob^ ɯ%ĮS[귨)L,jWq\iA$6䥒:B' =62ݰ>YI1ebhs%VP"GhC\"O1'DPdQEZ"{ f`PdF 7M )e_dŤ NbsQ뉑w,*A2!ﲭ^VJ c2!Yy0n~ݫ O>dXD&Mj=Vd D.Nl |cGpf'۳o8u}_'l{-8ETQbPVc8#D,.U!$QZϼӒ]! #ּF?DQoM㤜D)#o%x(fB%68bO-5EՒA5U&٪"Kp޺)t/ yR-D+&E@Tn$qIx\1ߕ.lr%[L޺bm Re? hoD:Eærz߿$(.& ^뮻ng#8s9Aq: _<'lsU[(I^R Y-YةG9 bЎE$2~(z"$9|Ŀ,ǥKZ<4ψ.R6P~X*8 vvĒj9.1J/CؤP"2HuOqGiW)EWN9GLP696TrH tբ~U'Ϭ/IRefS-)(DMi-T[o֔fGorpwN>Ghp8np/_#!GpNZ#I=0y7a%#]R'ldQڌELiUYx;CSugt,iTظE6IE%K_7NaߨA$5W "mٿZ$ Y%K[%N@Mi'D#DU'qbS\ Tn"}77l7:) BIcV-G\̻=E^I)k1bVLdžuN<%t:yG '~o8@G3O 1JsNR.HbZ(ͽV9QI>g Uss*eiajI7xTt4aARyѶMJ`[Fv" nRE^9l&C3_1QQU:B ;ƢIN@l&0FumQtLxL8B IDATЈ'(zd r[1Rwc:wBXf˭8 Nۯh 84# 3xe44Jm!ҍ,w;E3hORzKğ%|t)NJ(4J?lRQiL4aB`ŏIwa3%Eڳ3~\Jr;* ,2yhdkp<cF6BSjڳcI䦔[jfyo) v92y²ti_#4\l7֯X`pʉWQ{RFU5K H )fy[궒oyD]$V<2 EEJ:xq^_H5& <8iZ#ϕ!&5qz4$wO,$Oƨ T# 5zIr\_"^U(]=4DF*VI 1Km@:'BOX(uxq)4v/Ԧ9)U-(WC#Rqz>e!xվ9g ti,Pc@Ƽ(E !`gMk+"kHgG4±(D%Tv1n)L9DϬ'B+$e$͕a붝#+l׫8 Ds&,b[TBD0#BPpbQ<:& aD9Oq>[c R̨ i6ʺZRH',tv>%Z(JUۅ[È QU!Ζ01t2 Qi:C eȳuLj ه7]gHm㔀U閰ZX)j5D7V蹮4ȲlqMk~SH6!HRImxb4IW%[HbsoRFRb6"?WLMbX#2[u#+l׫8ҋJb*KۘR<d#TDj1bjsP(&(ؖbM gZ}Ƣ*GMΐ0B{KB<ɓ NK,,l 5ixV8 ;X y!K%2crp1wº[lL%G͇芢4.ۯɷz*şZ)8"11Y|srNjD1-dZ$ŠLr(Raȍׇ5kXpzzr`G,L2XɶvmJ\R,l-}z+EZ;>e%{bЄ8*^)6 }y.xӵ MZ4Q2(\di /M $#ߏ>,.:E!<c4(|%Yr=KJGW a=ұ)aL6~|a!ZXxMWVN<гg4Eȯ&,Xcty|'tDԣ.$%T&(MźEarOMcMI]&96" t[;ok{|XjM#8 ': &UB(B#S`#(@%ەGz̢B)Ci¢ųmAS5ύ:4_}- #,O{뮻. y^DyK%7SBF}_/=_gl,ꪰ‰-c\AnTTi q}{[m;0q7~<!oƫ WORCC]wMCΛnUei% S}?bKw~"K*TcQE?$/(b7!I#v껇y0'CO(ڮ}Xm8@]Cv]{E|<#0:Ԅ^ |5a.7$l9e⌚MC]x#tv 9(bJʦŹgnְM64暡Cv ^2dHXO~jYqWC? orNꫬqCXoؑ#?RBr~XT:(~pꩧc=V-\øφKDM7v}ۯJա;Ed pбDžr_y9W_ e]$KZυv Ncݵ d(vK%ڊI5v1bse$XdR$92caN -שyW<~oz yGp9N9~BG޿wb;4)k:X {XJ5(SC:Px`( 3Ήsw̑G;{7^ye8B#RB$D7460i:Ur|,_/  l$֑u|HTQ?CQ%Z̨%7 6qpYgwh'D|M> Ou4Ykýޫ-͏:Va󭒖'l Q`ЧG_UoY'3l믫*^C7 gBLT6b0Q&#/=ph׾}ִgd{}`m}Tסz"˗<%`\-%Z8nFvڢXZB}XSku#OGd5 LZnX֪74rUWɽ-퇉>d9M6* [g(6F"ٞM9빣UH:}fg )ېh?{<]OOl9)*W\ROQ~9I^e7~I6g 'ZH1vdGp]L*=\Lf@|^WpI'w{6|6XG>_|~ϲ}v%i$L0P '- Q2dAXQ*|ԋϫҞO= ^ ' [E^y=*BL梪R~o%)!tFF 9 o&3<9ӭ݋죫 &>[lQ39)>'/'@s/ȬfS:Y{%u#=ܽԶN'5?Ŷ{`yBwRu뢿u]}v.o*4ٮ7_Dq(&SuZuP9'7Jr7SzFotMoZ}0)sk(4KJ^L;lЇJQ~ҭ ~w¦lJ7ŔcZCsoᦛ<J䉿HQ/;ŎrxR/&}/M~Y񘷒޶]vMn7T )|Zl+oqhau V{:R0ye6 mYX_0vxXHp:MNÄLfH:Qi$ %e|@t ~zkN(ُz/D]^r&m^DHI%JSP>Cf)I+8e򦏙E%Y'$粿9}<_miY#{TKs΄w vA Ϸw.v̧) 5ߠl7DW~?:1&D.z .lrt[t)?|1^fIYHOH櫮mD,)yfCd>xvj+*+*y7(2C68MIfѲW1_2W+b_d3k lϴCa3ùs 9)+%cQ[H7!j=!n!<;pgTb^!_^(]u a^JYm.֕SN s[I>*چeR.-%12iaO+ր0LCN>Ef2\b|swnJqt}࣏U;o8' gfvؓn -SK,/m$*{{= ?Ozl٧D/,,&L4ϻM>i=N?Co.Qcu[SgPgP^'.Tm}͈>FOo;R _{e"*jh}LM?Cye>w3(|L>ϸǙC;/gvCA$dTZɪXJŃ] FB6Pu(Qv:q6;N:o?ӅbQ0xrE,ڪI.M{ Rx]Ij7HF'{ҐE3bc~h}e|k5_|n?GCQLRmob_|N=hc[?D`15U_sn'מ*BCJxo!7#[OvyүfʾͧMLTVՌ_]|p}U~_cb5_|*a ru>&?2 ix'4F*4i89`[.8){6 ^i.{D"rJeuqR+M40>VS@s`SCm3{LD3H"ط5~g}^ٓ}ە~ 3Ͽ߆ognx V0tUNxF,2H} Ry}[3b%jm$S#M7T鮷/."0MHX7B|#=[=XH DD6uP, )Ԯ^c!dD"ɇĖq{Ĉ(); B.Qm/"mۅ$$TҋB*KjXRB!Tʱ;DP!׊UO/햌kl'~NG]آ- 1rTcC=%c)NR@<];K7!?ۡECZOopq=%}7|myg`4Icd}" DrI:nVHd7^ ߼R[Bc ұC8   pnMe2glT{oraQ}qG`#0B1Vg +t~mBDƺ,(nGoFPk"j1 ݻs.)Qz%r𫯾 H^xAm]|q8A@(̣ds(K!w~שּׁ<`^94,*>;.!QJAStݭBv?<5WۢmepL4zqgP{ *ϑq,)_dgM&;wTuaZ&6to$K[^G IDAT H)ݡ}EfdK. SR/#E[viSRL)USX@RY-B&!ߕBȱUJ i򆤖I[s͢BQ(EsJ^*JtniS+! ܺ6ItyR,OU_ǞV|+BpcMm-҂Tr:VQRNqymP`[)EwJ<)w&4Z\VkLc( (u-qH]cr`HCZ²;afL6fp:tǤGpc>1@V $X2 AlCYRZNwDRLۭ}rJŃdQe͈RiVgD]VEH-8# IتR )W. 9;aҜjRN&5e,c-ISSʃ\Fd-L-M uBlM`l[k7ZFQOĤk9[J)TWK )2Ȳ@y="ϣuyM4[&;,CoGNT~ `}qG hp&\>d{h;·/DNl/#E0ǵuw($tآsej!˪BMV-BUK!~>[RrP)6ʹE+PtM>)!JQ{lt]4rV*)u?ӱ2E/_ałkǦQd̈́@"*=v"d50A Iz~oWu:֌*պ\.r颴dichK(6[C#&4QWR8 ($"utB3Sfl~̑aQQB6FlG:HY"9.SKHfN9D:?B%W*Db@!)LUOxQ )AUǯ\tf.(bi+® ^$lJW mXnr10đ6?tR/ \Ax,m)T@HAtx NhdRRģsU$K&K}Տ-̈5huS&JҮp>$!} f4SH#+tz >k , Jtc)6[kIATTUMb "˘*[-fˈ}>j:{!D [)5yc)ڸ'h$dYp-s]/u?Oc)W?2mԧnN j^hQg +^u6U+vt}4Fί(l[,K;R7 (XNQb?G¤aNwޣ>pGh?ikmF-5LG>"0q%HG %%Vl>g& syl;OBix#[86 -v삤Q ߶fÉ"/j#TLhNY-jIUX//ʽ} TgfQI>n>ޞ>fGha[n׮-$YF4` G 0Q"޿ό%B;Sj# 4keYUURB踘TB~OrZ#톦qh<%RBhmBɳXL;#YJ`R<MFwy FБk%Ȥ!>fRx9*3&NJK:kR/;eF ,m4k{+MZLꪉ4 E] AW;YWJl*KC^uCַQF#,H(پYPP_2KM)}qG"ed[IըVd[H"yܨ{TBh+jG\$(DJ[~ks), r!(ٚA&o"R?P5E2e Ś֨UCF~'Z QI+eŌmε)4I[+U<;$vqB d+NC(p ȏd$ %QTt$r-/,@ְ5*ŬvB|@8@]E`{D%viAe_j$֤HQc: Ԕ xŔ;":KH(oQ!J#z/GȾZzmC[8 ( پEvZ%>!XSijb8uExsԳMBẗ[hzAܢb_t|+b)(A_HaJ!ՕR )$o\JS!Sl"ME4hqľQ^0&Z̘QXbì ;d֛N*rspyB?K8Q'%_xҧvDK 쵓&|y=u_X0lo)IXJMm,6ف pѯp8F;_}BAT]- &Y'sFBX*Fቮp6F2a>e, &b+OGo%(heYKl_Տ Z*&kpC(eL,kW i }S/dɸhM{ S,!E͆?\Țiᤴ/xV)%XTJQQ'Tߪ&QwJRWz㤥|ے8#PWP}aQ"\2KMBc{C+WpG B`O$UXEdIWY}J-RY+j31}3[I-ŀN:mS%[ByTjPXEBqn'rRJlBNG'5^3QB펙D!ZpoRR]En6b,O8!%iP+p1EEC^s]<+Ɗ%Fu%%\ѯ#) [),&9${N M`G&|4$ @z-tgQSFҔ%pT^Ϙ(=!2ƹrx cEa)Y҄U!r DRH#-M&Y-aV,6iQcHI(/Sߣ"'hOv!%KH %iff}3HyUɠާ rq'9]S& A"5<$5fJ[<#\RW87V{$xYvi #kl_3,Fi-̕sG $_{u#T]laH`|Y" 1ѵHSZE Ҡh0)D[~uDM_Ի,牾d<4:1}OYIK:ŔR 5!QԞ=TIXӓߪ>qk$i,SbyM#IsO\&`YFRBiyϘ,"&L>[&4B|a[#8u +o~ i>,V=%D}qG"0w{nH*(YɭhG&rLGri&X2{Z9B-Hr*b77O؂\ϑ"lB6 vVic8٘ҋ}EwH1I#k2kG>hBHE#8u %MWl[fIQ|(R#8uQ/ݽkm%N2@Qz׬ /4&)OtQZ([TvE}Eܞ]U=F%!Hz~T NZ$`I&N=.4s~ڸz+!ϐod"Gcnꄂ"O3^/\=}}_ ]v (~َ#P []xIXH cR\Auh[2?6i e"?q^#)@j_ 'Ӧ+g8lm.c-RWZ 4 ƚS.j\hMdl҆ΟH'dwZ1BF|qO 7FE> B)f 7ui#;c%HhݶoGh$q_ti }h# "dvsL _s]hڶ,5;@BG߽JXDŽo N?~V,bO|곖D".Gі88Vz$yud=1TP3o~p /ib(m&>t,Eٺ.AM5B'$d5|Ql!c@=L4H=uuNJ*g2L1FuZ~)'['_ۼjǑ4)IFQsJ,2N=)t8lu8d{ VZV,fj#yqf[lUx0G<( u{X{@퓓=_>gͲN%#XiNh!YtjR!*Y:FIwtcrdF%OU](E/9 VLzd6fY az?JS뉎M 'S^:̷qum_QȱU24..F>|)3ɇQosOr jb#s |5•WsW櫮 8׏;:TJoj\Q-fIժ^Kwƨ}@()N ȒBE!EmЂڠESmq+u2!R]K Ο,O8"E|o)jCd(UI,Ms6֍$Tk'ǚBFE!\u_irL[m2XG<&qhXx"\SJ#4t7*9+B:V~}#PG={mK4GwD9Q\nX!R,ELؽdZP n,J6J!%dxTШ !tAG.vP6{NkyĤxI8aa~"kݿHFv^:aPGW^DIr4bPX#$@b—A(Ŭg1 *&T0笘PDT>s9Tߝf]P8N0N{ ?>) -z>dJJ Oh~@l"`d[lFerlq`&BaT@Be%is[3RcKbt/϶q7yԲ >eM{W sm%.zJuüJ@ DhDӤSSSz|ZOg-]@ڨTnd+QblZYRȥ^z{9SD_S 'g='%Ц{}JgNOu+y얨T:,RT{A6:wN?UU6;25O`dǥWHv3jd:7-;e4EG*W(+MTQ IGLөT 6Y:C6;4zCRG4sG-)H*m e6g%hP#ׂͦm/Ij{sMmO%ų{2\S<3)IU@f[|)IAJP.W;5hSWoֽ$3- $"Iwɬ>LE{@x^Y"2  ܖLms~TuTOG[4СTޏ+NnQ?zcFv!-":>\%Ք||ne=qHF8 %#WҠcZ5>liGr@D8MQ#dsW24N]D ;'Q=s1Bw.Ct֐U5dqm3*󂯪@@ P0n591;> AFMzlU-3F>35D:uwSVɩ˺[\ /Bx VO@ Yl_8T6ɓl~t4f5Z@ dD`X2]w;O HZB!&3e@O/4*<@@ (Ԅj>Cʐ!CJFB/@9D E5M&]S_;t |^0@@ P2ۭ/Ҽ ndv2*  'Mfy#'s9+ 1 *>n+ e#I5_}ҾO_Ye0@@ P:H߿~s@@ 'MGF_6w3j@ @`ҤIҡC#Ç~@@`-!"ۃlo~#ho_x-l@ (e76=zh9CB@@ lw9,iyGJ˽%?p- !4>_}lij[^kP@ %lTUdd6 ?\uf믿.;S( MO?Sݺg~.m9t- !4>رceZB3dݞIvUvZBh6 |>b-l۲v@@`-!ӥ6-Κcz$?j- !4>|l&FǍ'nm( FO Ͷqd4aikiـ@@ m۶F}]3O0 ŋOfd㎑uU5i= rB߮= 'bCݹ*N'>4zkbd8 rG`ҤIpf@ (6lt4߱Wd [ IDAT%ۺd~['C@n[ szr 'ȿ., ~o6y'뮻n1Z~7oԩSx7e3)0@@ flo|ɲގӰf=Xi}st܉kǡR F%z .ի>;M6>̈W_-k)qСCeڴir}ɇ~(]tvm+.ΒO_?.ҥKJ*\ȳ6hh3 DJ5Hlt4꺙l|Bk@`wРA>Yg%;hoi)_|q}rQG!lo?o]C~WLN*{{lSN1U忤LTPꫯ.RR|t:DiStQ/0#;H>}l k|GSOɕW^S{~y9_N"۹k'宻 ʁ]8;S-WGnVSeWڬY3y'=;Ga[q}&*Vh^zIv}Ձ1\vlYȪliqg|эpiyAb1c!ϩ]H\eɒ%Udfӈ[xԪUko}c=rjg믿v?\:cJoWڜug‘^kN GeqwXyv}ҠCGKJG`ԨQk믿O.zPt'O,[s?xOڷoo~:X i?@RO;4#3Xxѣv /L_zgʿ/#32y-Ȉ#6J-[&>~GlJ;cg^>0ϴʰa駟3g/bO"Zl36x\tAYrUQ{voZ×ӉON=Ic\uU2i$!'Gll7nga[3/>h{ew_J*2B cw-cq$ڶ=V[PǾKѣ|RZ51flC xcC6 hB1$쯿2µ/{FjmӦ8@j֬)~eWQnVk֭+:u2}eI^KvU" i|HHk}ܹ Ccʧ~jol/OPy9[h@\q _UV"H/{GsO#99 0hѢEwH&c !,-Zd!Cd3}g_p;D?WlM cL9>c1b+dz^W Ԑ社WXw6lAbY0Pd /Ȯ&,.g"N߻.+0y֟\rs8OհO(@@`M!@d{%-3cSK׳YS}#(Fa'[ZGA~P((\py`9{.SW^=S^ NIbiFBF)<ˋzi󸟺!GX@L!o!LE#˹;v4 V9~S!gO2\C >8qE EIx(,bs%l|!LQAsQɠAy}gÓ,"<8)OO.4W?ļ".!^X]zv[,b;, F3&Ƿ~[xD{xokK*Ms=g6/Wr ]?*ڥČF<&YQ>g Hn{jl8x3ˆO!r,ZS d3 v [ܸY`1l}|(ҨM_o?S ê < 1),4eF2-/],,#m ddޢ5Ė|ƻ͜D '`FݫXVI3 EQXcj=Evp|R8SkLC'Nh}ss.)`9'>OL3g70 7r߸E . l3O&w&5́dPo#"_| X"Ik:_ZWQIn/S}xQ!HٟP!~<p)!.snMk>1gDن\:&b,&!KH+ Y1Ԇ'Ef,Xa?W ,RS}71ЕEfbx=`65d5ORV8=|2@D>r|F&QNsU#uCY-Z8ø'XPyLC\ T/<Ö/Pi!LӇ8TuWO<ЕQQC`/d_>Ox/m,@,BB k#G%-Μ5ޙK5DCŃi~Yj]:00 2VVxgp!Y8KA fE}g}XƚB-A؇($V3>W>}J5a@q"@6v)7c3YjSBE_T[+`FcPe 5N@ x` -$$h\rϗ :7d>UQ  `dd'>,)zi.s@@%T.9) HcAnw1 %8ۋͩs h2m~'>}{:^ M&H΋l;!vMPM@ v}@~dId/ 05 ^&!~v- e/skڴcABHw6@r~CLI;/)@xw|ļ>^&wl9.ڒc(2.AvX=͹9}*XWGZww8Q/;xV{&_7;}gw_YI7}p/il&kc lxlyϖHK//7B/\6!7"q_Pqrb&3g4rg9B1m78;$ǝϹ`9p#Nsݩ{~?C8濒.>~w)Nr)> `v$v l4?͘Fp j,;<1G9H }2fGޱ mp#^_' mM{s*7/Ł#<`_>yZw3/#k n1_2x@CW5ݯ^@ Pvl> {e*Y=>g~eWTHؠMF /eGD-LI#G8L6is^ѶO*]\ suS4%CX[4, ( ﺻt<^-l{ rRT6m / lIJ@!pWV[IZOfͤgϞBVPG#_j*•@D.J~IF;aXH-Uf*M.],xj/m-jr-SP *l=#FO?]>#i׮j.wNǞe;)oؕ6ȵ^k6(i\tEr]wɯZҺV*ӢE =쳥%lw]$7xЯ@@"`d{$7^/L/;91t+}e*4huY@CsΑx@f̘QV:D:h<󥡻%aÆɋ/(mYgX@ P2lβ'Godǻ-# ʈ.w1_ 8N9y B)<-[4%J=z<f % #;$?O}MW_ʎ |I8ޒ~A$W^yeIRC@}w}W&Mvm߾y\.q逸,nm&  vzINΏlu2ϥj8x饗3ϔ=CߡЃ@ >X-ꫯ6y @֭[ BZ&zEʀ@@\"`d{sS#_~%KKIgueR!J69seoQiN;4[(뮻d@0S$w&}# p8y#mfTwR7;zGw޲h"7n\'ڶmk` %N>dyn{_Q2 (@mlrio&~4r `i=#=$l()kժ%jIZ~ml(?'x /Po+ W#l': O}N?X.,̓(S 64J@!曛23ϔtQYgywJEKj';8-kӿЯ@@"^網iGN<2z3v몫2RJ㏗:wl6~Hڿz{WI'd=,G#C #[M?neX%A-&2dL0AVX!=ؚl: l[o9N*ڵk 9C>}]wu!@2Õrd.y_|Cv5܂XZ~XU  H5l;S =իW'XQGe-";s+r.qT\F+?dMĉN:!@2ǻw.r>Aɛoߞ IDAT]JʕoJ+g{vȿpe@ P.l7r+:đ#dWKK?|4j((9H, Xn_([͛7O+F˯*˗/[lꫯءȖ.{Dj6I*kTZif~w  i7Mom,$̕SO=U~{SgϞ]>Gam~Ft]D}DdML5-H~2Fɑ`q%Z?,4~w>?`[ĄRx1)OB>K# rB AvG{aOpn @ wcA.ۿPcBL/%x|Zj'l"?* ɢ/(P!pNg߮];S]F(t ]xךujRl[g1PI,5(-<`l$E.u>|GC`-Z_Q2 (M6;wwue.m3_2?6^ }Ti6$=giذ{衇JNd]v1$H> SK/~2o&Tv}w ZD_UX$mXt@>=?H`k(##,Ɵd_k2 (/z0dt;?%2+ٞ2Y$=ty̌/TWT(GGcJ* 14[(dD>|xNpYW'NNbѱcGyѐZ4ze^|fYnfOhX :l*_d'dIlEa:-^Ȳ/!#,JBYa^hK/!>$\2لR8 K<" nͬ[d6J@ X(hdάlkpwJwVC[UGߋj+RkHI()Xx7$NjO𯇲jP R]""1'QYa%5GL޸tphg%?)S{?TI"gn6d= xKV\!Y 8kbq 2w7ʒwGGXȠg<#@V?.$'cO(@@ P^_tqdSdbrd8 ? Ġ֐-0DB)y;"%g&_ؑtv{i$٤(#fPtg' % / ;)rId?JG>$¹4Y{rrtlݗJHEIErSP|飏> 0,2e)DUTݿdbS}\@nv-^YCr[ܣyRM8SRͅX ;y.emvmwTnPC \aWY* (l7d$=cv#zB)hn/XPj/^J+W=dg}`66oVJ@ ( ;HK.ϓl?L~ARElH_)(7lJ@$!G+ crnR8HYG6_Z q!sΕy‰w)}|>|ϼxg掹㹦s?~"6麿X~w?'7㎻y] I1~dOB oNz\zE~d{ ɤl=\ԮS<  GJ0[휋QeJ|)=礎篼.UrPQ7PY{nh[J Xʩw}UП]=?u\εR|`Qp5cŎL9, hO&!l ë/Km(u''IrGw8w? !vko77[h$_$b-$h-w7I Gli+=.2_*ۣd;e4߿#K̖eKK:S` #[PyB}_l?/_^+& 1&E4X?ؤq{M=GIw%6+TЊKP' [}Q8ՃJy/s B#{!^F +Ve59W\Kt+UUK*%)U_9@/] +sego;O="Fx!(;/׎c(cv XI9u9ҟupg!5߭/g]봟ܦ\~PQε ͷ5 c\5WsZc:~w?W-Yl_9JVk컆U?g?zpM~,jN/ #NuRldsz_ёbwK#f듻s[2&L}J„'~i]䏝c<}x, &]FRO_qYlO}%-U5\Y*{JLr-Td藹~ NIuU.eRT̓p%MgӤ9hGbib>"+AFcIov̍~^tݢPp#A~.`ѐ-" ~rRq=|c_}T;?_V.Š}LyPp8#0y%N蚈cy'π^ ٮwnEW_~ /^pvYO+v^ЧmjKѢ}"X4V+72r|F9\mva5lwGyve!l+\'gG}R1do>1\])u& 2Ɖ>}'4&ZYnrY|ONK!(o\nAT&(O JHFv!7(ء`ŭmht|{VgVT_56MƻtӄW^@w[H]ڏDڠm gAkr>-W'OsuqQ[?cSwFLSz<4>#O4P2ϘUW?,1A}Dc٨k@_i/^Rnwӯ>W"_|QC?OPPC|뭷>}dT3U@lq6'N<;E0Dݑjc$E\/C 7|c/^0kBdZv򚌃N_~1Eo]iP|THS۬4pDDX[U!$|H%ʑJU ,GKUW@Je+)u%S HtK<&/@5#Ws= sQW%ONu>i4gPy,QRL)R!KpUv* 7JmQW]Ň7&]<̞̞6֬Zg p9iwhS6{ljKӹW]Fv7J!6;*sw)[#?Rghl3Av]N#yVGzޡc$CL]|ֹR׻wt:*E:VJ\/{$ R"_Qtd%$q7&nLdQ]?#c@uQju3yFY2wsO xb. y)^/؈60N~3O"ڙd&1cH"I6x_]#hna $Y_8I/#\O r?rI'ɍ7(^{mqLPg@!`d[w̟dd҃ȶ7&Si/Z1wlQVTوʎ(X$Xy5U*|ԉ#]Hi+YY1 N % F@غ7mD2I- j[S Z| )VbZ]>-URdDL"X묪q [<⩾Ԙ"bS0T$_TWB~;7y;R[;=*,VK1@R91ȲNqHHC18;RHH.u`X d|DOsPt6"SĵOsy. >g{Oښ޿/Q]ImZH5ː: b1V^gLRO4ΜD<%F,x֨Zfz*SOY6.w 8Pڵkh0,I6l|әl(.w$OOds[: .3L'YB L֗cU2S'O6 % X=Ӳl}u+JLlxToZwg;Ҫq~eV %viEZ:GT!<(݈vD6ܷطP4S#I6#JdPJ/G]\ߦ%Cm")R5&*Fʕ׳x(@]~XF%ʧdL_"Jzu͹jʞ->uD0U=Ez- ?\i4wͭ| f;hG,¸g*Ψ;]䴦~[bk)XJ|U7A٪@Q!ߖC5E{刺:>^;RBo}:3 Qbs\Qd1>Hs= zw-uvσDAqZ8K~a=RTؤ E]|ILtY:|$>)M"ddSz}8)=IJ1pzDNL*$OcE/󺛤-t֤G{x8Np_VFUK4/\7i ґggӨq@./XfwY@=+d Oj!iE6cp4чԦ=Scny+t-4T{֔{S}kKZP3Nߺb}b+ QciLa)u6SdZҸղΦRv *kb !EYeҍz uc0aj>k}vߩ.EwS:y£mrW^H2C-#س<0gxl2, l"XPX8\H2))~:5WE0*K8_@# )C V#!cEWd(%ZARɟ?l WTX?H16 yyD ~dG*ͦSN%٨U瓶I*^9XG*ZSW~A& jqO@%ܔt%Ñ,2"JjVgymH1cdQ؝6MVЏ)G݂A8Ń=)궠> 3fNҢۙYWҮO久AnFZH&f!EiŻt/Ȫ[97 VKIv~P3}HkAz.w; f_,HQI3zBLv}̦QQeSҁ,TSB2D[?Ub~nScv-뵾ϛE8;f!pr;HCނ/F2_uQ6o,/sD"b/)b럛(3M%zx:8u$v4Ӿ#$Se0HRSߺeXobС$@@`FR*Lߘd^FzC9S_fܤ阕<ɦ+5E:"κSC+x7]Z2: ur̈S,p.osʱf(ИH$H2" >Tr5!ٕMTwDB8*H . k!!Tq0m-X;9ж&l)\ߦs)\g#, Inkwq0'H= s:}2?uD(hYL;?:j<$ܬ3QҾX#zF$qFOVhosz IDATOJ=VιOrXd~լx0Y$^SvCMQzl>B #SC'CE-8[;%I~jlCysoK\%$AT1Y@&A/ϩ}fPaDkLQ樑%U9E=RB\|.p:ϲi)veijOȨ0`m6q%)0AI:"I=FW˛~ByAD;')>Yw89iw~cՈ@\QeY! ĐzIqMC z/P),9D3hfSJaB[8&E%}G8mvƕ^hx껍^Gy->j⃧ːRM&n&$U)b#qEHȯ}w/̔9#>)p]*?t&8~O}o X~.Lzҽ:~{&y<9{l?ChYJE7E vy pvk~1ڲ0vT,şS&R9 >9%őo['|#xJw}Mu"='|}788}'[Q=϶y/zذaiqQ믿 r-F2ݖIAIys_hD9N@2&&$:g"Ig rxI[POiӦ d%EI>9dff/M*Y|]&!=. +Et+C*JEL#J BɑC]@ @6S t]>ϑ m_*(cY ƾ*8 ַX<9F8i۳P'*Tܖ niF6 l(P+ P]S3mGzSd!HVoP2V kz/ΑiF tz@jF+YX_̦Lr rj?HO3~r` % hD&X֛R;K[$\ǔn,%1l(Y#?(6]AMS#ަ?[;'ZLGo/(ԗ->"y"?=%sekF[VW&bB7ROo՚-SOQQjr Sk H(ݥd,(#GH,m:ŞCZ7<1ry!{,%7,şpĻoBϋAn+h1Fe?>82sZ_ΣDe/.ˊ#7֓3ޖ/(W {W32+#yEU_~is(MklytvId1J)oiqD:lHuvd:O;ڣ NʺW3xI{NLOقQ?#y衇,6S)@ًf[GLl~P]շR\V-6X@$Y>~F?=f0"uH-%h *h+Qi(˾ʖe 3 Du֍VBkbς9^w: ci ~BgHou&"6Fl0khC0#*@3sOZA=.?Q&sQmHntm!Ch!`*(@ǂ| Hd[6X?;Nt0%s'O<jCRo|ҐTbqfй0ImgbSҺ5499wHaBT?cqO$S@Q=aSxkM)?wt) 2M?(ZrWJ:u6$3%e IRs/㛹ĉ#ęv\}N">vVl&ϻ)JN6q"=93nAoSO=eO/yыb: #ۍvޑ'~-%惇H֭K5~+TŞҮMRiClHR3j^<'(gդ~RmKgV 2Jx:) 69 @C].s+GBRy'h/!Ga6ۊ?ǸnD1%4︙;iSFdF ;LOw+w-3>KUR51H ZA a|sRa%@YEԁb@7w,E_f._wxz y@j=Nz?$[n㝦VCluPI gy͏e-l7Scn`BcooڇTo<޺"G˯mlJ1] +G6e]$)ReJWu3)C#~O!ϦPwJ;O5ᆬ%N#z;E'q;N$cNQ套^kFj*Oo^@HlWoHΌf J_(ڔ0Hd{ۋ=~W* i(X4|RJlv R5)TB^9 @AG()yyzŤ]]k_\#5oZ*Z6rq{CrrCo;nF9MQ;!N=Q`$"`i:ݛfgH&݋T,Cpo%ٰa* @,]捴b UV%Y{!\CeP+v7K $mbJ5YgtΛ*J!.p2ypU w$^qDBaTZqiY[bLP3e8kbqE as6,!,P& M׹P~a٥]{qs=ܹs ^ƍ'>hlgʼ-ѷJdRz{(I~hW|I)8YudkBwYN\eD;IwDie I rD3~0O?-\veRnݐdu?0rmݍuʈEV=c2~KtV %^=RWBG6Kҡ$•$nl&c|aJ<,}#ϬlW я,! ل|@mkv٤y9F U݂l2x#R87:E6v@P6DN g<#7͘El$`Lڂ=9QʱG̎=TR%߽u4|m(E4񾪲_ǼSZSZ!ZPo=[Y:Ncs 9 @rtϐPT^DOqZ'H^,E/K3,\ҶmDӑz9Cw9~94}.CO}UU-OV竺I3)qK#ڎ:I}[RyΣnF%\I*x)m'^=q; GyDyO.Vsʄ# ΈCv80blv]R rUVѮ}J@SJ=_䩲hDBh!Η Y-x<_KPQF2;οXGlY`"FDWQ޹'f߀C}F'd+|RrYYTɍA0fwǷNৗ!1x,1)Ut9Ҵ>REb5d;z Ѷ|YMoķ:@vQ`m{vϐgbM՛g28Inx^=L`'FOD$)q?9tʿZu~!..YqSoǣ9޲?;;#}T~:63/s|Bad=x?o{Exz|I#cӻ*C,v}w]<) 1mvi.D9ΩOd2= ;O~`g |H#TQ̙PG@<#ٮ֠p=aNU}p:\iСcrz>'G$r?.J)Jou Hiu!y(NE5$4{D› jUڥ+AI:IY%lmFęķo8i߶8 ^c"(k8/:$H=2%,\&LH\0&$ńj4fA.!Ďd>OqDOguB} s$};qP\PHƶWεYl"~ƚd=:#:Oj5GZ<8O6Y9; -'^_:JOQjl\E83/`1jp嗛='pmEK1e%[LD;)EeZ<'B#M'y3iQO?m'N' P0]pJgz9Ҡc"\I1Jap9YB} yiK1blGK"G|IAvY#N'Ml~?mu4%B X*"xQ]$xv'‚↗Kf fQ~i2pY #;OO~q˥, 6V ۠#%2k3M=R|<٨LdpOh|xg JeQbAMZ`6x\%mc8A h]j'"TU߼xY2LMҤÑ`kymdҨz/J(1v Bp'#V ΧpDeϦFN}u碞E۵1Mh9X&-O]FvIMґD@L*y\\~$ Se"b6cMR3]r=[ڿx.l gɖKϤDd__lPCej=e(;~=3aMV7k<W:l?T*TG-LknhG[F wmQt2*7D\SQbJk@b ȚuEM}&5&IŃe=oL|ިzʰ}` O1DIma-2 FtMkYi VϋYn e#MX3Nx:M IDATFՒdE Ҵ)v /c>Fzzkon{׿lu&,FX@vH>},4ܓuE?_ٜE2o l,2d#lHNUAFaΔK;zU5'3΋+I37h#SA'N-ZA~$l"~SI;ww?4C@yB]EgDag%ۿ~|;nt&j)91aѪxxJkbiǕ]?@ l ,!Fjɥb ( Y +ή(mkJ[H#2J!юfSi+ئ5xĕȸ-gQRg(J̿?kǑwmEo<-XJ4PCsYb' _[(GWC*K,)o!v#Q嶄g#Y7%M!S YgmdZ.m6X^ >ahB6,™݄b9NZ d;d\:@evh1Ʉ‰.H-şgdJz{s}T-1\ǁ۷&=?]w[q`S4DZ@@=,sȲ V&8pˤ0YIT(z?#ygHڵn)nOP,uCv Q}J0SOO+W|+뭷4@Cǜd :?t,B :'}<^n;˒iun> ^v?!C-K T"gZv" v; 4" w8#B%` dut@6Sf<(B?6MK"qq [ʩF 0kE68Cdܛ˶[hB ī{oNF֛% fj6d}RRw7vGѵJE†Gg·\C!&P-5I a!n]{挟q]̐$*Фe+IMgP2k6^hVE:-J-JqTa}5g4oGo, hڬ=QOA(II`b "IgN( (JPg* P1%+Ar$5cb>+wjO:F dWJ(N[^~Ckc *ecL>cG/,Y-ǝXl[_d Χ%uO-]De8S,Le.;RvGӷtÔ=̩^Eg0E)yɏ{9='۳fͲئW /`,/xf%"-$EkPlSGryY֭[_>.;C7uTiٲ{殂fܸqaoMW >~hz3V@11-ZHڵ li绑1瀶oL(qvad;6`7cծ,jQ-,Z/$(%^9mPСT9m9gc=`U3x~0onPNPV\e#r!3:yTy"eŊj|P4hrUW_Ʌ_v/RJٗu)Wπŗ^3cxӛF"8p}'eǶB*%̡$LȈ;5DOޯ_?cl"-m!w\[ziw6[oY0M4W_}U7o.;v_mYfƄ_'X|¼:L&;*VKsNFiGFGv๑IǚlO*??5Tʷ$*Wpn2ݥlc[1Ԃ$G*N8``$Ԗ m^&|0^j^ZUKo~4 N%G|n4|R1<ˣO<'ݻw\~q#)\08B.rٛRz]K,Pinj~VJɣ$ vß2I@{gɤIm;ߕ/ҥJ5do&HG'Ͽ&ׯB I/U03lOիר%ӾNHBGjMw]RlٲE4h`'ZnC?~k{ֻ\;Xz$_]$/hїEo)Xf9:_\ݹySHʴTw@ ER*r@[ $DnhwٸunTʴSf.({ܷ9o(ʞ:Apw3v>$IWg_$gqHWJU3E=䨭fMB3k0յdd˥ f݋Z'S>͏PKݰ[tbVLzv\2/ QMQz ԳKW ? R4ڿY); jwHR)91bÎXzHؑl#7>LdD=wşKt_(pӧeu#h /,84V~"fsΑaÆ| Z2a\lשSd* 3<^*=xD[%&@\e{9r߾QvenPv}+V $9>=O?d F ISݶqVns%Gv gy9^6?@ƿ6R*~X}8 [l5._]ʕ?E{`\$j\Zʕ+'/((o~&!agZxm謝ƛgkhCc`{՜!nl#Mo% QK1ͱ> .oCMvz@ l3W4ߑU`wH9n4 |/QF IRFvn2Xnv.|~r-_/0{"'̆1$JMn$7|%Fn$*(+1U_M r7O9i;̍dS5q^Q^ 4w&k[O1bIIgɚ(EP'0h^I.j'RR)iyf2dP_)Xi ǽ1VmZzKu 䭷[Ÿ^!Z_$Jge佷y݊|[i+sfϒO2t#*#K^,=.(ye#+#L|ip1wܦ2-7߲my2c c;kժ)^$[R@CYSʕ.,= j7|)>ضr?A'bγg@==S7IjJS]ql[,x4)כ2Irķ$VqR_Kf4A tS߬>xS%4Z!|uѢڥrCnIsPJ+Nr͢t5'77g?PN21h>vlG{+vbQ._$-ha]p{gEk{b760!2  _|%%0݀x2 \BI|*d.8YqNH"(%M07b}[.6<dVIY/t)>)宿QN8znY3KOwomn"057/Q\2S[,S9rb^,`cI)]"=aX`2ٗ.Ee(䥗_JNw̚tJ><]&L 9_} äΙ5%3n*0nG*rv 8Q*V^{@ř0҆i.S4WKHuyͩ^]SfG*"Ae>&S&SOh\?bՌ-#cǎMN?xI"\X% ˸[1`)/Agc[$l_?KI0FhՏ>,g5dhH Rp)rr9FlRD5bg֪?V?T^e\<\֨Q#n!g `ӯi˥@SzBw'm`.!|3}fOVm;qIع{F¢{A;񚴩ɣCICC=:ߜұSO=Tq,S 9`aלc_<(.+ԕοȴnʞtzm*@:w/d-&Ql61Ę,Rjgɖ1W_uУ!MdYnC)F;+9 A"b:m~,@ +!%$\Xe?{W*TQ+?4H!#;Uivu#yl@?;K[9wߐ΍Is|Rb TǼ0\iA%UG%g*R\Ѫz7&(]G,N`uAm,#^-otsKwǝWvCuN[[C`KXrZ6]trB6+~,@h|Zx$`D6S4uc=cIk~xX~)u=cWLPXA}_$&NK$ڰ45Y6Ϝ+,Te @Ǐ]ްaAlRY)m7&1h$"2spڵkm<ٲe3JGv#tI\?w$'Nb(jt(F#``[ GG1eZ_'AۦUүmIWCBAGWMלv@_hu5+})0QVÏ&K&W!J8A ǟ, ͔H| ƫ4Q/a 4Y0/h Ϫ_[UH(Z]5ەTFo26>*<`WØ0KÞ'}-<94ǐDMLmCh?I}0*CG_3pCiѪFEW4sKS\ٕ%H/UD;I`0o.aa~}*>|4=sq‚;{Bf)хM%glT'77Вϖ^NȗWN*QAÚ`loߥYj'O~L~_Awbɔι2yo$c6ڒ8PﻥgV1MQ܇UfOĎ$I#xxY԰ذʞgwOfH!=;ak'OJ>Г _ڰ Y5aakKfN}/p$,b8CnN$*9 O8 :W?~&ů3U$Is< pIu$t~RY1DP&ωr7\B{pGv>~QlgF:. I 8 )Ӫm\,)XMI|DX Ҁ)1XR!>űDEZmCJYP,fDש_ 'L!g7>/?nU`߸ݶ!7_ɔۥLR)U^[l^p󭮤 9sfO'#/yG=^[sseL|S駟sSs/ki4AR]Ctܓ?Xc*/;weևTI~ͧUC2AO ;@)%~U ίg[qԈ%-K)YI11@ o~ga=g)Z7v.aǴ̾L|ɄOE%9P)_9K=?Z(jVm{ܽ]Tz~rl~(2_Ǻx X=c81Uy,Yݖ@~;-ө ٵ2j ^UܯsI\_ ;} 4m$~-~Y;^>5_z5dan$\vazdMAy2I_"Kh0.3!BG֭[ǓiHD+!_a g;}{Gv+dþ΂$Qrl LwS_Af72 ^{ lnZ5?*IK !?tjESeٷIz*'ےѯ: ,cPni9c)Uؗ?#Y$6F+(BHUg˧LU%*vwX+NƾuP=fp c ,zjWWn)+-_7ScN".4H2T oɅ:*H)#lZ%S@3 ݴf/+)S.F9M۶#[`ʃww(c WCbxȗ,T#ĆN2%s2[dJbdA8-]ԪY/] h~Ή?vY݀~p Xf9b\ q):lR#s9ʣ>St%m\0Vi~:aZt6XҥKKk+V˻&BvK߻{[PN^CB9/Wk!;QP"rl"9^$eӖ9MKl\pªCԥ< %ߩ\TS̊?Mec_gmLo0Ɛ{ҫ~^Kf9QH`iˠc}t[u,H\q kDZ'90ğ+g"Żh)7*؎_#Y96L9] ai*?|*na$˱[$cړYjJ0DL+} acsqK =q,; Hd1O>0ϒFc^Iz,mn~L~a2ۘҹ$ hr4tǟ'$OmͪjIu<75$3찖Bٞr%HK\D=v e~ 7}5f=JN)_No-yٖH碝ֆk/m}\Ѵ\1)UAkK8۴mc9LLvxhc-2TX~jCl-&}"sΓ,*Ea7eذi&;8]{ܬK.7-m=lR-F[@@,7ڊh,2gGn]xuL]D=ls˦U_Ȳ_W>"7fqa.hM2ae}`t.'hiwL}Xa*{D}LU^K;Q&$oDe@f;r#Ieݿ2m/S}+?u1- +!+Ńwt;&c|fKf y l^"Ge!$&]Cۆ} WCa (& s>AJaӝ@c;m~Dm.+"Z)t T6V5H˸VK~DAvtq8 miL$I?΀YvWIUN+7|9t͹w/@nVe1<غ%ndl\x| (;P7ߓƥʎK4rXq`Abɢ⻑X̰01m@-ObiB>T#׏4lN>]:76>q;JO$Idq^'/uƩ,8>`@!|GD/K%$vxNҒLOxas֧MMu*DPlq~Ҫ*QGC(A2?Qw/SᅮP}m39Q2r[#Y=`qHj  %NC;+R*smu)\+ 06g/x5@/xG.kxǮ>Ljh8N Fe<}mlw6:p0ε`=B_e:xI9l4ٜk7΢-$4{FvT4l !? okgUS{)WOƔj΀W &v|ÊGX X$w#P3m$lcy4{_ F8a7NmsQ? %n*X5,qTχwma 1עa}$z~vOTŝG{5Mܸs$ A4=;Ly:)zR檘hH=X7ߜ$AOr |/ml:&bT5?>N;\;m#دKtw:}1NzL̉%#LjJ'sIn,-,A5Lf hsTpPZ(i`{~Uw$mvɫk . +f>ۖHp')MAjX.$),;APwtAlLasX&}’kB8 ,$ j9fl/@1${Ҷ56NX Β9|bÐs%>aavmԀ|K\Irl#ҀB wŃIcʁ۴e̝]ʒ\u͏Nu@(Ń_IP>j$,tuX.{}pV+TטgP(Ц_ڀJcGelҷsNqn7R k-I5إ$8A`qf2qb-WD{i;P^ۂB e ki\ ? `QSo.+B,P8X r t,&,^d8[}GʞzuOVT wus _>6T㚣qTL&g@:c5c^0ڱw^6ysVۿ_PE ry]80. Ƿ ,'=-T8_| gHN$](s{.rHfswl_-Wl Fz5܇Hr&9kކTQ|s&jFh3F(Hivlԇd@;GK2wC}ͩw>I5v'nrKuRھw${(Qd$I^S5? ?>PJ4J (m9g]`{t$}c!_PJ N?_: 谑kЧ8 xO} 3i hRbccEi̢^*^xpZ=ILd1!I7k&[u/A報(!86y1y_<`C<'}00̷V5pp]u df )Я0 (ľוw>{E T͉;X|9 m ,$i :ט[Lŕ밣^3nqe%z(!&sca ]&}͜Gt*xs^7y^v,l ]2wT۱JYO5Tűhl<+NDuC?!0u]2g黉`Ohtqja08#޹n#Işqӝ; 'jmZ+94 8b7m4+}qs0&hgIf7,Zjӏ W4 a[=/($#ق.+dYzcso\<%-H0;@[ĎF%p0I&8vY븴7h0.I_r3OF(Qpف}J kyx%#+ d4z_o< M,^LB8u21IZ}{];4acf;t=X`0ƍ-ZXAA?1 )>(;@&}y# tx a1߱s0H1cَ4WFPԆ6amvˮBg7A\]Y9kr3>\ ڵx!ϋ00Σ'QP9o3 }tDVv>a`XzKFYkߦ֭#OdLq?TPTv[ dǁf16&P}WĽ?bi}w;#A*Ad2$=%(i zm}I6~?pjj56PXa$HEǺ8 cXbGĝ=9ip6vʵo4ڵk˭Kt.N_١`%I `;> ĸ`k\8Pt֜tw mc;=:y'Q&mM`&6wdyu+>׌~X SϮd%;qXx%WC JOu#I\;N8L{N''LqX0GkarƓl9<#kb{Z fLԢDH[>hJQLr1V=kI.@ FxDB6{Sߣھq k/2@Cbm V㎽$A2оZ V&$ LDX>g _œeG̜ bϊN3;BZ>07d:qXА0^#ARN%'9gqu㏕2oRg)LOWGr4.`/X\ `t]svFa_mrb{ *b ec{(P=}3PK){'hS@(zxɵ uMpt_{fƱVv9k͡aAט{1uŅ_*iذ|3=cýZ g?CJ_2S2WjD&'azm$_|EܹUAd#ܾ[Ov`11y0Q+L2뾤e-yf[ 3$en?ܛm'.NQ4h0(QZG+ xݦ3 '_znrnFs^l)k`[' _ݾ݂4ɠ`p'lؙ)3̀r*9ޒ'֊( iS_O;~ӧ~-HT@N@]ۻ 904l*W:|)5? HşsRPÊjc[-4,$-`;FKRDǹeC8p z wn^,s?]ʞ=boP~]˯9TV|M+ jYHapN,`t%Oz@qV|!1c;Y0\;HA|PBKORmzi]uFsѹKS?~ӞjQ-!g*&t`K9m4+o(:9vƊ:;>= 0Y]8rbxcX\q~\B8MhI8_ f>=pw}EɦЎnOO8Ǫ9=_&8NT+,$ZܙK|ݓpIWt2s&ߚaH62V~LM, TzVVFyi&at}>K~H3IR92RX>α8P|Lװ'?Nhޓ:K{sWiTz8G8qD1qW})G{Qu`3|Í#o\F(^Y~9X @>b1Յ&쵕%Y*Ndu1ԫxKbȘ=6GcY7PfbsK,I$1/}0^ s[i ssq<̷ ɇ`RYօI=€~d#aNm@߾?yXBUV?c= LѨ(3E^1^w#K/"瞟yxZo>ퟂ@ifUFBݞgMTXw$ fKV~7r6 X!I`qdE'l:Y r@sn$h VXwKXD9.lx2ܐxW b,8Fv2 o 0_  a]k:V9ΤN.R[k%4V PK44/pvk;7JG7(u09{C7 YA5@_wc 8^p'lN.% $Ng^CwI0=e|I^y^w O/yzZ;2q`泷&QA00x ɀv@6Ux-Q;MGܾQNt LvOa$*A'Z16_b/%1k֬Eg| EE FI#=g`{YR좋yu~,\e_2R2GbYC@'^^1H5 +#_ڤ -I{;\0{V\62.8Uuh/qqc{vn$楍lL뢌-7sYq} ;hNn:X >/2EoKm ʔCfOha3dT^kF}wlY/# 1>?!uure%_%moh/hhIr~2jHurWyNG0>ZHwpjd?_"A+\5{d!a=>J2zh3ze|\s52bd2oR)Rzr-eӺҺ˝rEOUa2w/qٱO9餓u*eeJWxW/9Kx}hy!b@v9`at'Nܒ]M=/u thB9p)vTH#Sdof|+5kTrRT1MRjٺm,[LG+ҫZɓCIMڣKfrtD2w`RFcY@HȬW ɔ)ScǎǤn tOdc4%*TQ1 `@tVF $ }琽M@;QktE[dXX` =negLH}]Ҥ9/m$Y?gaO<#_֔=ۥ`QreI:@uniܸZԍ2*_!~TkƧ|&+s9RD-Z.]/t, (N}Glvʸw&HN lޭ[asQ}3<|G ה]Rz#zC'7@[?@Gee31o`<)џ~Tu]&XB3gY~2'#?bӲ|"y e/] ܽlWデ|qO!:YdOU#je>&Ho`۵k'}јˍĦ|A2?fbc_}9̢/^k'Ov0L(v@įx8i>Ͽ]eӺulb0Q"E @EwT<9LwfXK ϝ#35Vy@]kAl+{l{iIi#h I` ,)XI>D'J&-IK27^%F6;j_&1Xu`{yK99C1 {lLz}vԃN$v1b fQd0 ]_*IWv^5&N'/.|ϜA`U.|jQIep&!0parw5EۥCҭ[7ճ\ܠjLޡ.[5T"ŔpѓkLۋmW_~& f/]Z~]PʡUד؂ ݳG7顀ѯJ5d` ɕ"peܙW{뤷_juщJ5դSΖ&+9=`𷬘Ok?KSXN9yWZjnw%@;(Fˬ->1Zvgܩ ȿAߟ|~Õ*U񯍔ƍTmv9dӏ˩4%rAӖRhq޸ +qzt b~)q/:mx6q޽-;]I2-e3ad8 v<#f%bX'qG ;cd;?2Si,ZǏ/?Q"E 0#9ht ʌ^Ey@6g wbו`/'L`Bkʣ; 2GX]kbԒFc:x/{X9i(,3&p}"6e6FP\Cܘ"W0=/KxNJ( d.'ȵ\7deMG.fkYT8]wvnE~/hy7ś.#w=&|*~)~d@ f^ߨ 3jZ*LݺJJɷ?ϕ\ިaCbɝ[J*#},\h@}O2MeOZ+Lc,K7g_ƝA(.[<@i⒫Ir/KEALL yEJkꫥr2ҳC }M玲%KQ/){@ʛ#SC*؀Mvn (FUXV& aM'2arԌդ'N$X!F{t 4}"?Nx sɨ`%&.,&Ayd;"#9u;^}zd)T 3O[RYBR܏ u^fXcQ[]9OT  %C'~,'M4W`tAf={IwĎ;op{ ϳygZ!Zb k#:u-%8LAHRIR|̥# -ғO#S]h %yvy,VE @#@$ںyTp:%|V=K/Oqs&ghޱ7^ b.fǗ`P p p}=9zdg+Ϟ~@ v%ݧ,{9rO5 j;朢`tXO=YLS\ЉS;=y' b`7z&axz?U8ouh䕶(m{MST Ә-ÿ9TرanQVpg^vR\)kXrԵ5?ꁜ TViDHbWte]şi4ڰ~%H[<{L!ܗ-4/Z5B/ǺE.lд{խ8M|L"ϜSsB¦sba ?j$_C&1uoEwkMmRm:L?o޼n's셱Ϧu*9%Ɋ$&.WOe{vOacJ|-şsdr}+E?3^Gs 9Q"E }">J#?*G@X7jr!ee󚟥xr$f=|` `%h.1!PGrL$^Ɠ霝FHCc 32@5cT+0p,9 s3Ic+0qG^B#ׁY>i-&\_JP}r l:N:M#sBYJ2~)'UfY>:cT9풻.fJ$-%5eǎ:1͏sQF%h~D4/8!%] m" @1t.IҲc)`?p3Ü{3n|F\Lt]={D9z9ni3y1Yݺu_DK?Rl"ӛ n"*,2ho"HP1'3vvٓɝ_#qmNxL6mHerE @DGj YUR7BH˯LAN6!0T''$%MظAXtr`8^ƒb<~DXs9' c[&IPT`5=v}뀯nPY?oR3ePdk&9ЋJf=i*9֘Za`KQG :IEX߈iѮnppb^BZHO[pOn^)clUtgaWs2xyV>4h5sn$a;\?H|V|U~Ws/,!'lh"߿ii7tS(}y$+pV&-d6#KWT&SI,#m۶X):F?6ǁŋysElX0M6M?|MZ(*ٷm]a`{P9݆˖u*C\36;{ hc/us!qŔ~O-0=/ktH2.q2Fe͚s'$T<5&h*ױ@=~OIan*aQ7\%*2o90>,-݊-P}B̍"]Zb~ ǪL~)X5fEk4ٵJv MF/ yͱiɀ>fׁo^cU7^P,kG?Ne#wcrEh}Wx.~.VXcyks<Ǻl޼YV^m$.Xޣ͛{uNFG7F51RO?U`zx FJq`FRՇE T3r%PJ*=%[b1+؟y|FlZ;GS $Y[ ,œtu%4"KbE  }FIW⣷2\|cЦɇV9sbds{{,%kΏ[ch?V qZZ.@Vxxߟ!s${uv|MR!-4/k|e_=\.od"wvڱ&] Ve>P6. ڎvX=ɠwFDI_|r+}:F=.3q垲'aB"*ٶai;=m)|>Ɩ1O'X@}{Ĭw`{Bևavi)#:X$G_B*)IΪ@jQvq~on6uh7P_k <^3V]!$ΔMݎ y͎Sy7?Î9_vM/Ze8} }U?a:g^o)$C7m}걎~}-%ig6|չX1.L LV%pS[&gR51oyߴ}fP deh}\s5f/l_~kꏛw:k`;Fv y*.A3 ;Q"EFGd^`9AC)yw +y˶ʤ~uc5@nϯ߀tQ"tf"3UlVu͠/ʇQ9 `H8v+uRZaG;HŪe9>%?E%k ̐(#o *9*cu2ʐ6Bc-.v/]gdWbvo_kVh=NwEx sknY#ǪH\?YY7YREd|l!Ţoi[b΂j\M2ܦZ6yG_gZ0JRܘ s?ˋuc8sD,);MP(6=caA˱дk{}Z : w}ZױkƯ-$cLk,^*& "q8~饗,ip\E @`H{MQI 7-^$G ?KJ^>Bu1&<լ@&ym;f)>b?n/ǀ@Ŵ)ci"͘1/I˖+C1@o'ÖmlXس0Zo9Yx3,57)H`ad*#^jܺJWd}yp`0uWCe<̳آm.~+[qE-nb@>5 (Rov<3Ā2΋m[Umn<>;5XBn5h8޳c7ώ[@*.E~w3ovO3SJ&ȬR#̥~~+뱝C `mNRHЍ.\DO֮]E"E#``[#WɎl/Y,_wX^>:<1xb@<. 9~ݺZ <7@Hoz\jQ,li:*E:k K_7{`C8v'>GZ(Q4*rݒ#g4p `{֗RZa,Y"%J/"T=Ct=wҩS(,lC )N<يD-@(*r]K{R]OJ5oy׏?|oHƍHKGE7]$"6|zY^.So{Dg>aÆ`8h 9묳R%uhZp l5j[\ټ1lo֬i!'֩'[j4jժOo#O>$}:2qDiժ*_%?0jxgXҦWQ?U9n^K )ؾ[utևUpن뮻{F"PX1+Of.Al]Y 7 ={%K9Ɇ ҝSĮ2T8ǯЙ,_}/q1|Rnt3mTyTR)f]&]sF)ӪnH)[o>b:ݖ^x! =N6n$Tq[Ŝ̯o_\a҈uFl,,Ǝ+ÇOϟ?_6l(K< XF0j~:pƒ^{h8"zc`[#zޭl`6O3L붇_;IaH/8dѭT\Y)bQK{";|WI;\x\~Cg}f'yf͚VB(TL>?g7nܯ|k~q< }Woitjml׮]:usE?'i=zrHK L6)P )->P4(z^83LK9a„1(/wq1߬SO=UJ.-JNp,ꪫdrܪSNkVu&YVS4h@Fel/ۊ=Z .,_\hh&.եKymQ@`3gN;Wѣ\xq;\_3qg}Аp83f99bYnIX-ZT V<`qT.&o֫:N(if N  o&{EOӺ 홻1ۿ)ؾU Ԫ-e^E7E/M#p޷y<< ]zuϵH3f@ GѱcG.U TMr.`[WSo%j*ؾ(,GqyD-@&M ЈZ#l"&5.Lq@ZB09sv@k8g0K/iH";jdڽk;&510w$čDԢEK;tN Rjr|_v )߮} ;ξh;L KŃ>ji۰ɶ~ÿe4mit4$AN4zcOd*hϦ%$,aIx3c ,=o 8aePBWk֬iY(!A>v H(şЏ3&ygBFg6ml75ٰ$U Cŋ ]T1@l|ϧ~ڴ{GFjAr\<4 +l,OWD-cEX-/uhaߢ>*LIpN[EvjrJe%EPGI gP5#\mm6:Ụ"FGԢD"p0Zm<]{v|jTMzCfD-IRmWhP'_7"w-2Q1:;5%j|G/؁-b}jD:)jlϙKq)E]dتN:n ]r^x}mҤI3=ӎ>2c9V{aÇw6ᄈoѮ:/Jch$k{6zh<#]*gx?3vwڇ~2zlIoѢvPЬ1#_novmv+S.6ox _ 4￿kΏ81cڵ^k]v={Ƴ2lq]r[܌`+-ƚ۪Lkw<ָFWls ɈX55XçꙦm#4cƌBqԩFdJ].]ܽu`!:m}C=Ԛ5knro֘ٺ[}裏!F@{>a|b6ih3cL>Zz>cYbVlK;:9=}D7RO[;"bC %?K/<&5QM7tT`{\ @W_9$8*q0fSޝo=vn8(iƶn4`Ls}L}#pjW{ga)(ER'ɏ?<[C|2[nΰ3[.~}y,1cA?ki3@Jd!ga@ c7>k3a_qmϚ6m,*8[܊miWn{[Z9U 'ϭ۝KQJKl$!ayVZ}Wejo3] Vl$LV.Tk\V qe\:APn뭷F{hv*VVc`{0Q!=4@uaG>-:1 ּs Z4ǖ[nC+OCVh mn f<&6h H^׌or@e]`des)1ε,7X n.Tq``hT|w]&Eb>0sQ0g.`1`$G{F~ɬZfs=Lm˖-l瓇uс2oC 2`$ǸC$m oe /u6y!)jBEngĉEZVB߈%'84-*@$tLofaIYl"+H*4h_gc~h3gV#e ؆FH9GŽϽ믿 5~c뮻ڔ)S3Mzνe]u|༒OFy E̸a,۷<8>?q , B &i]HO6 8sy'1 ˠf_LA^]W9!8Vn[o"'[>֨A]ɧ-AZOLzoA>/(L VI*d$ a\` |䅉+/H@.˖ `/;E;;7_ Kp(^$ e1튦]yI$Aџ i~CLCN2ѪxX@TYq[M/9YUinU3;MH 4 X_l1"ez˭:r?'=Ꞟ$>G)E`1,ld!2I@,B%\ms9Ƕj+jM7Ac@8D40xCcJ6ZJU74X# JLxD#^mt+[Pxە//GHߎ~ՏaM I<-AMWJltx`O{2` [/`tR"F=B8-lp`z$ @ MIgeX.4@>20Ir`]Cj387- FptD%|%tAÔ3 ]VbAk66/$ˢG?E3I+b=&=GtA@l+K`Kv[lצ٨x[! <7@,CU$rY-?ؙUVG>f@?~l$E'G08| y.43j=CQ@ȱ\pan –Wբla[YLSlՋ>+^1KGVT1l+1Yg۲ {vָ]{[scLkYL!*U6f8\ / XV :ВS"ًN3HV1M.@lX?ۨ˽hUbV7{@En6ddrv3)f}^Eg , /IvLHӮ,1c<2֩+RJA&\VdL!cE8C3r(t6|ﲾ ˏe}* ḼGxHV 3&xú~HhEEE{%,~Ht?wdeϪJ}"Jn 8qh0h)|9#e–mmq`ڥK/'>"5r|\;@-Nb5'_/t Nawp,;z}ÌęuYo 3@de;owG!h'χc~ ,.1,pfr"l- J;|2H It`ËB'[:>ᅚ6 ``7p|/~x_;. TT!ź2}M:, >7,P:T ׏$Lt) @u.zWO1nWtsa:va`a<r"J H {x/(5(/n眯iS3#wP;` 쫼oym\+}iS@gЊby |Yɗ;3Zru"HU&084iwós`9 f0zsqSH릛n>£ ( 7NӦMns~2+:a,pxj]`ۓ$K{߮.^ha>!'a) 3VK,C,2rRN,AX)t ps~G\,.箓oe@o p@ۈNv^:d,آ2'b Qv ]_S~vݻ;  c ׸·vee0CëNz?*铡1AA3Xoqd#r xy8ߩS'GX@X֭[{-F F.\xmQސ bvTs. ^w:2Vu4'MYy\擹~;knE7\8滂X}@|3 i08p͘eazn'I(oRكAIY\vٍMwyΆ  vj+F4 a&l͝p `i Y(Pm{M6.8#+;hlѣK%#ap ;OC< jP`6:{rAR gpMϜfQG7&-}7w#P"\.$ˬ-y|-f4ju9ZvpcbjSLq7j~> + WZS\ҳqNϾl? 4#Ȥgf0MR]w|%I%k~fZ}5WEHpτ nf `ř5ׯ;Ѻs?n$ M7'ZAl˅d5׶e7ޤ`[]_####PYz?|` {k@6L3:H3j$*W 97F`~-ohˬvrmAn;YZ ._+G@@B.~~Xē"B.$MC&l+ l)C@@B>A>}ܓ9mjo"r=7*O첃5le{ J&o߾Y+y=6&jl6J+]2 1F F F FT#1W3~αL-%kܮڴ`{ +{(2kEl11115۪mиm{kY1O l/) .f"5F F F FTHē91bbbj65^yk{jm,fy6$횽q111|GI11156 %kߕX9m%>|wܹTIy۲kJ7r6ZYKG####7x5ڷooqR@@@@ E,T.M-&Vŗ]ֺ_ze Fm@@@@:n޼W -F F F Ff"o Umֳ[]U3g####P*[o=cְaC_ctbbbbj(7mKHfmmd-lu(={z ctbbbbj(m,k-u1ldfm+i#믿nճ3fP2`{sTlmT`:tv.$l~###Pp-˿ŔC|mgl/mx=@=_`;`?ٮ`X"خw###tMg####PCpŖ`馶¶{f jb=ӈHG DE@@@F[Y&K l"Wٳ{v}",bWJ@@@@ E"K-e+l}5vݭ~Fi#{wb8ުc0`[6~m N}@@@0`=ږXb bPbbbbj(Ov%߱`{=KF#"خw###P*z >7nl?sN@@@@ Ef{>X=a_69N#6F F F F N8 b͚51'F F F F"P̦J;T=fYؾN#6F F F F ;N?tkӦM81'F F F F"dm.j+lmm`kӈHG`СvqY۶m>8b6uNTlﳧj\{C Fm@@@@:W_}vaֱcG7n\ N@@@@ EvAzλخ/=*q111"pu`:uw}7F'F F F F"0gPh}Q7i#p7>cݺuW^y%'F F F F"`[l m]vvAݺuk4ncbbbۭ_~馛O?####PCl{1:uWleu 7i#p=.bn=1811115))QM=@` lu(v߾}]JB%bbbbj&-mut=of"5F F F FT}Qӧ{v%P+*&- 5[j4ncbbbرcmֲzȶn; lE]3W05F F Fv{-<)F`GO?oi?'5Y\gA۪9{[M}~V4}mzX("PPP G̤ddK^c'?w?g߿`_~%ZV]4mj۵%_Ǝ18F&#{l"= 횼q116pM`37jhK^ ]4c7slf?V'=J[Ok=\~* d|Nba vPߙ)dV@/e?S6GZޛ./I~u/o;Y;z90oKWgm,>eR]]٧V[AVn5Xfkq +I617߰6in-}c6坷x)3~?ίkiK~e6;l2"OuA?nc^_@@@# Tyg_S"M믟~~_ ,GAX+_P uA֬Ee="x"w 'S?3Ȅ[qdXW,ai>l73pH$'7I.t(l5j nmzkTi/vO^Ƶ 핣gˬvM6탱,Ѻڴ~6hZ|YUFVa  =Z,<s`<iؚE/ֶbY]W+3WUkoB[ s]rYOfE,ڛhn/hx~cuTygES'[Z|E?|,g/YV`m?ZrjJtVZyEpۯpqꜴ`v]+tNKVS*Z> qSM>K"ŒzLΩ^vMΩ`%e znj>yMqw O'3e` So֏͒+`u>esiw߶o~ʦyIfBYmpʑ<?W  lmv۝,daWZWtZ#P,v ( `X6MEk-571M.4_hT\+mAvٙT/R 5f}&-l ,^ d3 'g~dVEŀjih1xH@qdE g~ՑiY׋Dn+hʏVs*Ü9 E~p&XT{N8eJӷߺ\0}N?MJ4HyՆ IDATy.Et-Tmls6E~S_}k9/vcN_|nH[˵gukzXY}2ߑ}ӷli\Zo[cXP"' l{Zk J#FFuN:uIH:Ǐbzae ,bz*f)4^>Q!*4kn 9Ytq¾gAľ//aK4(/l*P0Ũ;#COyCl\z6_$P\,^2:qbX:E˯CKbgTc9: _5xClmíېX!sN޽+qǟdf]NWPJH5yM{UE),xuֵe]Kb1x#F/FGRɜq[5ʑ{ڟ7:W]}6_{Dw&P*9l-|L/VW8 j( PJKD`ž'L3rG}.,lLv̮8&$­iIyԦd*J @`Ɇ._ - # I@?Z彉Q9gQ$IA@TrAu6gqV,R/mm&bSOs/><מ?p!Ïm#٧=d>r0 fr gfn~# 6uVh==lQ͔P̑GIcG`}˭y12q 15l?'MH*f>fhZlൌ O-)PEXԙuWd"TJṚ`F@mu$Lsq"Y4t؆w.y` FNv{,i d*i b5XX0gv~_H q( !{)L%ɴM8'%@Alzz"lٍ6=4[,%;7E"l VCw `9O3*$|?0U_<@l!;K{smٍ{fpXBZ$ (Nt® 80}^'-p>I4̰RM;PO1$KmS "I&i)=̲߀IWlfit>G9XyY=I$ό\ieN'4Li鋃* LQOud.$9;DPNq IPVؗ$Vy6}RǹdJMQ?LD?\L_a@^L;J[EU_pҦ aU5ۿˑg lvM^ɸr#0՗nlM[_nӬD7 Z{B#;aj.g$G$`/v@BZ r&0;IRLbbkҒt$oODR)A~#a\-x.uFJ$I3O<~ @縄 'NaRI8aŷǷIr}){F]^< Oqp}gmQy(E]w,Pʽ9ud9w!Wc cg7v6}Evv{~e,EDq|$ǖ~{-`}P1.'ILk3n$I$n$ڗ$+-4)J'YfI)s~?1̾{H&|UN_A!kOCF^sp~{aG|RѪ| mɓVdMGmxUyqy{c+fUl؞vqo11Uً}rM{uV$PN:m(^YIttg'XIg@`]" +0dJMA@}fX_^IC$m:u J-2r~ f\3Paʽk~%yI5ֲoaE]eh<㹷/XsmԨ޳J5zO3^-<Ȁ}0TATll.&>-V [}ϫ~mq0L{ŗm6MzNk_ks]wuEC~-\Ȁ_l+fؖ/j۵ps#0D=YYe/xDgw3N /Pq1;-sR ;h}l,[A.JhS<Ƶ[̠t5e$0,;;`s +_q=)NjIn'PBu( ~ȑtĩ*n4⮇WHX`E m2l gyX{K ]w*.n$/5J ˻q?r3n-{[Qj@9/=I: {QV:B)?w씨2H4˓Ierc()پvg4bij:^d>Hփ&gAּKj?V^yE/mР' Šiƫcik^~k#K6mZG}b&<,R~~l+ Yhv%4p.t),q9HR L닅t=w `tA*ʻ`"Ȳk,PIWl{Au]X ;V#Qul*vbHw/o~۰[mDݻuWEm` ,kѦzNݽv^ď};o׵%}79-\pf[O?>B L=ܣi{I(l֮aklo4(~hO?=CvWC}:r`{^JD (q -$R40LS Q@)~f| `_rjp(n9/ ` F U0(L#l[l v`pRꙁ Zn9'EӴߴMK[!"vLXP$}NESĜO/]ޓ-HfM_!b)ֿ۫W dFU@eke'G\Y<$? mhg8%R^t5$YkxjS&$z(fMa[".y!ָݪ`m T (&3BAZ2d{ҩ6M >BUUrOW\ޙG}ĆAfu}=g}aO=r Y6yC_gɯ*{뭷~}ֵkfdgt𑕹,q,=~#Ue="U_>PU[6@Ygy䑲,r2GZ,>S' `e(c-N8z)Pzm(So]7 0 +vj$Xhdq| ӧ /FYkRu PH _A@;􄚟4wgP J#k=S{챇]Λc=|p_o: .~Wv3; /ꫯ$[o>@ x9{v]weA\V[m5=D.}&[Æ g}~@􊴲@k{<\[nLmo}#g-(%=u:ɷkFX-jWH-azqq/m#ɸJJA%Ȓಠe\3}-C88Qߤ@ Uβ˔w/794dFRExIY ?9S  V˻C˦NKͱg98.]aP$$[/mIBsݙr] hJ(7"|`[r*#={óK/̂mF֭[7n1b=]eU{3O xv@l֯_?O'4nF{?Uʜ6πssw8al#ˌ4'hh6=+h3֔X%}u9T5f J0k pfFɩ:1\d@gdagGkzf&ɥx3FWN91=Xe5/>`|V~7y|/Bt.ywq+/(k~N|mwNG]{>.W}07Z8Cw`o-pw},|:y@i:ˁ70ig;[` ȍzyYϞ=oaSܱcGɜqJig\r3 c|wmɄ)+k_<}ΐof>Hȹ2X`0q¹vO<_TB߿樣x rm+\8'^`!w eZk-d I[=|ٻ۟6qNa"my~]~" w@%L2Ts/xc|a2 уѰاDm8ְ4gi3@UU66|VRm.0ƃ n|UHx]AYN|M7С,NB'l;xmkAyא:& IDATwlN&3I><[ýl`bo]|žHxFN9O 8DŽlL7;?09|j+בKA94)o|馛: ] OĝƲ\C!]v?l>R^?($ e5^U8nTU-_=p}u=u[nAFҙgkN`y]:vjJIl 7ʋ>)" >.FTNY'OD'(~~1*fNhVy}alt_{UlǚvZR?,_|U)Vhw7 }РDjMl`2ާuuNy3o.Sl1!Oﹻ'N`gTV }'H`)74i ^P tĀ]4:>h@# (l {ww-vyy`mGv(`C4TtanJYgu|048@19&LPAg g0yΙVT ,IbKv !vm'#L2m{! a郤 :fXu N:b6$9wd#pHGn Fk9# =`] OCh)Ь+U^ȉOftƀZu~|#hj` EP V~b6J zKiv;}{MҤ4˥[(,떪|I$ PuET.+PRY3k(@3$)6v~-$Q$$.U60)60xR3-\n;Cp>n84ĉ?TAj{ǟ| IҮLelqњGS;}[ $ i FL*SL:Xȴ f ƴ!SdsVC a=dlBa PV!AC/FsM96yp:F/}Yݰ,bNФK2 s kDU}sq2dHc! \1X! ˫~P5,xkJ|hp xw`θFXS %}X?TE_X9qKBts;t,mGL$_]5w[`q5y5='b:X \'쯾K[g3|\"(U/% lHD~B?t~ bmF>qgtb{`LP }eG~`BɏcXs;k=P۫[oYV9ك&GbX;^y׊8[4X9g' ka˽ &A<4@,l5^x8=fR?ǁurv,aQn3[dC:$7:ȥبAR<ӗak?]2k0’$HH`otY9?̩ZW6k}`@R'U'ѩ+QY+Dyilyw,W8d,9ɏgڂ6} {YM wq}9 G>&k/k)O9՘DRRsj;]?f`g.B8?9ltqH@>lCϿ_,4ܦx~ (w0LR` 4'_T`뾡u8p_;֟,Qp3/m{NY9g$^'8G_ ߸%d`15@;O^/lF4)l%Ԡ&kr]q`II|3AX1c;DG >~U=kUߜK#s/l" }7ޓiuI]{ľ]JOִU 9p(W_'>j%K=lw XxNKRo:_cAnnҡW_y500[+7^37i1$Kc>'U.xpЭul[2rNn?nk7Z]1.7):_%s&C"00 1e;h$.y?IZ$+AsɴwGnî8͂H{v8߀PN'OV"ޅ.DŽE hu lD$ ^rVm˶1?%*^֫&kZ!mtm&hS f&zF`<*)L(C)viicٗg^(aɿf+mڦѩyoɣI6Q5U1.yRblRA#g`_xK1%6;!gܓﵖ,NDӡ4iqɧepgӄv$BImf<]"Wُf9UΠ}z{WRdey|-f\9O?+kڭN&U:p%[K3JZ10?WgE;.Bk<]tо} /||hYѬ⪓O4nUK/Zn3Kt.NyDg}sNZVґ--Ea>|][]Iiʻt0'K;TEBmp&LfmW)8y1G_aE%@vX=We%j Iyd,S$$e]r:}Gvx {H퐮VR2iJ $ohԤ=M<|)ncIĩr}59eo&H߼λr6nwavG'd %C-R(v8$i50(0$\@XnOtSK- ̬h9Kl [le*s>Mxµ̇ϼ+ݥ#WT2igz|~ ?a| T sT.; k4>խ۬Bq|OJxN>T` d2``֛1v+L6}Ȩœgp`Q9 DK d_, q ^}6.It[M#I%Ccj8"0$%wVA#qpxC -0,DGE*f”u=*at5EN>sAm: xo7pK혳g '[٥GG:^@yXk#U}74S$cglQ |t^J{Lp]io~SE3Ib(ڿW. oI~Y[aզ՚~;7n8K1p]'wZF@ %#p$GިKEZ Vl5l5#l)YEՇß>ʸ4s֖Hǘ%u'[|@KZ=Bn$KdSϪ| .q#nC]W8|Jd=E^Mer~)t rG2MZv;XJJ?^ZxN7p8 feSk;;`[7즘eY0j^E`7S;#:ByR@ kD{C/KTgw$JVrE`C $6"A%U'b Ur'}u%f<Y3[rX݇B.<U}U "" !:sG yg,2 dY4JՙTШ`*-ElQ#8OAwTիSjZ?^؊SOdo ɗ&JzK?q~/s)?lTLG%Z*nTRt'F r|I;lIHBًQcSRTчpB9Ӛl^3S&C# 3>2 RNiϿ&W9bO \;bF `h\R9~2lPc[lŕ3IŭmK eJ 1 4$ij[3>Mx!k{Kkc#ܓﳊ!nH}*v`nWc~a ߕ`^VXߓl]IBLh5(z ;n <%mQ_#]B>:̳3v#{b93r! !i ϷVefI MyU[Sa[ʧCIh~ϝy[{%\jHC r^}5˳dj9΂ >Tϫq'TiY2;{nCU[>Z*K._ksl7ls,kr-SU{M.)?S_/}1JҀ'><4TH wZotjxꐀژvHq/>%OyYiˉUM@*5FN moG''\(qb0Y84<_dAS=?E qͿk]9f4ܨTw%Zl'wn h7R7`f*{\ynC rx篟su^jQKha}e%N Izs=%9D]mT$:\ZQv3e_&|]=E8ؖ Ϗ\[ZeXBF l˪i>jTjDqǃ1 > ;Yz Ϸ]>^và!}9{6҃%gR@7)o۹|waYrY-|Nﳬ+:/cw}Wy˄}erIqy|2\¿jwm]s#l3YV~5\fӋgIFQooH?o%)BSLlAhBI1r2X `{cѣʫ#Hغ={v`ůU)b}ٽaS6Oส.~~|8N]BQ(4Ku_^| `+im}]g.:f,&~Њ˄R䌺.Έ3 De]N~$} T|&L+dIyjJZ󭷱:w7O~;"LϪ4 @p{w]{Ul7$ǷJ+;. @&yV*50XaHOQjbk(msZv:dkXnp IDAT.KllMOp-]vDz¢O,-9Kr%RyMVN8ﴋ}Zf2Un^誫v՗_ӏڶyQCS-F Dl?)o`*)ys* uѨ@JdH2K%ꈰl,izx r-40&Q`@%9RiDc[Y¤݃UztUKO=eIw}Me6I^m<0[0U#S'7+ /b\>^ڰ(oKU >D*2K?}X9gxi]י'7.xڅJN(r1e)-Ib2$}P+9 0ML6k$е\FBX`g)T|7~*ҳWg5 ta{ba'`ot|M?_{qHOP,@J+{q$|G{+gm;9I|Ë4PGY=!uoP}KIx'h==Ϟ;wE.O6?hǞ3#P8,eaӌ&ג Ž$xROSоSMxkgп㏷'_2toP)מϙX%l (B s"'cµBT;X IH/ >h_kN;Ǣ6Iy~@Jg{5U\rfZIO[)$-zH~8$9?#yHǽtfO%48,IG F%قI}@ggX Xg7|w9ijFʑ(M%)}jjp 'ٗw gnJ=Ԙ\3]KjF\;w?#ٹzbi0ɾ@X9g% ؗKW7{1֡C{[FIFR$]2.Dx{`=ArQ`{DbjYvqG{k'gKO] *)l=-!d"y⟴…\䭤t{'ukENᥫh pӂ@O#F-:K-VÇ5Ew!b{贎(y{]IҐ3ؕgmJwovkBuJCix?-]6m)z#ߧ]}嶧OBBhH߄AoO*h|8ju %Ju7[kJ_rV5[Ê ?`K׫z쑺7)gɑO~q#k$‹wͭ=U0a8m H󵊙I^--҆_A9Z$ C8.i;F8#ʅ*i!0 jS1T9aWYwhCե~F׷3ͿVkbaI Sxfo*[[wTbzWp^nm5 "nF@L]1{}1~Ś+8o[9h7P)/7s*֧Owml%ұS>Z! !QOeV,t=\J"+:.OL<: ŔF2*( >`mwZnc~~.&]T@o/&5eVߤ"l ?in 6ET ɐ$g7w`R/skfWAĀY״5焺kvׄ(1cDװf*5*b´f ݷ)zg:LT}|3BҩS~n^a;P~KB|ц#HD?$2w35)Oҥ9h?TaN}uy`4XgH6KvmWF~ʔ|zK/K6nr#`XYBZa`[d$]!`;[|4y@@s3gfȋ/H37a`6V/[H%Ʋ⎡ò Su$M&4$PM|y^52WeR0TM6[ +v+A"̸2?tEemu&L4YKBul;iHH cBl-Wd! KF漴s@T,l)ʨuua24Qs,zŅ Ičd _2-&~lI\}?d3n((pƮP }{vHf3~E, HdLh:Z)y=/- v}>_Z!r{%koճ$6r-eڋi{H򣸖H۷KOPCh G?▖{eM7U;zH)O72#I>d;>m'^̺r#`D%{q#䆛S~5y@@sg hzp6:dַ{&eAtfԒY_=Ijb,Gzi~HjW0>  Qf "&vk1al3̙ JH.MlIN3δZT$͋;s1ȱC>) ~Vk4THy,8V+L&H"e2$I3Fuɘg'$d7Y84Fhv{Qn9a)clDNEW_C5eZ~,<:?<5y5~ nQQ_O uhC҃$H^^-ICn&8Ӆe]®9繅2]wShwR\iUl<۽$IpyB6l6pCӔ+_|$#_&_e&h‘ckx2`[lz@4l eS?-7cbc:L6+ي֨Aʋ 4<>wEsv[4ʺw 5 MY Pw)o@_X @3{ZF!(rB2 aYf EXA+{S,~ę3Y% Phc &][#dl=5_?]I@H (Y 9RQȞ͋W Y+Qh|Gv2l/fקwԽctô< $Wv{7MVivcdhOX}=u31.| Kd ""_ |?Ձ_NvpD*- >`|̑U!j'2q6}Yt%'Qnw㥠bYh߿:!].ljȑ79A Yhw9F'3pɠ2 ۟Η]7Kl111-OK"<:^#-kN.+td8r  `OJuVi6 ? Uk|.@U}ZZLt40_IQ+ \, ne[q0jeڊȺăjE(al:U+Pn HAa uzlOp>x+gff|RD$rgs%Cd) Jwnjvx[j lB r=y[h _<|qc]s+ ضōhsn'&2f*t(:phZ][ͅs}}.os[K Sg)ٔ |s.,v]s'iC Y=.[( >f[%D:]<8U6;8jW$IR+ZmCvҖVH`BMĵ-&u3EsS"[htҀl+{ZXs˔)gVY 4 xIWMt ;S`F )#ը>m,^d9`ɬrL:Ǎ>aCb'*=A2\Af~yNg ܈# _VTP(qDov8SVXn7MNt7 @{۹S ▖AtP)*r0p"ry%2+i8|;\B(3/@M6:NR4K1ݽ*\s-[\BV독d-.}ٷ{E{e=JI"خ#"駸6ڟϹز!륭dS@{X88D``OK*<8.WE@<1( sQ&UF=+X;BbkT>yIKsȀr)1[u.j$-vu0i>͖snKX'\S3YӻϞ|ӍneArtulqjE@ɧ_CA"خ9( R@4ʼn!NgSNzlGS/e;HL{E"#W mJeaqXT!,&ʺ|c jQeMZ "NJWC[%F+y:kgˬ/iI!:oyk2dBL)/?[YFT6Rcrb9g Hliܑi/.H7n~[ ,"|g+")a&euӂuHK]K\dE21,+oԚi3b]q5 (3]lk-IlרmE@)}hl-!ڻbcZB^_ b0X_0r.mE:$B/M]1iU=U],IUe%9l ;sI"Wl r^B!=Lʵ.F\ck\^_V j"Xqgq[q݂r=Qt8)׽ͼVv%-%{6l~tZg?>r=$KrcɷX;E #Pd-`{p3lOs['/bbb[{_w8KxigK}Q4. N6oGB& fjD 5-v] eYSҺ؝i&W!6̀)n@9{M2,czp/#.Zn_#9&^ظV>c~iG'-^gzIj=P򑴘"9N8x-3QtbLfO0/vvuVHRD;P:o'Zmxa3sPiJ9H4r`2^{Y< 2O#op+m@c79:t-/:׎pu>euƚLhU {Y;:ңB#2Lg)PR8{L{lT'-SSfٙ6&ڢV@ s.+p+{./qis9^nb ;\_~CMGfgVݒ|5 }K5+Jl;g LBbU;g ݜSԶG/$e]nW]U<r^-O"_q =6NNm+WDb}ąFg"27RvFx!Wt%sV wPܯK['*a(*ےxLD]T11[>r{E4Aov("6ja'Ljت%;Хoa^*dPhץJP,ۦaYT{6"+Pk^3P/0GgF@=A08i3, "'gk,$**I/uHR]nWU;Th)mVf[\%C罢0+t-&6=6K (Ņ&0c@}\r M{>kz x; g*ZeVG`[dP$vg8D]H<z{vSuẑzH*imH"@IcFVB&[P/jqZ5 4@#}0r7&|;>rd"H8`}aIJX7tJ>ਲُY2^X}Y+:d,"8[mN& ^L&ߟ 2(I7tp IDAT 3I}BAV]Ueܫr;2^.fw_{ܢVj"A'9oy}4Q]iǝԲ9bFGO㟛iA-5& ~MJ"Ytn~b"U-F#`3ܻw:tdH>&^ƛUFv9pfGgZF! h)&yk,Ywlq_@ꕋJq.a =hg *ѯfnQ@9m^SQh ^9ҕ92 e)׎ijS]-g_Dvs )NqU$>~+MnF;J:Ђ9Y/#r)ȕF (_B@:B@?{M|wͶ1s6#r(yXw7RG"1\f۬$i ALt?3ڽWqub!޼`g V##P?x ؾ"'f|;<$_hkH) Iz;]! 4s'A48xHA5``G9U'32 a=JP/!e~#99e~(WM}f9*F5Ƈ 9#0T݄і~` S ӟ[_2*h6N7V?m3>d;odvlQ?cgRgﴕ[fM’< ZOu?BDL}׭7; 3>ZcnSOMǮ81P\ oZ2 z\:F FI?Nu+nY;T`c%A +#؜!0F\6+_Qe,a{$M_g-U)x3Z`)X)..W}s}gRR4kt7l_}i7N&Q {.o*b\Wߚ Sǩ)yT T{Bn-җs"5\K.Ղդnn)aWꋯk#ׅ;(ūs(,s, E7խ"U+{_&Z7+>]?rSF6'AY9A- r*I Ozk}'O?tacbb]2`l75lGl_$mP@@D`~GIZaήݟm/Ve<9jjEoq+A$gFcfS,Dn%1rdf8Mפ-Af[[ `إ@fQJܻaajA$&[b+{,@5.!RB;#,8w|)D+L"@HCQj@怶H?fŞ'0=՜0ſ{>{LH|m<;&}}֊Y%Nmʨ +9&̥Ijē\yv-$Qbeag Hl~ щO{IW^Rډh5W:c]L$&_JV83n+t;m+|-.m"q2Hg2}Ȱҭ(9E8:(}b}' }LL N$ ,#YExYqqp@C6.g )`oc]EF"}hd 0U _}7gOc=6n\L*T`e?>?տ^~eɮ[?Iۙ>c ,0 ÜA@j>d r+)J|kI`  (o-~>Ξo"&~^|q$:ހ4###P(>|un~mXF`[d$/ᜄEQ@@@3ԩSk!93u|g7wGU%ڭ6;fwlI]R~ߏUyYDF5ESv[hA416fRb:l `{0^v{wԩS]K'rz)/Fޒjis[u8.=T@@@CȀl_!`Ɓ2 w>F FEow'x[;Pw)wr;psk<B"`lj,ؾ<4`0߸L@@@ Ow]we]GP0F F F9 f|ۗ Hf;Bbh0}Wkd.. bwmj<"n|IȦm4ٮsقF[oUf+p{g7Sq^>5`@@@!Ȁn/}Q w\&F FEnS}%?u9_/c###PHl+`2C?f{0߸L@@@ C޻SOrn,ucbb .p]2muōdI`ebbZPF`{РAn}#wZ&-0F F F ҁmlg[plǫ,F F F"pw(ׯ;>0-n~Xv/pXf5٦M y\&F FEv޽\GN_kmױw>xp111F@(B(4wy2\pV6k 7ksSχ-F F FCY,|nR}adw_rv֭;#pgsnvc###Ph2`Cl_\ABn ||Iw}_~M:}!TZr3nO6m??{? / -mm}g}qS={E^~{w߹~|y?駟Lg֬YR1ps/iabM6c)anw'ݻ==Xy,o] z0qS1111:t^:msqSvoakѣرc[UW]խznr{챇a@/kf?18Y^,!So~c߿XoggmH|FGcYǴl}_e}L%9` vlp^xgEq.i~/nwK.7xý[nʔ)7t^?|׹sgw 7ܰv%?va%~s̟~tc<-)`}bl1;^{s'o=oc̖I߈#kmyϒ}J{ޱIIC$|DO46rW_}սK庼J]MS ۗ_8]esݗ_~稣bиh IpnC73@p#w6PM6ڴiWk~ۭnr:th[C#C>zUMyw?CfObEm۶U@l6?3Y$y < _ޛ>`oZ>Cw󒤑ڀ"|6?I& :B~'o:IVFZN8QUVY\XI=+Clk7}MI;X=\:o^u[ne49ҥ7nJ`ckxGdr!u2X#ݒ6z~]k7l}+#j38Ñ+]uUuRwrȐ!vo{'Zp$?cnwvtP]ɏxsΫcW{za6;O?-L ExY=Hm${ 2ۧr#PsWF{ 6h1eYg2eF?nn t7cR6=k]k]}Օ>q1E$O?رcAą'Smnȑn= LHwnM7s̺>xpՍ` vۭ{xŪI0sv_Wcpdvm>`u~@jU\r({l-+۟|u}ezwuumru}j%xku;^|7BC^hUFC~/!^o߾:5vl19z5jZֲ"@#<^;?n!2u{"sa 0vf!Yveklw^[c'=2$VXA7bh뮻\ؚw8GLQM4wS[o]6JѸF{[nYCZe[~a9Cfjgy:ZZE/rHzj魺{2{Sv A߫؆!_{mQobj!ao*E_ VYNPxR7dMJfʵ/Z%?Xc sX#VO =(cL3 y|1gPk'4< ƌ "[oFeZK̮]=k lc߄/ϫomϞ=ݱ[<#7_w@v܋/ӧRS:/K㻸EusKr*I;$X-h#TDBңG=rȻSa蔏!F.e 5Cw^Y:,.5eyuB] Mm)8ww#]nv[oӲTfk߾}-Ĺ}ĝjc?#Zn=Q,8gϮPw}_}=6xc='*YcGB/h}k:%3\kAĿDnYKudsk̙Sq#U]#aoiQ<@ld."G>'xgJX#LD>#Hy7qD՞c 4v[nk ood'LXN;uYO>$$el=ЪRvM7n$ IDAT[9]3bÃ7R_uM d ԃBl6:aE ,pzoOvɥ\.hԡ2-O<@\ ᄏ ckޥ VAIXl_~Q@lݻwWoS*Z#-AM <9Hӟe]30j@6#\rQiSl40RBc[+/yoE\3Mm'xR JԈ `)hh(7fP|饗*ŀnSb*ܿ琛83xfNXunFNe1{衇r2h'H¶Yd(yOmܬ]oFʬh D4j:\י_ J!Cʌc- -`G mU͈iFN:Fd\L/۬ G**׶k]{[_WoyGcuG(ÛA/R4@6S޼]tRlYo㹮R]7XR4Il103\s~TA,1I{W l"۰s h/H$? 3kPd%^{Jeq_gVg 3>ă޼M?3kX3`[\~5l͎F pU)":ꨣT56#RFL%یyY tfTV9 یI`͍,TM7ݤ?moQxAl\a`eZ)vm3`yA\0揼I2a=U7UW]ӜؚO`xKkiW,r!$PaixȚ5Y1/tשt LV y#F%yH 0ɑ#Gj=(C#{:3/\>sC Pg]{キΦAbaqi'Rfܐ"]AFVtvsP޻7p1ƀ2Zqɓu6V?m' ?<@јBÈv7߬GFgܬygHЀ;pfi<)MFmLqsx@/la馛V Y ,[o3K$C==Xyqƒ5٥b7b@@zcXzl/ V&/LIc1-C23rʰ蘿'1; 65d @/9|;v24R7 _Fg]X桁,dQD12 0&aV ;Lm0վ\mh *nF<0yX՛Q?Tkpg?< u_M#P Ȥ{P3\o 1h\4 @8?m-A= e$/徑J%H"S@?U`OPbƨW^SFDqid+ )T2*3M+A=.f^Ɇ @BFɶSL " Çg)&6]HXcRo3$8$Ċ-@- 0`iVu%+g/3U3McZ EiC'Q5ap3Yz7>zl>ig?e#,bWl-+snS-_9 flDaPkl] ubTLud~AKY5YV; ӝV aHD \`.G( m@3^Iep@0;$%la,M{F*3jbk9 $ X(LN7޻XD]ʋ͠ e^;sklz"UWjWCkh˱2C]*VaARZNHzFWL s{[nx|تH rw+rΐf2Y MH }]nv6;v[] Ncq@BZ[ˊV9${+.s;5_#@*r& ׮J%E" e4B  ${cI\֚}l#`ۜ|tlWꂍ\"a+w4ʊ?XbЍ*UmW^MeC߳ aY$~_xݭ;73==7LˈEߘn W1d&ٳRT ]vOby{ ]Fj&H ~`k;V\;S"خK,PTQ~u m۶5:J+^~f}۾;wh~l9_g[Z:@o?-ʹ`?۶?^$%wW=TMl꫿%I uz#b +$S| ØW1)tY!|Zcg3*t[ -G>%84xn31?"={ΙnknIo{b$D0m[@-D Ӟ'@IQ(*t sD02a/y~ON?E d3X?(7mL/mӶne-r.6m}>o[s0g,K?mv;F[ր=1s&/e6 8'掲LO4IGPY# M Ecf¹q*U3-\ Rx>അ@&Ţ(&G .`.@X(}Hiy+4pS; `ݨn];̶~}mm.l".%_Pu()(>vɦeI |X16͊U3XZ(>|fe >Y'7Ihiۤ>xf_9nGǔ/&q ]p|!1Qe8Z.|YZ`.WE .pփi󫬲o_, Y\CUoߎC1 _r 1`q;Iʽߦl0ܳg3թaf02TQl7u+~Qo4|NkV _JD[ou]tQnv y rl>[rtրOJ#7M8Q9f0K63#G+貯 *fGVG?3dF^SFō>}I*$z`Δ+Uf!jR cG-94 X`7 CxfOPA4lԖ _ P7P> |e:긫w_Uc]tѤcʋfguVٺ {ܐg s9Gld q`@yx~ӸZ-4TV8`%>Gs~z&o& $hufgvI'){޿po!*{}vmf5V^yr$Wf3پ.\10R(#.57R0?U/x\HS`fʴրEoynI8~ TgƈU_B !J#4ʈ[3|XA/U\$f{+9[l㞁 a[ޓO>Y%իG!6}Ck3H `fLÚCp Hd_b&Ssf4~x@*X$>2@ y5< dB= tnhChk;P5Rn$$'P=(Zb`N)ت1/1@0Sx4M`7~CXb1>!IL$ ZAAOcIF=g  \l-#rʈL`+IɆg/>!]hL ]:g52*63Ǧ~}Qگ(3qcZ֭:l@B(ғE]Tc< l$DN?+  '`ŭQ>"7\;OEn dSX`lX+`)2#خK,6ӜdkV0Xڰ76%?STX_N%LilzIŀ|(O2q3m$QxO($:,#4'Ikչ*^'ԒO?]$6&!w.7V{7p:p`4#@ 0 3{6s9}]c& aѤNä> m:H7`&G}-R ,g&,{WbÇ3`̦܍~qѠ]` ؾFm:j[ }l6DGO^4i@ymrhژodc:b@mi.<>ZIbу0]jt) ˷s{gk \G˵Q= FA!,'>0 \;k@|vl:L2efa0{4 .g\ԑ10 f5B8"3Ơ# qUMU Tҍ䦛nRQۅLs`^׮]CwZd`x$yY:Ԙ&0@n%K̷^@;^|U/t9W2Iӎۿ$&O}b !n#w5׸/E^-p/S|^YzVxƽPr= df9۔mlu L7LcD]H*h0 U'm^;m FI 5f: &jXnӇkn4̺8fZ=-c ilY6 eiƏ#yРA*݈eEv>k)/駸o{lے ٯ"`sPl%Hա12]l|mzk4?@NJLn>]HI>/m$#N|=\tr$N(sSIzio]IwUj$aG`l-+x eu֩ImR$D]XD z=4ñU' 1-QҘNBX7dh@i@ӶtH4[G MƊix?}O&Tm1I:WJ3:Bl*ݷFUR&L ymI%ff k}$$`UHw=$=?|7Ocj Dm&1i@;gN!'r6mҙ4F<_'NZ%!$ -ƴIRw2eNb0A3Y qZ#=vYm4xQOCzldi7 iē9,7Zkš:wB}?WxFc:ŧN6|йOK!xgGnaMDۧ=v>I[f\xl5;)!]%xcN>"׿iI&)HdYnN&fgf}R$ˇX 7 1Nڀx&'i~'I myj\;>+q8QT:vT(`VV7'Ʀ6=3n6j*~llg2_]9 pu`"HI "+j+bNFd΁_e0Ns戌 }=u# p,d1bB]NqI~SÚ<۷SL'@B":tEZ|j?Tlv{u0?d}-_]wݵ%1s9UlF˼}uݺu`G|"@0HbN>7/u ђ|禵m_˜,tgdCe[7}Nj1I4!7P_CLw;9 Jx##9ulQFiElz3``[ /e姨 21cƸZH]P%4? k/՚S2_6eFCq׿ܖ[nnHoDB#$)69v65k; f{{򤿻nfgϞP1[@-D`Ww{챇zVP6 /%X""}jIi6i҉4ul@_>9PH 9$$)#NJJ@qHO#vhnsŽV,wu~G'/R @]|C 8FzҔ1#s gi|[l\Xm6]N6MvO?ϐFYvJR I}4ʹ.qAg_FܱcG-mOZh-l?~7rj}w ڤrR&/m*CU*!ѣYc!^tʀZ_o/YB>|쯯.ԐI^!?͍7ިk,Žjϭjm|XPc{ M?Y va n;Umݦ >XwjQtӼY>n A*.:Wikx衇~i'|ҡhjC>`i.w}K-<l628`3Nfu饗V@;l0Gafq:u꤀SgHU/`Ce| IDATO|}FkηͩS 9[9SJi .SfGo'ˬnq|_h'|dP-4'N8|.7l$ _U0Av1`eR |{WXaB3T˷XQQ z[)w%H73ʬ,þKјF$A=Ԙ7zw.6Y!@fFH^ve59ow%N2Z۰ͼӈ) 0诼JNFa4k$2fЭ>=z~k;~oOIv\ `aƘlm F@o zj=ɓta}{f~V*YscZMm Mm$&Hr)ޕTI+H G6RE -_ (Ѧ?JbgĒ7Ӿ0۝wީSU8[VOJcU-ΦEIcnW: L)Z&=>YBfoHjb rP5 Yj#Y/ yxVh؆~ܭJ ?ۖ\=l#9rH3hy[B0<޼I̧c@EX4ri_9'Wc`fرc F\{-1avBI}ꩧ%F4h.&FN~i|,p)nʀLհ400wm܄nmK^`P1$T΅Ψ)4F%n4f /CMܴ9@ƑGcꫯ?`x4EO^uei}FMl}ݧl!? C*?@1&YCs.o0}H"}Et;(`p-(t@´/Y+,foiv}IL_')/-X ^tw3^fV8 m,Y$Ik} {+BCփiu>[?@;y7fb[}Gg;m0j\c5 izl#YcFuEm/4sAl3˻w3V̠2ӶϻTI&[h ͌(l6HFh}՛nIsP!x׀Ap%V`*lX/B9Ŋ[2.t,~Yh0e:\XH>-b~aL`L*/R.^cbǴQZ2\,oI_86Ȁ{Z%?Z. s`Xې47 K/дumh$'ִCi5v=5C j,9`LRHz1bˁ u@-n o~ Ta;LoLv9 C/l`fqfꖙ'7b@lKLu~D?_fg/@/ܙ%6$OSsaP@Bug/P H>1I56s3wGS#xOpB|pf| 2OӶ3TMr#,8~Cy~̐IĴ>/Ja%X+6/tOX-,@W4ۓU$'f6/FL3-3j0<tH$IrYPYLciM…t#@$%ܴ~fE 5^\ō!Dž6x1H(`_i I2 "rp@abxpGb1Xxc=6lt d7`w2HDb<$M3sT=# ΰt^kA|tfp4 (q,qp FbD{@03 n9  RtR1c jߣ:yiYB$0yĪgY dLJfx|3pY"ex(%j`x-/"dǒb7g#,$k< Χͨ؋ux.VjlðZ X䆬`D؞_G𡄱iĔ7/Mp؆>`Hd(*>$I+9&141l/F^>% D䅴1d{>Mrs͠6d6s1e umq?p/#ȥ$-=l( C 6ؗ=\Z`mv'HAI}mF :<Xl$9ǻV X$EmT["##22l0*B6,+ ˦iC}CAbua6q0lZ,q`r`@h/eȋidexA xŠOyƠ%=O$KMWmLt>_B(>txpap#li~^p0!Oi KKoI@v!%S|X\FrcJxr _  cYH!i N^nls"k 2 W"$ҋƍTm+4.dP6dFiraԹa=fx)3`}`aao˵ͳY131{mɏhȬ=&мay3c O_;G3FR?2i'N_SaRγ(2MSjc}"خ%cf+q`))gnǸ]n#4l3 CNj/^:0K0°^,| fUey2mT_b: h}v'PLk".>:KM1 m\^9lTA_`J^H: _LW?w(44 1|`IR6& 5bFL/~? d +4X4k*9 O|m ͽu V4' NۜG3Wуgy#//W fHhdWxs ϳd)ևT5yiso%yx˳rlfF]{L,qv d(xڸlf{]HIlf{w6S|^T)[boKRKOd8#a07n$L4Y.E  @$2#Nc+,$}6 v\A:KnY Glb#c&@g9i ̔oeƞ`iɶ:r:!ξX,blUi)`|IrL&PZRfɱG]n3؍e$lf{3lWrmlVO5%m:mY̥Y%L}6hh}JXf?`ai0h?^UJ6#A;rt7HsH&"QۚژmMH؎%Ew@U=jqPP:mhC$K蛣c~zZuJc!V`ȵR6,|}>:0-ll7S$ ʾFD}+ i1U'$*'9rG>P%Kn|afK5Pc 4׊z"1?c_f;T,ef]l_$3Q@9?6 4-ԲB!,`gV֚@+x4 sv ,UM3~uH'OC?KJW|P|d9w&wbV%4HD6p DP2ma+ ]MB/k}$$1 :@ XZp!91]Z_<7ABb6>SKxA${mL0}5!!~!7!ɒbrF>sAfB//S'n踑?Gˆs 9 ,o r,JOrչWLH5/r1kPɏ-,%3p$-'1db.$xgSY'R t`[^ [L CDK^jYos I:yisN=Tac$6 f_ٶm[=xĆ @՟eilt)q޲78*q1.uCfK]5TpZ3n|#.+x l $`{ mLy6fDPrXb/bibgtg-l3MVs/N$F[u"//Zh6Fƪ2R.$fڀ _%FK(O'vڀ"4,7?Ą,@$91Ph d;\܍&\tqڤ8Z~!b?8LMN߰${Dc=kX;>s/ b&F~ 9\me08xev}`zʁ|A|;b,@JRmxRX_ilo%`/'Mt[,`{rYR ַ*Wl*.0nnԖ^1-MVs^ت|yynp!0$,@KRb@ϖ|Ly#C1 ٭ꤝ5ۿ˷K\^ϊN0P}'g02\;>,! m#TUơta U2nJAt+j2{J! 0Scx) 1r.}9&؀Juf+ئx-$g\,A˷o,@g}ط=Lm3'jA_څxicԓ@b &a 1. Il \h- s 3 j H(Fl/bgs=Z|񄶪HٸxuQU:o g Zt@8R86\3ā57%i5r lp}ܮ&b ?"}0&~oNl/]~fK.Fb/ENf4*n0Z@  i!=msF!}E`]lՉE03eHH*f&+I23Ggp Nl>I  NŎY?~B{6$g$|7Af.VHm$qQA`SBhKLb0d 5@1,35'6 7O m,=ɖϭ`DF.`@C ?m߰`(pOaLAwͭ*+]gAnBS=Xu].n`B$EHAcʉl}z(!X?5g*Q3V +/4\̀.DSźB`?n6eJa {챇=s& e(AivaP|^ B0e/gl?55s8f `E!= 6bMkax[u"񪫮{g-=8!7vR %~`=9p72]u̸D lCpb"@O ,EA/ChToEꪫ* K0 KêЊN1ǹjtHBX]vZ Mcx\HiMmX}<}]cY)\^r%9Vmc[%o}0Ksm*Xf\Āzv"8 ֚Q1LEn1%\RheTM+DSr65ı0 PhonVXx0Ĕ}84pLYre}c̦BdT &2-E2%ƀ@MCf04aj nHƱf?70`ĉWSߘ &~U'.dPkSIH#m'K'bQh4ٞuS s1POL?LmߡQ@yK,Ҁ/zP_[}G o,׵kW%o(kJC⁽rNk\  ynf49wlx2  3 ffk xd!x6a;{ O" IDATy&H]SVu$Zh5 . lg1S\Lr]j@*7 ԊJ0J2s84@$ yZC*X(3ٸh +M17'~en$c<N&ryH qmiUiXb7 A6y>/lF ;?bo\w,~]fo)b%$ %$5e,n7:M4PB#iC|f/]@=/B ֯oGy9$Z\Bd`#kG5 w'DO{)߾ayOB%[} niJ[J| QXTc6eeRu&b$ȴMT2,#Kad+Kx ipa <~|N2UoX rc78/!@7ǏlȈ8g hI6$# :Lk h`[蝁R17gHKFaƖ[g[u" )IPMcC l_!y$ƨ:ef$ hnM4݅rbEkxi`2ɔ!IM\iq@K Y>?.T-ǎ9B|E}v'_u v%6#20`u/QiV0oRlJKތ7`XotRqJ+Tʳ @7 V7J+<`($}0R墤}-O`*';t3]vlm0FC:q01`6>X!ސi&]cO,&-6)kRcBU\.8\z(4 cKJҜGҊmz__|IMxm}4Mo+Zc-H!bꫭϳbپ;;-6]2`2("Th+4lU_YC]Xb5֯N`JC~4?S=0aa\aVcƔ4ưfאʲHSX"_Z3"|g BK FRh/ c0P#5 #N`>CV9`el8=I\sC,nYI%GkVur,;\g$КG1!II1IMog>Occ 1&`xi@w}жm`2(7;q\%K{E?{TCk/kwյl`AtWײ6oE{_{Cl`AER;nxd&drLn9/~;\<8sb Wmͳq`ۊ ­*خ s B(7Ow @a%TQQ솰+#Xx* jȏ%Df[&'\6+h'- f>Τ&N/IKih;x2[<%7$h9Pbdk`u(e`n_t#ob06""k?TƟ$lߣ?6!QbۙI,R1k)LDM`5T g`gUCDi)wd ԓqEЎMxB3-4@;(w|tCu&i y<W fiBxJ(4AcS>C$v8a,:M}DC!.pkx|]qMͥsFf<@N[,ԉΦKs;(~18}!BI:8POQZ$ Ğ_:iA"}]BdHPFρ~> z~w4,Hl w$Z'@)+J4u_#FH~)7Pcv@B;.Y|z9hAq&Pɏ+;(gTI8i2tO5x!$ǹqJJ:M.6|~jjo[ `^#dܓoD> ($lkf~id{l j6Q"4ʰÛ)1PhA&}._1tck%" %CjiK]Hq>kYD8Ўϓ~3_^i3)R|!qJ`uyn{O׮ʑ-fAu榛5/I]^Z1< RfϕL ӐlVhevZf;0T4glI4lzteLI'EēK7ttoEtL$*RNI'*SsY(V <@%dSخw}H$gc\+y*>"L̈́k6kZf-_ug{TO?mYlͅwe|> ? 5{qڨd}b6I$t`58;t IqN;mAq&>_&iA\3%$h3~m7~"\D.Қ} n!;j)P ;Ȁ<057u@@5-R>{vc:_Vcd([A] \;,-r 1]wUy{?oEEr6SaBTSŕz(TŸycZּȥ\+_#ۍ ٦R"EC٥sX푥K`T4}5=c[oU1z $EI&>ǁvE|PN$ &vWF A߷9L,Vm,ۏ(خ]Y18:y3w[-UK r7V;<#dpz;CL⊢̪@=..$57t|<'%t>ǟDIGw4?4ꉜO5 # [J-hΈTҥ7x HGaBv3 w@kXt=sHs.1)"iNN'φI3~B*ߙl yM{gmǚu )C{ී#oi@:2p@d~') Gl|Uct}]׼ysYl?7gEn|gg(i }9>x.8|:Cm?9=`Je,ٜ]˴s&H., 7/_`{̘1!}ᇍď['>Co `]Wf7&o ~rs 7jVDr"gfcQF% EDWb@|`dho,|P͇K,il=q-6|9b[XGyQmXа2mݗtۅ|Ҙ|i]U<;vXN;I&M=/gE]žJs~B?rj%q+ȣx&MD=)Ҝ.2m:]e -8"@C'3t<淁4~=$D'"Q~3tҙz&fn駟nX#GЎ ~?=wI'Yl9Ʃvm]p}z-A3_0ЩZ\`msD`Al^4"-Z[ BN/shwyEНT]v"e˖aϴ xȳHcW ^wh̑m"d:Ȫ,`,΅e]8T?}>Hxi|2q}]ej[9\XX2]?x܈{-/,sl۳Uo2B͏EE'ݏny+Odߴn?v}ğsL/EVkz9缗4lF|ws47&DP wnpfye5BD>vj,(㪶?&H<@>@ɥw*xKlwTzu]TDQUØ@҆D/$#ztPr&`§3V߬#<*I&pF"liVQuVڵ\(hc55 eeh, ߰bê8SOg#~aQ)IctP@aK`KVt:˧Ǝl;>q.>l:4^'\R7yHӹ];S{ο2Y+x"wͽ+qS+8K$ou;+ήKH4Y,Tj|~k;-آ*W霢KFva6` pNW^y~>3?oPJgA&:Π@ NH"ly:qlCMDQ`{r hN ]N<p22q͏:"PI؞Sۺd8@EF{-f+ fEύ=-kU6NBsd-kC'#^vCE|4S{<MMD06[1wn.B@%`9gJ_z[j$J#Qaͫ?MI|6MD>$EdJ,x`DhPNI$+phDzb@8gIxgg71!&Q24gq.{m mڴI% ѤLLtoh.%q>Idqଢ63͑ SL׏F2D gI {޳X= -| e_M)@ e'x`7=YXYK7Z(Ï,vKs(nT m$N_UIsᡟzϷTm)%bHNu.=f%ԄBn8伟Ίz [:=?TtIwuP-^oϸ7](~ < Ebm9FW6+Y!J'yRPp,((!' "W Ҟt]|o0,<@Q2$]I>/dTPW.π/TŊy&HO$ϒ*sR}`lVy~TNcD\ ul$w"GidKboEqj HtJT(>;u\?SkE;,|Pv+d#ߥgKg_Z_ nY ( _b4* L.B z뭵yalv!9B#_}!W](~ P8Y@ N5asεjقmJ%Ln:JhDo)S#yT#۫F2["G$X@mIqD{);smfW5y\mt)T(`2dRo#2Ӗ+.#vnƍ?k b|{dVDꫯ ՚afCd  ezEB1Tf'ux| 0K=~h.cܛo )B c {w-Z0?bC:AlG~}\+)N:yw?}?B8Cr `dm֑,3~B7 (bFK/; Ï4=/C&m-Ty|-4u0>5ґ\%yiZ^IV;Psfz]wئm@/Jc##  h'`ʈV /`@`'6h# :7b5kf HK&k4jZ["Ip=c~'P@=\AGht>1.QGeÆ E s5>o<6 e $- &DG4Ah$.]XM&jBD/L\'[.dd=xR/pTszqa6W"P1#m۶()`zРA or' zJ:3 cEv+J6K@10!nӦ*[CuA+} |0n8"PZإß?Q`el'鐃댁&Dávijtp]éOg7mlWTm͇ mҭފႄ1X$2BJ1A(P{f ?лx KKW~ P ;<|Gu?=|3Pdk6RV  l%Hf{6RG_-]~Pa@ۅrx觠g {_";EajUm?yT}׍;^U# G+^>vdnó>[4zu lsXU..WJvmҍ"7Vo1_rIVћ;`Č|X yj͗;*U"?l )a˗ѩB[_=! TG~lyGfp.[lE R%<#Al1XO>g:6V\T9Y:H!ɀyF9=8pPݽ$7X}c| Hvׄ"w1ߎۿbEqn>Ǐ ,wsnقr7_H@{8c=D pС9 9}{j!YH|ddKI$IoU/qzʠù46qmb-[Bij/GkS9΂m=2_YM7"$ ~:@7QXv~_>N2ǁx9`>|;1y 0|69t\Iyw& /s= 2tx_TM!=I4;v4B4H.8p9X@BB:Cdl롟By`Jn"f IugP7>q;Y˟oCz6rOÆ!O?/ } P%"s1;x77"r$][nŢDpعAP:S\>PWw?` gcD *s1@r܎Zuσ_6TC k>}] AEg$DRlvI'b|m)Wj\DH'V8lbl/.] '<'/`[ &ՠ$#UJF,[M1J3$r <8mQko خ6k0lG ^E1;6`{9A]bpHc@Mz$jsF4MYڻkB"O<ђ[o=K4ˋ `TĨ,Fą" |QŌf(Ecv1rhb @SN1}Y&Sd!dof ~GG>Ɉ.SSO]/-Z0HB6z)` ,hQk?[Ќ@>eH=[6a„.>狪^ʞGd+p|qx#(|`$@KP1X2Si$l`{c-Rvu `J8h:EHe-=V(4~I0Q}dV!B [(?Wsq# U$B?}Ga /x?xaNw-܀z"`^ځQ8'gC56{,X@;c'y J "裏6?ҠUIIFRH߇p3c6yخ~s/I} <lᡟzIIG'sEq88N$I]z>m<\M/7$p '59?boQ}~.l,c&I7$*"@=*D+B 5e A@)A*!lC!9 y>Ɉ +"I&atH,7~0G ro8}ך>BmFDcm@8?n,X0n(h2g:cV[JW" o(jS(~\5*7v3^":I~xx!PE}]v%W1F)'~jj_}lߞ[nTkJwyo޴Vx)ܡM}6++T<>;~ܻ;90Ƌ/NYnq9@4f͚B6h{SI^ k}[巀kː8Je`6Hg_zC[& VI:1L:x2@J-ZA]86{|6|9* l|64j@ɺ"h.ͦRb@H_5yvylR}Xl-^}UPjǼ`cun@@@6`;/cN8* Κ5"_}OXڵ~d훮Y#aH H$8y=~ }vz94<<>+[?Pƃ2{Frj$m/IUP#xFGô\{d̟?_\sM8pnMꁞɕG_ƃ*_Vp*xu Gm<0~xzM`^Zd͡ =P> zv(U|rAJ¼ {kd#+LD@߾} !TzkT[~@@@flZ3k94D-x ~GxCd;G >?RU.?Dț"L#P"A~V]uU;wKouZ <vx+];CE ' oͰ6m*ϗ 6%Tvgl_͇6@~veoѣBj?rYgwTN.~[ `Z _j$7"=˅F`{mL@c=zmh$e`-TW,<lkztV/l/n|, OnXj{36l)}r˯6mH.]d7'VW7`oJԠzhd{O"9Wɂɓ/TB&L ޻v6-_H%Iz+eD8<7USl<7pd93< f 3/_!˖.ߖ/szMoe7|7k$x=Qs}X0ԛׅc E^6}a-M?4Z7z7e721vm~[ ϗ==5{=u܊Ǵ]c}^}Ceo=4^MVp_YooaQUG>\c (el_NLۥfeK͒>$K͔KI&kI5fo MJ5֒.T,_ |l^3}H/[$:O/~(\D1b}Map1ry4o` g6v?ATrDZ pJt|c|]g [YtyЦsܗzG {>3e= o ]l-JKt&EHev_њzD_Ek>^Şߠ_>_꯺ddu.w>b]sΩ7'ڴ7XjNsчї-^"JIkܣ)H9ad?+ BxEڷX~Cg=㜳4Af顑ë ]}cɋQ3@ۣЇEcxw()LH8H7e(ɔsJqq__ )P Іf:%i7JF5\GyY}kyOޏ^3'хH/zqDmu7zc>:vEsTRfױxH-\D^俲ʚXo@"_#QNB &t<<iQr~Zp*ҬY3v[mkm׶:#qұcs/N l_`{ a5,vLO0  YD[If@,UPT\B~{K(4 wYԖXQO,qP4C IESJi1;?)5:+1qP$S|[>&]M+s&wiv\}M6$! h++4"Xx#.Uu7e1({IՁUK<xx cw@{vii+RC Ԉ\4Sz<E)vlЭQKhMfO#PDN}MoEW@' 0ZWPQj3.#-D\l95$o@UdLO!Ā6@Y#)Pڒܠh 9y]'qVXfڷ}gIԢBLh`4<١E-amV)+|馛/nDŽTe֥K:  ؞SaNa E %,rWyQ`(Ha(wވ~]Ev.IH}6WUÒn(GŔ7H2Ԩ;bFб3@P|;? ty΁>-¯Ǻv ;^{m x PlaDsMm^ `A:EseWdI2y/;n O lohbζyr=gQS%-[ǻW^%0R@~9NATHU™"0Ҋ*X%mu MD@"X(8m&]l'QH:sҜ d<ǥI$DJ&Z,"\)sy*$E@dI K9@p<ɓB<>wDdt4&b|t^?>^! P5j,(Dj&)>{l*e>?O~3os{1?%c9F[:thu(%U/q 6+cFIJk{~(`tÙqDƹ~ti:?$49N*qGbg]PIҋۜ78P*E|G#z4/K/)>}ȸqJgaT̛+>vxweC/|3ia2Fb%Q^QT+c,q>VHNUiڜ-rOuJ"D%!|t3p8$d h_H$mBJs'u_T^ Q4|wn:ͅ6J|M(QBsS ?idFrdKlWxj@?Kae`HiLÉVf"ըVPhQnX8u"%x%<.j6c|nSHqx DD~C#*74(EQ813'")P&n]-M~Y{I$㨧S8*"Wj$T )ќ8W}7weR;,C_yWSv2>S9蠃8T)xCC| (=PO .8W\{UH#s%*1@Xy0̸78Q;ʀ54;$H*עJ0@N_f$3D-/&gX*4&j^)rh)(qQ/ev7n5C3{*QP\LM(!x:~NG*!uVғ꘱J+qԡDQr{ZFSQ˻D]͆>d)edCJQ?$9XSH8 ~^{핗B#kjUHdiEsÂ"x ueEu߼.'},۶ J|,vhoJoޗ)C!CǼ.7D/R><ͬ/ԩSe FVg;\/.:_{ UL#"ۋl'ffO&G? T"P7D OoDMZ(kZDw#QUcF)rVEԉ(;-mJJ"zV&;Q7HTJ6๜]禥V`(!).qS E3B1'3)p>;$6R Dm"/Q~=ݧ$p|\M`;DsTdݾJ˵j*H~Tsf͒}W^~%_~l&rV=6iE#~ *lfxGモn@>hwH=zlGo+BW5遼ޗ^(˖, `&/f=kb1Uٮ1hTK*A hVg~IA7!1nnM>kD~T@\yuFyˍ; @ qhaZ~V[y(1jTHm MuTLQ%ED>7)LhQnXT8yTFNbuM)_($qםl.`u]rxe6A1(dB[nΝ; };䓭;`R -2.mڴIt;KO^{m9lԭZ?mV.䒌 "n!";v- lNz]rӯF[O^Wi@~K"|+e $,} )4 Ĩ*IR ̉."t[TY Ѩ1(@F"QW5 G1JQ 2el[~(HbzrE}<" n߾E QFQG%&Ly>Ui Ql9ڵ?ފڰ8 L^k?>]wuzܹO4gX[{1۵9sE9'|Dy/$Y׮](tz]y+^_\.1UƗ?T1紜0ֈNрRMϕlpTF(3K2Tx≲.!bQk+QlgW_@/sl:u"€毹((}6F Gat@3l"Ҁc@^j`,o6I?ܸg}w Evwќ9sk5ic6懢 <CO'O5b$n,' `\+}TЗ^K~4^7*7P.=ϖU_;T6:9T$4BG06S``TJR(zx|SI~$?Rh( JXXfTuhFމ$s|G$u/FcQvD3(Rm0HT,H:%VyԮrmÒ1eh2q_ k?U}2QY0sl8۹|L|n {y2p٧O'o&z! `M>@2Sg$; }ǒ/DH$ge\|$IH:x3~3 Ⱦ \O2@ p'lxn _iLv 1;1F!;{+[#: y8`70JL>#ە`gaʽ 4[uTVk@?R$QŲ[{/ GI:dRy'eFWç^/uM.)cF ):_-Mʶ[o!mHr'}UJ,>z;@xX<'}F~ ,Džq4 Lse$SJPJsJRӝVmQ]VPheT$?K~hEW˖_^}K>wGt](_ !}~)pxR8Kr{K~eZך7//2kBK#ASn_qeQu]ɱEؾr&Y̞3шjqau~9#'s܍zƶrS2r$4̉,4T\?F)ALD)QzʔaɂGJ- |6Dy`wߕΈ֭2"M@N4c(ɃMg]t믿$+k#A1mK駟?l7&" `q9mx`n?;N(<7"I>ELܳbLpl7/n,8B~?L'0e(X@yʡ/8i$*=Rj;/Gpen@ހ3jh"%%r@_LHQ(FjSo |o<*?Qc︍nitdfһWO6~.MU=h#ѻ[e/?Wj? $?kVy&[lz[;o٬iӤg>rҿj"g@z0 $yI -rG9m2X+INYOCd&>_M)|=/j$l } d^{<JpD^*v|g"Dy@s*&q_鎣X $4 >3h=ETJ t 88gqth|} PX_j@) w"S  .4 U=kAzt ', Pco{3; "I}l:>Wd韛9>s%?}HFOLK0<OerYfF-y1ƿVpj|NK;m n$(FI~Ԉ%Im]wEfKyge?^֯Qͅҳr7g4o ZQbQ`}_XCDdrdiF.z5JS o?X~ndp(Hb|oƎulH IDATξ0f^Ϳr#?*#Y28 EH!Tm%Bњ2MDܗ#O`,R}_:l;"EwmFT`nPݣG Ic\ ,iӦM&ӎ}ȁ¢"/? mFwv\v ^۵1͛G~rpJbxD崴^SrvMQ%"h$G(&L-ʫJGWڞ{@9ēl+|]4sQ%/z-YSZk+Hu*!i/_VGӶ܉8Z],&Ex͗UY-f2'Rܯ 7c,"e_4<[zهcDA[_ڞDzz P(S\r#T= K2Ujdޔ~ݡ6C<)a=̩' lC#Ze<+0}5үWU!@޺0x`ޔe`;;z^B!^0qEk,Q%I*FCyv=y@̟*tGF6p)Gy:hiZʃ\ɚT4#Q.+/ EiDAowN>N92uX*o|RW~uF٪:+g3(L|5d|Sۚmȡe@7e}VL$Z(( IypQnR ;v)Tqʈdޏe ~%sSr`i$0X @MlX c̷Wn{=^Hp$NSuDzBi%*҈&`\1'Ǚ<{$в&yL2Yz~:}l6|EQ8h]Y#<7DooꭤucVӭ^*Oƭ}w.k3 1FTf2%ZuNv$5{k3*c%Jîq$KmyJI;rmژ孯̭ z0X@e<64Ԯ\eNWhd{E!-jGo+ 6}c~)OWA=">HtTPgaJCidEc;W#֦/qچE5K,+KI+LUi >p28LÓ.0Z֛[ A_;h48zȡ}d[JϻɁL9Oe}[cHBk,LNU 0['Swj;S N$&*isn2x%S/s*v V#f0y}P':G Wd?]P(=!m8J]-RZ= Vɦ}`DUihە%HiT`w" UtQi:nK<.XIz;]-Ah\5GƳ&KaGE{ue_os3 /$Ú5Y&;l&ʮ h:0qp|Cdz;ǩd )աGc̽''K?ӿ*lcFɑ2Qo0;S7?i2(`b 92vH͸>8e: Thv-c/oy{`ʀ6U!m$U ‘⁷~ x;3xy ?`)3)ZFwFp*I?Gq-#Dii{[hЗREDfO&;N9J^A'цL`]hj #Kaޥn\%-<F㼳jϷt=f^i,1Xtl{C`Q tiʋk֧D$E`:q^I|P(KD{׻v=Eve˖,;mIY*u e=;-AF#kEb2O<|=bFe$٧  (x9r0`u䘿%8ިL~?gːa_c#$ ~b0yFQ<\ڑ"QTꍯMp=yE&JXΓ*LIhar Ja 3ȋG=ZsDR%XdVV|d 3~s$o},x=N sۊ`KMT9/9T&C+ >. E|hAL%ÕRG⎨Rx ʉܦN}UPhۨ='$=sDi"E}>9`;ɂDU]_!dZh,39ZP(n} @|Wx?$n$3/͘VtG$7]]9x86u*p/ZuN}/ZԐ了L̞MrhhU?'Oc幾wK:ҌPȄBm P,坺`G.! -뮫 8*tkvHv;hd;9g)^C0*z`O#d[l?`[K"Ij$^5W3TqTHeFdc%N =b$]yxǀZ5+xEcpfR~ bMwۙSKu~!OdtI`$yѨ"(PG#V' u@[( ѧ| >5;&yKαTZv:OLa Ol}#e7X=01|{]S@Hl_~%+n-vɊLZ#zl[Bt /:u2^|z] JQ3a ~Dɱƴxhk P崴 &8P=y(mzbr|z"k֚_T" [5("q`*)i=פ$l7jLvP#6 "pI4JX'&ǧc2V F\BgԿ%:qh1>D`v㩢3NϣOQsQ<x:G_Y@I:zb|e7d.}oF|+M! |D.>%!Wqm|\ 6`Hd#G}lܐ4͂ 7ꫯhNg;S9!ַf9u47|"nxy]v-Q~Do=oFa^Oh={ZD >dRǻロצ/U} ϐ'{T>p`X4wL^9۝A(.*onSj(>k@וwejf}#[UD!Fi#c L~qP0`'׿I>DԉJFr;B>]e3?3IytMhD'ZD"4LɣG%*8CҸ ~R@ X;;鴬]@E.>l$Sj;:OH<%,"s|1%95Hg O:G`ۓǛ'N*oz\oy[fuv_}첋eшC-{g$6i7"<@&ɃinGIIcb sϟ$z].;҂IrLABv G`񨬁=$L:9?ƓR!.@ /Fc4Ռ΁ ,]A䑜n;tai)P)D@E%DQ;0=}_@iQ,L@1P>gvayoewﱱ*0\;IHH1,qq91pkFcv  Zv܇({ňLkyAİon!jga0N5?,}ǎ0wT`}  LQfU~} !؞xuw)W{w90AwD`yJ{DLڋ TPU57> @tƁf4ηtضiU^a;=s0g;B}e~mNu&7t |\YK 2vImkpE<};[Jî&SM$Krhև,JІQg7aW &Y1O4Md'IA%hYp}/c./u ltW͕y)vBr|.cz#O6X*{ThcfBE*!~E.oPa 1矹* ʡ*r yi;U}$Ag +5?p4 a=sP897'iLFgǵ"N"a=27(Pj;4rM@1|#CCf*,yv~NrXjנciF(wy=ߜL`]N4VL׎IFXi>` c#A'sNq,-)Թ^6W4Zsgf33&fmlcڇ@v2?97(=GWpi}C?f훗I63\ M1.eM504 #I""aہ ~H"ռAu 3宵[dL9 rF.v{W?-7)of{HN]jU曭dI&fB>|b l_|!eL =J (Cg 7C}7z6;:Ij`E<=Mu cq72?1:woT+:N Ķ0{m0 fSvB!pbҕ(Fudѳ}''aᎱ!Vy|1;̝[]HK)nW?,/3ͼ2nױwڍ.}1vۇ@v2 '`>|b-#?<JgcD`l`(r:3f޿0 N41Pp1iXކ_8R{7@?h *A ㌲ԭR6@; -Dύ%ncrsrM{`ĝfAFX##;;Y3nF4aٌ{]~fnn#;ԋa}oMqOz`;>5k֔^zɐ!Cr9*zQőgq1Mg2``a 1ؾBnDvV,g`ݒ`}Y#7I1l(P#u0u 0]!GP (5 ׄ=Nn m*6/7/$1QM{4PUi9 719,s1 CHڑB@#kAcŔx0u3ZGT_̟ :k2~&kժ%=z0cٹsg_ߥT|ݿ̈cl .%߹/ ?n>k^<} >/?ܹfw%J/n 6 /P}̞r{=2!}l?sY`l7i*|{$;Z.XY근L }1@kOn-a1Ls: gDYq8-AGVR>`21Dt# ham1 jIc~Zzl7f0iwiX:bHI[GY ٭Mj-& D O]NYp =9xD>NزJ5-+\%S<1sMpN?eZn^˶mԩS4c} ؾNpOlrܬrK=&1~"uK2vjΑJWK>;oP L/MdX a c1Qv8v*P޹qLMqS\BTvn %7O`f2Z(EMQelT RU?6lbejeqRLS@\Lp+1Sb*_Ǝ~*eU&c$9mb8NNs}1a+BQ]2o`w(ʟw w{||X s [F;ZN-i3svkf6H8cyH zq091) خҼ|4w?B>W=\J+[6̗r\ LRB}eG*CA }oP^Gv*ݹ+Mvn,;|ܺFݢWSĮ[͊w16ޮn/@k1-,EŜ 5ڢ6;@C |ٶ {B!lhBS̵(ttǩDD9'9nTf1=wN~/GL8/=XUFAǤ)\3ߝR\vZ 8`i+4v4^D4+P#KE??+;O-%J2V1`{mm(eggg3``؅™ [R3#H l߲FV9F-FC`]0ag͆. v/_a86 ,Q(i #`  K*1Et0MK]H4Œ. =ޥҋ+ Ҁz:?-46@~x{3 kZޮ~cn>\#t㙼,:hڭQh$=c_9^&~Gx+#SH D(ۣr HՖ䠛>3pw?.V) d3ΐoY=lVZ2o<)]K$b%om $o;e˪|`Y2sn'.'o3*4h1bl?3RJ Ԝp rWH.]t|+ڵk}^Q9d)#xZ2m?OBl`.Ǵ7n>>30tPx7m۶֭[\5Ql̯ltԫWO-[<_Q*u+j1Ս='%XZQππ@@l_`eOV]}i>||bgW^*_%wTVM~w)Q,]T/x≂I%@b ߤaÆ]wesιk΅9sI1Ǟ_]{9={l!"L6MF-|,_g}V^}Uy裏ڵk \4i"/4mϟ/no!O||bgp ܾ}{q-ݻF@$o{O,X`Yʅ^hN[oO?m 0@J~Gj-Z$>6jwug䫯[|y^Ϛ5K.\h w}Ww_d̽k׮׭['_~Ko=K믷 OhL5Gǎm,s>۾4{ecʕ+۵: [ PHb`]t3< ?v`HNIlgo833 SN1!D@1cqLB lݺuA<F2%\"ݺu;-ZDR27n8tUV3l0YdIj? <;^p;}w%krѳgO o aG`'O6Ek֬1vR91l33 _Wxd/zL| $50mЋ.@ jXbXiRt"8dbÆ w#Hv1޷rnyモf͚b?~-Hx g|;^{00m۶~ǎ,aa]ø3v _~Rޗsޗ?] ؾƿ% Cgg ~L[X#pFO s$0omٲiiӮ];G\B:'L``@n۾`iòm P^kL23l8З#qYw>P/j3h00/K8CXx}lS0{1-9J*_l+x۩< vM*M9GcN& `B{*Hr%(tI1DR ٺuȱ)D+`gŋCo4'ΰHP6B[7 v9G`3 إpc>3 3rx>ߞ5*⩽')翏6>|||| &/\|G;P'/N=P@MӔwyG<̘֬Y$ {BtɊ(i#3vggg :/"y߃9/~v>>3H탂MXQsG`Kȼߑ6Cs8P3.g {?l'#>>>Y@l_`=ۻ[rL $?Qfgۅ| d62\G<3g (ԨQZcǿ{JcSP龰 /Íu61 Z0o{wO;&o7}9$z Dr/|_e˖Λ83 TȂππ@̀Ηʼߗ6'GG`9_RD3 (fĈmJݬ~ {uǸkycY7֢ t0?Ek!kµb!96/74ӡً gM|8pILππ@ uDCisOnl@>dֺbŊUXʂ/@lvϱr\$~,ݎ> ͆2Ϙ1c䫯vh3vXkTXb2_1N2 ɏgggeŝ埏w9,/.\'333#]*g͚%^x >\W^0=.ggg(g yH /.ʹs(=z 0@ԩcwA7vA  ؾbO䈻 Ť ||| *]v直d5 ff{xggg(g?Çܓs}JH*ggg(g`ٲe+=p@9 ,03TFr ؾ"?a~ݹDnۇππ@QСCeҼys9@hj󥺑3E533Pp}9rip97gB3go+SL)QM=BH<.ggg:H"^8i62 tB6>||||Ā6pfϞ]`8gL~o333P3``[ L ؾJO[袋dX:&:&l{]`Oπ@`iSЁwlk H\U;"P2p3< ZYlNlD{/b {4>st.grfr6lv~]i&<7{_n91]^kjF7޵kŋTRV\)ϧɡw >EkozE7y *W\q|2gΜ\]'7'' loڴI{9,\P:t }P8X7g}&sΕ5kj<@mxǺFnS  :6E@kƛc;co#3 IDAThqռD" ^KUT 6o&g}\zVa`selJ哋ϗf]KSNK| IZn-+W6Wɿo2[; ˳!xkǕ>ڮ'g*~衇_4mXlSN1 Ŀ>]h,6=]v zY Hv |~.^J)^ ;^s?ԨQ\7Use/9;l_ ͺNM<ٸcgRmR ~~͹n˽sDLAVYǐG S—> EaZ2er/l>@zc^{-7չ@H֭Xb[Nڵk'o}s30l0馛'~ԩZfSN{ E9{GڵkĉeرrA1fw:G~=CZ#`[Zt@wJ\8VloaŶ\-UVƍcnwe5ibl'+,LwƸR:xEoE/.WEGbgu1N=-#DD.? .[8<7G6+ljW6ʚ-b.21bn `};S婧gS( /#@ "$>v. N{f^y0`nݺY r x@n뗌[kh6l('t<6is _9l#iҤTTZ#7nr!6'f h!|  ;/)"ϔϔCn {>^z / x}D `"oykBFԨ _HH` 裏Ql'pB$^}ruy\Ine/όZ Yڿ2dH% bo_Un|Qd}G>_ .}8CV|m;n]:ˁW}:)G?pb~d#^|@Ccgݾ}{# *kq-̉6Ga:,RAK/HGbLܱS[J^ӦMO?ɼy6oH?2fO SJt,oP`ꫯuyfb ĉlS% l~'۱T+ބv+.U}s\|7naӇ@Ag l?ܽ{g5؂/T ~'w+sxlcUV-@!#53襦 |jK.ݍkРAZ|Vl@>Ȟ kaȯڪ%Eȃ{4i9d7XDPה;׌w|˖-KR% lk/jexp[b;1+/\'u:/۷Q|^&>d_7ͣ,/v6mPPAHlԘ} &XThJ6/⪫2 WW J O R&pw'x,{1yzS9c>0,bf,aq-qܹ]䮻2Ojժœ'˂"iX`|v |.QdW__~~ /F1a7ϑ;!,߾~q"ü믿q1^@2\֯_oKl1']{7"̇qmhaNBCv7x 5{^HӲeɾД{ISOճfA7vY:;${bx Dge&{W؆Ǔ U_9^&yσzR]t19@;NtX $bYT"q`и>H5|?c%pm R@H 7dHݧ]854YA @Hr<@nl>㣈?nbɒ%91,*hܓ &Xn"Ԧ!ljD]a<^rUZOǙY & -Zp>ap|&'㞰,b.#om\ Z|D*z衶J0}9 lo'糮]uKcD]tEEg0ff7Pq*TPǔ:ꨣvӭí# wNOmR0WgW?C рJ.mh@ SxÔR xYErB&Ź\\-3fza; [y 8q^{X3F޿Y 5g юum)&gϞV{E;0X(gAHg>2XdE`^ȼ0ukh$>r鯿 7 qolAJ g =YB sa;&#۹,!]=Ң R1I3P0Jz/qd7f8| aVoMq`{x|b2y9\x֔F6dшLk,7PyX vw |bDWFG Pw@ҡCx> 27&0,(,<,&Xdd%U/d6 a3 `fWE 9c $a<&?3ۢR!?tLSeߤUb9A>~GjMn)VbX93PX3@[fOTX VAŷʧvA=)t_!h֬Y)}gFMQ#h?3qf$ 4C[-7|Yq-t19?y+0`p`~dWW8u$z!'=9A#ׯ܌)ѹ?~V7>ަ/=7(jquYe}œml{ŇЮ}?ޔNv{f}X˗/+k2d9$ f͚4Э`I0 XEFBa,ALG~۰b9p]$,9Oc%1 U@ Pljhv x/sun$3h|:ř1s`AnCa#:QpM@4@~۶mk ݩS'cGXX!AA 3qfQg&+XBI>2#!MX'^hG9>| {XS|vG[Cdta{ *~?]>_5@]024;VqfPpVf,)׆1NA,@xvzy~OGo$$gI,c HkxnJ-'*/iJXl ubnJ55GGIE/B|>=iʰgF @A8 aÇ[Ɏ?!_ϛ(?FWi$|]7EU_8:tɞ~3@">^`)LY944Il=dY?o5!`{뺵2gw2qD͙,)`ǞK+2Kŀ5'-czxq}#l° MRc?iJeeێs{i%DyFRo! {} ^y! {も#'Ɇŵw2[:g #NÒ7iJ**\)6 R,[QbCG g&#%JJ2e? ;K;wίaHhBQwtfdAadOh?u, abi뺘CH UK46~aI BXT'x tVXP,2|xI%X0Q$BJ* _(:`q ;H0T_1oůdmåˑ}UZr@~ 'E2@a3f0he%H߰jLf;z';/sާiR9ؖOSEvt$6Ǽ;ף)fl:p4U׮}lvƹ|@AD1A^G2Mq!>ҩ0t3OF3󴧍7w.G?'TQto7`OKOdBSft( `:z@!RE )XB/ƼĺWyLBe*|r-!6Gk1TB8^ggŋYulv͹");Yg'R1E',rJ >Qtw/Ytwg =|Ky%f} %s2u0Տ!g@lsv``!R lQ(kmLNd'_:Qڵt%Ʌ`+1oBku`TFi`[{$ Dry)`׀.^|1F6 GX1F00vZR0tPp<`l,.`w/meI<E U*2l0ktfEIS2 1 0#?(mORPY:QW@d,뷜]5wg1jv|y܌_ǣ֋D- {T:'[37mP45ҺRAI3,-|lcxX1?kf~lPnL|hЋK.fӄ 3|rZ`` bƴhE7͛H\`]6fa=fv4=_t|] &j`U8*]ݺE]U2/oҧd0_b+B:B2?[wa|Ϫ6}ZZOz<.W݈ͷg~|~,&W-ZCQa7=XߴbgB~fK-uH5j2c &!q \kO2jJ]{3Krti8]vzرFd 1w/}l٦uz92+Wi=`Tmz^%?:LSՍ}wx+b=.Ԙv9Ҍ .|!UÐ=8~?d|,Fzʗhr5WJFygJcx/vu;tsQgTXQ֪Ys @W*yJ] sFJ9PNexi=ꩧf;vceX7~Uq$+˔믕Co$UZLDV*L!€mV^argΜ&0lLP%Λ *Lʹ02/L*xc-Xa?~ M7bkÊ _.hp2f׼)" Vϱ AƂ\6=]G TMRlcVj-m#&wlUrJYiT,]I߃mdͦR^RD03S[#%Y4eRy,m1ٶs2ZVV/)Զ/- 68͎g^FUxӶ-n^.YF}vYaԪWn:]qݯދ7뷬I龺vlc&1T)WoݼV*jf-:%SRM+uLۥ2!ƻߺ^VkN/=SvGx y_k4RVȗ#t/9-gEֻL29xRCDT!;Ʃ |Y]``$yge [']p0MH lm7Hn=b>]SnP}`r`:lذ[9."`I7/ fÁm&mr GхZ wK+`z?`EHIC͘kcu8{ ™4flnƇΊ%^y6hu0ܥ1s13lIŲ]ӤzzRB`]WnX!5,\RpVb A (_~PPYFA1]Au\ezM*pЇm]NdLjkr^E]v^!PL Xsc6 _VK]K*k>\! @j]|q xݢrD癖V<9s7l Wπzy9sMl{vĜ 59[kۺz"97gϞ-/Rޏy_3sN0Zr]w{;5W]"|Qv[ |'l'>o$lؽxE܇E>K]Ŏ > ~}YL}3^0n8^N/a>#?s NX$Wt3^]/`]s'NTkk.Y٩ƁnݺPw3g}QLC^w~=d4;dl;Fo$Ms 66&S\' "5OڜceF.T :"ۼغ7(ĿY˧~jwUyevӉ'hDz KFa6=Xۚ$<ʋ-,^༩R hFoMQ oZQ1lyceLHMXH;$%\aְ,xC&W]y<7={ڇF*.S13'%=JNn٘ʠVU6@m5}\kK-U{GnFuR:6)Ҳ%*ӝ^RYA4 0ebJ%oYo@ia^IAz/YV\(`Wʔ} aq~ eAmdN (ި@EAe/$lN ZY%0e wj#*.`l^m*^2UtP>g_L6 з15K-c~xUyciwL9c ,W}!p>H"ذA"i@`b hpV 1H x3P $2RNaA1$B#$ nV guD4$R38 IDAT" Qg9RNv>I>j Pwe{날. e).m w :{d9!m ˿ŀظ5tjC5;KpFsJsHv,\ުʀbK ϫU$e2;πZ 䳚sr]d4N'Z$s ^bv iBjA~֬YxYԢ3fCBva+d{#"sO\HX񄬓EI<-(d=rЯe‘nWHeB 2@@%xњ&p3@Fǂ-*zplkb@mH \$!HW~(MgTuk4])$E`:8ڎFBsݜ?2;S@jeC|#=\Bd&qfȉz7swsu 1ۙBKQl+~ac^XB{Y 038 %;0> x`G"M JCL;P5-rE=  0k3Y r/E <Uq\`:2Hqm+%7ޜoم`$!,t)8v`] y;̟7n-vY Yy Gm &]9`[WS*rݸIR9/YCH`}2\|e ͟ [L[-Udb1 eCeK!(@vOb]4(-f4")q_dT/FP2L[\4]A$#q ߠLE.H"9QKH;19KHϽڮ4D`VyKPcZIHN(\O@O΂E g\ݭxXzuy<^U}$ G+Zcht hJ:H2Ђ F貊|#2e(EhhԳ,"xk HCGDZ^ i :F>xO$(zsOvT,HUq_$$ծA` rNTkOژ-䢌ܑsƂvAw dzbe,G`b y{NV_}`QؽC퍚i7 G=T*5: g%žt%|pd}fźra}E$c,)s-/LqɴRV觏R@pP.l4&U X3 "Ew2:vTPݸ+dHU,\>uIRS uzPL Xz/KUfO0Nr4x''0U H)IUٸH(G6C}@t &@,G Q,FUߍ΃Qυy1v\tSIZ{%~"GvE`ƑB"5wH^; xV ru+fے21ƗvXl/RG>#KٮrqY:3P@`x4"{M 8.ӮtAw \Rm+6P h;FvJ&0ݎ9:QP[YAHY`$Kp [.s#a\u>wŇb\J*AIHHVLBNJe+E}Y /B`!@1$ztwMr\^(a,ܟ|9qڠw UB=.T#k`̮>kgf< 9^9> KV @KNqߞ*>Vɸ{>HNp,Bf"&]͑.,E eZͽKņd+6U3Hw^̻0_c֢oo漁s!IN]5eWyBLʰ$$\։{? @kE缷r ƾI R43'bcʫ#Ժ%Iqn$A7Oel D豥iC ;=c6; ,JBnN0#E*s{riOaQ`KaV/&|)^J_Y@65m$M5G;>/yrBA>YbnIn+ٛ?g "/D7Hbe_?&]C}m=$Q)0)FƮ)Il//rRMbCMB"e͛2l#gM|4g T/`ɘsa濾EC,y)@һC"Mht7Djw(x(;P 8E`ʹ}vqHLLwXn_ cCnijkXQߡ.VηǙ)u\aAm,'l,{$$x {ӌ59aa5d?2&wV1ieσzSNz,C,Z։RUC W9ooA{f;;mY ߫bgl6Qofn:{w;`Y\E{~N o~\ORvR/+OZX'7{f.>lR24iJ9gXA!k<#<%xG*Ng + v`jibFg6NC^ګER(cS3 w@1R&ԇXM,K[mкPS=?>wS<, B5:7CU-y]:R4Oc#܀TDE|,xa]i/m<Μ4If`UյOHtn 9/eH`9aRvH7`;YMFpI?Q*|%##?oq9J? jvd =k :` UAy1=50H?8HeX`P9oWd` =8;8⃅/àoͫԍ6`-Y`!jDx/;g܃P,jtIjpXۻP/)Ov668^E#Y$Wr4Xr-LXkDMqkX/2 >uuO4y R%&F:XjGgǖ$%_U>U+-ryѕmTyyqATXXQxhhSdyB=t04wt-t >zN~GlW\qRxPS#󆭅zl~UPY~# 8 cܢ,u Mg?)Y:F As{[=nWݴ sz2;<viL:,?c#aɹ,wh7 8b7Zv{,Fu - E1޸A{.H/2ܞYs='C5轊>eJ",.w'OB ,)>|r1bL8dvU<2 @ʕ+}d˖-n:sm$*TC,ޱc 6LycgufSS\ '^{Ƌ=#ӧO7r 6nit͋93x`L9q?SRV-{"|b;gsJYƟyURXcyرcMM6XhG}-nժoI`!ŷ6=ܹsC(뮻y!T Nmlۤ'> ﳝkuhdǛyݜ]Onj .?5Ac$ )Y ~Ю"@v=6m Wg쭵A/k'}D# @ܸqcP,`A"P$`H84Ds %I!A믿n=z}Bn<+c& 1P#i??!Zb@%@ˢhiNËdrE{$Vas!W֮]k&8r>:n%\"FXAr1:f\/|~) aa}m[o2 r֋,$IAxqka,tiӦ#ye|i@`\yuDx ^K,/׆Z)* 6}Oml|yG9fSRj.l%#y:Jh9{7z"#9eY#?p#I*. u  c8TS/`4$^jq#A&PAc)$>`2(ԖT9/ ,Su]{ud97k "`8]#$CchCӝ'r1Xy,"Ed.7M;Is3@#ާ` ;V 0>k 1VP(v1T>fz3g8Þhv0c @:1`=3`+ W @n%O>s74Yw9d|8`B>;( 2or@tY;Xi `R(%x.w}g@g 8%0䙅6Xlpz>d[`ԭ[Wj2 eZ PwJ+7m.i1lk!KQHݲHfT^ 9^?xvx-<1~J;^uHB # lRrXo}T dq;x;?g#i߮;$,ƹ^#p2 k^3R oQ ޝv9 y :VEjm<Ō =b pH r(u*_XjϮR͓c(]]`]bOxPϚp2 vcƌ1 lb4Pd8͛ǝ,)[lÊ=vYاp)PtfYx ^ =2S|>BT IDAToxh8| {xcD[aO߈PƳ\zd#',ZTV v(ED w:gVr@mH .f [)ʘg']q,Nիe1L#d-AcvιfG]HX~Hk`k{gGVNs(3U'!ȀWcꫯ؝6m}! FۀZ#N[& h9)A"uB⥗^2]uU& m$Ҿ}W^1fl!O,,# A Ԕ33'Om8EyCS^\vk@#~Lce ̙vގ1!'52<#}wV, ! d;::wW0c8aarf5h0L>T MHͤɝb;1؞O?'XIbgg}*ܳV9arIl*| Xsa *((<H, 8Pp &9 tCvTPr<AۿHw0Pg\=MjթmL69Rېi($01 h7)8il`aC#*D+럾#VCya`xϢP[h8S$A!?XLzWKw<%BMG*0+@#t|Y @-/-a~F#@.PkN3iPY,9L8@~F2#8_%E5üf</ `|s<Ϝ"D4aYP0F\?*V(wfSN0сql H70,~\"Ц\<䓑K1<.'' Z|&@>p Ye,Eb@U**xO; W._e %˗Z5QO c4iD֯kիV75L:`ǶRbU+NeRR5iռٕ0HE,3:4 ,Hfdi"Yra{B5a2PfEsGٰiܺSJ+L!xP&9 .X$8-;V#ϝv|pr1wHJoWaWmuE0%{#R],}tl.jtۙ=2HY2fs {\Yf>w EJ_ {I1lu|RRJ ^|MD̟{k 6D>g)-l_|xoc)H W<rn] )- CJ]$@8P88c?6v(WYL)K^;Jlj TcLZZZ1Yb,R C{^a]!F爨37Y@StWMK}%]=g[RiRf2RZMVY@3k(s=BnZ)ի\C䶻o K7BE42ljt*mS<%#G9H}^]qn&]':gwm*(/TНӱ3C=KSjӢ[nP3@"Ek$*LJ?bL>|be(ٔ7E钨9eƝ^R&߀mtTȿ S/XPj-,F-ԛ#V9 3L۩eF|] #R #,/r\I-0:7;45=O?^l7nXl\{4ܧ>\sfXd9q_| 0[NMi//mjkB eA (ضǯwȐ; 2Bw$$\|nH!&>%DiN4ccW G,`]:Yf<,"hIQFM].ms4ִpR`H} 1;ov_1tdF*d fb!e㎏9`{YՐAj|`@7thl9 bMY5Xy]xg&m.eyp[M328`/+qby<Ǹևby?oѺKH=x^Yu%tjjҬi3Wc]zMӨRN"sf͖vc;H3h(b.=cm8FEaOڶ5bŲd-K_3;MSjRnr汻AYk^[o3{nobh׾L2M,_ Բfwޖ;e 6h`g|?C,\ i5 RPu$B%FBI^-k- dbz(@7+EiA߻`3V UvRdc;1؞wQT]>PC:t `^P"좢 "`A v "{s''I6d\ܹ{}{浾<9ES5FK]h7ɍDB) 4P'ұe'&]vҢus)` $#/އ8Myi:(!}˯ʲdoҺIk+6a Iwy?5sMX`Vnr51ta<ٖ{˰[Ae([&w<2a)m_Rqvo~#lѦ&z3rb^?3a&PTDQ#I!1H% MJHJuH&C ɔJWi^3=^˲pnwJ#AnImlaɂc-ZIv7l/An2E)`f46T<ֈ %Bn:ɠV I@Bjц$ZH G''8hRQ&$/lBJGR%dy>HA,RժUm LH¹ a瘇87W_}5I D8Y롓|~) "HǨȮ(:d8Ё#=yY/ 핒 IVJik^ oFTy,Vg4ןݮ@u~Rd zpXPTa\޻o+]U.A@Hd5k$s̕/>Fs1-Y,n&Ӟf# u ?$i#cA{q\r6}И2A/U ݫ%rTj2rEoDڇ4TwiV~4xCf͖o#uڵj[E`"d[Z% ƀ墆r"i /M_pTO4;޾Zn_?e]5'Yx&5۔xO`cbR}X, F ._)<`<E` M#@iPHl,3pf EjSphHGx( AȾ?<(Dp>,T pM!]t@XΥZI $"$gIOnhjp l8SG,d.uXz:m?Y6IZz[l1-c9 tzN{mw=uMqMkd Ͼ>ҥmӡ쫚KM7rQcEJB&Am w]Nn%-ޗ@~+Da y>ː &$?mtCkoI\ ECqs}^3{OM6pB6c}eQrƙI/Txa /H>fÙw;}`2kv^!$ÔI\#gGW?9Fߒg̙33YdP>dsYBddee[Yџ[ՏVig`+>?dΈ2 nYFa8$~Q|'X"C@.(K3N(p"$`Sh@t G@7"":h,l K&)`FYUPA1hwiytAcW%ˆЇ\7Cjc=~DpO A!D_ AD9$J*]L:՞/$ Udŀ2"$qLp2rvF<&[XtMn$ CaD#Dzh'w0ex(mܵVﶴJw^Zr{v &q'sNg5 P .YJ*$/H .5jɵW]gio,ӧNsrWRE[@EʏS'?g<\@>s09Mw ..'wdXZiP >LFi}_)lsN~|t7B~ih{|F Hb;0Z:3ߵ0J\ h?3+# F%HV]`w۰nۋSLL~q3';Y<h77N:F `bDE @@7Q z"֭[CM\"DH\$a(TQы`&2O)/U4_z% wD2)[K.N`pqn"cb΍r1`dJre0Q`F׏ @gE}*iq' &,xF зf10n7M<'X"o&L8h 1Ĺrx.vNlmWy yT)|(&>eE+1q1[LTNf_~0Qn֠Q-o,*>\?|{]swm#hvs<61s)i@K:믕qcL(WL Ul\(CH UXEJʘ{ '|Em3QVJd#{6yXM>'| O/T\Ryns6RڀeSS]xh]ѣXU-5D'*zS`?e9OjZWU&r^}jcwu%v7:zDyd5]?+GJH eV  Q I9c>Z "Y065MeXbلqFG!(_)' o%r Yj:"&ɛ9j!B P M&FqR|1I7D?pJrAmaV %r& )WKdb&RWfCi c&Jh'J/.m@#$~JH6d\hPjxXp[_# U8&LbF7@_,#t%˄(k3߼ OTSLFpxDQ#&z Hi(%\wU IP81zT,]X a]vMyE;De @`\;v[H(ue䨑2qD-.Z`X_/z`re,3J|I_tc[64OxX(.v jٲwq` U*Z:s"?Y]^#~3iC?"m $ONyRꖋ~NjV^߯Z k3^+N|b8JC u;T,n"I0U.Om-Eϼ!ҭEN"h ?)9r:˨D5Z`ꨖdWbzt3Cg9s.SDsuhOU4dE %7A&VstRx[0^,^f3 3O墎`Ix<BBP_QWnA>#?#_, x"洓# } c"N9 @4'F!@$cqg #E1ӹQ9~#ZTI8>_l |qˀ[5q^ʄ? 0 /#Il\t4۾Va3 @*% H3Qpp?0 IZY)3NR'vTb}q ( 0 kV5Vک=NvliOx8d9 *(=mpM`\P=Rv;l[YhvWM>h j LEh. 4"H"\/J7 9o| 58\<0c=8RE駟v1 \DK\lJ>Ĕ^6ƍ2~n0p˪}fs 94Mrsd~N=[IRl ?(.~j *_GLM'lw݅ [l* |"+o|A Ry>p=g+48d ^γ|VT\?$&(^ *( V(.fInJŖv;l,e8}'cfbFDTgVа9 ϗ˺l3$JÍ<36.Jh DC|A7pcHxPp2kLp5%qa$~_R+ ,N"$jD9'D4Y2S[dʽgR(TK ec>`#͑I}$_:8όW?ئ7O&MT }C1͵9 zXDӦ?I.ll5j!"Poh)1Xk~QFmLH' ~c1ڎϴ4= L n)/:mA\Ug. cTuT#РЅo Pa% `-Ŋe8㙞^w&Eh}jNh n q'xmg۩L}o+:.Ht *8Ҟ4 m)j<z`$0 ?W&K`Mdg2@V.kiug~X܌p,1VՆh`Wq荔j42/(Ѵ=r Y/}@¿.n(%<#R ӬS3;M1D* PFjq Z Pfx㪱Ͷd"H&V(^1%YsURAav5pm&Z"(lG0"ZRO3J Wƞ=5ب`'dzR0yb_G\cAa (G "!ҭ!4GZ iSLO$8A#7)@$*#,Բ]DRS'#mLCfgc@A`Z9+Jo&D2ABJW$t\ÑA M <Cb`=P㜰3}`LRd 7g7'DQA?Jpa` ",[E2F1D5I1zG83sŗՇ6nD9DcpTHɣ96is/2=6 S`# TjWU&dh+uhK}դbA!n9vjT.(4'[^*d"I`Z!y9 Y魱0ˤpW2R9J! U`;F_,0V ں&jrL9caLz9Dʧ~4ʁLۀ!*@T B@@ b @1RyD fEZJDNFڄr@ v`ЅCJ6MapQHCHN $B IN~M=O O7I.?lsn1$qr7(v0sK˗97P ˮpn,]\h )(cǧ,.b.Qm+yD^F BND5{lo9Éƈnڹn~jDi x}Oe镬$IcW,&J6X=k:ԘN LF, <WډN (xWcm9Ψ2$ʯ`tFpnXZӓq9"Y :cV+C5S$8sD)2.G䝤PV^,6 ǝoM,C-lSYxJtc:Y\e͗9=)0sgh F8˰*sFӖ6k<֢U_M'({`"ݖ{l@$P4@۞=f)MJ24_o$ !q]̂u-a hH5RN}o6EmLdqК4n<Aģ& 3xA΃ªD1 C {Jv0cYCVg;F"%=X!mB,(H$  gGVdi0i#Z' f؎NPXc*Zcّk.Fۆ>k=xrs ؆ _P> ~QU1~_bϾo8,Zᑚ߉+'/ku!nʫzE))D鯍'Lc- # )|TM>0P0&F)'"D5o`hL PNI4-|7~?% j(_Q,=N+kҖWTi|gzN<FጤNTHؚ(f)w‰aW}<_H6*-'r:dF2f|.S66DܰFR Ke$Ґ,=0geYG#M^ XBD0 V:IDtߖ`5ҠՀB"쯲} `VbдK 4g1+gYDu˘$E'x-%'O_~#rN9y#Rj{~ }mכx%S JNLԕ"[z !ɤ3!U7v\jI|xJiX5|_6k*\|xg$c:EnܨŠP>Q d|Pw_)ϟ''O2`+]+CކXm n\T8D,jH7΂=@8+Zl(pL$g3f#ٗCL~g9?%6[2R(nQ Q@$?*@I%s Xz-Dt}Hͽ)eWyYс~0)P5EZ))'Ua<)>ރfB6Ey]՘Dms&/ ݪLie8?"Og''ZT =0>{ئIVsWG ɣ|_fC{Ol.,u2 v ^9o,ybt[f#Ir( @)Ȓ&:` QdmT4c) Vo+2F#pU2}\S,qW'7xf˼ߔ^o`CP zIF7JوpHC|n߳*-lI͆ Y:,sy&6D9i*5ҫ@4q.1td׭Ѱ3Ko1ɋ{Z<7#(ll~|˗0*! J&gJ 'Z޸mO!`"HcZ^D_ГSѶ &J SךtJtN2zh%DcT2t&L4|dHf2uWPmstfW2I]$"=I]T?o8p]'dg ؎^'E@R$B<| 4bI=D.C~: ,}D26Kcg&&"cǤ,s?)I5X*m.JPDիgA$3`exQ1B}AR%,YI$ocXcf *c?x|a{|iZZICfIFv2e)̤Q{>P݄(}fw+Ԉ˵wmhl盧At%%M4O3hШEV: Rky=8H֕~XBBFQe+'isV#BReJI/Ja,~ h*I2 xPM4JgVت1)!?v`O{ۦݛLp`7q kѝ<L^'O_[yag"p*mȯ`>?uhSrWVo{GM%GZ2}fr/=nNoFZE3[m RVfɏӦJc *HC&%UPzQI>xɍ sw$Lԕh%%C;;/k4L 4i2-{;@mJDɉhٿ?7XDhE'##Iy;&T 5ڌY$)5p8_$:QfǬYRfqrJ @6%OVeQp^>Gq!(#.k"jժ>mbe+_M;N%]P*4"K!D(UC躖B^/uzD$ʹ3^|uUNl罿m/ZlqiG HWS@\L4~B>ȳcIŇ$w}ҧB<N_rx~&"vgcA$%-pɲu?ʌ/;{<+)5U̮…=*/'=OzOGgّTHF 2p@` a>pϢ%- ]H0i¡5S~~~c ͂2PKt _ok&1@DpG)ئl7m(Y #zlT O2<$;vQWء ~{( (x$[h4iDfΜi$/F2i pYDnjJD?A P8|.7HBxm|u%+8/$#%VE=&e ߅9&'N6-So#DKPI~Z<ɨ ?4\_%C66*K@Z)tF"ZcmHyF64ʑkMDeW m9^Aȉ4)3pi5Mo#EƯ&VtnLt3i(ϫK^zL[z"B{UhSrbq Q"C֎`5UB3KvX晣Fe-Vf>IG 8mpJsbypm'$ 'IJc?f-15 u8M$E"II@X,-oq,am.S pcV GP49ZD<9>33@)`qlKODQCH3N^(X:`%X6DuCA3C>}iC^& T}8G' ![jl&=Lx@{EEo,A^iQ IDATE:L@3˗/`^ 9?4N;nnܘs.~dx]3ARVY\D wQh;$I>solrRz_@[__yYNy>`Y)_)0ƅkYtN7h_29"Ԃ> 7&5L$ 4輤;O3|\|T-mTvGФ =y81*05, UJJTI B3IN ~~(oMܤ]@2 "j:&~,׀j5ٵu*o5Qe$Ū*i9c |CEdH^s^qbdd3|4Y|\q  YJMsN`8Om^byOAy9\0< JK0c$eHB5E>@Ygׯ`ɽE3 v-`bD?Ɍj i@p>%H4k7<-tz&΄$>QDu7:ۦAC-\[sJx%qphD1` G) Srg8nبp5Zfm*$&häv9u BFɵaŔN5"zcyOdFˁ>H;\nVdX%%JΊvj_ULV0Cp&0 ~' 54Tgx !+ROTf_zy`pYe .IT<-j3F.gLJ3)a7ALVZP~W8.< Ki7Frr; ͵􎻥x@t1؆_"+2؜n0fEy"C*w:1F7aF22.?L#;\1ZF]Gi\SI29ҋ{fgKiQ$KP{]ԀJ?S(AίjuR_&eHِP(9[\MiyN*H|d\bMD $Kf8tF-QGgR_U.1)iU[NkϨab\9K$iN7wy'5HDbDmhHy9DI_gPA3x"QS.ȿ%J#\m"DІm@*oT8&cCg52D0~z(`+8` n1@]IzyZ5 yfA6ɛblX G %1) BJpa $ 6)V9m@Oeڋ13_u_O)_%H ~R"͆O]H&I *alq X,_,;.`?,#(Iy^!͇%$!hhtR\+/9𸡑&ViH]~g]Ll2z{>ꌃ{M?_rF` Mg pSr_J5,.{PJI5O54-ٮF֖BO6@9fP:{iU k (֨n쯔GP5+g䨦$.R|l3ERԙMFQ7)RE6"o h%Lq4+I2Ѱ<]dLbi]t{V|]d TF H r<X>/.1PD҂ڍ&(+4`U] Xg4 p Iem >5e[oHb Y^a&`;Nk'=UDJf]I\|9Q?Y 描^&RrS[DcLjI!t yAZI޵wQĨh)$lb/Xa/ P'>wf+S &J$EԈ2 @8b4DᗣAϭ#M%Iװy)N2koۃ{ E9>j({H3Tڥh{4|V " , l`l?4w E M!$ 6IM;|s&sIlٻlQJ˙'J9puWdηJ D)js=@MD2A3;iR\B<`W_?y[:O}>tm9^F)'ID9yD?$,>=eL"h]La5&R'/`f6XzަܴF-M[DKXm>k ڿQoL ,[@L)mDF@2f)2{CkJڧM*IzEt9g>?mQmJ@^BC#8:@d<@Z .3x|xJ"`'/IF9_^yIVMc:n'fwdQnS -SW$ 56Μ>wm(CY|{ jFK])(#YW%yQT`g FfUWhy`F~7Kx>5mQ CHNik ~R}dD/Qr H6Q)UI2{6b y9Hf_m~ݵпy?=}_GOP/.'OJzKA)ONc̼,>d jLjmV dbnWOH+JF<Ԙ6h6ohvB332_e/^z *@ >3Kflٲ R3f̰75n>ebgϞma2h&p}cXNLdh^P\y)&3NJ"*RLh!AFgsϵ}9ѣGj&1Yr R)9ĘJDN4r=E\^t<3/hjƜ;fH8GM(TK_툒kSE?hUP{ 0g#Hmums:RwO$ vt?\褆NtMNtBOP$C'Eu߶N~ByK-޾M:<,V geK'ةDIh6m) $D3jVf3ڶy #Xm"O|qy =lر6,o{mt)P8)z'e)wa1dff o6,auJ$T:bhp r5@7@7l (Qp|(:|$nݺu#NĚHt$h7@/%oڛoiA)ƄX3Tŀ lɬ60?\jԨn",ٟ(3.elC6?FORLml|KlGs4X~Pց\X/y[Y=gVQyβ,o{`e_]$ u'Fl3!cU20\p͡8m ݶR?Rnn]Fu,\trH'.Yy){{F+pS}#'?SW D  `ۀf͚Y XBYT1,f5mY$O(jME"ϝ;_@+DOyƍ!I~F3V؀O?&L9F$w:gDϥ;4 $*Q'\lxHP @ 7?p%/}}s7>j'O(}B;f}L2j$u2Ahn;灌x`ݶe7u`K;sp><"Y<"&uk/J> lca"iؔzpPUH4t @@8#TSvzu&L c_J*{U!8O0#$}hՏ&7m2w v6{@oV;=rۻ Ÿk8@xin59E dg9V ~h@:s l޹A&&7v/EMsg蠬nIa;R,=0*޸AOzD6Tڙ84TCHӤX˵MЁ&U 3灜=[ٷȿ=( /rt `场9wՕ6A˯gl?lgiz wYI#isy( 6r&p"y '{p̽ m$гv<رUj6m-y '=pۃvwJj9 wl<xlyjnAlf@i/dl3nZZN~0lQ#Iv^yVwvnv;wlRϟo_N]!ၱ\'^$Mj^8bڵK+&l~xnhx|EHW)ql[fjժC=ʢfg]Cy`۶m-7㏷`r}#E1;y%9 IDfxsWHϟ_U@3Η/_]+Yu &U4`/_^nVy <@6Nkv8:ԯ__W.[p</ Ko IDATS":%lurh>i9rt{/ "lРzҤIiժԬY3PkdX}ӈw^lL,xd;wOX? ી`6H'+?\} ` `O.\VSh^b^;ﱏOU[tK{短;u$7tt-ǯ}Hx٨v:=bUVUv]t\Ӊ恹W^&HIgl9NC>$-G]VfΜ)SNŋv)EiT*H j䖟^l@2چnoO_\ÍCOJ~-D\\]# d":`ោNHo?1 >z}LJJ<֭[KsΉuy ߻Ih#<<CP9"6[nQ\Ӊ聹.B&2 &&L)-_o_D6Xo^7h(U"JG%lqgꁉoJ$]\CpvHBrI'ɫu>_ ()mz4s`>"z펔eXl4lPx G2n$+~:z<<@H#_x≹ltn8Gva:f#nfi_9oQ( ΜrsԬP_zxi@yQFvg{ۥKKelq0wwM0,YD6m*mڴ9s$X]w2G?&֔sWgY X2͛7]vRٲr ۟~ᡔfN|owyvOiF<7<ܻrru97θev{EV*g<0~R|i=6r@nIJUg ٳSNgy&a:<<&x/QE.j~Ut;oYСCۻ ,خXIZT[۷hCMo5$]v̚5Kz!O=QB uyy x-^Qzyyy =P^=[o]ss/'ET @OoPAr{nKo+m[N92sprF<1^)]\l<;@]w%G?C:?`7L{/UVE. o**W7ݚNc*`N8RE~7ܹL>brײ@\y`ʼRhڸ@"{nx lV=d0ؾ)V4l;Dz@ad…'|bKEرcVZ5>wpExrH),[]F< )r/lGՏFfOu^C )!k[l3իeҥ˾b Yf-)қ5k&\r 4(އ<<#<9>)V95<<0|p1b}v<>̀c , ^'%>ZN>yoO?/.e8`_f}}+U$իWڵkK lF4Μh)XTsz? {w˽b~G<jJ8@ Nnhqڑ wޑ^{M^~e 6ƍe)8_5jԐE ]?~[ʙ@$rcrurH,FNzUVRfMs3 9Hym#%lϻzTl\Ȋħ^u+tX3灬K{KŖ-LvJ`AWH6O UԩcyΜO̻W(6wIrN\?ׯ:K>3 ]95's.%[dd#+jRO\h裏.upp)_\lPLwH4BzԩSmB3Xx]F&;2/l_yTY%DdժU _I灼-kyM]^M9nAdʔ)2iF&҈] q_(ǜyv1ʗ/-^Lyyy ut4=}4m۶m;vΝ;eիWڵk3tv{% F﨣ڵkKƍN&MQ\,GCj U˟?,Y ;spp'y/ 6nęoOeL-[{na%wr @O^<+Y@)Z(Q‚eJŊJ*Rzu9e˖3gcz%.q8`{ݫ +VL͛g%988ēj5rs<@kfYcI4ՎB Z@o ,gJ{P7p4+xo{ilCyř۽,zS_7l UV_~Y=<7h}o_%WM>:~;zlݺUyy7/LQ[ 7jHZn-6;spz߻QҮ#Y`d z"7oXjcA %؄Ε,t%|]9|}(Zt&H"˫je>רQCZh!=zO?F98df]낋HeWHΧd_H\p2eʔ8@^ %`Q9ph?OQjܒNjR652xW_}y|' .!<`{vdDpdP $U;vJǢmڴ#q<<<ٶ{+QIA5[W.s{Y䁹sm& .d֭ :TZjEGp88d۵Mrdr_`R}ǬOBq7ԩSt3灜dܬRdU9q?9xLdl1DjWK:=S :N'ι^D_  +V/&@,eTNt;u].5GV ۦFכVsp9믿m/r=pp2lܱF.[)$i߾}/͛3<#O.;m]6@wܗ>zTl2O{rѢEҡC~饗&;ѕJ1U帙=!v4QΛt߽mSvv?T93;-_?6-?COݞ|megn+dӎuRd)_J8GZwy2H)[b }M?߽o+\"G4i\wuV駟SNɻ_9~wH,`Z`}ɅۤBfYڱDlqƶ۽z[n%fCXi{2Ya*^X;(72_"*禘YDK?KS!3{΃}`yv@ ?d{22adރ&Z$)C})>=n*y(2n)3۳O|62ه]'Q}>`D%5-',+X|{{f|j ;x-QP … 2E#v'eJRżxmۓO.h߾klݱW>~,Y^6l%%vshǐ1cPϏ?HgdY wў.^8Yй>)i1k΍;|}{v5o۽ph\X0o^i=@B/^[:ul}o`Jik_Ņ.:I`fL2e;`Ґ_}n.Vx~ws`T.Z:ea@nd3Q(R7ں{$Ir ;̾Rw>5*U?&v*2zEᏍ ?Kd_\JT-?ȩjy07o^uTm!o{\ nKʝ9x}rgX)@vÆ 2Ƽ)\PN=i^y擝{0pHʗ4@ݶ}HJgA& W0۪b]L3L{PJ'%_k+Tbima@}"m`5Y$Km81o+L?6K>цz&63f\ ZgO*h@j[b2`{wC3s ?>*S>mIi?]r[\}މYvdݻwK>},Xzꩧ,2d̜96uc;$'aʕi&[9 $ 2ٺz.ouVsI,݀Ǎ;6k{{d+\L0`rʩn6I%yT| P-k51D7'\ɷ&NL?2(ZX93ArDԫ"ejvn2 v Í~6O*!N?ܘO 1XuO )Ͷ5W,Fclƴ#dLi35@ݎ[o L~a*vLk%|#^PNծTR"~\x}J}` åN~ҵkWy] d̘1-P2#66::ʴdԽ8o0` h,@ۀ: (RNS@v~P X)@PUP@a0d>cL6`[m/ZT? cɘ=c:βq2ywRTY"9 " Ӛv9*׈aULL VAQQD@4 ߭ݯFcTWzvuy=XYzZzX^%_1a 00U5&<-`izt,q[o$M"D`HcdKzHv/ IDATqF+6IH4^|EKs=3rg駟.*T=Jo_n\'?3pϓ$ 5` |i^V]V7 a"`^G]Xa0njx=@q5}h:{L$%_DQ#ce?P e,{P\:@F8{P/Vx=LL…? ]8O$%>'$&̋1y1 Y ׵ӌ)Z843 'ǻhĊ/>紞$91&SIDX .bBfכʁNBk .[IK"D``Ws_ɮIۻ~ToVX|6|p裏q„ F%K*VhrNvѤHm:ΘB@`Or x5 JJrgp,:%b]KA)Zq') HD@;;@AIg@gKBrI:rmCB$sqr~ V h]X}NX~$7$b (Y\^KS{4MwvcQH-R]XJngC fkm:cieS[$9S+:(UY9zc]fqCeuUK,`H&]// j(3hy818s*Pύ {,=)M y²g00;$T:^#SAFƘ|N,hH̐ӐC&?s1>Vhݶڧ^'O6eh6^S)&{`{;jM*s _T '|ڼ`RßAx [R+S$`G#!ILjItҤ?zClIL5ɃJPʹqa.}2 jL\zrh@Z['>ĉxYgĔ]8,T^GT4mTV*X%-@?{^#uwj+o{tT|?Zky͛775l6Xmڬ".QZ j:Xtž K̾d)ϕHlIF.MZsp<2깍uΑ;Nܰρm!7*{3@H2x4HM)z Qhr*Fg h8$9-x&N2O$Vn=9 s5w<l3B;Kkժ%{s95gjyȣolಡ&^}[267(ɾK8+(L Ii. #bn%9fZDPbXn*iXuTR)NU; }^9ā.ou"qPKnZ Ӟ#0✫R3V;^ d.u}~'77ui17w>_~\{CڵPqxʔ)D !ǩM5I%璬lwOlxZȑ#S ^umt ɍu5ItCF%):wq:S^0TͶP,U!IK% L3N)0בt# }/ _| }QP;'s#Xreğׅ>]OΝO(A5/|-&iU'KK[pTu %H"׉` H-K*vJoi|-,U` S Xt`@bhsGG\Ȓ- EKiJbӀ9y̻ɳ$Eg;E'xq/΁3%ғ;Ӭ¨} 逞̙2N9qj0Z(l6O~#xifKhi(tQJIFTB"Vv\9TBFطHA&X`SZ#0a~aC/kl"Sqt.{BE N#cU1^uPv^}PF3o9 $S"_qX !6)I%kh0OsY9;Hi}N%F~:%)_L.oy^\٪6Z1wC]쳏7D _+7MvmW ,4|LV+vo+}wL2[7!g l?Cu6[t,kFdgyTAIfd lKg;cwҒ#[mlJodSgmXCiuVSNsJV%[ϹT6 jjhF1lRM+l}XZW=i9 I siuH je]a^ܱ?H1xi;(Q.̲'L܁L,. 㽌=?GRT8#!9I|Я<m B /vD~?]iuy~ӆeƜszr~%'V|<-gV{+>Ȧ C^,it}XX@-!Rc+ZoMQ’#A%$3⾁FeVFY[ ! }6 q̳&eMͶhZn>(3F^P_%!huPEK E(W.Zcrճ#E gM+v/rŭd{b]PEX2>"|G- k4n>uYxcA{ڜ9sw2l0cޤߝ,*߿XǏӧ ' ?jO?2w|ud$1ԤtO_xϺJ߳/H}LGb2n}3}~g1lLe短K{B`U^gPoşj'j)` :g#b02β{$LoG62V9N,PCDC9zpL8N1u.pcc+Bw(IKW2X"a<}NIIwo\ /~7>$w`vlyu2"%X4kڼQJ>-\R  p -I~5ZeH,BP!UgN$"=3YjF`ae f=3ՑGfuH-)UÄ(ă)g[TfF1 f^.=EĆϴϋhM8gv^s1BoGBc$"qPIJ:=nK#vlzbGf&zj֭e%sǎe̘1}X̞=[ꫳʴ?tEj9S lO6'xžagϞ&XhzpeY͉jOvJ"P#^;]%U;@6k' ݢE +0Lim\uNG $ֹvq ۰=4 30remNcă滭s{ &fs.yB"}->{ pv8SSI ;(v+h sLj+$!'a~~{^ڪE*IvP{yX8v{Ewި_;e0~Nd$?I;S-mE˵~6Zl]++\^GGKkZ(0x"iV9zAY* %57|%hR;VH_3.-?0X)2%_e&YIFeU#GN w60 Jca(hJ$X( ~l$C7F+EN4ɀ+`_Ю\PF-(VgiR#"lXq뮻J=iT-5墋.2fSNr%N>IJ}۝= 4YJOK9gk OzR=<$H=WH%a)r@% @ )X&! XHc;PxbCkw4`YcݎS͑s"$N3#n` 0aB"(CDzX@3o@7Փ`HJaG"+I(wS IDAT X ʢiЈ/'S7M3^}_mᶑUE {.0SdSPfHR=3 4=>S KY|yIogVs+(^^$h2.Q!G,FZZ~SLƿPOm$MzBgɶH摷8F>"D&p܎0$ۦ?gE<>Yi;IZ41NfX7n.QpG> e .A/Ν;x$56)0l%W!?[`nӦ>j3СCSWp /Ф'/ Ò#Y;Ť%3DmuqoԊ%mL>XJ|ywMaz^{TKe'2Eʛufb[5pt0k:gřS-" $sIJ\#w/mqhO|ٌ)6Xmg6@~`͉ňwY~Әm_&H1*p銍S3,Dd\w.yIRgwSUJ2Y<7q֘]O:mM61H*`o7Up&ؓuXK% ?tX?Xj )08f\E[ Hjp2̹CITt5lg>]^6) MH"$ $"04o+j'n#uG ]`ǝWᢄ?0X׋N&%naml)q^1n2B& fo6yds[e]/Z!-@VV =x)[t}dWu.޸ǜ+O=ߐ GiW/h4Vd{ ̵P~I桓V1 }M~#eĚYsD"FT=rUl u_Οờ|pi V̄=yw6zu ]b10˦'orU20' $.r ;IQXH?MT f?'}Y* /0`izf8 ˛"GVM{igj8gl7WȟT:62 gl1-I}<@kgtakbM Qweuܾ4q2:$lb.F>vJ88gB#r(eXP>#`ڑӄu$@Tޏ'!4[RU>S\n`u~=tn- ;8#@lٲ&Ak]R*`b:iҤ\zrAQqM44G}d2>׮v#HM">"M>2oCt+?G5( nIJv}L8K.:I,}n}7k׮ݮZӕڞ rw<;JmgiE HD?FbIqzgvMDwF-UxI X/ZD:edM Jv͖$"AӒb/nYv$. kQ`R)LR6tu\DL0$Xz5YɤFB<]bS_v#n$ k:JScd[wBlPړa_jHH R0.k^ sV] γd@)nelZl=?KUdΨJͺOA0(1d9}G0Ů=wwxe_vb@{nn(:'X0xlctX/IѣR$U##S:P9Lf%:$ژ7һ{ULݪIKMݢV r٣[V}~wV~&%H"#03]il}TmX}4\:: oYRf&Uy楣Emz 9[ki$@J+)zD,"9b(SL#jcXv[*g f]BcDjDX'47W!\ۜ{&Ar*c%Hk5U~uVJ>8C7Z G@WTTù4i*l9\h{iލV$3z(/Yʾ Oyin_}l2_)W,ׄ'9_o\7Ʉ$qEʘ4?,fMѤ3ވ,cG#~e ,0A¢7(PIZ >exT GK$$f}+egɆh0 0%H"׍B=Ke %[|JRWeS6׍:9]BN=h{iլi!$HH;`t?T;XD^Pk|T-Mn+l̺V342D _;=*~L*Ԭ`l/_X>8Tiy >RecwsnѴj;gp:*pr ,3#Q#(ɓ$o 1o $> cslB>䓌05.Ű>Z|A9ʪ+'9VFM9gܐ򗍪SfZ4JC<סk }"'t.aAN=tawFM>1k}1S?~D;,/^-0>$*{ȔFԵ¢ }Wpw3B aSy֙r7j>uǥ)҉)٣Q$5ړ=)ݏnR ƃz-۵Ç=侾eȣW_yURJ2}tTs1ǟ?;KZJ=^@/&b%.Tb9 ;{:,rmDI+$s/ v|'_|ņ8}r$IJIDeQls7ߐ_>xWU 4aYe*H"#9ֲ͖ LRZa@` 5D=wAwbȮH_y5zG-453p\wurw+0.!0ߔʈIZ5Zљrޜ~Q$g*4nyi6[H[ZZvm^מڠ!!>*(Xc#:Wd&\x~Ʌf=wX+bw`Cl/*pLdPnD8ieۜc;dȈrWlw/wGo XYDCi}F`U! [(8a%=)LN<$r-eYe&59og0k840w}\{uX?˗+o怷=nrU|5+KRC;4>* }>Co!{Cb9䓥`AW^y3E2cO>+[76U%2ÆAuS`N^v+.9W(fJS` XZ}dRc\YYPfbn"#VzJdx=$DR&O͗0%I/.gt:Ŕ`ʕWʰ$HM\ iFfIE6p<2K/T 唗sfJ> ?M2?]!Us=3zX,oG/?`Pqy}goa@"]*/4y'mqֻ~z̏<(OenvgțCIG |kyf3rܑق0^ͬx^~rYZ~'_}Ѕrk(67M@-#-T_ƒ7_{O&#ɒ5 _=|߿aVy=p nZZ'}&H"P#oTOfjmzZɆn~6UA-lGGC+}o_.џ+Y}1R#ЈcTmS4iGzc?7"2jeO{.ϥ8VhWoY q#ҭӖF:UuqQ#;Q/U1$2+# U+(8XA. [2KM$Re>xT/r7vnE 3˽g'ͷn&Zn-իW*7:qdǎd2fy,Iu'q1kф)o09xdja*S&ny"z\ۀ\4 ߖ?nVT-{h!o?;đ ݲ+PǙ̐ :#0j0<L\ $R6.vt6@6Itn /٧m_ <ؤX'.Dϲ$EX㜇M6|syM#NH'1[cqHe)}M7B.[2zWq4v͢ מcȡ{jEH~>Q?S 4X`>1=zh^{{'$7FyeǍgp+-=kBmǜ-Qu*lÜ7#3YZA_8/emeM5mdy+_)_^?<V| fN1%H"F@?~D_>.W {Ҥe&\*Ԫ-}˯zAXm=.)'SzSO:R^G̶ǨſDG[ҹiiJhM9_3b:;KrXÈ{;tЅrQW_'|l~l2u$Mh&gv :kaݪu/ږokX^( -{!^KN>dN%8dCԶ2:OTJ}%6ժ'WBN?4c!>/LGwY&wٳzxoQNW s= \pKuo$ZT~q|QFBU]wm\:r'JןVp#V of#ޓG=&ӦM?[oMx 9(?2yvgԡ 4t} ob=qF.#k$Tk) ,hJʲE%$l>3'^ ȝkѻz'O8Na4zЉI>7҇c'&Rg=PdeucE}Ww×s yz{ԇ+buQQz{%\W"̒[RX&hj~^iA){G?ҏCyh%~E=d}ʾcElTTmTKo)un!{w4mXCь`*vhx?B? ( {),Jr &ڹI./.0K;„^߳ߕ) pɴh T.}ѣF[nE_>eNҩ[4Kw*B׷s9h"ymL|? /lȾKg(SS>3 m8S {8XFw|v%-"M3A^yٞlo+K g2PˤRS˟ —ϯz.z^ oKݑowgx)?@oWOƣ.~5E$9N80 "3"P!`BbgvL/YVx> |4"R 6'肹gq`_2w]IW8Ot]zM <2ψvZx%L}dX2^ԥ8 BE+>2%BkL>*βn+J~|r9s1bq-AABݪ. ^ IDATs&`ڪKcPh{FcU*[9Zac: :M9]=rXif{rՕDXn&QIve]f2$ث,//Vt{+/H Z\!%AO;{37Y$ E+,; >77_INsrq䰃o'] `>ă~p#l ,H#G^K|S] e9I\e-Q`=ϊg_JƾrO˗+}.J~2mcg+sz.gvU(trP]AFzs?/eGJ_6yr/E:nlʭNKTfL!=9KZ:ɗt|V^u9tCK倮pA*rhϙsɲda|Æ 3˾];عe{ ՓK殁;tޒ#5 u@hՋ X5c&͑`KuP ~N4>FFҐm@%z20$NzF p8 ʹ8WxZ'bg;0e'Α0Fn?-Q%ߎ⁃W]u7Qx#퇞+>$/wԸ^~e9ȣm[j~ `gZ/,/U$vi֛ZG+C^Q 0p@1w >|kE iMCewXurV,9^V͜U3v7à穢dz6s/CZ$GI &X,D @5@$Z`…K'[5%}͜c\I gvt? {,yS)ӶONyH'q/P{ xsA{}w @ܫ"G*Ik0ߐ[nc};PYiZhs };Ce]ʎ]n>BQLVfp_G=ت|9aMPo-Η% hx_^\r 駟1,^uq]N󫎗E/($ ;}cGB7(s5׾N:xdwI ,'qi rx(.W7.YH2qԀF/.=t,>r+8/6:gyEE0u?|:^rr}PTTd(T/WCvjN'pv~Yuﮦ+SV+nG~d&0;oTO|)i\S.5y=^;0_!#e Ju_1 {IcAO4'4 )9v,Q4^Y6KFm>,>NG|&-@$kliEZGܻ=\]d%HYw-|H5`\k|qJ#7wI.WMP+V6FrXARM&/~_I>Sƹ_hf (_1Bmz#M񙭷i!DMum]$2!XYs#@G"2TD9OAr {[7 uzaS r}$gǏq1~eϑeDsG܆qnfؓ4=N̓1ʪչR6-w"{JHTްhwor7OB <I2-,"{bE$9e^o^ pYYQ_;|9$-@$kli^Dz5QlYjngPSl=,dCv?jlR}x7Uȹ0UrjsS0r@m"оЍxHJKmosbI]5v݀Pv.i}D]ٓl9Ԭ翔 ^{o L*|0ӡG) Y)zp[I*hcakUboT +;dasd!4S[6&H첝y^h`d/x,l±s@:@'12C@|L7D s&~uKll?o?N/~;m$͡zA/y+ !KPK9)Vtu re$0- Efk /W| (""zt@3ET)I?,\Q; J/y߆ifn S"ґh;'&l{8ll72PR5Ѝ$bXݍ$*><1~gƌPNgٗH_I  { K2w0᭲bH/IU?[&&LӲtt9Ϭh:^%kn^/~<+~z=or$I6$`ɕ' nN%R{@k781(W K- 9hzFRyf?@)khS0V`Y<"dNg+P}9?辉l<5댓X9qugl#Ba'Sq/8?}pyZKlw2prȎ'+ `{ ih gd0Mo횔`հac$~\xA,iHHt΋,2FXǘ_8;HqP` 4'!)LyvYF'  R24=Cu++E[隨y* Ā(0߮|edױGZfƄD-ϖhu՛iM:|Ȑ!V13iI$X$`{M#ayr vGP*Z@Fe_\ƨR0Q6Kic {iӧ%I*P}gαث3vQG]@>cp>]}zeLΆs~>+=Q"yBGcU0aaͧOo%EN$MsRxX;m'7Hn}2km3]KgP[}ݖ{&A2_KVHAl3W`^a)vG ʦvcomWO.8H5E@&ɔ4dl#q8P2pXefԀ]96smRn'=@3Ny0v6s w/l>l[1 l29q~G+W7C*C5L~5:>fN&DQu2\EoT^HgnɓN1iI$X$`{M#X֪پMT"}V{MU.(VTP jNAFj(0*N$0ʕ;y+5r[8Μs/6vG(F_ $#s1y<0!sF1q.3X,\r^ 4*#̹rK_ʪ0LEAlmI-: MR=6ҥaD:+Y-6P+t+Z(ǒ|Dg.Fe> I"ɀ܀_\8d@0\Ӱxkdiɋ#Ӭud顽EYرlfQ@#>3C-aoon ,4osga+PGe&,M?b9u9rn_$2WnuҒ$H"{"| --?ednǩ+:(6/:ZQ>]SCK=nw(l4?xi;e(-P DL1 ؙrEwXْm4H\L7+Dcc/ B!g0'IΜs@ vd~ {lgT$Dz|]Ui4haIR BM`tGh0oG.k /+KtB& @ :D&ZN]lh鱊εW =5zngY^16p4-{x r޷gY):cĉҼys[8%-@$' =Q[۴'vVX-mcLJ&×/`VtMY*fFayy`S^ v=b/mTr @'h3~F#o96z.+?c,.>OhΉ3?ߏ>~pL=+$&Ӌȡ9(w ˥^sxpAy3iy +@Ji`eTG`Km1>_Q+,^|g1FxCjNwj QAtUnK>X`OxL>;vQJi۴lVskoh[W!d@d#o^۽Y @9v[v#,T`gۋ.V<"=iqeziWc;՟:|.! ,&2FUι23k JêfI ɄIѸv;atY $)ْ5.~A<>/.I:5}}(d;&Mx^%"R2##i]#96!UH-vYAA5 tYF*QP -RuI^ڹ KVbfl1F:%\vzr]J(EąE=@ub=+з5TѤb&G)$qeKMN]gu=Q_4.Vu9'ZH1{Gl6@P=OMgAli;{1ѹ蓊{v["o_Pt-TvjA>iUZi`'Hz/ )8(&qqfe袅?(IXǂLjj_EߔgOu-VfeOP1$q792g վ i׮]W$#R^gtiTej4`tSĹGXg@hXd(K"-K P^ڹ,T_(`<0X@fD[He>&PY[aݶ0 xy%)5)g?)=t(a{<f &Oa IDAT%6{zD6*3 ,r-e/ow9KiatlKDϭO~8s}u}$ KZ}i53>lC8 LkK&P{qr>~KT.X ? \ϛ&# %iJ;/Rm\_B:i7/$sѰ:%IԃEq/VyC5밶\|ҥKr%}'H"E ۥ5PNv.JDr0zji!X 5рO%ړ`|c~$HEk`pu$U9w{~:g{!l=7m̰c\nB 9!A 2'ZdwX0wz~I<' 9?QcꉛA?on(Cs>`IZxUi=mQ1ҨfTG>`pupAkK/"GdPݡ4 d[qe0`4(^ ݥ"<=0(ɥ7K- ]Ne{q A[UӘ-T8 й}Q2FòY#ϙ}V |s]睫- l֣ӯ%N*+tXY/ ,r|?Nzc!e-]V+7ސ?<#9lH~a*߇RQmH)þ:S D# /p::aC;8v9sBRBsυ%۝=s%&f'`s#c\)2^~nz7?oeS#>fBqxgf/TʉuI1%X|:ٴC2=t!07 FJ0:~3@ZK"4"MhIWF~hZVlc D-l$Z2`IO$6mi҆QF{1kɜQݒ"="GE{}auiѤI+2g+XwHIDe&t.o4۳MK_+u~ ol;q] 0@?xY4և&H"D`@7˹@5#=Xv7tۑH;:U'skOoKY =5elcɋl33KpP<q@( =9|t-9DA1)zw=a]¹,DB9 )m&X)#uA6IK;KΌCyO4_f/H?|2m4wEmwǚ~ڼǽʃ]hGO^%%nvG2塟5EKHrUS@a!Jĝ7MF7t,#_ ,ģ8H:ih]<Cޓ 9#FHb &P;> 0'J"E @&SI GdJs7!($ϳ_=.К]p޽{u]'EEE$IH~)M|irxj|*LGɃhy5D\yd'NHRJa%L7]s ̱3G0H2eW]d{s q }eWOO=;ċ1!k?bI#ٶ0$cp2>Ql7N>l[CۦS[-w)TO2lF`4NfTŠ4(Z9mw CM6@דС~]6}KjeCa } uPNBQB,3,ӄD?26'ei˴:K5ꏍ}Xy(&!з$I<8x!vaJ'(ȇ7ѱ(#ZW_,<篫S$&H"G ۥ𞡲MrVf**( A'0x[2qXe4.p=7wPV&$\IKFb=8`OqQ hQ!?7f}#V-Jr=;dLn;dG@(}%Yfژuv] -?]^p}A ~͟?*ᅍx:u^n >?:\*[:84I~ԓAe|{r`: ή%$.0@2K\Tu,[r/aamѬ}`$#pykt싇5e3/WH@=Ih/*(:cB/,fSq} V+^ŭK|ض` WED!jG/>c?\&M$;&H"D @K@RE4[@&P{0$&՘鐽v+@XrJӬwK2elu@߰5B:4<(PL#Ps&*Q0F=%O3Eb/α>Nwg; fc[vYJ%_~*IORS(lȖ~2|Ͻ;Өk{~Ox˸+tCB x Ŕt"R:0(j!D>"q==~l|6ۄ<:ƨ?I> <-TԬYS*V(2rH:n: oՈ(Ez!J麙>CW'yTq^!F./QݜP4h 2/&"+eRzZM;kX.\OJHzgNOT}7]H#!ƁH<`b!xgmx17ѲYYa mj5sIvkB,:J`!˅t*EQRDNiܺQ7'/OTZ5)=zDNoHIIy攍HrBb;'\tϢoC:g`WvSTwhe2f4!ԕȄWh#7f'G4fٕ7G7^gWѸڜBߜs׌DPzs >%T҂iIv'Mٰ`?|g ,]{ ."!&氓޻~<򕜸tPsoIVmC 2T=0BBla&*mHg4x8D J/Xcyus%l> ! mArbpj#Di\FyMP붕gQ} os֤ 3o$mY[2 Ϯ:Q6Zff.)_NÂ.[<>ȭ/޽{y2sLׯ[d$@!@az1E˝amX)sWOVJQpZ! {Y3*Nꏼտ^Cl!e!BIS O7 Qs Ƅ6BGij.Cl$ uTy,bq~}g!)ywk2k!KQrTDDIAB{jJy؛%Z0tСC3ٶqF3fα]L:`իwy~xY׸ON]:>8'UopP-)XU%u(BBnB2 dJgΑm QFy_d"A;*%`Nk#sGbSWc(T1^} SQ!gKwYzL)[ /0lҙST>xGقppQ[ELFXZQƾ%6**[ <жty(󝢅b!!Q,1 96h*nrTc"(ɫ!wU(e2>pOڵkf#  57s\V,Qщ/6aBsf2]_|B@TM{v߶eۮ3)J(2c 4_C <Ɔ@(#sm~[xa7J0#`AHA~jLCخM$=Dm6EKV>URp-!龮!ƍ꿳Om{?_x? hnϢ}s?x[|{GC~82ֶ6e{_ngܸ'ӺLVgaGBW.7a~n+ȷ~+׿dرi &m =L.H5FUۺϘrk'à~*RL]fr,'$&mk>WHMRJl,TF OKbbO JUJƍeذa_HJ)+mkvu4n^rT; 8ŶHr $r-E 9bRR s&$$HѢEeݺuҲeto_UBCC],o/tÞOlw+w^)Q@yvVh7 GH4w`@a؃Jʕʕ+g|ApIDATeK7BIf̘!:t#K.|a .&:u5 \)IH:̙3$iF?LI)?Xz-ǎ\fΜ & ضHC :!JQIԩI[ tNf͚_)ΝţHz5P &@Ϗ֓ {OF^'3 pmD$@V%N*תKL_[.`QFɇ~گZJ4i6@ kضjHHU͕5:K 8{L ~SoBG'իWŋl$@$n&H,C3=uHr֏տ()nK2f˼s\ gFI<W)[ \g<+wbw=纉r0m۴F^ sGr 8ŶSqr0 _"}aK[أRxUX>_A{BۻwHRǏמm6 ۞h W_}%o={Vʗ/,QF+Vtشi>8mڴ{ڵ@Ν;uH7=o  Wv%]M$`yb~#֋))):.]$*UeyKB?GER0t?QK 2;vLͫuAXϘ1C XQ<2`y`# O#@iO x rDatɕ+Wxw-\;V%,,LoݺU̙%K'N-#f;iҤ~_'k{Ǵw'G qp[RP)h?aɒ%ꫯӧP~Wg="+WիW˞={$11Qc#W / jպix Ŷ;is. KHMKVH/sl10iݺb?[vޭe:ut\ m۶.\(k֬hӢo՗>e s#⟧JK?͛7 DǵG2ݧN!.( x+mo}rH ĥJyR` m͛߃eرCw.mڴÇ;4fBB 8Ph ka.dXlCݨb$95Itx,x+-5kԞdl$@$`UV}\ GgEZ!gt 6LkGE;f}!Yh8B/ׯKHH9rD "$@$ (=) /&&Б?Zy!A"8)q@5klذA/_#6FYl#N|9ϸ)^yo(Mu[h]L"+VF y "\ϩI|U w<[WbiVq-/#gΜ7l$@$`EV|\ [ 9H)[Ip@rƆQҦfW *7M$@$(1H O$Iu@!wOPm2xΰ).)FSC-u7tƐH,Mbҏ#p%S+'2Xɛ ]ɛc 7ƧFI<Rj04HH@@$@@bq L dIP%m@ oU @ZZ\>'4E^ f!GʜMGI" pmp,$@$vdL,=vW%]*7a&X3I$@BbV^ & pۛ>"*,:IO?{.H%@()# ,gŽrOR6Rdߟ;^ʳor$@$p(o 'YɩI&9yLK;ciHu~c l*c-8 gvIC$sSTCnwtvݲȗҷ3R@q{\0 ,%$@$ReղNy>J& #@}s؛H%WJ-p,|>WHAb9 HH;f}t8SmYCHNb9! }a9|~[\Sy%8q1RHYp]fmmKbr/TJh5R"eƆZN^OVYUj3^ƃl$@$@7Ob p48BIp5&唀ؠEq)sF  ضRHOwB "eʔ/jq ڣG1ciF yILL_{x ۴rJ-!P>re)]?^|AΝ;/ !sZp?ZN2E_W6Aha DK jԨ-VԩSGܶm[56TRo'|7hǏ~ZXmIHK Pl{郣$@!AܫW/цhz)TXQk׮io)]td \rڃܢE QBx!٣I&jquڵ}֬Yұcǿ9Gl6"wҾ}֮]al$@$@|HH!#l#kXF^l6C#QFi o…_InÃe}pa(@6mh:J͚5bBS b }ΰAZK^Ha߰a,_/B#(BÆ u9JD?Ĵc<6  m$@$HC" !'6mvH {]V/8؉ F8+$ \!C˕1)0&5lÝ r{?s G X⸑yscdذai& #@u Icv39Gq紜HŶ?B.HHHN3ZIENDB`finit-4.14/doc/img/logo.png0000644000175100001660000001344215054341541011232 PNG  IHDRRsBIT|dIDATxl\Uǿf+qǛql׬UR+jZ j *Z +(J !(@ j vUĖRIL~ql$? ߳3ΜyqV}osLw=qUov>@RC‡IHHX9AdlzEhIHHx3w7 4vB6خeO'l%NPz(hU27 S8}BB5 Q27􂒭B`@)P.Ba H>!:+Y"'$mWNjc/9OHPgg#k2   .@J 'lH>!A{h"pYgOHX2 x6˩Thւ섚oɠ'qE:ӡf0q5nՊc6*ٺG XI[8}B"nf蜃9%[=9?AcFgi9F 09v qm{-ٺ[:~ܔB{ݦ4lզDhQ2 bOETKs@N?ֳ?A@/xmL=:ũ|ǧdR}ItcAP1 Q(lqcϓX(Otf?{D(|75ӟy=|O6L`)cd ߥ1(8~@Vcɞ\qo {Ƙ (li)>29 MSYF[S֤`m oP8Xyތ0ĕgoP Qg r4AkBmu_l&IWAp<|d4^*NOw>Ilӷ58%MA>$ C-Āk ‡=nsvLyL :EdM;Ww}sNglҶ0#Qם[_;;z6Y}cq_:Cv*@g9e kj ٣4&>C̪N=qH i{"8u :j A@5,f1ǙG^]SEX> ¡v+@~ewsMͅf\&p6r5nK|X{!Ei|dT@^,T$@r_8:o/ti!8GRUAdSٛjܔg;F lA3(zҾJ%30/Z3,% *-D 2Pbw4J+Cjyߌ"?q>ʗP)c>ֲ):N/ȥ|,5YLw|Yec@:"^ر( ߒK{C@e+ /w|F?/gG+,DJY9"BquKy7SgqN}V(_D? nz5ip@HQ ≈Zۤ(40G_]TZ+B|x/.&@mlU@gv= : 崎hVξ]Eo "*͇/3 m=S٭Zk &dk՜d\@ma,ߥoY#drb*zdbqJ-'BZ{]k ;Qy0ƏRͥb"*RPK失rM G J&{!G=fXSɪNɷ,IU:Y@+zvbWd}ZmB߅V!`tc\Rc RVPr!'Ll?Vi&.(8)zR$}[ZD-i!b+qJoMUjTS!Ocs:]PGvl֣V@ ŹZDYCz\G\PԊL"&Hw؎|q]hYqNF]f=\։n\zޭFXUɀߥZ3 V-{M5e2m6bOsN vYU8-&ۤJMˤ)㬟>ar h;!gL!ys$9FAON.N꺒e)2ԟ twH )62IÊCO-TjK!ެB}P |;&?ޮS- 6댁9Ht=1V/"Ć&e:=1Ћ܏eGnkZK4m=.%s308ȉ؂x-:PhГ^zq1Zu 鄞6c䑦H@+nSde9=U hFZ`XC@OJFMѫj)s5)5 ^ZZ%9ӘPszűʍ;~ bԃt٭BFF _ui,-~+μkhmGoL S}xF0v ($ 8wq0T]RJɢ,C9%[{CֳT 1)Z/1I3.~<e9=UUyB T @4Fi\ݡUj9KYLP2wddR y;^yPo~^LDjheͼ1J$ 't:KPRQujcbuz6` ֱ51FgAaʼn-=}k;Q0nPZng7B5~5YS|809ș-P:2[kpbL ^h*|a+o⍫%/]T~Lh3g4P4 "[Lecd<cPKYl}IpA@0⑖^ݍ}? l EﻈU`7ꌨU=,6A3UTew Rf<˻re* kEK m$RQPm^kUWypH3_C`-6{)n RQx^usmPT\Ɖ5"lS2wE VA.h5\&nR.Ē~{)w3S8Ciz!"](6?M`@o 4DWf^耫֧ ]+0[E/X8 T$eszW*z4!Of7}frV|͚Rbl7Xqǻ\=7ki -0/%aV<%eus>b?,9h%:zC?ɸ4U)0HA^CI [QcDTt4!p:|1s 9}dD{#jҾ8[5QBh%t{*YUUSs WCN_ꇨ\7',oPKP+WpiT˱%qk \,Zx%MۦR{>>W8 bG\(kr|`SZLfӓlX^;Q pejUUK`CNO9*|^%.J")ٲ#!AI=u{R6|ƆNQT8wڳdZžjjndU/ = {Μ)D&E3Ĺ|'&( 0.L^o}!M蕊N%[GRJ])Y\6{APVUr5X"2cJ3+ItX'UH#o@ְEr=CX#ݫ^oWH|˪~אme69٬*89ZZS ʺnLy޾a;-bыlV.ZGR80|`9 "*)^-P*OϋT6TlHv` ԩ%v=_,DwW ~i=B-e-D=z>J[8fK> !7 ZjEFxLdRkx#+M rZƉw_ +xZu4xM*4E=:j ?~8jn5ra3[ C!qx}- ?;֨}|, ).LZ~vym?\CSr՞}K-J4oƥn9>쟴t{/:^ɪ |>?7J~+ H̾3M#H; j6CisyٗԶz_l;[_9JR&eݷX^9ϥҞ_s V}Z2dZB!Hb \Ls~Ffzo~ee-k쮮UFUX_X.zcZi[I Ӄb7ןkM?\~hIr; iеNcJò Q~lKymWWT[:e4M}o6xv33rj[ٲ7Z6P=Ud"8Э!8|fQ>cY,_=Xʫq=㧬NQ~IT rTR]>n]I4oaZ3]W(&or}4מZ( ^/k|IUNK3~D_) R6py,g!]׏|iͤcIHiKO--}Z,^=|!GԚsE~g>9㛛Hghi9ɵrPh }s[JNMuuRn ^lQS~n'K(r78u-R6RuDjR{o5 Hj[V048%0J9ǤiJ\R448z/x?(e9;/ =/]gtej ђ 0Z,[im [z#Wiy., nb7ڛV~_>aYY˧d7-,+h}^{V-04Rceݿ|Z[I Ӄc'ԯmI?\~䶭&-XH뗌sm׺wZ U:?}}Gs\G_%S_M\S:ºWJ?w{Fxv3;E)wGuVݚ rV3ZI.#j#g]av4:{us2WqEx}`ɿ{uҹY/`xv3Wwp}\nݭ -Gt. hG<G ٻ?bJ|l]VNW<-ߒGݥuKc2#,y*-Vv*OMS11}BWqEx}`)|RJ'Rߊ4iJK4z?\Lw[FKj}K>-צ9>o%ۯ]VLrV⤿^&-o -hrZrvMZY[?WVagkߢduθV~GmmR]MmmjgpzV%2cX׍ֲ<\ys==Xѵm.BCyBA=BIii. )@̲u5;;Ke46HU] Ke9/e͓iK)k)/.=PnxѕZlc,ʓ_;ek/)p08Ysc+ bsg K4-7E?K9Ho.IھԞ'JeeCr=ޏZJ+MEMMwIS|\J'_WLVViH'2w~Zm3hɹ&]5eq_ܬ{j;n Sοw/7CViK#K.Ƿ:Vyڝ'L5X?e%s4}gnwF/4 4oKU2F"{+0Nɘ;FOZ^S8ZV7lxff1Oܲ[m'4-G(aCp[ CpL΍{RzvjՎt&8 ?o+}OTXɭ^<{5noxpԺEIT530R3٧sOR-mW~IbiH˴ K~ږu˩׮[&Ͱ^}h!֮X~I J NbI5m˚^ɸ@`hJ$k~,(ٿp5o:=s,?(qn5 >_Nf YpI [.ַ Vέ}/Ha~Z Ȗg_Z%W'=M[XŬ4q?&GĽq`m1[6g5ȟP/VƚakNf~15y5GI@mej׷qGpGV~f#NQ9XKp;-ʰwe*x]N5qlhxeGgIdT)8[%\-o2u<R o9=⿂.OcY!3ݪ[Mor47\jJv}zHXҳy|ޭvI emIk^gܝێf۩3r!OS%5E#h9M]v̆C!{G=J).&2rkמ_vjJss8 ?oŔu+TfZ7n~6 ̰ -3H} }s[$Ef~_M@:~l73Wۿۏ93Pϻ՘R~b XkK+ZxFLmˈ}%8ؾ["E`Ejb3x#8Э!8|fQ~ˣܽʥ``ؤiycVgNC8 ?ošuKWG*-Un3zVC,7"tuhwR!k^SZfgN[,ӬKenӖly[*}H-H/u?{z}*섟cj|Jҗ*_.s{= m?vJ0m;L3X-Ij-O{˵cr5[πl!^<*vЭ8h tPSg,nˣ61׫C@Vo<ց7+J uf*KPI',)`om X h?`} ht {VI7FbȈN[/wv:~o_? n: dlynũA'rkWnhoyZ̺\" ,i>d\xfFXy8z[mqxF'taFhڴ[_Z=xVx>Q~g~Ob(ilOKYgx yȾZ( ^/kN!Rs~"j'VIs!m^<n\oxpԺEI"5>ՂNjvck4R]Vܩcti_mc{]ZCiMVs^b;gᘤ4RůI7U2(z$mrCX(z&l/|y} un5֎f)uLV-KPI' { T; IDAT~ V źr4/mcESZf]0|TW[/#&PQ>ע|ٟ72<7RܠpˠhMWF3 iv[R1-]nvnfy}X pcѭ8X|~h9@m(_#j#g]o9p'x*ڗVQ OrÓf$7n%3%wkʷ\.7YpI Qs>NsvKӯͿ副ҧrǥt@wickokXߨդR}zW=:TOWmr4ewfCp[ Cp!8x<G#Cp!8x<G#Cpy>9~?>Xכ\-ʯ-mi\YS*}ZVc7駶j^qnMWq~7٭jdEv H疇MnJ5@ S4)_X~ߩz5[-Vv H[?+Y?_'"rO4tccq+?~yZV%7e!la8~!q%iZw}jhf/[)3g/?FtIOSGUsdd\s=bͮE]2~vf {Ǟ>͔ iH'O4UMiחʥ _xxZMts8s3%f.I ׽eڱmYof!'.4w}fW8>B9IJbLY,imKז^l)\(E`^›GTg;qlcrn[:~WZ?ւC{7/\g73lk@]o>w2}KZ-+=t~~ǖ;NYM:{]w< x>wIP}e ,i䶓}t6oR$"_:-|[/\i-˭g. #ųvti5`ERnԣXXm"gwXx<G#Cp!8x<G#Cp!8x~_|>-ؙF5Z_+opR~S\=WKvn9javvoy`?} Xn =uZY?j2 bjF-vw8_jY{sM+S*Y/?"]D[fBF@TlQVc+Jjo0]w+|dp#V~9~MƿX͒*{ӌ/yw3ӯjǓw ]κrʿ\yѭs\Q7n3_ޢnE(aj׋ϩAnmw/c;i>fI?*6\IrH'ܣ5 )-cۣO;I^jni+h1]MQ{2uT>/<̫tJҟ/Q{k҈}'Ԧ+J? x>x1Cp!8| 3Zw?wc>-GJ.|bXI˥GV8cFq|[/2?z3U3?O?-t6Y>\~X8^9(Վ9Qfm+G*m fƊ~5L?lj,Zy]ߗ,Kf֬=zU(%.%I+UO:[~nk̒]zYgKjꆚk^ wrGOKjEV%=c'-ӱ+??O=ϛ\`_².*V݊/î(W[Y[_s0 ޤ彝70·_›b$]_%V\Kmnr^vkA7;,Gʢ\֢,K-kTukh[g(wpeW18*+ /d~yvLoKۍ]snj Tzu8RSelynďB? .5rBSZ}2_?՝RVL=$aAs?!-ZP4륶1KjeŲ\_T3tA5lH-O~>6k'K,رnrk-UwtfXzzO+ s>i~/.r7oREZ;<h=֡X/)0ka9_Q~,U.0 %c F\ڥf}o5W-Q?[7֫H_YP{2:f( yXUxo]RQx-Oԍ ^Zz]ko-^f͕&owswsx%bp_y;kkg J˵+-^LA~+eٯ2]nYgT)dzwF 0T)MRb*??\V/5enz竷ι[HScZV|t5Mq1q 87R)KЦ'G Mr۷_b@$A{~ҷ{wb՜ԁ%_vRf%Q<~\^/^\`^{Wh;otsioߪ~v#ElePGVl+aFk#ovsy5ͼ?4y׌SQGA@_4$IeUܹT:פnYi7Y-9&VJn1+;w\dzS94sO;h֯%=!ϒikFk˷o)aRlٚ>(Z;4v5燥o֏Axb Pj]nrtUw Z}p[ Cp3CWvn!|63?iv带2LǡWFi͓njy*{muh $qU`?U; \&6:ĂGivTu4V eki}mff(*yZ lt KP0X͟G57;e}KRa)ˇ5-p\s ˫W峱Kv~u`ɣ~3s_40 ?Jv(v؇jXviK-Fn\;oqPW;gYz訃h6+Jވ1y%]ii\)Ob#`b5h==8:Gb(՟_+׹)0{kjkrOC}Z#])A ʶftɀ\>J+5IҠmi+Ֆv{/0Vz"^_?`5[ɝR ^s-A|i[mSKRԥZ_Zі_QӖ(:ܺ_VrHhnK{_G?;ѓf8"?_Z~iǀ7KvIj1p;ae.;?p! ´-˻&=;gz -up,7+f/>yHeUܹTxݹ~Hoikc#`b5 G>AQsn ݎIkZ8soMSuu9?F0m?RG./ k=-C5z5I}Q~Jzmޱ~ɟvvE$ϥY.up0ai4ZHpUw 8F '#j#ϟ5X,RoE׬WOe1$I!-[f\8ԖGޯ_fqu֫ 4黎}7P'jw4{=Ѥp^+ѝ:n36C9 q/pY^ke&WWS#ɕfzv9J/J~w;+s8Cev-v9furO<̳m`YS~MTf-ZZ?4ZY_Awv]k:tQ6e^i=vg"nm^\$h< 9[ٖsrҌ7&)豬O,0k.rQӖi/+QKiοsWriWr~~p1;޸ l}\1W[Z/ ;u#ׯݿQ壑 ȹյr(+;hK՞;FX3lsRY(˒a(\f?P 925ޭcFՁɕۧFʖx#8w\P2XL{GocR,9NHAyu[!S3@W[A30:̻TYMOڏ-t&i?+t3ՖKM_Saپf1-}~cq^Ɩj5pֲR@r-Zo9ZKy=/עQn5 ٚG}G!GJ~uf.R{ߟr}iÖҸBGK?Ӹ~Տ. '~RN*:OTiy+R{?SЫL?I 0]_B1%9b~_ֻp`ڕH_\Xm\˝?kCj&5{M~W>b~Uv0Ref9W.Q2۵~Y^64,OɻRexgnM"y_}7v_F??WXkISL/mk'o0kp(u}icĘIݒ#i흟IH_]/Spy1%ݪZj1MͿ7[Եr(?DqXO*eYҕ~iU[ukˏ f_^,_K^9)8?)<-qqE2 QQ߈G?)P'j'{m_c!8J S2)ZϫꗙHWS#ǹ.GBj&6vݥٻS ǹ_e=Ӕ ,54Ѯr5[f5K֗fIɻRexgg_4/r6Xڽ66U|~ZVh K z,K/8ѭ!8![O(~_Pc׶ybBZ?cRWh(gW/OOp$= vRyJ[뉦Q9>I 0B1%9b~4/POʟ)?4w:bNw5ڐ u޵<Fm:)?*juY6| Xeki\4mn}iߝk-Uw~O,b˝7ߗ~ciSc+'yQj*'4e~ɔҶbVk'<~ߚ}}[ZcM_S"?myz֒UF/\_;?Uw=f 4f]gZ~g uI.?I-F7pY|ҢVҢGP-upTs'UrʺR[7\ 9_[Gז̦N /=J:3r\Sq~RHy [J y%FQcy)]8Hz'*3&]PZls8L*PLd&5OIz:~[i^b+ߤ׆L$x7& (/~UvTڧlfFC[~̀jEɻָ=znozi}< ;¦T%.ou^bڍ-ӱ睏U.0J]_1jq>_:+='G?K\>zQo;ckRtb$]_Bl7rTmY ܺRFWݘ΀(r}2.Wz^Ǻ<G?3dǞL/=.?z{6f6fqMr w蘿kgdΥqqevW yv 4ITờVXGv`Wu%L |GqJ S:V yv\݄~WX]ϥ'6D[f4@ǹ_etźA4݂ݗ=y5˧*~?L|{9DXkJ޵*;*C6R4-}]z@?|b/o~rMe<X֏(ZTnD{}j]C.M`6|'C_/jQ?f̑ʇ&(_DeP%Rb,n׭Cp3Ck_qQ ވ n'uz>{ߟҲ}ɹ4P:.'7GѬWs yZGwHbi%R4O{x'ڟu%w꼉͐}NyiB1/rMs!@+?εUH \]kCJZPy?OzѤmFW]lf2W0~nonrkr}z[6R4-ٽKR>oe i<\N%RcY?V~0kӛG.0 Mڕ_oYCԪEfFLn-[r(GB섏iOUp0@T–Z1GS^>fY]oƚOwsO"GT.-+wq*v(˒4??>(}b]%(])m]>6ޮJu 18QPaw_K;1*ջL(<38soSElm1'4O4X&,jPp)hijMOڏ55m?5%z%9?KO~mfv~,?C 7^
STOPPING
HALTED
WAITING
PAUSED
RUNNING
TEARDOWN
SETUP
post:script runs first if both exist
~C
-C
+C
-E
+C and pre:script
-E or -C
+C
new run/task/sysv/service
+E
E - Enabled
C - Condition(s)
P - PID file ready
R - Readiness
pre: - pre-script
post: - post-script
DONE
run/task
STARTING
pre:script done
initctl reload

SIGSTOP while figuring out if process should be in this .conf generation
initctl reload

Enabled and READY but waiting for a condition, e.g. another process.
ready:script
+R
 or +P
When service signals 'ready' we call the ready script and then emit the <svc> condtion to trigger other run/task/services
NULL conditions are also conditions ...
cleanup:script
Wait here until the PID has been reaped
CLEANUP
removed
scripts done
* manual + (re)start
* runlevel change
* removed
only if removed
finit-4.14/doc/initctl.md0000644000175100001660000001512415054341541010777 Commands & Status ================= Finit also implements a modern API to query status, and start/stop services, called `initctl`. Unlike `telinit` the `initctl` tool does not return until the given command has fully completed. ``` Usage: initctl [OPTIONS] [COMMAND] Options: -b, --batch Batch mode, no screen size probing -c, --create Create missing paths (and files) as needed -f, --force Ignore missing files and arguments, never prompt -h, --help This help text -j, --json JSON output in 'status' and 'cond' commands -1, --once Only one lap in commands like 'top' -p, --plain Use plain table headings, no ctrl chars -q, --quiet Silent, only return status of command -t, --no-heading Skip table headings -v, --verbose Verbose output -V, --version Show program version Commands: debug Toggle Finit (daemon) debug help This help text version Show program version ls | list List all .conf in /etc/finit.d create Create .conf in /etc/finit.d/available delete Delete .conf in /etc/finit.d/available show Show .conf in /etc/finit.d/available edit Edit .conf in /etc/finit.d/available touch Change .conf in /etc/finit.d/available enable Enable .conf in /etc/finit.d/available disable Disable .conf in /etc/finit.d/enabled reload Reload *.conf in /etc/finit.d (activate changes) cond set Set (assert) user-defined conditions +usr/COND cond get Get status of user-defined condition, see $? and -v cond clear Clear (deassert) user-defined conditions -usr/COND cond status Show condition status, default cond command cond dump [TYPE] Dump all, or a type of, conditions and their status log [NAME] Show ten last Finit, or NAME, messages from syslog start [:ID] Start service by name, with optional ID stop [:ID] Stop/Pause a running service by name reload [:ID] Reload service as if .conf changed (SIGHUP or restart) This allows restart of run/tasks that have already run Note: Finit .conf file(s) are *not* reloaded! restart [:ID] Restart (stop/start) service by name kill [:ID] Send signal S to service by name, with optional ID ident [NAME] Show matching identities for NAME, or all status [:ID] Show service status, by name status Show status of services, default command cgroup List cgroup config overview ps List processes based on cgroups top Show top-like listing based on cgroups plugins List installed plugins runlevel [0-9] Show or set runlevel: 0 halt, 6 reboot reboot Reboot system halt Halt system poweroff Halt and power off system suspend Suspend system utmp show Raw dump of UTMP/WTMP db ``` For services *not* supporting `SIGHUP` the `` notation in the .conf file must be used to tell Finit to stop and start it on `reload` and `runlevel` changes. If `<>` holds more [conditions](conditions.md), these will also affect how a service is maintained. > [!NOTE] > Even though it is possible to start services not belonging in the > current runlevel these services will not be respawned automatically by > Finit if they exit (crash). Hence, if the runlevel is 2, the below > Dropbear SSH service will not be restarted if it is killed or exits. The `status` command is the default, it displays a quick overview of all monitored run/task/services. Here we call `initctl -p`, suitable for scripting and documentation: ``` alpine:~# initctl -p PID IDENT STATUS RUNLEVELS DESCRIPTION ====================================================================== 1506 acpid running [---2345----] ACPI daemon 1509 crond running [---2345----] Cron daemon 1489 dropbear running [---2345----] Dropbear SSH daemon 1511 klogd running [S-12345----] Kernel log daemon 1512 ntpd running [---2345----] NTP daemon 1473 syslogd running [S-12345----] Syslog daemon alpine:~# initctl -pv PID IDENT STATUS RUNLEVELS COMMAND ====================================================================== 1506 acpid running [---2345----] acpid -f 1509 crond running [---2345----] crond -f -S $CRON_OPTS 1489 dropbear running [---2345----] dropbear -R -F $DROPBEAR_OPTS 1511 klogd running [S-12345----] klogd -n $KLOGD_OPTS 1512 ntpd running [---2345----] ntpd -n $NTPD_OPTS 1473 syslogd running [S-12345----] syslogd -n ``` The environment variables to each of the services above are read from, in the case of Alpine Linux, `/etc/conf.d/`. Other distributions may have other directories, e.g., Debian use `/etc/default/`. The `status` command takes an optional `NAME:ID` argument. Here we check the status of `dropbear`, which only has one instance in this system: ``` alpine:~# initctl -p status dropbear Status : running Identity : dropbear Description : Dropbear SSH daemon Origin : /etc/finit.d/enabled/dropbear.conf Environment : -/etc/conf.d/dropbear Condition(s): Command : dropbear -R -F $DROPBEAR_OPTS PID file : !/run/dropbear.pid PID : 1485 User : root Group : root Uptime : 2 hour 46 min 56 sec Runlevels : [---2345----] Memory : 1.2M CGroup : /system/dropbear cpu 0 [100, max] mem [--.--, max] |- 1485 dropbear -R -F |- 2634 dropbear -R -F |- 2635 ash `- 2652 initctl -p status dropbear Apr 8 12:19:49 alpine authpriv.info dropbear[1485]: Not backgrounding Apr 8 12:37:45 alpine authpriv.info dropbear[2300]: Child connection from 192.168.121.1:47834 Apr 8 12:37:46 alpine authpriv.notice dropbear[2300]: Password auth succeeded for 'root' from 192.168.121.1:47834 Apr 8 12:37:46 alpine authpriv.info dropbear[2300]: Exit (root) from <192.168.121.1:47834>: Disconnect received Apr 8 15:02:11 alpine authpriv.info dropbear[2634]: Child connection from 192.168.121.1:48576 Apr 8 15:02:12 alpine authpriv.notice dropbear[2634]: Password auth succeeded for 'root' from 192.168.121.1:48576 ``` finit-4.14/doc/conditions.md0000644000175100001660000002570615054341541011511 Conditions ========== Conditions were added to Finit in v3 with the intention of providing a mechanism for common synchronization problems. For example: - *"wait for service A to start before starting service B"*, or - *"wait for basic network access to be available"* Conditions are similar in syntax to declaring runlevels per service. They are specified within angle brackets `<>` and can be applied to any of the `service`, `task`, or `run` stanza. Multiple conditions may be specified separated by comma. Multiple conditions are logically AND'ed during evaluation, i.e. all conditions must be satisfied in order for a service to run. A special syntax, using a leading `!` in run/task/service conditions, denote if a: - service does not support `SIGHUP` - run/task should not block runlevel changes (i.e., bootstrap) Finit guarantees by default that all run/tasks run (at least) once per runlevel. For most tasks this is a good default, for example checking SSH host keys or loading keymap. However, for conditions that are unlikely to happen it is not. (See example below.) ### Example service [2345] /sbin/netd -- Network monitor In this example the Network monitor daemon `netd` is not started until both the `pid/setupd` *and* `pid/zebra` conditions are satisfied. A `pid/` condition is satisfied by the corresponding service's PID file being created, i.e., the service's default readiness notification. > [!IMPORTANT] > Conditions also stop services when a condition is no longer asserted. > I.e., if the `zebra` process above stops or restarts, `netd` will also > stop or restart. Another example is `dropbear`, it does not support `SIGHUP`, but we can also see optional sourcing of arguments from an environment file: service [2345789] env:-/etc/default/dropbear dropbear -F -R $DROPBEAR_ARGS -- Dropbear SSH daemon Finally, the weird "block runlevel changes" example. Here we see what happens when Finit receives `SIGPWR`, sent from a power daemon like [powstatd(8)][]. A condition is asserted and a user can set up their own task to act on it. We do not want this task to block Finit from moving to the next runlevel after bootstrap, so we set ``: task [S0123456789] name:pwrfail initctl poweroff -- Power failure, shutting down Triggering ---------- Conditions are mainly triggered (asserted) by built-in plugins, e.g., - `netlink.so`: provides `` - `pidfile.so`: provides `` - Cmdline `finit.cond=arg`: provides `` See below for built-in conditions. Finit also supports user-defined conditions, sometimes referred to as static or one-shot conditions. They live in the `` namespace and are constrained to a flat hierarchy without any sub-directories, unlike the pidfile plugin, for instance. User-defined conditions are controlled using the `initctl cond set` and `initctl cond clear` commands: initctl cond set foo initctl cond clear foo The purpose of user-defined conditions is to be able to start or stop services, or run/task jobs, on external site-dependent stimuli. **Example:** service [2345] alarm --arg foo -- Foo alarm For convenience, prefixing with `usr/` is allowed, but any other slashes or period characters are disallowed. E.g., to trigger the `Foo alarm`, the same as above, can also be achieved like this: initctl cond set usr/foo initctl cond clear usr/foo Conditions retain their current state until the next reconfiguration or runlevel change. At that point all set conditions transition into the `flux` state, meaning the condition's state is unknown. (For more info on this, see [Internals](#internals).) Thus, after a reconfiguration it is up to the "owner" of the condition to convey the new (or possibly unchanged) state of it. Static (one-shot) conditions, like `usr/`, never enter the `flux` state. > [!IMPORTANT] > For `pid/` conditions it is expected that the service reassert, i.e., > "touch" or recreate, their PID file on `SIGHUP`. This can be done by > calling `utimensat()` on the PID file. Provided, of course, that the > service supports reloading on `SIGHUP`, otherwise it will be restarted > by Finit when they instead exit on the signal. For such services, use > `` to tell Finit the service does not support `SIGHUP`. Built-in Conditions ------------------- Finit comes with a set of plugins for conditions: - `devmon` (built-in) - `netlink` - `pidfile` - `sys` - `usr` The `devmon` (built-in) plugin monitors `/dev` and `/dev/dir` for device nodes being created and removed. It is active only when a run, task, or service has declared a `` or `` condition. The `pidfile` plugin (recursively) watches `/run/` (recursively) for PID files created by the monitored services, and sets a corresponding condition in the `pid/` namespace. Similarly, the `netlink` plugin provides basic conditions for when an interface is brought up/down and when a default route (gateway) is set, in the `net/` namespace. The `sys` and `usr` plugins monitor are passive condition monitors where the action is provided by `keventd`, signal handlers, and in the case of `usr`, the end-user via the `initctl` tool. Additionally, the various states of a run/task/sysv/service can also be used as conditions, the image above shows the state names. The syntax for a `service` type process: ``. The other types, in particular run/task/sysv, there are the additional states `success` and `failure`. With the example listed above, finit does not start the `/sbin/netd` daemon until `setupd` and `zebra` has started *and* created their PID files. Which they do when they have completed their initial set up and are ready to receive signals. Finit expects monitored services to touch their PID files, i.e. update the mtime, when they reload their configuration files after a `SIGHUP`. Some services do not support `SIGHUP` and are instead restarted, which is a crude but effective way to have the PID file touched (re-created). Built-in conditions: - `pid/` - `net/route/default` - `net//exist` - `net//up` - `net//running` - `service//` - `{run, task, sysv}//{, success, failure}` - `sys/pwr/ac` - `sys/pwr/fail` - `sys/key/ctrlaltdel` - `usr/foo` - `boot/arg` - `dev/node` and `dev/dir/node` > [!NOTE] > Here, `up` means administratively up, the interface flag `IFF_UP`. > `running` is the `IFF_RUNNING` flag, meaning operatively up. The > difference is that `running` tells if the NIC has link. Composition ----------- The `pid/` conditions are generated by the Finit `pidfile.so` plugin and composed from a service's `name:` and `:id`. By default the basename of the daemon and the empty string. | **service** | **condition** | |----------------------------------------------------|------------------| | /sbin/foo | pid/foo | | /sbin/bar -p /run/baz.pid | pid/bar | | name:lxc :foo lxc-start -n foo -p /run/lxc/foo.pid | pid/lxc:foo | | /usr/bin/dbus-daemon | pid/dbus-daemon | | :222 dropbear -p 222 | pid/dropbear:222 | The condition is asserted when `pidfile.so` receives an inotify event for a file matching `/run/*.pid`, `/run/**/*.pid`, or `/run/**/pid`, which contains the PID of the service Finit has started. When Finit configuration files are changed and the `initctl reload` command is called, it is expected of services to touch their PID files for Finit to reassert their conditions. Daemons that don't create PID files, or fail to touch them on reload, can be worked around by using the `pid:/path/to/file.pid` syntax in the service stanza for the daemon. It is far from optimal since any synchronization of depending services may fail due to the daemon not having reinitialized/created their IPC sockets, or similar. > [!NOTE] > In versions of Finit prior to v4, the PID conditions were called 'svc' > conditions, and they were far more complex. Debugging --------- If a service is not being started as it should, the problem might be that one of its conditions is not in the expected state. Use the command `initctl status` to inspect service status. Services in the `waiting` state are pending a condition. In that situation, running `initctl cond show` reveals which of the conditions that are not satisfied. Listed as `off` below. **Example:** ```shell ~ # initctl cond show PID IDENT STATUS CONDITION (+ ON, ~ FLUX, - OFF) ======================================================================= 1419 /sbin/netd on <+pid/setupd,+pid/zebra> 0 /sbin/udhcpc off <-net/vlan1/exist> ``` Here we can see that `netd` is allowed to run since both its conditions are in the `on` state, as indicated by the `+`-prefix. `udhcpc` however is not allowed to run since `net/vlan1/exist` condition is not satisfied. As indicated by the `-`-prefix. To fake interface `vlan1` suddenly appearing, and test what happens to `udhcpc` we can enable debug mode and assert the condition, like this: ```shell ~ # initctl debug ~ # mkdir -p /var/run/finit/cond/net/vlan1 ~ # cp /var/run/finit/cond /var/run/finit/cond/net/vlan1/exist ``` Then watch the console for the debug messages and then check the output from `initctl cond show` again. The client will likely have failed to start, but at least the condition is now satisfied. There is also the `initctl cond dump` command, which dumps all known conditions, their current status, and their origin. Internals --------- As shown previously, conditions are implemented as simple files in the file system, in the `/var/run/finit/cond/` sub-directory. The files are created, updated, and removed by condition plugins. To debug them, see the previous section. A condition is always in one of three states: * ` on` (+): The condition is asserted. * ` off` (-): The condition is deasserted. * `flux` (~): The conditions state is unknown. All conditions that have not explicitly been set are interpreted as being in the `off` state. ![The service state machine](img/svc-machine.png "The service state machine") When a reconfiguration is requested, Finit transitions all conditions to the `flux` state. As a result, services that depend on a condition are sent `SIGSTOP`. Once the new state of the condition is asserted, the service receives `SIGCONT`. If the condition is no longer satisfied the service will then be stopped, otherwise no further action is taken. This STOP/CONT handling minimizes the number of unnecessary service restarts that would otherwise occur because a depending service was sent `SIGHUP` for example. Therefore, any plugin that supplies Finit with conditions must ensure that their state is updated after each reconfiguration. This can be done by binding to the `HOOK_SVC_RECONF` hook. For an example of how to do this, see `plugins/pidfile.c`. [powstatd(8)]: https://manpages.ubuntu.com/manpages/trusty/en/man8/powstatd.8.html finit-4.14/doc/runparts.md0000644000175100001660000000375215054341541011213 Runparts & `/etc/rc.local` ========================== At the end of the boot, when all bootstrap (`S`) tasks and services have started, but not networking, Finit calls its built-in [run-parts(8)][] command on any configured `runparts ` directory. This happens just before changing to the configured runlevel (default 2). (Networking is enabled just prior to changing from single user mode.) ```shell runparts /etc/rc.d/ ``` Right after the runlevel change when all services have started properly, `/etc/rc.local` is called. No configuration stanza in `/etc/finit.conf` is required for `rc.local`. If it exists and is an executable shell script Finit calls it at the very end of the boot, before calling the `HOOK_SYSTEM_UP`. See more in the [Hook Scripts](plugins.md#hooks) section. ### Limitations It is not possible to call Finit via signals or use `initctl` in any runparts or `/etc/rc.local` script. This because Finit is single threaded and is calling these scripts in a blocking fashion at the end of runlevel S, at which point the event loop has not yet been started. The event loop is the whole thing which Finit is built around, except for runlevel S, which remains a slow procession through a lot of set up, with a few hooks and blocking call outs to external scripts. However, not all `initctl` commands are prohibited. Supported commands: - `initctl cond`: only operate on files in `/run/finit/cond` - `initctl enable/disable`: enabled run/task/service is activated on the runlevel change from S to 2 - `initctl touch/show/create/delete/list`: `create`, provided the non-interactive mode is used, again changes take effect in the runlevel change directly after bootstrap - `initctl -f reboot/poweroff/halt`: provided the `-f` flag is used to force direct kernel commands > [!TIP] > you can set a `usr/` condition in `/etc/rc.local` and have a > service/task in runlevel 2 depend on it to execute. [run-parts(8)]: https://manpages.debian.org/cgi-bin/man.cgi?query=run-parts finit-4.14/doc/Makefile.in0000644000175100001660000005221315054341567011064 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_docs_DATA) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(dist_docs_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS ChangeLog.md README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ SUBDIRS = config EXTRA_DIST = AUTHORS ChangeLog.md docsdir := @docdir@/doc dist_docs_DATA = build.md cmdline.md commands.md conditions.md \ distro.md example.md features.md index.md initctl.md \ keventd.md plugins.md requirements.md runlevels.md runparts.md \ service.md signals.md state-machine.md watchdog.md \ img/logo.png img/svc-machine.png img/svc-machine.svg \ img/alpine-screenshot2.png all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_docsDATA: $(dist_docs_DATA) @$(NORMAL_INSTALL) @list='$(dist_docs_DATA)'; test -n "$(docsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-dist_docsDATA: @$(NORMAL_UNINSTALL) @list='$(dist_docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docsdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_docsDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_docsDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_docsDATA 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-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-dist_docsDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/doc/keventd.md0000644000175100001660000000116415054341541010770 keventd ======= The kernel event daemon bundled with Finit is a simple uevent monitor for `/sys/class/power_supply`. It provides the `sys/pwr/ac` condition, which can be useful to prevent power hungry services like anacron to run when a laptop is only running on battery, for instance. Since keventd is not an integral part of Finit yet it is not enabled by default. Enable it using `./configure --with-keventd`. The bundled `contrib/` build scripts for Debian, Alpine, and Void have this enabled. This daemon is planned to be extended with monitoring of other uevents, patches and ideas are welcome in the issue tracker. finit-4.14/doc/watchdog.md0000644000175100001660000000340715054341541011132 Bundled Watchdog Daemon ======================= When built `--with-watchdog` a separate service is built and installed in `/libexec/finit/watchdogd`. If this exists at runtime, and the WDT device node exists, Finit will start it and treat it as the elected watchdog service to delegate its reboot to. This delegation is to ensure that the system is rebooted by a hardware watchdog timer -- on many embedded systems this is crucial to ensure all circuits on the board are properly reset for the next boot, in effect ensuring the system works the same after both a power-on and reboot event. The delegation is performed at the very last steps of system shutdown, if reboot has been selected and an elected watchdog is known, first a `SIGPWR` is sent to advise watchdogd of the pending reboot. Then, when the necessary steps of preparing the system for shutdown (umount etc.) are completed, Finit sends `SIGTERM` to watchdogd and puts itself in a 10 sec timeout loop waiting for the WDT to reset the board. If a reset is not done before the timeout, Finit falls back to`reboot(RB_AUTOBOOT)` which tells the kernel to do the reboot. An external watchdog service can also be used. The more advanced cousin [watchdogd](https://github.com/troglobit/watchdogd/) is the recommended option here. It can register itself with Finit using the same IPC as `initctl`. If the bundled watchdogd is running a hand-over takes place, so it's safe to have both services installed on a system. For the hand-over to work it requires that the WDT driver supports the safe exit functionality where `"V"` is written to the device before closing the device descriptor. If the kernel driver has been built without this, the only option is to remove `/libexec/finit/watchdogd` or build without it at configure time. finit-4.14/doc/ChangeLog.md0000644000175100001660000026251215054341541011165 Change Log ========== All relevant changes are documented in this file. [4.14][] - 2025-08-29 --------------------- Minor bug fix release. ### Changes - Add exit status/signal info when a process dies, by Mattias Berthel - Extend `service kill:SEC` to support up to 300 sec. - Extend `norespawn` debug to cover `service_retry()` - Build *without* libsystemd replacement by default ### Fixes - Fix #449: ALSA plugin fail-to-build-from-source - Fix `sysv` stop command process environment, should be same as start - Fix state machine ordering issue: enter new config generation *after* services disabled in previous generation have been stopped [4.13][] - 2025-07-10 --------------------- > [!NOTE] > This release introduce a bare bones `libsystemd` replacement with an > `.h` include file. Other systemd features are the > `reload:script` and `stop:script`, mimicking ExecReload and ExecStop. ### Changes - `initctl signal` command has been renamed to `initctl kill` - Drop xz tarballs from distribution, gzip is good enough - New `tmpfiles` stand-alone program, refactored from the existing tmpfiles.d support in Finit, by Aaron Andersen, PR #439 - `--remove` command runs only the `r` and `R` rules - `--create` is used for all other cases (bootstrap) - All `notify:systemd` services now log with `logit` by default. This because it supports systemd style log severity, leading `""` - Support for quoted arguments to run/task/service options, issue #441 - Clear command line arguments after bootstrap, issue #442 - Support for `stop:'script [args]'` to stop a sysv/service instead of the common `foo-stop-start.sh stop`, or `SIGTERM`, issue #412 - Support for `reload:'script [args]'` to trigger a configuration reload in a service, issue #446 ### Fixes - Fix #437: buffer overflow in `initctl status` - Fix #438: support very long command lines in `initctl ps/top` - Fix #440: broken systemd and s6 readiness notification - Fix #443: build warnings, by Ming Liu, Atlas Copco - Fix #444: handle loooooong arguments, by Aaron Andersen - Fix service's redirected stdout/stderr log priority in fallback mode, when neither `logger` or `logit` is available. This fix also checks for systemd style log severity, leading `""` in log messages - Ensure API socket used by `initctl` is non-blocking (event loop) [4.12][] - 2025-04-28 --------------------- ### Changes - Improve notify:s6 readiness compatibility, by Aaron Andersen - Update `runparts` usage text ### Fixes - Fix variable overloading in urandom plugin - Fix buffer overwrite in urandom plugin, reported by Aaron Andersen [4.11][] - 2025-03-27 --------------------- ### Changes - Update documentation regarding transition from runlevel S to 2, how run/tasks must "complete" before Finit can move to the next runlevel - Improve argument handling in bundled getty when launching login ### Fixes - Fix #432: allow services in `setup` state to be stopped. This fixes a serious blocker introduced in 4.10 that prevented systems from being rebooted when any service was in this state - Fix fallback `SIGKILL` when stopping a service with `SIGTERM` does not work. This fixes a serious issue with services not responding to the default `SIGTERM` - Fix pre/post/ready/cleanup script execution if service has an optional `env:file` (leading `-`) - Fix blocked signals for pre/post/ready/cleanup scripts preventing normal shutdown when a service/sysv is stopped in its setup state - Fix issue where a pre:script creates a PID file in `/run` cause the service to move from setup state to running. Any `svc_t` in setup, teardown, or cleanup state should be ignored in the pidfile plugin [4.10][] - 2025-03-03 --------------------- ### Changes - Add support for `cleanup:[0-3600,]script`, runs before service is removed, unlike `post:script` that runs when service is stopped - Improved entropy gathering in tertiary fallback of urandom plugin - Reclassify `sysv` from run/task class to `service` ### Fixes - Fix #427: using an external getty with custom login program cause Finit to use login program as the getty command - Fix #428: allow `sysctl` path to be set at build time - Fix #429: regression in v4.9 causing Finit to segfault at shutdown - Fix possible memory leak when sourcing a service `env:file` - Finit now waits until all `post:scripts` have run before returning OK to `initctl `. This also applies to the new `cleanup:scripts` introduced in this release - RFC3154 conformance formatting fix for `/dev/kmsg` fallback logging [4.9][] - 2025-02-15 -------------------- > [!CAUTION] > This release changes how Finit reacts to the exit status of `pre:` > scripts. Finit will now no longer start the main process if its > `pre:` script fails for any reason. So, if you have pre scripts that, > e.g., create directories, make sure they are idempotent. ### Changes - Add individual timeout (optional) support for pre/post/ready scripts - Add support for systems with broken RTC, i.e., those that at power-on may reset the RTC to a random date instead of zero, issue #418 - Add support for detecting "in-container" when in `systemd-nspawn` - Check exit status of `pre:` scripts, on failure drive service/sysv to `crashed` state. (The exit code of `post:` scripts remain ignored) - All pre/post/ready scripts are now also searched for in `$PATH` - Reset color attributes and clear screen when starting up. This is for boot loaders like GRUB, which leave background color artifacts ### Fixes - Fix #415: only mark reverse-dependencies "dirty" if the main service does not support SIGHUP. This helps avoid unnecessary restarts of services that depend on a service that supports SIGHUP - Fix #417: leaking inotify watchers in the cgroup subsystem - Fix #421: add support for `nofail` mount option in `/etc/fstab` - Fix #425: ordering bug in detecting .conf file changes to services and `initctl reload`, or runlevel changes - Fix `initctl touch` of template services, previously marking a service created from a template as "dirty" did not take - Fix unintended restart of template "siblings". I.e., `initctl touch` of instantiated template service A affected B from same template - Fix buggy `--with-rtc-date=DATE` configure option - Fix kill on timeout of pre/post/ready scripts [4.8][] - 2024-10-13 -------------------- ### Changes - Avoid remounting already mounted `/run` and `/tmp` directories. This extends the existing support for detecting mounted directories to include complex mount hierarchies are in use, overlayfs and tmpfs mounts. Feature by Mathias Thore, Atlas Copco - getty: trigger /etc/issue compat mode for Alpine Linux - tmpfiles.d: skip `x11.conf` unless X11 common plugin is enabled - tmpfiles.d: ignore x/X command, nos support for cleanup at runtime - Drop debug mode `-D` from `udevd` in `hotplug.conf.in`, allow the user to set this in `/etc/default/udevd` instead - Certain initctl APIs at bootstrap are not supported, update warning log to include command (number) for troubleshooting, issue #398 - Add support for hwrng to urandom plugin and check for empty seed - Add `runparts -b` (batch mode) support, disables escape sequences - New configure `--without-rc-local`, disables `/etc/rc.local` support - New configure `--disable-cgroup` option, disables cgroup v2 detection - `initctl show template@foo.conf` now shows how an enabled template service has been evaluated by Finit, issue #411 - Extend `initctl` timeout connecting and waiting for Finit reply. The previous 2 + 2 second poll timeout has proved to be too short on more complex systems. Now a 15 + 15 second timeout is applied which should be more resistant to temporary overload scenarios, issue #407 ### Fixes - Fix #397: system shutdown/reboot can block on console input if action is started remotely (ssh). Caused by legacy TTY screen size probing, removed from both bootstrap and shutdown/reboot - Fix #400: both `HOOK_MOUNT_ERROR` and `sulogin()` fail to trigger on either mount or `fsck` errors. Problem caused by unresolved status from pipe, calling `pclose()` without extracting exit status - Fix #402: `initctl touch` does not respect `-n` (no error) flag - Fix #403: `initctl touch` does not support template services - Fix #404: possible undefined behavior when `--with-fstab=no` is set - Fix #405: `@console` getty does not work with `tty0 ttyS0` - Fix #409: prevent tmpfiles from following symlinks for `L+` and `R`, otherwise symlink targets would also be removed. Found and fixed by Mathias Thore and Ming Liu, Atlas Copco - Fix #414: Frr Zebra immediately restarts on `initctl stop zebra`. The fix likely works for all Frr/Quagga services due to the way they create and delete their pid file - Cosmetic issue with `[ OK ]` messages being printed out of order at shutdown/reboot. Caused by nested calls to `service_stop()` - Cosmetic issue with duplicate "Restoring RTC" message at bootstrap [4.7][] - 2024-01-07 -------------------- ### Changes - Silence "not available" messages for run/task/service with `nowarn` - Update docs, `cgroup.root` workaround for `SCHED_RR` tasks - Drop runlevels 0 and 6 from `keventd`, not needed at reboot/poweroff - Mount `/dev/shm` with mode 1777 (sticky bit) - Mount `/dev/mqueue` if available, inspiration from Alpine Linux - Update Alpine Linux installer and configuration files, tested on Alpine v3.19, some assembly still required ### Fixes - Fix confusing warning message when tmpfiles.d fails to install symlink - Fix tmpfiles.d legacy `/run/lock/subsys`, ordering - Add missing `/var/tmp` and `/var/lock -> /run/lock` (tmpfiles.d) - Fix #388: log redirection broken unless Finit runs in debug mode. Found and fixed by Ryan Rorison - Fix #389: must libc requires `libgen.h` for `basename()` function. Reported and worked around with new `basenm()` function by Stargirl - Fix #392: `service/foo/ready` condition reasserted on pidfile removal [4.6][] - 2023-11-13 -------------------- ### Changes - Add support for service `notify:pid` and `readiness none` global option to change how Finit expects readiness notification, issue #386 ### Fixes - Fix #383: dbus and runparts regression in Finit v4.5. The configure script must expand `FINIT_RUNPATH_` before defining it in `config.h` - Fix #384: service environment variables drop everything but the first argument, e.g., `VAR="foo bar qux"` drops everything but `foo` - Fix #385: internal conditions, e.g., `` turn into flux when leaving bootstrap, causing depending services to stop - Fix #387: global environment variables declared with `set VAR=NAME` do not drop leading `set `, causing `'set VAR'='NAME'` in env. - Sanity check environment variables, for services and globally. Ensure the variable name (key) does not contain spaces, or a leading `set ` [4.5][] - 2023-10-30 -------------------- ### Changes - Refactor `runparts` and `/etc/rc.local` to no longer block the main loop, allowing `initctl` calls to interact with Finit. Issue #356 - Refactor the `run` stanza to no longer block the main loop, issue #362 - Allow `sulogin` with a user different from `root`, issue #357 - Allow disabling invocation of rescue mode from kernel command line - Add `initctl -f` to force-skip asking Finit for existing services when creating new services during bootstrap, e.g. `/etc/rc.local` - `initctl runlevel` now returns `N S` instead of `N 10` in bootstrap - `initctl runlevel N` during bootstrap is now allowed. It changes the next runlevel to go to when bootstrap has completed. Effectively overriding the `runlevel N` statement in `/etc/finit.conf` - Improved logging on failure to `execvp()` a run/task/service, now with `errno`, e.g., "No such file or directory" when the command is missing from `$PATH` - Add Bash completion support for `initctl`, configurable, issue #360 - Handle absolute path to `initctl [enable|disable]`, not supported - Update `finit.conf(5)` man page with the recommended directory hierarchy in `/etc/finit.d/` - The `runparts` code has been split into `/libexec/finit/runparts` - The `runparts` command now takes two options: `sysv` and `progress`. The former ensures only `SNNfoo` and `KNNfoo` scripts are run. - Add SysV Init Compatibility section to documentation - Increased MAX path for commands, and arguments: 64 -> 256 - The bundled watchdog daemon no longer tries to log at startup, because syslog is not available yet, any startup message leak to console - Extend `if:` option with runtime evaluation of conditions. E.g., start a task only `if:` (here the run task 'foo' failed) - Document new `if:`, `conflict:`, `nowarn` options for run/task/service first introduced in v4.4 - Failure to open fstab should log to console, not just log to `/dev/kmsg` - Rename `/lib/finit/system/*.conf`, added numbered prefix to ensure proper execution order, e.g., `udevd` should always run first - Plugins and bundled services: dbus, keventd, watchdogd, and runparts, are now loaded *after* all services in `/lib/finit/system/`. A new runtime-only path (for inspection) in `/run/finit/system/` is used - Redirect `log*` output to console when `finit.debug` is enabled - Assert `` condition if we detect running in container - Add support for mdev's netlink daemon mode, issue #367 - Add support for mdevd in `10-hotplug.conf`, preferred over plain mdev - Disable modprobe plugin by default, udevd and mdev/mdevd loads modules - Update documentation for run/task shell limitations, issue #376 - Update documentation regarding automount of `/run` and `/tmp` - Update plugin documentation, add section about limited tmpfiles.d(5) support - Skip registering service when `if:!name` matches a known service. This allows conditional loading of alternative services, e.g. if udevd is already loaded we do not need mdevd - Drop `doc/bootstrap.md`, inaccurate and confusing to users ### Fixes - Fix #227: believed to have been fixed in v4.3, the root cause was actually that Finit was waiting for a process that was no longer in the system. The fix is to ask the kernel on process-stop-timeout and replay the lost PID so that Finit can continue with reboot/shutdown - Fix #358: fix inotify events for `/etc/finit.conf`, improved log messages and error handling - Fix #361: cgroup move fail if run/task/services start as non-root. Regression in the v4.4 release cycle while adding support for the pre:/post:/ready: scripts. Now the latter scripts also properly run in their correct cgroup - Fix #366: document `fsck.*` kernel command line options and simplify the configure flags `--enable-fsckfix` and `--enable-fastboot` to only adjust the default values for the `fsck.*` options. - Fix #371: swap load order of `/lib/finit/system/*` vs `/etc/finit.d/*` We must run `10-hotplug.conf` first to ensure devices and modules are up and loaded before the user's run/task/services are called. The order at bootstrap is now saved in `/run/finit/conf.order` for inspection, `/run/finit/exec.order` shows the start order of each process - Fix #372: lost `udevadm` calls due to overloading - Adjust final `udevadm settle` timeout: 5 -> 30 sec - Fixed dbus plugin, the function that located ` ...` in the `dbus/system.conf` caused spurious line breaks which led to the service not being loaded properly - The `runparts` executor now skips backup files (`foo~`) - The `runparts` stanza now properly appends ` start` to scripts that start with `S[0-9]+`. This has been broken for a very long time. - Fix #377: expand service `env:file` variables, allow constructs like: RUNDIR=/var/run/somesvc DAEMON_ARGS=--workdir $RUNDIR --other-args... - Fix #378: warn on console if run/task times out during bootstrap - Fix #378: add run/task support for `` to allow transition from bootstrap to multi-user runlevel even though task has not run yet. - Fix #382: do not clear `` conditions on reload. Introduced back in v4.3-rc2, 82cc10be8, the support for automatic service conditions have had a weird and unintended behavior. Any change in state (see `doc/svc-machine.png`) caused Finit to clear out *all* previously acquired service conditions. However, when moving between RUNNING and PAUSED states, a service should not have its conditions cleared. The PAUSED state, seen also by all conditions moving to FLUX, is only temporary while an `initctl reload` is processed. If a service has no changes to be applied it will move back to RUNNING. Also, we cannot clear the service conditions because other run/task or services may depend on it and clearing them would cause Finit to `SIGTERM` these processes (since they are no longer eligible to run). [4.4][] - 2023-05-15 -------------------- > **Note 1:** this release contains changes to the `.conf` parser. If you > have .conf file statements with comment character (`#`) in the command > options or description, you must now escape them (`\#`). Issue #186 > > **Note 2:** prior to this release, runlevel `S` and `0` were after > boot treated as the same runlevel. This caused `task [06] ...` to > also run at bootstrap instead of just at shutdown and reboot. The > changes made to Finit to separate `S` from `0` require you to update > the allowed runlevels for services that are allowed to continue > running at shutdown. I.e., change `[S123456789]` to `[S0123456789]` > for, e.g., `sysklogd`. Issue #352 ### Changes * Add limited tmpfiles.d(5) support This change adds very basic `tmpfiles.d/` support to Finit. Most of the basic types are supported, but not all, so for now, please check the code and examples for details on what is working. * If a run/task/service command does not exist, skip registering it This changes the semantics of Finit a bit by checking for the command to run when registering it, skipping commands that cannot be found in the absolute path provided in the command, or in `$PATH` This change includes a new `nowarn` flag that can be used to prevent Finit from warning for missing commands. See below for an example. * Add run/task/service support for `conflict:foo` handling * Add run/task/service support for `if:[!]ident` and `if:<[!]cond>` Conditional loading of stanza depending on ident is already loaded (or not), or condition satisfied (or not). E.g., do not run `mdev` if we found and registered `udevd`, or load service only if `` condition is set. The optional leading `!` negates the comparison, if NOT foo then ... * Add support for static services in `/lib/finit/system/*.conf` Slowly migrating away from hard-coded services in plugins. This way it's possible for the user to both inspect and override as needed. * Migrate hotplug plugin to a conditional `/lib/finit/system/hotplug.conf` This is the first example of the just minted advanced stanza syntax with `if:`-statements, `conflict:` handling, and `nowarn` flags. * Initial support for template services, `foo@.conf`, similar to systemd $ initctl show avahi-autoipd@ service :%i avahi-autoipd --syslog %i -- ZeroConf for %i To enable ZeroConf for, e.g., `eth0`, use $ initctl enable avahi-autoipd@eth0.conf The enabled symlink will be set up to `avahi-autoipd@.conf` and every instance of `%i` will in the instantiated directive be replaced with `eth0`. Inspect the result with: $ initctl status avahi-autoipd:eth0 * Add `devmon`, a `` condition provider, issue #185 * Support for line continuation character `\` in .conf files, issue #186 service name:sysklogd [S123456789] \ env:-/etc/default/sysklogd \ syslogd -F $SYSLOGD_ARGS \ -- System log daemon * `HOOK_BASEFS_UP` has been moved! External plugins that need to call `service_register()`, please use `HOOK_SVC_PLUGIN` from now on. Apologies for any inconveniences this might cause! * getty: add support for `/etc/os-release` to replace `uname` output This change, which has a fallback to `/usr/lib/os-release`, overrides traditional modifiers with the os-release variant. These values were taken from `uname`, which on Linux systems are pretty useless since they always return the kernel name and version instead of the distro/OS values. E.g., \s becomes `PRETTY_NAME` instead of 'Linux' and \v becomes the pretty `VERSION`, while \r becomes `VERSION_ID`. * Support for overriding `/etc/finit.conf` and `/etc/finit.d` issue #235 New (kernel) command line option `finit.config=PATH` which can be used to redirect Finit to start up with, e.g., `/etc/factory.conf` instead of `/etc/finit.conf`. For the complete experience a new top-level configuration file directive `rcsd PATH` has also been added. It in turn can be used by `factory.conf` as follows to override `/etc/finit.d`: rcsd /etc/factory.d * Support for overriding `/etc/finit.d` from the alternate `finit.conf` with a new `rcsd /path/to/dot.d/` .conf file directive * Support for `fsck_mode=[auto,skip,force]` + `fsck_repair=[preen,no,yes]` * Add `set` keyword for environment variables set in `/etc/finit.conf` * Support `finit.cond=foo` cmdline `` conditions, issue #250 * `initctl` JSON output support for status and conditions, issue #273 Example: root@infix:~$ initctl status -j resolvconf { "identity": "resolvconf", "description": "Update DNS configuration", "type": "task", "forking": false, "status": "done", "exit": { "code": 0 }, "origin": "/etc/finit.d/enabled/sysrepo.conf", "command": "resolvconf -u", "restarts": 0, "pidfile": "none", "pid": 0, "user": "root", "group": "root", "uptime": 0, "runlevels": [ 1, 2, 3, 4, 5, 7, 8, 9 ] } The excellent tool `jq` can be used to extract parts of the output for further scripting. E.g. `initctl status -j foo | jq .exit.status` * Add JSON support to `initctl ls` command This allows for easy access to the *disabled* services: root@anarchy:~# initctl ls --json |jq '.available - .enabled' [ "chronyd.conf", "dnsmasq.conf", "gdbserver.conf", "inadyn.conf", "inetd.conf", "isisd.conf", "lldpd.conf", "mstpd.conf", "ntpd.conf", "ospf6d.conf", "ospfd.conf", "querierd.conf", "ripd.conf", "ripng.conf", "sshd.conf", "syslogd.conf", "telnetd.conf", "uftpd.conf", "wpa_supplicant.conf", "zebra.conf" ] * Allow `manual:yes` on sysv/service/run/task stanzas, issue #274 * Add support for `oncrash:script` to call the `post:script` action, if defined, for a crashing service. The `EXIT_CODE` variable sent to the script is set to `crashed`. Issue #282 * Search for plugins in `/usr` and `/usr/local` as well, issue #284 * tty: add support for `passenv` flag to `/bin/login`, issue #286 * Add reboot/shutdown/poweroff timeout `-t SEC` to initctl, issue #295 * Add support for s6 and systemd readiness notification, issue #299. Service readiness notification to support daemons employing systemd and s6 notification. Complementing the native Finit readiness support using PID files that exist already. The two have slightly different ways of implementing readiness: - https://www.freedesktop.org/software/systemd/man/sd_notify.html - https://skarnet.org/software/s6/notifywhenup.html Finit now provides both a `NOTIFY_SOCKET` environment variable, for systemd, and a way to start s6 daemons with a descriptor argument. For details on the syntax, see the `service` documentation. This change also renames internal states for run/task/services to avoid any confusion with the introduction of `ready:scripts`: - `WAITING -> PAUSED` - `READY -> WAITING` A service condition that used, e.g., `` should now instead use `` * Add `ready:script` for services, called when daemon is ready, issue #300 * Add support for running scripts at shutdown at two new hook points during the shutdown process, issue #302. See doc/plugins.md for details: - `HOOK_SVC_DN`: after all services and non-reserved processes have been killed (and collected) - `HOOK_SYS_DN`: after all file systems have been unmounted, *just prior* to Finit calling `reboot()` to shut down or reboot the system * The `modules-load` plugin now default to runlevel `[S]`, in previous releases it was `[2345]`. This breaking change is to align it more with what users mostly want (modules loaded before services start) and can be changed back to the old behavior with a per-file setting: set runlevel 2345 * The `modules-load` plugin now adds silent tasks for modprobe. This to prevent confusing `[ OK ]` boot messages when in fact modprobe failed. * The `modules-load` plugin now support `set modprobe /path/to/modprobe` * The header files `finit/conf.h` and `finit/service.h` are now exported for external plugins * Add support for multiple args to `initctl cond set/clr`, issue #329 * Silence confusing `[ OK ]` progress from modules-load plugin, issue #332 This change drops the confusing status progress output, which was always OK since the actual modprobe operation runs in the background. No need to show status of the "added a task to finit, found modprobe" command. * dbus plugin: adapt to other operating systems Not all Linux systems are based on Debian, and even if they are inspired by Debian (Buildroot), they do not necessarily use the same defaults. Probes the system at runtime for: - dbus user and group - dbus PID file If the user/group cannot be found we fall back to `root`, if the PID file cannot be determined we ignore PID file readiness. * Improve documentation for runparts and hook scripts. Issue #315, #320 * Add `HOOK_NETWORK_DN`, called after change to runlevel 6 or 0, issue #319 * Use sysklogd `logger` tool instead of legacy `logit` tool, issue #344 For log redirection Finit has the legacy `logit` tool. This change allows Finit to use the `sysklogd` project's extended `logger` tool instead, when available. Allowing logging with the process' PID. * Add `initctl` aliases: `cat -> show`, `kill -> signal` * Add `initctl -n,--noerr` to return OK(0) if services do not exist, for integration with openresolv and scripts with similar requirements * Add `initctl plugins`, list installed plugins * Add timestamp to log messages in fallback and logging to `stderr`. When there is no log daemon, and we are running in a container, or we cannot log to the kernel ring buffer, then we log to `stderr`. This change improves log output by prefixing each message with a timestamp. ### Fixes * Fix #254: document limitations in `rc.local` and `runparts` scripts * Fix #269: add compulsory kernel symlinks in `/dev` * Fix #275: `initctl status foo` should list all instances, regression introduced in v4.3 * Fix #278: enforce conditions also for running `pre:` scripts * Fix #279: allow `restart:always`, of crashing services. Similar to `respawn` but honors `restart_sec` * Fix #280: allow calling `initctl restart foo` from within foo * Fix #283: too quick timeout at bootstrap of lingering tasks * Fix #285: `initctl restart` should start crashed service * Fix #288: enable built-in `sulogin` in Alpine and Void Linux builds * Fix #293: modprobe plugin: support for coldplugging more devices. It turns out, not all buses in Linux add `modalias` attributes to their devices in sysfs. One notable exception are MDIO buses. The plugin's scan routine would thus not pick them up. * Fix #294: `shutdown --help` mistakenly shuts down system * Fix #310: Always use configured restart delay for crashing services. If no delay is configured, default to an initial 2000 msec for forking daemons and start-stop scripts, and 1 msec for non-forking daemons * Fix #311: document how to combine device tree with conditions * Fix #312: restart services with respawn set, e.g. ttys, immediately * Fix #313: Cancel pending restart timer on stop/start/restart/reload * Fix #314: skip run/task/service restart if conditions are lost * Fix #315: add environment variables to hook scripts All hook scripts are called with at least one environment variable set, `FINIT_HOOK_NAME`, useful when reusing the same hook script for multiple hook points. It is set to the string name, also used by the path, e.g., `hook/net/up` For all hook points from hook/sys/shutdown and later, `FINIT_SHUTDOWN` is also set, to one of: `halt`, `poweroff`, `reboot` * Fix #317: make sure hook scripts don't run twice, also fixes #316 * Fix #318: only show `[ OK ] Calling foo` progress for `runparts ...` * Fix #320: the API/IPC socket is closed immediately at shutdown/reboot to protect hook scripts or services calling initctl. There is no way to service these requests safely at that time * Fix #333: consider a service dirty if command line args have changed This fixes `initctl reload` correctly restarting all daemons that have new command line arguments. Previously command line arguments changes were only acted upon if the service was explicitly reloaded `initctl reload myservice`. Found and fixed by Jack Newman * Fix #338: ensure shutdown hooks are called properly; `hook/sys/down` and `hook/svc/down` hook scripts, found and fixed by Jack Newman * Fix #339: use absolute path in `/etc/finit.d/enabled/` symlinks, for use-cases when `/etc` is read-only and `/etc/finit.d/enabled -> /mnt/finit.d/enabled`, reported by Jack Newman * Fix #340: Finit ignores deleted/moved `.conf` file sin `/etc/finit.d` * Fix #342: in runlevel S (bootstrap), not all `initctl` commands can be supported, block the following: runlevel, reload, start/stop, restart, reload, halt, poweroff, suspend. Also, prevent `SIGHUP` and `SIGUSR1` signals when in shutdown or reboot * Fix #352: separate runlevel S from runlevel 0 * Fix #355: regression in v3.2 stopping a process and its group In Finit v3.2 a regression was introduced that affects the way Finit stops a supervised process and its process group. Instead of sending SIGTERM to the process, and thus delegating the responsibility to that process to inform any children it may have, as of commit 91a9c83 Finit sends SIGTERM to the entire process group. For SIGKILL this is fine, SIGKILL only runs as cleanup and as a last ditch effort if the process doesn't respond to SIGTERM. This regression, introduced in v3.2, directly affects services like `avahi-autoipd` that have forked off children that it needs to tell to exit cleanly before it returns. With the patch in question these children are never allowed to complete, which in turn causes lingering 169.254 link-local addresses on interfaces. * Fix bootmisc plugin: octal permission on `/run/lock` and `/var/lock` * Ensure `initctl cond get` support the flux state (exit code 255) * Fix potential socket leak at bootstrap and shutdown * Fix potential NULL pointer deref in kernel command line parser * Fix lingering condition in service after reload of service with new config that has no condition * Fix wrong path to command in service after reload, may have changed * `logit`: fall back to package name if `$LOGNAME` and `$USER` are unset. **Note:** you should probably not use `logit` in your own scripts, it is only meant for internal use by Finit. We recommend using `logger` from the `bsdutils` or `sysklogd` packages instead * Fix issue where `env:`/`pre:`/`post:`/etc. is removed from a service The trick is when reloading a service like this: service env:/etc/env serv -np -e foo:bar into this: service pre:/bin/pre.sh serv -np In the second the `env:` has been removed and `pre:` added. Prior to this patch, `env:` was kept leading to unintended behavior. * Fix parse/diff of command line args, e.g., `nginx -g 'daemon off;'` Starting a service like this works fine: service [2345789] env:-/etc/default/nginx nginx -g 'daemon off;' However, on `initctl reload` (and no change to .conf files) the arg list was lost while parsing the .conf files. Leading to a false positive 'diff' in args causing nginx to be unnecessarily restarted. * Fix issue with disabled "linewrap" on the console TTY after login. The root cause is `qemu-system-x86_64 -nographics` disabling it when starting up. The correct `\e[?7h` escape code is now used. [4.3][] - 2022-05-15 -------------------- Critical bug fix release. If you run a 32-bit target with GLIBC 2.34 you *need* to upgrade! > **Note:** system verbosity on console at start and shutdown has been > increased. Now the output of all commands is logged to the > system logger, for early services `/dev/kmsg` is used. > > **Also:** please notice the updated support for enabling and disabling > kernel and Finit debug messages on the system console. Very > useful when debugging either of them, e.g., a kernel module. > For details, see [cmdline.md](doc/cmdline.md). ### Changes * Support for overriding default runlevel from kernel command line. Any runlevel `[1-9]` may be selected, except 6 (reboot). Issue #261 * New command line option: `finit.fstab=/etc/fstab.custom`, with full support for mounting, mount helpers, fsck, and swapon/off, issue #224 * Support for special device `/dev/root`, which may not exist in `/dev`. Finit now looks up the matching block device for `/` in `/sys/block/` * Loading `module`s no longer shows arguments in progress output * Warning messages in progress output now in yellow, not red, issue #214 * `initctl`, new command line option `-V,--version` for ease of use * New condition `done` for run task, issue #207 by Ming Liu, Atlas Copco * Refactor parts of shutdown and reboot sequence for PREEMPT-RT kernels, by Robert Andersson, Mathias Thore, and Ming Liu, Atlas Copco * Conditions for run/task/sysv status, e.g. `run/foo/success` and `task/bar/failure`. Issue #232, by Ming Liu, Atlas Copco * Conditions for services, can be used to synchronize other stanzas: - `service/foo/running` - `service/foo/halted` - `service/foo/missing` - `service/foo/crashed` - `service/foo/stopped` - `service/foo/busy` - `service/foo/restart` * `initctl signal` support, by Jörgen Sigvardsson, issue #225 * `initctl cond get` support to match `cond [set | clear]`, issue #255 * `[WARN]` messages on console now printed in yellow, issue #214 * Network services now also stopped when going to runlevel 6 (reboot), not just runlevel 0 (shutdown) or 1 (single-user) * When `ifup` is missing on the system, bring at least `lo` up at boot * Log output from `ifup -a` (and `ifdown -a`), to syslog * Avoid blocking PID 1 when starting SysV init scripts * Allow custom `pid:` for SysV init scripts * Document supported types of forking/non-forking services * Auto-detect running in some common forms of containers * Simplify shutdown/reboot when running in a container * Log to `stderr` when running in a container w/o syslog daemon * Add support for `type:forking` to services, already supported but with a very difficult `pid:` syntax, issue #223. Docs updated * Support for setting global environment variables in `finit.conf`, please note: this also affects Finit itself, be careful! * Extended environment variables for pre/post scripts, issue #189 * Document secret service option `respawn`, which bypasses the crash semantics, allowing endless restarts * Document secret `HOOK_BANNER`, the first hook point before the banner * Document slightly confusing `initctl reload foo` command. It does *not* reload the service's `.conf` file! Issue #263 * Log changes; all instances where previously the `basename cmd` of a service was used to identify the service, now the proper `name:id` is used instead. Meaning, a service without a custom `:ID` or `name:` will display the same as before, but with any of those customizations the name and name:id will now be shown. **Note:** this may affect any log scrapers out there! * New plugin: `hook-scripts`, allows [run-parts(8)][] style scripts to run on any hook point. Contributed by Tobias Waldekranz * `initctl` (`reboot`) falls back to `-f` when it detects it is in `sulogin` recovery mode, issue #247 * The bundled `sulogin` is no longer enabled by default, in favor of distribution versions. Enable with `./configure --with-sulogin` * Support args to sysv-like scripts, e.g. `bridge-stp br0 start` * The `modules-load` plugin now skips all lines starting with `#` and `;`. Furthermore, files in `/etc/modules-load.d/*.conf` are now read in lexicographic order and UNIX backup files (`foo.conf~`) are skipped * The `name:id` tuple is now more consistently used in all log and debug messages instead of the basename of the command * Simplify error output of `initctl start/stop/restart/signal`, no more extra usage help, just a plain error message * Exit codes of `initctl` have changed to use LSB script standard and BSD sysexits.h exit codes. As before, a non-zero exit is error or missing * Add support for `initctl -q` to more commands: stop, start, restart, reload, signal, etc. [run-parts(8)]: https://manpages.debian.org/cgi-bin/man.cgi?query=run-parts ### Fixes * Fix nasty 32/64-bit alignment issue between finit and its plugins, applicable to 32-bit targets with GLIBC 2.34 and later. External plugins must make sure to use, at least: `-D_TIME_BITS=64` * Fix #215: disable cgroup support at runtime if kernel lacks support or does not have the required controllers (cpu) * Fix #217: iwatcher initialization issue, by Ming Liu, Atlas Copco * Fix #218: initctl matches too many services, by Ming Liu, Atlas Copco * Fix #219: not all filesystems unmounted at shutdown, by Ming Liu, Mathias Thore, and Robert Andersson, Atlas Copco * Fix #226: initctl shows wrong PID for crashing services * Fix #227: reboot stalls if process stopped with `[WARN]` * Fix #233: initctl shows wrong status for run/task, by Sergio Morlans and Ming Liu, Atlas Copco * Fix #248: source `env:file` also in `pre:` and `post` scripts * Fix #260: drop limit on device name in `Checking filesystem...` output * Fix start/stop and monitoring (restart) of SysV init scripts and forking services, see the updated documentation for details * Fix call to `swapoff` at shutdown, does not support `-e` flag * Fix suspend to RAM issue. Previously `reboot(RB_SW_SUSPEND)` was used, now the modern `/sys/power/state` API is used instead. * Fix nasty run/task/service matcher bug, triggered by stanzas using the same basename of a command but different `:ID`. Caused Finit to match with already registered but different run/task/service [4.2][] - 2022-01-16 -------------------- ### Changes * Support for non-root users to use `initctl`, e.g. group wheel * Support for new libite (-lite) header namespace * RTC plugin now reset an invalid RTC time to the kernel default time, 2000-01-01 00:00, prevents errors and is less crazy than some systems coming with with <= Jan 1, 1970 * urandom plugin now use RNDADDENTROPY ioctl to seed kernel rng, incrementing entropy count. Also, 32 kiB instead of 512 bytes are now saved (and restored) on reboot. This should greatly improve reliability of systems with none or poor HWRNG * Kernel logging to console (loglevel >= 7, debug, when quiet mode is not used) is now honored by Finit, regardless of the finit.debug command line option * Reduced default log level from `LOG_NOTICE` to `LOG_INFO` * Wrapped all calls to mount(2) to add logging in case of failure * New configure options to control fastboot (no fsck) and fsck fix options, by Ming Liu, Atlas Copco * Support for overriding default `/etc/nologin` file with an external `#define`, by Ming Liu, Atlas Copco * Support for overriding default `/var/run/dbus/pid` file with an external `#define`, by Ming Liu, Atlas Copco * Support for more service options to control respawn behavior of crashing services, by Robert Andersson and Ming Liu, Atlas Copco * Support for `initctl ident [NAME]` which lists all instances of `NAME`, or all enabled system run/tasks and services * Show number of total restarts and current respawn count for a service in `initctl status foo` * Crashing services no longer have the crash/restart counter reset as soon as they have stabilized. Instead, a background timer will slowly (every 300 sec) age (decrement) the counter. This will still catch services that "rage quit", but also those that crash after a longer period of activity ### Fixes * Fix #180: user managed (`manual:yes`) services accidentally started by `initctl reload`, regression introduced in Finit v4.0 * Fix #181: lots of typos all over the tree, by David Yang, Debian * Fix #187: fix typos, incl. small cleanup, in doc/bootstrap.md * Fix #188: support running on kernels that do not have cgroups v2. When this is detect, all functions related to cgroups support in Finit are disabled, *except* the .conf file parser. Hence, you may get parse error if you have invalid cgroup configuration in your Finit .conf files * Fix #197: `initctl status foo` now shows a focused overview of all matching instances; foo:1, foo:2 -- if only one instance matches the command line argument, or if onle one instance exists, the detailed view is shown, as before * Fix #198: a few typos found by Tim Gates * Fix #199: avoid using C++ reserved keywords * Fix #201: memory leak in usr condition plugin, by Ming Liu, Atlas Copco * Fix #203: ensure all filesystems listed in /proc/mounts are properly unumounted on shutdown/reboot, by Robert Andersson, Atlas Copco * Fix #210: resizing terminal (smaller) after boot causes empty lines to be inserted between boot progress * Fix #211: drop hard-coded 32 character limit in getty, now reads `_SC_LOGIN_NAME_MAX` from `sysconf(3)` * Fix #212: service PID file lost after inictl reload, visible from the output from `initctl status foo` [4.1][] - 2021-06-06 -------------------- Bug fix release. Also disables handlers for `SIGINT` and `SIGPWR`, a new set of `sys` conditions are instead generated which can be used to trigger external programs. ### Changes * Change behavior on SIGUSR1 to be compatible with sysvinit and systemd. Previously SIGUSR1 caused Finit to halt, like BusyBox init. This had "interesting" side effects on Debian systems when coexisting with sysvinit (upgrading/reinstalling causes scripts to `kill -USR1 1`) * Change how `contrib/debian/install.sh` sets up a Grub boot entry for finit. We now modify the $SUPPORTED_INITS variable in `10_linux` * Disable default kernel ctrl-alt-delete handler and let Finit instead catch `SIGINT` from kernel to be able to perform a proper reboot. There is no default command for this, you need to set up a task that triggers on `` to issue `initctl reboot` * Added keventd to provide `` condition to Finit. keventd is currently only responsible for monitoring `/sys/class/power_supply` for changes to active AC mains power online status. Enable keventd with `configure --with-keventd` * For handling power fail events (from UPS and similar) a process may send `SIGPWR` to PID 1. Finit no longer redirects this to `SIGUSR1` (poweroff). There is no default command for this, you need to set up a task that triggers on `` to issue `initctl poweroff` * Built-in Finit getty is now a standalone program * Default termios for TTYs now enable `IUTF8` on input * If `/bin/login` is not found, Finit now tries `sulogin` before it falls back to an unauthenticated `/bin/sh` * Dropped (broken) support for multiple consoles. Finit now follows the default console selected by the kernel, `/dev/console` * Dropped signal handlers for SIGSTOP/TSTP and SIGCONT * Added support for `\n`, in addition to `\r`, in "Please press Enter" prompt before starting getty * Finit no longer parses `/proc/cmdline` for its options. Instead all options are by default now read from `argv[]`, like a normal program, this is also what the kernel does by default. Please note, this may not work if your systems boots with an initramfs (ymmv), for such cases, see `configure --enable-kernel-cmdline` * The following plugins are now possible to disable (for containers): `rtc.so`, `urandom.so`, you may also want to disable `hotplug.so`. They are all enabled by default, as in Finit 4.0, but may be moved to external tools or entries in `finit.conf` in Finit 5.0 * Added support for reading `PRETTY_NAME` from `/etc/os-release` to use as heading in progress output, unless `--with-heading=GREET` is used. * Added manual pages for finit(8), initctl(8), and finit.conf(5) ### Fixes * Stricter interface name validation in netlink plugin, modeled after the kernel. Suggested by Coverity Scan * Fix problem of re-registering a service as a task. Previously, if a fundamental change, like type, was made to an active service/run/task it did not take. Only possible workaround was to remove from config * initctl: drop warning when removing a non-existing usr condition * initctl: drop confusing `errno 0` when timing out waiting for reply * Ensure services in plugins and from Finit main belong to a cgroup * Ensure init top-level cgroup remains a leaf group * Fix tty parse error for detecting use of external getty * Fix default `name:` and `:ID` for tty's, e.g. `ttyS0` now gives `tty:S0` as expected. This was default for built-in getty already * Fix max username (32 chars) in bundled Finit getty * The `contrib/*/install.sh` scripts failed to run from tarball * Finit no longer forcibly mounts; `/dev`, `/proc`, or `/sys`, instead it checks first if they are already mounted (devtmpfs or container) * Fix `/etc/fstab` parser to properly check for 'ro' to not remount the root filesystem at boot. The wrong field was read, so a root mounted by an initramfs, or by lxc for a container, had their root remounted * Fix SIGCHLD handler, `waitpd()` may be interrupted by a signal * Reset `starting` flag of services being stopped. When a service is started and then stopped before it has created its pid file, it could be left forever in the stopping state, unless we reset the starting flag. * Fix #170: detect loss of default route when interfaces go down. This emulates the missing kernel netlink message to remove the condition net/default/route to allow stopping dependent services * Fix #171: restore automatic mount of `/dev/shm`, `/dev/pts`, `/run` and `/tmp`, unless mounted already by `/etc/fstab`. This is what most desktop systems expect PID 1 to do. Here we also make sure to mount `/run/lock` as a tmpfs as well, with write perms for regular users, this prevents regular users from filling up `/run` and causing DoS. * Fix #173: netlink plugin runs out of socket buffer space; finit[1]: nl_callback():recv(): No buffer space available Fixed by adding support for resync with kernel on `ENOBUFS`. See netlink(7) for details. As a spin-off the plugin now supports any number of interfaces and routes on a system. On resync, the following message is now logged, as a warning: finit[1]: nl_callback():busy system, resynchronizing with kernel. * Fix #174: loss of log messages using combo of prio and facility, e.g., `logit(LOG_CONSOLE | LOG_NOTICE, ...)`, by Jacques de Laval, Westermo * Fix #175: ensure Finit does not acquire a controlling TTY when checking if a device is a TTY before starting a getty. This fixes an old bug where Ctrl-C after logout from a shell could cause PID 1 to get SIGINT, which in turn could lead to a system reboot [4.0][] - 2021-04-26 -------------------- This release became v4.0, and not v3.2, because of incompatible changes to service conditions. There are other significant changes as well, so make sure to read the whole change log when upgrading. ### Changes * The stand-alone `reboot` tool has been replaced with a symlink to `initctl`, like its siblings: halt, shutdown, poweroff, and suspend. Calling `reboot` & C:o now defaults to the corresponding `initctl cmd` with a fallback to sending signals as per traditional SysV init. The `-f` (force) flag remains, where `reboot(2)` is called directly * Introducing Finit progress 𝓜𝓸𝓭𝓮𝓻𝓷 * The `inictl cond set|clear COND` have changed completely. Constrained to a flat `` namespace and automatically activated by a new `usr.so` plugin that checks services for usr condition changes * Removed built-in inetd super server. If you need this functionality, use an external inetd, like xinetd, instead. A pull request for a stand-alone inetd, like watchdogd and getty, is most welcome! * Incompatible `configure` script changes, i.e., no guessing `--prefix` and other paths. Also, many options have been changed, renamed, or flipped defaults, or even dropped altogether. There are examples in the documentation and the `contrib/` section * Service conditions change from the non-obvious `` to ``. Not only does this give simpler internal semantics, it hopefully also makes it clear that one service's `pid:!foo` pidfile is another service's `` condition, issue #143 * Initial support for cgroups v2: - services runs in a cgroup named after their respective *.conf file - top-level groups are; init, user, and system - all top-level groups can be configured from finit *.conf files - each service can tweak the cgroup settings - Use `initctl [top|ps|cgroup]` commands to inspect runtime state - https://twitter.com/b0rk/status/1214341831049252870?s=20 * Major refactor of Finit's `main()` function to be able to start the event loop earlier. This also facilitated factoring out functionality previously hard-coded in Finit, e.g., starting the bundled watchdogd, various distro packed udevd and other hotplugging tools * A proper rescue mode has been added. It is started extremely early and is protected with a bundled `sulogin`. Exiting rescue mode now brings up the system as a normal boot, as one expects * Support for `sysv` start/stop scripts as well as monitoring forking services, stared using `sysv` or `service` stanza * Support for custom `kill:DELAY`, default 3 sec. * Support for custom `halt:SIGNAL`, default SIGTERM * Support for `pre:script` and `post:script`, allows for setup and teardown/cleanup before and after a service runs, issue #129 * Support for `env:file` in `/etc/default/foo` or `/etc/conf.d/foo`, see the contrib section for examples that utilize this feature. Variables expanded from env files, and the env files themselves, are tracked for changes to see if a service .conf file is "dirty" and needs restart on `initctl reload` * Support for tracking custom PID files, using `pid:!/path/to/foo.pid`, useful with new `sysv` or `service` which fork to background * Support starting run/task/services without absolute path, trust `$PATH` * Add support for `--disable-doc` and `--disable-contrib` to speed up builds and work around issue with massively parallel builds * Support for `@console` also for external getty * Support for `notty` option to built-in getty, for board bring-up * Support for `rescue` option to built-in getty, for rescue shells * Add `-b`, batch mode, for non-interactive use to `initctl` * Prefer udev to handle `/dev/` if mdev is also available * Redirect dbus daemon output to syslog * Set `$SHELL`, like `$PATH`, to a sane default value, needed by BusyBox * Finit no longer automatically reloads its `*.conf` files after running `/etc/rc.local` or run-parts. Use `initctl reload` instead. * `initctl` without an argument or option now defaults to list services * Convert built-in watchdog daemon to standalone mini watchdogd, issue #102 * Improved watchdog hand-over, now based on `svc_t` and not PID * Extended bootstrap, runlevel S, timeout: 10 --> 120 sec. before services not allowed in the runtime runlevel are unconditionally stopped * Removed `HOOK_SVC_START` and `HOOK_SVC_LOST`, caused more problems than they were worth. Users are encouraged to use accounting instead * Skip displaying "Restarting ..." progress for bootstrap processes * Added a simple work queue mechanism to queue up work at boot + runtime - Postpone deletion of `svc_t` until any `SIGKILL` timer has elapsed - As long as a stepped service changes state we queue another step all event, because services may depend on each other * Require new libuEv API: `uev_init1()` to reduce event cache so that the kernel can invalidate deleted events before enqueuing to userspace * Rename `hwclock.so` plugin to `rtc.so` since it now is stand-alone from the `hwclock` tool. Note: the kernel can also be set to load and store RTC to/from system clock at boot/halt as well, issue #110 * New plugin to support cold plugging devices, auto-loading of modules at boot. Detects required modules by reading `/sys/devices/*` * New plugin for `/etc/modules-load.d/` by Robert Andersson, Atlas Copco * New `name:foo` support for services, by Robert Andersson, Atlas Copco * New `manual:yes` support for services, by Robert Andersson, Atlas Copco * New `log:console` support for services, by Robert Andersson, Atlas Copco * Support for `:ID` as a string, by Jonas Johansson, Westermo * Support for auto-reload, instead of having to do `initctl reload`, when a service configuration has changed. Disabled by default, but can be enabled with `./configure --enable-auto-reload` * Support for logging security related events, e.g., runlevel change, star/stop or failure to start services, by Jonas Holmberg, Westermo * Mount devtpts with recommended `ptxmode=0666` * Mount /run tmpfs with nosuid,nodev,noexec for added security * Support for `console` as alias for `@console` in tty stanzas * Drop `--enable-rw-roots` configure option, use `rw` for your `/` partition in `/etc/fstab` instead to trigger remount at boot * Drop default tty speed (38400) and use 0 (kernel default) instead * Make `:ID` optional, use NULL/zero internally this allows ... * Handle use-cases where multiple services share the same PID filem and thus the same condition path, e.g. different instances for different runlevels. Allow custom condition path with `name:foo` syntax, creates conditions w/o a path, and ... * Always append `:ID` qualifier to conditions if set for a service * The IPC socket has moved from `/run/finit.sock` to `/run/finit/socket` officially only supported for use by the `initctl` tool * The IPC socket now uses `SOCK_SEQPACKET` instead of `SOCK_STREAM`. Recommend using watchdogd v3.4, or later, which support this * Improved support for modern `/etc/network/interfaces`, which has include statements. No more native `ifup` of individual interfaces, Finit now calls `ifup -a`, or `ifdown -a`, delegating all details to the operating system. Also, this is now done in the background, by popular request ### Fixes * Fix #96: Start udevd as a proper service * Ensure we track run commands as well as task/service, once per runlevel * Ensure run/tasks also go to stopping state on exit, like services, otherwise it is unnecessarily hard to restart them * Fix missing OS/Finit title bug, adds leading newline before banner * Remove "Failed connecting to watchdog ..." error message on systems that do not have a watchdog * Fix #100: Early condition handling may not work if `/var/run` does not yet exist (symlink to `/run`). Added compat layer for access * Fix #101: Built-in inetd removed * Fix #102: Start built-in watchdogd as a regular service * Fix #103: Register multiple getty if `@console` resolves to >1 TTY, * Fix #105: Only remove /etc/nologin when moving from runlevel 0, 1, 6 Fixed by Jonas Johansson, Westermo * Fix #109: Support for PID files in sub-directories to `/var/run` * Handle rename of PID files, by Robert Andersson, Atlas Copco * Fix #110: automatic modprobe of RTC devices, built-in hwclock * Fix #120: Redirect `stdin` to `/dev/null` for services by default * Fix #122: Switch to `nanosleep()` to achieve "signal safe" sleep, fixed by Jacques de Laval, Westermo * Fix #124: Lingering processes in process group when session leader exits. E.g., lingering `logit` processes when parent dies * Fix #127: Show all runparts scripts as they start, like rc.local, fixed by Jacques de Laval, Westermo * Fix service name matching, e.g. for condition handling, may match with wrong service, by Jonas Holmberg, Westermo * Run all run-parts scripts using `/bin/sh -c foo` just like the standard run-parts tool. Found by Magnus Malm, Westermo * Fix `initctl [start | restart]`, should behave the same for services that have crashed. Found by Mattias Walström, Westermo * Wait for bootstrap phase to complete before cleaning out any bootstrap processes that have stopped, they may be restarted again * Reassert condition when an unmodified run/task/service goes from WAITING back to RUNNING again after a reconfiguration event. Found and fixed by Jonas Johansson, Westermo * Restore Ctrl-D and Ctrl-U support in built-in getty * Remove service condition when service is deleted * Fix C++ compilation issues, by Robert Andersson, Atlas Copco * Build fixes for uClibc * Provide service description for built-in watchdog daemon * Fix #138: Handle `SIGPWR` like `SIGSUR2`, i.e., power off the system * Drop the '%m' GNUism, for compat with older musl libc * Fix #139: call `tzset()` on `initctl reload` to activate system timezone changes (for logging) [3.1][] - 2018-01-23 -------------------- Improvements to `netlink.so` plugin, per-service `rlimit` support, improved integration with `watchdogd`, auto-detect TTY console. Much improved debug, rescue and logging support. Also, many fixes to both big and small issues, most notably in the condition handling, which no longer is sensitive to time skips. This version requires at least libuEv v2.1.0 and libite v2.0.1 ### Changes * Support for more kernel command line settings: - splash, enable boot progress - debug, like `--debug` but also enable kernel debug - single, single user mode (no network) - rescue, new rescue mode * Support for `IFF_RUNNING` to netlink plugin => `net/IFNAME/running` * Support for restarting `initctl` API socket on `SIGHUP` * Greatly updated `initctl status ` command * Support for `rlimit` per service/run/task/inetd/tty, issue #45 * Support for setting `hard` and `soft` rlimit for a resource at once * Support for auto-detecting serial console using Linux SysFS, the new `tty @console` eliminates the need to keep track of different console devices across embedded platforms: `/dev/ttyS0`, `/dev/ttyAMA0`, etc. * Add TTY `nologin` option. Bypasses login and skips immediately to a root shell. Useful during board bringup, in developer builds, etc. * Support for calling run/tasks on Finit internal HOOK points, issue #18 * Removed support for long-since deprecated `console DEV` setting * Cosmetic change to login, pressing enter at the `Press enter to ...` prompt will now replace that line with the login issue text * Calling `initctl` without any arguments or options now defaults to show status of all enabled services, and run/task/inetd jobs * Cosmetic change to boot messages, removed `Loading plugins ...`, start of inetd services, and `Loading configuration ...`. No end user knows what those plugins and configurations are, i.e. internal state+config * Change kernel WDT timeout (3 --> 30 sec) for built-in watchdog daemon * Advise watchdog dawmon on shutdown and reboot using `SIGPWR` and then `SIGTERM`. It is recommended the daemon start a timer on the first signal, in case the shutdown process somehow hangs. * Handle `/etc/` OverlayFS, reload /etc/finit.d/*.conf after `mount -a` * initctl: Add support for printing previous runlevel * initctl: Support short forms of all commands * initctl: Support for `initctl touch ` to be used with `reload` * initctl: Improved output of `initctl show ` * Support reloading `/etc/finit.conf`. The main finit.conf file previously did not support reloading at runtime, as of v3.1 all configuration directives supported in `/etc/finit.d/*.conf` are now supported in `/etc/finit.conf` * Change `.conf` dependency + reload handling. Finit no longer relies on mtime of `.conf` files, instead an inotify handler tracks file changes for time *insensitive* dependency tracking * Change condition handling to not rely on mtime but a generation id. * New configure script option `--enable-redirect` to automatically redirect `stdout` and `stderr` of all applications to `/dev/null` * New `pid` sub-option to services when a service does not create a PID file, or when the PID file has another name. Issue #95 * Greatly improved `log` sub-option to service/run/tasks, selectively redirect `stdout` and `stderr` using the new tool `logit` to either syslog or a logfile. Issue #44 * Support for automatic log rotation of logfiles created by `log` option. Use `configure --disable-logrotate` on systems with a dedicated log rotation service. Issue #44 * Support for disabling service/run/task progress with empty ` --` description. Note: no description separator gives a default desc. * Create `/etc/mtab` symlink if missing on system (bootmisc plugin) * New hook: `hook/mount/post` runs after `mount -a` but before the `hook/mount/all`, where `bootmisc.so` runs. This provides the possibility of running a second stage mount command before files in `/run` and similar are created * Skip `gdbserver` when unleashing the grim reaper at shutdown * Distribute and install `doc/` and `contrib/` directories ### Fixes * Reset TTY before restarting it. A program may manipulate the TTY in various ways before the user logs out, Finit needs to reset the TTY to a sane state before restarting it. Issue #84 * On .conf parse errors, do *not* default to set TTY speed 38400, reuse current TTY speed instead * Fix run/tasks, must be guaranteed to run once per declared runlevel. All run/tasks on `[S]` with a condition `<...>` failed to run. Finit now tracks run/tasks more carefully, waiting for them to finish before switching to the configured runlevel at boot. Issue #86 * Allow inetd services to be registered with a unique ID, e.g. `:161`, issue #87. Found by Westermo * inetd: drop UDP packets from blocked interfaces, issue #88 * Handle obscure inter-plugin dependency issue by calling the netlink plugin before the pidfile plugin on `HOOK_SVC_RECONF` events * Handle event loop failure modes, issue found by Westermo * Handle API socket errors more gracefully, restart socket * Do not attempt to load kernel modules more than once at bootstrap * Remove reboot symlinks properly on uninstall * Fix regression in condition handling, reconf condition must be kept as a reference point to previous reconfiguration, or bootstrap. * Fix nasty race condition with internal service stop, abort kill if the service has already terminated, otherwise we may do `kill(0, SIGKILL)` * Fix reconfiguration issue with (very quick) systems that don't have highres timers * Fix formatting of runlevel string in `initctl show` * Allow running `initctl` with `STDOUT` redirected * Fix regression in `initctl start/stop `, using name worked not id * Fix error handling in `initctl start/stop` without any argument * Fix issue #81 properly, remove use of SYSV shm IPC completely. Finit now use the API socket for all communication between PID 1 and initctl * Fix segfault on x86_64 when started with kernel cmdline `--debug` * Normalize condition paths on systems with `/run` instead of `/var/run` [3.0][] - 2017-10-19 -------------------- Major release, support for conditions/dependencies between services, optional built-in watchdog daemon, optional built-in getty, optional built-in standard inetd services like echo server, rdate, etc. Also, native support for Debian/BusyBox `/etc/network/interfaces`, overhauled new configure based build system, logging to `/dev/kmsg` before syslogd has started, massively improved support for Linux distributions. ### Changes * Added basic code of conduct covenant to project * Added contribution guidelines document * Removed `finit.conf` option `check DEV`, replaced entirely by automated call to `fsck` for each device listed in `/etc/fstab` * Removed deprecated and confusing `startx` and `user` settings. It is strongly recommended to instead use xdm/gdb/lightdm etc. * Add support for `initctl log `, shows last 10 lines from syslog * Add `initctl cond dump` for debugging conditions * Ensure plugins always have a default name, file name * Reorganization, move all source files to a `src/` sub-directory * Add support for `initctl `, much needed by distributions. See [doc/distro.md](doc/distro.md) for details * Remove `UNUSED()` macro, mentioned here because it may have been used by external plugin developers. Set `-Wno-unused-parameter` instead * New table headings in `initctl`, using `top` style inverted text * Allow `initctl show` to use full screen width for service descriptions * New `HOOK_BANNER` for plugins to override the default `banner()` * Allow loading TTYs from `/etc/finit.d` * Improvements to built-in getty, ignore signals like `SIGINT`, `SIGHUP`, support Ctrl-U to erase to beginning of line * Add TTY `nowait` and `noclear` options * Allow using both built-in getty and external getty: tty [12345] /dev/ttyAMA0 115200 noclear vt220 tty [12345] /sbin/getty -L 115200 /dev/ttyAMA0 vt100 tty [12345] /sbin/agetty -L ttyAMA0 115200 vt100 nowait * Silent boot is now the default, use `--enable-progress` to get the old Finit style process progress. I.e., `--enable-silent` is no more * Support for `configure --enable-emergency-shell`, debug-only mode * Support for a fallback shell on console if none of the configured TTYs can be started, `configure --enable-fallback-shell` * All debug messages to console when Finit `--debug` is enabled * Prevent login, by touching `/etc/nologin`, during runlevel changes * A more orderly shutdown. On reboot/halt/poweroff Finit now properly goes to runlevel 0/6 to first stop all processes. * Perform sync before remounting as read-only, at shutdown * Clean up `/tmp`, `/var/run`, and `/var/lock` at boot on systems which have these directories on persistent storage * Call udev triggers at boot, on systems with udev * Add missing `/var/lock/subsys` directory for dbus * Add support for `poweroff` * Add support for a built-in miniature watchdog daemon * Remove GLIBC:isms like `__progname` * Manage service states based on user defined conditions * Manage dependencies between services, w/ conditions (pidfile plugin) * Manage service dependencies on network events (netlink plugin) * Support for dynamically reloading Finit configuration at runtime * Refactor to use GNU configure and build system * New hooks for for detecting lost and started services (lost plugin) * External libraries, libuEv and libite, now build requirements * Early logging support to `/dev/kmsg` instead of console * Support for redirecting stdout/stderr of services to syslog * Support for managing resource limits for Finit and its processes * Add optional built-in inetd services: echo server, chargen, etc. * Add simple built-in getty * Greatly improved accounting support, both UTMP and WTMP fixes+features * Improved udev support, on non-embedded systems * Improved shutdown and file-system unmount support (Debian) * Support SysV init `/etc/rc.local` * Inetd protection against UDP looping attacks * Support systems with `/run` instead of `/var/run` (bootmisc plugin) * Adopted BusyBox init signals for halt/reboot/poweroff * SysV init compat support for reboot (setenv) * Compat support for musl libc * Add OpenRC-like support for sysctl.d/*.conf * Add support for Debian/BusyBox `/etc/network/interfaces` * Add support for running fsck on file systems in `/etc/fstab` * Added example configs + HowTos for Debian and Alpine Linux to support latest releases of both distributions * Lots of documentation updates ### Fixes * Fix race-condition at configuration reload due to too low resolution. Thanks to Mattias Walström, Westermo * Fix to handle long process (PID) dependency chains, re-run reconf callback until no more applications are in flux. Thanks to Mattias Walström, Westermo * Clear `reconf` condition when `initctl reload` has finished * Skip automatic reload of `/etc/finit.d/*.conf` files when changing runlevel to halt or reboot * Fix issue #54: Allow halt and poweroff commands even if watchdog is enabled * Fix issue #56: Check existence of device before trying to start getty * Fix issue #60: `initctl` should display error and return error code for non-existing services should the operator try to start/stop them. * Fix issue #61: Reassert `net/*` conditions after `initctl reload` * Fix issue #64: Skip `fsck` on already mounted devices * Fix issue #66: Log rotate and gzip `/var/log/wtmp`, created by Finit * Fix issue #72: Check `ifup` exists before trying to bring up networking, also set `$PATH` earlier to simplify `run()` et al -- no longer any need to use absolute paths for system tools called from Finit. Thanks to crazy * Fix issue #73: Remove double `ntohl()` in inetd handling, prevents matches. Thanks to Petrus Hellgren, Westermo * Fix issue #76: Reap zombie processes in emergency shell mode * Fix issue #80: FTBFS on Arch Linux, missing `stdarg.h` in `helpers.h`, thanks to Jörg Krause * Fix issue #81: Workaround for systems w/o SYSV shm IPC support in kernel * Always collect bootstrap-only tasks when done, we will never re-run them. Also, make sure to never reload bootstrap-only tasks at runtime * Remove two second block (!) of Finit when stopping TTYs [2.4][] - 2015-12-04 -------------------- Bug fix release. ### Changes * Add support for status/show service by `name:id` * Enforce terse mode after boot, if verbose mode is disabled * Re-enable verbose mode at reboot, if disabled at boot * Update section mentioning BusyBox getty * Update debugging documentation * Allow debug to override terse mode * Revert confusing change in service state introduced in [v2.3][2.3]. As of [v2.4][2.4] services are listed as "halted" and "stopped", when they have been halted due to a runlevel changed or stopped by the user, respectively. ### Fixes * Fix system freeze at reconfiguration. Changed services that all support `SIGHUP` caused a freeze due to Finit waiting for them to stop. * Make sure to start and/or `SIGHUP` services after reconfiguration when there was no services to stop. [2.3][] - 2015-11-28 -------------------- Bug fix release. ### Changes * Add support for stop/start/restart/reload service by `name:id` * Refactor service status listed in `initctl show`, show actual status ### Fixes * Remove bootstrap-only tasks/services when leaving runlevel 'S' * Fix reference counting issue with already stopped and removed services when the user performs `initctl reload` to change system configuration * Revert semantic change in behavior of `initctl restart`: users expect service to be stopped/started, not reloaded with `SIGHUP` even if the service supports it * Fix `NULL` pointer dereference causing kernel panic when user calls `initctl reload` after change of system configuration * Fix column alignment in output of `initctl show` for services not in current runlevel [2.2][] - 2015-11-23 -------------------- Lots of fixes to handle static builds, but also fixes for dynamic event handling and reconfiguration at runtime. ### Changes * Upgrade to libuEv v1.2.4, to handle static builds * Upgrade to libite (LITE) v1.2.0, to handle static builds * Clarify how to select different plugins with the configure script * Improve urandom plugin for embedded systems w/o random seed * Add `--debug` flag to `initctl` * The runlevels listed for services in `initctl show` now highlight the active runlevel. * Clarify in the README and in `initctl help` that the GW event to listen for in service declarations is `GW:UP` ### Fixes * Build fixes for `configure --disable-inetd` * Fixed issue #14: Improved support for static Finit builds * Misc. fixes to silence warnings when building a static Finit * Default to register services as `SIGHUP`'able, regression in v2.0 * Call `HOOK_SVC_RECONF` only when all processes have been stopped * On reload/reconf we must wait for all services to stop first * Only trigger on events that matches the service's specification, fix by Tobias Waldekranz [2.1][] - 2015-10-16 -------------------- ### Changes * Add hook point for fstab mount failure * Set hostname on dynamic reload * Upgrade to libite v1.1.1 ### Fixes * Fix service callback coredump checks and simplify callback exit * Do not use `-Os` use `-O2` as default optimization level. Many cross compiler toolchains are known to have problems with `-Os` * Do not allow build VERSION to be overloaded by an environment variable * Fix too small MAX arguments and too few arguments in `svc_t` for reading currently running services with `initctl show` * Unblock blocked signals after forking off a child [2.0][] - 2015-09-20 -------------------- Support for multiple instances and event based services, as well as the introduction of an `initctl` tool. **Note:** Incompatible change to syntax for custom `inetd` services, c.f. Finit v[1.12][]. ### Changes * The most notable change is the support for multiple instances. A must have when running multiple DHCP clients, OpenVPN tunnels, or anything that means using the same command only with different arguments. Now simply add a `:ID` after the `service` keyword, where `ID` is a unique instance number for that service. service :1 [2345] /sbin/httpd -f -h /http -p 80 -- Web server service :2 [2345] /sbin/httpd -f -h /http -p 8080 -- Old web server * Another noteworthy new feature is support for starting/stopping services on Netlink events: service :1 [2345] /sbin/dropbear -R -F -p 22 -- SSH daemon Here the first instance `:1` of the SSH daemon is declared to run in runlevels 2-5, but only if eth0 `IFUP:eth0` is up and a gateway `GW` is set. When the configuration changes, a new gateway is set, or if somehow a new `IFUP` event for eth0 is received, then dropbear is not SIGHUP'ed, but instead stop-started ``. The latter trick applies to all services, even those that do not define any events. * Support for reloading `*.conf` files in `/etc/finit.d/` on SIGHUP. All `task`, `service` and `run` statements can be used in these .conf files. Use the `telinit q` command, `initctl reload` or simply send `SIGHUP` to PID 1 to reload them. Finit automatically does reload of these `*.conf` files when changing runlevel. * Support for a modern `initctl` tool which can stop/start/reload and list status of all system services. Also, the old client tool used to change runlevel is now also available as a symlink: `telinit`. initctl [-v] [JOB] * Add concept of "jobs". This is a unique identifier, composed of a service and instance number, `SVC:ID` initctl JOB * Support for *deny filters* in `inetd` services. inetd service/proto[@iface,!iface,...] Internal services on a custom port must use the `internal.service` syntax so Finit can properly bind the inetd service to the correct plugin. Here follows a few examples: inetd time/udp wait [2345] internal -- UNIX rdate service inetd time/tcp nowait [2345] internal -- UNIX rdate service inetd 3737/tcp nowait [2345] internal.time -- UNIX rdate service inetd telnet/tcp@*,!eth1,!eth0, nowait [2345] /sbin/telnetd -i -F -- Telnet service inetd 2323/tcp@eth1,eth2,eth0 nowait [2345] /sbin/telnetd -i -F -- Telnet service inetd 222/tcp@eth0 nowait [2345] /sbin/dropbear -i -R -F -- SSH service inetd ssh/tcp@*,!eth0 nowait [2345] /sbin/dropbear -i -R -F -- SSH service Access to telnet on port `2323` is only possible from interfaces `eth0`, `eth1` and `eth2`. The standard telnet port (`23`) is available from all other interfaces, but also `eth2`. The `*` notation used in the ssh stanza means *any* interface, however, here `eth0` is not allowed. **NOTE:** This change breaks syntax compatibility with Finit v[1.12]. * Support for a more user-friendly configure script rather than editing the top Makefile, or setting environment variables at build time. * Support for building Finit statically, no external libraries. This unfortunately means that some plugins cannot be built, at all. Big thanks goes to James Mills for all help testing this out! * Support for disabling the built-in inetd server with `configure`. * Support for two new hook points: `HOOK_SVC_RECONF` and `HOOK_RUNLEVEL_CHANGE`. See the source for the exact location. * The `include ` option now needs an absolute path to `FILE`. ### Fixes * Rename `patches/` to `contrib/` to simplify integration in 3rd party build systems. * Fix for unwanted zombies ... when receiving SIGCHLD we must reap *all* children. We only receive one signal, but multiple processes may have exited and need to be collected. [1.12][] - 2015-03-04 --------------------- The inetd release. ### Changes * Add support for built-in inetd super server -- launch services on demand. Supports filtering per interface and custom Inet ports. * Upgrade to [libuEv][] v1.1.0 to better handle error conditions. * Allow mixed case config directives in `finit.conf` * Add support for RFC 868 (rdate) time plugin, start as inetd service. * Load plugins before parsing `finit.conf`, this makes it possible to extend finit even with configuration commands. E.g., the `time.so` plugin must be loaded for the `inetd time/tcp internal` service to be accepted when parsing `finit.conf`. * Slight change in TTY fallback behavior, if no TTY is listed in the system `finit.conf` first inspect the `console` setting and only if that too is unset fall back to `/bin/sh` * When falling back to the `console` TTY or `/bin/sh`, finit now marks this fallback as console. Should improve usability in some use cases. ### Fixes * Revert "Use vfork() instead of fork() before exec()" from v1.11. It turned out to not work so well after all. For instance, launching TTYs in a background process completely blocked inetd services from even starting up listening sockets ... proper fork seems to work fine though. This is the cause for *yanking* the [1.11] release, below. * Trap segfaults caused by external plugins/callbacks in a sub-process. This prevents a single programming mistake in by a 3rd party developer from taking down the entire system. * Fix Coverity CID 56281: dlopen() resource leak by storing the pointer. For the time being we do not support unloading plugins. * Set hostname early, so bootstrap processes like syslog can use it. * Only restart *lost daemons* when recovering from a SIGSTOP/norespawn. [1.11][] - 2015-01-24 [YANKED] ------------------------------ The [libuEv][] release. **Note:** This release has been *yanked* from distribution due to a regression in launching background processes and TTY's. Fixed in Finit v[1.12]. ### Changes * Now using the asynchronous libuEv library for handling all events: signals, timers and listening to sockets or file descriptors. * Rename NEWS.md --> CHANGELOG.md, with symlinks for `make install` * Attempt to align with http://keepachangelog.com/ for this file. * Travis CI now only invokes Coverity Scan from the 'dev' branch. This means that all development, except documentation updates, must go into that branch. ### Fixes * Fix bug with finit dying when no `tty` is defined in `finit.conf`, now even the fallback shell has control over its TTY, see fix in GIT commit [dea3ae8] for this. [1.10][] - 2014-11-27 --------------------- Major bug fix release. ### Changes * Project now relies on static code analysis from Coverity, so this release contains many serious bug fixes. * Convert to use Markdown for README, NEWS and TODO. * Serious update to README and slight pruning of finished TODO items. ### Fixes * Fix serious file descriptor and memory leaks in the following functions. In particular the leaks in `run_interactive()` are very serious since that function is called every time a service is started and/or restarted! For details, see the GIT log: * `helpers.c:run()` * `helpers.c:run_interactive()` * `helpers.c:set_hostname()` * `helpers.c:procname_kill()` * `svc.c:svc_start()`: Fix swapped arguments to dup2() and add close(fd) to prevent descriptor leak. * `svc.c:svc_start()`: Fix out of bounds write to local stack variable, wrote off-by-one outside array. * Several added checks for return values to `mknod()`, `mkdir()`, `remove()`, etc. [1.9][] - 2014-04-21 -------------------- ### Changes * Add support for an include directive to `.conf` files * Fallback to `/bin/sh` if user forgets tty setting * Initial support for restarting lost services during `norespwan` ### Fixes * Bug fixes, code cleanup * Handle `SIGHUP` from service callback properly when switching runlevel * Misc. major (memleak) and minor fixes and additions to `libite/lite.h` [1.8][] - 2013-06-07 -------------------- ### Changes * Support for runlevels, with a bootstrap runlevel 'S' * Support for saving previous and current runlevel to UTMP * Support for new `finit.conf` commands: run, task, and runlevel * Support for tty and console commands in `finit.conf`, like services but for launching multiple getty logins * New tty plugin to monitor TTYs coming and going, like USB TTYs ### Fixes * Bugfixes to libite [1.7][] - 2012-10-08 -------------------- ### Changes * Show `__FILE__` in `_d()` debug messages, useful for plugins with similarly named callbacks. Also, only in debug mode anyway * Make sure to cleanup recorded PID when a service is lost. Required by service plugins for their callbacks to work. * Only clear screen when in verbose mode. Maybe this should be removed altogether? ### Fixes * Bugfix: Do not `free()` static string in `finit.conf` parser [1.6][] - 2012-10-06 -------------------- ### Changes * Skip `.` and `..` in plugin loader and display error when failing to load plugins * Support for overriding `/etc/finit.d` with `runparts DIR` in `finit.conf` * Revoke support for starting services not starting with a slash. * Prevent endless restart of non-existing services in `finit.conf` * Support for sysvinit style startstop scripts in `/etc/finit.d` ### Fixes * Minor fix to alsa-utils plugin to silence on non-existing cards [1.5][] - 2012-10-03 -------------------- ### Changes * Use bootmisc plugin to setup standard FHS 2.3 structure in `/var` * Added `FLOG_WARN()` syslog macro, for plugins * Add plugin dependency resolver. Checks `plugin_t` for `.depends` [1.4][] - 2012-10-02 -------------------- ### Changes * Start refactoring helpers.c into a libite.so (-lite). This means other user space applications/daemons can make use of the neat toolbox available in finit * Use short-form -s/-w -u to work with BusyBox hwclock as well * Use RTLD_GLOBAL flag to tell dynamic loader to load dependent .so files as well. Lets other plugins use global symbols. * Greatly simplify svc hook for external plugins and cleanup plugin API. * And more ... see the GIT log for more details. ### Fixes * Fix I/O plugin watcher and load plugins earlier for a new hook [1.3][] - 2012-09-28 -------------------- ### Changes * Cleanup public plugin API a bit and add new pid/pidfile funcs * Add plugin hook to end of service startup * Remove finit.h from svc.h, plugins should not need this. * Move utility macros etc. to helpers.h * Make `finit.h` daemon internal, only * Move defines of FIFO, conf and rcS.d to Makefile => correct paths * Add support for installing required headers in system include dir * Better support for distributions and packagers with install-exec, install-data, and install-dev targets in Makefile. Useful if you want to call targets with different `$DESTDIR`! * Makefile fixes for installation, paths encoded wrong * Strip binaries + .so files, support for `$(CROSS)` toolchain strip * Default install is now to `/sbin/finit` and `/usr/` * Note change in `$PLUGIN_DIR` environment variable to `$plugindir` [1.2][] - 2012-09-27 -------------------- ### Changes * Update README with section on building and environment variables ### Fixes * Fix installation paths encoded in finit binary [1.1][] - 2012-09-27 -------------------- ### Changes * Rename signal.[ch]-->sig.[ch] to avoid name clash w/ system headers ### Fixes * Build fixes for ARM eabi/uClibc [1.0][] - 2012-09-26 -------------------- ### Changes * New plugin based system for all odd extensions * New service monitor that restarts services if they die * New maintainer at GitHub http://github.com/troglobit/finit * Add standard LICENSE and AUTHORS files * New focus: embedded systems and small headless servers [0.6][] - 2010-06-14 -------------------- * Don't start consolekit manually, dbus starts it (rtp) * Unmount all filesystems before rebooting * Disable `USE_VAR_RUN_RESOLVCONF` for Mandriva * Unset terminal type in Mandriva before running X * Remove extra sleep in finit-alt before calling services.sh (caio) [0.5][] - 2008-08-21 -------------------- * Add option to start dbus and consolekit before the X server * finit-alt listens to `/dev/initctl` to work with `reboot(8)` (smurfy) * Write runlevel to utmp, needed by Printerdrake (Pascal Terjan) * Fix ownership of `/var/run/utmp` (reported by Pascal Terjan) * Remove obsolete code to load AGP drivers * Conditional build of `/etc/resolveconf/run` support * Add support to `/var/run/resolvconf` in Mandriva (blino) [0.4][] - 2008-05-16 -------------------- * Default username for finit-alt configurable in Makefile * Create loopback device node in finit-alt (for squashfs) * Add option to use built-in run-parts instead of `/bin/run-parts` * Ignore signal instead of setting to an empty handler (Metalshark) * Handle pam_console permissions in finit-alt for Mandriva * Add services.sh example and nash-hotplug patch for Mandriva * Mount `/proc/bus/usb` in Mandriva * Add runtime debug to finit-alt if finit_debug parameter is specified * Read configuration from `/etc/finit.conf` * Run getty with openvt on the virtual terminal [0.3][] - 2008-02-23 -------------------- * Change poweroff method to `reboot(RB_POWER_OFF)` (Metalshark) * Remove duplicate `unionctl()` reimplementation error * Fix string termination in path creation * Mount `/var/lock` and `/var/run` as tmpfs [0.2][] - 2008-02-19 -------------------- * Replace `system("touch")` with `touch()` in finit-mod (Metalshark) * Disable `NO_HCTOSYS` by default to match stock Eeepc kernel * Drop `system("rm -f")` to clean `/tmp`, its a fresh mounted tmpfs * Write ACPI sleep state to `/sys/power/state` instead of `/proc/acpi/sleep` (Metalshark) * Use direct calls to set loopback instead of `system("ifconfig")` * Replace `system("cat")` and `system("dd")` with C implementation * Moved finit-mod and finit-alt helpers to `helpers.c` * Replace `system("echo;cat")` to draw shutdown splash with C calls 0.1 - 2008-02-14 ---------------- * Initial release [UNRELEASED]: https://github.com/troglobit/finit/compare/4.12...HEAD [4.13]: https://github.com/troglobit/finit/compare/4.12...4.13 [4.12]: https://github.com/troglobit/finit/compare/4.11...4.12 [4.11]: https://github.com/troglobit/finit/compare/4.10...4.11 [4.10]: https://github.com/troglobit/finit/compare/4.9...4.10 [4.9]: https://github.com/troglobit/finit/compare/4.8...4.9 [4.8]: https://github.com/troglobit/finit/compare/4.7...4.8 [4.7]: https://github.com/troglobit/finit/compare/4.6...4.7 [4.6]: https://github.com/troglobit/finit/compare/4.5...4.6 [4.5]: https://github.com/troglobit/finit/compare/4.4...4.5 [4.4]: https://github.com/troglobit/finit/compare/4.3...4.4 [4.3]: https://github.com/troglobit/finit/compare/4.2...4.3 [4.2]: https://github.com/troglobit/finit/compare/4.1...4.2 [4.1]: https://github.com/troglobit/finit/compare/4.0...4.1 [4.0]: https://github.com/troglobit/finit/compare/3.1...4.0 [3.1]: https://github.com/troglobit/finit/compare/3.0...3.1 [3.0]: https://github.com/troglobit/finit/compare/2.4...3.0 [2.4]: https://github.com/troglobit/finit/compare/2.3...2.4 [2.3]: https://github.com/troglobit/finit/compare/2.2...2.3 [2.2]: https://github.com/troglobit/finit/compare/2.1...2.2 [2.1]: https://github.com/troglobit/finit/compare/2.0...2.1 [2.0]: https://github.com/troglobit/finit/compare/1.12...2.0 [1.12]: https://github.com/troglobit/finit/compare/1.11...1.12 [1.11]: https://github.com/troglobit/finit/compare/1.10...1.11 [1.10]: https://github.com/troglobit/finit/compare/1.9...1.10 [1.9]: https://github.com/troglobit/finit/compare/1.8...1.9 [1.8]: https://github.com/troglobit/finit/compare/1.7...1.8 [1.7]: https://github.com/troglobit/finit/compare/1.6...1.7 [1.6]: https://github.com/troglobit/finit/compare/1.5...1.6 [1.5]: https://github.com/troglobit/finit/compare/1.4...1.5 [1.4]: https://github.com/troglobit/finit/compare/1.3...1.4 [1.3]: https://github.com/troglobit/finit/compare/1.2...1.3 [1.2]: https://github.com/troglobit/finit/compare/1.1...1.2 [1.1]: https://github.com/troglobit/finit/compare/1.0...1.1 [1.0]: https://github.com/troglobit/finit/compare/0.9...1.0 [0.9]: https://github.com/troglobit/finit/compare/0.8...0.9 [0.8]: https://github.com/troglobit/finit/compare/0.7...0.8 [0.7]: https://github.com/troglobit/finit/compare/0.6...0.7 [0.6]: https://github.com/troglobit/finit/compare/0.5...0.6 [0.5]: https://github.com/troglobit/finit/compare/0.4...0.5 [0.4]: https://github.com/troglobit/finit/compare/0.3...0.4 [0.3]: https://github.com/troglobit/finit/compare/0.2...0.3 [0.2]: https://github.com/troglobit/finit/compare/0.1...0.2 [libuEv]: https://github.com/troglobit/libuev [dea3ae8]: https://github.com/troglobit/finit/commit/dea3ae8 finit-4.14/doc/features.md0000644000175100001660000001401215054341541011142 Finit Features ============== **Process Supervision** Start, monitor and restart services should they fail. **Getty** Finit supports external getty but also comes with a limited built-in Getty, useful for really small systems. A getty sets up the TTY and waits for user input before handing over to `/bin/login`, which is responsible for handling the actual authentication. ```conf tty [12345] /dev/tty1 nowait linux tty [12345] /dev/ttyAMA0 noclear vt100 tty [12345] /sbin/getty -L /dev/ttyAMA0 vt100 ``` Users of embedded systems may want to enable automatic serial console with the special `@console` device. This works regardless whether the system uses `ttyS0`, `ttyAMA0`, `ttyMXC0`, or anything else. Finit figures it out by querying sysfs: `/sys/class/tty/console/active`. ```conf tty [12345] @console linux noclear ``` Notice the optional `noclear`, `nowait`, and `nologin` flags. The latter is for skipping the login process entirely. For more information, see the [TTY and Consoles](config/tty.md) section. **Runlevels** Support for SysV init-style [runlevels][5] is available, in the same minimal style as everything else in Finit. The `[2345]` syntax can be applied to service, task, run, and TTY stanzas. Reserved runlevels are 0 and 6, halt and reboot, respectively just like SysV init. Runlevel 1 can be configured freely, but is recommended to be kept as the system single-user runlevel since Finit will not start networking here. The configured `runlevel NUM` from `/etc/finit.conf` is what Finit changes to after bootstrap, unless 'single' (or 'S') is given on the kernel cmdline, in which case runlevel 1 is started. All services in runlevel S) are started first, followed by the desired run-time runlevel. Run tasks in runlevel S can be started in sequence by using `run [S] cmd`. Changing runlevels at runtime is done like any other init, e.g. init 4, but also using the more advanced [`initctl`](initctl.md) tool. **Conditions** As mentioned previously, Finit has an advanced dependency system to handle synchronization, called [conditions](conditions.md). It can be used in many ways; depend on another service, network availability, etc. One *really cool* example useful for embedded systems is to run certain scripts if a board has a certain feature encoded in its device tree. At bootstrap we run the following `ident` script: ```sh #!/bin/sh conddir=/var/run/finit/cond/hw/model dtmodel=/sys/firmware/devicetree/base/model if ! test -e $dtmodel; then exit 0 fi model=$(cat $dtmodel | tr "[A-Z] " "[a-z]-") mkdir -p $conddir && ln -s ../../reconf $conddir/$model ``` Provided the device tree node exists, and is a string, we can then use the condition `` when starting other scripts. Here is an example: ``` run [S] /path/to/ident -- task [2] /path/to/foo-init -- Initializing Foo board ``` > [!TIP] > Notice the trick with an empty description to hide the call to `ident` > in the Finit progress output. **Plugins** Plugins can *extend* the functionality of Finit and *hook into* the different stages of the boot process and at runtime. Plugins are written in C and compiled into a dynamic library loaded automatically by finit at boot. A basic set of plugins are bundled in the `plugins/` directory. Capabilities: - **Hooks** Hook into the boot at predefined points to extend Finit - **I/O** Listen to external events and control Finit behavior/services Extensions and functionality not purely related to what an `/sbin/init` needs to start a system are available as a set of plugins that either hook into the boot process or respond to various I/O. For more information, see the [Plugins](plugins.md) section. **Automatic Reload** By default, Finit monitors `/etc/finit.d/` and `/etc/finit.d/enabled/` registering any changes to `.conf` files. To activate a change the user must call `initctl reload`, which reloads all modified files, stops any removed services, starts new ones, and restarts any modified ones. If the command line arguments of a service have changed, the process will be terminated and then started again with the updated arguments. If the arguments have not been modified and the process supports SIGHUP, the process will receive a SIGHUP rather than being terminated and started. For some use-cases the extra step of calling `initctl reload` creates an unnecessary overhead, which can be removed at build-time using: configure --enable-auto-reload **Cgroups** Finit supports cgroups v2 and comes with the following default groups in which services and user sessions are placed in: /sys/fs/cgroup |-- init/ # cpu.weight:100 |-- system/ # cpu.weight:9800 `-- user/ # cpu.weight:100 Finit itself and its helper scripts and services are placed in the top-level leaf-node group `init/`, which also is _reserved_. All run/task/service/sysv processes are placed in their own sub-group in `system/`. The name of each sub-group is taken from the respective `.conf` file from `/etc/finit.d`. All getty/tty processes are placed in their own sub-group in `user/`. The name of each sub-group is taken from the username. A fourth group also exists, the `root` group. It is also _reserved_ and primarily intended for RT tasks. If you have RT tasks they need to be declared as such in their service stanza like this: service [...] <...> cgroup.root /path/to/foo args -- description or cgroup.root service [...] <...> /path/to/foo args -- description service [...] <...> /path/to/bar args -- description See the [Cgroups](config/cgroups.md) section for more information, e.g., how to configure per-group limits. The `initctl` tool has three commands to help debug and optimize the setup and monitoring of cgroups. See the `ps`, `top`, and `cgroup` commands for details. > [!NOTE] > Systems that do not support cgroups, specifically version 2, are > automatically detected. On such systems the above functionality is > disabled early at boot. [5]: https://en.wikipedia.org/wiki/Runlevel finit-4.14/doc/Makefile.am0000644000175100001660000000071015054341541011036 SUBDIRS = config EXTRA_DIST = AUTHORS ChangeLog.md docsdir := @docdir@/doc dist_docs_DATA = build.md cmdline.md commands.md conditions.md \ distro.md example.md features.md index.md initctl.md \ keventd.md plugins.md requirements.md runlevels.md \ runparts.md service.md signals.md state-machine.md \ watchdog.md dist_docs_DATA += img/logo.png img/svc-machine.png img/svc-machine.svg \ img/alpine-screenshot2.png finit-4.14/doc/commands.md0000644000175100001660000000111615054341541011126 Rebooting & Halting =================== Traditionally, rebooting and halting a UNIX system is done by switching to the corresponding runlevel (0 or 6). Over time this has changed and Finit comes with its own tooling providing: `shutdown`, `reboot`, `poweroff`, and `suspend`. These commands are also available from the [`initctl`](initctl.md) tool. For compatibility reasons Finit listens to the same set of signals as BusyBox init. This is not 100% compatible with SysV init, but clearly the more common combination for Finit. For more details, see the [Signal](signals.md) section. finit-4.14/doc/requirements.md0000644000175100001660000000207115054341541012051 Requirements ============ Finit is capable of running on both desktop/server systems with udev and embedded systems that usually come with BusyBox mdev. Some systems have systemd-udev or eudev today instead of the original udev, Finit probes for all of them at runtime and expects `/dev/` to be a writable file system using `devtmpfs`. It is also possible to run on a statically set up `/dev` if needed. It is however not a good idea to have both udev and mdev installed at the same time, this will lead to unpredictable results. At boot Finit calls either `mdev` or `udevd` to populate `/dev`, this is done slightly differently and on systems with udev you might want to add the following one-shot task early in your `/etc/finit.conf`: ```conf run [S] udevadm settle --timeout=120 -- Waiting for udev ``` Finit has a built-in Getty for TTYs, but requires a working `/bin/login` or `/bin/sh`, if no TTYs are configured in `/etc/finit.conf`. For a fully operational system `/var`, `/run` and `/tmp` must be set up properly in `/etc/fstab` -- which is iterated over at boot. finit-4.14/tmpfiles.d/0000755000175100001660000000000015054341601010361 5finit-4.14/tmpfiles.d/legacy.conf0000644000175100001660000000041315054341541012415 d /run/lock 0755 root root - L /var/lock - - - - ../run/lock d /run/lock/subsys 0755 root root - L /run/shm - - - - ../dev/shm # These are not supported by Finit, see command line options r! /forcefsck r! /fastboot r! /forcequotacheck finit-4.14/tmpfiles.d/lldpd.conf0000644000175100001660000000003415054341541012247 d /var/run/lldpd 0755 - - - finit-4.14/tmpfiles.d/sshd.conf0000644000175100001660000000003415054341541012111 d /var/run/sshd 01755 - - - finit-4.14/tmpfiles.d/etc.conf0000644000175100001660000000034615054341541011731 L /etc/os-release - - - - ../usr/lib/os-release L+ /etc/mtab - - - - ../proc/self/mounts C! /etc/locale.conf - - - - C! /etc/nsswitch.conf - - - - C! /etc/vconsole.conf - - - - C! /etc/pam.d - - - - C! /etc/issue - - - - finit-4.14/tmpfiles.d/var.conf0000644000175100001660000000233015054341541011741 # Standard FHS 2.3 structure in /var and /var/run, err /run d /var/cache 0755 - - - d /var/db 0755 - - - d /var/games 0755 - - - d /var/lib 0755 - - - d /var/lib/alarm 0755 - - - d /var/lib/misc 0755 - - - d /var/lib/urandom 0755 - - - d /var/spool 0755 - - - d /var/tmp 0777 - - - # Used by pam_console(8) d /run/console 1777 - - - f /run/console/nobody 0644 - - - f /run/console/console.lock 0644 - - - nobody # /run/lock/subsys is used for serializing SysV service execution d /run/lock 0777 - - - d /run/lock/subsys 0755 - - - # Compat symlink to new /run ramdisk L /var/run - - - - ../run L /var/lock - - - - ../run/lock # Needed by Debian/Ubuntu ifupdown d /var/run/network 0755 - - - # Debian has /run/sudo, ensure correct perms and SELinux label d /run/sudo 0711 root root d /run/sudo/ts 0700 root root Z /run/sudo - - - - d /var/empty 0755 - - - d /var/log 0755 - - - d /var/mail 0755 - - - d /var/opt 0755 - - - d /var/spool 0755 - - - d /var/spool/cron 0755 - - - # UTMP actually needs multiple db files f /var/run/utmp 0664 root utmp - f /var/log/wtmp 0664 root utmp - f /var/log/btmp 0660 root utmp - f /var/log/lastlog 0664 root utmp - finit-4.14/tmpfiles.d/testserv.conf0000644000175100001660000000024215054341541013030 # Test service, only used for `make check`, not for public use d /var/run/serv 0755 - - - d /var/lib/serv 0755 - - - d /tmp/serv 0755 - - - r /run/serv.pid finit-4.14/tmpfiles.d/quagga.conf0000644000175100001660000000011615054341541012416 d /var/run/quagga 0755 quagga quagga - d /var/log/quagga 0755 quagga quagga - finit-4.14/tmpfiles.d/openswan.conf0000644000175100001660000000003415054341541013002 d /var/run/pluto 0755 - - - finit-4.14/tmpfiles.d/finit.conf0000644000175100001660000000074715054341541012274 # Finit expects to run on a Linux FHS compatible system. # Preferably one where /run is used and is a RAM disk. # This should be set up but OS/dist but is sometimes missing # Note: l+ == only if ../run exists, if so, rm -rf /var/run l+ /var/run - - - - ../run # Finit directories d /run/finit 0755 - - - d /run/finit/cond 0755 - - - d /run/finit/cond/pid 0755 - - - d /run/finit/cond/sys 0755 - - - d /run/finit/cond/usr 0755 - - - d /run/finit/system 0755 - - - finit-4.14/tmpfiles.d/Makefile.in0000644000175100001660000004012715054341567012365 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @BUILD_TESTSERV_PLUGIN_TRUE@am__append_1 = testserv.conf @BUILD_X11_COMMON_PLUGIN_TRUE@am__append_2 = x11.conf subdir = tmpfiles.d ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_finit_DATA) \ $(am__dist_tmpfiles_DATA_DIST) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(finitdir)" "$(DESTDIR)$(tmpfilesdir)" am__dist_tmpfiles_DATA_DIST = etc.conf legacy.conf var.conf \ dnsmasq.conf frr.conf lldpd.conf openswan.conf quagga.conf \ sshd.conf uuidd.conf testserv.conf x11.conf DATA = $(dist_finit_DATA) $(dist_tmpfiles_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ finitdir = $(finit_tmpfiles) dist_finit_DATA = finit.conf tmpfilesdir = $(tmpfiles_path) dist_tmpfiles_DATA = etc.conf legacy.conf var.conf dnsmasq.conf \ frr.conf lldpd.conf openswan.conf quagga.conf sshd.conf \ uuidd.conf $(am__append_1) $(am__append_2) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tmpfiles.d/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tmpfiles.d/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_finitDATA: $(dist_finit_DATA) @$(NORMAL_INSTALL) @list='$(dist_finit_DATA)'; test -n "$(finitdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(finitdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(finitdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(finitdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(finitdir)" || exit $$?; \ done uninstall-dist_finitDATA: @$(NORMAL_UNINSTALL) @list='$(dist_finit_DATA)'; test -n "$(finitdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(finitdir)'; $(am__uninstall_files_from_dir) install-dist_tmpfilesDATA: $(dist_tmpfiles_DATA) @$(NORMAL_INSTALL) @list='$(dist_tmpfiles_DATA)'; test -n "$(tmpfilesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(tmpfilesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(tmpfilesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(tmpfilesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(tmpfilesdir)" || exit $$?; \ done uninstall-dist_tmpfilesDATA: @$(NORMAL_UNINSTALL) @list='$(dist_tmpfiles_DATA)'; test -n "$(tmpfilesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(tmpfilesdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(finitdir)" "$(DESTDIR)$(tmpfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_finitDATA install-dist_tmpfilesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_finitDATA uninstall-dist_tmpfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_finitDATA install-dist_tmpfilesDATA 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-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-dist_finitDATA \ uninstall-dist_tmpfilesDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/tmpfiles.d/uuidd.conf0000644000175100001660000000006515054341541012266 # Void Linux uuidd d /var/run/uuidd 0755 uuidd uuidd finit-4.14/tmpfiles.d/dnsmasq.conf0000644000175100001660000000005015054341541012614 d /var/run/dnsmasq 0755 nobody nobody - finit-4.14/tmpfiles.d/frr.conf0000644000175100001660000000007415054341541011745 d /var/run/frr 0755 frr frr - d /var/log/frr 0755 frr frr - finit-4.14/tmpfiles.d/Makefile.am0000644000175100001660000000064315054341541012343 finitdir = $(finit_tmpfiles) dist_finit_DATA = finit.conf tmpfilesdir = $(tmpfiles_path) dist_tmpfiles_DATA = etc.conf legacy.conf var.conf dist_tmpfiles_DATA += dnsmasq.conf frr.conf lldpd.conf openswan.conf \ quagga.conf sshd.conf uuidd.conf if BUILD_TESTSERV_PLUGIN dist_tmpfiles_DATA += testserv.conf endif if BUILD_X11_COMMON_PLUGIN dist_tmpfiles_DATA += x11.conf endif finit-4.14/tmpfiles.d/x11.conf0000644000175100001660000000035115054341541011563 D! /tmp/.X11-unix 1777 root root D! /tmp/.ICE-unix 1777 root root D! /tmp/.XIM-unix 1777 root root D! /tmp/.font-unix 1777 root root z /tmp/.X11-unix z /tmp/.ICE-unix z /tmp/.XIM-unix z /tmp/.font-unix r! /tmp/.X[0-9]*-lock finit-4.14/src/0000755000175100001660000000000015054341601007103 5finit-4.14/src/private.h0000644000175100001660000000453615054341541010661 /* Private header file for main finit daemon, not for plugins * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_PRIVATE_H_ #define FINIT_PRIVATE_H_ #include "svc.h" #include "plugin.h" #define SERVICE_INTERVAL_DEFAULT 300000 /* 5 mins */ #define MATCH_CMD(l, c, x) \ (!strncasecmp(l, c, strlen(c)) && (x = (l) + strlen(c))) #define IS_RESERVED_RUNLEVEL(l) (l == 0 || l == 6 || l == INIT_LEVEL) extern char *finit_conf; extern char *finit_rcsd; extern svc_t *wdog; extern int service_interval; extern char *fsck_mode; extern char *fsck_repair; extern uev_ctx_t *ctx; int api_init (uev_ctx_t *ctx); int api_exit (void); void conf_flush_events(void); void service_monitor (pid_t lost, int status); const char *plugin_hook_str (hook_point_t no); int plugin_exists (hook_point_t no); void plugin_run_hook (hook_point_t no, void *arg); void plugin_run_hooks (hook_point_t no); void plugin_script_run(hook_point_t no); int plugin_init (uev_ctx_t *ctx); void plugin_exit (void); #endif /* FINIT_PRIVATE_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/finit.c0000644000175100001660000004337715054341541010321 /* Finit - Fast /sbin/init replacement w/ I/O, hook & service plugins * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include #ifdef HAVE_MNTENT_H #include #endif #include /* tzet() */ #include #include #include /* umask(), mkdir() */ #include #ifdef HAVE_SYS_SYSMACROS_H #include #endif #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "cgroup.h" #include "cond.h" #include "conf.h" #include "devmon.h" #include "helpers.h" #include "private.h" #include "plugin.h" #include "service.h" #include "sig.h" #include "sm.h" #include "tty.h" #include "util.h" #include "utmp-api.h" uev_ctx_t *ctx = NULL; /* Main loop context */ svc_t *wdog = NULL; /* No watchdog by default */ /* * Show user configured banner before service bootstrap progress */ static void banner(void) { #ifndef KERNEL_LOGGING /* * Silence kernel logs, assuming users have sysklogd or * similar enabled to start emptying /dev/kmsg. * * Instead of using `configure --disable-kernel-logging`, we * recommend adjusting the kernel log level in the kernel's * menuconfig, or using sysctl kernel.printk, or setting the * desired log level, on the kernel cmdline, e.g. 'quiet'. * * By default KERNEL_LOGGING is enabled so you can see any * warnings/errors or higher on your system console. */ if (!debug && !kerndebug) klogctl(6, NULL, 0); #endif /* * First level hooks, if you want to run here, you're * pretty much on your own. Nothing's up yet ... */ plugin_run_hooks(HOOK_BANNER); #ifdef INIT_OSHEADING osheading = INIT_OSHEADING; if (osheading) { if (!osheading[0]) osheading = release_heading(); print_banner(osheading); } #endif } static int sulogin(int do_reboot) { int rc = EX_OSFILE; char *cmd[] = { "sulogin", _PATH_SULOGIN, }; size_t i; for (i = 0; i < NELEMS(cmd); i++) { char *path = which(cmd[i]); if (!path) continue; if (access(path, X_OK)) { free(path); continue; } rc = systemf("%s", path); free(path); break; } if (do_reboot) { do_shutdown(SHUT_REBOOT); exit(rc); } return rc; } char *fs_root_dev(char *real, size_t len) { struct dirent *d; struct stat st; int found = 0; dev_t dev; DIR *dir; if (stat("/", &st)) return NULL; if (S_ISBLK(st.st_mode)) dev = st.st_rdev; else dev = st.st_dev; dir = opendir("/sys/block"); if (!dir) return NULL; while ((d = readdir(dir))) { char buf[10]; char *ptr; if (fnread(buf, sizeof(buf), "/sys/block/%s/dev", d->d_name) == -1) continue; ptr = strchr(buf, ':'); if (!ptr) continue; *ptr++ = 0; if (atoi(buf) == (int)major(dev) && atoi(ptr) == (int)minor(dev)) { /* Guess name, assume no renaming */ snprintf(real, len, "/dev/%s", d->d_name); found = 1; break; } } closedir(dir); if (!found) return NULL; return real; } /* * Check all filesystems in /etc/fstab with a fs_passno > 0 */ static int fsck(int pass) { struct mntent mount; struct mntent *mnt; char real[192]; char buf[256]; int rc = 0; FILE *fp; fp = setmntent(fstab, "r"); if (!fp) { logit(LOG_CONSOLE | LOG_ALERT, "Failed opening fstab: %s", fstab); sulogin(1); } dbg("Opened %s, pass %d", fstab, pass); while ((mnt = getmntent_r(fp, &mount, buf, sizeof(buf)))) { int fsck_rc = 0; struct stat st; char cmd[256]; char *dev; dbg("got: fsname '%s' dir '%s' type '%s' opts '%s' freq '%d' passno '%d'", mnt->mnt_fsname, mnt->mnt_dir, mnt->mnt_type, mnt->mnt_opts, mnt->mnt_freq, mnt->mnt_passno); if (mnt->mnt_passno == 0 || mnt->mnt_passno != pass) continue; /* Device to maybe fsck, */ dev = mnt->mnt_fsname; errno = 0; if (stat(dev, &st) || !S_ISBLK(st.st_mode)) { int skip = 1; if (string_match(dev, "UUID=") || string_match(dev, "LABEL=")) skip = 0; /* * Kernel short form for root= device, figure out * actual device since we cannot rely on symlinks * https://bugs.busybox.net/show_bug.cgi?id=8891 */ else if (string_compare(dev, "/dev/root")) { if (fs_root_dev(real, sizeof(real))) { dev = real; skip = 0; } } if (skip) { dbg("Cannot fsck %s, not a block device: %s", dev, strerror(errno)); continue; } } if (ismnt("/proc/mounts", mnt->mnt_dir, "rw")) { dbg("Skipping fsck of %s, already mounted rw on %s.", dev, mnt->mnt_dir); continue; } snprintf(cmd, sizeof(cmd), "fsck %s %s %s", fsck_mode, fsck_repair, dev); dbg("Running pass %d fsck command %s", pass, cmd); fsck_rc = run_interactive(cmd, "Checking filesystem %s", dev); /* * "failure" is defined as exiting with a return code of * 2 or larger. A return code of 1 indicates that filesystem * errors were corrected but that the boot may proceed. */ if (fsck_rc > 1) { if (hasmntopt(mnt,"nofail")) { logit(LOG_CONSOLE | LOG_WARNING, "Ignoring failed fsck %s because of nofail option", dev); fsck_rc = 0; } else { logit(LOG_CONSOLE | LOG_ALERT, "Failed fsck %s, attempting sulogin ...", dev); sulogin(1); } } rc |= fsck_rc; } endmntent(fp); return rc; } static int fsck_all(void) { int rc = 0; int pass; if (!fsck_mode) return 0; for (pass = 1; pass < 10; pass++) { rc = fsck(pass); if (rc) break; } return rc; } /* Wrapper for mount(2), logs any errors to stderr */ static void fs_mount(const char *src, const char *tgt, const char *fstype, unsigned long flags, const void *data) { const char *msg = !fstype ? "MS_MOVE" : "mounting"; int rc; rc = mount(src, tgt, fstype, flags, data); if (rc && errno != EBUSY) err(1, "Failed %s %s on %s", msg, src, tgt); } #ifndef SYSROOT static void fs_remount_root(int fsckerr) { struct mntent *mnt; FILE *fp; fp = setmntent(fstab, "r"); if (!fp) return; while ((mnt = getmntent(fp))) { if (!strcmp(mnt->mnt_dir, "/")) break; } /* If / is not listed in fstab, or listed as 'ro', leave it alone */ if (!mnt || hasmntopt(mnt, "ro")) goto out; if (fsckerr) print(1, "Cannot remount / as read-write, fsck failed before"); else run_interactive("mount -n -o remount,rw /", "Remounting / as read-write"); out: endmntent(fp); } #else static void fs_remount_root(int fsckerr) { /* * XXX: Untested, in the initramfs age we should * probably use switch_root instead. */ fs_mount(SYSROOT, "/", NULL, MS_MOVE, NULL); } #endif /* SYSROOT */ /* * Opinionated file system setup. Checks for critical mount points and * mounts them as most users expect. All file systems are checked with * /proc/mounts before mounting. * * Embedded systems, and other people who want full control, can set up * their system with /etc/fstab, which is handled before this function * is called. For systems like Debian/Ubuntu, who only have / and swap * in their /etc/fstab, this function does all the magic necessary. */ static void fs_finalize(void) { int flags = MS_NOEXEC | MS_NOSUID; /* * Some systems rely on us to both create /dev/shm and, to mount * a tmpfs there. Any system with dbus needs shared memory, so * mount it, unless its already mounted, but not if listed in * the /etc/fstab file already. */ if (!fismnt("/dev/shm")) { makedir("/dev/shm", 1777); fs_mount("shm", "/dev/shm", "tmpfs", flags | MS_NODEV, "mode=1777"); } /* Modern systems use /dev/pts */ if (!fismnt("/dev/pts")) { char opts[32]; int mode; int gid; gid = getgroup("tty"); if (gid == -1) gid = 0; /* 0600 is default on Debian, use 0620 to get mesg y by default */ mode = 0620; snprintf(opts, sizeof(opts), "gid=%d,mode=%d,ptmxmode=0666", gid, mode); makedir("/dev/pts", 0755); fs_mount("devpts", "/dev/pts", "devpts", flags, opts); } /* Needed on systems like Alpine Linux */ if (!fismnt("/dev/mqueue")) { makedir("/dev/mqueue", 1777); fs_mount("mqueue", "/dev/mqueue", "tmpfs", flags | MS_NODEV, NULL); } /* * Modern systems use tmpfs for /run. Fallback to /var/run if * /run doesn't exist is handled by the bootmisc plugin. It * also sets up compat symlinks. * * The unconditional mount of /run/lock is for DoS prevention. * To override any of this behavior, add entries to /etc/fstab * for /run (and optionally /run/lock). */ if (fisdir("/run") && !fismnt("/run") && !fistmpfs("/run")) { fs_mount("tmpfs", "/run", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_RELATIME, "mode=0755,size=10%"); /* This prevents user DoS of /run by filling /run/lock at the expense of another tmpfs, max 5MiB */ makedir("/run/lock", 1777); fs_mount("tmpfs", "/run/lock", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_RELATIME, "mode=0777,size=5252880"); } /* Modern systems use tmpfs for /tmp */ if (!fismnt("/tmp") && !fistmpfs("/tmp")) fs_mount("tmpfs", "/tmp", "tmpfs", MS_NOSUID | MS_NODEV, "mode=1777"); } static void fs_swapon(char *cmd, size_t len) { struct mntent *mnt; FILE *fp; if (!whichp("swapon")) return; fp = setmntent(fstab, "r"); if (!fp) return; while ((mnt = getmntent(fp))) { if (strcmp(mnt->mnt_type, MNTTYPE_SWAP)) continue; snprintf(cmd, len, "swapon %s", mnt->mnt_fsname); run_interactive(cmd, "Enabling swap %s", mnt->mnt_fsname); } endmntent(fp); } static void fs_mount_all(void) { char cmd[256] = "mount -na"; if (!fstab || !fexist(fstab)) { logit(LOG_CONSOLE | LOG_NOTICE, "%s system fstab %s, trying fallback ...", !fstab ? "Missing" : "Cannot find", fstab ?: "\b"); fstab = FINIT_FSTAB; } if (!fstab || !fexist(fstab)) { logit(LOG_CONSOLE | LOG_EMERG, "%s system fstab %s, attempting sulogin ...", !fstab ? "Missing" : "Cannot find", fstab ?: "\b"); sulogin(1); } /* * Needed by fsck, both BusyBox and util-linux support this. * We leave it set in the env. for the benefit of any mount * helpers and other system tools that the user expects to * behave even if we've booted with a different fstab. */ setenv("FSTAB_FILE", fstab, 1); if (!rescue) fs_remount_root(fsck_all()); dbg("Root FS up, calling hooks ..."); plugin_run_hooks(HOOK_ROOTFS_UP); if (fstab && strcmp(fstab, "/etc/fstab")) snprintf(cmd, sizeof(cmd), "mount -na -T %s", fstab); if (run_interactive(cmd, "Mounting filesystems from %s", fstab)) plugin_run_hooks(HOOK_MOUNT_ERROR); dbg("Calling extra mount hook, after mount -a ..."); plugin_run_hooks(HOOK_MOUNT_POST); dbg("Enable any swap ..."); fs_swapon(cmd, sizeof(cmd)); dbg("Finalize, ensure common file systems are available ..."); fs_finalize(); dbg("Base FS up, calling hooks ..."); plugin_run_hooks(HOOK_BASEFS_UP); } /* * We need /proc for rs_remount_root() and conf_parse_cmdline(), /dev * for early multi-console, and /sys for the cgroups support. Any * occurrence of these file systems in /etc/fstab will replace these * mounts later in fs_mount_all() * * Ignore any mount errors with EBUSY, kernel likely already mounted * the filesystem for us automatically, e.g., CONFIG_DEVTMPFS_MOUNT. */ static void fs_init(void) { struct { char *spec, *file, *type; } fs[] = { { "proc", "/proc", "proc" }, { "devtmpfs", "/dev", "devtmpfs" }, { "sysfs", "/sys", "sysfs" }, }; size_t i; /* mask writable bit for g and o */ umask(022); for (i = 0; i < NELEMS(fs); i++) { /* * Check if already mounted, we may be running in a * container, or an initramfs ran before us. The * function fismnt() reliles on /proc/mounts being * unique for each chroot/container. */ if (fismnt(fs[i].file)) continue; fs_mount(fs[i].spec, fs[i].file, fs[i].type, 0, NULL); } } static int version(int rc) { puts(PACKAGE_STRING); printf("Bug report address: %-40s\n", PACKAGE_BUGREPORT); #ifdef PACKAGE_URL printf("Project homepage: %s\n", PACKAGE_URL); #endif return rc; } static int usage(int rc) { printf("Usage: %s [OPTIONS] [q | Q | 0-9]\n\n" "Options:\n" // " -a Ignored, compat SysV init\n" // " -b Ignored, compat SysV init\n" // " -e arg Ignored, compat SysV init\n" " -h This help text\n" // " -s Ignored, compat SysV init\n" // " -t sec Ignored, compat SysV init\n" " -v Show Finit version\n" // " -z xxx Ignored, compat SysV init\n" "\n" "Commands:\n" " 0 Power-off the system, same as initctl poweroff\n" " 6 Reboot the system, same as initctl reboot\n" " 2-9 Change runlevel\n" " q, Q Reload /etc/finit.conf and/or any *.conf in /etc/finit.d/\n" " if modified, same as initctl reload or SIGHUP to PID 1\n" " 1, s, S Enter single user mode, no networking, runlevel 1\n" "\n", prognm); return rc; } /* * wrapper for old-style init/telinit commands, for compat with * /usr/bin/shutdown from sysvinit, and old fingers */ static int telinit(int argc, char *argv[]) { int c; progname(argv[0]); while ((c = getopt(argc, argv, "abe:h?st:vVz:")) != EOF) { switch(c) { case 'a': case 'b': case 'e': case 's': case 'z': break; /* ign, compat */ case 't': /* optarg == killdelay */ break; case 'v': case 'V': return version(0); case 'h': case '?': return usage(0); } } if (optind < argc) { int req = (int)argv[optind][0]; if (isdigit(req)) return systemf("initctl -b runlevel %c", req); if (req == 'q' || req == 'Q') return systemf("initctl -b reload"); if (req == 's' || req == 'S') return systemf("initctl -b runlevel %c", req); } return usage(1); } int main(int argc, char *argv[]) { uev_ctx_t loop; /* user calling telinit or init */ if (getpid() != 1) { if (geteuid() == 0) return telinit(argc, argv); /* * Issue #301: add non-pid1 process monitor here. * Default to read ~/.config/finit.conf with the * API socket in /run/user/$UID/. Lot of things * to refactor before then though. */ return EX_NOPERM; } /* * Need /dev, /proc, and /sys for console=, remount and cgroups */ fs_init(); /* * Parse /proc/cmdline (debug, rescue, console=, etc.) */ conf_parse_cmdline(argc, argv); /* * Clear command line arguments for ps display, issue #442 */ prctl(PR_SET_NAME, "init", 0, 0, 0); for (int i = 1; i < argc; i++) memset(argv[i], 0, strlen(argv[i])); /* * Figure out system console(s) and call log_init() to set * correct log level, possibly finit.debug enabled. */ console_init(); /* * Initialize event context. */ uev_init1(&loop, 1); ctx = &loop; /* * Set PATH, SHELL, and PWD early to something sane */ conf_reset_env(); if (chdir("/")) err(1, "Failed cd /"); /* * In case of emergency. */ #ifdef RESCUE_MODE if (rescue) rescue = sulogin(0); #endif /* * Load plugins early, the first hook is in banner(), so we * need plugins loaded before calling it. */ plugin_init(&loop); /* * Hello world. */ enable_progress(1); /* Allow progress, if enabled */ banner(); if (osheading) logit(LOG_CONSOLE | LOG_NOTICE, "%s, entering runlevel S", osheading); else logit(LOG_CONSOLE | LOG_NOTICE, "Entering runlevel S"); /* * Initial setup of signals, ignore all until we're up. */ sig_init(); /* * Initialize default control groups, if available */ cgroup_init(&loop); /* * Check custom fstab from cmdline, including fallback, then run * fsck before mounting all filesystems, on error call sulogin. */ fs_mount_all(); /* * Base FS up, enable standard SysV init signals and * Bootstrap conditions, needed for hooks */ sig_setup(&loop); cond_init(); /* * Emit conditions for early hooks that ran before the condition * system was initialized in case anyone. */ cond_set_oneshot(plugin_hook_str(HOOK_BANNER)); cond_set_oneshot(plugin_hook_str(HOOK_ROOTFS_UP)); /* Some bootstrap tasks may need to know if we're in a container. */ if (in_container()) cond_set_oneshot("int/container"); /* * Initialize .conf system and load static /etc/finit.conf then * tell the world what we used. */ devmon_init(&loop); conf_init(&loop); conf_saverc(); /* * Set up inotify watcher for /etc/finit.conf, /etc/finit.d, and * their deps, to figure out how to bootstrap the system. */ conf_monitor(); dbg("Starting initctl API responder ..."); api_init(&loop); dbg("Starting service interval monitor ..."); service_init(&loop); /* * Initialize state machine and start all bootstrap tasks * NOTE: no network available! */ sm_init(); sm_step(); /* * Enter main loop to monitor /dev/initctl and services */ dbg("Entering main loop ..."); return uev_run(&loop, 0); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/log.c0000644000175100001660000001217215054341541007756 /* Finit daemon log functions * * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #define SYSLOG_NAMES #include #include "finit.h" #include "helpers.h" #include "log.h" #include "util.h" static int up = 0; static int loglevel = LOG_INFO; void log_init(void) { if (debug) loglevel = LOG_DEBUG; else loglevel = LOG_INFO; } /* If we enabled terse mode at boot, restore to previous setting at shutdown */ void log_exit(void) { enable_progress(1); } static int log_open(void) { int opts; if (up) return 1; if (access("/dev/log", W_OK)) return 0; opts = LOG_CONS | LOG_PID; if (debug) opts |= LOG_PERROR; openlog("finit", opts, LOG_DAEMON); setlogmask(LOG_UPTO(loglevel)); return up = 1; } static void log_close(void) { closelog(); up = 0; } /* Toggle debug mode */ void log_debug(void) { debug = !debug; log_close(); log_init(); log_open(); logit(LOG_NOTICE, "Debug mode %s", debug ? "enabled" : "disabled"); } static const char *l2s(int prio) { int level = prio & ~LOG_CONSOLE; switch (level) { case LOG_ERR: return "ERR"; case LOG_WARNING: return "WRN"; case LOG_NOTICE: return "NOT"; case LOG_INFO: return "NFO"; case LOG_DEBUG: return "DBG"; default: break; } return "UNK"; } static int s2f(const char *str) { for (int i = 0; facilitynames[i].c_name; i++) { if (string_match(facilitynames[i].c_name, str)) return facilitynames[i].c_val; } return -1; } static int s2l(const char *str) { for (int i = 0; prioritynames[i].c_name; i++) { if (string_match(prioritynames[i].c_name, str)) return prioritynames[i].c_val; } return -1; } /* * Parse syslog facility.priority strings into their numerical values * using arrays defined in . Note, the 'prio' argument may * be one of: * * - facility.level * - facility * - level * * It is up to the callee to assign defaults to 'facility' and 'level' * before calling this function. If There is any match the respective * facility or level will be assigned and this function returns OK. */ int log_parse(char *prio, int *facility, int *level) { char *fac = prio, *lvl; int f = -1; int l = -1; if (!prio || !facility || !level) return -1; lvl = strchr(prio, '.'); if (lvl) { *lvl = 0; lvl++; } if (lvl && *lvl) l = s2l(lvl); f = s2f(fac); if (l < 0) l = s2l(fac); if (l < 0 && f <= 0) return -1; if (l <= LOG_DEBUG) *level = l; if (f <= LOG_LOCAL7) *facility = f; return 0; } /* * Log to /dev/kmsg until syslogd has started, then openlog() * and continue logging as a regular daemon. */ void logit(int prio, const char *fmt, ...) { va_list ap; FILE *fp; va_start(ap, fmt); if (up || log_open()) { vsyslog(prio, fmt, ap); goto done; } if (LOG_PRI(prio) > loglevel) goto done; if (in_container() || !(fp = fopen("/dev/kmsg", "w"))) { static char buf[512]; time_t now; size_t pos; now = time(NULL); pos = (int)strftime(buf, sizeof(buf), "%FT%T", localtime(&now)); pos += snprintf(&buf[pos], sizeof(buf) - pos, " [%s]: ", l2s(prio)); vsnprintf(&buf[pos], sizeof(buf) - pos, fmt, ap); strlcat(buf, "\n", sizeof(buf)); fputs(buf, stderr); goto done; } fprintf(fp, "<%d>finit[1]: ", LOG_DAEMON | prio); vfprintf(fp, fmt, ap); fclose(fp); if (debug) { va_end(ap); va_start(ap, fmt); vfprintf(stderr, fmt, ap); fputs("\n", stderr); } done: va_end(ap); } /* * Log to file, intended for debug only. */ void flog(char *file, const char *fmt, ...) { char fn[80]; va_list ap; FILE *fp; snprintf(fn, sizeof(fn), "/tmp/%s.log", file); fp = fopen(fn, "a"); if (!fp) return; va_start(ap, fmt); vfprintf(fp, fmt, ap); va_end(ap); fclose(fp); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/cond-w.c0000644000175100001660000002445215054341541010370 /* Condition engine (write) * * Copyright (c) 2015-2017 Tobias Waldekranz * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "cond.h" #include "pid.h" #include "service.h" #include "sm.h" struct cond_boot { TAILQ_ENTRY(cond_boot) link; char *name; }; static TAILQ_HEAD(, cond_boot) cond_boot_list = TAILQ_HEAD_INITIALIZER(cond_boot_list); /* * Parse finit.cond=cond[,cond[,...]] from command line. It creates a * temporary linked list of conds which are freed when finit reaches * cond_init(), which calls cond_boot_strap() to realize the conditions * in the file system as regular static conditions. Policy, however, * dictates that these are read-only and should not be possible to * manage from initctl. */ void cond_boot_parse(char *arg) { struct cond_boot *node; if (!arg) return; node = malloc(sizeof(*node)); if (!node) { err(1, "Out of memory cannot track boot conditions"); return; } node->name = strdup(arg); TAILQ_INSERT_HEAD(&cond_boot_list, node, link); } /* * Convert all conditions read from the kernel command line (above) into * proper finit conditions. */ static void cond_boot_strap(void) { struct cond_boot *node, *tmp; TAILQ_FOREACH_SAFE(node, &cond_boot_list, link, tmp) { TAILQ_REMOVE(&cond_boot_list, node, link); if (node->name) { char *ptr; ptr = strtok(node->name, ","); while (ptr) { char cond[strlen(ptr) + 6]; if (strncmp(ptr, "boot/", 5)) snprintf(cond, sizeof(cond), "boot/%s", ptr); else snprintf(cond, sizeof(cond), "%s", ptr); cond_set_oneshot_noupdate(cond); ptr = strtok(NULL, ","); } free(node->name); } free(node); } } /* * The service condition name is constructed from the 'pid/' prefix and * the unique NAME:ID tuple that identify each process in Finit. Here * are a few examples: * * The Linux aggregate helper teamd creates PID files in a subdirectory, * /run/teamd/lag1.pid: * * service teamd -f /etc/teamd/lag1.conf -- Aggregate lag1 * * => 'pid/' + 'teamd' + '' = condition * * When you add a second aggregate you need to tell Finit it's a different * instance usugin the :ID syntax: * * service :lag2 teamd -f /etc/teamd/lag2.conf -- Aggregate lag2 * * => 'pid/' + 'teamd' + ':lag2' = condition * * The next example is for the dbus-daemon. It also use a subdirectory, * /run/dbus/pid: * * service dbus-daemon -- DBus daemon * * => 'pid/' + 'dbus-daemon' = condition * * The last example uses lxc-start to start container foo, again in a * subdirectory, /run/lxc/foo.pid. We set an ID to be user-friendly to * ourselves and override the name usually derivedd using the basename * of the path: * * service name:lxc :foo lxc-start -n foo -F -p /run/lxc/foo.pid -- Container foo * * => 'pid/' + 'lxc' + ':foo' = condition */ char *mkcond(svc_t *svc, char *buf, size_t len) { char ident[sizeof(svc->name) + sizeof(svc->id) + 2]; snprintf(buf, len, "pid/%s", svc_ident(svc, ident, sizeof(ident))); return buf; } static int cond_set_gen(const char *file, unsigned int gen) { char *ptr, path[256]; FILE *fp; int ret; /* /var/run --> /run symlink may not exist (yet) */ ptr = pid_runpath(file, path, sizeof(path)); fp = fopen(ptr, "w"); if (!fp) return -1; ret = fprintf(fp, "%u\n", gen); fclose(fp); return (ret > 0) ? 0 : ret; } static void cond_bump_reconf(void) { unsigned int rgen; /* * If %_PATH_RECONF does not exist, cond_get_gen() returns 0 * meaning that rgen++ is always what we want. */ rgen = cond_get_gen(_PATH_RECONF); rgen++; if (cond_set_gen(_PATH_RECONF, rgen)) err(1, "Failed setting %s to gen %d", _PATH_RECONF, rgen); } static int cond_checkpath(const char *path) { char buf[MAX_ARG_LEN], *dir; strlcpy(buf, path, sizeof(buf)); dir = dirname(buf); if (!dir) { errx(1, "Invalid path '%s' for condition", path); return 1; } if (mkpath(dir, 0755) && errno != EEXIST) { err(1, "Failed creating dir '%s' for condition '%s'", dir, path); return 1; } return 0; } static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftw) { const char *cond, *ptr; (void)sb; (void)tflag; if (ftw->level == 0) return 1; ptr = strstr(fpath, COND_BASE); if (!ptr) { warnx("%s does not seem to be a Finit condition, skipping", fpath); return 0; } if (remove(fpath)) err(1, "Failed removing condition %s", fpath); cond = ptr + strlen(COND_BASE) + 1; if (sm_in_reload()) cond_clear_noupdate(cond); else cond_update(cond); return 0; } static void cond_delpath(const char *path) { nftw(path, do_delete, 20, FTW_DEPTH); if (remove(path)) { switch (errno) { case ENOENT: /* Ignore */ case ENOTEMPTY: /* Only at shutdown and for directories */ break; default: err(1, "Failed removing condition path %s", path); break; } } } int cond_set_path(const char *path, enum cond_state next) { enum cond_state prev; unsigned int rgen; dbg("%s <= %d", path, next); prev = cond_get_path(path); switch (next) { case COND_ON: if (cond_checkpath(path)) return 0; rgen = cond_get_gen(_PATH_RECONF); if (!rgen) { errx(1, "Unable to read configuration generation (%s)", path); return -1; } cond_set_gen(path, rgen); break; case COND_OFF: if (unlink(path)) { switch (errno) { case ENOENT: break; case EISDIR: cond_delpath(path); break; default: err(1, "Failed removing condition '%s'", path); break; } } break; default: errx(1, "Invalid condition state"); return 0; } return next != prev; } /* Should only be used by cond_set*(), cond_clear(), and usr/sys plugins! */ int cond_update(const char *name) { svc_t *svc, *iter = NULL; int affects = 0; // dbg("%s", name); for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (!svc_has_cond(svc) || !cond_affects(name, svc->cond)) continue; affects++; dbg("%s: match <%s> %s(%s)", name ?: "nil", svc->cond, svc->desc, svc->cmd); /* Fix bug #314: race condition between crashing services and conditions */ if (svc_is_restart(svc) && cond_get_agg(svc->cond) == COND_OFF) { dbg("%s: cancel timer & unblock => WAITING state.", name ?: "nil"); service_timeout_cancel(svc); svc_unblock(svc); } service_step(svc); } return affects; } int cond_set_noupdate(const char *name) { dbg("%s", name); if (string_compare(name, "nop")) return 1; if (!cond_set_path(cond_path(name), COND_ON)) return 1; return 0; } void cond_set(const char *name) { // dbg("%s", name); if (cond_set_noupdate(name)) return; cond_update(name); } int cond_set_oneshot_noupdate(const char *name) { const char *path; if (string_compare(name, "nop")) return 1; path = cond_path(name); dbg("%s => %s", name, path); if (cond_checkpath(path)) return 1; if (symlink(_PATH_RECONF, path) && errno != EEXIST) { err(1, "Failed creating onshot cond %s", name); return 1; } return 0; } void cond_set_oneshot(const char *name) { dbg("%s", name); if (cond_set_oneshot_noupdate(name)) return; cond_update(name); } int cond_clear_noupdate(const char *name) { dbg("%s", name); if (string_compare(name, "nop")) return 1; if (!cond_set_path(cond_path(name), COND_OFF)) return 1; return 0; } void cond_clear(const char *name) { // dbg("%s", name); if (cond_clear_noupdate(name)) return; cond_update(name); } void cond_reload(void) { dbg(""); cond_bump_reconf(); } static int do_assert(const char *fpath, const struct stat *sb, int tflg, struct FTW *ftw, int set) { char *nm; (void)sb; if (ftw->level == 0) return 1; if (tflg != FTW_F) return 0; nm = strstr((char *)fpath, COND_BASE); if (!nm) { errx(1, "Incorrect condition path %s, cannot %sassert", fpath, set ? "re" : "de"); return 1; } nm += strlen(COND_BASE); dbg("%sasserting %s => %s", set ? "Re" : "De", fpath, nm); if (set) cond_set(nm); else cond_clear_noupdate(nm); /* important, see netlink plugin! */ return 0; } static int reassert(const char *fpath, const struct stat *sb, int tflg, struct FTW *ftw) { return do_assert(fpath, sb, tflg, ftw, 1); } static int deassert(const char *fpath, const struct stat *sb, int tflg, struct FTW *ftw) { return do_assert(fpath, sb, tflg, ftw, 0); } /* * Used only by netlink plugin atm. * type: is a one of pid/, net/, etc. */ void cond_reassert(const char *pat) { dbg("%s", pat); nftw(cond_path(pat), reassert, 20, FTW_DEPTH); } /* * Used only by netlink plugin atm. */ void cond_deassert(const char *pat) { dbg("%s", pat); nftw(cond_path(pat), deassert, 20, FTW_DEPTH); } /* * Check if we have bootstrapped enough of the system to use conditions. * Will answer 'No' before bootstrap done *and* at shutdown/reboot. */ int cond_is_available(void) { return fisdir(_PATH_COND); } void cond_init(void) { char path[MAX_ARG_LEN]; if (mkpath(pid_runpath(_PATH_COND, path, sizeof(path)), 0755) && errno != EEXIST) { err(1, "Failed creating condition base directory '%s'", _PATH_COND); return; } cond_bump_reconf(); cond_boot_strap(); } void cond_exit(void) { cond_delpath(_PATH_COND); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/watchdog.h0000644000175100001660000000257715054341541011012 /* Built-in watchdog daemon * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #ifndef WDT_DEVNODE #define WDT_DEVNODE "/dev/watchdog" #endif #define WDT_TIMEOUT 30 /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/cond.h0000644000175100001660000000332515054341541010125 #ifndef FINIT_COND_H_ #define FINIT_COND_H_ #include #include "svc.h" #define COND_BASE "finit/cond" #define COND_DEV "dev/" #define COND_PID "pid/" #define COND_SYS "sys/" #define COND_USR "usr/" #define _PATH_COND _PATH_VARRUN COND_BASE "/" #define _PATH_CONDDEV _PATH_COND COND_DEV #define _PATH_CONDPID _PATH_COND COND_PID #define _PATH_CONDSYS _PATH_COND COND_SYS #define _PATH_CONDUSR _PATH_COND COND_USR #define _PATH_RECONF _PATH_COND "reconf" typedef enum cond_state { COND_OFF = 0, COND_FLUX, COND_ON } cond_state_t; char *mkcond (svc_t *svc, char *buf, size_t len); const char *condstr (enum cond_state s); const char *cond_path (const char *name); unsigned int cond_get_gen (const char *path); enum cond_state cond_get_path(const char *path); enum cond_state cond_get (const char *name); enum cond_state cond_get_agg (const char *names); int cond_affects (const char *name, const char *names); void cond_boot_parse (char *arg); int cond_update (const char *name); int cond_set_path (const char *path, enum cond_state new); void cond_set (const char *name); void cond_set_oneshot (const char *name); void cond_clear (const char *name); void cond_reload (void); int cond_set_noupdate(const char *name); int cond_set_oneshot_noupdate(const char *name); int cond_clear_noupdate(const char *name); void cond_reassert (const char *pat); void cond_deassert (const char *pat); int cond_is_available(void); void cond_init (void); void cond_exit (void); #endif /* FINIT_COND_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/tmpfiles.c0000644000175100001660000003056315054341541011024 /* Limited tmpfiles.d implementation * * Copyright (c) 2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include #include #include #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "log.h" #include "util.h" int debug; int c_flag = 0; int r_flag = 0; static int is_dir_empty(const char *path) { struct dirent **namelist; int num; num = scandir(path, &namelist, NULL, NULL); if (num < 0) return 0; for (int i = 0; i < num; i++) free(namelist[i]); free(namelist); return num >= 3; } static int glob_do(const char *path, int (*cb)(const char *)) { int rc = 0; glob_t gl; rc = glob(path, GLOB_NOESCAPE, NULL, &gl); if (rc) { if (rc == GLOB_NOMATCH) { errno = ENOENT; return -1; } return 0; } for (size_t i = 0; i < gl.gl_pathc; i++) rc += cb(gl.gl_pathv[i]); return rc; } static int parse_mm(char *arg, int *major, int *minor) { char *ptr; if (!arg) { inval: errno = EINVAL; return -1; } ptr = strchr(arg, ':'); if (!ptr) goto inval; *ptr++ = 0; *major = atoi(arg); *minor = atoi(ptr); if (!*major || !*minor) return -1; return 0; } static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftw) { (void)sb; (void)tflag; if (ftw->level == 0) return 1; if (remove(fpath) && errno != EBUSY) warn("Failed removing %s", fpath); return 0; } static int rmrf(const char *path) { if (!fisdir(path)) return 0; nftw(path, do_delete, 20, FTW_DEPTH | FTW_PHYS); if (remove(path) && errno != ENOENT) warn("Failed removing path %s", path); return 0; } static void mkparent(char *path, mode_t mode) { mkpath(dirname(strdupa(path)), mode); } static char *write_hex(FILE *fp, char *p) { unsigned char val; char num[4], *ptr; int i, len = 0; for (i = 0; p[i] && len < 2; i++) { char c = p[i]; if ((c >= '0' && c <= '7') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) num[len++] = c; else break; } num[len] = 0; if (len == 0) { fputs("x", fp); return p; } errno = 0; val = strtoul(num, &ptr, 16); if (errno || ptr == num) goto end; fputc(val & 0xff, fp); end: return &p[i]; } static char *write_num(FILE *fp, char *p) { unsigned char val; char num[4], *ptr; int i, len = 0; for (i = 0; p[i] && len < 3; i++) { char c = p[i]; if (c >= '0' && c <= '7') num[len++] = c; else break; } num[len] = 0; if (len == 0) return p; errno = 0; val = strtoul(num, &ptr, 8); if (errno || ptr == num) goto end; fputc(val & 0xff, fp); end: return &p[i]; } static void write_arg(FILE *fp, char *arg) { char *p; if (!arg) return; while (*arg && (p = strchr(arg, '\\'))) { fwrite(arg, sizeof(char), p - arg, fp); *p++ = 0; switch (*p) { case '\\': fputc('\\', fp); arg = p + 1; break; case '\'': fputc('\'', fp); arg = p + 1; break; case '"': fputc('"', fp); arg = p + 1; break; case 'a': fputc('\a', fp); arg = p + 1; break; case 'b': fputc('\b', fp); arg = p + 1; break; case 'e': fputc('\e', fp); arg = p + 1; break; case 'n': fputc('\n', fp); arg = p + 1; break; case 't': fputc('\t', fp); arg = p + 1; break; case 'x': arg = write_hex(fp, &p[1]); break; case '0' ... '7': arg = write_num(fp, p); break; default: fputc(*p, fp); arg = p + 1; break; } } fputs(arg, fp); } /* * The configuration format is one line per path, containing type, path, * mode, ownership, age, and argument fields. The lines are separated by * newlines, the fields by whitespace: * * #Type Path Mode User Group Age Argument… * d /run/user 0755 root root 10d - * L /tmp/foobar - - - - /dev/null * * https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html */ static void tmpfiles(char *line) { char *type, *path, *token, *user, *group, *age, *arg; char *dst = NULL, *opts = ""; struct stat st, ast; int major, minor; int strc, rc = 0; mode_t mode = 0; FILE *fp = NULL; char buf[1024]; glob_t gl; type = strtok(line, "\t "); if (!type) return; path = strtok(NULL, "\t "); if (!path) return; if (strchr(path, '%')) { errx(1, "Path name specifiers unsupported, skipping."); return; } token = strtok(NULL, "\t "); if (token) { errno = 0; mode = strtoul(token, &arg, 8); if (errno || arg == token) mode = 0; } user = strtok(NULL, "\t "); if (!user || !strcmp(user, "-")) user = "root"; group = strtok(NULL, "\t "); if (!group || !strcmp(group, "-")) group = "root"; age = strtok(NULL, "\t "); (void)age; /* unused atm. */ arg = strtok(NULL, "\n"); strc = stat(path, &st); // file and directory removal logic if (r_flag) { switch (type[0]) { case 'b': case 'c': case 'C': case 'd': break; case 'D': if (fisdir(path)) { nftw(path, do_delete, 20, FTW_DEPTH | FTW_PHYS); } break; case 'e': case 'f': case 'F': case 'l': /* Finit extension, like 'L' but only if target exists */ case 'L': case 'p': break; case 'r': rc = glob_do(path, erase); if (rc && errno == ENOENT) rc = 0; break; case 'R': rc = glob_do(path, rmrf); break; case 'w': break; case 'X': case 'x': dbg("Unsupported x/X command, ignoring %s, no support for clean at runtime.", path); break; case 'Z': case 'z': break; default: errx(1, "Unsupported tmpfiles command '%s'", type); return; } } // file & directory creation logic if (c_flag) { switch (type[0]) { case 'b': rc = parse_mm(arg, &major, &minor); if (rc) break; if (!strc) { if (type[1] != '+') break; erase(path); } mkparent(path, 0755); rc = blkdev(path, mode ?: 0644, major, minor); break; case 'c': rc = parse_mm(arg, &major, &minor); if (rc) break; if (!strc) { if (type[1] != '+') break; erase(path); } mkparent(path, 0755); rc = chardev(path, mode ?: 0644, major, minor); break; case 'C': if (!arg) { paste(buf, sizeof(buf), "/usr/share/factory", path); arg = buf; } if (fisdir(path) && !is_dir_empty(path)) break; if (fisdir(arg) && !fisslashdir(arg)) { size_t len = strlen(arg) + 2; dst = malloc(len); if (!dst) break; snprintf(dst, len, "%s/", arg); arg = dst; } mkparent(path, 0755); rc = rsync(arg, path, LITE_FOPT_KEEP_MTIME, NULL); if (rc && errno == ENOENT) rc = 0; break; case 'd': case 'D': mkparent(path, 0755); rc = mksubsys(path, mode ?: 0755, user, group); break; case 'e': if (glob(path, GLOB_NOESCAPE, NULL, &gl)) break; for (size_t i = 0; i < gl.gl_pathc; i++) rc += mksubsys(gl.gl_pathv[i], mode ?: 0755, user, group); break; case 'f': case 'F': mkparent(path, 0755); if (type[1] == '+' || type[0] == 'F') { /* f+/F will create or truncate the file */ if (!arg) { rc = create(path, mode ?: 0644, user, group); break; } fp = fopen(path, "w+"); } else { /* f will create the file if it doesn't exist */ if (strc) fp = fopen(path, "w"); } if (fp) { write_arg(fp, arg); rc = fclose(fp); } break; case 'l': /* Finit extension, like 'L' but only if target exists */ if (!arg) { paste(buf, sizeof(buf), "/usr/share/factory", path); if (stat(buf, &ast)) break; } else if (arg[0] != '/') { char *tmp; tmp = dirname(strdupa(path)); paste(buf, sizeof(buf), tmp, arg); dst = realpath(buf, NULL); if (!dst) break; if (stat(dst, &ast)) break; } else { if (stat(arg, &ast)) break; } /* fallthrough */ case 'L': if (!strc) { if (type[1] != '+') break; rmrf(path); } mkparent(path, 0755); if (!arg) { paste(buf, sizeof(buf), "/usr/share/factory", path); arg = buf; } rc = ln(arg, path); if (rc && errno == EEXIST) rc = 0; break; case 'p': if (!strc) { if (type[1] != '+') break; erase(path); } mkparent(path, 0755); rc = mkfifo(path, mode ?: 0644); break; case 'r': case 'R': break; case 'w': if (!arg) break; if (glob(path, GLOB_NOESCAPE, NULL, &gl)) break; for (size_t i = 0; i < gl.gl_pathc; i++) { fp = fopen(gl.gl_pathv[i], type[1] == '+' ? "a" : "w"); if (fp) { write_arg(fp, arg); rc = fclose(fp); } } break; case 'X': case 'x': dbg("Unsupported x/X command, ignoring %s, no support for clean at runtime.", path); break; case 'Z': opts = "-R"; /* fallthrough */ case 'z': if (!whichp("restorecon")) break; if (glob(path, GLOB_NOESCAPE, NULL, &gl)) break; for (size_t i = 0; i < gl.gl_pathc; i++) systemf("restorecon %s %s", opts, gl.gl_pathv[i]); break; default: errx(1, "Unsupported tmpfiles command '%s'", type); return; } } if (dst) free(dst); if (rc) warn("Failed %s operation on path %s", type, path); } static int usage(int rc) { fprintf(stderr, "Usage: tmpfiles [COMMAND...]\n" "\n" "Commands:\n" " -c, --create Create files and directories\n" " -d, --debug Show developer debug messages\n" " -r, --remove Remove files and directories marked for removal\n" " -h, --help This help text\n" "\n"); return rc; } int main(int argc, char *argv[]) { struct option long_options[] = { { "create", 0, NULL, 'c' }, { "debug", 0, NULL, 'd' }, { "remove", 0, NULL, 'r' }, { "help", 0, NULL, 'h' }, { NULL, 0, NULL, 0 } }; int c; while ((c = getopt_long(argc, argv, "cdrh?", long_options, NULL)) != EOF) { switch(c) { case 'c': c_flag = 1; break; case 'd': debug = 1; break; case 'r': r_flag = 1; break; case 'h': case '?': return usage(0); default: return usage(1); } } if (c_flag + r_flag == 0) { fprintf(stderr, "You need to specify at least one of --create or --remove.\n"); return 1; } /* * Only the three last tmpfiles.d/ directories are defined in * tmpfiles.d(5) as system search paths. Finit adds two more * before that to have Finit specific ones sorted first, and * a configure prefix specific one after that for user needs. */ /* in priority order */ char *dir[] = { FINIT_TMPFILES "/*.conf", TMPFILES_PATH_ "/*.conf", "/usr/lib/tmpfiles.d/*.conf", "/run/tmpfiles.d/*.conf", "/etc/tmpfiles.d/*.conf", /* local admin overrides */ }; int flags = GLOB_NOESCAPE; glob_t gl; size_t i; for (i = 0; i < NELEMS(dir); i++) { glob(dir[i], flags, NULL, &gl); flags |= GLOB_APPEND; } for (i = 0; i < gl.gl_pathc; i++) { char *fn = gl.gl_pathv[i]; size_t j; FILE *fp; /* check for overrides */ for (j = i + 1; j < gl.gl_pathc; j++) { if (strcmp(basenm(fn), basenm(gl.gl_pathv[j]))) continue; fn = NULL; break; } if (!fn) continue; /* skip, override exists */ fp = fopen(fn, "r"); if (!fp) continue; // info("Parsing %s ...", fn); while (!feof(fp)) { char *line; line = fparseln(fp, NULL, NULL, NULL, FPARSELN_UNESCCOMM); if (!line) continue; tmpfiles(line); free(line); } fclose(fp); } globfree(&gl); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/helpers.h0000644000175100001660000001035715054341541010647 /* Misc. utility functions and C-library extensions for finit and its plugins * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_HELPERS_H_ #define FINIT_HELPERS_H_ #include #include #include #include #include #include #include #include /* Not included by default in musl libc */ #include #ifdef _LIBITE_LITE # include #else # include #endif #define PROGRESS_DEFAULT PROGRESS_MODERN typedef enum { PROGRESS_SILENT, PROGRESS_CLASSIC, PROGRESS_MODERN, } pstyle_t; char *console (void); void console_init (void); ssize_t cprintf (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); void tabstospaces (char *line); char *strip_line (char *line); void enable_progress (int onoff); void show_progress (pstyle_t style); char *release_heading (void); speed_t stty_parse_speed(char *baud); void stty (int fd, speed_t speed); void print_banner (const char *heading); void printv (const char *fmt, va_list ap); void print (int action, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); void print_desc (char *action, char *desc); int print_result (int fail); void set_hostname (char **hostname); void networking (int updown); int in_container (void); int complete (char *cmd, int pid); int run (char *cmd, char *log); int run_interactive (char *cmd, char *fmt, ...) __attribute__ ((format (printf, 2, 3))); int exec_runtask (char *cmd, char *args[]); pid_t run_getty (char *tty, char *cmd, char *args[], int noclear, int nowait, struct rlimit rlimit[]); pid_t run_sh (char *tty, int noclear, int nowait, struct rlimit rlimit[]); pid_t run_bg (char *cmd, char *args[]); int run_parts (char *dir, char *cmd, const char *env[], int progress, int sysv); static inline int dprint(int fd, const char *s, size_t len) { size_t loop = 3; int rc = -1; if (!len) len = strlen(s); while (loop--) { rc = write(fd, s, len); if (rc == -1 && errno == EINTR) continue; break; } return rc; } static inline char *fgetval(const char *line, const char *key, char *sep) { char *ptr, *str, *copy; size_t len; str = copy = strdup(line); if (!copy) return NULL; ptr = strsep(&str, sep); if (ptr && strcmp(ptr, key)) { fail: free(copy); return NULL; } /* * Check if we should strip optional separator, e.g., * 'foo = bar' => '= bar' should be stripped to 'bar' */ while (strchr(sep, str[0])) { ptr = strsep(&str, sep); if (!ptr) goto fail; } ptr = str; if (*ptr == '"' || *ptr == '\'') { char *end = &ptr[strlen(ptr) - 1]; char q = *ptr; while (end > ptr && isspace(*end)) *end-- = 0; if (*end == q) { *end = 0; ptr++; } } len = strlen(ptr) + 1; memmove(copy, ptr, len); return realloc(copy, len); } #endif /* FINIT_HELPERS_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/tty.c0000644000175100001660000001754315054341541010024 /* Finit TTY handling * * Copyright (c) 2013 Mattias Walström * Copyright (c) 2013-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include /* isdigit() */ #include #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "config.h" /* Generated by configure script */ #include "log.h" #include "finit.h" #include "conf.h" #include "helpers.h" #include "service.h" #include "tty.h" #include "util.h" #include "utmp-api.h" char *tty_canonicalize(char *dev) { static char path[80]; struct stat st; if (!dev) return NULL; if (tty_isatcon(dev)) return dev; strlcpy(path, dev, sizeof(path)); if (stat(path, &st)) { if (!strncmp(path, _PATH_DEV, strlen(_PATH_DEV))) { unavailable: dbg("TTY %s not available at the moment, registering anyway.", path); return path; } snprintf(path, sizeof(path), "%s%s", _PATH_DEV, dev); if (stat(path, &st)) goto unavailable; } if (!S_ISCHR(st.st_mode)) return NULL; return path; } /* * The @console syntax is a wildcard to match the system console(s) given * on the kernel cmdline. As such it can match multiple, or even none. */ int tty_isatcon(char *dev) { return dev && !strcmp(dev, "@console"); } /* * Returns console TTYs known by the kernel, from cmdline */ char *tty_atcon(void) { static char *buf = NULL; static char *save; char *ptr = NULL; char *dev; if (!buf) { FILE *fp; fp = fopen("/sys/class/tty/console/active", "r"); if (!fp) { errx(1, "Cannot find system console, is sysfs not mounted?"); errno = ENOENT; return NULL; } buf = malloc(512); if (!buf) { err(1, "Failed allocating memory for @console"); fclose(fp); return NULL; } if (!fgets(buf, 512, fp)) { fclose(fp); goto done; } fclose(fp); ptr = chomp(buf); dbg("consoles: %s", ptr); } dev = strtok_r(ptr, " \t", &save); if (!dev) { done: free(buf); return buf = NULL; } return dev; } /** * tty_parse_args - Parse cmdline args for a tty * @tty: service tty * @cmd: command or tty * @args: args from strtok_r() * * A Finit tty line can use the internal getty implementation or an * external one, like the BusyBox getty for instance. This function * determines which one to use based on a leading '/dev' prefix. If * a leading '/dev' is encountered the remaining options must be in * the following sequence: * * tty [!1-9,S] [BAUD[,BAUD,...]] [noclear] [nowait] [TERM] * * Otherwise the leading prefix must be the full path to an existing * getty implementation, with it's arguments following: * * tty [!1-9,S] [ARGS] [noclear] [nowait] * * Different getty implementations prefer the TTY device argument in * different order, so take care to investigate this first. */ int tty_parse_args(struct tty *tty, char *cmd, char **args) { char *dev = NULL; int passenv = 0; size_t i; do { if (!strcmp(cmd, "noclear")) tty->noclear = 1; else if (!strcmp(cmd, "nowait")) tty->nowait = 1; else if (!strcmp(cmd, "nologin")) tty->nologin = 1; else if (!strcmp(cmd, "notty")) tty->notty = 1; /* for board bringup */ else if (!strcmp(cmd, "passenv")) passenv = 1; else if (!strcmp(cmd, "rescue")) tty->rescue = 1; /* for rescue shells */ else if (!tty->cmd && whichp(cmd)) tty->cmd = cmd; else tty->args[tty->num++] = cmd; cmd = strtok_r(NULL, " ", args); } while (cmd && tty->num < NELEMS(tty->args)); /* rescue shells are always notty */ if (tty->rescue) tty->notty = 1; /* skip /dev probe, we just want a bríngup shell */ if (tty->notty) return 0; /* Iterate over all args */ for (i = 0; i < tty->num; i++) { /* * First, figure out if built-in or external getty * tty [12345] /dev/ttyAMA0 115200 noclear vt220 # built-in * tty [12345] /sbin/getty -L 115200 @console vt100 noclear # external */ if (!dev) { if (!strcmp(tty->args[i], "@console")) dev = tty->args[i]; if (!strncmp(tty->args[i], "/dev", 4)) dev = tty->args[i]; if (!strncmp(tty->args[i], "tty", 3) || !strcmp(tty->args[i], "console")) dev = tty->args[i]; /* The first arg must be one of the above */ continue; } /* Built-in getty args */ if (!tty->cmd && dev) { if (isdigit(tty->args[i][0])) { tty->baud = tty->args[i]; continue; } /* * Last arg, if not anything else, is the value * to be used for the TERM environment variable. */ if (i + 1 == tty->num) tty->term = tty->args[i]; } } tty->dev = tty_canonicalize(dev); if (!tty->dev) { errx(1, "Incomplete or non-existing TTY device given, cannot register."); return errno = EINVAL; } dbg("Registering %s getty on TTY %s at %s baud with term %s", tty->cmd ? "external" : "built-in", tty->dev, tty->baud ?: "0", tty->term ?: "N/A"); /* Built-in getty now comes as standalone program */ if (!tty->cmd) { if (passenv && tty->num < NELEMS(tty->args)) { for (i = tty->num; i > 0; i--) tty->args[i] = tty->args[i - 1]; tty->args[0] = "-p"; tty->num++; } tty->cmd = _PATH_GETTY; } return 0; } int tty_exists(char *dev) { struct termios c; int fd, rc; fd = open(dev, O_RDWR | O_NOCTTY); if (-1 == fd) return 0; /* XXX: Add check for errno == EIO? */ rc = tcgetattr(fd, &c); close(fd); return rc == 0; } int tty_exec(svc_t *svc) { char *args[MAX_NUM_SVC_ARGS]; char *dev; int i, j; /* try to protect system with sulogin, fall back to root shell */ if (svc->notty) { if (svc->rescue) { /* check if bundled one is available */ if (whichp(_PATH_SULOGIN)) return execl(_PATH_SULOGIN, _PATH_SULOGIN, NULL); /* util-linux or busybox, no args for compat */ if (whichp("sulogin")) return execlp("sulogin", "sulogin", NULL); } /* * Become session leader and set controlling TTY * to enable Ctrl-C and job control in shell. */ setsid(); ioctl(STDIN_FILENO, TIOCSCTTY, 1); prctl(PR_SET_NAME, "finitsh", 0, 0, 0); return execl(_PATH_BSHELL, "-sh", NULL); } dev = tty_canonicalize(svc->dev); if (!dev) { dbg("%s: Cannot find TTY device: %s", svc->dev, strerror(errno)); return EX_CONFIG; } if (!tty_exists(dev)) { dbg("%s: Not a valid TTY: %s", dev, strerror(errno)); return EX_OSFILE; } if (svc->nologin) { dbg("%s: Starting /bin/sh ...", dev); return run_sh(dev, svc->noclear, svc->nowait, svc->rlimit); } dbg("%s: Starting %s ...", dev, svc->cmd); for (i = 1, j = 0; i < MAX_NUM_SVC_ARGS; i++) { if (!svc->args[i][0]) break; args[j++] = svc->args[i]; } args[j++] = NULL; return run_getty(dev, svc->cmd, args, svc->noclear, svc->nowait, svc->rlimit); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/sample.conf0000644000175100001660000000700115054341541011154 # sample.conf: template cgroup/run/task/service stanza for finit # # The top-level cgroups can be defined anywhere, but share the same # namespace. It is up to the user to ensure groups are defined only # once, otherwise the last read .conf wins. See below for assigning # run/task/services to cgroups. The below example creates the cgroup # NAME with the following cpu and memory settings: # # cgroup NAME cpu.weight:1000 mem.max:65 # # The one-shot commands 'run' and 'task' are called only once per # runlevel. Finit does not restart them when they exit. # # - run : wait for completion before continuing with next stanza # - task : like run but started in background, parallel with other stanzas # - service : supervised daemon, run in foreground, restarted if it crashes # # The env: is an optional path to a file with environment variables to # adjust the behavior of daemons. Debian and Buildroot use /etc/default # while Alpine use /etc/conf.d -- ensure your Finit is built correctly. # The leading '-' determines if its OK to start the service even if the # env file is missing. # # run [LVLS] log command ARGS -- Command # task [LVLS] log command ARGS -- Command # service [LVLS] log env:[-]/etc/default/daemon daemon ARGS -- Daemon daemon # ^ ^ ^ ^ ^ ^ ^ ^ # | | | | | | | `-- Optional description # | | | | | | `----------- Daemon arguments # | | | | | `-------------------------- Path to daemon # | | | | `---------------------------------------------------- Optional env. file # | | | `-------------------------------------------------------- Redirect output to log # | | `--------------------------------------------------------------- Optional conditions # | `---------------------------------------------------------------------- Optional Runlevels # `------------------------------------------------------------------------------ Monitored application # # Each stanza can also hold a 'cgroup' argument, or be prefixed with # cgroup.NAME to place all following stanzas in the same group. In # the following example, foo and bar share the cgroup foo but baz # runs in its own cgroup baz: # # cgroup.foo # service cgroup:cpu.weight:250,mem.max:655350 foo args -- foo desc # service cgroup:cpu.weight:150,mem.max:655350 bar args -- bar desc # service cgroup.baz:cpu.weight:300 baz args -- baz desc # Debian GNU/Linux: start SSH daemon as soon as basic networking comes up #service [2345] env:-/etc/default/ssh /usr/sbin/sshd -D $SSHD_OPTS -- OpenSSH daemon # Alpine Linux: Oneshot task to run once at bootstrap, yes pipes are possible :) #task [S] env:/etc/conf.d/loadkmap zcat $KEYMAP | loadkmap -- Loading keymap # Alpine Linux: start SSH daemon with $DROPBEAR_OPTS from /etc/conf.d #service [2345] cgroup.user env:-/etc/conf.d/dropbear dropbear -R -F $DROPBEAR_OPTS -- Dropbear SSH daemon # Handle PWR button to shutdown/reboot -- useful in Qemu (virt-manager) # Depends on syslogd having started. Redirect any output to log. #service [2345] cgroup:mem.max:32000,cpu.max:1000 log acpid -f -- ACPI daemon # Start rsyslogd as soon as possible, should always run # Provides pid/syslogd condition #service [S12345] name:syslogd env:-/etc/default/rsyslog rsyslogd -n $RSYSLOGD_OPTIONS -- Reliable syslog daemon finit-4.14/src/logit.c0000644000175100001660000001424115054341541010312 /* * Copyright (c) 2018-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include #include #include #define SYSLOG_NAMES #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #define LOG_MAX (200 * 1024) #define LOG_NUM 5 static const char version_info[] = PACKAGE_NAME " v" PACKAGE_VERSION; extern int logrotate(char *file, int num, off_t sz); static int checksz(FILE *fp, off_t sz) { struct stat st; if (sz <= 0) return 0; if (!fstat(fileno(fp), &st) && st.st_size > sz) { fclose(fp); return 1; } return 0; } static int flogit(char *logfile, int num, off_t sz, char *buf, size_t len) { FILE *fp; reopen: fp = fopen(logfile, "a"); if (!fp) { syslog(LOG_ERR | LOG_PERROR, "Failed opening %s: %s", logfile, strerror(errno)); return 1; } if (buf[0]) { fprintf(fp, "%s\n", buf); fsync(fileno(fp)); if (checksz(fp, sz)) return logrotate(logfile, num, sz); } else { while ((fgets(buf, len, stdin))) { fputs(buf, fp); fsync(fileno(fp)); if (checksz(fp, sz)) { logrotate(logfile, num, sz); buf[0] = 0; goto reopen; } } } return fclose(fp); } /* * Parse possible systemd style log prefix from message * For details, see libsystemd/sd-daemon.h * * Returns the level, and updates buf to point past the prefix */ static int parse_level(char **buf, int default_level) { char *msg = *buf; if (msg[0] == '<' && msg[2] == '>' && msg[1] >= '0' && msg[1] <= '7') { int level; switch (msg[1]) { case '0': level = LOG_EMERG; break; case '1': level = LOG_ALERT; break; case '2': level = LOG_CRIT; break; case '3': level = LOG_ERR; break; case '4': level = LOG_WARNING; break; case '5': level = LOG_NOTICE; break; case '6': level = LOG_INFO; break; case '7': level = LOG_DEBUG; break; default: level = default_level; break; } *buf = msg + 3; return (default_level & ~LOG_PRIMASK) | level; } return default_level; } static int do_log(int level, char *msg) { level = parse_level(&msg, level); syslog(level, "%s", msg); return 0; } static int logit(int level, char *buf, size_t len) { if (buf[0]) return do_log(level, buf); while ((fgets(buf, len, stdin))) do_log(level, buf); return 0; } static int parse_prio(char *arg, int *fac, int *lvl) { char *duparg = strdup(arg); const char *prio; char *ptr; int found; if (!duparg) prio = arg; else prio = duparg; ptr = strchr(prio, '.'); if (ptr) { *ptr++ = 0; found = -1; for (int i = 0; facilitynames[i].c_name; i++) { if (!strcmp(facilitynames[i].c_name, prio)) { found = facilitynames[i].c_val; break; } } if (found == -1) goto notfound; *fac = found; prio = ptr; } found = -1; for (int i = 0; prioritynames[i].c_name; i++) { if (!strcmp(prioritynames[i].c_name, prio)) { found = prioritynames[i].c_val; break; } } if (found == -1) { notfound: if (duparg) free(duparg); return 1; } *lvl = found; if (duparg) free(duparg); return 0; } static int usage(int code) { fprintf(stderr, "Usage: logit [OPTIONS] [MESSAGE]\n" "\n" "Write MESSAGE (or stdin) to syslog, or file (with logrotate)\n" "\n" " -h This help text\n" " -p PRIO Priority (numeric or facility.level pair)\n" " -t TAG Log using the specified tag (defaults to user name)\n" " -s Log to stderr as well as the system log\n" "\n" " -f FILE File to write log messages to, instead of syslog\n" " -n SIZE Number of bytes before rotating, default: 200 kB\n" " -r NUM Number of rotated files to keep, default: 5\n" " -v Show program version\n" "\n" "This version of logit is distributed as part of Finit.\n" "Bug report address: %s\n", PACKAGE_BUGREPORT); return code; } int main(int argc, char *argv[]) { char *ident = NULL, *logfile = NULL; int log_opts = LOG_NOWAIT; int facility = LOG_USER; int level = LOG_INFO; off_t size = LOG_MAX; char buf[512] = ""; int num = LOG_NUM; int c, rc; while ((c = getopt(argc, argv, "f:hn:p:r:st:v")) != EOF) { switch (c) { case 'f': logfile = optarg; break; case 'h': return usage(0); case 'n': size = atoi(optarg); break; case 'p': if (parse_prio(optarg, &facility, &level)) return usage(1); break; case 'r': num = atoi(optarg); break; case 's': log_opts |= LOG_PERROR; break; case 't': ident = optarg; break; case 'v': /* version */ fprintf(stderr, "%s\n", version_info); return 0; default: return usage(1); } } if (!ident) { ident = getenv("LOGNAME"); if (!ident) ident = getenv("USER"); if (!ident) ident = PACKAGE_NAME; } if (optind < argc) { size_t pos = 0, len = sizeof(buf); while (optind < argc) { size_t bytes; bytes = snprintf(&buf[pos], len, "%s ", argv[optind++]); pos += bytes; len -= bytes; } } openlog(ident, log_opts, facility); if (logfile) rc = flogit(logfile, num, size, buf, sizeof(buf)); else rc = logit(level, buf, sizeof(buf)); closelog(); return rc; } finit-4.14/src/sig.c0000644000175100001660000004132015054341541007754 /* Signal management - Be conservative with what finit responds to! * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * Finit is often used on embedded and small Linux systems with BusyBox. * For compatibility with its existing toolset (halt, poweroff, reboot), * the following signals have been adopted: * * SIGHUP * Same effect as initctl reload, reloads *.conf in /etc/finit.d/ * Also restarts API (initctl) socket, like SysV init and systemd * does on USR1 with their FIFO/D-Bus. * * SIGUSR1 * Restarts API (initctl) socket, like SysV init and systemd does * on USR1 with their FIFO/D-Bus. * * Finit <= 4.0 used to perform a system halt on USR1. This caused * some quite nasty problems on systems with both systemd/sysvinit * installed alongside finit. For compatibility reasons Finit 4.1 * changed to partial SIGHUP (api_exit/init). * * SIGUSR2 * Calls shutdown hooks, including HOOK_SHUTDOWN, stops all running * processes, and unmounts all file systems. Then tells kernel to * power-off the system, if ACPI or similar exists to actually do * this. If the kernel fails power-off, Finit falls back to halt. * * (SysV init N/A, systemd dumps its internal state to log.) * * SIGTERM * Like SIGUSR2, but tell kernel to reboot the system when done. * * (SysV init N/A, systemd rexecutes itself.) * * SIGINT * Sent from kernel when the CTRL-ALT-DEL key combo is pressed. * SysV init and systemd default to reboot with `shutdown -r`. * Finit defaults to nothing but sets sys/key/ctrlaltdel condition. * * SIGWINCH * Sent from kernel when the KeyboardSignal key is pressed. Some * users bind keys, see loadkeys(1), to create consoles on demand. * Finit currently ignores this signal. * * SIGPWR * Sent from a power daemon, like powstatd(8), on changes to the * UPS status. Traditionally SysV init read /etc/powerstatus and * acted on "OK", "FAIL", or "LOW" and then removed the file. * Finit defaults to nothing but sets sys/pwr/fail condition. */ #include "config.h" /* Generated by configure script */ #include #ifdef HAVE_MNTENT_H #include #endif #include /* strerror() */ #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "cond.h" #include "conf.h" #include "config.h" #include "helpers.h" #include "plugin.h" #include "private.h" #include "sig.h" #include "service.h" #include "sm.h" #include "util.h" #include "utmp-api.h" /* * Old-style SysV shutdown sends a setenv cmd INIT_HALT with "=HALT", * "=POWERDOWN", or "" to cancel shutdown, before requesting change to * runlevel 6 over the /dev/initctl FIFO. */ shutop_t halt = SHUT_DEFAULT; static uev_t sigterm_watcher, sigusr1_watcher, sigusr2_watcher; static uev_t sighup_watcher, sigint_watcher, sigpwr_watcher; static uev_t sigchld_watcher; static struct sigmap { int num; char *name; } signames[] = { /* ISO C99 signals. */ { SIGINT, "SIGINT" }, { SIGILL, "SIGILL" }, { SIGABRT, "SIGABRT" }, { SIGFPE, "SIGFPE" }, { SIGSEGV, "SIGSEGV" }, { SIGTERM, "SIGTERM" }, /* Historical signals specified by POSIX. */ { SIGHUP, "SIGHUP" }, { SIGQUIT, "SIGQUIT" }, { SIGTRAP, "SIGTRAP" }, { SIGKILL, "SIGKILL" }, { SIGBUS, "SIGBUS" }, { SIGSYS, "SIGSYS" }, { SIGPIPE, "SIGPIPE" }, { SIGALRM, "SIGALRM" }, /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ { SIGURG, "SIGURG" }, { SIGSTOP, "SIGSTOP" }, { SIGTSTP, "SIGTSTP" }, { SIGCONT, "SIGCONT" }, { SIGCHLD, "SIGCHLD" }, { SIGTTIN, "SIGTTIN" }, { SIGTTOU, "SIGTTOU" }, { SIGPOLL, "SIGPOLL" }, { SIGXCPU, "SIGXCPU" }, { SIGXFSZ, "SIGXFSZ" }, { SIGVTALRM, "SIGVTALRM" }, { SIGPROF, "SIGPROF" }, { SIGUSR1, "SIGUSR1" }, { SIGUSR2, "SIGUSR2" }, /* Nonstandard signals found in all modern POSIX systems (including both BSD and Linux). */ { SIGWINCH, "SIGWINCH" }, #ifdef SIGSTKFLT { SIGSTKFLT, "SIGSTKFLT" }, #endif { SIGPWR, "SIGPWR" }, /* Archaic names for compatibility. */ #ifdef SIGIO { SIGIO, "SIGIO" }, #endif #ifdef SIGIOT { SIGIOT, "SIGIOT" }, #endif #ifdef SIGCLD { SIGCLD, "SIGCLD" }, #endif }; void mdadm_wait(void); void unmount_tmpfs(void); void unmount_regular(void); static void fs_swapoff(void) { struct mntent *mnt; char cmd[256]; FILE *fp; if (!whichp("swapoff")) return; fp = setmntent(fstab, "r"); if (!fp) return; while ((mnt = getmntent(fp))) { if (strcmp(mnt->mnt_type, MNTTYPE_SWAP)) continue; snprintf(cmd, sizeof(cmd), "swapoff %s", mnt->mnt_fsname); run_interactive(cmd, "Disabling swap %s", mnt->mnt_fsname); } endmntent(fp); } /* * Kernel threads have no cmdline so fgets() returns NULL for them. We * also skip "special" processes, e.g. mdadm/mdmon or watchdogd that must * not be stopped here, for various reasons. * * https://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/ */ void do_iterate_proc(int (*cb)(int, void *), void *data) { DIR *dirp; dirp = opendir("/proc"); if (dirp) { struct dirent *d; while ((d = readdir(dirp))) { int pid; FILE *fp; char file[LINE_SIZE] = ""; if (d->d_type != DT_DIR) continue; pid = atoi(d->d_name); if (!pid) continue; if (pid == 1) continue; snprintf(file, sizeof(file), "/proc/%s/cmdline", d->d_name); fp = fopen(file, "r"); if (!fp) continue; if (fgets(file, sizeof(file), fp)) { if (strstr(file, "gdbserver")) dbg("Skipping %s ...", file); else if (file[0] == '@') dbg("Skipping %s ...", &file[1]); else if (strstr(file, "initctl")) dbg("Skipping %s ...", file); else if (cb(pid, data)) { dbg("PID %d is still alive (%s)", pid, file); fclose(fp); break; } } fclose(fp); } closedir(dirp); } } static int kill_cb(int pid, void *data) { int signo = *(int *)data; kill(pid, signo); return 0; } static int status_cb(int pid, void *data) { int *has_proc = (int *)data; (void)pid; *has_proc = 1; return 1; } /* return value: * 1 - at least one process remaining * 0 - no processes remaining */ static int do_wait(int secs) { const int delay = 250000; int iterations = secs * 1000 * 1000 / delay; int has_proc; do { do_usleep(delay); while (waitpid(-1, NULL, WNOHANG) > 0) ; has_proc = 0; iterations--; do_iterate_proc(status_cb, &has_proc); } while (has_proc && iterations > 0); return has_proc; } void do_shutdown(shutop_t op) { struct sched_param sched_param = { .sched_priority = 99 }; int in_cont = in_container(); int signo = SIGTERM; if (!in_cont) { /* * On a PREEMPT-RT system, Finit must run as the highest prioritized * RT process to ensure it completes the shutdown sequence. */ sched_setscheduler(1, SCHED_RR, &sched_param); } halt = op; if (sdown) run_interactive(sdown, "Calling shutdown hook: %s", sdown); /* Update UTMP db */ utmp_set_halt(); /* * Tell remaining non-monitored processes to exit, give them * time to exit gracefully, 2 sec was customary, we go for 1. */ do_iterate_proc(kill_cb, &signo); if (do_wait(1)) { signo = SIGKILL; do_iterate_proc(kill_cb, &signo); } /* Exit plugins gracefully */ plugin_exit(); /* We can no longer act on conditions, activate script runner */ cond_exit(); /* Reap 'em */ while (waitpid(-1, NULL, WNOHANG) > 0) ; /* All services and (non-critical) processes have stopped. */ plugin_script_run(HOOK_SVC_DN); if (in_cont) { if (osheading) logit(LOG_CONSOLE | LOG_NOTICE, "%s, shutting down container.", osheading); _exit(0); } /* Close all local non-console descriptors */ for (int fd = 3; fd < 128; fd++) close(fd); if (vfork()) { /* * Put PID 1 aside and let child perform reboot/halt * kernel may exit child and we don't want to exit PID 1 * ... causing "aiii killing init" during reboot ... */ return; } if (wdog) { print(kill(wdog->pid, SIGPWR) == 1, "Advising watchdog, system going down"); do_sleep(2); } /* Unmount any tmpfs before unmounting swap ... */ print(0, "Unmounting filesystems ..."); unmount_tmpfs(); fs_swapoff(); /* ... unmount remaining regular file systems. */ unmount_regular(); /* * We sit on / so we must remount it ro, try all the things! * See the following links for details: * - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=339023 * - https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/29187 */ sync(); run("mount -n -o remount,ro -t dummytype dummydev /", NULL); run("mount -n -o remount,ro dummydev /", NULL); run("mount -n -o remount,ro /", "mount"); /* Call mdadm to mark any RAID array(s) as clean before halting. */ mdadm_wait(); /* Last chance to run scripts (all .so plugins have exited already) */ print(0, "Calling hook/svc/down scripts ..."); plugin_script_run(HOOK_SYS_DN); /* * Optional reboot-delay, needed on systems running ubifs, jffs, * or similar. From fileutils-4.0, sync(8); "On Linux, sync is * only guaranteed to schedule the dirty blocks for writing; it * can actually take a short time before all the blocks are * finally written." -- https://linux.die.net/man/8/sync */ sync(); if (syncsec > 0) { print(-1, "Reboot delay, waiting for filesystem sync, %d sec", syncsec); do_sleep(syncsec); print(0, NULL); } /* Reboot via watchdog or kernel, or shutdown? */ if (op == SHUT_REBOOT) { print(0, "Rebooting ..."); if (wdog && wdog->pid > 1) { int timeout = 10; /* Wait here until the WDT reboots, or timeout with fallback */ print(kill(wdog->pid, SIGTERM) == 1, "Pending watchdog reboot"); while (timeout--) do_sleep(1); } dbg("Rebooting ..."); reboot(RB_AUTOBOOT); } else if (op == SHUT_OFF) { print(0, "Powering down ..."); reboot(RB_POWER_OFF); } /* Also fallback if any of the other two fails */ print(0, "Halting ..."); reboot(RB_HALT_SYSTEM); } /* * Reload .conf files in /etc/finit.d/ */ static void sighup_cb(uev_t *w, void *arg, int events) { (void)arg; dbg("..."); if (UEV_ERROR == events) { errx(1, "Unrecoverable error in signal watcher"); return; } if (IS_RESERVED_RUNLEVEL(runlevel)) { warnx("SIGHUP ignored in runlevel S and 6."); return; } /* Restart initctl API domain socket, similar to systemd/SysV init */ api_exit(); api_init(w->ctx); /* INIT_CMD_RELOAD: 'init q', 'initctl reload', and SIGHUP */ sm_reload(); } /* * SIGINT: generates condition, which the sys.so * plugin picks up and tells Finit to start any service(s) or * task(s) associated with the condition. */ static void sigint_cb(uev_t *w, void *arg, int events) { (void)w; (void)arg; dbg("..."); if (UEV_ERROR == events) { errx(1, "Unrecoverable error in signal watcher"); return; } cond_set_oneshot_noupdate("sys/key/ctrlaltdel"); } /* * SIGPWR: generates condition, which the sys.so plugin * picks up and tells Finit to start any service(s) or task(s) * associated with the condition. */ static void sigpwr_cb(uev_t *w, void *arg, int events) { (void)w; (void)arg; dbg("..."); if (UEV_ERROR == events) { errx(1, "Unrecoverable error in signal watcher"); return; } cond_set_oneshot_noupdate("sys/pwr/fail"); } /* * SIGUSR1: SysV init/systemd API socket restart */ static void sigusr1_cb(uev_t *w, void *arg, int events) { (void)arg; dbg("..."); if (UEV_ERROR == events) { errx(1, "Unrecoverable error in signal watcher"); return; } if (IS_RESERVED_RUNLEVEL(runlevel)) { warnx("SIGUSR1 ignored in runlevel S and 6."); return; } /* Restart initctl API domain socket, similar to systemd/SysV init */ api_exit(); api_init(w->ctx); } /* * SIGUSR2: BusyBox style poweroff */ static void sigusr2_cb(uev_t *w, void *arg, int events) { (void)w; (void)arg; dbg("..."); if (UEV_ERROR == events) { errx(1, "Unrecoverable error in signal watcher"); return; } if (IS_RESERVED_RUNLEVEL(runlevel)) { warnx("SIGUSR2 ignored in runlevel S and 6."); return; } halt = SHUT_OFF; sm_runlevel(0); } /* * SIGTERM: BusyBox style reboot */ static void sigterm_cb(uev_t *w, void *arg, int events) { (void)w; (void)arg; dbg("..."); if (UEV_ERROR == events) { errx(1, "Unrecoverable error in signal watcher"); return; } if (IS_RESERVED_RUNLEVEL(runlevel)) { warnx("SIGTERM ignored in runlevel S and 6."); return; } halt = SHUT_REBOOT; sm_runlevel(6); } /* * SIGCHLD: one of our children has died */ static void sigchld_cb(uev_t *w, void *arg, int events) { int status; pid_t pid; (void)w; (void)arg; if (UEV_ERROR == events) { errx(1, "Unrecoverable error in signal watcher"); return; } /* Reap all the children! */ while (1) { pid = waitpid(-1, &status, WNOHANG); if (pid <= 0) { if (pid == -1 && errno == EINTR) continue; break; } dbg("Collected child PID %d, status: %d", pid, status); service_monitor(pid, status); } } /* * Convert SIGFOO to a number, if it exists */ int sig_num(const char *name) { size_t i, offset = 0; if (strncasecmp(name, "SIG", 3)) offset = 3; for (i = 0; i < NELEMS(signames); i++) { if (strcasecmp(name, &signames[i].name[offset])) continue; return signames[i].num; } return -1; } const char *sig_name(int signo) { size_t i; for (i = 0; i < NELEMS(signames); i++) { if (signames[i].num == signo) return signames[i].name; } return "SIGUNKOWN"; } /* * Initial signal setup - ignore everything but SIGCHLD until we're capable of responding */ static void chld_handler(int sig, siginfo_t *info, void *ctx) { (void)sig; (void)info; (void)ctx; /* NOP */ } void sig_init(void) { struct sigaction sa; int i; for (i = 1; i < NSIG; i++) IGNSIG(sa, i, SA_RESTART); SETSIG(sa, SIGCHLD, chld_handler, SA_RESTART); } /* * Unblock all signals blocked by finit when starting children */ void sig_unblock(void) { struct sigaction sa; sigset_t nmask; int i; sigemptyset(&nmask); sigaddset(&nmask, SIGHUP); sigaddset(&nmask, SIGCHLD); sigaddset(&nmask, SIGINT); sigaddset(&nmask, SIGPWR); sigaddset(&nmask, SIGSTOP); sigaddset(&nmask, SIGTSTP); sigaddset(&nmask, SIGCONT); sigaddset(&nmask, SIGTERM); sigaddset(&nmask, SIGUSR1); sigaddset(&nmask, SIGUSR2); sigprocmask(SIG_UNBLOCK, &nmask, NULL); /* Reset signal handlers that were set by the parent process */ for (i = 1; i < NSIG; i++) DFLSIG(sa, i, 0); } /* * Setup limited set of SysV compatible signals to respond to */ void sig_setup(uev_ctx_t *ctx) { struct sigaction sa; dbg("Setup signals"); /* * Standard SysV init calls ctrl-alt-delete handler * We need to disable kernel default so it sends us SIGINT */ reboot(RB_DISABLE_CAD); uev_signal_init(ctx, &sigint_watcher, sigint_cb, NULL, SIGINT); /* BusyBox/SysV init style signals for halt, power-off and reboot. */ uev_signal_init(ctx, &sigusr1_watcher, sigusr1_cb, NULL, SIGUSR1); uev_signal_init(ctx, &sigusr2_watcher, sigusr2_cb, NULL, SIGUSR2); uev_signal_init(ctx, &sigpwr_watcher, sigpwr_cb, NULL, SIGPWR); uev_signal_init(ctx, &sigterm_watcher, sigterm_cb, NULL, SIGTERM); /* Some C APIs may need SIGALRM for implementing timers. */ IGNSIG(sa, SIGALRM, 0); /* /etc/inittab not supported yet, instead /etc/finit.d/ is scanned for *.conf */ uev_signal_init(ctx, &sighup_watcher, sighup_cb, NULL, SIGHUP); /* After initial bootstrap of Finit we call the service monitor to reap children */ uev_signal_init(ctx, &sigchld_watcher, sigchld_cb, NULL, SIGCHLD); setsid(); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/service.c0000644000175100001660000023142215054341541010636 /* Finit service monitor, task starter and generic API for managing svc_t * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include /* isblank() */ #include /* sched_yield() */ #include #include #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include #include "cgroup.h" #include "client.h" #include "conf.h" #include "cond.h" #include "devmon.h" #include "finit.h" #include "helpers.h" #include "pid.h" #include "private.h" #include "sig.h" #include "service.h" #include "sm.h" #include "tty.h" #include "util.h" #include "utmp-api.h" #include "schedule.h" #define NOTIFY_PATH "@run/finit/notify/%d" /* * run tasks block other tasks/services from starting, we track the * current run task here. For service_step() and service_start(). */ static pid_t run_block_pid; static struct wq work = { .cb = service_worker, }; int service_interval = SERVICE_INTERVAL_DEFAULT; static void svc_set_state(svc_t *svc, svc_state_t new_state); static void service_notify_cb(uev_t *w, void *arg, int events); /** * service_timeout_cb - libuev callback wrapper for service timeouts * @w: Watcher * @arg: Callback argument, from init * @events: Error, or ready to read/write (N/A for relative timers) * * Run callback registered when calling service_timeout_after(). */ static void service_timeout_cb(uev_t *w, void *arg, int events) { svc_t *svc = arg; if (UEV_ERROR == events) { dbg("%s: spurious problem", svc_ident(svc, NULL, 0)); uev_timer_start(w); return; } if (svc->timer_cb) svc->timer_cb(svc); } /** * service_timeout_after - Call a function after some time has elapsed * @svc: Service to use as argument to the callback * @timeout: Timeout, in milliseconds * @cb: Callback function * * After @timeout milliseconds has elapsed, call @cb() with @svc as the * argument. * * Returns: * POSIX OK(0) on success, non-zero on error. */ int service_timeout_after(svc_t *svc, int timeout, void (*cb)(svc_t *svc)) { if (timeout == 0) return 0; /* OK, not starting timer. */ if (svc->timer_cb) return -EBUSY; svc->timer_cb = cb; return uev_timer_init(ctx, &svc->timer, service_timeout_cb, svc, timeout, 0); } /** * service_timeout_cancel - Cancel timeout associated with service * @svc: Service whose timeout to cancel * * If a timeout is associated with @svc, cancel it. * * Returns: * POSIX OK(0) on success, non-zero on error. */ int service_timeout_cancel(svc_t *svc) { int err; if (!svc->timer_cb) return 0; err = uev_timer_stop(&svc->timer); svc->timer_cb = NULL; return err; } struct assoc { TAILQ_ENTRY(assoc) link; pid_t pid; /* script pid */ svc_t *svc; /* associated svc_t */ }; static TAILQ_HEAD(, assoc) svc_assoc_list = TAILQ_HEAD_INITIALIZER(svc_assoc_list); static void service_script_kill(svc_t *svc) { struct assoc *ptr, *next; TAILQ_FOREACH_SAFE(ptr, &svc_assoc_list, link, next) { if (ptr->svc != svc || ptr->pid <= 1) continue; dbg("Killing service %s script PID %d.", svc_ident(svc, NULL, 0), ptr->pid); kill(ptr->pid, SIGKILL); TAILQ_REMOVE(&svc_assoc_list, ptr, link); free(ptr); } } static int service_script_add(svc_t *svc, pid_t pid, int tmo) { struct assoc *ptr; ptr = malloc(sizeof(*ptr)); if (!ptr) { err(1, "Failed starting service script timer"); return 1; } ptr->svc = svc; ptr->pid = pid; TAILQ_INSERT_TAIL(&svc_assoc_list, ptr, link); service_timeout_after(svc, tmo, service_script_kill); return 0; } static int service_script_del(pid_t pid) { struct assoc *ptr, *next; TAILQ_FOREACH_SAFE(ptr, &svc_assoc_list, link, next) { if (ptr->pid != pid) continue; dbg("Collected service %s script PID %d, killing process group.", svc_ident(ptr->svc, NULL, 0), pid); service_timeout_cancel(ptr->svc); kill(-ptr->pid, SIGKILL); TAILQ_REMOVE(&svc_assoc_list, ptr, link); free(ptr); return 0; } return 1; } /* * Redirect stdin to /dev/null => all reads by process = EOF * https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Logging%20and%20Standard%20Input/Output */ static int stdin_redirect(void) { int fd; fd = open("/dev/null", O_RDONLY); if (fd == -1) { warn("Failed opening /dev/null for stdin redirect"); return -1; } dup2(fd, STDIN_FILENO); close(fd); return 0; } /* * Redirect output to a file, e.g., /dev/null, or /dev/console */ static int fredirect(const char *file) { int fd; fd = open(file, O_WRONLY | O_APPEND | O_NOCTTY); if (-1 != fd) { dup2(fd, STDOUT_FILENO); dup2(fd, STDERR_FILENO); return close(fd); } return -1; } /* * Fallback in case we don't even have logger on the system. * XXX: we should parse 'prio' here to get facility.level */ static void fallback_logger(char *ident, char *prio) { int facility = LOG_DAEMON; int level = LOG_NOTICE; char buf[256]; strlcpy(buf, prio, sizeof(buf)); log_parse(buf, &facility, &level); prctl(PR_SET_NAME, "finitlog", 0, 0, 0); openlog(ident, LOG_NOWAIT | LOG_PID, facility); while ((fgets(buf, sizeof(buf), stdin))) syslog(level, "%s", buf); closelog(); } /* * Redirect output to syslog using the command line logit tool */ static int lredirect(svc_t *svc) { static int have_sysklogd = -1; pid_t svc_pid = getpid(); pid_t pid; int fd; /* * Open PTY to connect to logger. A pty isn't buffered * like a pipe, and it eats newlines so they aren't logged */ fd = posix_openpt(O_RDWR); if (fd == -1) { dbg("Failed posix_openpt(), errno %d: %s", errno, strerror(errno)); svc->log.enabled = 0; return -1; } if (grantpt(fd) == -1 || unlockpt(fd) == -1) { dbg("Failed grantpt()|unlockpt(), errno %d: %s", errno, strerror(errno)); close(fd); svc->log.enabled = 0; return -1; } /* * First time, check if we have sysklogd logger tool. * It supports logging the actual PID of the service. */ if (have_sysklogd == -1) { FILE *pp; have_sysklogd = 0; pp = popen("logger -h 2>/dev/null", "r"); if (pp) { char buf[128]; while (fgets(buf, sizeof(buf), pp)) { if (strstr(buf, "-I PID")) { have_sysklogd = 1; break; } } pclose(pp); } } pid = fork(); if (pid == 0) { char *prio = "daemon.info"; char buf[MAX_IDENT_LEN]; char *tag; int fds; sched_yield(); fds = open(ptsname(fd), O_RDONLY); close(fd); if (fds == -1) { logit(LOG_WARNING, "failed open() ptsname(%d), errno %d", fd, errno); _exit(0); } dup2(fds, STDIN_FILENO); /* Reset signals */ sig_unblock(); /* Default syslog identity name[:id] */ tag = svc_ident(svc, buf, sizeof(buf)); if (svc->log.ident[0]) tag = svc->log.ident; if (svc->log.prio[0]) prio = svc->log.prio; /* Neither sysklogd logger or native logit tool available */ if (!have_sysklogd && !whichp(_PATH_LOGIT)) { logit(LOG_INFO, _PATH_LOGIT " missing, using syslog for %s instead", svc->name); fallback_logger(tag, prio); _exit(0); } if (svc->log.file[0] == '/') { if (have_sysklogd) { char rot[25], pid[16]; snprintf(rot, sizeof(rot), "%d:%d", logfile_size_max, logfile_count_max); snprintf(pid, sizeof(pid), "%d", svc_pid); execlp("logger", "logger", "-f", svc->log.file, "-b", "-t", tag, "-p", prio, "-I", pid, "-r", rot, debug ? "-s" : NULL, NULL); } else { char sz[20], num[3]; snprintf(sz, sizeof(sz), "%d", logfile_size_max); snprintf(num, sizeof(num), "%d", logfile_count_max); execlp(_PATH_LOGIT, "logit", "-f", svc->log.file, "-n", sz, "-r", num, debug ? "-s" : NULL, NULL); } _exit(1); } /* * For now, let systemd programs go via our native logit * tool. It supports systemd logging defines for stderr * parsing. The only real downside is that it cannot do * PID faking, like sysklogd's logger tool. */ if (have_sysklogd && svc->notify != SVC_NOTIFY_SYSTEMD) { char pid[16]; snprintf(pid, sizeof(pid), "%d", svc_pid); execlp("logger", "logger", "-t", tag, "-p", prio, "-I", pid, debug ? "-s" : NULL, NULL); } else { execlp(_PATH_LOGIT, "logit", "-t", tag, "-p", prio, debug ? "-s" : NULL, NULL); } _exit(1); } dup2(fd, STDOUT_FILENO); dup2(fd, STDERR_FILENO); return close(fd); } /* * Handle redirection of process output, if enabled */ static int redirect(svc_t *svc) { stdin_redirect(); if (svc->log.enabled) { if (svc->log.null) return fredirect("/dev/null"); if (svc->log.console) return fredirect(console()); return lredirect(svc); } else if (debug) return fredirect(console()); #ifdef REDIRECT_OUTPUT else return fredirect("/dev/null"); #endif return 0; } /* * Source environment file, if it exists * Note: must be called from privsepped child */ static void source_env(svc_t *svc) { char *buf, *val, *line, *fn; FILE *fp; fn = svc_getenv(svc); if (!fn) return; /* Warning in service_start() after svc_checkenv() */ fp = fopen(fn, "r"); if (!fp) return; buf = alloca(LINE_SIZE); val = alloca(LINE_SIZE); if (!buf || !val) { warn("Failed allocating temporary env buffer"); return; } line = buf; while (fgets(line, LINE_SIZE, fp)) { wordexp_t we = { 0 }; char *key, *value; size_t i; /* Trim newline */ key = chomp(line); /* skip any leading whitespace */ while (isspace(*key)) key++; /* skip comments */ if (*key == '#' || *key == ';') continue; key = conf_parse_env(key, &value); if (!key) continue; if (wordexp(value, &we, 0)) { setenv(key, value, 1); } else { for (i = 0, *val = 0; i < we.we_wordc; i++) { if (i > 0) strlcat(val, " ", LINE_SIZE); strlcat(val, we.we_wordv[i], LINE_SIZE); } setenv(key, val, 1); } wordfree(&we); } fclose(fp); } static int is_norespawn(void) { return fexist("/mnt/norespawn") || fexist("/tmp/norespawn"); } /* used for process group name, derived from originating filename, * so to group multiple services, place them in the same .conf */ static char *group_name(svc_t *svc, char *buf, size_t len) { char *ptr; if (!svc->file[0]) return svc_ident(svc, buf, len); ptr = strrchr(svc->file, '/'); if (ptr) ptr++; else ptr = svc->file; strlcpy(buf, ptr, len); ptr = strstr(buf, ".conf"); if (ptr) *ptr = 0; return buf; } static void compose_cmdline(svc_t *svc, char *buf, size_t len) { size_t i; strlcpy(buf, svc->cmd, len); for (i = 1; i < MAX_NUM_SVC_ARGS; i++) { if (!strlen(svc->args[i])) break; strlcat(buf, " ", len); strlcat(buf, svc->args[i], len); } } static pid_t service_fork(svc_t *svc) { pid_t pid; pid = fork(); if (pid == 0) { char *home = NULL; #ifdef ENABLE_STATIC int uid = 0; /* XXX: Fix better warning that dropprivs is disabled. */ int gid = 0; #else int uid = getuser(svc->username, &home); int gid = getgroup(svc->group); #endif sched_yield(); /* Set configured limits */ for (int i = 0; i < RLIMIT_NLIMITS; i++) { if (setrlimit(i, &svc->rlimit[i]) == -1) logit(LOG_WARNING, "%s: rlimit: failed setting %s", svc_ident(svc, NULL, 0), rlim2str(i)); } /* Set desired user+group */ if (gid >= 0) { if (setgid(gid)) err(1, "%s: failed setgid(%d)", svc_ident(svc, NULL, 0), gid); } if (uid >= 0) { if (setuid(uid)) err(1, "%s: failed setuid(%d)", svc_ident(svc, NULL, 0), uid); /* Set default path for regular users */ if (uid > 0) setenv("PATH", _PATH_DEFPATH, 1); if (home) { setenv("HOME", home, 1); if (chdir(home)) { if (chdir("/")) err(1, "%s: failed chdir(%s) and chdir(/)", svc_ident(svc, NULL, 0), home); } } } /* Source any environment from env:/path/to/file */ source_env(svc); } if (pid > 1) { char grnam[80]; if (svc_is_tty(svc)) cgroup_user("getty", pid); else cgroup_service(group_name(svc, grnam, sizeof(grnam)), pid, &svc->cgroup); } return pid; } /** * service_start - Start service * @svc: Service to start * * Returns: * 0 if the service was successfully started. Non-zero otherwise. */ static int service_start(svc_t *svc) { int result = 0, do_progress = 1; char cmdline[CMD_SIZE] = ""; sigset_t nmask, omask; int pipefd[2]; int fd = -1; int sd = -1; pid_t pid; size_t i; if (!svc) return 1; /* Ignore if finit is SIGSTOP'ed */ if (is_norespawn()) return 1; /* Waiting for a run task to complete */ if (run_block_pid) return 1; /* Don't try and start service if it doesn't exist. */ if (!whichp(svc->cmd)) { logit(LOG_WARNING, "%s: missing %s or not in $PATH", svc_ident(svc, NULL, 0), svc->cmd); svc_missing(svc); return 1; } /* Unlike systemd we do not allow starting service if env is missing, unless - */ if (!svc_checkenv(svc)) { logit(LOG_WARNING, "%s: missing %s env file %s", svc_ident(svc, NULL, 0), svc->cmd, svc->env); svc_missing(svc); return 1; } if (svc_is_tty(svc) && !svc->notty) { char *dev = tty_canonicalize(svc->dev); if (!dev || !tty_exists(dev)) { dbg("TTY %s missing or invalid, halting service.", svc->dev); svc_missing(svc); return 1; } } compose_cmdline(svc, cmdline, sizeof(cmdline)); if (bootstrap) conf_save_exec_order(svc, cmdline, -1); if (svc_is_sysv(svc)) logit(LOG_CONSOLE | LOG_NOTICE, "Calling '%s start' ...", cmdline); switch (svc->notify) { case SVC_NOTIFY_S6: if (pipe(pipefd) == -1) { err(1, "%s: failed opening pipe for s6 notify", svc_ident(svc, NULL, 0)); svc_missing(svc); return 1; } fd = pipefd[1]; sd = pipefd[0]; break; case SVC_NOTIFY_SYSTEMD: sd = socket(AF_UNIX, SOCK_DGRAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); if (sd == -1) { err(1, "%s: failed opening notify socket", svc_ident(svc, NULL, 0)); svc_missing(svc); return 1; } break; default: break; } if (!svc->desc[0]) do_progress = 0; if (do_progress) { if (svc_is_daemon(svc)) print_desc("Starting ", svc->desc); else print_desc("", svc->desc); } /* Declare we're waiting for svc to create its pidfile */ svc_starting(svc); /* Increment total restarts, unless first time or non-service */ if (svc_is_daemon(svc)) { if (svc->restart_cnt || svc->restart_tot) svc->restart_tot++; } /* Block SIGCHLD while forking. */ sigemptyset(&nmask); sigaddset(&nmask, SIGCHLD); sigprocmask(SIG_BLOCK, &nmask, &omask); pid = service_fork(svc); if (pid < 0) { if (sd != -1) close(sd); if (fd != -1) close(fd); result = -1; goto fail; } else if (pid > 0) { struct sockaddr_un sun; size_t len; dbg("Starting %s as PID %d", svc_ident(svc, NULL, 0), pid); svc->pid = pid; svc->start_time = jiffies(); switch (svc->notify) { case SVC_NOTIFY_SYSTEMD: memset(&sun, 0, sizeof(sun)); sun.sun_family = AF_UNIX; snprintf(sun.sun_path, sizeof(sun.sun_path), NOTIFY_PATH, pid); len = strlen(sun.sun_path); sun.sun_path[0] = 0; result = bind(sd, (struct sockaddr *)&sun, offsetof(struct sockaddr_un, sun_path) + len); if (result == -1) { err(1, "%s: failed binding to notify socket", svc_ident(svc, NULL, 0)); close(sd); break; } /* fallthrough */ case SVC_NOTIFY_S6: if (svc->notify == SVC_NOTIFY_S6) close(fd); /* client-end of pipefd for s6 notify */ result = uev_io_init(ctx, &svc->notify_watcher, service_notify_cb, svc, sd, UEV_READ); if (result < 0) { err(1, "%s: failed setting up notify callback", svc_ident(svc, NULL, 0)); close(sd); break; } default: break; } } else { /* pid == 0 */ char str[strlen(NOTIFY_PATH) + 32]; char *args[MAX_NUM_SVC_ARGS + 1]; int status; if (!svc_is_tty(svc)) redirect(svc); switch (svc->notify) { case SVC_NOTIFY_SYSTEMD: snprintf(str, sizeof(str), NOTIFY_PATH, getpid()); setenv("NOTIFY_SOCKET", str, 1); /* fallthrough */ case SVC_NOTIFY_S6: close(sd); break; default: break; } if (!svc_is_sysv(svc)) { wordexp_t we = { 0 }; int rc; if ((rc = wordexp(svc->cmd, &we, 0))) { errx(1, "%s: failed wordexp(%s): %d", svc_ident(svc, NULL, 0), svc->cmd, rc); nomem: wordfree(&we); _exit(1); } for (i = 0; i < MAX_NUM_SVC_ARGS; i++) { char *arg = svc->args[i]; size_t len = strlen(arg); char str[len + 2]; char ch = *arg; if (len == 0) break; if (svc->notify == SVC_NOTIFY_S6) { char *ptr = strstr(arg, "%n"); if (ptr) { len = snprintf(str, sizeof(str), "%d", fd); if (len > 0 && len <= 2) { ptr[0] = ' '; ptr[1] = ' '; memcpy(ptr, str, len); } } } /* * Escape forbidden characters in wordexp() * but allowed in Finit run/task stanzas, * * XXX: escapes only leading characters ... */ if (strchr("|<>&:", ch)) sprintf(str, "\\"); else str[0] = 0; strlcat(str, arg, sizeof(str)); if ((rc = wordexp(str, &we, WRDE_APPEND))) { errx(1, "%s: failed wordexp(%s): %d", svc_ident(svc, NULL, 0), str, rc); goto nomem; } } if (we.we_wordc > MAX_NUM_SVC_ARGS) { logit(LOG_ERR, "%s: too many args to %s after expansion.", svc_ident(svc, NULL, 0), svc->cmd); goto nomem; } for (i = 0; i < we.we_wordc; i++) { if (strlen(we.we_wordv[i]) >= sizeof(svc->args[i])) { logit(LOG_ERR, "%s: expanded %s arg. '%s' too long", svc_ident(svc, NULL, 0), svc->cmd, we.we_wordv[i]); rc = WRDE_NOSPACE; goto nomem; } /* overwrite the child's svc with expanded args */ strlcpy(svc->args[i], we.we_wordv[i], sizeof(svc->args[i])); args[i] = svc->args[i]; } wordfree(&we); } else { size_t j; i = 0; args[i++] = svc->cmd; /* this handles, e.g., bridge-stop br0 start */ for (j = 0; j < MAX_NUM_SVC_ARGS; j++) { if (!strlen(svc->args[j])) break; args[i++] = svc->args[j]; } args[i++] = "start"; } args[i] = NULL; #ifdef DEBUG_COMMAND_ARGS char buf[PATH_MAX] = ""; for (i = 0; args[i]; i++) { strlcat(buf, args[i], sizeof(buf)); strlcat(buf, " ", sizeof(buf)); } logit(LOG_DEBUG, "DEBUG starting %s", buf); buf[0] = 0; strlcat(buf, svc->cmd, sizeof(buf)); strlcat(buf, " ", sizeof(buf)); for (i = 1; i < MAX_NUM_SVC_ARGS; i++) { if (!strlen(svc->args[i])) break; strlcat(buf, svc->args[i], sizeof(buf)); strlcat(buf, " ", sizeof(buf)); } logit(LOG_DEBUG, "DEBUG starting args %s", buf); #endif /* * The setsid() call takes care to detach the process * from its controlling terminal, preventing daemons * from leaking to the console, and allowing us to run * such programs like `lxc-start -F` in the foreground * to properly monitor them. * * If you find yourself here wanting to fix the output * to the console at boot, for debugging or similar, * have a look at redirect() and log.console instead. */ pid = setsid(); if (pid < 1) syslog(LOG_ERR, "failed setsid(), pid %d: %s", pid, strerror(errno)); sig_unblock(); if (svc_is_runtask(svc)) status = exec_runtask(args[0], &args[1]); else if (svc_is_tty(svc)) status = tty_exec(svc); else status = execvp(args[0], &args[1]); syslog(LOG_ERR, "failed starting %s, exit code %d: %s", svc_ident(svc, NULL, 0), status, strerror(errno)); _exit(status); } if (!svc_is_sysv(svc)) logit(LOG_CONSOLE | LOG_NOTICE, "Starting %s[%d]", svc_ident(svc, NULL, 0), pid); switch (svc->type) { case SVC_TYPE_RUN: run_block_pid = pid; break; case SVC_TYPE_SERVICE: pid_file_create(svc); break; default: break; } fail: sigprocmask(SIG_SETMASK, &omask, NULL); if (do_progress && !run_block_pid) print_result(result); if (bootstrap && !run_block_pid) conf_save_exec_order(svc, NULL, result); return result; } /** * service_kill - Forcefully terminate a service * @param svc Service to kill * * Called when a service refuses to terminate gracefully. */ static void service_kill(svc_t *svc) { char *nm, *id = svc_ident(svc, NULL, 0); service_timeout_cancel(svc); if (svc->pid <= 1) { /* Avoid killing ourselves or all processes ... */ dbg("%s: Aborting SIGKILL, already terminated.", id); return; } nm = pid_get_name(svc->pid, NULL, 0); if (!nm) { /* PID possibly monitored by someone else? */ dbg("%s: Aborting SIGKILL, PID[%d] no longer exists.", id, svc->pid); service_monitor(svc->pid, 0); return; } dbg("%s: Sending SIGKILL to process %d", nm, svc->pid); logit(LOG_CONSOLE | LOG_NOTICE, "Stopping %s[%d], sending SIGKILL ...", id, svc->pid); if (runlevel != 1) print_desc("Killing ", svc->desc); kill(svc->pid, SIGKILL); /* Let SIGKILLs stand out, show result as [WARN] */ if (runlevel != 1) print(2, NULL); } /* * Call script with MAINPID environment set, and any environment specified * by env:file, wait for completion before resuming operation. * * Called by service_stop() and service_reload() when alternate mechanisms * for stopping and reloading have been specified by the user. */ static int service_run_script(svc_t *svc, char *script) { const char *id = svc_ident(svc, NULL, 0); pid_t pid = service_fork(svc); int status, rc; if (pid < 0) { err(1, "%s: failed forking off script %s", id, script); return 1; } if (pid == 0) { char *argv[4] = { "sh", "-c", script, NULL }; char pidbuf[16]; snprintf(pidbuf, sizeof(pidbuf), "%d", svc->pid); setenv("MAINPID", pidbuf, 1); sig_unblock(); execvp(_PATH_BSHELL, argv); _exit(EX_OSERR); } dbg("%s: script '%s' started as PID %d", id, script, pid); if (waitpid(pid, &status, 0) == -1) { warn("%s: failed calling script %s", id, script); return -1; } rc = WEXITSTATUS(status); if (WIFEXITED(status)) { dbg("%s: script '%s' exited without signal, status: %d", id, script, rc); } else if (WIFSIGNALED(status)) { dbg("%s: script '%s' terminated by signal %d", id, script, WTERMSIG(status)); if (!rc) rc = 1; } else { dbg("%s: script '%s' exited with status: %d", id, script, rc); } return rc; } /* Ensure we don't have any notify socket lingering */ static void service_notify_stop(svc_t *svc) { if (svc->notify != SVC_NOTIFY_SYSTEMD && svc->notify != SVC_NOTIFY_S6) return; uev_io_stop(&svc->notify_watcher); if (svc->notify_watcher.fd > 0) { close(svc->notify_watcher.fd); svc->notify_watcher.fd = 0; } } /* * Clean up any lingering state from dead/killed services */ static void service_cleanup(svc_t *svc) { char *fn; /* PID collected, cancel any pending SIGKILL */ service_timeout_cancel(svc); fn = pid_file(svc); if (fn && remove(fn) && errno != ENOENT) logit(LOG_CRIT, "Failed removing service %s pidfile %s", svc_ident(svc, NULL, 0), fn); service_notify_stop(svc); /* No longer running, update books. */ if (svc_is_tty(svc) && svc->pid > 1) utmp_set_dead(svc->pid); /* Set DEAD_PROCESS UTMP entry */ svc->oldpid = svc->pid; svc->starting = svc->start_time = svc->pid = 0; } /** * service_stop - Stop service * @svc: Service to stop * * Called externally by initctl to perform stop/start (restart) of * services. Internally it is used to bring a run/task/service to * HALTED state. * * Returns: * 0 if the service was successfully stopped. Non-zero otherwise. */ int service_stop(svc_t *svc) { const char *id = svc_ident(svc, NULL, 0); char cmdline[CMD_SIZE] = ""; int do_progress = 1; int rc = 0; if (!svc) return 1; if (svc->state <= SVC_STOPPING_STATE) return 0; service_timeout_cancel(svc); if (svc->stop_script[0]) { logit(LOG_CONSOLE | LOG_NOTICE, "%s[%d], calling stop:%s ...", id, svc->pid, svc->stop_script); } else if (!svc_is_sysv(svc)) { char *nm = pid_get_name(svc->pid, NULL, 0); const char *sig = sig_name(svc->sighalt); if (svc->pid <= 1) return 1; if (!nm) { dbg("Skipping stop (%s) of %s, PID[%d] no longer exists.", sig, id, svc->pid); service_cleanup(svc); svc_set_state(svc, SVC_HALTED_STATE); return 0; } dbg("Sending %s to pid:%d name:%s(%s)", sig, svc->pid, id, nm); logit(LOG_CONSOLE | LOG_NOTICE, "%s[%d], stopping, sending %s ...", id, svc->pid, sig); } else { compose_cmdline(svc, cmdline, sizeof(cmdline)); logit(LOG_CONSOLE | LOG_NOTICE, "%s[%d], calling '%s stop' ...", id, svc->pid, cmdline); } /* * Make sure we are no longer considering the service to be starting (if * that was the case). service_monitor() might get confused otherwise, and * leave the service in a lingering, "stopping", state. */ svc_started(svc); /* * Verify there's still something there before we send the reaper. */ if (svc->pid > 1 && !pid_alive(svc->pid)) { svc->pid = 0; return 0; } if (!svc->desc[0]) do_progress = 0; /* * Skip run/tasks in progress, would otherwise print silly stuff * like: "Stopping Shutting down" ... */ if (runlevel != 1 && do_progress && svc_is_daemon(svc)) print_desc("Stopping ", svc->desc); if (svc->stop_script[0]) { rc = service_run_script(svc, svc->stop_script); } else if (!svc_is_sysv(svc)) { if (svc->pid > 1) { /* * Send SIGTERM to parent process of process group, not to the * entire group. This gives the process time to properly stop * and/or forward TERM to its children. If it does not respond * in within a reasonable timeout we SIGKILL the entire group. */ rc = kill(svc->pid, svc->sighalt); dbg("kill(%d, %d) => rc %d, errno %d", svc->pid, svc->sighalt, rc, errno); /* PID lost or forking process never really started */ if (rc == -1 && (errno == ESRCH || errno == ENOENT)) rc = 1; } else { service_cleanup(svc); svc_set_state(svc, SVC_HALTED_STATE); } } else { char *args[MAX_NUM_SVC_ARGS + 1]; size_t i = 0, j; args[i++] = svc->cmd; /* this handles, e.g., bridge-stop br0 stop */ for (j = 0; j < MAX_NUM_SVC_ARGS - 2; j++) { if (!strlen(svc->args[j])) break; args[i++] = svc->args[j]; } args[i++] = "stop"; args[i] = NULL; switch (service_fork(svc)) { case 0: redirect(svc); setsid(); sig_unblock(); exec_runtask(args[0], &args[1]); _exit(0); break; case -1: err(1, "Failed fork() to call sysv script '%s stop'", cmdline); rc = 1; break; default: break; } } if (rc == 1) { service_cleanup(svc); svc_set_state(svc, SVC_HALTED_STATE); } else svc_set_state(svc, SVC_STOPPING_STATE); if (runlevel != 1 && do_progress && svc_is_daemon(svc)) print_result(rc); return rc; } /** * service_reload - Reload a service * @svc: Service to reload * * This function does some basic checks of the runtime state of Finit * and a sanity check of the @svc before sending %SIGHUP or calling * the reload:script command. * * Returns: * POSIX OK(0) or non-zero on error. */ static int service_reload(svc_t *svc) { const char *id = svc_ident(svc, NULL, 0); int do_progress = 1; pid_t lost = 0; int rc = 1; /* Ignore if service is invalid or finit is SIGSTOP'ed */ if (!svc || is_norespawn()) return 1; /* Skip progress if desc disabled or bootstrap task */ if (!svc->desc[0] || svc_in_runlevel(svc, INIT_LEVEL)) do_progress = 0; if (do_progress) print_desc("Restarting ", svc->desc); if (svc->reload_script[0]) { logit(LOG_CONSOLE | LOG_NOTICE, "%s[%d], calling reload:%s ...", id, svc->pid, svc->reload_script); rc = service_run_script(svc, svc->reload_script); } else if (svc->sighup) { if (svc->pid <= 1) { dbg("%s[%d]: bad PID, cannot reload service", id, svc->pid); svc->start_time = svc->pid = 0; goto done; } dbg("%s[%d], sending SIGHUP", id, svc->pid); logit(LOG_CONSOLE | LOG_NOTICE, "%s[%d], sending SIGHUP ...", id, svc->pid); rc = kill(svc->pid, SIGHUP); if (rc == -1 && (errno == ESRCH || errno == ENOENT)) { /* nobody home, reset internal state machine */ lost = svc->pid; } } else { warnx("%s: neither HUP nor reload:script defined, no action.", id); } if (!rc) { /* Declare we're waiting for svc to re-assert/touch its pidfile */ svc_starting(svc); /* Service does not maintain a PID file on its own */ if (svc_has_pidfile(svc)) { sched_yield(); touch(pid_file(svc)); } } done: if (do_progress) print_result(rc); if (lost) service_monitor(lost, 0); return rc; } /* * Parse run/task/service arguments with support for quoted strings, both * single and double quotes to allow arguments containing spaces. * * Returns next argument or NULL if end of line * Updates *line to point past the parsed argument */ static char *parse_args(char **line) { char *start, *end = NULL, *arg; char in_quote = 0; int has_colon = 0; if (!line || !*line) return NULL; /* Skip leading whitespace */ while (**line && (**line == ' ' || **line == '\t')) (*line)++; if (!**line) return NULL; start = *line; /* Parse the token */ while (**line) { if (in_quote) { if (**line == in_quote) { /* End quote found */ in_quote = 0; } } else { if (**line == '\'' || **line == '"') { /* Start quote */ in_quote = **line; } else if (**line == ':') { /* Found colon - this might be key:value format */ has_colon = 1; } else if (**line == ' ' || **line == '\t') { /* Whitespace - check if we're in key:value mode */ if (has_colon) { /* Look ahead to see if there's a comma after whitespace */ char *lookahead = *line; while (*lookahead && (*lookahead == ' ' || *lookahead == '\t')) lookahead++; if (*lookahead == ',') { /* Continue parsing - this space is part of the token */ (*line)++; continue; } } /* End token at whitespace */ end = *line; break; } } (*line)++; } /* Set end if we reached end of string */ if (!end) end = *line; /* Null terminate the argument */ if (end > start) { arg = start; if (*end) { *end = '\0'; *line = end + 1; } return arg; } return NULL; } /* * log:/path/to/logfile,priority:facility.level,tag:ident */ static void parse_log(svc_t *svc, char *arg) { char *tok; tok = strtok(arg, ":, "); while (tok) { if (!strcmp(tok, "log")) svc->log.enabled = 1; else if (!strcmp(tok, "null") || !strcmp(tok, "/dev/null")) svc->log.null = 1; else if (!strcmp(tok, "console") || !strcmp(tok, "/dev/console")) svc->log.console = 1; else if (tok[0] == '/') strlcpy(svc->log.file, tok, sizeof(svc->log.file)); else if (!strcmp(tok, "priority") || !strcmp(tok, "prio")) strlcpy(svc->log.prio, strtok(NULL, ","), sizeof(svc->log.prio)); else if (!strcmp(tok, "tag") || !strcmp(tok, "identity") || !strcmp(tok, "ident")) strlcpy(svc->log.ident, strtok(NULL, ","), sizeof(svc->log.ident)); tok = strtok(NULL, ":=, "); } } static svc_notify_t parse_notify(char *arg) { if (!strcmp(arg, "systemd")) return SVC_NOTIFY_SYSTEMD; if (!strcmp(arg, "s6")) return SVC_NOTIFY_S6; if (!strcmp(arg, "pid")) return SVC_NOTIFY_PID; return SVC_NOTIFY_NONE; /* unsupported/none */ } static void parse_env(svc_t *svc, char *env) { if (!env) return; if (strlen(env) >= sizeof(svc->env)) { errx(1, "%s: env file is too long (>%zu chars)", svc_ident(svc, NULL, 0), sizeof(svc->env)); return; } strlcpy(svc->env, env, sizeof(svc->env)); } /* * the @cgroup argument can be, e.g., .system:mem.max:1234 or just the * default group with some cfg, e.g., :mem.max:1234 as a side effect, * cgroupinit also work, selecting group init. */ static void parse_cgroup(svc_t *svc, char *cgroup) { char *ptr = NULL; if (!cgroup) return; if (cgroup[0] == '.') { ptr = strchr(cgroup, ':'); if (ptr) *ptr++ = 0; group: strlcpy(svc->cgroup.name, &cgroup[1], sizeof(svc->cgroup.name)); if (!ptr) return; } else if (cgroup[0] == ':') { ptr = &cgroup[1]; } else goto group; if (strlen(ptr) >= sizeof(svc->cgroup)) { errx(1, "%s: cgroup settings too long (>%zu chars)", svc_ident(svc, NULL, 0), sizeof(svc->cgroup)); return; } strlcpy(svc->cgroup.cfg, ptr, sizeof(svc->cgroup.cfg)); } static void parse_sighalt(svc_t *svc, char *arg) { int signo; signo = sig_num(arg); if (signo == -1) return; svc->sighalt = signo; } static void parse_killdelay(svc_t *svc, char *delay) { const char *errstr; long long sec; sec = strtonum(delay, 1, 300, &errstr); if (errstr) { errx(1, "%s: killdelay %s is %s (1-300)", svc_ident(svc, NULL, 0), delay, errstr); return; } /* convert to msec */ svc->killdelay = (int)(sec * 1000); } /* * pre:[0-3600,]/path/to/script */ static void parse_script(svc_t *svc, char *type, char *script, int *tmo, char *buf, size_t len) { char *found, *path; path = strchr(script, ','); if (path) { const char *errstr; long long sec; *path++ = 0; sec = strtonum(script, 0, 3600, &errstr); if (errstr) { errx(1, "%s: tmo %s is %s (0-3600)", svc_ident(svc, NULL, 0), script, errstr); goto err; } *tmo = (int)(sec * 1000); } else { path = script; if (tmo) *tmo = svc->killdelay; } if (unquote(&path, NULL)) { errx(1, "Syntax error, unterminated quote in %s:%s", type, path); goto err; } found = which(path); if (!found) { logit(LOG_WARNING, "%s:'%s' is missing or not executable, skipping.", type, path); goto err; } free(found); if (strlen(path) >= len) { errx(1, "Command too long in %s:%s", type, path); goto err; } strlcpy(buf, path, len); return; err: memset(buf, 0, len); } /* * 'name:' or derived from '/path/to/cmd args' */ static char *parse_name(char *cmd, char *arg) { char *name = NULL; if (arg && !strncasecmp(arg, "name:", 5)) { name = arg + 5; } else { char *ptr; ptr = strchr(cmd, ' '); if (!ptr) ptr = cmd + strlen(cmd); while (ptr > cmd) { if (*ptr == '/') { ptr++; break; } ptr--; } name = ptr; } return name; } /* * Update the command line args in the svc struct */ static void parse_cmdline_args(svc_t *svc, char *cmd, char **args) { char prev[MAX_CMD_LEN]; int diff = 0; char sep = 0; char *arg; int i = 0; if (strcmp(svc->args[i], cmd)) diff++; strlcpy(svc->args[i++], cmd, sizeof(svc->args[0])); /* * Copy supplied args. Stop at MAX_NUM_SVC_ARGS-1 to allow the args * array to be zero-terminated. */ while ((arg = strtok_r(NULL, " ", args)) && i < (MAX_NUM_SVC_ARGS - 1)) { char ch = arg[0]; size_t len; if (!sep) { strlcpy(prev, svc->args[i], sizeof(prev)); svc->args[i][0] = 0; } /* XXX: ugly string arg re-concatenation, fixme */ if (ch == '"' || ch == '\'') sep = ch; else if (sep) strlcat(svc->args[i], " ", sizeof(svc->args[0])); strlcat(svc->args[i], arg, sizeof(svc->args[0])); /* string arg contained already? */ len = strlen(arg); if (sep && len >= 1) { ch = arg[len - 1]; if (ch != sep) continue; } /* replace any @console arg with the expanded device name */ if (svc_is_tty(svc) && tty_isatcon(svc->args[i])) strlcpy(svc->args[i], svc->dev, sizeof(svc->args[i])); if (strcmp(svc->args[i], prev)) diff++; sep = 0; i++; } /* * Clear remaining args in case they were set earlier. * This also zero-terminates the args array. */ while (i < MAX_NUM_SVC_ARGS) { if (svc->args[i++][0]) { svc->args[i-1][0] = 0; diff++; } } /* * Check also for changes to /etc/default/foo, because this * also constitutes changes to command line args. */ diff += conf_changed(svc_getenv(svc)); if (diff) { char buf[256]; for (buf[0] = 0, i = 0; i < MAX_NUM_SVC_ARGS; i++) { if (!strlen(svc->args[i])) break; strlcat(buf, " ", sizeof(buf)); strlcat(buf, svc->args[i], sizeof(buf)); } dbg("Modified args for %s detected: %s", cmd, buf); } svc->args_dirty = (diff > 0); } /** * service_register - Register service, task or run commands * @type: %SVC_TYPE_SERVICE(0), %SVC_TYPE_TASK(1), %SVC_TYPE_RUN(2) * @cfg: Configuration, complete command, with -- for description text * @rlimit: Limits for this service/task/run, may be global limits * @file: The file name service was loaded from * * This function is used to register commands to be run on different * system runlevels with optional username. The @type argument details * if it's service to bo monitored/respawned (daemon), a one-shot task * or a command that must run in sequence and not in parallel, like * service and task commands do. * * The @line can optionally start with a username, denoted by an @ * character. Like this: * * service @username [!0-6,S] /path/to/daemon arg -- Description * task @username [!0-6,S] /path/to/task arg -- Description * run @username [!0-6,S] /path/to/cmd arg -- Description * * If the username is left out the command is started as root. The [] * brackets denote the allowed runlevels, if left out the default for a * service is set to [2-5]. Allowed runlevels mimic that of SysV init * with the addition of the 'S' runlevel, which is only run once at * startup. It can be seen as the system bootstrap. If a task or run * command is listed in more than the [S] runlevel they will be called * when changing runlevel. * * Services (daemons) also support an optional argument. * This is for services that depend on another service, e.g. Quagga ripd * depends on zebra, or require a system gateway or interface to be up * before they are started. Or restarted, or even SIGHUP'ed, when the * gateway changes or interfaces come and go. The special case when a * service is declared with means it does not support SIGHUP but * must be STOP/START'ed at system reconfiguration. For run/task a * means Finit can relax its promise to run at least once per runlevel. * I.e., for run/task conditions that would otherwise block bootstrap: * * task [S0123456789] name:pwrfail initctl poweroff -- Power failure, shutting down * * Conditions can for example be: pid/NAME:ID for process dependencies, * net//up or net//exists. The condition handling is * further described in doc/conditions.md, but worth mentioning here is * that the condition a services *provides* can be modified using the * :ID and name:foo syntax. * * For multiple instances of the same command, e.g. multiple DHCP * clients, the user must enter an ID, using the :ID syntax. * * service :eth1 /sbin/udhcpc -i eth1 * service :eth2 /sbin/udhcpc -i eth2 * * Without the :ID syntax, Finit replaces the first service line with * the contents of the second. The :ID can be any string value and * defaults to "" (empty string). * * Returns: * POSIX OK(0) on success, or non-zero errno exit status on failure. */ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file) { char *cmd, *desc, *runlevels = NULL, *cond = NULL; char *username = NULL, *log = NULL, *pid = NULL; char *name = NULL, *halt = NULL, *delay = NULL; char *id = NULL, *env = NULL, *cgroup = NULL; char *pre_script = NULL, *post_script = NULL; char *ready_script = NULL, *conflict = NULL; char *reload_script = NULL, *stop_script = NULL; char *cleanup_script = NULL; char ident[MAX_IDENT_LEN]; char *ifstmt = NULL; char *notify = NULL; struct tty tty = { 0 }; char *dev = NULL; int respawn = 0; int levels = 0; int forking = 0, manual = 0, nowarn = 0; int restart_max = SVC_RESPAWN_MAX; int restart_tmo = 0; unsigned oncrash_action = SVC_ONCRASH_IGNORE; char *line, *args; svc_t *svc; if (!cfg) { errx(1, "Invalid input argument"); return errno = EINVAL; } line = strdupa(cfg); if (!line) return 1; desc = strstr(line, "-- "); if (desc) { *desc = 0; desc += 3; while (*desc && isblank(*desc)) desc++; } else { int pos; /* Find "--\n" to denote empty/no description */ pos = (int)strlen(line) - 2; if (pos > 0 && !strcmp(&line[pos], "--")) { line[pos] = 0; desc = &line[pos]; } } args = line; cmd = parse_args(&args); if (!cmd) { incomplete: errx(1, "Incomplete service '%s', cannot register", cfg); return errno = ENOENT; } while (cmd) { char *arg; if (type == SVC_TYPE_TTY && cmd[0] == '@') break; /* @console */ if (cmd[0] == '@') /* @username[:group] */ username = &cmd[1]; else if (cmd[0] == '[') /* [runlevels] */ runlevels = &cmd[0]; else if (cmd[0] == '<') /* <[!][cond][,cond..]> */ cond = &cmd[1]; else if (cmd[0] == ':') /* :ID */ id = &cmd[1]; else if (MATCH_CMD(cmd, "log", arg)) log = cmd; else if (MATCH_CMD(cmd, "pid", arg)) pid = cmd; else if (MATCH_CMD(cmd, "name:", arg)) name = cmd; else if (MATCH_CMD(cmd, "notify:", arg)) notify = arg; else if (MATCH_CMD(cmd, "type:forking", arg)) forking = 1; else if (MATCH_CMD(cmd, "manual:yes", arg)) manual = 1; else if (MATCH_CMD(cmd, "restart:", arg)) { if (MATCH_CMD(arg, "always", arg)) restart_max = -1; else restart_max = atoi(arg); } else if (MATCH_CMD(cmd, "restarttmo:", arg)) /* compat alias */ restart_tmo = atoi(arg) * 1000; else if (MATCH_CMD(cmd, "restart_sec:", arg)) restart_tmo = atoi(arg) * 1000; else if (MATCH_CMD(cmd, "norestart", arg)) restart_max = 0; else if (MATCH_CMD(cmd, "nowarn", arg)) nowarn = 1; else if (MATCH_CMD(cmd, "oncrash:", arg)) { if (MATCH_CMD(arg, "reboot", arg)) oncrash_action = SVC_ONCRASH_REBOOT; if (MATCH_CMD(arg, "script", arg)) oncrash_action = SVC_ONCRASH_SCRIPT; } else if (MATCH_CMD(cmd, "respawn", arg)) respawn = 1; else if (MATCH_CMD(cmd, "halt:", arg)) halt = arg; else if (MATCH_CMD(cmd, "kill:", arg)) delay = arg; else if (MATCH_CMD(cmd, "pre:", arg)) pre_script = arg; else if (MATCH_CMD(cmd, "post:", arg)) post_script = arg; else if (MATCH_CMD(cmd, "ready:", arg)) ready_script = arg; else if (MATCH_CMD(cmd, "cleanup:", arg)) cleanup_script = arg; else if (MATCH_CMD(cmd, "reload:", arg)) reload_script = arg; else if (MATCH_CMD(cmd, "stop:", arg)) stop_script = arg; else if (MATCH_CMD(cmd, "env:", arg)) env = arg; /* catch both cgroup: and cgroup. handled in parse_cgroup() */ else if (MATCH_CMD(cmd, "cgroup", arg)) cgroup = arg; else if (MATCH_CMD(cmd, "conflict:", arg)) conflict = arg; else if (MATCH_CMD(cmd, "if:", arg)) ifstmt = arg; else break; /* Check if valid command follows... */ cmd = parse_args(&args); if (!cmd) goto incomplete; } name = parse_name(cmd, name); strlcpy(ident, name, sizeof(ident)); if (!id) { id = ""; } else { strlcat(ident, ":", sizeof(ident)); strlcat(ident, id, sizeof(ident)); } if (ifstmt && !svc_ifthen(1, ident, ifstmt, nowarn)) return 0; levels = conf_parse_runlevels(runlevels); if (runlevel != INIT_LEVEL && !ISOTHER(levels, INIT_LEVEL)) { dbg("Skipping %s%s%s, bootstrap is completed.", name, id[0] ? ":" : "", id[0] ? id : ""); return 0; } if (type == SVC_TYPE_TTY) { size_t i, len; char *ptr; if (tty_parse_args(&tty, cmd, &args)) return errno; /* NOTE: this may result in dev == NULL! */ if (tty_isatcon(tty.dev)) dev = tty_atcon(); else dev = tty.dev; next: len = 0; if (tty.cmd) len += strlen(tty.cmd); else len += 3; len += tty.num + 1; for (i = 0; i < tty.num; i++) len += strlen(tty.args[i]) + 1; line = alloca(len); if (!line) return errno; snprintf(line, len, "%s", tty.cmd ? tty.cmd : "tty"); for (i = 0; i < tty.num; i++) { strlcat(line, " ", len); strlcat(line, tty.args[i], len); } cmd = strtok_r(line, " \t", &args); if (!cmd) return errno; /* tty's always respawn, never incr. restart_cnt */ respawn = 1; /* Create name:id tuple for identity, e.g., tty:S0 */ if (dev) { ptr = strrchr(dev, '/'); if (ptr) ptr++; else ptr = dev; if (!strncmp(ptr, "tty", 3)) ptr += 3; name = "tty"; if (!id || id[0] == 0) id = ptr; } svc = svc_find_by_tty(dev); } else svc = svc_find(name, id); if (!whichp(cmd)) { if (nowarn) return 0; warn("%s: skipping %s", file ? file : "static", cmd); return errno; } if (!svc) { dbg("Creating new svc for %s name %s id %s type %d", cmd, name, id, type); svc = svc_new(cmd, name, id, type); if (!svc) { errx(1, "Out of memory, cannot register service %s", cmd); return errno = ENOMEM; } if (manual) svc_stop(svc); } else { dbg("Found existing svc for %s name %s id %s type %d", cmd, name, id, type); /* update type, may have changed from service -> task */ svc->type = type; /* update path, may have changed on reload */ strlcpy(svc->cmd, cmd, sizeof(svc->cmd)); /* e.g., if missing cmd or env before */ if (!manual) svc_unblock(svc); } if (username) { char *ptr = strchr(username, ':'); if (ptr) { *ptr++ = 0; strlcpy(svc->group, ptr, sizeof(svc->group)); } strlcpy(svc->username, username, sizeof(svc->username)); } else { getcuser(svc->username, sizeof(svc->username)); getcgroup(svc->group, sizeof(svc->group)); } svc->runlevels = levels; dbg("Service %s runlevel 0x%02x", svc_ident(svc, NULL, 0), svc->runlevels); conf_parse_cond(svc, cond); if (type == SVC_TYPE_TTY) { if (dev) strlcpy(svc->dev, dev, sizeof(svc->dev)); if (tty.baud) strlcpy(svc->baud, tty.baud, sizeof(svc->baud)); if (tty.term) strlcpy(svc->term, tty.term, sizeof(svc->term)); svc->noclear = tty.noclear; svc->nowait = tty.nowait; svc->nologin = tty.nologin; svc->notty = tty.notty; svc->rescue = tty.rescue; /* TTYs cannot be redirected */ log = NULL; } parse_cmdline_args(svc, cmd, &args); /* * Warn if svc generates same condition (based on name:id) * as an existing service. */ svc_validate(svc); if (halt) parse_sighalt(svc, halt); else svc->sighalt = svc_is_tty(svc) ? SIGHUP : SIGTERM; if (delay) parse_killdelay(svc, delay); else svc->killdelay = SVC_TERM_TIMEOUT; if (pre_script) parse_script(svc, "pre", pre_script, &svc->pre_tmo, svc->pre_script, sizeof(svc->pre_script)); else memset(svc->pre_script, 0, sizeof(svc->pre_script)); if (post_script) parse_script(svc, "post", post_script, &svc->post_tmo, svc->post_script, sizeof(svc->post_script)); else memset(svc->post_script, 0, sizeof(svc->post_script)); if (ready_script) parse_script(svc, "ready", ready_script, &svc->ready_tmo, svc->ready_script, sizeof(svc->ready_script)); else memset(svc->ready_script, 0, sizeof(svc->ready_script)); if (cleanup_script) parse_script(svc, "cleanup", cleanup_script, &svc->cleanup_tmo, svc->cleanup_script, sizeof(svc->cleanup_script)); else memset(svc->cleanup_script, 0, sizeof(svc->cleanup_script)); if (reload_script) parse_script(svc, "reload", reload_script, NULL, svc->reload_script, sizeof(svc->reload_script)); else memset(svc->reload_script, 0, sizeof(svc->reload_script)); if (stop_script) parse_script(svc, "stop", stop_script, NULL, svc->stop_script, sizeof(svc->stop_script)); else memset(svc->stop_script, 0, sizeof(svc->stop_script)); if (!svc_is_tty(svc)) { if (log) parse_log(svc, log); else svc->log.enabled = 0; } if (notify) svc->notify = parse_notify(notify); else svc->notify = readiness; if (desc) strlcpy(svc->desc, desc, sizeof(svc->desc)); else if (type == SVC_TYPE_TTY) snprintf(svc->desc, sizeof(svc->desc), "Getty on %s", svc->dev); if (env) parse_env(svc, env); else memset(svc->env, 0, sizeof(svc->env)); if (file) strlcpy(svc->file, file, sizeof(svc->file)); else memset(svc->file, 0, sizeof(svc->file)); if (conflict) strlcpy(svc->conflict, conflict, sizeof(svc->conflict)); else memset(svc->conflict, 0, sizeof(svc->conflict)); if (ifstmt) strlcpy(svc->ifstmt, ifstmt, sizeof(svc->ifstmt)); else memset(svc->ifstmt, 0, sizeof(svc->ifstmt)); svc->manual = manual; svc->nowarn = nowarn; svc->respawn = respawn; svc->forking = forking; svc->restart_max = restart_max; svc->restart_tmo = restart_tmo; svc->oncrash_action = oncrash_action; /* Decode any (optional) pid:/optional/path/to/file.pid */ if (svc_is_daemon(svc)) { char tmp[sizeof(svc->name) + 6]; /* pid:! + svc->name */ /* no pid: set, figure out a default to track this svc */ if (!pid && forking) { snprintf(tmp, sizeof(tmp), "pid:!%s", svc->name); pid = tmp; logit(LOG_INFO, "%s: forking but no pid:!file set, guessing -> %s", svc->name, tmp); } if (pid && pid_file_parse(svc, pid)) logit(LOG_WARNING, "%s: service has invalid 'pid:' config: %s", svc->name, pid); /* only set forking based on pidfile if user supplied pid: option */ if (pid && svc->pidfile[0] == '!') svc->forking = 1; if (svc->restart_tmo == 0) { if (svc_is_forking(svc)) svc->restart_tmo = 2000; else svc->restart_tmo = 1; } } /* Set configured limits */ memcpy(svc->rlimit, rlimit, sizeof(svc->rlimit)); /* Seed with currently active group, may be empty */ strlcpy(svc->cgroup.name, cgroup_current, sizeof(svc->cgroup.name)); if (cgroup) parse_cgroup(svc, cgroup); /* New, recently modified or unchanged ... used on reload. */ if ((file && conf_changed(file)) || conf_changed(svc_getenv(svc)) || svc->args_dirty) svc_mark_dirty(svc); else svc_mark_clean(svc); svc_enable(svc); /* for finit native services only, e.g. plugins/hotplug.c */ if (!file) svc->protect = 1; /* continue expanding any 'tty @console ...' */ if (tty_isatcon(tty.dev)) { dev = tty_atcon(); if (dev) { id = NULL; /* reset for next tty:ID */ goto next; } } return 0; } /* * This function is called at the end of a runlevel change or reload * command to delete all remnants of removed services. * * We need to ensure we properly stop the service before removing it, * including stopping any pending restart or SIGKILL timers before we * proceed to free() the svc itself. */ void service_unregister(svc_t *svc) { char *c; if (!svc) return; service_stop(svc); service_timeout_cancel(svc); for (c = strtok(svc->cond, ","); c; c = strtok(NULL, ",")) devmon_del_cond(c); svc_del(svc); } void service_monitor(pid_t lost, int status) { int sig = WIFSIGNALED(status); int rc = WEXITSTATUS(status); int ok = WIFEXITED(status); svc_t *svc; if (lost <= 1) return; /* main process as well as pre: and post: scripts use svc->pid */ svc = svc_find_by_pid(lost); if (!svc) { /* Check if ready: script in assoc list */ if (service_script_del(lost)) dbg("collected unknown PID %d", lost); return; } switch (svc->state) { case SVC_SETUP_STATE: /* If the setup phase fails, drive svc to crashed. */ svc->status = status; /* fallthrough */ case SVC_TEARDOWN_STATE: case SVC_CLEANUP_STATE: dbg("collected script %s(%d), normal exit: %d, signaled: %d, exit code: %d", (svc->state == SVC_TEARDOWN_STATE ? svc->post_script : (svc->state == SVC_CLEANUP_STATE ? svc->cleanup_script : svc->pre_script)), lost, ok, sig, rc); /* Prevent: spurious problem from timeout callback */ service_timeout_cancel(svc); /* Kill all children in the same proess group, e.g. logit */ dbg("Killing lingering children in same process group ..."); kill(-svc->pid, SIGKILL); goto done; default: dbg("collected %s(%d), normal exit: %d, signaled: %d, exit code: %d", svc_ident(svc, NULL, 0), lost, ok, sig, rc); svc->status = status; break; } /* Forking sysv/services declare themselves with pid:!/path/to/pid.file */ if (svc_is_forking(svc)) { /* Likely start script exiting */ if (svc_is_starting(svc)) { svc->pid = 0; /* Expect no more activity from this one */ goto cont; } logit(LOG_CONSOLE | LOG_NOTICE, "Stopped %s[%d]", svc_ident(svc, NULL, 0), lost); } /* Terminate any children in the same proess group, e.g. logit */ dbg("Killing lingering children in same process group ..."); kill(-svc->pid, SIGKILL); /* Try removing PID file (in case service does not clean up after itself) */ if (svc_is_daemon(svc) || svc_is_tty(svc)) { service_cleanup(svc); } else if (svc_is_runtask(svc)) { /* run/task should run at least once per runlevel */ svc->started = ok; } done: /* No longer running, update books. */ svc->start_time = svc->pid = 0; cont: if (lost == run_block_pid) { int result = ok ? rc : 1; svc_mark_clean(svc); /* done, regardless of exit status */ run_block_pid = 0; if (svc->desc[0]) print_result(result); if (bootstrap) conf_save_exec_order(svc, NULL, result); } if (!service_step(svc)) { /* Clean out any bootstrap tasks, they've had their time in the sun. */ if (svc_clean_bootstrap(svc)) dbg("collected bootstrap task %s(%d), removing.", svc_ident(svc, NULL, 0), lost); } sm_step(); } static void svc_mark_affected(char *cond) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (!svc_has_cond(svc)) continue; if (cond_affects(cond, svc->cond)) svc_mark_dirty(svc); } } /* * Called on conf_reload() to update service reverse dependencies. * E.g., if ospfd depends on zebra and the zebra Finit conf has * changed, we need to mark the ospfd Finit conf as changed too. * * However, a daemon that depends on syslogd (sysklogd project), need * not be reloeaded (SIGHUP'ed or stop/started) because syslogd support * reloading its configuration file on SIGHUP. */ void service_update_rdeps(void) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { char cond[MAX_COND_LEN]; if (!svc_is_changed(svc)) continue; /* Service supports reloading conf without stop/start */ if (!svc_is_noreload(svc)) continue; /* Yup, no need to stop start rdeps */ svc_mark_affected(mkcond(svc, cond, sizeof(cond))); } } /* * Drop services with 'if:otherserv' if otherserv does not exist. * Drop services with 'if:!otherserv' if otherserv does exist. */ void service_mark_unavail(void) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { char buf[MAX_IDENT_LEN]; if (!svc->ifstmt[0]) continue; if (!svc_ifthen(1, svc_ident(svc, buf, sizeof(buf)), svc->ifstmt, svc->nowarn)) svc_mark(svc); } } static void service_kill_script(svc_t *svc) { if (svc->pid <= 1) return; dbg("Timeout, killing service %s script PID %d", svc_ident(svc, NULL, 0), svc->pid); kill(svc->pid, SIGKILL); } /* * Shared env vars for both pre: and post: scripts */ static void set_pre_post_envs(svc_t *svc, const char *type) { char buf[25 + 256] = "/etc/default:/etc/conf.d"; setenv("SERVICE_TYPE", svc_typestr(svc), 1); setenv("SERVICE_NAME", svc->name, 1); if (svc->id[0]) setenv("SERVICE_ID", svc->id, 1); setenv("SERVICE_IDENT", svc_ident(svc, NULL, 0), 1); setenv("SERVICE_SCRIPT_TYPE", type, 1); #ifdef FINIT_SYSCONFIG strlcat(buf, ":", sizeof(buf)); strlcat(buf, FINIT_SYSCONFIG, sizeof(buf)); #endif setenv("SERVICE_CONF_DIR", buf, 1); } static void service_pre_script(svc_t *svc) { svc->pid = service_fork(svc); if (svc->pid < 0) { err(1, "Failed forking off %s pre:script %s", svc_ident(svc, NULL, 0), svc->pre_script); return; } if (svc->pid == 0) { char buf[CMD_SIZE]; char *argv[4] = { "sh", "-ac", buf, NULL }; char *env_file; redirect(svc); /* Warning in service_start() after svc_checkenv() */ env_file = svc_getenv(svc); if (env_file && fexist(env_file)) snprintf(buf, sizeof(buf), ". %s; exec %s", env_file, svc->pre_script); else strlcpy(buf, svc->pre_script, sizeof(buf)); set_pre_post_envs(svc, "pre"); sig_unblock(); execvp(_PATH_BSHELL, argv); _exit(EX_OSERR); } dbg("%s: pre:script %s started as PID %d", svc_ident(svc, NULL, 0), svc->pre_script, svc->pid); service_timeout_after(svc, svc->pre_tmo, service_kill_script); } static void service_post_script(svc_t *svc) { svc->pid = service_fork(svc); if (svc->pid < 0) { err(1, "Failed forking off %s post:script %s", svc_ident(svc, NULL, 0), svc->post_script); return; } if (svc->pid == 0) { char buf[CMD_SIZE]; char *argv[4] = { "sh", "-ac", buf, NULL }; char *env_file; int rc, sig; rc = WEXITSTATUS(svc->status); sig = WTERMSIG(svc->status); /* Warning in service_start() after svc_checkenv() */ env_file = svc_getenv(svc); if (env_file && fexist(env_file)) snprintf(buf, sizeof(buf), ". %s; exec %s", env_file, svc->post_script); else strlcpy(buf, svc->post_script, sizeof(buf)); set_pre_post_envs(svc, "post"); sig_unblock(); if (WIFEXITED(svc->status)) { char val[4]; setenv("EXIT_CODE", "exited", 1); snprintf(val, sizeof(val), "%d", rc & 0xff); setenv("EXIT_STATUS", val, 1); } else if (WIFSIGNALED(svc->status)) { setenv("EXIT_CODE", "signal", 1); setenv("EXIT_STATUS", sig2str(sig), 1); } if (svc_is_crashing(svc)) setenv("EXIT_CODE", "crashed", 1); execvp(_PATH_BSHELL, argv); _exit(EX_OSERR); } dbg("%s: post:script %s started as PID %d", svc_ident(svc, NULL, 0), svc->post_script, svc->pid); service_timeout_after(svc, svc->post_tmo, service_kill_script); } /* * Unlike the pre: and post: scripts, the ready: script cannot reuse * svc->pid, so instead we use an assoc. list for matching any scripts * related to the svc, handled by service_script_add() below. When a * ready: script is reaped the service_monitor() checks first for the * svc, then calls service_script_del(). */ void service_ready_script(svc_t *svc) { pid_t pid; if (access(svc->ready_script, X_OK)) return; pid = service_fork(svc); if (pid < 0) { err(1, "Failed forking off %s ready-script %s", svc_ident(svc, NULL, 0), svc->ready_script); return; } if (pid == 0) { char buf[CMD_SIZE]; char *argv[4] = { "sh", "-ac", buf, NULL }; char *env_file; /* Warning in service_start() after svc_checkenv() */ env_file = svc_getenv(svc); if (env_file && fexist(env_file)) snprintf(buf, sizeof(buf), ". %s; exec %s", env_file, svc->ready_script); else strlcpy(buf, svc->ready_script, sizeof(buf)); set_pre_post_envs(svc, "ready"); sig_unblock(); execvp(_PATH_BSHELL, argv); _exit(EX_OSERR); } dbg("%s: ready:script %s started as PID %d", svc_ident(svc, NULL, 0), svc->ready_script, pid); service_script_add(svc, pid, svc->ready_tmo); } static void service_cleanup_script(svc_t *svc) { svc->pid = service_fork(svc); if (svc->pid < 0) { err(1, "Failed forking off %s cleanup:script %s", svc_ident(svc, NULL, 0), svc->cleanup_script); return; } if (svc->pid == 0) { char buf[CMD_SIZE]; char *argv[4] = { "sh", "-ac", buf, NULL }; char *env_file; redirect(svc); /* Warning in service_start() after svc_checkenv() */ env_file = svc_getenv(svc); if (env_file && fexist(env_file)) snprintf(buf, sizeof(buf), ". %s; exec %s", env_file, svc->cleanup_script); else strlcpy(buf, svc->cleanup_script, sizeof(buf)); set_pre_post_envs(svc, "cleanup"); sig_unblock(); execvp(_PATH_BSHELL, argv); _exit(EX_OSERR); } dbg("%s: cleanup:script %s started as PID %d", svc_ident(svc, NULL, 0), svc->cleanup_script, svc->pid); service_timeout_after(svc, svc->cleanup_tmo, service_kill_script); } static void service_retry(svc_t *svc) { char *restart_cnt = (char *)&svc->restart_cnt; int timeout; service_timeout_cancel(svc); if (is_norespawn()) return; if (svc->respawn) { dbg("%s crashed/exited, respawning ...", svc_ident(svc, NULL, 0)); svc_unblock(svc); service_step(svc); return; } if (svc->state != SVC_HALTED_STATE || svc->block != SVC_BLOCK_RESTARTING) { svc->restart_tmo = svc->restart_saved; svc_set_state(svc, SVC_RUNNING_STATE); logit(LOG_CONSOLE | LOG_NOTICE, "Successfully restarted crashing service %s.", svc_ident(svc, NULL, 0)); return; } /* Peak instability index */ if (svc->restart_max != -1 && *restart_cnt >= svc->restart_max) { logit(LOG_CONSOLE | LOG_WARNING, "Service %s keeps crashing, not restarting.", svc_ident(svc, NULL, 0)); svc_crashing(svc); *restart_cnt = 0; svc->restart_tmo = svc->restart_saved; switch (svc->oncrash_action) { case SVC_ONCRASH_REBOOT: logit(LOG_ERR, "%s issuing reboot", svc_ident(svc, NULL, 0)); sync(); kill(1, SIGTERM); break; case SVC_ONCRASH_SCRIPT: if (svc_has_post(svc)) { dbg("calling post:script %s, crashing.", svc->post_script); service_post_script(svc); } break; default: break; } service_step(svc); return; } (*restart_cnt)++; dbg("%s crashed, trying to start it again, attempt %d", svc_ident(svc, NULL, 0), *restart_cnt); if ((*restart_cnt) == 1) svc->restart_saved = svc->restart_tmo; /* Wait 2s for the first 5 respawns, then back off to 5s */ timeout = ((*restart_cnt) <= (svc->restart_max / 2)) ? 2000 : 5000; /* If a longer timeout was specified in the conf, use that instead. */ svc->restart_tmo = max(svc->restart_tmo, timeout); logit(LOG_CONSOLE|LOG_WARNING, "Service %s[%d] died (%s%d), restarting (retry in %d msec) (attempt: %d/%d)", svc_ident(svc, NULL, 0), svc->oldpid, WIFEXITED(svc->status) ? "with exit status: " : "by signal: ", WIFEXITED(svc->status) ? WEXITSTATUS(svc->status) : WTERMSIG(svc->status), svc->restart_tmo, *restart_cnt, svc->restart_max); svc_unblock(svc); service_step(svc); service_timeout_after(svc, svc->restart_tmo, service_retry); } static void svc_set_state(svc_t *svc, svc_state_t new_state) { svc_state_t *state = (svc_state_t *)&svc->state; const svc_state_t old_state = svc->state; /* if PID isn't collected within SVC_TERM_TIMEOUT msec, kill it! */ if (new_state == SVC_STOPPING_STATE) { dbg("%s is stopping, wait %d sec before sending SIGKILL ...", svc_ident(svc, NULL, 0), svc->killdelay / 1000); service_timeout_cancel(svc); service_timeout_after(svc, svc->killdelay, service_kill); } if (svc->state == new_state) return; *state = new_state; if (svc_is_runtask(svc)) { char success[MAX_COND_LEN], failure[MAX_COND_LEN]; snprintf(success, sizeof(success), "%s/%s/success", svc_typestr(svc), svc_ident(svc, NULL, 0)); snprintf(failure, sizeof(failure), "%s/%s/failure", svc_typestr(svc), svc_ident(svc, NULL, 0)); /* create success/failure condition when entering SVC_DONE_STATE. */ if (new_state == SVC_DONE_STATE) { if (svc->started && !WEXITSTATUS(svc->status)) cond_set_oneshot(success); else cond_set_oneshot(failure); } /* clear all conditions when entering SVC_HALTED_STATE. */ if (new_state == SVC_HALTED_STATE) { cond_clear(success); cond_clear(failure); } } if (svc_is_daemon(svc)) { char cond[MAX_COND_LEN]; snprintf(cond, sizeof(cond), "service/%s/", svc_ident(svc, NULL, 0)); if ((old_state == SVC_RUNNING_STATE && new_state == SVC_PAUSED_STATE) || (old_state == SVC_PAUSED_STATE && new_state == SVC_RUNNING_STATE)) ; /* only paused during reload, don't clear conds. */ else if (sm_in_reload()) cond_clear_noupdate(cond); else cond_clear(cond); switch (new_state) { case SVC_HALTED_STATE: case SVC_RUNNING_STATE: strlcat(cond, svc_status(svc), sizeof(cond)); cond_set_oneshot(cond); break; default: break; } } } /* * Called by pidfile plugin for forking services that have successfully started. * We get here when the service_monitor() collects the PID, sets svc->pid to 0, * and the state machine prepares for the worst bu setting state to HALTED. */ void service_forked(svc_t *svc) { /* Stop forking_retry() timer */ service_timeout_cancel(svc); /* Not crashing, restore RUNNING state */ svc_unblock(svc); svc_set_state(svc, SVC_RUNNING_STATE); } /* Set or clear service/foo/ready condition for services and call optional ready:script */ void service_ready(svc_t *svc, int ready) { char buf[MAX_COND_LEN]; if (!svc_is_daemon(svc)) return; snprintf(buf, sizeof(buf), "service/%s/ready", svc_ident(svc, NULL, 0)); if (ready) { cond_set(buf); if (svc_has_ready(svc)) service_ready_script(svc); } else cond_clear(buf); } /* * Transition task/run/service * * Returns: non-zero if the @svc is no longer valid (removed) */ int service_step(svc_t *svc) { char *restart_cnt = (char *)&svc->restart_cnt; int changed = 0, waiting = 0; svc_state_t old_state; cond_state_t cond; svc_cmd_t enabled; int err; restart: old_state = svc->state; enabled = svc_enabled(svc); dbg("%20s(%4d): %8s %3sabled/%-7s cond:%-4s", svc_ident(svc, NULL, 0), svc->pid, svc_status(svc), enabled ? "en" : "dis", svc_dirtystr(svc), condstr(cond_get_agg(svc->cond))); switch (svc->state) { case SVC_HALTED_STATE: if (enabled) { svc_set_state(svc, SVC_WAITING_STATE); } else { if (svc_is_removed(svc)) { svc_set_state(svc, SVC_DEAD_STATE); } else if (svc_is_conflict(svc)) { #if 0 logit(svc->nowarn ? LOG_DEBUG : LOG_INFO, "%s in conflict with %s, checking again ...", svc_ident(svc, NULL, 0), svc->conflict); #endif if (!svc_conflicts(svc)) svc_unblock(svc); } } break; case SVC_TEARDOWN_STATE: if (!svc->pid) { dbg("%s: post script done.", svc_ident(svc, NULL, 0)); service_timeout_cancel(svc); if (svc_is_removed(svc) && svc_has_cleanup(svc)) { svc_set_state(svc, SVC_CLEANUP_STATE); service_cleanup_script(svc); } else svc_set_state(svc, SVC_HALTED_STATE); } break; case SVC_CLEANUP_STATE: if (!svc->pid) { dbg("%s: cleanup script done.", svc_ident(svc, NULL, 0)); svc_set_state(svc, SVC_HALTED_STATE); } break; case SVC_DEAD_STATE: /* End of the line ☠ */ break; case SVC_DONE_STATE: if (svc_is_changed(svc)) svc_set_state(svc, SVC_HALTED_STATE); if (svc_is_runtask(svc) && svc_is_manual(svc) && enabled) svc_set_state(svc, SVC_WAITING_STATE); break; case SVC_STOPPING_STATE: if (!svc->pid) { char condstr[MAX_COND_LEN]; dbg("%s: stopped, cleaning up timers and conditions ...", svc_ident(svc, NULL, 0)); service_notify_stop(svc); service_timeout_cancel(svc); cond_clear(mkcond(svc, condstr, sizeof(condstr))); switch (svc->type) { case SVC_TYPE_SERVICE: case SVC_TYPE_SYSV: case SVC_TYPE_TTY: if (svc_has_post(svc)) { svc_set_state(svc, SVC_TEARDOWN_STATE); service_post_script(svc); } else if (svc_is_removed(svc) && svc_has_cleanup(svc)) { svc_set_state(svc, SVC_CLEANUP_STATE); service_cleanup_script(svc); } else svc_set_state(svc, SVC_HALTED_STATE); break; case SVC_TYPE_TASK: case SVC_TYPE_RUN: if (svc->manual) svc_stop(svc); svc_set_state(svc, SVC_DONE_STATE); break; default: errx(1, "unknown service type %d", svc->type); break; } } break; case SVC_SETUP_STATE: if (!enabled) { service_stop(svc); break; } if (!svc->pid) { int rc = WEXITSTATUS(svc->status); int ok = WIFEXITED(svc->status); if (!ok || rc) { const char *sig; if (WIFSIGNALED(svc->status)) sig = sig_name(WTERMSIG(svc->status)); else sig = "none"; logit(LOG_WARNING, "Service %s pre:%s failed, rc: %d sig:%s", svc_ident(svc, NULL, 0), svc->pre_script, rc, sig); svc_set_state(svc, SVC_STOPPING_STATE); svc_crashing(svc); } else { svc_set_state(svc, SVC_STARTING_STATE); } } break; case SVC_WAITING_STATE: if (!enabled) { svc_set_state(svc, SVC_HALTED_STATE); } else if (cond_get_agg(svc->cond) == COND_ON) { /* wait until all processes have been stopped before continuing... */ if (sm_in_reload()) break; if (is_norespawn()) break; /* Don't start if it conflicts with something else already started */ if (svc_conflicts(svc)) { logit(svc->nowarn ? LOG_DEBUG : LOG_INFO, "Not starting %s, conflicts with %s", svc_ident(svc, NULL, 0), svc->conflict); svc_conflict(svc); svc_set_state(svc, SVC_HALTED_STATE); break; } if (svc_has_pre(svc)) { svc_set_state(svc, SVC_SETUP_STATE); service_pre_script(svc); break; } svc_set_state(svc, SVC_STARTING_STATE); } break; case SVC_STARTING_STATE: if (!enabled) { svc_set_state(svc, SVC_HALTED_STATE); break; } err = service_start(svc); if (err) { /* Busy, waiting for run task, try again later */ if (run_block_pid) break; if (svc_is_missing(svc)) { svc_set_state(svc, SVC_HALTED_STATE); break; } (*restart_cnt)++; break; } svc_mark_clean(svc); svc_set_state(svc, SVC_RUNNING_STATE); break; case SVC_RUNNING_STATE: if (!enabled) { service_stop(svc); break; } if (!svc->pid) { if (svc_is_daemon(svc) || svc_is_tty(svc)) { svc_restarting(svc); /* BLOCK_RESTARTING */ svc_set_state(svc, SVC_HALTED_STATE); /* * Restart directly after the first crash, except for forking services * which we need to wait for the forked-off child to create its pid * file. In both cases, after that, retry after 2 sec */ if (!svc->respawn) { dbg("delayed restart of %s", svc_ident(svc, NULL, 0)); service_timeout_after(svc, svc->restart_tmo, service_retry); goto done; } dbg("respawning %s", svc_ident(svc, NULL, 0)); svc_unblock(svc); break; } if (svc_is_runtask(svc)) { svc_set_state(svc, SVC_STOPPING_STATE); svc->restart_tot++; svc->once++; break; } } service_timeout_cancel(svc); cond = cond_get_agg(svc->cond); switch (cond) { case COND_OFF: service_stop(svc); break; case COND_FLUX: kill(svc->pid, SIGSTOP); svc_set_state(svc, SVC_PAUSED_STATE); break; case COND_ON: if (svc_is_changed(svc)) { /* * If service does not suport reload, or its command line * arguments have been modified, we need to stop-start it. */ if (svc_is_noreload(svc) || svc->args_dirty) { service_stop(svc); } else { /* * wait until all processes have been * stopped before continuing... */ if (sm_in_reload()) break; service_reload(svc); } svc_mark_clean(svc); } if (svc->notify == SVC_NOTIFY_NONE) service_ready(svc, 1); break; } break; case SVC_PAUSED_STATE: if (!enabled) { kill(svc->pid, SIGCONT); service_stop(svc); break; } if (!svc->pid) { (*restart_cnt)++; svc_set_state(svc, SVC_WAITING_STATE); break; } cond = cond_get_agg(svc->cond); switch (cond) { case COND_ON: kill(svc->pid, SIGCONT); svc_set_state(svc, SVC_RUNNING_STATE); /* Reassert condition if we go from waiting and no change */ if (!svc_is_changed(svc)) { if (svc->notify == SVC_NOTIFY_PID) { char name[MAX_COND_LEN]; mkcond(svc, name, sizeof(name)); dbg("Reassert condition %s", name); cond_set_path(cond_path(name), COND_ON); } dbg("Reassert %s ready condition", svc_ident(svc, NULL, 0)); service_ready(svc, 1); } break; case COND_OFF: dbg("Condition for %s is off, sending SIGCONT + SIGTERM", svc_ident(svc, NULL, 0)); kill(svc->pid, SIGCONT); service_stop(svc); break; case COND_FLUX: break; } break; } /* Are we waiting for a run task to complete? */ waiting = run_block_pid; if (svc->state != old_state) { dbg("%20s(%4d): -> %8s", svc_ident(svc, NULL, 0), svc->pid, svc_status(svc)); changed++; goto restart; } done: /* * When a run/task/service changes state, e.g. transitioning from * waiting to running, other services may need to change state too. */ if (changed || waiting) schedule_work(&work); return 0; } void service_step_all(int types) { svc_foreach_type(types, service_step); } void service_worker(void *unused) { (void)unused; service_step_all(SVC_TYPE_RESPAWN | SVC_TYPE_RUNTASK); } /** * svc_clean_runtask - Clear once flag of runtasks * * XXX: runtasks should be stopped before calling this */ void service_runtask_clean(void) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (!svc_is_runtask(svc)) continue; /* run/task declared with */ if (svc->sighup) svc->once = 1; else svc->once = 0; if (svc->state == SVC_DONE_STATE) svc_set_state(svc, SVC_HALTED_STATE); } } /** * service_completed - Have run/task completed in current runlevel * @svcp: On %FALSE return, this points to the first incomplete svc * * This function checks if all run/task have run once in the current * runlevel. E.g., at bootstrap we must wait for these scripts or * programs to complete their run before switching to the configured * runlevel. * * All tasks with %HOOK_SVC_UP, %HOOK_SYSTEM_UP set in their condition * mask are skipped. These tasks cannot run until finalize() * * Returns: * %TRUE(1) or %FALSE(0) */ int service_completed(svc_t **svcp) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (!svc_is_runtask(svc)) continue; if (!svc_enabled(svc)) continue; if (svc_conflicts(svc)) continue; if (strstr(svc->cond, plugin_hook_str(HOOK_SVC_UP)) || strstr(svc->cond, plugin_hook_str(HOOK_SYSTEM_UP))) { dbg("Skipping %s(%s), post-strap hook", svc->desc, svc_ident(svc, NULL, 0)); continue; } if (!svc->once) { dbg("%s has not yet completed ...", svc_ident(svc, NULL, 0)); if (svcp) *svcp = svc; return 0; } dbg("%s has completed ...", svc_ident(svc, NULL, 0)); } return 1; } /* * Called in SM_RELOAD_WAIT_STATE to update unmodified non-native * services' READY condition to the current generation. Similar * to the pidfile_reconf() function for native services. */ void service_notify_reconf(void) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (svc->notify == SVC_NOTIFY_PID) continue; /* managed by pidfile plugin */ if (svc->state != SVC_RUNNING_STATE) continue; if (svc->notify != SVC_NOTIFY_NONE && (svc_is_changed(svc) || svc_is_starting(svc))) continue; service_ready(svc, 1); } } /* * Called when a service sends readiness notification, or when * the service closes its end of the IPC connection. */ static void service_notify_cb(uev_t *w, void *arg, int events) { svc_t *svc = (svc_t *)arg; int ready = 0; char buf[32]; ssize_t len; if (UEV_ERROR == events) { dbg("%s: spurious problem with notify callback, restarting.", svc_ident(svc, NULL, 0)); uev_io_start(w); return; } len = read(w->fd, buf, sizeof(buf) - 1); if (len <= 0) { warn("Failed reading notification from %s", svc_ident(svc, NULL, 0)); return; } buf[len] = 0; /* Check for systemd READY=1 or s6 newline termination */ if (svc->notify == SVC_NOTIFY_SYSTEMD) { char *token = strtok(buf, "\n"); while (token) { if (!strcmp(token, "READY=1")) { ready = 1; break; } token = strtok(NULL, "\n"); } } else if (svc->notify == SVC_NOTIFY_S6 && buf[len - 1] == '\n') { ready = 1; } if (ready) { /* * native (pidfile) services are marked as started by * the pidfile plugin. */ svc_started(svc); /* * On reload, and this svc is unmodified, it is up to * the service_notify_reconf() function to step the * generation of the READY condition. */ service_ready(svc, 1); /* s6 applications close their socket after notification */ if (svc->notify == SVC_NOTIFY_S6) { uev_io_stop(w); close(w->fd); w->fd = 0; } } } /* * Every five¹ minutes we sweep over all services, skipping crashed or * otherwise no longer running ones. Decrement non-zero crash counters * to allow services that have started after an initial crash to slowly * prove themselves again as stable services. Previously this counter * was reset as soon as such services had stopped crashing at least once * per second. This new scheme allows us to catch those that rage-quit * immediately when we try to start them, but now also those that are * only slightly buggy -- when they reach their restart_max, they too * are marked 'crashed'. * * This does not affect the restart_tot counter, which you can see in * the output from 'initctl status foo', along with this instability * "index" in parenthesis: total (cnt/max) */ static void service_interval_cb(uev_t *w, void *arg, int events) { svc_t *svc, *iter = NULL; (void)arg; if (UEV_ERROR == events) { dbg("spurious problem, restarting."); uev_timer_start(w); return; } for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (svc_is_daemon(svc)) { char *restart_cnt = (char *)&svc->restart_cnt; if (!svc_is_running(svc)) continue; if (*restart_cnt > 0) { logit(LOG_CONSOLE | LOG_DEBUG, "Aging %s instability index (%d/%d)", svc_ident(svc, NULL, 0), svc->restart_cnt, svc->restart_max); (*restart_cnt)--; } } } service_init(NULL); } /* * The service_interval may change (conf) between invocations, so we * periodically reset the one-shot timer instead of using a periodic. */ void service_init(uev_ctx_t *ctx) { static int initialized = 0; static uev_t watcher; if (!initialized) uev_timer_init(ctx, &watcher, service_interval_cb, NULL, service_interval, 0); else uev_timer_set(&watcher, service_interval, 0); initialized = 1; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/iwatch.h0000644000175100001660000000473715054341541010471 /* inotify watcher for files or directories * * Copyright (c) 2015-2016 Tobias Waldekranz * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_IWATCH_H_ #define FINIT_IWATCH_H_ #include #ifdef _LIBITE_LITE # include /* BSD sys/queue.h API */ #else # include /* BSD sys/queue.h API */ #endif #include #ifndef IN_MASK_CREATE #define IN_MASK_CREATE 0x10000000 /* since Linux 4.18 */ #endif /* * Monitors changes to both directories and files by default, but only * add watcher once (IN_MASK_CREATE) to avoid clobbering any already * monitored paths. */ #define IWATCH_MASK (IN_CREATE | IN_DELETE | IN_MODIFY | IN_ATTRIB | IN_MOVE | IN_MASK_CREATE) struct iwatch_path { TAILQ_ENTRY(iwatch_path) link; char *path; int wd; }; struct iwatch { int fd; TAILQ_HEAD(, iwatch_path) iwp_list; }; int iwatch_init (struct iwatch *iw); void iwatch_exit (struct iwatch *iw); int iwatch_add1 (struct iwatch *iw, char *file, uint32_t mask); int iwatch_add (struct iwatch *iw, char *file, uint32_t mask); int iwatch_del (struct iwatch *iw, struct iwatch_path *iwp); struct iwatch_path *iwatch_find_by_wd (struct iwatch *iw, int wd); struct iwatch_path *iwatch_find_by_path (struct iwatch *iw, const char *path); #endif /* FINIT_IWATCH_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/cgutil.h0000644000175100001660000000440615054341541010472 /* Cgroup utility functions for initctl * * Copyright (c) 2019-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_CGUTIL_H_ #define FINIT_CGUTIL_H_ #include #include struct cg { struct cg *cg_next; /* stats */ char *cg_path; /* path in /sys/fs/cgroup */ uint64_t cg_prev; /* cpuacct.usage */ uint64_t cg_rss; /* memory.stat */ uint64_t cg_vmlib; /* memory.stat */ uint64_t cg_vmsize; /* memory.current */ float cg_memshare; /* cg_rss / total_ram * 100 */ float cg_load; /* curr - prev / 10000000.0 */ /* config */ struct { char min[32]; char max[32]; } cg_mem; struct { char set[16]; char weight[32]; char max[32]; } cg_cpu; }; int cgroup_avail(void); char *pid_cmdline (int pid); char *pid_cgroup (int pid); uint64_t cgroup_memory(char *group); struct cg *cg_stats(char *path); struct cg *cg_conf (char *path); int cgroup_tree (char *path, char *pfx, int mode, int pos); int show_cgroup (char *arg); int show_cgtop (char *arg); int show_cgps (char *arg); #endif /* FINIT_CGUTIL_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/util.c0000644000175100001660000004142515054341541010155 /* Misc. shared utility functions for initctl, reboot and finit * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include /* isprint() */ #include #include #include #ifdef HAVE_MNTENT_H #include #endif #include #include #include #include #ifdef HAVE_TERMIOS_H # include #endif #include #include #include #ifdef HAVE_SYS_IOCTL_H # include #endif #include /* sysinfo() */ #include /* statfs */ #include #ifdef _LIBITE_LITE # include #else # include #endif #include "util.h" #ifdef HAVE_TERMIOS_H /* * This flag is used on *BSD when calling tcsetattr() to prevent it * from changing speed, duplex, parity. GNU says we should use the * CIGNORE flag to c_cflag, but that doesn't exist so ... we rely on * our initial tcgetattr() and prey that nothing changes on the TTY * before we exit and restore with tcsetattr() */ #ifndef TCSASOFT #define TCSASOFT 0 #endif static struct termios ttold; static struct termios ttnew; #endif int ttrows = 24; int ttcols = 80; char *prognm = NULL; static char *signames[] = { "", "HUP", /* 1 */ "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", /* 8 */ "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", /* 16 */ "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", /* 24 */ "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", }; /* https://freedesktop.org/software/systemd/man/systemd.exec.html#id-1.20.8 */ static char *exitcodes[] = { "SUCCESS", /* 0: Std C exit OK */ "FAILURE", /* 1: Std C exit FAIL */ /* 2-7: LSB init scripts (usually) */ "INVALIDARGUMENT", /* 2: Invalid or excess args */ "NOTIMPLEMENTED", /* 3: Unimplemented feature, e.g. 'reload' */ "NOPERMISSION", /* 4: Insufficient privilege */ "NOTINSTALLED", /* 5: Program is not installed */ "NOTCONFIGURED", /* 6: Program is not configured */ "NOTRUNNING", /* 7: Program is not running */ "", "", "", "", "", "", "", "", /* 8-63: Not standardized */ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* 16-31 */ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* 32-47 */ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* 48-63 */ /* 64-78: BSD, from sysexit.h */ "USAGE", /* 64: Command line usage error */ "DATAERR", /* 65: data format error */ "NOINPUT", /* 66: cannot open input */ "NOUSER", /* 67: addressee unknown */ "NOHOST", /* 68: host name unknown */ "UNAVAILABLE", /* 69: service unavailable */ "SOFTWARE", /* 70: internal software error */ "OSERR", /* 71: system error (e.g., can't fork) */ "OSFILE", /* 72: critical OS file missing */ "CANTCREAT", /* 73: can't create (user) output file */ "IOERR", /* 74: input/output error */ "TEMPFAIL", /* 75: temp failure; user is invited to retry */ "PROTOCOL", /* 76: remote error in protocol */ "NOPERM", /* 77: permission denied */ "CONFIG", /* 78: configuration error */ /* 79-199: Not standardized, typically 127 == -1 */ /* >= 200: reserved (LSB), used by systemd */ }; char *progname(char *arg0) { prognm = strrchr(arg0, '/'); if (prognm) prognm++; else prognm = arg0; return prognm; } /* basename(3) replacement that does not modify its argument */ const char *basenm(const char *path) { const char *basename; basename = rindex(path, '/'); if (!basename) return path; basename++; return basename; } char *str(char *fmt, ...) { static char buf[32]; va_list ap; va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); return buf; } int getuser(char *username, char **home) { #ifdef ENABLE_STATIC if (home) *home = "/"; /* XXX: Fixme */ return fgetint("/etc/passwd", "x:\n", username); #else struct passwd *usr; if (!username || (usr = getpwnam(username)) == NULL) return -1; if (home) *home = usr->pw_dir; return usr->pw_uid; #endif } int getgroup(char *group) { #ifdef ENABLE_STATIC return fgetint("/etc/group", "x:\n", group); #else struct group *grp; if ((grp = getgrnam(group)) == NULL) return -1; return grp->gr_gid; #endif } /* get current user */ int getcuser(char *buf, size_t len) { char *ptr = "root"; #ifndef ENABLE_STATIC struct passwd *pw = getpwuid(getuid()); if (pw) ptr = pw->pw_name; #endif if (strlcpy(buf, ptr, len) > len) return -1; return 0; } /* get current group */ int getcgroup(char *buf, size_t len) { char *ptr = "root"; #ifndef ENABLE_STATIC struct group *gr = getgrgid(getgid()); if (gr) ptr = gr->gr_name; #endif if (strlcpy(buf, ptr, len) > len) return -1; return 0; } int mksubsys(const char *dir, mode_t mode, char *user, char *group) { mode_t omask; int uid, gid; int rc = 0; omask = umask(0); uid = getuser(user, NULL); if (uid >= 0) { gid = getgroup(group); if (gid < 0) gid = 0; rc = makedir(dir, mode); if (rc && errno == EEXIST) rc = chmod(dir, mode); if (chown(dir, uid, gid)) err(1, "Failed chown(%s, %d, %d)", dir, uid, gid); } umask(omask); return rc; } int fnread(char *buf, size_t len, char *fmt, ...) { char path[256]; va_list ap; FILE *fp; va_start(ap, fmt); vsnprintf(path, sizeof(path), fmt, ap); va_end(ap); if (!buf || !len) { struct stat st; if (stat(path, &st)) return -1; return (ssize_t)st.st_size; } fp = fopen(path, "r"); if (!fp) return -1; len = fread(buf, sizeof(char), len - 1, fp); buf[len] = 0; fclose(fp); return (int)len; } int fnwrite(char *value, char *fmt, ...) { char path[256]; va_list ap; FILE *fp; int rc; if (!value) { errno = EINVAL; return -1; } va_start(ap, fmt); vsnprintf(path, sizeof(path), fmt, ap); va_end(ap); fp = fopen(path, "w"); if (!fp) return -1; /* echo(1) always adds a newline */ if (fputs(value, fp) == EOF || fputs("\n", fp) == EOF) rc = -1; if (fclose(fp) == EOF) rc = -1; else rc = 0; return rc; } int fngetint(char *path, int *val) { char buf[64]; if (fnread(buf, sizeof(buf), "%s", path) <= 0) return -1; errno = 0; *val = strtoul(chomp(buf), NULL, 0); if (errno) return -1; return 0; } /* * This is a replacement for the non-working reboot(RB_SW_SUSPEND). It * checks for suspend to RAM support, assuming `mem_sleep` has a sane * default, e.g. 'deep' or 's2idle'. The latter should be possible to * select from finit.conf, but for now we go with the kernel default. * For more information on kernel sleep states, see: * https://www.kernel.org/doc/html/latest/admin-guide/pm/sleep-states.html */ int suspend(void) { char buf[80]; char *ptr; if (fnread(buf, sizeof(buf), "/sys/power/state") <= 0) { opnotsup: errno = EINVAL; return 1; } chomp(buf); ptr = strtok(buf, " "); while (ptr) { if (!strcmp(ptr, "mem")) break; ptr = strtok(NULL, " "); } if (!ptr) goto opnotsup; return fnwrite("mem", "/sys/power/state"); } int strtobytes(char *arg) { int mod = 0, bytes; size_t pos; if (!arg) return -1; pos = strspn(arg, "0123456789"); if (arg[pos] != 0) { if (arg[pos] == 'G') mod = 3; else if (arg[pos] == 'M') mod = 2; else if (arg[pos] == 'k') mod = 1; else return -1; arg[pos] = 0; } bytes = atoi(arg); while (mod--) bytes *= 1000; return bytes; } char *sig2str(int signo) { if (signo < 1 || signo >= (int)NELEMS(signames)) return ""; return signames[signo]; } /** * str2sig - Translate signal name to the corresponding signal number. * @sig: The name of the signal * * A signal can be a complete signal name such as "SIGHUP", or * it can be the shortest unique name, such as "HUP" (no SIG prefix). */ int str2sig(char *sig) { size_t i; if (!strncasecmp(sig, "SIG", 3)) sig += 3; for (i = 1; i < NELEMS(signames); ++i) { if (strcasecmp(sig, signames[i]) == 0) return i; } return -1; } char *code2str(int code) { if (code < 0 || code >= (int)NELEMS(exitcodes)) return ""; return exitcodes[code]; } void do_sleep(unsigned int sec) { struct timespec requested_sleep = { .tv_sec = sec, .tv_nsec = 0, }; while (nanosleep(&requested_sleep, &requested_sleep)) ; } void do_usleep(unsigned int usec) { struct timespec deadline; clock_gettime(CLOCK_MONOTONIC, &deadline); deadline.tv_nsec += usec * 1000; deadline.tv_sec += deadline.tv_nsec / 1000000000; deadline.tv_nsec = deadline.tv_nsec % 1000000000; while (clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &deadline, NULL) != 0 && errno == EINTR) ; } /* Seconds since boot, from sysinfo() */ long jiffies(void) { struct sysinfo si; if (!sysinfo(&si)) return si.uptime; return 0; } char *uptime(long secs, char *buf, size_t len) { long mins, hours, days, years; char y[20] = "", d[20] = "", h[20] = "", m[20] = "", s[20] = ""; if (!buf) { errno = EINVAL; return NULL; } years = secs / 31556926; secs = secs % 31556926; days = secs / 86400; secs = secs % 86400; hours = secs / 3600; secs = secs % 3600; mins = secs / 60; secs = secs % 60; if (years) snprintf(y, sizeof(y), "%ld year", years); if (days) snprintf(d, sizeof(d), "%ld day", days); if (hours) snprintf(h, sizeof(h), "%ld hour", hours); if (mins) snprintf(m, sizeof(m), "%ld min", mins); if (secs) snprintf(s, sizeof(s), "%ld sec", secs); snprintf(buf, len, "%s%s%s%s%s%s%s%s%s", y, years ? " " : "", d, days ? " " : "", h, hours ? " " : "", m, mins ? " " : "", s); return buf; } char *memsz(uint64_t sz, char *buf, size_t len) { int gb, mb, kb, b; if (!sz) { strlcpy(buf, "--.--", len); return buf; } gb = sz / (1024 * 1024 * 1024); sz = sz % (1024 * 1024 * 1024); mb = sz / (1024 * 1024); sz = sz % (1024 * 1024); kb = sz / (1024); b = sz % (1024); if (gb) snprintf(buf, len, "%d.%dG", gb, mb / 102); else if (mb) snprintf(buf, len, "%d.%dM", mb, kb / 102); else snprintf(buf, len, "%d.%dk", kb, b / 102); return buf; } /* * Verify string argument is NUL terminated * Verify string is a JOB[:ID], JOB and ID * can both be string or number, or combo. */ char *sanitize(char *arg, size_t len) { const char *regex = "[a-z0-9_]+[:]?[a-z0-9_]*"; regex_t preg; int rc; if (!memchr(arg, 0, len)) return NULL; if (regcomp(&preg, regex, REG_ICASE | REG_EXTENDED)) return NULL; rc = regexec(&preg, arg, 0, NULL, 0); regfree(&preg); if (rc) return NULL; return arg; } void de_dotdot(char *file) { char *cp, *cp2; int l; /* Remove leading ./ and any /./ sequences. */ while (strncmp(file, "./", 2) == 0) memmove(file, file + 2, strlen(file) - 1); while ((cp = strstr(file, "/./"))) memmove(cp, cp + 2, strlen(cp) - 1); /* Alternate between removing leading ../ and removing xxx/../ */ for (;;) { while (strncmp(file, "../", 3) == 0) memmove(file, file + 3, strlen(file) - 2); cp = strstr(file, "/../"); if (!cp) break; for (cp2 = cp - 1; cp2 >= file && *cp2 != '/'; --cp2) continue; memmove(cp2 + 1, cp + 4, strlen(cp + 3)); } /* Also elide any xxx/.. at the end. */ while ((l = strlen(file)) > 3 && strcmp((cp = file + l - 3), "/..") == 0) { for (cp2 = cp - 1; cp2 >= file && *cp2 != '/'; --cp2) continue; if (cp2 < file) break; *cp2 = '\0'; } /* Collapse any multiple / sequences. */ while ((cp = strstr(file, "//"))) { cp2 = cp + 1; memmove(cp, cp2, strlen(cp2) + 1); } } static int hasopt(char *opts, char *opt) { char buf[strlen(opts) + 1]; char *ptr; memcpy(buf, opts, sizeof(buf)); ptr = strtok(buf, ","); while (ptr) { if (!strcmp(ptr, opt)) return 1; ptr = strtok(NULL, ","); } return 0; } int ismnt(char *file, char *dir, char *mode) { struct mntent mount; struct mntent *mnt; char buf[256]; int found = 0; FILE *fp; fp = setmntent(file, "r"); if (!fp) return 0; /* Dunno, maybe not */ while ((mnt = getmntent_r(fp, &mount, buf, sizeof(buf)))) { if (!strcmp(mnt->mnt_dir, dir)) { if (mode) { if (hasopt(mnt->mnt_opts, mode)) found = 1; } else found = 1; break; } } endmntent(fp); return found; } /* Requires /proc to be mounted */ int fismnt(char *dir) { return ismnt("/proc/mounts", dir, NULL); } /* Return 1 if dir is a backed by tmpfs or overlayfs */ int fistmpfs(char *dir) { struct statfs info = {0}; if (statfs(dir, &info)) return 0; if (info.f_type == TMPFS_MAGIC || info.f_type == OVERLAYFS_SUPER_MAGIC) return 1; return 0; } #ifdef HAVE_TERMIOS_H /* * Called by initctl, and by finit at boot and shutdown, to * (re)initialize the screen size for print() et al. */ int ttinit(void) { struct pollfd fd = { STDIN_FILENO, POLLIN, 0 }; struct winsize ws = { 0 }; struct termios tc, saved; int cached = 0; /* * Basic TTY init, CLOCaL is important or TIOCWINSZ will block * until DCD is asserted, and we won't ever get it. */ if (!tcgetattr(STDERR_FILENO, &tc)) { saved = tc; cached = 1; tc.c_cflag |= (CLOCAL | CREAD); tc.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); tcsetattr(STDERR_FILENO, TCSANOW, &tc); } /* 1. Try TIOCWINSZ to query window size from kernel */ if (!ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws)) { ttrows = ws.ws_row; ttcols = ws.ws_col; /* Likely doesn't work in PID 1 after kernel starts us ... */ if (!ws.ws_row && !ws.ws_col) goto fallback; } else if (!isatty(STDOUT_FILENO)) { /* 2. We may be running under watch(1) */ ttcols = atonum(getenv("COLUMNS")); ttrows = atonum(getenv("LINES")); } else { fallback: /* 3. ANSI goto + query cursor position trick as fallback */ fprintf(stderr, "\e7\e[r\e[999;999H\e[6n"); if (poll(&fd, 1, 300) > 0) { int row, col; if (scanf("\e[%d;%dR", &row, &col) == 2) { ttcols = col; ttrows = row; } } /* Jump back to where we started (\e7) */ fprintf(stderr, "\e8"); } if (cached) tcsetattr(STDERR_FILENO, TCSANOW, &saved); /* Sanity check */ if (ttcols <= 0) ttcols = 80; if (ttrows <= 0) ttrows = 24; return ttcols; } /* * This function sets the terminal to RAW mode, as defined for the current * shell. This is called both by ttopen() above and by spawncli() to * get the current terminal settings and then change them to what * mg expects. Thus, tty changes done while spawncli() is in effect * will be reflected in mg. */ int ttraw(void) { if (tcgetattr(0, &ttold) == -1) { fprintf(stderr, "%s: failed querying tty attrs: %s\n", prognm, strerror(errno)); return 1; } (void)memcpy(&ttnew, &ttold, sizeof(ttnew)); /* Set terminal to 'raw' mode and ignore a 'break' */ ttnew.c_cc[VMIN] = 1; ttnew.c_cc[VTIME] = 0; ttnew.c_iflag |= IGNBRK; ttnew.c_iflag &= ~(BRKINT | PARMRK | INLCR | IGNCR | ICRNL | IXON); ttnew.c_oflag &= ~OPOST; ttnew.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN); if (tcsetattr(0, TCSASOFT | TCSADRAIN, &ttnew) == -1) { fprintf(stderr, "%s: failed setting tty in raw mode: %s\n", prognm, strerror(errno)); return 1; } return 0; } /* * This function restores all terminal settings to their default values, * in anticipation of exiting or suspending the editor. */ int ttcooked(void) { if (tcsetattr(0, TCSASOFT | TCSADRAIN, &ttold) == -1) { fprintf(stderr, "%s: failed restoring tty to cooked mode: %s\n", prognm, strerror(errno)); return 1; } return 0; } #endif /* HAVE_TERMIOS_H */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/svc.c0000644000175100001660000004743515054341541010002 /* Low-level service primitives and generic API for managing svc_t structures * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include /* isdigit() */ #include #include #include #include #include #ifdef _LIBITE_LITE # include /* BSD sys/queue.h API */ #else # include /* BSD sys/queue.h API */ #endif #include "finit.h" #include "conf.h" #include "svc.h" #include "helpers.h" #include "pid.h" #include "util.h" #include "cond.h" #include "schedule.h" /* Each svc_t needs a unique job# */ static int jobcounter = 1; static TAILQ_HEAD(, svc) svc_list = TAILQ_HEAD_INITIALIZER(svc_list); static TAILQ_HEAD(, svc) gc_list = TAILQ_HEAD_INITIALIZER(gc_list); /* * Before gc removal of svc, make sure we don't clear an active * condition of a new instance of the svc. */ static void maybe_clear_cond(svc_t *svc) { char ident[MAX_IDENT_LEN]; char cond[MAX_COND_LEN]; svc_t *iter = NULL; svc_t *s; mkcond(svc, cond, sizeof(cond)); svc_ident(svc, ident, sizeof(ident)); for (s = svc_iterator(&iter, 1); s; s = svc_iterator(&iter, 0)) { char c[MAX_COND_LEN]; mkcond(s, c, sizeof(c)); if (!string_compare(cond, c)) continue; dbg("Not clearing cond %s from gc svc %s, provided by new active service %s", cond, ident, svc_ident(s, NULL, 0)); return; } dbg("Cleaning out %s, clearing any conditions ...", svc->name); cond_clear(mkcond(svc, cond, sizeof(cond))); } static void svc_gc(void *arg) { struct timespec now; struct wq *work = (struct wq *)arg; svc_t *svc, *next; clock_gettime(CLOCK_MONOTONIC_COARSE, &now); TAILQ_FOREACH_SAFE(svc, &gc_list, link, next) { int msec; msec = (now.tv_sec - svc->gc.tv_sec) * 1000 + (now.tv_nsec - svc->gc.tv_nsec) / 1000000; if (msec < SVC_TERM_TIMEOUT) continue; TAILQ_REMOVE(&gc_list, svc, link); maybe_clear_cond(svc); free(svc); } if (!TAILQ_EMPTY(&gc_list)) schedule_work(work); } /** * svc_new - Create a new service * @cmd: External program to call * @name: Default or custom svc name * @id: Instance id * @type: Service type, one of service, task, run * * Returns: * A pointer to a new &svc_t object, or %NULL if out of empty slots. */ svc_t *svc_new(char *cmd, char *name, char *id, int type) { svc_t *svc, *iter = NULL; int job = -1; /* Find first job n:o if registering multiple instances */ for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (cmd && !strcmp(svc->cmd, cmd)) { job = svc->job; break; } } if (job == -1) job = jobcounter++; svc = calloc(1, sizeof(*svc)); if (!svc) return NULL; svc->type = type; svc->job = job; if (name) strlcpy(svc->name, name, sizeof(svc->name)); if (id && id[0]) strlcpy(svc->id, id, sizeof(svc->id)); if (cmd) strlcpy(svc->cmd, cmd, sizeof(svc->cmd)); /* Default description, if missing */ strlcpy(svc->desc, svc->name, sizeof(svc->desc)); /* Default HALT signal to send */ if (svc_is_tty(svc)) svc->sighalt = SIGHUP; else svc->sighalt = SIGTERM; /* Default delay between SIGTERM and SIGKILL */ svc->killdelay = SVC_TERM_TIMEOUT; TAILQ_INSERT_TAIL(&svc_list, svc, link); return svc; } static struct wq work = { .cb = svc_gc, .delay = SVC_TERM_TIMEOUT }; /** * svc_del - Mark a service object for deletion * @svc: Pointer to an &svc_t object * * Returns: * Always succeeds, returning POSIX OK(0). */ int svc_del(svc_t *svc) { TAILQ_REMOVE(&svc_list, svc, link); TAILQ_INSERT_TAIL(&gc_list, svc, link); clock_gettime(CLOCK_MONOTONIC_COARSE, &svc->gc); schedule_work(&work); return 0; } /** * svc_validate - Check if service asserts same condition as another service * @svc: Pointer to an &svc_t object * * Logs to syslog if there is a name clash with existing services. */ void svc_validate(svc_t *svc) { char ident[MAX_IDENT_LEN]; char cond[MAX_COND_LEN]; svc_t *iter = NULL; svc_t *s; mkcond(svc, cond, sizeof(cond)); svc_ident(svc, ident, sizeof(ident)); for (s = svc_iterator(&iter, 1); s; s = svc_iterator(&iter, 0)) { char c[MAX_COND_LEN]; if (s->removed) continue; if (s == svc) continue; mkcond(s, c, sizeof(c)); if (!string_compare(cond, c)) continue; logit(LOG_WARNING, "%s (%s) asserts the same condition as %s (%s) => %s", svc->cmd, ident, s->cmd, svc_ident(s, NULL, 0), c); } } /** * svc_iterator - Naive iterator over all registered services. * @iter: Iterator, must be a valid pointer * @first: If set, get first &svc_t, otherwise get next * * Returns: * An &svc_t pointer, or %NULL when no more entries can be found. */ svc_t *svc_iterator(svc_t **iter, int first) { svc_t *svc; if (!iter) { errno = EINVAL; return NULL; } if (first) svc = TAILQ_FIRST(&svc_list); else svc = *iter; if (svc) *iter = TAILQ_NEXT(svc, link); return svc; } /** * svc_named_iterator - Iterates over all instances of a service. * @iter: Iterator, must be a valid pointer * @first: If set, get first &svc_t, otherwise get next * @cmd: Service name to look for. * * Returns: * The first matching &svc_t when %NULL is given as argument, otherwise * the next &svc_t with the same @cmd name until the end when %NULL is * returned. */ svc_t *svc_named_iterator(svc_t **iter, int first, char *cmd) { svc_t *svc; for (svc = svc_iterator(iter, first); svc; svc = svc_iterator(iter, 0)) { char *name = svc->name; if (string_compare(name, cmd)) return svc; } return NULL; } /** * svc_job_iterator - Iterates over all instances of a service. * @iter: Iterator, must be a valid pointer * @first: If set, get first &svc_t, otherwise get next * @job: Job to look for. * * Returns: * The first matching &svc_t when %NULL is given as argument, otherwise * the next &svc_t with the same @job ID until the end when %NULL is * returned. */ svc_t *svc_job_iterator(svc_t **iter, int first, int job) { svc_t *svc; for (svc = svc_iterator(iter, first); svc; svc = svc_iterator(iter, 0)) { if (svc->job == job) return svc; } return NULL; } /** * svc_foreach - Run a callback for each registered service * @cb: Callback to run for each service */ void svc_foreach(int (*cb)(svc_t *)) { svc_t *svc, *iter = NULL; if (!cb) return; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) cb(svc); } /** * svc_foreach_type - Run a callback for each matching type * @types: Mask of service types * @cb: Callback to run for each matching type */ void svc_foreach_type(int types, int (*cb)(svc_t *)) { svc_t *svc, *iter = NULL; if (!cb) return; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (!(svc->type & types)) continue; cb(svc); } } /** * svc_stop_completed - Have all stopped services been collected? * * Returns: * %NULL if all stopped services have been collected, otherwise a * pointer to the first svc_t waiting to be collected. */ svc_t *svc_stop_completed(void) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (svc->state == SVC_STOPPING_STATE && svc->pid > 1) return svc; } return NULL; } /** * svc_clean_completed - Have post: and cleanup: scripts finished? * * Called late in runlevel and reload transitions to check if all post: and * cleanup:scripts have completed. A removed service should end up in the * DEAD state, while a service with a post:script ends up in HALTED. * * Returns: * %NULL if post: and cleanup: scripts have run, otherwise a pointer to * the first found svc_t waiting for post: or cleanup:script. */ svc_t *svc_clean_completed(void) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (svc_enabled(svc)) continue; if (svc_is_runtask(svc) && svc->state == SVC_DONE_STATE) continue; if (svc_is_removed(svc)) { if (svc->state == SVC_DEAD_STATE) continue; /* any cleanup:script done */ } else { if (svc->state == SVC_HALTED_STATE) continue; /* any post:script done */ } return svc; } return NULL; } /** * svc_find - Find a service object by its full path name * @name: Full path name, e.g., /sbin/syslogd * @id: Optional instance id * * Returns: * A pointer to an &svc_t object, or %NULL if not found. */ svc_t *svc_find(char *name, char *id) { svc_t *svc, *iter = NULL; if (!id) id = ""; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (!strcmp(svc->name, name) && !strcmp(svc->id, id)) return svc; } return NULL; } /** * svc_find_by_str - Find a service object by name:id * @str: name[:id] * * Like svc_find() but takes 'name[:id]' argument * * Returns: * A pointer to an &svc_t object, or %NULL if not found. */ svc_t *svc_find_by_str(const char *str) { char *name, *id; if (!str) return NULL; name = strdupa(str); id = strchr(name, ':'); if (id) *id++ = 0; else id = ""; return svc_find(name, id); } /** * svc_find_by_pid - Find a service object by its PID * @pid: Process ID to match * * Returns: * A pointer to an &svc_t object, or %NULL if not found. */ svc_t *svc_find_by_pid(pid_t pid) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (svc->pid == pid) return svc; } return NULL; } /** * svc_find_by_cond - Find a service object by its pid/foo condition * @cond: Full "pid/foo" condition * * Returns: * A pointer to an &svc_t object, or %NULL if not found. */ svc_t *svc_find_by_cond(const char *cond) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { char buf[MAX_COND_LEN]; mkcond(svc, buf, sizeof(buf)); if (string_compare(buf, cond)) return svc; } return NULL; } /** * svc_find_by_jobid - Find a service object by its JOB:ID * @job: Job n:o * @id: Optional instance id * * Returns: * A pointer to an &svc_t object, or %NULL if not found. */ svc_t *svc_find_by_jobid(int job, char *id) { svc_t *svc, *iter = NULL; if (!id) id = ""; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (svc->job == job && !strcmp(svc->id, id)) return svc; } return NULL; } svc_t *svc_find_by_tty(char *dev) { svc_t *svc, *iter = NULL; /* rescue (notty) shells have no device node */ if (!dev) return NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (!svc_is_tty(svc)) continue; if (!strcmp(dev, svc->dev)) return svc; } return NULL; } /** * svc_find_by_plidfile - Find a service by its PID file * @fn: PID file, can be absolute path or relative to /run * * This function is primarily used by the pidfile plugin to track the * conditions and dependencies of services. * * Note, the PID file is assumed to exist so the contents can be * compared to the the PID of a located service. There may be several * services, in many runlevels, that use the same name for the PID file. * So we won't know for sure until the PID is compared. * * Returns: * A pointer to an &svc_t object, or %NULL if not found. */ svc_t *svc_find_by_pidfile(char *fn) { svc_t *svc, *iter = NULL; pid_t pid; pid = pid_file_read(fn); if (pid > 1) { svc = svc_find_by_pid(pid); if (svc) return svc; } /* * No PID in file, or a sysv service. So it has probably forked * off a chiled that we don't know about. See if we can match * the PID file to a service instead. */ for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { int v = 0; if (svc->pidfile[0] == '!') v = 1; if (strcmp(&svc->pidfile[v], fn)) continue; return svc; } return NULL; } void svc_mark(svc_t *svc) { if (!svc || svc->protect) return; *((int *)&svc->removed) = 1; } /** * svc_mark_dynamic - Mark dynamically loaded services for deletion. * * This function traverses the list of known services, marking all that * have been loaded from /etc/finit.d/ for deletion. If a .conf file * has been removed svc_cleanup_dynamic() will stop and delete the * service. * * This function is called from sighup_cb(). */ void svc_mark_dynamic(void) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) svc_mark(svc); } void svc_mark_dirty(svc_t *svc) { *((int *)&svc->dirty) = 1; } void svc_mark_clean(svc_t *svc) { *((int *)&svc->dirty) = 0; *((int *)&svc->args_dirty) = 0; } void svc_enable(svc_t *svc) { *((int *)&svc->removed) = 0; } /** * svc_clean_dynamic - Stop and cleanup stale services removed from /etc/finit.d * @cb: Callback to run for each stale service * * This function traverses the list of known services to stop and clean * up all non-existing services previously marked by svc_mark_dynamic(). */ void svc_clean_dynamic(void (*cb)(svc_t *)) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (svc_is_removed(svc) && cb) cb(svc); } } /** * svc_clean_bootstrap - Remove bootstrap-only services after boot * @svc: Pointer to &svc_t object * * Returns: * %TRUE(1) if object was bootstrap-only, otherwise %FALSE(0) */ int svc_clean_bootstrap(svc_t *svc) { if (!ISOTHER(svc->runlevels, INIT_LEVEL)) { svc->pid = 0; svc_del(svc); return 1; } return 0; } /** * svc_prune_bootstrap - Prune any remaining bootstrap tasks * * This function cleans up all bootstrap tasks that have not yet been * collected, or that never even ran in bootstrap. All other instances * when svc_clean_bootstrap() is called are when a service is collected. */ void svc_prune_bootstrap(void) { svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (!svc->pid) svc_clean_bootstrap(svc); } } /** * svc_enabled - Should the service run? * @svc: Pointer to &svc_t object * * Returns: * 1, if the service is allowed to run in the current runlevel and the * user has not manually requested that this service should not run. 0 * otherwise. */ int svc_enabled(svc_t *svc) { if (!svc) return 0; if (!svc_in_runlevel(svc, runlevel)) { // dbg("Not in runlevel"); return 0; } if (svc_is_removed(svc) || svc_is_blocked(svc)) { // dbg("removed (%d) / blocked (%d)", svc->removed, svc->block); return 0; } if (svc_is_missing(svc)) { // dbg("missing"); return 0; } if (!svc_ifthen(0, NULL, svc->ifstmt, svc->nowarn)) { // dbg("ifthen:%s>", svc->ifstmt[0] ? svc->ifstmt : "<"); return 0; } if (svc_is_tty(svc) && bootstrap) { // dbg("is tty in bootstrap"); return 0; } return 1; } /** * svc_conflicts - Check if svc conflicts with any other running svc * @svc: * * Returns: * %TRUE(1) or %FALSE(0) */ int svc_conflicts(svc_t *svc) { char *ptr, *nm; int rc = 0; if (!svc->conflict[0]) return 0; ptr = strdup(svc->conflict); if (!ptr) return 0; nm = strtok(ptr, ","); while (nm) { svc_t *s; s = svc_find_by_str(nm); if (s) { if (s->state >= SVC_STOPPING_STATE) rc = 1; break; } nm = strtok(NULL, ","); } free(ptr); return rc; } /** * svc_ifthen - Check if: statement in declaration * @is_conf: Set when called by service_mark_unavail() * @ident: svc_t identififcation (name:id) * @stmt: if: statement from .conf file * @quiet: If non-zero, do not warn in syslog * * Returns: * %TRUE(1) yes, use this svc_t, %FALSE(0) prune */ int svc_ifthen(int is_conf, const char *ident, char *stmt, int quiet) { char stmts[MAX_IDENT_LEN]; int not = 0; svc_t *svc; if (!stmt || !stmt[0]) return 1; if (stmt[0] == '<') { enum cond_state cond; char *ptr = ++stmt; int i = 0; if (is_conf) return 1; while (ptr[i] != '>' && ptr[i] != 0) i++; ptr[i] = 0; strlcpy(stmts, stmt, sizeof(stmts)); for (stmt = strtok(stmts, ","); stmt; stmt = strtok(NULL, ","), not = 0) { if (stmt[0] == '!') { stmt++; not++; } cond = cond_get(stmt); if (not && cond == COND_ON) return 0; if (!not && cond == COND_OFF) return 0; } return 1; } if (!is_conf) return 1; strlcpy(stmts, stmt, sizeof(stmts)); for (stmt = strtok(stmts, ","); stmt; stmt = strtok(NULL, ","), not = 0) { if (stmt[0] == '!') { stmt++; not++; } svc = svc_find_by_str(stmt); if (not && svc) { if (!quiet) logit(LOG_NOTICE, "skipping %s, %s already loaded.", ident, svc_ident(svc, NULL, 0)); return 0; } if (!not && !svc) { if (!quiet) logit(LOG_NOTICE, "skipping %s, %s not available.", ident, stmt); return 0; } } return 1; } /* break up "job:id job:id job:id ..." into several "job:id" tokens */ static char *tokstr(char *str, size_t len) { static char *cur = NULL; static size_t pos = 0; char *token; if (!cur && !str) return NULL; if (str) { cur = str; pos = 0; } if (pos >= len) return NULL; token = &cur[pos]; while (pos < len) { if (isspace(cur[pos])) { cur[pos++] = 0; break; } pos++; } return token; } /* * Used by api.c (to start/stop/restart) and initctl.c (for input validation) */ int svc_parse_jobstr(char *str, size_t len, void *user_data, int (*found)(svc_t *, void *), int (not_found)(char *, char *, void *)) { char *input, *token; int result = 0; dbg("Got str:'%s'", str); input = tokstr(str, len); while (input) { char *id = NULL; svc_t *svc, *iter = NULL; char *ptr; dbg("Got token:'%s'", input); token = sanitize(input, strlen(input) + 1); if (!token) { dbg("Sanitation of token:'%s' failed", input); goto next; } ptr = strchr(token, ':'); if (isdigit(token[0])) { char *ep; long job = 0; errno = 0; job = strtol(token, &ep, 10); if ((errno == ERANGE && (job == LONG_MAX || job == LONG_MIN)) || (errno != 0 && job == 0) || (token == ep)) { result++; continue; } if (!ptr) { svc = svc_job_iterator(&iter, 1, job); if (!svc && not_found) result += not_found(NULL, token, user_data); while (svc) { if (found) result += found(svc, user_data); svc = svc_job_iterator(&iter, 0, job); } } else { *ptr++ = 0; id = ptr; svc = svc_find_by_jobid(job, id); if (!svc && not_found) result += not_found(token, id, user_data); else if (found) result += found(svc, user_data); } } else { if (!ptr) { svc = svc_named_iterator(&iter, 1, token); if (!svc && not_found) result += not_found(token, id, user_data); while (svc) { if (found) result += found(svc, user_data); svc = svc_named_iterator(&iter, 0, token); } } else { *ptr++ = 0; id = ptr; svc = svc_find(token, id); if (!svc && not_found) result += not_found(token, id, user_data); else if (found) result += found(svc, user_data); } } next: input = tokstr(NULL, len); } return result; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/sm.h0000644000175100001660000000267415054341541007627 /* Finit state machine * * Copyright (c) 2016 Jonas Johansson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_SM_H_ #define FINIT_SM_H_ void sm_init (void); void sm_step (void); int sm_in_reload (void); void sm_reload (void); void sm_runlevel (int newlevel); #endif /* FINIT_SM_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/client.h0000644000175100001660000000334115054341541010456 /* External client API, using UNIX domain socket. * * Copyright (c) 2015-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_CLIENT_H_ #define FINIT_CLIENT_H_ #include "finit.h" #include "svc.h" int client_connect (void); int client_disconnect (void); int client_socket (void); int client_request (struct init_request *rq, ssize_t len); int client_send (struct init_request *rq, ssize_t len); int client_command (int cmd); svc_t *client_svc_iterator (int first); svc_t *client_svc_find (const char *arg); svc_t *client_svc_find_by_cond (const char *arg); #endif /* FINIT_CLIENT_H_ */ finit-4.14/src/mdadm.c0000644000175100001660000000425115054341541010256 /* Handle MD arrays * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include #include "helpers.h" #include "util.h" static glob_t *get_arrays(void) { static glob_t arrays; glob("/sys/block/md*", 0, NULL, &arrays); if (arrays.gl_pathc > 0) return &arrays; return NULL; } /* * If system has an MD raid, we must tell it to stop before continuing * with the shutdown. Some controller cards, in particular the Intel(R) * Matrix Storage Manager, must be properly notified. */ void mdadm_wait(void) { glob_t *gl; /* Setup kernel specific settings, e.g. allow broadcast ping, etc. */ gl = get_arrays(); if (gl) { size_t i; for (i = 0; i < gl->gl_pathc; i++) { const char *array; char cmd[160]; array = basenm(gl->gl_pathv[i]); snprintf(cmd, sizeof(cmd), "mdadm --wait-clean /dev/%s >/dev/null", array); run_interactive(cmd, "Marking MD array %s as clean", array); } globfree(gl); } } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/cond.c0000644000175100001660000000600415054341541010115 /* Condition engine (read) * * Copyright (c) 2015-2017 Tobias Waldekranz * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "cond.h" #include "pid.h" #include "service.h" const char *condstr(enum cond_state s) { static const char *strs[] = { [COND_OFF] = "off", [COND_FLUX] = "flux", [COND_ON] = "on", }; return strs[s]; } const char *cond_path(const char *name) { static char path[256]; char tmp[MAX_ARG_LEN]; snprintf(tmp, sizeof(tmp), _PATH_COND "%s", name); return pid_runpath(tmp, path, sizeof(path)); } unsigned int cond_get_gen(const char *file) { char *ptr, path[256]; unsigned int gen; FILE *fp; int ret; /* /var/run --> /run symlink may not exist (yet) */ ptr = pid_runpath(file, path, sizeof(path)); fp = fopen(ptr, "r"); if (!fp) return 0; ret = fscanf(fp, "%u", &gen); fclose(fp); return (ret == 1) ? gen : 0; } enum cond_state cond_get_path(const char *path) { int cgen, rgen; cgen = cond_get_gen(path); if (!cgen) return COND_OFF; rgen = cond_get_gen(_PATH_RECONF); if (!rgen) return COND_OFF; return (cgen == rgen) ? COND_ON : COND_FLUX; } enum cond_state cond_get(const char *name) { return cond_get_path(cond_path(name)); } enum cond_state cond_get_agg(const char *names) { enum cond_state s = COND_ON; if (names) { char conds[strlen(names) + 1]; const char *cond; strlcpy(conds, names, sizeof(conds)); for (cond = strtok(conds, ","); s && cond; cond = strtok(NULL, ",")) s = min(s, cond_get(cond)); } return s; } int cond_affects(const char *name, const char *names) { char conds[MAX_COND_LEN]; char *cond; if (!name || !names) return 0; strlcpy(conds, names, sizeof(conds)); for (cond = strtok(conds, ","); cond; cond = strtok(NULL, ",")) { if (!strcmp(cond, name)) return 1; } return 0; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/api.c0000644000175100001660000003210215054341541007741 /* External client API, using UNIX domain socket. * * Copyright (c) 2015-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include #include "finit.h" #include "cond.h" #include "conf.h" #include "helpers.h" #include "log.h" #include "plugin.h" #include "private.h" #include "schedule.h" #include "service.h" #include "sm.h" #include "sig.h" #include "util.h" static uev_t api_watcher; static int call(int (*action)(svc_t *, void *), char *buf, size_t len) { return svc_parse_jobstr(buf, len, NULL, action, NULL); } static int stop(svc_t *svc, void *user_data) { (void)user_data; if (!svc) return 1; service_timeout_cancel(svc); svc_stop(svc); service_step(svc); service_step_all(SVC_TYPE_ANY); return 0; } static int start(svc_t *svc, void *user_data) { (void)user_data; if (!svc) return 1; service_timeout_cancel(svc); svc_start(svc); service_step(svc); service_step_all(SVC_TYPE_ANY); return 0; } /* * NOTE: this does not wait for svc to be stopped first, that is the * responsibility of initctl to do. Otherwise we'd block PID 1, * or introduce some nasty race conditions. */ static int restart(svc_t *svc, void *user_data) { if (!svc) return 1; if (!svc_is_running(svc)) return start(svc, user_data); service_timeout_cancel(svc); service_stop(svc); service_step(svc); return 0; } static int reload(svc_t *svc, void *user_data) { (void)user_data; if (!svc) return 1; if (svc_is_blocked(svc)) svc_start(svc); else service_timeout_cancel(svc); svc_mark_dirty(svc); service_step(svc); return 0; } static int do_stop (char *buf, size_t len) { return call(stop, buf, len); } static int do_start (char *buf, size_t len) { return call(start, buf, len); } static int do_restart(char *buf, size_t len) { return call(restart, buf, len); } static int do_reload (char *buf, size_t len) { return call(reload, buf, len); } static int do_signal_svc(svc_t *svc, void *user_data) { int signo; if (!svc || !user_data || !svc_is_running(svc)) return 1; signo = *(int *)user_data; return !!kill(svc->pid, signo); } static int do_signal(char *buf, size_t len, int sig) { /* Sanity check: do we know this signal? */ if (!*sig2str(sig)) return 1; return svc_parse_jobstr(buf, len, &sig, do_signal_svc, NULL); } static char query_buf[368]; static int missing(char *job, char *id, void *user_data) { char buf[20]; (void)user_data; if (!job) job = ""; if (!id) id = ""; snprintf(buf, sizeof(buf), "%s:%s ", job, id); strlcat(query_buf, buf, sizeof(query_buf)); return 1; } static int do_query(char *buf, size_t len) { query_buf[0] = 0; if (svc_parse_jobstr(buf, len, NULL, NULL, missing)) { memcpy(buf, query_buf, len); return 1; } return 0; } static svc_t *do_find(char *buf, size_t len) { char *id = NULL; char *ptr, *input; svc_t *iter = NULL; input = sanitize(buf, len); if (!input) return NULL; ptr = strchr(input, ':'); if (ptr) { *ptr++ = 0; id = ptr; } if (isdigit(input[0])) { char *ep; long job = 0; errno = 0; job = strtol(input, &ep, 10); if ((errno == ERANGE && (job == LONG_MAX || job == LONG_MIN)) || (errno != 0 && job == 0) || (input == ep)) return NULL; if (!id) return svc_job_iterator(&iter, 1, job); return svc_find_by_jobid(job, id); } if (!id) return svc_named_iterator(&iter, 1, input); return svc_find(input, id); } static svc_t *do_find_byc(char *buf, size_t len) { char *input; input = sanitize(buf, len); if (!input) { dbg("Invalid input"); return NULL; } return svc_find_by_cond(input); } static void bypass_shutdown(void *); struct wq emergency = { .cb = bypass_shutdown }; static void bypass_shutdown(void *unused) { (void)unused; cprintf("TIMEOUT TIMEOUT SHUTTING DOWN NOW!!\n"); do_shutdown(halt); } static int do_reboot(int cmd, int timeout, char *buf, size_t len) { int rc = 1; switch (cmd) { case INIT_CMD_REBOOT: halt = SHUT_REBOOT; break; case INIT_CMD_HALT: halt = SHUT_HALT; break; case INIT_CMD_POWEROFF: halt = SHUT_OFF; break; case INIT_CMD_SUSPEND: break; default: return 255; } if (timeout > 0) { emergency.delay = timeout * 1000; schedule_work(&emergency); } switch (cmd) { case INIT_CMD_REBOOT: dbg("reboot"); halt = SHUT_REBOOT; sm_runlevel(6); break; case INIT_CMD_HALT: dbg("halt"); halt = SHUT_HALT; sm_runlevel(0); break; case INIT_CMD_POWEROFF: dbg("poweroff"); halt = SHUT_OFF; sm_runlevel(0); break; case INIT_CMD_SUSPEND: dbg("suspend"); sync(); rc = suspend(); if (rc) { if (errno == EINVAL) snprintf(buf, len, "Kernel does not support suspend to RAM."); else snprintf(buf, len, "Failed: %s", strerror(errno)); } break; default: /* Handled previously */ break; } return rc; } typedef struct { char *event; void (*cb)(void); } ev_t; ev_t ev_list[] = { { "RELOAD", sm_reload }, { NULL, NULL } }; static void send_svc(int sd, svc_t *svc) { svc_t empty = { 0 }; size_t len; if (!svc) { empty.pid = -1; svc = ∅ } len = write(sd, svc, sizeof(*svc)); if (len != sizeof(*svc)) dbg("Failed sending svc_t to client"); } static void api_cb(uev_t *w, void *arg, int events) { static svc_t *iter = NULL; struct init_request rq; int sd, lvl; svc_t *svc; (void)arg; if (UEV_ERROR == events) { dbg("%s(): api socket %d invalid.", __func__, w->fd); goto error; } /* * TODO: refactor to use accept4() and a new uev handler for the * client socket instead of risking blocking PID 1 if the client * is misbehaving. */ // sd = accept4(w->fd, NULL, NULL, SOCK_NONBLOCK); sd = accept(w->fd, NULL, NULL); if (sd < 0) { err(1, "Failed serving API request"); goto error; } while (1) { int result = 0; ssize_t len; len = read(sd, &rq, sizeof(rq)); if (len <= 0) { if (-1 == len) { if (EINTR == errno) continue; if (EAGAIN == errno) break; /* we get here when client restarts itself */ if (ECONNRESET == errno) break; errx(1, "Failed reading initctl request, error %d: %s", errno, strerror(errno)); } break; } if (rq.magic != INIT_MAGIC || len != sizeof(rq)) { errx(1, "Invalid initctl request"); break; } switch (rq.cmd) { case INIT_CMD_RELOAD: case INIT_CMD_START_SVC: case INIT_CMD_RESTART_SVC: case INIT_CMD_STOP_SVC: case INIT_CMD_RELOAD_SVC: case INIT_CMD_REBOOT: case INIT_CMD_HALT: case INIT_CMD_POWEROFF: case INIT_CMD_SUSPEND: if (IS_RESERVED_RUNLEVEL(runlevel)) { strterm(rq.data, sizeof(rq.data)); warnx("Unsupported command (cmd: %d, data: %s) in runlevel S and 6/0.", rq.cmd, rq.data); goto leave; } default: break; } switch (rq.cmd) { case INIT_CMD_RUNLVL: /* Allow changing cfglevel in runlevel S */ if (IS_RESERVED_RUNLEVEL(runlevel)) { if (runlevel != INIT_LEVEL) { warnx("Cannot abort runlevel 6/0."); break; } } switch (rq.runlevel) { case 's': case 'S': rq.runlevel = '1'; /* Single user mode */ /* fallthrough */ case '0'...'9': dbg("Setting new runlevel %c", rq.runlevel); lvl = rq.runlevel - '0'; if (lvl == 0) halt = SHUT_OFF; if (lvl == 6) halt = SHUT_REBOOT; /* User requested change in next runlevel */ if (runlevel == INIT_LEVEL) cfglevel = lvl; else sm_runlevel(lvl); break; default: dbg("Unsupported runlevel: %d", rq.runlevel); break; } break; case INIT_CMD_DEBUG: dbg("debug"); log_debug(); break; case INIT_CMD_RELOAD: /* 'init q' and 'initctl reload' */ dbg("reload"); sm_reload(); break; case INIT_CMD_START_SVC: dbg("start %s", rq.data); strterm(rq.data, sizeof(rq.data)); result = do_start(rq.data, sizeof(rq.data)); break; case INIT_CMD_RESTART_SVC: dbg("restart %s", rq.data); strterm(rq.data, sizeof(rq.data)); result = do_restart(rq.data, sizeof(rq.data)); break; case INIT_CMD_STOP_SVC: dbg("stop %s", rq.data); strterm(rq.data, sizeof(rq.data)); result = do_stop(rq.data, sizeof(rq.data)); break; case INIT_CMD_RELOAD_SVC: dbg("reload %s", rq.data); strterm(rq.data, sizeof(rq.data)); result = do_reload(rq.data, sizeof(rq.data)); break; case INIT_CMD_GET_PLUGINS: result = plugin_list(rq.data, sizeof(rq.data)); break; case INIT_CMD_PLUGIN_DEPS: result = plugin_deps(rq.data, sizeof(rq.data)); break; case INIT_CMD_GET_RUNLEVEL: dbg("get runlevel"); rq.runlevel = runlevel; rq.sleeptime = prevlevel; break; case INIT_CMD_REBOOT: case INIT_CMD_HALT: case INIT_CMD_POWEROFF: case INIT_CMD_SUSPEND: result = do_reboot(rq.cmd, rq.sleeptime, rq.data, sizeof(rq.data)); break; case INIT_CMD_ACK: dbg("Client failed reading ACK"); goto leave; case INIT_CMD_WDOG_HELLO: dbg("wdog hello"); if (rq.runlevel <= 0) { result = 1; break; } dbg("Request to hand-over wdog ... to PID %d", rq.runlevel); svc = svc_find_by_pid(rq.runlevel); if (!svc) { logit(LOG_ERR, "Cannot find PID %d, not registered.", rq.runlevel); break; } if (wdog && wdog != svc) { char name[32]; svc_ident(svc, name, sizeof(name)); logit(LOG_NOTICE, "Handing over wdog ctrl from %s[%d] to %s[%d]", svc_ident(wdog, NULL, 0), wdog->pid, name, svc->pid); if (wdog->protect) { logit(LOG_NOTICE, "Stopping and deleting built-in watchdog."); stop(wdog, NULL); svc_del(wdog); } } wdog = svc; break; case INIT_CMD_SVC_ITER: // dbg("svc iter, first: %d", rq.runlevel); /* * XXX: This severely limits the number of * simultaneous client connections, but will * have to do for now. */ svc = svc_iterator(&iter, rq.runlevel); send_svc(sd, svc); goto leave; case INIT_CMD_SVC_QUERY: dbg("svc query: %s", rq.data); strterm(rq.data, sizeof(rq.data)); result = do_query(rq.data, sizeof(rq.data)); break; case INIT_CMD_SVC_FIND: dbg("svc find: %s", rq.data); strterm(rq.data, sizeof(rq.data)); send_svc(sd, do_find(rq.data, sizeof(rq.data))); goto leave; case INIT_CMD_SVC_FIND_BYC: dbg("svc find by cond: %s", rq.data); strterm(rq.data, sizeof(rq.data)); send_svc(sd, do_find_byc(rq.data, sizeof(rq.data))); goto leave; case INIT_CMD_SIGNAL: /* runlevel is reused for signal */ dbg("svc signal %d: %s", rq.runlevel, rq.data); strterm(rq.data, sizeof(rq.data)); result = do_signal(rq.data, sizeof(rq.data), rq.runlevel); break; default: dbg("Unsupported cmd: %d", rq.cmd); break; } if (result) rq.cmd = INIT_CMD_NACK; else rq.cmd = INIT_CMD_ACK; len = write(sd, &rq, sizeof(rq)); if (len != sizeof(rq)) dbg("Failed sending ACK/NACK back to client"); } leave: close(sd); return; error: api_exit(); if (api_init(w->ctx)) errx(1, "Unrecoverable error on API socket"); } int api_init(uev_ctx_t *ctx) { struct sockaddr_un sun = { .sun_family = AF_UNIX, .sun_path = INIT_SOCKET, }; mode_t oldmask; int uid, gid; int sd; dbg("Setting up external API socket ..."); sd = socket(AF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); if (-1 == sd) { err(1, "Failed starting external API socket"); return 1; } uid = geteuid(); gid = getgroup(DEFGROUP); erase(INIT_SOCKET); oldmask = umask(0117); if (-1 == bind(sd, (struct sockaddr*)&sun, sizeof(sun))) goto error; if (-1 == listen(sd, 10)) goto error; if (chown(INIT_SOCKET, uid, gid)) err(1, "Failed setting group %s on %s", DEFGROUP, INIT_SOCKET); umask(oldmask); if (!uev_io_init(ctx, &api_watcher, api_cb, NULL, sd, UEV_READ)) return 0; error: err(1, "Failed initializing API socket"); umask(oldmask); close(sd); return 1; } int api_exit(void) { uev_io_stop(&api_watcher); return close(api_watcher.fd); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/sig.h0000644000175100001660000000500415054341541007760 /* Signal management - Be conservative with what finit responds to! * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_SIG_H_ #define FINIT_SIG_H_ #include #include #define SETSIG(sa, sig, fun, flags) \ do { \ sa.sa_sigaction = fun; \ sa.sa_flags = SA_SIGINFO | flags; \ sigemptyset(&sa.sa_mask); \ sigaction(sig, &sa, NULL); \ } while (0) #define IGNSIG(sa, sig, flags) \ do { \ sa.sa_handler = SIG_IGN; \ sa.sa_flags = flags; \ sigemptyset(&sa.sa_mask); \ sigaction(sig, &sa, NULL); \ } while (0) #define DFLSIG(sa, sig, flags) \ do { \ sa.sa_handler = SIG_DFL; \ sa.sa_flags = flags; \ sigemptyset(&sa.sa_mask); \ sigaction(sig, &sa, NULL); \ } while (0) /* * For old-style /dev/initctl shutdown we default to halt */ #define SHUT_DEFAULT SHUT_HALT typedef enum { SHUT_OFF, SHUT_HALT, SHUT_REBOOT } shutop_t; extern shutop_t halt; void do_shutdown (shutop_t op); int sig_num (const char *name); void sig_init (void); void sig_unblock (void); void sig_setup (uev_ctx_t *ctx); const char *sig_name(int signo); #endif /* FINIT_SIG_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/keventd.c0000644000175100001660000001536115054341541010640 /* Listens to kernel events like AC power status and manages sys/ conditions * * Copyright (c) 2021-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "cond.h" #include "pid.h" #include "util.h" #define _PATH_SYSFS_PWR "/sys/class/power_supply" static int num_ac_online; static int num_ac; static int running = 1; static int level; static int logon; int debug; /* debug in other modules as well */ void logit(int prio, const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (logon) vsyslog(prio, fmt, ap); else if (prio <= level) { vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); } va_end(ap); } #define panic(fmt, args...) { logit(LOG_CRIT, fmt ":%s", ##args, strerror(errno)); exit(1); } #define warn(fmt, args...) { logit(LOG_WARNING, fmt ":%s", ##args, strerror(errno)); } static void sys_cond(char *cond, int set) { char oneshot[256]; snprintf(oneshot, sizeof(oneshot), "%s/%s", _PATH_CONDSYS, cond); if (set) { if (symlink(_PATH_RECONF, oneshot) && errno != EEXIST) warn("failed asserting sys/%s", cond); } else { if (erase(oneshot) && errno != ENOENT) warn("failed asserting sys/%s", cond); } } static int fgetline(char *path, char *buf, size_t len) { FILE *fp; fp = fopen(path, "r"); if (!fp) return -1; if (!fgets(buf, len, fp)) { fclose(fp); return -1; } chomp(buf); fclose(fp); return 0; } static int check_online(char *online) { int val; if (!online) return 0; val = atoi(online); logit(LOG_INFO, "AC %s", val ? "connected" : "disconnected"); return val; } static int is_ac(char *type) { char *types[] = { "Mains", "USB", "BrickID", "Wireless", NULL }; int i; for (i = 0; types[i]; i++) { if (!strncmp(type, types[i], strlen(types[i]))) return 1; } return 0; } static void init(void) { struct dirent **d = NULL; char *cond_dirs[] = { _PATH_CONDSYS, _PATH_CONDSYS "/pwr", }; char path[384]; int i, n; for (i = 0; i < (int)NELEMS(cond_dirs); i++) { if (mkpath(cond_dirs[i], 0755) && errno != EEXIST) { warn("Failed creating %s condition directory, %s", COND_SYS, cond_dirs[i]); return; } } n = scandir(_PATH_SYSFS_PWR, &d, NULL, alphasort); for (i = 0; i < n; i++) { char *nm = d[i]->d_name; char buf[10]; snprintf(path, sizeof(path), "%s/%s/type", _PATH_SYSFS_PWR, nm); if (!fgetline(path, buf, sizeof(buf)) && is_ac(buf)) { num_ac++; snprintf(path, sizeof(path), "%s/%s/online", _PATH_SYSFS_PWR, nm); if (!fgetline(path, buf, sizeof(buf))) { if (check_online(buf)) num_ac_online++; } } free(d[i]); } if (n > 0) free(d); /* if any power_supply is online, or none can be found */ if (num_ac == 0 || num_ac_online > 0) sys_cond("pwr/ac", 1); } static void set_logging(int prio) { setlogmask(LOG_UPTO(prio)); level = prio; } static void toggle_debug(int signo) { (void)signo; debug ^= 1; set_logging(debug ? LOG_DEBUG : LOG_NOTICE); } static void shut_down(int signo) { (void)signo; running = 0; } /* * Started by Finit as soon as possible when base filesystem is up, * modules have been probed, or insmodded from /etc/finit.conf, so by * now we should have /sys/class/power_supply/ available for probing. * If none is found we assert /sys/pwr/ac condition anyway, this is what * systemd does (ConditionACPower) and also makes most sense. */ int main(int argc, char *argv[]) { struct sockaddr_nl nls = { 0 }; struct pollfd pfd; char buf[1024]; if (argc > 1) { if (!strcmp(argv[1], "-d")) debug = 1; } if (!debug) { openlog("keventd", LOG_PID, LOG_DAEMON); set_logging(LOG_NOTICE); logon = 1; } signal(SIGUSR1, toggle_debug); signal(SIGTERM, shut_down); init(); pfd.events = POLLIN; pfd.fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); if (pfd.fd == -1) panic("failed creating netlink socket"); nls.nl_family = AF_NETLINK; nls.nl_pid = 0; nls.nl_groups = -1; if (bind(pfd.fd, (void *)&nls, sizeof(struct sockaddr_nl))) panic("bind failed"); logit(LOG_DEBUG, "Waiting for events ..."); while (running) { char *path = NULL; int ac = 0; int i, len; if (-1 == poll(&pfd, 1, -1)) { if (errno == EINTR) continue; break; } len = recv(pfd.fd, buf, sizeof(buf), MSG_DONTWAIT); if (len == -1) { switch (errno) { case EINTR: continue; case ENOBUFS: warn("lost events"); continue; default: panic("unhandled"); continue; } } buf[len] = 0; logit(LOG_DEBUG, "%s", buf); /* skip libusb events, focus on kernel events/changes */ if (strncmp(buf, "change@", 7)) continue; /* XXX: currently limited to monitoring this subsystem */ if (!strstr(buf, "power_supply")) continue; i = 0; while (i < len) { char *line = buf + i; logit(LOG_DEBUG, "%s", line); if (!strncmp(line, "DEVPATH=", 8)) { path = &line[8]; logit(LOG_DEBUG, "Got path %s", path); } else if (!strncmp(line, "POWER_SUPPLY_TYPE=", 18)) { ac = is_ac(&line[18]); } else if (!strncmp(line, "POWER_SUPPLY_ONLINE=", 20) && ac) { if (check_online(&line[20])) { if (!num_ac_online) sys_cond("pwr/ac", 1); num_ac_online++; } else { if (num_ac_online > 0) num_ac_online--; if (!num_ac_online) sys_cond("pwr/ac", 0); } } i += strlen(line) + 1; } } close(pfd.fd); return 0; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/serv.c0000644000175100001660000002747415054341541010167 /* List and enable/disable service configurations * * Copyright (c) 2017-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" #include /* Definition of AT_* constants */ #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "client.h" #include "initctl.h" static int is_builtin(char *arg) { svc_t *svc; /* skip check, we may be in non-responsive bootstrap */ if (iforce) return 0; svc = client_svc_find(arg); if (!svc) return 0; if (svc->file[0]) return 0; return 1; } static int calc_width(char *arr[], size_t len) { int width = 0; size_t i; for (i = 0; i < len; i++) { int w = strlen(arr[i]); if (w > width) width = w; } return width; } static void do_list(const char *path, char *title, int comma) { static int once = 0; int width, num, prev; glob_t gl; size_t i; if (chdir(path)) { char *dir, *ptr; if (!fexist(path)) return; dir = strdupa(path); if (!dir) return; ptr = strrchr(dir, '/'); if (ptr) *ptr++ = 0; else ptr = dir; if (json) { printf("%s\"%s\": \"%s\"", comma ? "," :"", title, path); return; } if (heading) print_header("%s%s ", once ? "\n" : "", dir); puts(ptr); puts(""); return; } if (glob("*.conf", 0, NULL, &gl)) return; if (gl.gl_pathc <= 0) goto done; if (plain && !json) { if (heading) print_header("%s%s ", once ? "\n" : "", path); once++; for (i = 0; i < gl.gl_pathc; i++) { if (!heading) { char buf[512]; paste(buf, sizeof(buf), path, gl.gl_pathv[i]); puts(buf); } else puts(gl.gl_pathv[i]); } goto done; } if (heading && !json) print_header("%s ", path); if (json) printf("%s\"%s\": [", comma ? "," : "", title); width = calc_width(gl.gl_pathv, gl.gl_pathc); if (width <= 0) goto done; num = (ttcols - 2) / width; if ((num - 1) * 2 + num * width > ttcols) num--; prev = 0; for (i = 0; i < gl.gl_pathc; i++) { if (i > 0 && !(i % num) && !json) { puts(""); prev = 0; } if (prev) printf("%s", json ? "," : " "); if (json) printf("\"%s\"", gl.gl_pathv[i]); else printf("%-*s", width, gl.gl_pathv[i]); prev++; } if (json) fputs("]", stdout); else puts("\n"); done: globfree(&gl); } int serv_list(char *arg) { char path[256]; int pre = 0; if (arg && arg[0]) { paste(path, sizeof(path), finit_rcsd, arg); if (fisdir(path)) { if (json) fputs("[", stdout); do_list(path, NULL, 0); if (json) fputs("]\n", stdout); return 0; } /* fall back to list all */ } if (json) fputs("{", stdout); paste(path, sizeof(path), finit_rcsd, "available"); if (fisdir(path)) do_list(path, "available", pre++); paste(path, sizeof(path), finit_rcsd, "enabled"); if (fisdir(path)) do_list(path, "enabled", pre++); if (fisdir(finit_rcsd)) do_list(finit_rcsd, "static", pre++); if (fexist(finit_conf)) do_list(finit_conf, "finit.conf", pre++); if (json) fputs("}\n", stdout); return 0; } /* * Return path to configuration file for 'name'. This may be any of the * following, provided sysconfdir is /etc: * * - /etc/finit.d/available/$name.conf * - /etc/finit.d/$name.conf * - /etc/finit.conf * * The system *may* have a /etc/finit.d/available/ directory, or it may * just use a plain /etc/finit.d/ -- we do not set policy. * * If the resulting file doesn't exist, and creat is not set, *or* * the base directory doesn't exist, we return NULL. .*/ static char *conf(char *path, size_t len, char *name, int creat, int template) { if (!name || !name[0] || !strcmp(name, "finit") || !strcmp(name, "finit.conf")) { strlcpy(path, finit_conf, len); return path; } if (!fisdir(finit_rcsd)) return NULL; paste(path, len, finit_rcsd, "available/"); if (!fisdir(path)) { if (creat && mkdir(path, 0755) && errno != EEXIST) return NULL; paste(path, len, finit_rcsd, name); } else strlcat(path, name, len); if (suffix(path, len, ".conf")) return NULL; /* fall back to static service unless edit/create */ if (!creat && !fexist(path)) { char *at = strchr(path, '@'); if (template && at) *++at = 0; else paste(path, len, finit_rcsd, name); if (suffix(path, len, ".conf")) return NULL; } return path; } int serv_enable(char *arg) { char *serv, *ptr, *src, *dst; size_t len; int rc; if (!arg || !arg[0]) { WARNX("missing argument to enable, may be one of:"); return serv_list("available"); } if (arg[0] == '/') { WARNX("absolute paths not supported, this command manages %s/available/", finit_rcsd); return serv_list("available"); } len = strlen(arg); serv = alloca(len + 6); if (!serv) ERR(71, "failed allocating stack"); strlcpy(serv, arg, len + 6); if (len < 6 || strcmp(&serv[len - 5], ".conf")) strlcat(serv, ".conf", len + 6); if (chdir(finit_rcsd)) ERR(72, "failed cd %s", finit_rcsd); if (icreate && mkdir("enabled", 0755) && EEXIST != errno) ERR(73, "failed creating %s/enabled directory", finit_rcsd); if (asprintf(&src, "%s/available/%s", finit_rcsd, serv) == -1) goto fail; if (asprintf(&dst, "%s/enabled/%s", finit_rcsd, serv) == -1) { free(src); fail: ERR(71, "failed allocating memory"); } if (fexist(dst)) { WARNX("%s already enabled", arg); rc = noerr ? 0 : 1; goto done; } /* check for template instantiation */ ptr = strchr(src, '@'); if (ptr) strcpy(++ptr, ".conf"); if (!fexist(src)) { WARNX("cannot find %s%s", ptr ? "template ": "", src); rc = 72; goto done; } rc = symlink(src, dst); if (rc) WARN("failed enabling %s", arg); done: free(src); free(dst); return rc; } int do_disable(char *arg, int check) { struct stat st; size_t len; char *serv; if (!arg || !arg[0]) { WARNX("missing argument to disable, may be one of:"); return serv_list("enabled"); } if (arg[0] == '/') { WARNX("absolute paths not supported, this command manages %s/enabled/", finit_rcsd); return serv_list("available"); } len = strlen(arg) + 7; serv = alloca(len); if (!serv) ERR(71, "failed allocating stack"); strlcpy(serv, arg, len); if (suffix(serv, len, ".conf")) ERR(71, "failed composing service name (%s)", serv); if (chdir(finit_rcsd)) ERR(72, "failed cd %s", finit_rcsd); if (chdir("enabled")) /* System *may* have enabled/ dir. */ dbg("Failed changing to %s/enabled/: %s", finit_rcsd, strerror(errno)); if (check && stat(serv, &st)) ERRX(noerr ? 0 : 6, "%s not (an) enabled (service).", serv); if (check && (st.st_mode & S_IFMT) == S_IFLNK) ERRX(noerr ? 0 : 1, "cannot disable %s, not a symlink.", serv); return remove(serv) != 0; } int serv_disable(char *arg) { return do_disable(arg, 1); } int serv_touch(char *arg) { char path[256]; char *fn; if (!arg || !arg[0]) { WARNX("missing argument to touch, may be one of:"); return serv_list("enabled"); } /* 1. Try /etc/finit.d/enabled/$arg.conf to handle template@.conf */ paste(path, sizeof(path), finit_rcsd, "enabled/"); strlcat(path, arg, sizeof(path)); if (!suffix(path, sizeof(path), ".conf") && fexist(path)) { fn = path; goto touchit; } /* 2. Try /etc/finit.d/available/$arg.conf and other combos (legacy) */ fn = conf(path, sizeof(path), arg, 0, 0); if (!fexist(fn)) { if (!strstr(arg, "finit.conf")) ERRX(noerr ? 0 : 72, "%s not available.", arg); if (is_builtin(arg)) ERRX(noerr ? 0 : 4, "%s is a built-in service.", arg); strlcpy(path, finit_conf, sizeof(path)); fn = path; } touchit: /* libite:touch() follows symlinks */ if (utimensat(AT_FDCWD, fn, NULL, AT_SYMLINK_NOFOLLOW)) ERR(noerr ? 0 : 71, "failed marking %s for reload", fn); return 0; } int serv_show(char *arg) { char path[256]; char *fn; fn = conf(path, sizeof(path), arg, 0, 0); if (!fexist(fn)) { if (is_builtin(arg)) ERRX(4, "%s is a built-in service.", arg); fn = conf(path, sizeof(path), arg, 0, 1); if (!fn || !fexist(fn)) { WARNX("Cannot find %s", arg); return 1; } return systemf("cat %s | sed 's/%%i/system/g'", fn); } return systemf("cat %s", fn); } /* * Try to open an editor for the given file, if creat is given we * create a new file based on /lib/finit/sample.conf * * The order of editors that this command checks for is evaluated * as follows, in order: * * sensible-editor :: debian based systems * editor :: debian + most other systems * VISUAL :: full-screen editor program * EDITOR :: line-mode editor program * $(command ...) :: fallback to mg or vi * * For details: https://jdebp.uk/FGA/unix-editors-and-pagers.html */ static int do_edit(char *arg, int creat) { char *editor[] = { "sensible-editor", "editor", "${VISUAL:-${EDITOR:-$(command -v mg || command -v vi)}}" }; char path[256]; char *fn; fn = conf(path, sizeof(path), arg, creat, 0); if (!fexist(fn)) { if (is_builtin(arg)) ERRX(4, "%s is a built-in service.", arg); if (!creat) { WARNX("Cannot find %s, use -c flag, create command, or select one of:", arg); return serv_list(NULL); } #ifdef SAMPLE_CONF /* Try copying file, it may have been removed by sysop */ copyfile(SAMPLE_CONF, fn, 0, 0); #endif } else if (creat) WARNX("the file %s already exists, falling back to edit.", fn); for (size_t i = 0; i < NELEMS(editor); i++) { if (systemf("%s %s 2>/dev/null", editor[i], path)) continue; return 0; } return 1; } int serv_edit(char *arg) { if (!arg || !arg[0]) { if (!yorn("Do you want to edit %s (y/N)? ", finit_conf)) return 0; arg = ""; } return do_edit(arg, icreate); } int serv_creat(char *arg) { char buf[256]; char *fn; FILE *fp; if (!arg || !arg[0]) ERRX(2, "missing argument to create"); if (is_builtin(arg)) ERRX(4, "%s is a built-in service.", arg); /* Input from a pipe or a proper TTY? */ if (isatty(STDIN_FILENO)) return do_edit(arg, 1); /* Open fn for writing from pipe */ fn = conf(buf, sizeof(buf), arg, 1, 0); if (!fn) ERR(73, "failed creating conf %s", arg); if (!icreate && fexist(fn)) { WARNX("%s already exists, skipping (use -c to override)", fn); fn = "/dev/null"; } fp = fopen(fn, "w"); if (!fp) ERR(73, "failed opening %s for writing", fn); while (fgets(buf, sizeof(buf), stdin)) fputs(buf, fp); return fclose(fp); } int serv_delete(char *arg) { char buf[256]; char *fn; if (!arg || !arg[0]) { WARNX("missing argument to delete, may be one of:"); return serv_list("available"); } fn = conf(buf, sizeof(buf), arg, 0, 0); if (!fn) { if (is_builtin(arg)) ERRX(4, "%s is a built-in service.", arg); ERRX(72, "%s missing on system.", finit_rcsd); } if (!fexist(fn)) WARNX("cannot find %s", fn); if (iforce || yorn("Remove file and symlink(s) to %s (y/N)? ", fn)) { do_disable(arg, 0); if (remove(fn)) ERR(1, "Failed removing %s", fn); } return 0; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/exec.c0000644000175100001660000002525215054341541010124 /* Functions for exec'ing processes * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include #include #include #include #include /* Not included by default in musl libc */ #include #ifdef _LIBITE_LITE # include #else # include #endif #include #include "finit.h" #include "cgroup.h" #include "conf.h" #include "helpers.h" #include "sig.h" #include "util.h" #include "utmp-api.h" #define NUM_ARGS 16 /* Wait for process completion, returns status of waitpid(2) syscall */ int complete(char *cmd, int pid) { int status = 0; if (waitpid(pid, &status, 0) == -1) { if (errno == EINTR) warnx("Caught unblocked signal waiting for %s, aborting", cmd); else if (errno == ECHILD) warnx("Caught SIGCHLD waiting for %s, aborting", cmd); else warnx("Failed starting %s, error %d: %s", cmd, errno, strerror(errno)); return -1; } return status; } static int do_redirect(void) { FILE *fp; fp = fopen("/dev/null", "w"); if (fp) { int fd = fileno(fp); dup2(fd, STDIN_FILENO); dup2(fd, STDOUT_FILENO); dup2(fd, STDERR_FILENO); return fclose(fp); } return -1; } /* * Run 'cmd' and wait for completion. If 'log' is not NULL any output * from the command is logged with the given string as prefix, use "" to * skip. If 'log' is NULL all output is redirected to /dev/null, which * is what this function originally did. */ int run(char *cmd, char *log) { char *args[NUM_ARGS + 1] = { 0 }; int status, result, i = 0; char *backup = NULL; pid_t pid; if (!log) { char *arg; /* We must create a copy that is possible to modify. */ backup = arg = strdup(cmd); if (!arg) return 1; /* Split command line into tokens of an argv[] array. */ args[i++] = strsep(&arg, "\t "); while (arg && i < NUM_ARGS) { /* Handle run("su -c \"dbus-daemon --system\" messagebus"); * => "su", "-c", "\"dbus-daemon --system\"", "messagebus" */ if (*arg == '\'' || *arg == '"') { char *p, delim[2] = " "; delim[0] = arg[0]; args[i++] = arg++; strsep(&arg, delim); p = arg - 1; *p = *delim; *arg++ = 0; } else { args[i++] = strsep(&arg, "\t "); } } args[i] = NULL; if (i == NUM_ARGS && arg) { errx(1, "Command too long: %s", cmd); free(backup); errno = EOVERFLOW; return 1; } } pid = fork(); if (0 == pid) { char *pfx, buf[256]; FILE *pp; int rc; setsid(); sig_unblock(); if (!log) { do_redirect(); execvp(args[0], args); _exit(EX_OSERR); } pp = popen(cmd, "r"); if (!pp) _exit(EX_OSERR); pfx = *log ? ": " : ""; while (fgets(buf, sizeof(buf), pp)) { chomp(buf); logit(LOG_NOTICE, "%s%s%s", log, pfx, buf); } rc = pclose(pp); if (rc == -1) _exit(EX_OSERR); _exit(WEXITSTATUS(rc)); } else if (-1 == pid) { err(1, "%s", !log ? args[0] : cmd); if (backup) free(backup); return -1; } status = complete(args[0], pid); if (-1 == status) { if (backup) free(backup); return 1; } result = WEXITSTATUS(status); if (WIFEXITED(status)) { dbg("Started '%s' and exit without signal, status: %d", cmd, result); } else if (WIFSIGNALED(status)) { dbg("Process '%s' terminated by signal %d", cmd, WTERMSIG(status)); if (!result) result = 1; /* Must alert callee the command did not complete successfully. * This is necessary since not all programs trap signals and * change their return code accordingly. --Jocke */ } if (backup) free(backup); return result; } int run_interactive(char *cmd, char *fmt, ...) { int status, oldout = 1, olderr = 2; FILE *fp; if (!cmd) { errno = EINVAL; return 1; } if (fmt) { va_list ap; va_start(ap, fmt); printv(fmt, ap); va_end(ap); } /* Redirect output from cmd to a tempfile */ fp = tempfile(); if (fp && !debug) { oldout = dup(STDOUT_FILENO); olderr = dup(STDERR_FILENO); dup2(fileno(fp), STDOUT_FILENO); dup2(fileno(fp), STDERR_FILENO); } /* Run cmd ... */ status = run(cmd, ""); /* Restore stderr/stdout */ if (fp && !debug) { if (oldout >= 0) { dup2(oldout, STDOUT_FILENO); close(oldout); } if (olderr >= 0) { dup2(olderr, STDERR_FILENO); close(olderr); } } if (fmt) print_result(status); /* Dump any results of cmd on stderr after we've printed [ OK ] or [FAIL] */ if (fp && !debug) { char line[LINE_SIZE]; size_t len, written; rewind(fp); do { len = fread(line, 1, sizeof(line), fp); written = fwrite(line, len, sizeof(char), stderr); } while (len > 0 && written == len); } if (fp) fclose(fp); return status; } int exec_runtask(char *cmd, char *args[]) { char buf[1024] = ""; char *argv[4] = { "sh", "-c", buf, NULL }; size_t i; strlcat(buf, cmd, sizeof(buf)); for (i = 1; args && args[i]; i++) { strlcat(buf, " ", sizeof(buf)); strlcat(buf, args[i], sizeof(buf)); } logit(LOG_DEBUG, "Calling %s %s", _PATH_BSHELL, buf); dbg("Calling %s %s", _PATH_BSHELL, buf); return execvp(_PATH_BSHELL, argv); } static void prepare_tty(char *tty, speed_t speed, const char *procname, struct rlimit rlimit[]) { char name[80]; int fd, dummy; fd = open(tty, O_RDWR); if (fd < 0) { logit(LOG_ERR, "Failed opening %s: %s", tty, strerror(errno)); _exit(1); } dup2(fd, STDIN_FILENO); dup2(fd, STDOUT_FILENO); dup2(fd, STDERR_FILENO); /* Set default TERM, run_getty() below allows override */ if (ioctl(fd, VT_OPENQRY, &dummy) == -1) setenv("TERM", "vt102", 1); /* likely a serial line */ else setenv("TERM", "linux", 1); /* * Reset to sane defaults in case of messup from prev. session */ stty(fd, speed); close(fd); /* Set configured limits */ for (int i = 0; i < RLIMIT_NLIMITS; i++) { if (setrlimit(i, &rlimit[i]) == -1) logit(LOG_WARNING, "%s: rlimit: Failed setting %s", tty, rlim2str(i)); } /* Finit is responsible for the UTMP INIT_PROCESS record */ utmp_set_init(tty, 0); if (!strncmp("/dev/", tty, 5)) tty += 5; snprintf(name, sizeof(name), "%s %s", procname, tty); prctl(PR_SET_NAME, name, 0, 0, 0); } static int activate_console(int noclear, int nowait) { static const char msg[] = "\nPlease press Enter to activate this console."; static const char clr[] = "\r\e[K"; static const char cup[] = "\e[A"; struct termios orig; char ch; int rc; if (nowait || rescue) return 1; if (!noclear) dprint(STDERR_FILENO, "\e[r\e[H\e[J", 9); /* Disable ECHO, XON/OFF while waiting for */ if (!tcgetattr(STDIN_FILENO, &orig)) { struct termios c = orig; c.c_iflag &= ~(BRKINT|ICRNL|INPCK|ISTRIP|IXON|IXOFF); c.c_oflag &= ~(OPOST); c.c_cflag |= (CS8); c.c_lflag &= ~(ECHO|ICANON|IEXTEN|ISIG); tcsetattr(STDIN_FILENO, TCSAFLUSH, &c); } dprint(STDERR_FILENO, clr, strlen(clr)); dprint(STDERR_FILENO, msg, strlen(msg)); while ((rc = read(STDIN_FILENO, &ch, 1)) > 0 && ch != '\r' && ch != '\n') ; /* On any error (likely EINTR), we avoid starting getty */ if (rc == -1) rc = 0; /* Clear msg and move cursor up for next message/login: */ dprint(STDERR_FILENO, clr, strlen(clr)); dprint(STDERR_FILENO, cup, strlen(cup)); /* Restore TTY */ if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig) == -1) rc = 0; /* TTY in bad shape, restart */ return rc; } /* * Start a getty on @tty * * At the login: prompt, no signals are allowed, both Ctrl-C and Ctrl-D * should be disabled. Ctrl-S and Ctrl-Q are optional, but most getty * allow them. * * Prior to getty is called and login: is printed, Finit may display the * "Please press Enter ..." if @nowait is unset. This mode must be RAW, * only accepting and not echoing anything, this also means no * signals are allowed. For ease of implementation Finit will call the * stty() function to reset the TTY and then force RAW mode until a * has been received. This is handled in the same fashion for both this * function and run_getty2(), which is used for external getty. * * When handing over to /bin/login, Ctrl-C and Ctrl-D must be enabled * since /bin/login usually only disables ECHO until a password line has * been entered. Upon starting the user's $SHELL the ISIG flag is reset */ pid_t run_getty(char *tty, char *cmd, char *args[], int noclear, int nowait, struct rlimit rlimit[]) { int rc = 1; /* Dunno speed, tell stty() to not mess with it */ prepare_tty(tty, B0, "getty", rlimit); if (activate_console(noclear, nowait)) { logit(LOG_INFO, "Starting getty on %s", tty); rc = execv(cmd, args); } vhangup(); return rc; } int sh(char *tty) { char *args[2] = { NULL, NULL }; char *arg0; size_t len; /* The getty process is usually responsible for the UTMP login record */ utmp_set_login(tty, NULL); /* Start /bin/sh as a login shell, i.e. with a prefix '-' */ len = strlen(_PATH_BSHELL) + 2; arg0 = malloc(len); if (!arg0) { err(1, "Failed allocating memory"); return 1; } snprintf(arg0, len, "-%s", _PATH_BSHELL); args[0] = arg0; /* Unblock signals inherited from parent */ sig_unblock(); return execv(_PATH_BSHELL, args); } pid_t run_sh(char *tty, int noclear, int nowait, struct rlimit rlimit[]) { int rc = 1; prepare_tty(tty, B0, "finitsh", rlimit); if (activate_console(noclear, nowait)) rc = sh(tty); return rc; } pid_t run_bg(char *cmd, char *args[]) { pid_t pid; if (access(cmd, X_OK)) return 0; print(-1, "Calling %s in the background", cmd); pid = fork(); if (!pid) _exit(exec_runtask(cmd, args)); print_result(pid == -1); return pid; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/rescue.conf0000644000175100001660000000003615054341541011162 runlevel 1 tty [12345] rescue finit-4.14/src/utmp-api.c0000644000175100001660000001006315054341541010726 /* UTMP API * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "helpers.h" #include "util.h" #include "utmp-api.h" #define MAX_NO 5 #define MAX_SZ 100 * 1024 extern int logrotate(char *file, int num, off_t sz); static void utmp_strncpy(char *dst, const char *src, size_t dlen) { size_t i; for (i = 0; i < dlen && src[i]; i++) dst[i] = src[i]; if (i < dlen) dst[i] = 0; } /* * Rotate /var/log/wtmp (+ btmp?) and /run/utmp * * Useful on systems with no logrotate daemon, e.g. BusyBox based * systems where syslogd rotates its own log files only. */ void utmp_logrotate(void) { #ifdef LOGROTATE_ENABLED int i; char *files[] = { _PATH_UTMP, _PATH_WTMP, _PATH_BTMP, _PATH_LASTLOG, NULL }; if (!has_utmp()) return; for (i = 0; files[i]; i++) logrotate(files[i], MAX_NO, MAX_SZ); #endif /* LOGROTATE_ENABLED */ } int utmp_set(int type, int pid, char *line, char *id, char *user) { int result = 0; struct utmp ut; struct utsname uts; if (!has_utmp()) return 0; switch (type) { case RUN_LVL: case BOOT_TIME: line = "~"; id = "~~"; break; default: break; } memset(&ut, 0, sizeof(ut)); ut.ut_type = type; ut.ut_pid = pid; if (user) utmp_strncpy(ut.ut_user, user, sizeof(ut.ut_user)); if (line) utmp_strncpy(ut.ut_line, line, sizeof(ut.ut_line)); if (id) utmp_strncpy(ut.ut_id, id, sizeof(ut.ut_id)); if (!uname(&uts)) utmp_strncpy(ut.ut_host, uts.release, sizeof(ut.ut_host)); ut.ut_tv.tv_sec = time(NULL); if (type != DEAD_PROCESS) { setutent(); result += pututline(&ut) ? 0 : 1; endutent(); } utmp_logrotate(); updwtmp(_PATH_WTMP, &ut); return result; } int utmp_set_boot(void) { return utmp_set(BOOT_TIME, 0, NULL, NULL, "reboot"); } int utmp_set_halt(void) { return utmp_set(RUN_LVL, 0, NULL, NULL, "shutdown"); } static int set_getty(int type, char *tty, char *id, char *user) { char *line; if (!has_utmp()) return 0; if (!tty) line = NULL; else if (!strncmp(tty, "/dev/", 5)) line = tty + 5; else line = tty; if (!id && line) { id = line; if (!strncmp(id, "pts/", 4)) id += 4; } return utmp_set(type, getpid(), line, id, user); } int utmp_set_init(char *tty, char *id) { return set_getty(INIT_PROCESS, tty, id, NULL); } int utmp_set_login(char *tty, char *id) { return set_getty(LOGIN_PROCESS, tty, id, "LOGIN"); } int utmp_set_dead(int pid) { return utmp_set(DEAD_PROCESS, pid, NULL, NULL, NULL); } static int encode(int lvl) { if (lvl == INIT_LEVEL) return 0; return lvl + '0'; } int utmp_set_runlevel(int pre, int now) { return utmp_set(RUN_LVL, (encode(pre) << 8) | (encode(now) & 0xFF), NULL, NULL, "runlevel"); } void runlevel_set(int pre, int now) { utmp_set_runlevel(pre, now); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/iwatch.c0000644000175100001660000001126615054341541010457 /* inotify watcher for files or directories * * Copyright (c) 2015-2016 Tobias Waldekranz * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include "finit.h" #include "iwatch.h" #include "log.h" /* * iwatch is initialized and used mainly by the pidfile plugin, which is * one of the cornerstones in the condition subsystem. Other parts of * Finit may use iwatch too, like env: watchers, but are disabled if the * pidfile plugin hasn't called iwatch_init() -- this is by design. */ static int initialized = 0; int iwatch_init(struct iwatch *iw) { socklen_t len; int sz; if (!iw) { errno = EINVAL; return -1; } TAILQ_INIT(&iw->iwp_list); iw->fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); if (iw->fd < 0) { warn("Failed creating inotify descriptor"); return -1; } /* * Double the size of the socket's receive buffer to address * issues with lost events in some cases, e.g. bootstrap and * reconf of systems with lots of services. */ len = sizeof(sz); if (!getsockopt(iw->fd, SOL_SOCKET, SO_RCVBUF, &sz, &len)) { if (setsockopt(iw->fd, SOL_SOCKET, SO_RCVBUF, &sz, sizeof(sz))) warn("Failed increasing size of inotify socket"); } initialized = 1; return iw->fd; } void iwatch_exit(struct iwatch *iw) { struct iwatch_path *iwp, *tmp; TAILQ_FOREACH_SAFE(iwp, &iw->iwp_list, link, tmp) { TAILQ_REMOVE(&iw->iwp_list, iwp, link); inotify_rm_watch(iw->fd, iwp->wd); free(iwp->path); free(iwp); } close(iw->fd); initialized = 0; } int iwatch_add1(struct iwatch *iw, char *file, uint32_t mask) { struct iwatch_path *iwp; char *path; int wd; if (!initialized) return -1; iwp = iwatch_find_by_path(iw, file); if (iwp) { dbg("skipping, %s already registered", file); return 0; } if (!fexist(file)) { dbg("skipping %s: no such file or directory", file); return 0; } dbg("adding new watcher for path %s", file); path = strdup(file); if (!path) { warn("Out of memory"); return -1; } wd = inotify_add_watch(iw->fd, path, mask); if (wd < 0) { switch (errno) { case EEXIST: break; case EINVAL: /* * some older kernels, notably 4.19, don't like * inotify on top-level cgroups in cgroup v2 */ if (!strncmp(path, "/sys/fs/cgroup", 14)) break; /* ignore error */ /* fallthrough */ default: warn("Failed adding watcher for %s", path); break; } free(path); return -1; } iwp = malloc(sizeof(struct iwatch_path)); if (!iwp) { warn("Failed allocating new `struct iwatch_path`"); inotify_rm_watch(iw->fd, wd); free(path); return -1; } iwp->path = path; iwp->wd = wd; TAILQ_INSERT_HEAD(&iw->iwp_list, iwp, link); return 0; } int iwatch_add(struct iwatch *iw, char *file, uint32_t mask) { return iwatch_add1(iw, file, IWATCH_MASK | mask); } int iwatch_del(struct iwatch *iw, struct iwatch_path *iwp) { if (!initialized) return -1; dbg("Removing watcher for removed path %s", iwp->path); TAILQ_REMOVE(&iw->iwp_list, iwp, link); inotify_rm_watch(iw->fd, iwp->wd); free(iwp->path); free(iwp); return 0; } struct iwatch_path *iwatch_find_by_wd(struct iwatch *iw, int wd) { struct iwatch_path *iwp; if (!initialized) return NULL; TAILQ_FOREACH(iwp, &iw->iwp_list, link) { if (iwp->wd == wd) return iwp; } return NULL; } struct iwatch_path *iwatch_find_by_path(struct iwatch *iw, const char *path) { struct iwatch_path *iwp; if (!initialized) return NULL; TAILQ_FOREACH(iwp, &iw->iwp_list, link) { if (!strcmp(iwp->path, path)) return iwp; } return NULL; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/watchdog.c0000644000175100001660000000611215054341541010772 /* Built-in watchdog daemon * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "watchdog.h" int running = 1; int handover = 0; int shutdown = 0; static void sighandler(int signo) { if (signo == SIGTERM) handover = 1; if (signo == SIGPWR) shutdown = 1; running = 0; } static int init(char *progname, char *devnode) { int fd; sprintf(progname, "@finit-watchdog"); signal(SIGTERM, sighandler); signal(SIGPWR, sighandler); openlog(&progname[1], LOG_CONS | LOG_PID, LOG_DAEMON); fd = open(devnode, O_WRONLY); if (fd == -1) return -1; return fd; } static int loop(int fd, int timeout) { int dummy = 0; int period = timeout / 2; ioctl(fd, WDIOC_SETTIMEOUT, &timeout); while (running) { ioctl(fd, WDIOC_KEEPALIVE, &dummy); sleep(period); } /* System is going down, prepare to reboot system on TERM */ if (shutdown) { timeout /= 3; ioctl(fd, WDIOC_SETTIMEOUT, &timeout); } /* External watchdogd wants to take over ... */ if (handover) { syslog(LOG_INFO, "Handing over %s and exiting ...", WDT_DEVNODE); ioctl(fd, WDIOC_KEEPALIVE, &dummy); if (write(fd, "V", 1) == -1) return EX_IOERR; } else syslog(LOG_ALERT, "System going down ..."); return EX_OK; } int main(int argc, char *argv[]) { int fd, rc = EX_OK; fd = init(argv[0], WDT_DEVNODE); if (fd == -1) { syslog(LOG_CRIT, "Failed connecting to %s: %s", WDT_DEVNODE, strerror(errno)); rc = EX_OSFILE; goto done; } rc = loop(fd, WDT_TIMEOUT); while (!handover) { /* Waiting for SIGTERM or WDT reset ... */ sleep(1); /* Set lowest possible timeout on SIGPWR */ ioctl(fd, WDIOC_SETTIMEOUT, &shutdown); } close(fd); done: closelog(); return rc; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/log.h0000644000175100001660000000644315054341541007767 /* Finit daemon log functions * * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_LOG_H_ #define FINIT_LOG_H_ #include /* Local facility, unused in GNU but available in FreeBSD or sysklogd >= 2.0 */ #ifndef LOG_CONSOLE #define LOG_CONSOLE (14<<3) #endif #ifndef __FINIT__ #include #include #include extern int debug; static __attribute__ ((format (printf, 1, 2))) inline void dbg(char *fmt, ...) { va_list ap; if (!debug) return; va_start(ap, fmt); vfprintf(stderr, fmt, ap); fputs("\n", stderr); va_end(ap); } #define info(fmt, args...) warnx(fmt, ##args) #define note(fmt, args...) warnx(fmt, ##args) #else /* * General log macros, similar to those used by initctl. Initially intended * only for bridging client.c in Finit and initctl. */ #define dbg(fmt, args...) logit(LOG_DEBUG, "%s():" fmt, __func__, ##args) #define info(fmt, args...) logit(LOG_INFO, "%s():" fmt, __func__, ##args) #define note(fmt, args...) logit(LOG_NOTICE, "%s():" fmt, __func__, ##args) #define warnx(fmt, args...) logit(LOG_WARNING, "%s():" fmt, __func__, ##args) #define warn(fmt, args...) logit(LOG_WARNING, "%s():" fmt ": %s", __func__, ##args, strerror(errno)) #define errx(rc, fmt, args...) logit(LOG_ERR, "%s():" fmt, __func__, ##args) #define err(rc, fmt, args...) logit(LOG_ERR, "%s():" fmt ": %s", __func__, ##args, strerror(errno)) /* * DEPRECATED developer error and debug messages, please migrate to above! * Will be removed without further warning in a future Finit release. */ #define _d(fmt, args...) logit(LOG_DEBUG, "%s():" fmt, __func__, ##args) #define _w(fmt, args...) logit(LOG_WARNING, "%s():" fmt, __func__, ##args) #define _e(fmt, args...) logit(LOG_ERR, "%s():" fmt, __func__, ##args) #define _pe(fmt, args...) logit(LOG_ERR, "%s():" fmt ": %s", __func__, ##args, strerror(errno)) void log_init (void); void log_exit (void); void log_debug(void); int log_parse(char *prio, int *facility, int *level); void logit (int prio, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); void flog (char *file, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); #endif #endif /* FINIT_LOG_H_ */ finit-4.14/src/utmp-api.h0000644000175100001660000000407515054341541010741 /* UTMP API * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_UTMP_API_H_ #define FINIT_UTMP_API_H_ #include #include #ifndef _PATH_BTMP #define _PATH_BTMP "/var/log/btmp" #endif int utmp_set (int type, int pid, char *line, char *id, char *user); int utmp_set_boot (void); int utmp_set_halt (void); int utmp_set_init (char *tty, char *id); int utmp_set_login (char *tty, char *id); int utmp_set_dead (int pid); int utmp_set_runlevel(int pre, int now); int utmp_show (char *file); void runlevel_set (int pre, int now); /* * musl libc default to /dev/null/utmp and /dev/null/wtmp, respectively. * See https://www.openwall.com/lists/musl/2012/03/04/4 for reasoning. * Also, there's no __MUSL__, so we cannot make a libc-specific #ifdef */ static inline int has_utmp(void) { return strncmp(_PATH_UTMP, "/dev/null", 9); } #endif /* FINIT_UTMP_API_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/cgroup.h0000644000175100001660000000320415054341541010475 /* Finit control group support functions * * Copyright (c) 2019-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_CGROUP_H_ #define FINIT_CGROUP_H_ #include struct cgroup { char name[16]; char cfg[128]; }; void cgroup_mark_all(void); void cgroup_cleanup (void); int cgroup_add (char *name, char *cfg, int is_protected); int cgroup_del (char *dir); void cgroup_config (void); void cgroup_init (uev_ctx_t *ctx); int cgroup_user (char *name, int pid); int cgroup_service (char *name, int pid, struct cgroup *cg); #endif /* FINIT_CGROUP_H_ */ finit-4.14/src/pid.h0000644000175100001660000000503115054341541007752 /* PID and PID file helpers * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_PID_H_ #define FINIT_PID_H_ #include "svc.h" #include "util.h" int pid_alive (pid_t pid); char *pid_get_name (pid_t pid, char *name, size_t len); char *pid_file (svc_t *svc); int pid_file_set (svc_t *svc, char *file, int not); pid_t pid_file_read (const char *fn); int pid_file_create (svc_t *svc); int pid_file_parse (svc_t *svc, char *arg); /** * pid_runpath - Adjust /var/run --> /run path depending on system * @file: Path to file in /run/path or /var/run/path * @path: Pointer to buffer to write correct path * @len: Length, in bytes, of @path buffer * * Returns: * Always returns a valid pointer, which can be either @path with a /run * or /var/run prefix to @file, or it may be @file if the prefix is OK. */ static inline char *pid_runpath(const char *file, char *path, size_t len) { static char *prefix = "/var/run"; static int unknown = 1; char *ptr; int rc; if (unknown) { if (fisdir("/run")) prefix = "/run"; unknown = 0; } ptr = strstr(file, "/run/"); if (ptr) file = ptr + 5; rc = paste(path, len, prefix, file); if (rc < 0 || (size_t)rc >= len) err(1, "File path '%s' truncated, should end with '%s'", path, file); return path; } #endif /* FINIT_PID_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/stty.c0000644000175100001660000000745415054341541010207 /* Reset terminal line settings (stty sane) * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include /* _POSIX_VDISABLE */ #include /* Not included by default in musl libc */ #include #include "helpers.h" #include "sig.h" /* B0 means; keep kernel default */ speed_t stty_parse_speed(char *baud) { char *ptr; size_t i; unsigned long val; struct { unsigned long val; speed_t speed; } v2s[] = { { 0, B0 }, { 50, B50 }, { 75, B75 }, { 110, B110 }, { 134, B134 }, { 150, B150 }, { 200, B200 }, { 300, B300 }, { 600, B600 }, { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 }, { 4800, B4800 }, { 9600, B9600 }, { 19200, B19200 }, { 38400, B38400 }, { 57600, B57600 }, { 115200, B115200 }, { 230400, B230400 }, { 460800, B460800 }, { 500000, B500000 }, { 576000, B576000 }, { 921600, B921600 }, { 1000000, B1000000 }, { 1152000, B1152000 }, { 1500000, B1500000 }, { 2000000, B2000000 }, #ifdef B4000000 { 2500000, B2500000 }, { 3000000, B3000000 }, { 3500000, B3500000 }, { 4000000, B4000000 }, #endif }; if (!baud || !baud[0]) return B0; errno = 0; val = strtoul(baud, &ptr, 10); if (errno || ptr == baud) return B0; for (i = 0; i < sizeof(v2s) / sizeof(v2s[0]); i++) { if (v2s[i].val == val) return v2s[i].speed; } return B0; } void stty(int fd, speed_t speed) { struct termios term; struct sigaction sa; /* Ignore SIGINT during login phase, /bin/login resets */ IGNSIG(sa, SIGINT, SA_RESTART); tcdrain(fd); if (tcgetattr(fd, &term)) return; if (speed != B0) { cfsetispeed(&term, speed); cfsetospeed(&term, speed); } /* Modem specific control flags */ term.c_cflag &= ~(PARENB|PARODD|CSTOPB|CRTSCTS); term.c_cflag |= CS8|HUPCL|CREAD|CLOCAL; term.c_line = 0; /* Timeouts, minimum chars and default flags */ term.c_cc[VTIME] = 0; term.c_cc[VMIN] = 1; term.c_iflag = ICRNL|IXON|IXOFF|IUTF8; term.c_oflag = OPOST|ONLCR; term.c_lflag |= ICANON|ISIG|ECHO|ECHOE|ECHOK|ECHOKE; /* Reset special characters to defaults */ term.c_cc[VINTR] = CINTR; term.c_cc[VQUIT] = CQUIT; term.c_cc[VEOF] = CEOF; term.c_cc[VEOL] = CEOL; term.c_cc[VKILL] = CKILL; term.c_cc[VERASE] = CERASE; tcsetattr(fd, TCSAFLUSH, &term); /* Show cursor again, if it was hidden previously */ dprint(fd, "\033[?25h", 6); /* Enable line wrap, if disabled previously */ dprint(fd, "\033[?7h", 5); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/schedule.c0000644000175100001660000000372615054341541010776 /* Work queue helper functions * * Copyright (c) 2018-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" #include "private.h" #include "log.h" #include "schedule.h" #define SC_INIT 0x494E4954 /* "INIT", see ascii(7) */ /* * libuEv callback wrapper */ static void cb(uev_t *w, void *arg, int events) { struct wq *work = (struct wq *)arg; if (UEV_ERROR == events) { dbg("%s(): spurious problem with schedule work timer, restarting.", __func__); uev_timer_start(w); return; } work->cb(work); } /* * Place work on event queue */ int schedule_work(struct wq *work) { int msec; if (!work) return errno = EINVAL; msec = work->delay; if (work->init != SC_INIT) { work->init = SC_INIT; return uev_timer_init(ctx, &work->watcher, cb, work, msec, 0); } return uev_timer_set(&work->watcher, msec, 0); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/mount.c0000644000175100001660000000645215054341541010343 /* Mount and unmount helpers * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #ifdef HAVE_MNTENT_H #include #endif #include #include "helpers.h" #include "log.h" /* * SysV init on Debian/Ubuntu skips these protected mount points * * It also skips anything below /proc, /sys and /run for good measure so * we do the same here. What we want is a list of non-protected tmpfs * and regular filesystems that can be safely unmounted before we do * swapoff, and remount / as read-only, respectively. */ static int is_protected(const char *dir) { size_t i; char *protected_mnts[] = { "/sys", "/proc", "/.dev", "/dev", "/dev/pts", "/dev/shm", "dev/.static/dev", "/dev/vcs", "/run", "/var/run", "/", NULL }; char *any[] = { "/proc/", "/sys/", "/run/", NULL }; for (i = 0; protected_mnts[i]; i++) { if (!strcmp(dir, protected_mnts[i])) return 1; } for (i = 0; any[i]; i++) { if (!strncmp(dir, any[i], strlen(any[i]))) return 1; } return 0; } static void iterator_end(FILE **fp) { endmntent(*fp); *fp = NULL; } static struct mntent *iterator(char *filename, FILE **fp) { static struct mntent *mnt; if (!*fp && filename) { *fp = setmntent(filename, "r"); if (!*fp) return NULL; } while ((mnt = getmntent(*fp))) { if (is_protected(mnt->mnt_dir)) continue; return mnt; } iterator_end(fp); return NULL; } static int unmount(const char *target) { int rc; dbg("Unmounting %s", target); rc = umount(target); if (rc) { if (errno != EBUSY) print(2, "Failed unmounting %s, error %d: %s", target, errno, strerror(errno)); return rc; } return 0; } void unmount_tmpfs(void) { const struct mntent *mnt; FILE *fp = NULL; while ((mnt = iterator("/proc/mounts", &fp))) { if (!strcmp("tmpfs", mnt->mnt_fsname) && !unmount(mnt->mnt_dir)) iterator_end(&fp); /* Restart iteration */ } } void unmount_regular(void) { const struct mntent *mnt; FILE *fp = NULL; while ((mnt = iterator("/proc/mounts", &fp))) { if (!unmount(mnt->mnt_dir)) iterator_end(&fp); /* Restart iteration */ } } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/sm.c0000644000175100001660000003152415054341541007616 /* Finit state machine * * Copyright (c) 2016 Jonas Johansson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include "finit.h" #include "cond.h" #include "conf.h" #include "log.h" #include "helpers.h" #include "private.h" #include "schedule.h" #include "service.h" #include "sig.h" #include "tty.h" #include "sm.h" #include "utmp-api.h" typedef enum { SM_BOOTSTRAP_STATE = 0, /* Init state, bootstrap services */ SM_BOOTSTRAP_WAIT_STATE, /* Waiting for bootstrap to complete */ SM_RUNNING_STATE, /* Normal state, services running */ SM_RUNLEVEL_CHANGE_STATE, /* A runlevel change has occurred */ SM_RUNLEVEL_WAIT_STATE, /* Waiting for all stopped processes to halt */ SM_RUNLEVEL_CLEAN_STATE, /* Wait for post:scripts and cleanup:scripts */ SM_RELOAD_CHANGE_STATE, /* A reload event has occurred */ SM_RELOAD_WAIT_STATE, /* Waiting for all stopped processes to halt */ SM_RELOAD_CLEAN_STATE, /* Wait for post:scripts and cleanup:scripts */ } sm_state_t; static struct { sm_state_t state; /* Running, Changed, Waiting, ... */ int newlevel; /* Set to new runlevel on change, -1 otherwise */ int reload; /* Set on reload event, else 0 */ int in_reload; /* Set when waiting for all processes to be halted */ } sm; /* * Wait for system bootstrap to complete, all SVC_TYPE_RUNTASK must be * allowed to complete their work in [S], or timeout, before we switch * to the configured runlevel and call finalize(), should not take more * than 120 sec. */ static void sm_check_bootstrap(void *work) { static int timeout = 120; int bootstrap_done; int level = cfglevel; svc_t *svc = NULL; dbg("Step all services ..."); service_step_all(SVC_TYPE_ANY); bootstrap_done = service_completed(&svc); if (timeout-- > 0 && !bootstrap_done) { dbg("Not all bootstrap run/tasks have completed yet ... %d", timeout); schedule_work(work); return; } if (timeout > 0) { dbg("All run/task have completed, resuming bootstrap."); } else { dbg("Timeout, resuming bootstrap."); if (svc) print(2, "Timeout waiting for %s to run, resuming bootstrap", svc_ident(svc, NULL, 0)); else print(2, "Timeout waiting for unknown run/task, resuming bootstrap"); } dbg("Flushing pending .conf file events ..."); conf_flush_events(); /* * Start all tasks/services in the configured runlevel, or jump * into the runlevel selected from the command line. */ if (cmdlevel) { dbg("Runlevel %d requested from command line, starting all services ...", cmdlevel); level = cmdlevel; } else dbg("Change to default runlevel(%d), starting all services ...", cfglevel); sm_runlevel(level); /* Clean up bootstrap-only tasks/services that never started */ dbg("Clean up all bootstrap-only tasks/services ..."); svc_prune_bootstrap(); /* All services/tasks/etc. in configure runlevel have started */ dbg("Running svc up hooks ..."); plugin_run_hooks(HOOK_SVC_UP); } static char *sm_status(sm_state_t state) { switch (state) { case SM_BOOTSTRAP_STATE: return "bootstrap"; case SM_BOOTSTRAP_WAIT_STATE: return "bootstrap/wait"; case SM_RUNNING_STATE: return "running"; case SM_RUNLEVEL_CHANGE_STATE: return "runlevel/change"; case SM_RUNLEVEL_WAIT_STATE: return "runlevel/wait"; case SM_RUNLEVEL_CLEAN_STATE: return "runlevel/clean"; case SM_RELOAD_CHANGE_STATE: return "reload/change"; case SM_RELOAD_WAIT_STATE: return "reload/wait"; case SM_RELOAD_CLEAN_STATE: return "reload/clean"; } return "unknown"; } static char sm_rl2ch(int lvl) { if (lvl == INIT_LEVEL) return 'S'; return lvl + '0'; } /* * Disable login in single user mode and shutdown/reboot * * Re-enable only when going from these runlevels, this way a user can * manage FINIT_NOLOGIN_PATH manually within the other runlevels without * us pulling the rug from under their feet. */ static void nologin(void) { if (runlevel == 1 || IS_RESERVED_RUNLEVEL(runlevel)) touch(FINIT_NOLOGIN_PATH); if (prevlevel == 1 || IS_RESERVED_RUNLEVEL(prevlevel)) erase(FINIT_NOLOGIN_PATH); } void sm_init(void) { static struct wq work = { .cb = sm_check_bootstrap, .delay = 1000 }; sm.state = SM_BOOTSTRAP_STATE; sm.newlevel = -1; sm.reload = 0; sm.in_reload = 0; dbg("Starting bootstrap finalize timer ..."); schedule_work(&work); } void sm_step(void) { sm_state_t old_state; svc_t *svc; restart: old_state = sm.state; dbg("state: %s, runlevel: %c, newlevel: %d, teardown: %d, reload: %d", sm_status(sm.state), sm_rl2ch(runlevel), sm.newlevel, sm.in_reload, sm.reload); switch (sm.state) { case SM_BOOTSTRAP_STATE: dbg("Bootstrapping all services in runlevel S from %s", finit_conf); service_step_all(SVC_TYPE_RUNTASK | SVC_TYPE_SERVICE | SVC_TYPE_SYSV); sm.state = SM_BOOTSTRAP_WAIT_STATE; break; /* * Handle bootstrap transition to configured runlevel, start TTYs * * This is the final stage of bootstrap. It changes to the default * (configured) runlevel, calls all external start scripts and final * bootstrap hooks before bringing up TTYs. * * We must ensure that all declared `task [S]` and `run [S]` jobs in * finit.conf, or *.conf in finit.d/, run to completion before we * finalize the bootstrap process by calling this function. */ case SM_BOOTSTRAP_WAIT_STATE: /* We come here from bootstrap, runlevel change and conf reload */ service_step_all(SVC_TYPE_ANY); /* Allow runparts to start */ cond_set_oneshot("int/bootstrap"); if (sm.newlevel == -1) break; /* Hooks that should run at the very end */ dbg("Calling all system up hooks ..."); plugin_run_hooks(HOOK_SYSTEM_UP); service_step_all(SVC_TYPE_ANY); /* Disable progress output at normal runtime */ enable_progress(0); /* System bootstrapped, launch TTYs et al */ bootstrap = 0; service_step_all(SVC_TYPE_RESPAWN); sm.state = SM_RUNNING_STATE; break; case SM_RUNNING_STATE: /* We come here from bootstrap, runlevel change and conf reload */ service_step_all(SVC_TYPE_ANY); /* runlevel changed? */ if (sm.newlevel >= 0 && sm.newlevel <= 9) { if (runlevel == sm.newlevel) { sm.newlevel = -1; break; } sm.state = SM_RUNLEVEL_CHANGE_STATE; break; } /* reload ? */ if (sm.reload) { sm.reload = 0; sm.state = SM_RELOAD_CHANGE_STATE; } break; case SM_RUNLEVEL_CHANGE_STATE: prevlevel = runlevel; runlevel = sm.newlevel; sm.newlevel = -1; /* Restore terse mode and run hooks before shutdown */ if (runlevel == 0 || runlevel == 6) { api_exit(); log_exit(); plugin_run_hooks(HOOK_SHUTDOWN); } dbg("Setting new runlevel --> %c <-- previous %c", sm_rl2ch(runlevel), sm_rl2ch(prevlevel)); if (osheading) logit(LOG_CONSOLE | LOG_NOTICE, "%s, entering runlevel %c", osheading, sm_rl2ch(runlevel)); else logit(LOG_CONSOLE | LOG_NOTICE, "Entering runlevel %c", sm_rl2ch(runlevel)); runlevel_set(prevlevel, runlevel); /* Disable login in single-user mode as well as shutdown/reboot */ nologin(); if (runlevel != 0 && runlevel != 6) { /* Make sure to (re)load all *.conf in /etc/finit.d/ */ if (conf_any_change()) conf_reload(); } /* Reset once flag of runtasks */ service_runtask_clean(); dbg("Stopping services not allowed in new runlevel ..."); sm.in_reload = 1; service_step_all(SVC_TYPE_ANY); sm.state = SM_RUNLEVEL_WAIT_STATE; break; case SM_RUNLEVEL_WAIT_STATE: /* * Need to wait for any services to stop? If so, exit early * and perform second stage from service_monitor later. */ svc = svc_stop_completed(); if (svc) { dbg("Waiting to collect %s, cmd %s(%d) ...", svc_ident(svc, NULL, 0), svc->cmd, svc->pid); break; } /* Prev runlevel services stopped, call hooks before starting new runlevel ... */ dbg("All services have been stopped, calling runlevel change hooks ..."); plugin_run_hooks(HOOK_RUNLEVEL_CHANGE); /* Reconfigure HW/VLANs/etc here */ dbg("Starting services new to this runlevel ..."); sm.in_reload = 0; service_step_all(SVC_TYPE_ANY); sm.state = SM_RUNLEVEL_CLEAN_STATE; break; case SM_RUNLEVEL_CLEAN_STATE: /* * Wait for post:script or cleanup:script to be collected, * which moves the svc to HALTED or DEAD state. We will * be called by the service_monitor() on collect. */ svc = svc_clean_completed(); if (svc) { dbg("Waiting to collect post/cleanup script for %s, cmd %s(%d) ...", svc_ident(svc, NULL, 0), svc->cmd, svc->pid); break; } /* Cleanup stale services */ svc_clean_dynamic(service_unregister); #ifdef FINIT_RC_LOCAL /* Compat SysV init */ if (prevlevel == INIT_LEVEL && !rescue) run_bg(FINIT_RC_LOCAL, NULL); #endif /* * "I've seen things you people wouldn't believe. Attack ships on fire off * the shoulder of Orion. I watched C-beams glitter in the dark near the * Tannhäuser Gate. All those .. moments .. will be lost in time, like * tears ... in ... rain." */ if (runlevel == 0 || runlevel == 6) do_shutdown(halt); sm.state = SM_RUNNING_STATE; break; case SM_RELOAD_CHANGE_STATE: sm.in_reload = 1; /* First reload all *.conf in /etc/finit.d/ */ conf_reload(); /* * Then, mark all affected service conditions as in-flux and * let all affected services move to WAITING/HALTED */ dbg("Stopping services not allowed after reconf ..."); service_step_all(SVC_TYPE_ANY); /* Step the generation ... */ cond_reload(); sm.state = SM_RELOAD_WAIT_STATE; break; case SM_RELOAD_WAIT_STATE: /* * Need to wait for any services to stop? If so, exit early * and perform second stage from service_monitor later. */ svc = svc_stop_completed(); if (svc) { dbg("Waiting to collect %s, cmd %s(%d) ...", svc_ident(svc, NULL, 0), svc->cmd, svc->pid); break; } sm.in_reload = 0; dbg("Starting services after reconf ..."); service_step_all(SVC_TYPE_ANY); sm.state = SM_RELOAD_CLEAN_STATE; break; case SM_RELOAD_CLEAN_STATE: /* * Wait for post:script or cleanup:script to be collected, * which moves the svc to HALTED or DEAD state. We will * be called by the service_monitor() on collect. */ svc = svc_clean_completed(); if (svc) { dbg("Waiting to collect post/cleanup script for %s, cmd %s(%d) ...", svc_ident(svc, NULL, 0), svc->cmd, svc->pid); break; } /* Cleanup stale services */ svc_clean_dynamic(service_unregister); dbg("Calling reconf hooks ..."); plugin_run_hooks(HOOK_SVC_RECONF); dbg("Update configuration generation of unmodified non-native services ..."); service_notify_reconf(); dbg("Reconfiguration done"); sm.state = SM_RUNNING_STATE; break; } if (sm.state != old_state) goto restart; } /** * sm_in_reload - System currently in reload or runlevel change? * * Returns: * %TRUE(1) or %FALSE(0) */ int sm_in_reload(void) { return sm.in_reload; } /** * sm_reload - Called on SIGHUP, 'init q' or 'initctl reload' * * This function is called when Finit has received SIGHUP to reload * .conf files in /etc/finit.d. It is responsible for starting, * stopping and reloading (forwarding SIGHUP) to processes affected. */ void sm_reload(void) { sm.reload = 1; dbg("Flushing pending .conf file events ..."); conf_flush_events(); sm_step(); } /** * sm_runlevel - Change to a new runlevel * @newlevel: New runlevel to activate * * Stops all services not in @newlevel and starts, or lets continue to run, * those in @newlevel. Also updates @prevlevel and active @runlevel. */ void sm_runlevel(int newlevel) { if (!rescue && (runlevel == 1 || runlevel == INIT_LEVEL) && !IS_RESERVED_RUNLEVEL(newlevel)) networking(1); sm.newlevel = newlevel; dbg("Flushing pending .conf file events ..."); conf_flush_events(); sm_step(); if (!rescue && IS_RESERVED_RUNLEVEL(runlevel)) networking(0); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/coldplug0000755000175100001660000000057215054341541010571 #!/bin/sh # With the daemon mode ('mdev -df') we no longer need the hotplug helper echo "" > /proc/sys/kernel/hotplug # Wait for 'mdev -df' to set up its event queue. sleep 1 # Trigger 'add' event for all devices and subsystems to load all modules # and any firmware needed by the hardware. find /sys/devices -name uevent -print | while IFS='' read X; do echo add > $X; done finit-4.14/src/logrotate.c0000644000175100001660000000624015054341541011174 /* * Copyright (c) 2018-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif static int recreate(char *path, mode_t mode, uid_t uid, gid_t gid) { if (mknod(path, S_IFREG | mode, 0) || chown(path, uid, gid)) { syslog(LOG_ERR, "Failed recreating %s: %s", path, strerror(errno)); return -1; } return 0; } /* * This function triggers a log rotates of @file when size >= @sz bytes * At most @num old versions are kept and by default it starts gzipping * .2 and older log files. If gzip is not available in $PATH then @num * files are kept uncompressed. */ int logrotate(char *file, int num, off_t sz) { struct stat st; if (stat(file, &st)) return 1; if (sz > 0 && S_ISREG(st.st_mode) && st.st_size > sz) { if (num > 0) { size_t len = strlen(file) + 10 + 1; char ofile[len]; char nfile[len]; int cnt; /* First age zipped log files */ for (cnt = num; cnt > 2; cnt--) { snprintf(ofile, len, "%s.%d.gz", file, cnt - 1); snprintf(nfile, len, "%s.%d.gz", file, cnt); /* May fail because ofile doesn't exist yet, ignore. */ if (rename(ofile, nfile) && errno != ENOENT) syslog(LOG_ERR, "Failed logrotate %s: %s", ofile, strerror(errno)); } for (cnt = num; cnt > 0; cnt--) { snprintf(ofile, len, "%s.%d", file, cnt - 1); snprintf(nfile, len, "%s.%d", file, cnt); /* May fail because ofile doesn't exist yet, ignore. */ if (rename(ofile, nfile) && errno != ENOENT) { syslog(LOG_ERR, "Failed logrotate %s: %s", ofile, strerror(errno)); continue; } if (cnt == 2 && fexist(nfile)) { if (systemf("gzip %s 2>/dev/null", nfile)) continue; /* no gzip, probably */ (void)remove(nfile); } } if (rename(file, nfile)) goto fallback; recreate(file, st.st_mode, st.st_uid, st.st_gid); } else { fallback: if (truncate(file, 0)) syslog(LOG_ERR, "Failed truncating %s: %s", file, strerror(errno)); } } return 0; } finit-4.14/src/sulogin.c0000644000175100001660000001141415054341541010653 /* poor man's sulogin, may be statically linked * * Copyright (c) 2021-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #ifndef SULOGIN_USER #define SULOGIN_USER "root" #endif /* getpwnam() cannot be used when statically linked */ static int get_passwd(struct passwd *pw) { char *ptr, *tmp; char buf[256]; FILE *fp; fp = fopen("/etc/passwd", "r"); if (!fp) return 1; while ((tmp = fgets(buf, sizeof(buf), fp))) { ptr = strsep(&tmp, ":"); if (!ptr) break; pw->pw_name = strdup(ptr); if (!pw->pw_name || strcmp(pw->pw_name, SULOGIN_USER)) continue; ptr = strsep(&tmp, ":"); if (!ptr) break; /* x : password in /etc/shadow, see passwd(5) */ if (ptr[0] != 'x') pw->pw_passwd = strdup(ptr); break; /* done, check it */ } fclose(fp); if (!pw->pw_name) return 1; /* no uid 0 here */ if (pw->pw_passwd) return 0; /* passwd in passwd */ fp = fopen("/etc/shadow", "r"); if (!fp) { if (pw->pw_name) free(pw->pw_name); return 1; } while ((tmp = fgets(buf, sizeof(buf), fp))) { ptr = strsep(&tmp, ":"); if (!ptr) break; if (!strcmp(tmp, pw->pw_name)) continue; ptr = strsep(&tmp, ":"); if (!ptr) break; pw->pw_passwd = strdup(ptr); break; } fclose(fp); if (!pw->pw_passwd) { if (pw->pw_name) free(pw->pw_name); return 1; /* nopass => nologin */ } return 0; /* passwd in shadow */ } static void freepw(struct passwd *pw) { if (pw->pw_passwd) { free(pw->pw_passwd); pw->pw_passwd = NULL; } free(pw->pw_name); } static int sh(void) { /* * Become session leader and set controlling TTY * to enable Ctrl-C and job control in shell. */ setsid(); ioctl(STDIN_FILENO, TIOCSCTTY, 1); setenv("PS1", "# ", 1); return execl(_PATH_BSHELL, "-sh", NULL); } int main(void) { struct termios old, raw; struct passwd pw = { 0 }; int rc = 1, ch; if (get_passwd(&pw)) err(1, "reading credentials for UID 0"); switch (pw.pw_passwd[0]) { case '*': case '!': /* login disabled, allow */ printf("The %s account is locked, allowing entry.\n", pw.pw_name); /* fallthrough */ case 0: /* no password at all? */ printf("Press enter for maintenance (Ctrl-D to continue) "); fflush(stdout); ch = getchar(); if (ch == 4 || ch == EOF) { /* Ctrl-D */ rc = 0; goto done; } goto nopass; case '$': /* md5/shaN or similar, original DES not supported */ break; default: break; } if (tcgetattr(1, &old) < 0) goto done; /* failed reading tty */ raw = old; raw.c_lflag &= ~ICANON; raw.c_lflag &= ~ECHO; raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0; if (tcsetattr(1, TCSANOW, &raw) < 0) { tcsetattr(1, TCSANOW, &old); goto done; /* failed setting raw/pw mode */ } while (1) { char pwd[256]; /* reasonable max? */ size_t i = 0; char *passwd; printf("Give %s password for maintenance (Ctrl-D to continue): ", pw.pw_name); fflush(stdout); do { ch = getchar(); if (ch == '\n' || ch == '\r') break; if (ch == 4 || ch == EOF) { /* Ctrl-D */ rc = 0; goto exit; } pwd[i++] = ch; } while (i + 1 < sizeof(pwd)); pwd[i] = 0; puts(""); passwd = crypt(pwd, pw.pw_passwd); if (passwd && !strcmp(passwd, pw.pw_passwd)) { tcsetattr(1, TCSANOW, &old); /* restore tty */ nopass: freepw(&pw); /* tell initctl/reboot to trigger force mode */ setenv("SULOGIN", "finit", 1); return sh(); } } exit: tcsetattr(1, TCSANOW, &old); /* restore tty */ puts(""); done: freepw(&pw); return rc; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/svc.h0000644000175100001660000004042315054341541007775 /* Low-level service primitives and generic API for managing svc_t structures * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_SVC_H_ #define FINIT_SVC_H_ #include /* IPC_CREAT */ #include #include /* pid_t */ #ifdef _LIBITE_LITE # include # include /* BSD sys/queue.h API */ #else # include # include /* BSD sys/queue.h API */ #endif #include #include "cgroup.h" #include "helpers.h" typedef int svc_cmd_t; typedef enum { SVC_TYPE_FREE = 0, /* Free to allocate */ SVC_TYPE_SERVICE = 1, /* Monitored, will be respawned */ SVC_TYPE_TASK = 2, /* One-shot, runs in parallel */ SVC_TYPE_RUN = 4, /* Like task, but wait for completion */ SVC_TYPE_TTY = 8, /* Like service, but dedicated to TTYs */ SVC_TYPE_SYSV = 32, /* SysV style init.d script w/ start/stop */ } svc_type_t; #define SVC_TYPE_ANY (-1) #define SVC_TYPE_DAEMON (SVC_TYPE_SERVICE | SVC_TYPE_SYSV) #define SVC_TYPE_RESPAWN (SVC_TYPE_SERVICE | SVC_TYPE_SYSV | SVC_TYPE_TTY) #define SVC_TYPE_RUNTASK (SVC_TYPE_RUN | SVC_TYPE_TASK) typedef enum { SVC_HALTED_STATE = 0, /* Not allowed in runlevel, or not enabled. */ SVC_DONE_STATE, /* Task/Run job has been run */ SVC_DEAD_STATE, /* Process is dead and scheduled for removal */ SVC_CLEANUP_STATE, /* Running cleanup: script */ SVC_TEARDOWN_STATE, /* Running post: script */ SVC_STOPPING_STATE, /* Waiting to collect the child process */ SVC_SETUP_STATE, /* Running pre: script */ SVC_PAUSED_STATE, /* Condition is in flux, process SIGSTOPed */ SVC_WAITING_STATE, /* Enabled but condition not satisfied */ SVC_STARTING_STATE, /* Conditions OK and pre: script done, start */ SVC_RUNNING_STATE, /* Process running */ } svc_state_t; typedef enum { SVC_BLOCK_NONE = 0, SVC_BLOCK_MISSING, SVC_BLOCK_CRASHING, SVC_BLOCK_USER, SVC_BLOCK_BUSY, SVC_BLOCK_RESTARTING, SVC_BLOCK_CONFLICT, } svc_block_t; typedef enum { SVC_ONCRASH_IGNORE = 0, SVC_ONCRASH_REBOOT, SVC_ONCRASH_SCRIPT, } svc_oncrash_action_t; /* 0: none, 1: finit (native), 2: systemd, 3: s6 */ typedef enum { SVC_NOTIFY_NONE = 0, SVC_NOTIFY_PID, SVC_NOTIFY_SYSTEMD, SVC_NOTIFY_S6, } svc_notify_t; #define MAX_ID_LEN 16 #define MAX_ARG_LEN 64 #define MAX_CMD_LEN 256 #define MAX_IDENT_LEN (MAX_ARG_LEN + MAX_ID_LEN + 1) #define MAX_STR_LEN 64 #define MAX_COND_LEN (MAX_ARG_LEN * 3) #define MAX_USER_LEN 16 #define MAX_NUM_FDS 64 /* Max number of I/O plugins */ #define MAX_NUM_SVC_ARGS 64 /* Default kill delay (msec) after SIGTERM (svc->sighalt) that we SIGKILL processes */ #define SVC_TERM_TIMEOUT 3000 /* Prevent endless respawn of faulty services. */ #define SVC_RESPAWN_MAX 10 /* * Default enable for all services, can be stopped by means * of issuing an initctl call. E.g. * * initctl service */ typedef struct svc { TAILQ_ENTRY(svc) link; /* Origin of service */ char file[MAX_ARG_LEN]; /* Limits and scoping */ struct rlimit rlimit[RLIMIT_NLIMITS]; struct cgroup cgroup; /* Service details */ int sighalt; /* Signal to stop process, default: SIGTERM */ int killdelay; /* Delay in msec before sending SIGKILL */ pid_t oldpid, pid; char pidfile[MAX_CMD_LEN]; long start_time; /* Start time, as seconds since boot, from sysinfo() */ int started; /* Set for run/task/sysv to track if started */ int status; /* From waitpid() when process is collected */ const svc_state_t state; /* Paused, Reloading, Restart, Running, ... */ svc_type_t type; /* Service, run, task, ... */ char protect; /* Services like dbus-daemon & udev by Finit */ char manual; /* run/task that require `initctl start foo` */ char nowarn; /* Skip or log warning if cmd missing or conflicts */ const int dirty; /* 0: unmodified, 1: modified */ const int removed; int starting; /* ... waiting for pidfile to be re-asserted */ int runlevels; int sighup; /* This service supports SIGHUP :) */ int forking; /* This is a service/sysv daemon that forks, wait for it ... */ svc_block_t block; /* Reason that this service is currently stopped */ char cond[MAX_COND_LEN]; /* Instance specifics */ int job; /* For internal use only, canonical ref is NAME:ID */ char name[MAX_ARG_LEN]; char id[MAX_ID_LEN]; /* :ID */ char ifstmt[MAX_IDENT_LEN]; /* Counters */ char once; /* run/task, (at least) once per runlevel */ unsigned int restart_tot; /* Total restarts ever, summarized, including `initctl restart` */ int restart_max; /* Maximum number of restarts allowed */ int restart_saved; /* INTERNAL, saved copy of .conf value */ int restart_tmo; /* Time before restarting a crashing service */ unsigned char oncrash_action; /* Action to perform in crashed state. */ char respawn; /* ttys, or services with `respawn`, never increment restart_cnt */ const char restart_cnt; /* Incremented for each restart by service monitor. */ union { /* services we redirect stdout/stderr to syslog (not TTYs!) */ struct { char enabled; char null; char console; char file[64]; char prio[20]; char ident[20]; } log; /* Only for TTY type services */ struct { char dev[32]; char baud[10]; char term[10]; char noclear; char nowait; char nologin; char notty; char rescue; }; }; /* Identity */ char username[MAX_USER_LEN]; char group[MAX_USER_LEN]; /* Command, arguments and service description */ char cmd[MAX_CMD_LEN]; char args[MAX_NUM_SVC_ARGS][MAX_CMD_LEN]; int args_dirty; char conflict[MAX_ARG_LEN]; char desc[MAX_STR_LEN]; char env[MAX_CMD_LEN]; char pre_script[MAX_CMD_LEN]; int pre_tmo; char post_script[MAX_CMD_LEN]; int post_tmo; char ready_script[MAX_CMD_LEN]; int ready_tmo; char cleanup_script[MAX_CMD_LEN]; int cleanup_tmo; /* When set, used instead of SIGHUP or stop-start */ char reload_script[MAX_CMD_LEN]; /* When set, used instead of SIGTERM or sysv 'stop' */ char stop_script[MAX_CMD_LEN]; /* * Used to forcefully kill services that won't shutdown on * termination and to delay restarts of crashing services. */ uev_t timer; void (*timer_cb)(struct svc *svc); /* * Readiness notification socket: systemd, s6 */ svc_notify_t notify; uev_t notify_watcher; /* i/o watcher */ /* time at svc_del(), used by gc timer */ struct timespec gc; } svc_t; svc_t *svc_new (char *cmd, char *name, char *id, int type); int svc_del (svc_t *svc); void svc_validate (svc_t *svc); svc_t *svc_find (char *name, char *id); svc_t *svc_find_by_str (const char *str); svc_t *svc_find_by_pid (pid_t pid); svc_t *svc_find_by_cond (const char *cond); svc_t *svc_find_by_jobid (int job, char *id); svc_t *svc_find_by_tty (char *dev); svc_t *svc_find_by_pidfile (char *fn); svc_t *svc_iterator (svc_t **iter, int first); svc_t *svc_named_iterator (svc_t **iter, int first, char *cmd); svc_t *svc_job_iterator (svc_t **iter, int first, int job); void svc_foreach (int (*cb)(svc_t *)); void svc_foreach_type (int types, int (*cb)(svc_t *)); svc_t *svc_stop_completed (void); svc_t *svc_clean_completed (void); void svc_mark (svc_t *svc); void svc_mark_dynamic (void); void svc_mark_dirty (svc_t *svc); void svc_mark_clean (svc_t *svc); void svc_clean_dynamic (void (*cb)(svc_t *)); int svc_clean_bootstrap (svc_t *svc); void svc_prune_bootstrap (void); void svc_enable (svc_t *svc); int svc_enabled (svc_t *svc); int svc_conflicts (svc_t *svc); int svc_ifthen (int is_conf, const char *ident, char *stmt, int quiet); int svc_parse_jobstr (char *str, size_t len, void *user_data, int (*found)(svc_t *, void *), int (not_found)(char *, char *, void *)); static inline int svc_is_daemon (svc_t *svc) { return svc && (SVC_TYPE_DAEMON & svc->type); } static inline int svc_is_sysv (svc_t *svc) { return svc && SVC_TYPE_SYSV == svc->type; } static inline int svc_is_tty (svc_t *svc) { return svc && SVC_TYPE_TTY == svc->type; } static inline int svc_is_runtask (svc_t *svc) { return svc && (SVC_TYPE_RUNTASK & svc->type);} static inline int svc_is_forking (svc_t *svc) { return svc && svc->forking; } static inline int svc_is_manual (svc_t *svc) { return svc && svc->manual; } static inline int svc_is_noreload (svc_t *svc) { return svc && (0 == svc->sighup && 0 == svc->reload_script[0]); } static inline int svc_in_runlevel (svc_t *svc, int runlevel) { return svc && ISSET(svc->runlevels, runlevel); } static inline int svc_has_pidfile (svc_t *svc) { return svc_is_daemon(svc) && svc->pidfile[0] != 0 && svc->pidfile[0] != '!'; } static inline int svc_has_pre (svc_t *svc) { return svc->pre_script[0]; } static inline int svc_has_post (svc_t *svc) { return svc->post_script[0]; } static inline int svc_has_ready (svc_t *svc) { return svc->ready_script[0];} static inline int svc_has_cleanup (svc_t *svc) { return svc->cleanup_script[0]; } static inline void svc_starting (svc_t *svc) { if (svc) svc->starting = 1; } static inline void svc_started (svc_t *svc) { if (svc) svc->starting = 0; } static inline int svc_is_starting (svc_t *svc) { return svc && 0 != svc->starting; } static inline int svc_is_running (svc_t *svc) { return svc && svc->state == SVC_RUNNING_STATE; } static inline int svc_is_stopping (svc_t *svc) { return svc && svc->state == SVC_STOPPING_STATE; } static inline int svc_is_stopped (svc_t *svc) { return svc && svc->block == SVC_BLOCK_USER; } static inline int svc_is_removed (svc_t *svc) { return svc && svc->removed; } static inline int svc_is_changed (svc_t *svc) { return svc && 0 != svc->dirty; } static inline int svc_is_updated (svc_t *svc) { return svc && 1 == svc->dirty; } static inline int svc_is_blocked (svc_t *svc) { return svc && svc->block != SVC_BLOCK_NONE; } static inline int svc_is_busy (svc_t *svc) { return svc && svc->block == SVC_BLOCK_BUSY; } static inline int svc_is_missing (svc_t *svc) { return svc && svc->block == SVC_BLOCK_MISSING; } static inline int svc_is_crashing (svc_t *svc) { return svc && svc->block == SVC_BLOCK_CRASHING; } static inline int svc_is_restart (svc_t *svc) { return svc && svc->block == SVC_BLOCK_RESTARTING; } static inline int svc_is_conflict (svc_t *svc) { return svc && svc->block == SVC_BLOCK_CONFLICT; } static inline void svc_unblock (svc_t *svc) { if (svc) svc->block = SVC_BLOCK_NONE; } #define svc_start(svc) svc_unblock(svc) static inline void svc_stop (svc_t *svc) { if (svc) svc->block = SVC_BLOCK_USER; } static inline void svc_busy (svc_t *svc) { if (svc) svc->block = SVC_BLOCK_BUSY; } static inline void svc_missing (svc_t *svc) { if (svc) svc->block = SVC_BLOCK_MISSING; } static inline void svc_restarting (svc_t *svc) { if (svc) svc->block = SVC_BLOCK_RESTARTING; } static inline void svc_crashing (svc_t *svc) { if (svc) svc->block = SVC_BLOCK_CRASHING; } static inline void svc_conflict (svc_t *svc) { if (svc) svc->block = SVC_BLOCK_CONFLICT; } /* Has condition in configuration and cond is allowed? */ static inline int svc_has_cond(svc_t *svc) { if (!svc->cond[0]) return 0; switch (svc->type) { case SVC_TYPE_SERVICE: case SVC_TYPE_TASK: case SVC_TYPE_RUN: case SVC_TYPE_TTY: case SVC_TYPE_SYSV: return 1; default: break; } return 0; } static inline const char *svc_typestr(svc_t *svc) { switch (svc->type) { case SVC_TYPE_FREE: return "free"; case SVC_TYPE_SERVICE: return "service"; case SVC_TYPE_TASK: return "task"; case SVC_TYPE_RUN: return "run"; case SVC_TYPE_TTY: return "tty"; case SVC_TYPE_SYSV: return "sysv"; } return "unknown"; } static inline char *svc_status(svc_t *svc) { if (!svc) return "Unknown"; switch (svc->state) { case SVC_HALTED_STATE: switch (svc->block) { case SVC_BLOCK_NONE: return "halted"; case SVC_BLOCK_MISSING: return "missing"; case SVC_BLOCK_CRASHING: return "crashed"; case SVC_BLOCK_USER: return "stopped"; case SVC_BLOCK_BUSY: return "busy"; case SVC_BLOCK_RESTARTING: return "restart"; case SVC_BLOCK_CONFLICT: return "conflict"; } return "unknown"; case SVC_DONE_STATE: if (svc->started) return "done"; else return "failed"; case SVC_STOPPING_STATE: switch (svc->type) { case SVC_TYPE_RUN: case SVC_TYPE_TASK: return "active"; default: return "stopping"; } case SVC_TEARDOWN_STATE: return "teardown"; case SVC_SETUP_STATE: return "setup"; case SVC_CLEANUP_STATE: return "cleanup"; case SVC_PAUSED_STATE: return "paused"; case SVC_WAITING_STATE: return "waiting"; case SVC_STARTING_STATE: return "starting"; case SVC_RUNNING_STATE: return "running"; case SVC_DEAD_STATE: return "dead"; default: return "UNKNOWN"; } } static inline const char *svc_dirtystr(svc_t *svc) { if (!svc) return "Unknown"; if (svc_is_removed(svc)) return "removed"; if (svc_is_updated(svc)) return "updated"; if (svc_is_changed(svc)) return "UNKNOWN"; return "clean"; } /* * Returns svc unique identifier tuple 'name:id', or just 'name', * if that's enough to identify the service. */ static inline char *svc_ident(svc_t *svc, char *buf, size_t len) { static char ident[MAX_IDENT_LEN]; if (!buf) { buf = ident; len = sizeof(ident); } if (!svc) return "nil"; strlcpy(buf, svc->name, len); if (strlen(svc->id)) { strlcat(buf, ":", len); strlcat(buf, svc->id, len); } return buf; } /* * Returns svc unique identifier tuple 'job:id', or just 'job', * if that's enough to identify the service. */ static inline char *svc_jobid(svc_t *svc, char *buf, size_t len) { static char ident[MAX_IDENT_LEN]; if (!buf) { buf = ident; len = sizeof(ident); } if (!svc) return "nul"; if (strlen(svc->id)) snprintf(buf, len, "%d:%s", svc->job, svc->id); else snprintf(buf, len, "%d", svc->job); return buf; } /* * non-zero env, no checking if file exists or not */ static inline char *svc_getenv(svc_t *svc) { int v = 0; if (!svc->env[0]) return NULL; if (svc->env[0] == '-') v = 1; return &svc->env[v]; } /* * Check if svc has env, if env file exists returns true * if it doesn't exist, but has '-', also true. if svc * doesn't have env, also true. */ static inline int svc_checkenv(svc_t *svc) { char *env = svc_getenv(svc); if (!env || svc->env[0] == '-') return 1; return fexist(env); } #endif /* FINIT_SVC_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/serv.h0000644000175100001660000000307615054341541010164 /* List and enable/disable service configurations * * Copyright (c) 2017-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_SERV_H_ #define FINIT_SERV_H_ int serv_list (char *arg); int serv_enable (char *arg); int serv_disable (char *arg); int serv_touch (char *arg); int serv_show (char *arg); int serv_edit (char *arg); int serv_creat (char *arg); int serv_delete (char *arg); #endif /* FINIT_SERV_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/Makefile.in0000644000175100001660000037575515054341567011131 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @STATIC_TRUE@am__append_1 = -DENABLE_STATIC sbin_PROGRAMS = finit$(EXEEXT) initctl$(EXEEXT) pkglibexec_PROGRAMS = getty$(EXEEXT) logit$(EXEEXT) runparts$(EXEEXT) \ tmpfiles$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \ $(am__EXEEXT_3) @SULOGIN_TRUE@am__append_2 = sulogin @KEVENTD_TRUE@am__append_3 = keventd @WATCHDOGD_TRUE@am__append_4 = watchdogd @LOGROTATE_TRUE@am__append_5 = logrotate.c @STATIC_TRUE@am__append_6 = ../plugins/libplug.la @STATIC_FALSE@am__append_7 = -ldl subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_pkglibexec_SCRIPTS) \ $(pkginclude_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @SULOGIN_TRUE@am__EXEEXT_1 = sulogin$(EXEEXT) @KEVENTD_TRUE@am__EXEEXT_2 = keventd$(EXEEXT) @WATCHDOGD_TRUE@am__EXEEXT_3 = watchdogd$(EXEEXT) am__installdirs = "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(finit_pkglibdir)" \ "$(DESTDIR)$(pkgincludedir)" PROGRAMS = $(pkglibexec_PROGRAMS) $(sbin_PROGRAMS) am__finit_SOURCES_DIST = api.c cgroup.c cgroup.h client.c client.h \ cond.c cond-w.c cond.h conf.c conf.h devmon.c devmon.h exec.c \ finit.c finit.h stty.c helpers.c helpers.h iwatch.c iwatch.h \ log.c log.h mdadm.c mount.c pid.c pid.h plugin.c plugin.h \ private.h runparts.c schedule.c schedule.h service.c service.h \ sig.c sig.h sm.c sm.h svc.c svc.h tty.c tty.h util.c util.h \ utmp-api.c utmp-api.h logrotate.c @LOGROTATE_TRUE@am__objects_1 = finit-logrotate.$(OBJEXT) am_finit_OBJECTS = finit-api.$(OBJEXT) finit-cgroup.$(OBJEXT) \ finit-client.$(OBJEXT) finit-cond.$(OBJEXT) \ finit-cond-w.$(OBJEXT) finit-conf.$(OBJEXT) \ finit-devmon.$(OBJEXT) finit-exec.$(OBJEXT) \ finit-finit.$(OBJEXT) finit-stty.$(OBJEXT) \ finit-helpers.$(OBJEXT) finit-iwatch.$(OBJEXT) \ finit-log.$(OBJEXT) finit-mdadm.$(OBJEXT) \ finit-mount.$(OBJEXT) finit-pid.$(OBJEXT) \ finit-plugin.$(OBJEXT) finit-runparts.$(OBJEXT) \ finit-schedule.$(OBJEXT) finit-service.$(OBJEXT) \ finit-sig.$(OBJEXT) finit-sm.$(OBJEXT) finit-svc.$(OBJEXT) \ finit-tty.$(OBJEXT) finit-util.$(OBJEXT) \ finit-utmp-api.$(OBJEXT) $(am__objects_1) finit_OBJECTS = $(am_finit_OBJECTS) am__DEPENDENCIES_1 = finit_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__append_6) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = finit_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(finit_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_getty_OBJECTS = getty-getty.$(OBJEXT) getty-logrotate.$(OBJEXT) \ getty-stty.$(OBJEXT) getty-utmp-api.$(OBJEXT) getty_OBJECTS = $(am_getty_OBJECTS) getty_DEPENDENCIES = $(am__DEPENDENCIES_1) getty_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(getty_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_initctl_OBJECTS = initctl-initctl.$(OBJEXT) \ initctl-cgutil.$(OBJEXT) initctl-client.$(OBJEXT) \ initctl-cond.$(OBJEXT) initctl-reboot.$(OBJEXT) \ initctl-serv.$(OBJEXT) initctl-util.$(OBJEXT) initctl_OBJECTS = $(am_initctl_OBJECTS) initctl_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) initctl_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(initctl_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_keventd_OBJECTS = keventd-keventd.$(OBJEXT) \ keventd-iwatch.$(OBJEXT) keventd-util.$(OBJEXT) keventd_OBJECTS = $(am_keventd_OBJECTS) keventd_DEPENDENCIES = $(am__DEPENDENCIES_1) keventd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(keventd_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_logit_OBJECTS = logit-logit.$(OBJEXT) logit-logrotate.$(OBJEXT) logit_OBJECTS = $(am_logit_OBJECTS) logit_DEPENDENCIES = $(am__DEPENDENCIES_1) logit_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(logit_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_runparts_OBJECTS = runparts-runparts.$(OBJEXT) runparts_OBJECTS = $(am_runparts_OBJECTS) runparts_DEPENDENCIES = $(am__DEPENDENCIES_1) runparts_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(runparts_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_sulogin_OBJECTS = sulogin-sulogin.$(OBJEXT) sulogin_OBJECTS = $(am_sulogin_OBJECTS) sulogin_DEPENDENCIES = sulogin_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(sulogin_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_tmpfiles_OBJECTS = tmpfiles-tmpfiles.$(OBJEXT) \ tmpfiles-util.$(OBJEXT) tmpfiles_OBJECTS = $(am_tmpfiles_OBJECTS) tmpfiles_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) tmpfiles_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(tmpfiles_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__watchdogd_SOURCES_DIST = watchdog.c watchdog.h @WATCHDOGD_TRUE@am_watchdogd_OBJECTS = watchdogd-watchdog.$(OBJEXT) watchdogd_OBJECTS = $(am_watchdogd_OBJECTS) watchdogd_LDADD = $(LDADD) watchdogd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(watchdogd_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(dist_pkglibexec_SCRIPTS) $(finit_pkglib_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/finit-api.Po \ ./$(DEPDIR)/finit-cgroup.Po ./$(DEPDIR)/finit-client.Po \ ./$(DEPDIR)/finit-cond-w.Po ./$(DEPDIR)/finit-cond.Po \ ./$(DEPDIR)/finit-conf.Po ./$(DEPDIR)/finit-devmon.Po \ ./$(DEPDIR)/finit-exec.Po ./$(DEPDIR)/finit-finit.Po \ ./$(DEPDIR)/finit-helpers.Po ./$(DEPDIR)/finit-iwatch.Po \ ./$(DEPDIR)/finit-log.Po ./$(DEPDIR)/finit-logrotate.Po \ ./$(DEPDIR)/finit-mdadm.Po ./$(DEPDIR)/finit-mount.Po \ ./$(DEPDIR)/finit-pid.Po ./$(DEPDIR)/finit-plugin.Po \ ./$(DEPDIR)/finit-runparts.Po ./$(DEPDIR)/finit-schedule.Po \ ./$(DEPDIR)/finit-service.Po ./$(DEPDIR)/finit-sig.Po \ ./$(DEPDIR)/finit-sm.Po ./$(DEPDIR)/finit-stty.Po \ ./$(DEPDIR)/finit-svc.Po ./$(DEPDIR)/finit-tty.Po \ ./$(DEPDIR)/finit-util.Po ./$(DEPDIR)/finit-utmp-api.Po \ ./$(DEPDIR)/getty-getty.Po ./$(DEPDIR)/getty-logrotate.Po \ ./$(DEPDIR)/getty-stty.Po ./$(DEPDIR)/getty-utmp-api.Po \ ./$(DEPDIR)/initctl-cgutil.Po ./$(DEPDIR)/initctl-client.Po \ ./$(DEPDIR)/initctl-cond.Po ./$(DEPDIR)/initctl-initctl.Po \ ./$(DEPDIR)/initctl-reboot.Po ./$(DEPDIR)/initctl-serv.Po \ ./$(DEPDIR)/initctl-util.Po ./$(DEPDIR)/keventd-iwatch.Po \ ./$(DEPDIR)/keventd-keventd.Po ./$(DEPDIR)/keventd-util.Po \ ./$(DEPDIR)/logit-logit.Po ./$(DEPDIR)/logit-logrotate.Po \ ./$(DEPDIR)/runparts-runparts.Po \ ./$(DEPDIR)/sulogin-sulogin.Po \ ./$(DEPDIR)/tmpfiles-tmpfiles.Po ./$(DEPDIR)/tmpfiles-util.Po \ ./$(DEPDIR)/watchdogd-watchdog.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ 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 = $(finit_SOURCES) $(getty_SOURCES) $(initctl_SOURCES) \ $(keventd_SOURCES) $(logit_SOURCES) $(runparts_SOURCES) \ $(sulogin_SOURCES) $(tmpfiles_SOURCES) $(watchdogd_SOURCES) DIST_SOURCES = $(am__finit_SOURCES_DIST) $(getty_SOURCES) \ $(initctl_SOURCES) $(keventd_SOURCES) $(logit_SOURCES) \ $(runparts_SOURCES) $(sulogin_SOURCES) $(tmpfiles_SOURCES) \ $(am__watchdogd_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(pkginclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ EXTRA_DIST = rescue.conf sample.conf AM_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE \ -D_DEFAULT_SOURCE $(am__append_1) @STATIC_FALSE@AM_LDFLAGS = -export-dynamic @STATIC_TRUE@AM_LDFLAGS = -static-libtool-libs dist_pkglibexec_SCRIPTS = coldplug finit_pkglibdir = $(pkglibdir) finit_pkglib_SCRIPTS = rescue.conf sample.conf getty_SOURCES = finit.h getty.c helpers.h logrotate.c stty.c utmp-api.c utmp-api.h getty_CFLAGS = -W -Wall -Wextra -std=gnu99 $(lite_CFLAGS) getty_LDADD = $(lite_LIBS) keventd_SOURCES = keventd.c iwatch.c iwatch.h util.c util.h keventd_CFLAGS = -W -Wall -Wextra -std=gnu99 $(lite_CFLAGS) keventd_LDADD = $(lite_LIBS) runparts_SOURCES = runparts.c runparts_CFLAGS = -W -Wall -Wextra -std=gnu99 $(lite_CFLAGS) runparts_LDADD = $(lite_LIBS) sulogin_SOURCES = sulogin.c sulogin_CFLAGS = -W -Wall -Wextra -std=gnu99 sulogin_LDADD = -lcrypt tmpfiles_SOURCES = tmpfiles.c util.c util.h log.h tmpfiles_CFLAGS = -W -Wall -Wextra -std=gnu99 $(lite_CFLAGS) \ $(uev_CFLAGS) tmpfiles_LDADD = $(lite_LIBS) $(uev_LIBS) logit_SOURCES = logit.c logrotate.c logit_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99 \ $(lite_CFLAGS) logit_LDADD = $(lite_LIBS) finit_SOURCES = api.c cgroup.c cgroup.h client.c client.h cond.c \ cond-w.c cond.h conf.c conf.h devmon.c devmon.h exec.c finit.c \ finit.h stty.c helpers.c helpers.h iwatch.c iwatch.h log.c \ log.h mdadm.c mount.c pid.c pid.h plugin.c plugin.h private.h \ runparts.c schedule.c schedule.h service.c service.h sig.c \ sig.h sm.c sm.h svc.c svc.h tty.c tty.h util.c util.h \ utmp-api.c utmp-api.h $(am__append_5) pkginclude_HEADERS = cgroup.h cond.h conf.h finit.h helpers.h log.h \ plugin.h svc.h service.h finit_CPPFLAGS = $(AM_CPPFLAGS) -D__FINIT__ finit_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99 \ $(lite_CFLAGS) $(uev_CFLAGS) finit_LDADD = $(lite_LIBS) $(uev_LIBS) $(am__append_6) $(am__append_7) initctl_SOURCES = initctl.c initctl.h cgutil.c cgutil.h \ client.c client.h cond.c cond.h reboot.c \ serv.c serv.h svc.h util.c util.h log.h initctl_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99 \ $(lite_CFLAGS) $(uev_CFLAGS) initctl_LDADD = $(lite_LIBS) $(uev_LIBS) INIT_LNKS = init telinit REBOOT_LNKS = reboot shutdown halt poweroff suspend @WATCHDOGD_TRUE@watchdogd_SOURCES = watchdog.c watchdog.h @WATCHDOGD_TRUE@watchdogd_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files clean-pkglibexecPROGRAMS: @list='$(pkglibexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list finit$(EXEEXT): $(finit_OBJECTS) $(finit_DEPENDENCIES) $(EXTRA_finit_DEPENDENCIES) @rm -f finit$(EXEEXT) $(AM_V_CCLD)$(finit_LINK) $(finit_OBJECTS) $(finit_LDADD) $(LIBS) getty$(EXEEXT): $(getty_OBJECTS) $(getty_DEPENDENCIES) $(EXTRA_getty_DEPENDENCIES) @rm -f getty$(EXEEXT) $(AM_V_CCLD)$(getty_LINK) $(getty_OBJECTS) $(getty_LDADD) $(LIBS) initctl$(EXEEXT): $(initctl_OBJECTS) $(initctl_DEPENDENCIES) $(EXTRA_initctl_DEPENDENCIES) @rm -f initctl$(EXEEXT) $(AM_V_CCLD)$(initctl_LINK) $(initctl_OBJECTS) $(initctl_LDADD) $(LIBS) keventd$(EXEEXT): $(keventd_OBJECTS) $(keventd_DEPENDENCIES) $(EXTRA_keventd_DEPENDENCIES) @rm -f keventd$(EXEEXT) $(AM_V_CCLD)$(keventd_LINK) $(keventd_OBJECTS) $(keventd_LDADD) $(LIBS) logit$(EXEEXT): $(logit_OBJECTS) $(logit_DEPENDENCIES) $(EXTRA_logit_DEPENDENCIES) @rm -f logit$(EXEEXT) $(AM_V_CCLD)$(logit_LINK) $(logit_OBJECTS) $(logit_LDADD) $(LIBS) runparts$(EXEEXT): $(runparts_OBJECTS) $(runparts_DEPENDENCIES) $(EXTRA_runparts_DEPENDENCIES) @rm -f runparts$(EXEEXT) $(AM_V_CCLD)$(runparts_LINK) $(runparts_OBJECTS) $(runparts_LDADD) $(LIBS) sulogin$(EXEEXT): $(sulogin_OBJECTS) $(sulogin_DEPENDENCIES) $(EXTRA_sulogin_DEPENDENCIES) @rm -f sulogin$(EXEEXT) $(AM_V_CCLD)$(sulogin_LINK) $(sulogin_OBJECTS) $(sulogin_LDADD) $(LIBS) tmpfiles$(EXEEXT): $(tmpfiles_OBJECTS) $(tmpfiles_DEPENDENCIES) $(EXTRA_tmpfiles_DEPENDENCIES) @rm -f tmpfiles$(EXEEXT) $(AM_V_CCLD)$(tmpfiles_LINK) $(tmpfiles_OBJECTS) $(tmpfiles_LDADD) $(LIBS) watchdogd$(EXEEXT): $(watchdogd_OBJECTS) $(watchdogd_DEPENDENCIES) $(EXTRA_watchdogd_DEPENDENCIES) @rm -f watchdogd$(EXEEXT) $(AM_V_CCLD)$(watchdogd_LINK) $(watchdogd_OBJECTS) $(watchdogd_LDADD) $(LIBS) install-dist_pkglibexecSCRIPTS: $(dist_pkglibexec_SCRIPTS) @$(NORMAL_INSTALL) @list='$(dist_pkglibexec_SCRIPTS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-dist_pkglibexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(dist_pkglibexec_SCRIPTS)'; test -n "$(pkglibexecdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pkglibexecdir)'; $(am__uninstall_files_from_dir) install-finit_pkglibSCRIPTS: $(finit_pkglib_SCRIPTS) @$(NORMAL_INSTALL) @list='$(finit_pkglib_SCRIPTS)'; test -n "$(finit_pkglibdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(finit_pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(finit_pkglibdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(finit_pkglibdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(finit_pkglibdir)$$dir" || exit $$?; \ } \ ; done uninstall-finit_pkglibSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(finit_pkglib_SCRIPTS)'; test -n "$(finit_pkglibdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(finit_pkglibdir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-api.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-cgroup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-cond-w.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-cond.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-conf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-devmon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-exec.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-finit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-helpers.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-iwatch.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-logrotate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-mdadm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-mount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-pid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-plugin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-runparts.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-schedule.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-service.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-sig.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-sm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-stty.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-svc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-tty.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit-utmp-api.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getty-getty.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getty-logrotate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getty-stty.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getty-utmp-api.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initctl-cgutil.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initctl-client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initctl-cond.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initctl-initctl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initctl-reboot.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initctl-serv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initctl-util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keventd-iwatch.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keventd-keventd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keventd-util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logit-logit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logit-logrotate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runparts-runparts.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sulogin-sulogin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmpfiles-tmpfiles.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmpfiles-util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watchdogd-watchdog.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< finit-api.o: api.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-api.o -MD -MP -MF $(DEPDIR)/finit-api.Tpo -c -o finit-api.o `test -f 'api.c' || echo '$(srcdir)/'`api.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-api.Tpo $(DEPDIR)/finit-api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='api.c' object='finit-api.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-api.o `test -f 'api.c' || echo '$(srcdir)/'`api.c finit-api.obj: api.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-api.obj -MD -MP -MF $(DEPDIR)/finit-api.Tpo -c -o finit-api.obj `if test -f 'api.c'; then $(CYGPATH_W) 'api.c'; else $(CYGPATH_W) '$(srcdir)/api.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-api.Tpo $(DEPDIR)/finit-api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='api.c' object='finit-api.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-api.obj `if test -f 'api.c'; then $(CYGPATH_W) 'api.c'; else $(CYGPATH_W) '$(srcdir)/api.c'; fi` finit-cgroup.o: cgroup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-cgroup.o -MD -MP -MF $(DEPDIR)/finit-cgroup.Tpo -c -o finit-cgroup.o `test -f 'cgroup.c' || echo '$(srcdir)/'`cgroup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-cgroup.Tpo $(DEPDIR)/finit-cgroup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgroup.c' object='finit-cgroup.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-cgroup.o `test -f 'cgroup.c' || echo '$(srcdir)/'`cgroup.c finit-cgroup.obj: cgroup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-cgroup.obj -MD -MP -MF $(DEPDIR)/finit-cgroup.Tpo -c -o finit-cgroup.obj `if test -f 'cgroup.c'; then $(CYGPATH_W) 'cgroup.c'; else $(CYGPATH_W) '$(srcdir)/cgroup.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-cgroup.Tpo $(DEPDIR)/finit-cgroup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgroup.c' object='finit-cgroup.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-cgroup.obj `if test -f 'cgroup.c'; then $(CYGPATH_W) 'cgroup.c'; else $(CYGPATH_W) '$(srcdir)/cgroup.c'; fi` finit-client.o: client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-client.o -MD -MP -MF $(DEPDIR)/finit-client.Tpo -c -o finit-client.o `test -f 'client.c' || echo '$(srcdir)/'`client.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-client.Tpo $(DEPDIR)/finit-client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client.c' object='finit-client.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-client.o `test -f 'client.c' || echo '$(srcdir)/'`client.c finit-client.obj: client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-client.obj -MD -MP -MF $(DEPDIR)/finit-client.Tpo -c -o finit-client.obj `if test -f 'client.c'; then $(CYGPATH_W) 'client.c'; else $(CYGPATH_W) '$(srcdir)/client.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-client.Tpo $(DEPDIR)/finit-client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client.c' object='finit-client.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-client.obj `if test -f 'client.c'; then $(CYGPATH_W) 'client.c'; else $(CYGPATH_W) '$(srcdir)/client.c'; fi` finit-cond.o: cond.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-cond.o -MD -MP -MF $(DEPDIR)/finit-cond.Tpo -c -o finit-cond.o `test -f 'cond.c' || echo '$(srcdir)/'`cond.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-cond.Tpo $(DEPDIR)/finit-cond.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cond.c' object='finit-cond.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-cond.o `test -f 'cond.c' || echo '$(srcdir)/'`cond.c finit-cond.obj: cond.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-cond.obj -MD -MP -MF $(DEPDIR)/finit-cond.Tpo -c -o finit-cond.obj `if test -f 'cond.c'; then $(CYGPATH_W) 'cond.c'; else $(CYGPATH_W) '$(srcdir)/cond.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-cond.Tpo $(DEPDIR)/finit-cond.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cond.c' object='finit-cond.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-cond.obj `if test -f 'cond.c'; then $(CYGPATH_W) 'cond.c'; else $(CYGPATH_W) '$(srcdir)/cond.c'; fi` finit-cond-w.o: cond-w.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-cond-w.o -MD -MP -MF $(DEPDIR)/finit-cond-w.Tpo -c -o finit-cond-w.o `test -f 'cond-w.c' || echo '$(srcdir)/'`cond-w.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-cond-w.Tpo $(DEPDIR)/finit-cond-w.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cond-w.c' object='finit-cond-w.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-cond-w.o `test -f 'cond-w.c' || echo '$(srcdir)/'`cond-w.c finit-cond-w.obj: cond-w.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-cond-w.obj -MD -MP -MF $(DEPDIR)/finit-cond-w.Tpo -c -o finit-cond-w.obj `if test -f 'cond-w.c'; then $(CYGPATH_W) 'cond-w.c'; else $(CYGPATH_W) '$(srcdir)/cond-w.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-cond-w.Tpo $(DEPDIR)/finit-cond-w.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cond-w.c' object='finit-cond-w.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-cond-w.obj `if test -f 'cond-w.c'; then $(CYGPATH_W) 'cond-w.c'; else $(CYGPATH_W) '$(srcdir)/cond-w.c'; fi` finit-conf.o: conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-conf.o -MD -MP -MF $(DEPDIR)/finit-conf.Tpo -c -o finit-conf.o `test -f 'conf.c' || echo '$(srcdir)/'`conf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-conf.Tpo $(DEPDIR)/finit-conf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conf.c' object='finit-conf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-conf.o `test -f 'conf.c' || echo '$(srcdir)/'`conf.c finit-conf.obj: conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-conf.obj -MD -MP -MF $(DEPDIR)/finit-conf.Tpo -c -o finit-conf.obj `if test -f 'conf.c'; then $(CYGPATH_W) 'conf.c'; else $(CYGPATH_W) '$(srcdir)/conf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-conf.Tpo $(DEPDIR)/finit-conf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conf.c' object='finit-conf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-conf.obj `if test -f 'conf.c'; then $(CYGPATH_W) 'conf.c'; else $(CYGPATH_W) '$(srcdir)/conf.c'; fi` finit-devmon.o: devmon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-devmon.o -MD -MP -MF $(DEPDIR)/finit-devmon.Tpo -c -o finit-devmon.o `test -f 'devmon.c' || echo '$(srcdir)/'`devmon.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-devmon.Tpo $(DEPDIR)/finit-devmon.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='devmon.c' object='finit-devmon.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-devmon.o `test -f 'devmon.c' || echo '$(srcdir)/'`devmon.c finit-devmon.obj: devmon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-devmon.obj -MD -MP -MF $(DEPDIR)/finit-devmon.Tpo -c -o finit-devmon.obj `if test -f 'devmon.c'; then $(CYGPATH_W) 'devmon.c'; else $(CYGPATH_W) '$(srcdir)/devmon.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-devmon.Tpo $(DEPDIR)/finit-devmon.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='devmon.c' object='finit-devmon.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-devmon.obj `if test -f 'devmon.c'; then $(CYGPATH_W) 'devmon.c'; else $(CYGPATH_W) '$(srcdir)/devmon.c'; fi` finit-exec.o: exec.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-exec.o -MD -MP -MF $(DEPDIR)/finit-exec.Tpo -c -o finit-exec.o `test -f 'exec.c' || echo '$(srcdir)/'`exec.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-exec.Tpo $(DEPDIR)/finit-exec.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='exec.c' object='finit-exec.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-exec.o `test -f 'exec.c' || echo '$(srcdir)/'`exec.c finit-exec.obj: exec.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-exec.obj -MD -MP -MF $(DEPDIR)/finit-exec.Tpo -c -o finit-exec.obj `if test -f 'exec.c'; then $(CYGPATH_W) 'exec.c'; else $(CYGPATH_W) '$(srcdir)/exec.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-exec.Tpo $(DEPDIR)/finit-exec.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='exec.c' object='finit-exec.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-exec.obj `if test -f 'exec.c'; then $(CYGPATH_W) 'exec.c'; else $(CYGPATH_W) '$(srcdir)/exec.c'; fi` finit-finit.o: finit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-finit.o -MD -MP -MF $(DEPDIR)/finit-finit.Tpo -c -o finit-finit.o `test -f 'finit.c' || echo '$(srcdir)/'`finit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-finit.Tpo $(DEPDIR)/finit-finit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='finit.c' object='finit-finit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-finit.o `test -f 'finit.c' || echo '$(srcdir)/'`finit.c finit-finit.obj: finit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-finit.obj -MD -MP -MF $(DEPDIR)/finit-finit.Tpo -c -o finit-finit.obj `if test -f 'finit.c'; then $(CYGPATH_W) 'finit.c'; else $(CYGPATH_W) '$(srcdir)/finit.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-finit.Tpo $(DEPDIR)/finit-finit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='finit.c' object='finit-finit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-finit.obj `if test -f 'finit.c'; then $(CYGPATH_W) 'finit.c'; else $(CYGPATH_W) '$(srcdir)/finit.c'; fi` finit-stty.o: stty.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-stty.o -MD -MP -MF $(DEPDIR)/finit-stty.Tpo -c -o finit-stty.o `test -f 'stty.c' || echo '$(srcdir)/'`stty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-stty.Tpo $(DEPDIR)/finit-stty.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stty.c' object='finit-stty.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-stty.o `test -f 'stty.c' || echo '$(srcdir)/'`stty.c finit-stty.obj: stty.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-stty.obj -MD -MP -MF $(DEPDIR)/finit-stty.Tpo -c -o finit-stty.obj `if test -f 'stty.c'; then $(CYGPATH_W) 'stty.c'; else $(CYGPATH_W) '$(srcdir)/stty.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-stty.Tpo $(DEPDIR)/finit-stty.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stty.c' object='finit-stty.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-stty.obj `if test -f 'stty.c'; then $(CYGPATH_W) 'stty.c'; else $(CYGPATH_W) '$(srcdir)/stty.c'; fi` finit-helpers.o: helpers.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-helpers.o -MD -MP -MF $(DEPDIR)/finit-helpers.Tpo -c -o finit-helpers.o `test -f 'helpers.c' || echo '$(srcdir)/'`helpers.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-helpers.Tpo $(DEPDIR)/finit-helpers.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='helpers.c' object='finit-helpers.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-helpers.o `test -f 'helpers.c' || echo '$(srcdir)/'`helpers.c finit-helpers.obj: helpers.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-helpers.obj -MD -MP -MF $(DEPDIR)/finit-helpers.Tpo -c -o finit-helpers.obj `if test -f 'helpers.c'; then $(CYGPATH_W) 'helpers.c'; else $(CYGPATH_W) '$(srcdir)/helpers.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-helpers.Tpo $(DEPDIR)/finit-helpers.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='helpers.c' object='finit-helpers.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-helpers.obj `if test -f 'helpers.c'; then $(CYGPATH_W) 'helpers.c'; else $(CYGPATH_W) '$(srcdir)/helpers.c'; fi` finit-iwatch.o: iwatch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-iwatch.o -MD -MP -MF $(DEPDIR)/finit-iwatch.Tpo -c -o finit-iwatch.o `test -f 'iwatch.c' || echo '$(srcdir)/'`iwatch.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-iwatch.Tpo $(DEPDIR)/finit-iwatch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iwatch.c' object='finit-iwatch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-iwatch.o `test -f 'iwatch.c' || echo '$(srcdir)/'`iwatch.c finit-iwatch.obj: iwatch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-iwatch.obj -MD -MP -MF $(DEPDIR)/finit-iwatch.Tpo -c -o finit-iwatch.obj `if test -f 'iwatch.c'; then $(CYGPATH_W) 'iwatch.c'; else $(CYGPATH_W) '$(srcdir)/iwatch.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-iwatch.Tpo $(DEPDIR)/finit-iwatch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iwatch.c' object='finit-iwatch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-iwatch.obj `if test -f 'iwatch.c'; then $(CYGPATH_W) 'iwatch.c'; else $(CYGPATH_W) '$(srcdir)/iwatch.c'; fi` finit-log.o: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-log.o -MD -MP -MF $(DEPDIR)/finit-log.Tpo -c -o finit-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-log.Tpo $(DEPDIR)/finit-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='finit-log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c finit-log.obj: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-log.obj -MD -MP -MF $(DEPDIR)/finit-log.Tpo -c -o finit-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-log.Tpo $(DEPDIR)/finit-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='finit-log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi` finit-mdadm.o: mdadm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-mdadm.o -MD -MP -MF $(DEPDIR)/finit-mdadm.Tpo -c -o finit-mdadm.o `test -f 'mdadm.c' || echo '$(srcdir)/'`mdadm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-mdadm.Tpo $(DEPDIR)/finit-mdadm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mdadm.c' object='finit-mdadm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-mdadm.o `test -f 'mdadm.c' || echo '$(srcdir)/'`mdadm.c finit-mdadm.obj: mdadm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-mdadm.obj -MD -MP -MF $(DEPDIR)/finit-mdadm.Tpo -c -o finit-mdadm.obj `if test -f 'mdadm.c'; then $(CYGPATH_W) 'mdadm.c'; else $(CYGPATH_W) '$(srcdir)/mdadm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-mdadm.Tpo $(DEPDIR)/finit-mdadm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mdadm.c' object='finit-mdadm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-mdadm.obj `if test -f 'mdadm.c'; then $(CYGPATH_W) 'mdadm.c'; else $(CYGPATH_W) '$(srcdir)/mdadm.c'; fi` finit-mount.o: mount.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-mount.o -MD -MP -MF $(DEPDIR)/finit-mount.Tpo -c -o finit-mount.o `test -f 'mount.c' || echo '$(srcdir)/'`mount.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-mount.Tpo $(DEPDIR)/finit-mount.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mount.c' object='finit-mount.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-mount.o `test -f 'mount.c' || echo '$(srcdir)/'`mount.c finit-mount.obj: mount.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-mount.obj -MD -MP -MF $(DEPDIR)/finit-mount.Tpo -c -o finit-mount.obj `if test -f 'mount.c'; then $(CYGPATH_W) 'mount.c'; else $(CYGPATH_W) '$(srcdir)/mount.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-mount.Tpo $(DEPDIR)/finit-mount.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mount.c' object='finit-mount.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-mount.obj `if test -f 'mount.c'; then $(CYGPATH_W) 'mount.c'; else $(CYGPATH_W) '$(srcdir)/mount.c'; fi` finit-pid.o: pid.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-pid.o -MD -MP -MF $(DEPDIR)/finit-pid.Tpo -c -o finit-pid.o `test -f 'pid.c' || echo '$(srcdir)/'`pid.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-pid.Tpo $(DEPDIR)/finit-pid.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pid.c' object='finit-pid.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-pid.o `test -f 'pid.c' || echo '$(srcdir)/'`pid.c finit-pid.obj: pid.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-pid.obj -MD -MP -MF $(DEPDIR)/finit-pid.Tpo -c -o finit-pid.obj `if test -f 'pid.c'; then $(CYGPATH_W) 'pid.c'; else $(CYGPATH_W) '$(srcdir)/pid.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-pid.Tpo $(DEPDIR)/finit-pid.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pid.c' object='finit-pid.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-pid.obj `if test -f 'pid.c'; then $(CYGPATH_W) 'pid.c'; else $(CYGPATH_W) '$(srcdir)/pid.c'; fi` finit-plugin.o: plugin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-plugin.o -MD -MP -MF $(DEPDIR)/finit-plugin.Tpo -c -o finit-plugin.o `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-plugin.Tpo $(DEPDIR)/finit-plugin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugin.c' object='finit-plugin.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-plugin.o `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c finit-plugin.obj: plugin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-plugin.obj -MD -MP -MF $(DEPDIR)/finit-plugin.Tpo -c -o finit-plugin.obj `if test -f 'plugin.c'; then $(CYGPATH_W) 'plugin.c'; else $(CYGPATH_W) '$(srcdir)/plugin.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-plugin.Tpo $(DEPDIR)/finit-plugin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugin.c' object='finit-plugin.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-plugin.obj `if test -f 'plugin.c'; then $(CYGPATH_W) 'plugin.c'; else $(CYGPATH_W) '$(srcdir)/plugin.c'; fi` finit-runparts.o: runparts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-runparts.o -MD -MP -MF $(DEPDIR)/finit-runparts.Tpo -c -o finit-runparts.o `test -f 'runparts.c' || echo '$(srcdir)/'`runparts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-runparts.Tpo $(DEPDIR)/finit-runparts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='runparts.c' object='finit-runparts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-runparts.o `test -f 'runparts.c' || echo '$(srcdir)/'`runparts.c finit-runparts.obj: runparts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-runparts.obj -MD -MP -MF $(DEPDIR)/finit-runparts.Tpo -c -o finit-runparts.obj `if test -f 'runparts.c'; then $(CYGPATH_W) 'runparts.c'; else $(CYGPATH_W) '$(srcdir)/runparts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-runparts.Tpo $(DEPDIR)/finit-runparts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='runparts.c' object='finit-runparts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-runparts.obj `if test -f 'runparts.c'; then $(CYGPATH_W) 'runparts.c'; else $(CYGPATH_W) '$(srcdir)/runparts.c'; fi` finit-schedule.o: schedule.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-schedule.o -MD -MP -MF $(DEPDIR)/finit-schedule.Tpo -c -o finit-schedule.o `test -f 'schedule.c' || echo '$(srcdir)/'`schedule.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-schedule.Tpo $(DEPDIR)/finit-schedule.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='schedule.c' object='finit-schedule.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-schedule.o `test -f 'schedule.c' || echo '$(srcdir)/'`schedule.c finit-schedule.obj: schedule.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-schedule.obj -MD -MP -MF $(DEPDIR)/finit-schedule.Tpo -c -o finit-schedule.obj `if test -f 'schedule.c'; then $(CYGPATH_W) 'schedule.c'; else $(CYGPATH_W) '$(srcdir)/schedule.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-schedule.Tpo $(DEPDIR)/finit-schedule.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='schedule.c' object='finit-schedule.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-schedule.obj `if test -f 'schedule.c'; then $(CYGPATH_W) 'schedule.c'; else $(CYGPATH_W) '$(srcdir)/schedule.c'; fi` finit-service.o: service.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-service.o -MD -MP -MF $(DEPDIR)/finit-service.Tpo -c -o finit-service.o `test -f 'service.c' || echo '$(srcdir)/'`service.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-service.Tpo $(DEPDIR)/finit-service.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='service.c' object='finit-service.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-service.o `test -f 'service.c' || echo '$(srcdir)/'`service.c finit-service.obj: service.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-service.obj -MD -MP -MF $(DEPDIR)/finit-service.Tpo -c -o finit-service.obj `if test -f 'service.c'; then $(CYGPATH_W) 'service.c'; else $(CYGPATH_W) '$(srcdir)/service.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-service.Tpo $(DEPDIR)/finit-service.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='service.c' object='finit-service.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-service.obj `if test -f 'service.c'; then $(CYGPATH_W) 'service.c'; else $(CYGPATH_W) '$(srcdir)/service.c'; fi` finit-sig.o: sig.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-sig.o -MD -MP -MF $(DEPDIR)/finit-sig.Tpo -c -o finit-sig.o `test -f 'sig.c' || echo '$(srcdir)/'`sig.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-sig.Tpo $(DEPDIR)/finit-sig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sig.c' object='finit-sig.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-sig.o `test -f 'sig.c' || echo '$(srcdir)/'`sig.c finit-sig.obj: sig.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-sig.obj -MD -MP -MF $(DEPDIR)/finit-sig.Tpo -c -o finit-sig.obj `if test -f 'sig.c'; then $(CYGPATH_W) 'sig.c'; else $(CYGPATH_W) '$(srcdir)/sig.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-sig.Tpo $(DEPDIR)/finit-sig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sig.c' object='finit-sig.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-sig.obj `if test -f 'sig.c'; then $(CYGPATH_W) 'sig.c'; else $(CYGPATH_W) '$(srcdir)/sig.c'; fi` finit-sm.o: sm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-sm.o -MD -MP -MF $(DEPDIR)/finit-sm.Tpo -c -o finit-sm.o `test -f 'sm.c' || echo '$(srcdir)/'`sm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-sm.Tpo $(DEPDIR)/finit-sm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sm.c' object='finit-sm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-sm.o `test -f 'sm.c' || echo '$(srcdir)/'`sm.c finit-sm.obj: sm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-sm.obj -MD -MP -MF $(DEPDIR)/finit-sm.Tpo -c -o finit-sm.obj `if test -f 'sm.c'; then $(CYGPATH_W) 'sm.c'; else $(CYGPATH_W) '$(srcdir)/sm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-sm.Tpo $(DEPDIR)/finit-sm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sm.c' object='finit-sm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-sm.obj `if test -f 'sm.c'; then $(CYGPATH_W) 'sm.c'; else $(CYGPATH_W) '$(srcdir)/sm.c'; fi` finit-svc.o: svc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-svc.o -MD -MP -MF $(DEPDIR)/finit-svc.Tpo -c -o finit-svc.o `test -f 'svc.c' || echo '$(srcdir)/'`svc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-svc.Tpo $(DEPDIR)/finit-svc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='svc.c' object='finit-svc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-svc.o `test -f 'svc.c' || echo '$(srcdir)/'`svc.c finit-svc.obj: svc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-svc.obj -MD -MP -MF $(DEPDIR)/finit-svc.Tpo -c -o finit-svc.obj `if test -f 'svc.c'; then $(CYGPATH_W) 'svc.c'; else $(CYGPATH_W) '$(srcdir)/svc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-svc.Tpo $(DEPDIR)/finit-svc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='svc.c' object='finit-svc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-svc.obj `if test -f 'svc.c'; then $(CYGPATH_W) 'svc.c'; else $(CYGPATH_W) '$(srcdir)/svc.c'; fi` finit-tty.o: tty.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-tty.o -MD -MP -MF $(DEPDIR)/finit-tty.Tpo -c -o finit-tty.o `test -f 'tty.c' || echo '$(srcdir)/'`tty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-tty.Tpo $(DEPDIR)/finit-tty.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tty.c' object='finit-tty.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-tty.o `test -f 'tty.c' || echo '$(srcdir)/'`tty.c finit-tty.obj: tty.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-tty.obj -MD -MP -MF $(DEPDIR)/finit-tty.Tpo -c -o finit-tty.obj `if test -f 'tty.c'; then $(CYGPATH_W) 'tty.c'; else $(CYGPATH_W) '$(srcdir)/tty.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-tty.Tpo $(DEPDIR)/finit-tty.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tty.c' object='finit-tty.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-tty.obj `if test -f 'tty.c'; then $(CYGPATH_W) 'tty.c'; else $(CYGPATH_W) '$(srcdir)/tty.c'; fi` finit-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-util.o -MD -MP -MF $(DEPDIR)/finit-util.Tpo -c -o finit-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-util.Tpo $(DEPDIR)/finit-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='finit-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c finit-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-util.obj -MD -MP -MF $(DEPDIR)/finit-util.Tpo -c -o finit-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-util.Tpo $(DEPDIR)/finit-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='finit-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` finit-utmp-api.o: utmp-api.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-utmp-api.o -MD -MP -MF $(DEPDIR)/finit-utmp-api.Tpo -c -o finit-utmp-api.o `test -f 'utmp-api.c' || echo '$(srcdir)/'`utmp-api.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-utmp-api.Tpo $(DEPDIR)/finit-utmp-api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utmp-api.c' object='finit-utmp-api.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-utmp-api.o `test -f 'utmp-api.c' || echo '$(srcdir)/'`utmp-api.c finit-utmp-api.obj: utmp-api.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-utmp-api.obj -MD -MP -MF $(DEPDIR)/finit-utmp-api.Tpo -c -o finit-utmp-api.obj `if test -f 'utmp-api.c'; then $(CYGPATH_W) 'utmp-api.c'; else $(CYGPATH_W) '$(srcdir)/utmp-api.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-utmp-api.Tpo $(DEPDIR)/finit-utmp-api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utmp-api.c' object='finit-utmp-api.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-utmp-api.obj `if test -f 'utmp-api.c'; then $(CYGPATH_W) 'utmp-api.c'; else $(CYGPATH_W) '$(srcdir)/utmp-api.c'; fi` finit-logrotate.o: logrotate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-logrotate.o -MD -MP -MF $(DEPDIR)/finit-logrotate.Tpo -c -o finit-logrotate.o `test -f 'logrotate.c' || echo '$(srcdir)/'`logrotate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-logrotate.Tpo $(DEPDIR)/finit-logrotate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logrotate.c' object='finit-logrotate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-logrotate.o `test -f 'logrotate.c' || echo '$(srcdir)/'`logrotate.c finit-logrotate.obj: logrotate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -MT finit-logrotate.obj -MD -MP -MF $(DEPDIR)/finit-logrotate.Tpo -c -o finit-logrotate.obj `if test -f 'logrotate.c'; then $(CYGPATH_W) 'logrotate.c'; else $(CYGPATH_W) '$(srcdir)/logrotate.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/finit-logrotate.Tpo $(DEPDIR)/finit-logrotate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logrotate.c' object='finit-logrotate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(finit_CPPFLAGS) $(CPPFLAGS) $(finit_CFLAGS) $(CFLAGS) -c -o finit-logrotate.obj `if test -f 'logrotate.c'; then $(CYGPATH_W) 'logrotate.c'; else $(CYGPATH_W) '$(srcdir)/logrotate.c'; fi` getty-getty.o: getty.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -MT getty-getty.o -MD -MP -MF $(DEPDIR)/getty-getty.Tpo -c -o getty-getty.o `test -f 'getty.c' || echo '$(srcdir)/'`getty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getty-getty.Tpo $(DEPDIR)/getty-getty.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getty.c' object='getty-getty.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -c -o getty-getty.o `test -f 'getty.c' || echo '$(srcdir)/'`getty.c getty-getty.obj: getty.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -MT getty-getty.obj -MD -MP -MF $(DEPDIR)/getty-getty.Tpo -c -o getty-getty.obj `if test -f 'getty.c'; then $(CYGPATH_W) 'getty.c'; else $(CYGPATH_W) '$(srcdir)/getty.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getty-getty.Tpo $(DEPDIR)/getty-getty.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getty.c' object='getty-getty.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -c -o getty-getty.obj `if test -f 'getty.c'; then $(CYGPATH_W) 'getty.c'; else $(CYGPATH_W) '$(srcdir)/getty.c'; fi` getty-logrotate.o: logrotate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -MT getty-logrotate.o -MD -MP -MF $(DEPDIR)/getty-logrotate.Tpo -c -o getty-logrotate.o `test -f 'logrotate.c' || echo '$(srcdir)/'`logrotate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getty-logrotate.Tpo $(DEPDIR)/getty-logrotate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logrotate.c' object='getty-logrotate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -c -o getty-logrotate.o `test -f 'logrotate.c' || echo '$(srcdir)/'`logrotate.c getty-logrotate.obj: logrotate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -MT getty-logrotate.obj -MD -MP -MF $(DEPDIR)/getty-logrotate.Tpo -c -o getty-logrotate.obj `if test -f 'logrotate.c'; then $(CYGPATH_W) 'logrotate.c'; else $(CYGPATH_W) '$(srcdir)/logrotate.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getty-logrotate.Tpo $(DEPDIR)/getty-logrotate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logrotate.c' object='getty-logrotate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -c -o getty-logrotate.obj `if test -f 'logrotate.c'; then $(CYGPATH_W) 'logrotate.c'; else $(CYGPATH_W) '$(srcdir)/logrotate.c'; fi` getty-stty.o: stty.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -MT getty-stty.o -MD -MP -MF $(DEPDIR)/getty-stty.Tpo -c -o getty-stty.o `test -f 'stty.c' || echo '$(srcdir)/'`stty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getty-stty.Tpo $(DEPDIR)/getty-stty.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stty.c' object='getty-stty.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -c -o getty-stty.o `test -f 'stty.c' || echo '$(srcdir)/'`stty.c getty-stty.obj: stty.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -MT getty-stty.obj -MD -MP -MF $(DEPDIR)/getty-stty.Tpo -c -o getty-stty.obj `if test -f 'stty.c'; then $(CYGPATH_W) 'stty.c'; else $(CYGPATH_W) '$(srcdir)/stty.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getty-stty.Tpo $(DEPDIR)/getty-stty.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stty.c' object='getty-stty.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -c -o getty-stty.obj `if test -f 'stty.c'; then $(CYGPATH_W) 'stty.c'; else $(CYGPATH_W) '$(srcdir)/stty.c'; fi` getty-utmp-api.o: utmp-api.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -MT getty-utmp-api.o -MD -MP -MF $(DEPDIR)/getty-utmp-api.Tpo -c -o getty-utmp-api.o `test -f 'utmp-api.c' || echo '$(srcdir)/'`utmp-api.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getty-utmp-api.Tpo $(DEPDIR)/getty-utmp-api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utmp-api.c' object='getty-utmp-api.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -c -o getty-utmp-api.o `test -f 'utmp-api.c' || echo '$(srcdir)/'`utmp-api.c getty-utmp-api.obj: utmp-api.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -MT getty-utmp-api.obj -MD -MP -MF $(DEPDIR)/getty-utmp-api.Tpo -c -o getty-utmp-api.obj `if test -f 'utmp-api.c'; then $(CYGPATH_W) 'utmp-api.c'; else $(CYGPATH_W) '$(srcdir)/utmp-api.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getty-utmp-api.Tpo $(DEPDIR)/getty-utmp-api.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utmp-api.c' object='getty-utmp-api.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getty_CFLAGS) $(CFLAGS) -c -o getty-utmp-api.obj `if test -f 'utmp-api.c'; then $(CYGPATH_W) 'utmp-api.c'; else $(CYGPATH_W) '$(srcdir)/utmp-api.c'; fi` initctl-initctl.o: initctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-initctl.o -MD -MP -MF $(DEPDIR)/initctl-initctl.Tpo -c -o initctl-initctl.o `test -f 'initctl.c' || echo '$(srcdir)/'`initctl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-initctl.Tpo $(DEPDIR)/initctl-initctl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='initctl.c' object='initctl-initctl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-initctl.o `test -f 'initctl.c' || echo '$(srcdir)/'`initctl.c initctl-initctl.obj: initctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-initctl.obj -MD -MP -MF $(DEPDIR)/initctl-initctl.Tpo -c -o initctl-initctl.obj `if test -f 'initctl.c'; then $(CYGPATH_W) 'initctl.c'; else $(CYGPATH_W) '$(srcdir)/initctl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-initctl.Tpo $(DEPDIR)/initctl-initctl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='initctl.c' object='initctl-initctl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-initctl.obj `if test -f 'initctl.c'; then $(CYGPATH_W) 'initctl.c'; else $(CYGPATH_W) '$(srcdir)/initctl.c'; fi` initctl-cgutil.o: cgutil.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-cgutil.o -MD -MP -MF $(DEPDIR)/initctl-cgutil.Tpo -c -o initctl-cgutil.o `test -f 'cgutil.c' || echo '$(srcdir)/'`cgutil.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-cgutil.Tpo $(DEPDIR)/initctl-cgutil.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgutil.c' object='initctl-cgutil.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-cgutil.o `test -f 'cgutil.c' || echo '$(srcdir)/'`cgutil.c initctl-cgutil.obj: cgutil.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-cgutil.obj -MD -MP -MF $(DEPDIR)/initctl-cgutil.Tpo -c -o initctl-cgutil.obj `if test -f 'cgutil.c'; then $(CYGPATH_W) 'cgutil.c'; else $(CYGPATH_W) '$(srcdir)/cgutil.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-cgutil.Tpo $(DEPDIR)/initctl-cgutil.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgutil.c' object='initctl-cgutil.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-cgutil.obj `if test -f 'cgutil.c'; then $(CYGPATH_W) 'cgutil.c'; else $(CYGPATH_W) '$(srcdir)/cgutil.c'; fi` initctl-client.o: client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-client.o -MD -MP -MF $(DEPDIR)/initctl-client.Tpo -c -o initctl-client.o `test -f 'client.c' || echo '$(srcdir)/'`client.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-client.Tpo $(DEPDIR)/initctl-client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client.c' object='initctl-client.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-client.o `test -f 'client.c' || echo '$(srcdir)/'`client.c initctl-client.obj: client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-client.obj -MD -MP -MF $(DEPDIR)/initctl-client.Tpo -c -o initctl-client.obj `if test -f 'client.c'; then $(CYGPATH_W) 'client.c'; else $(CYGPATH_W) '$(srcdir)/client.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-client.Tpo $(DEPDIR)/initctl-client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client.c' object='initctl-client.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-client.obj `if test -f 'client.c'; then $(CYGPATH_W) 'client.c'; else $(CYGPATH_W) '$(srcdir)/client.c'; fi` initctl-cond.o: cond.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-cond.o -MD -MP -MF $(DEPDIR)/initctl-cond.Tpo -c -o initctl-cond.o `test -f 'cond.c' || echo '$(srcdir)/'`cond.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-cond.Tpo $(DEPDIR)/initctl-cond.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cond.c' object='initctl-cond.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-cond.o `test -f 'cond.c' || echo '$(srcdir)/'`cond.c initctl-cond.obj: cond.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-cond.obj -MD -MP -MF $(DEPDIR)/initctl-cond.Tpo -c -o initctl-cond.obj `if test -f 'cond.c'; then $(CYGPATH_W) 'cond.c'; else $(CYGPATH_W) '$(srcdir)/cond.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-cond.Tpo $(DEPDIR)/initctl-cond.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cond.c' object='initctl-cond.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-cond.obj `if test -f 'cond.c'; then $(CYGPATH_W) 'cond.c'; else $(CYGPATH_W) '$(srcdir)/cond.c'; fi` initctl-reboot.o: reboot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-reboot.o -MD -MP -MF $(DEPDIR)/initctl-reboot.Tpo -c -o initctl-reboot.o `test -f 'reboot.c' || echo '$(srcdir)/'`reboot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-reboot.Tpo $(DEPDIR)/initctl-reboot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reboot.c' object='initctl-reboot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-reboot.o `test -f 'reboot.c' || echo '$(srcdir)/'`reboot.c initctl-reboot.obj: reboot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-reboot.obj -MD -MP -MF $(DEPDIR)/initctl-reboot.Tpo -c -o initctl-reboot.obj `if test -f 'reboot.c'; then $(CYGPATH_W) 'reboot.c'; else $(CYGPATH_W) '$(srcdir)/reboot.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-reboot.Tpo $(DEPDIR)/initctl-reboot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reboot.c' object='initctl-reboot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-reboot.obj `if test -f 'reboot.c'; then $(CYGPATH_W) 'reboot.c'; else $(CYGPATH_W) '$(srcdir)/reboot.c'; fi` initctl-serv.o: serv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-serv.o -MD -MP -MF $(DEPDIR)/initctl-serv.Tpo -c -o initctl-serv.o `test -f 'serv.c' || echo '$(srcdir)/'`serv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-serv.Tpo $(DEPDIR)/initctl-serv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='serv.c' object='initctl-serv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-serv.o `test -f 'serv.c' || echo '$(srcdir)/'`serv.c initctl-serv.obj: serv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-serv.obj -MD -MP -MF $(DEPDIR)/initctl-serv.Tpo -c -o initctl-serv.obj `if test -f 'serv.c'; then $(CYGPATH_W) 'serv.c'; else $(CYGPATH_W) '$(srcdir)/serv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-serv.Tpo $(DEPDIR)/initctl-serv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='serv.c' object='initctl-serv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-serv.obj `if test -f 'serv.c'; then $(CYGPATH_W) 'serv.c'; else $(CYGPATH_W) '$(srcdir)/serv.c'; fi` initctl-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-util.o -MD -MP -MF $(DEPDIR)/initctl-util.Tpo -c -o initctl-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-util.Tpo $(DEPDIR)/initctl-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='initctl-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c initctl-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -MT initctl-util.obj -MD -MP -MF $(DEPDIR)/initctl-util.Tpo -c -o initctl-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/initctl-util.Tpo $(DEPDIR)/initctl-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='initctl-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(initctl_CFLAGS) $(CFLAGS) -c -o initctl-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` keventd-keventd.o: keventd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -MT keventd-keventd.o -MD -MP -MF $(DEPDIR)/keventd-keventd.Tpo -c -o keventd-keventd.o `test -f 'keventd.c' || echo '$(srcdir)/'`keventd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/keventd-keventd.Tpo $(DEPDIR)/keventd-keventd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keventd.c' object='keventd-keventd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -c -o keventd-keventd.o `test -f 'keventd.c' || echo '$(srcdir)/'`keventd.c keventd-keventd.obj: keventd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -MT keventd-keventd.obj -MD -MP -MF $(DEPDIR)/keventd-keventd.Tpo -c -o keventd-keventd.obj `if test -f 'keventd.c'; then $(CYGPATH_W) 'keventd.c'; else $(CYGPATH_W) '$(srcdir)/keventd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/keventd-keventd.Tpo $(DEPDIR)/keventd-keventd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keventd.c' object='keventd-keventd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -c -o keventd-keventd.obj `if test -f 'keventd.c'; then $(CYGPATH_W) 'keventd.c'; else $(CYGPATH_W) '$(srcdir)/keventd.c'; fi` keventd-iwatch.o: iwatch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -MT keventd-iwatch.o -MD -MP -MF $(DEPDIR)/keventd-iwatch.Tpo -c -o keventd-iwatch.o `test -f 'iwatch.c' || echo '$(srcdir)/'`iwatch.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/keventd-iwatch.Tpo $(DEPDIR)/keventd-iwatch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iwatch.c' object='keventd-iwatch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -c -o keventd-iwatch.o `test -f 'iwatch.c' || echo '$(srcdir)/'`iwatch.c keventd-iwatch.obj: iwatch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -MT keventd-iwatch.obj -MD -MP -MF $(DEPDIR)/keventd-iwatch.Tpo -c -o keventd-iwatch.obj `if test -f 'iwatch.c'; then $(CYGPATH_W) 'iwatch.c'; else $(CYGPATH_W) '$(srcdir)/iwatch.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/keventd-iwatch.Tpo $(DEPDIR)/keventd-iwatch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iwatch.c' object='keventd-iwatch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -c -o keventd-iwatch.obj `if test -f 'iwatch.c'; then $(CYGPATH_W) 'iwatch.c'; else $(CYGPATH_W) '$(srcdir)/iwatch.c'; fi` keventd-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -MT keventd-util.o -MD -MP -MF $(DEPDIR)/keventd-util.Tpo -c -o keventd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/keventd-util.Tpo $(DEPDIR)/keventd-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='keventd-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -c -o keventd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c keventd-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -MT keventd-util.obj -MD -MP -MF $(DEPDIR)/keventd-util.Tpo -c -o keventd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/keventd-util.Tpo $(DEPDIR)/keventd-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='keventd-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keventd_CFLAGS) $(CFLAGS) -c -o keventd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` logit-logit.o: logit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(logit_CFLAGS) $(CFLAGS) -MT logit-logit.o -MD -MP -MF $(DEPDIR)/logit-logit.Tpo -c -o logit-logit.o `test -f 'logit.c' || echo '$(srcdir)/'`logit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/logit-logit.Tpo $(DEPDIR)/logit-logit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logit.c' object='logit-logit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(logit_CFLAGS) $(CFLAGS) -c -o logit-logit.o `test -f 'logit.c' || echo '$(srcdir)/'`logit.c logit-logit.obj: logit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(logit_CFLAGS) $(CFLAGS) -MT logit-logit.obj -MD -MP -MF $(DEPDIR)/logit-logit.Tpo -c -o logit-logit.obj `if test -f 'logit.c'; then $(CYGPATH_W) 'logit.c'; else $(CYGPATH_W) '$(srcdir)/logit.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/logit-logit.Tpo $(DEPDIR)/logit-logit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logit.c' object='logit-logit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(logit_CFLAGS) $(CFLAGS) -c -o logit-logit.obj `if test -f 'logit.c'; then $(CYGPATH_W) 'logit.c'; else $(CYGPATH_W) '$(srcdir)/logit.c'; fi` logit-logrotate.o: logrotate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(logit_CFLAGS) $(CFLAGS) -MT logit-logrotate.o -MD -MP -MF $(DEPDIR)/logit-logrotate.Tpo -c -o logit-logrotate.o `test -f 'logrotate.c' || echo '$(srcdir)/'`logrotate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/logit-logrotate.Tpo $(DEPDIR)/logit-logrotate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logrotate.c' object='logit-logrotate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(logit_CFLAGS) $(CFLAGS) -c -o logit-logrotate.o `test -f 'logrotate.c' || echo '$(srcdir)/'`logrotate.c logit-logrotate.obj: logrotate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(logit_CFLAGS) $(CFLAGS) -MT logit-logrotate.obj -MD -MP -MF $(DEPDIR)/logit-logrotate.Tpo -c -o logit-logrotate.obj `if test -f 'logrotate.c'; then $(CYGPATH_W) 'logrotate.c'; else $(CYGPATH_W) '$(srcdir)/logrotate.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/logit-logrotate.Tpo $(DEPDIR)/logit-logrotate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logrotate.c' object='logit-logrotate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(logit_CFLAGS) $(CFLAGS) -c -o logit-logrotate.obj `if test -f 'logrotate.c'; then $(CYGPATH_W) 'logrotate.c'; else $(CYGPATH_W) '$(srcdir)/logrotate.c'; fi` runparts-runparts.o: runparts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(runparts_CFLAGS) $(CFLAGS) -MT runparts-runparts.o -MD -MP -MF $(DEPDIR)/runparts-runparts.Tpo -c -o runparts-runparts.o `test -f 'runparts.c' || echo '$(srcdir)/'`runparts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/runparts-runparts.Tpo $(DEPDIR)/runparts-runparts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='runparts.c' object='runparts-runparts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(runparts_CFLAGS) $(CFLAGS) -c -o runparts-runparts.o `test -f 'runparts.c' || echo '$(srcdir)/'`runparts.c runparts-runparts.obj: runparts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(runparts_CFLAGS) $(CFLAGS) -MT runparts-runparts.obj -MD -MP -MF $(DEPDIR)/runparts-runparts.Tpo -c -o runparts-runparts.obj `if test -f 'runparts.c'; then $(CYGPATH_W) 'runparts.c'; else $(CYGPATH_W) '$(srcdir)/runparts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/runparts-runparts.Tpo $(DEPDIR)/runparts-runparts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='runparts.c' object='runparts-runparts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(runparts_CFLAGS) $(CFLAGS) -c -o runparts-runparts.obj `if test -f 'runparts.c'; then $(CYGPATH_W) 'runparts.c'; else $(CYGPATH_W) '$(srcdir)/runparts.c'; fi` sulogin-sulogin.o: sulogin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sulogin_CFLAGS) $(CFLAGS) -MT sulogin-sulogin.o -MD -MP -MF $(DEPDIR)/sulogin-sulogin.Tpo -c -o sulogin-sulogin.o `test -f 'sulogin.c' || echo '$(srcdir)/'`sulogin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sulogin-sulogin.Tpo $(DEPDIR)/sulogin-sulogin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sulogin.c' object='sulogin-sulogin.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sulogin_CFLAGS) $(CFLAGS) -c -o sulogin-sulogin.o `test -f 'sulogin.c' || echo '$(srcdir)/'`sulogin.c sulogin-sulogin.obj: sulogin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sulogin_CFLAGS) $(CFLAGS) -MT sulogin-sulogin.obj -MD -MP -MF $(DEPDIR)/sulogin-sulogin.Tpo -c -o sulogin-sulogin.obj `if test -f 'sulogin.c'; then $(CYGPATH_W) 'sulogin.c'; else $(CYGPATH_W) '$(srcdir)/sulogin.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sulogin-sulogin.Tpo $(DEPDIR)/sulogin-sulogin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sulogin.c' object='sulogin-sulogin.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sulogin_CFLAGS) $(CFLAGS) -c -o sulogin-sulogin.obj `if test -f 'sulogin.c'; then $(CYGPATH_W) 'sulogin.c'; else $(CYGPATH_W) '$(srcdir)/sulogin.c'; fi` tmpfiles-tmpfiles.o: tmpfiles.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tmpfiles_CFLAGS) $(CFLAGS) -MT tmpfiles-tmpfiles.o -MD -MP -MF $(DEPDIR)/tmpfiles-tmpfiles.Tpo -c -o tmpfiles-tmpfiles.o `test -f 'tmpfiles.c' || echo '$(srcdir)/'`tmpfiles.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tmpfiles-tmpfiles.Tpo $(DEPDIR)/tmpfiles-tmpfiles.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tmpfiles.c' object='tmpfiles-tmpfiles.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tmpfiles_CFLAGS) $(CFLAGS) -c -o tmpfiles-tmpfiles.o `test -f 'tmpfiles.c' || echo '$(srcdir)/'`tmpfiles.c tmpfiles-tmpfiles.obj: tmpfiles.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tmpfiles_CFLAGS) $(CFLAGS) -MT tmpfiles-tmpfiles.obj -MD -MP -MF $(DEPDIR)/tmpfiles-tmpfiles.Tpo -c -o tmpfiles-tmpfiles.obj `if test -f 'tmpfiles.c'; then $(CYGPATH_W) 'tmpfiles.c'; else $(CYGPATH_W) '$(srcdir)/tmpfiles.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tmpfiles-tmpfiles.Tpo $(DEPDIR)/tmpfiles-tmpfiles.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tmpfiles.c' object='tmpfiles-tmpfiles.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tmpfiles_CFLAGS) $(CFLAGS) -c -o tmpfiles-tmpfiles.obj `if test -f 'tmpfiles.c'; then $(CYGPATH_W) 'tmpfiles.c'; else $(CYGPATH_W) '$(srcdir)/tmpfiles.c'; fi` tmpfiles-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tmpfiles_CFLAGS) $(CFLAGS) -MT tmpfiles-util.o -MD -MP -MF $(DEPDIR)/tmpfiles-util.Tpo -c -o tmpfiles-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tmpfiles-util.Tpo $(DEPDIR)/tmpfiles-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='tmpfiles-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tmpfiles_CFLAGS) $(CFLAGS) -c -o tmpfiles-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c tmpfiles-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tmpfiles_CFLAGS) $(CFLAGS) -MT tmpfiles-util.obj -MD -MP -MF $(DEPDIR)/tmpfiles-util.Tpo -c -o tmpfiles-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tmpfiles-util.Tpo $(DEPDIR)/tmpfiles-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='tmpfiles-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tmpfiles_CFLAGS) $(CFLAGS) -c -o tmpfiles-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` watchdogd-watchdog.o: watchdog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(watchdogd_CFLAGS) $(CFLAGS) -MT watchdogd-watchdog.o -MD -MP -MF $(DEPDIR)/watchdogd-watchdog.Tpo -c -o watchdogd-watchdog.o `test -f 'watchdog.c' || echo '$(srcdir)/'`watchdog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/watchdogd-watchdog.Tpo $(DEPDIR)/watchdogd-watchdog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='watchdog.c' object='watchdogd-watchdog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(watchdogd_CFLAGS) $(CFLAGS) -c -o watchdogd-watchdog.o `test -f 'watchdog.c' || echo '$(srcdir)/'`watchdog.c watchdogd-watchdog.obj: watchdog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(watchdogd_CFLAGS) $(CFLAGS) -MT watchdogd-watchdog.obj -MD -MP -MF $(DEPDIR)/watchdogd-watchdog.Tpo -c -o watchdogd-watchdog.obj `if test -f 'watchdog.c'; then $(CYGPATH_W) 'watchdog.c'; else $(CYGPATH_W) '$(srcdir)/watchdog.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/watchdogd-watchdog.Tpo $(DEPDIR)/watchdogd-watchdog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='watchdog.c' object='watchdogd-watchdog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(watchdogd_CFLAGS) $(CFLAGS) -c -o watchdogd-watchdog.obj `if test -f 'watchdog.c'; then $(CYGPATH_W) 'watchdog.c'; else $(CYGPATH_W) '$(srcdir)/watchdog.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(finit_pkglibdir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibexecPROGRAMS \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/finit-api.Po -rm -f ./$(DEPDIR)/finit-cgroup.Po -rm -f ./$(DEPDIR)/finit-client.Po -rm -f ./$(DEPDIR)/finit-cond-w.Po -rm -f ./$(DEPDIR)/finit-cond.Po -rm -f ./$(DEPDIR)/finit-conf.Po -rm -f ./$(DEPDIR)/finit-devmon.Po -rm -f ./$(DEPDIR)/finit-exec.Po -rm -f ./$(DEPDIR)/finit-finit.Po -rm -f ./$(DEPDIR)/finit-helpers.Po -rm -f ./$(DEPDIR)/finit-iwatch.Po -rm -f ./$(DEPDIR)/finit-log.Po -rm -f ./$(DEPDIR)/finit-logrotate.Po -rm -f ./$(DEPDIR)/finit-mdadm.Po -rm -f ./$(DEPDIR)/finit-mount.Po -rm -f ./$(DEPDIR)/finit-pid.Po -rm -f ./$(DEPDIR)/finit-plugin.Po -rm -f ./$(DEPDIR)/finit-runparts.Po -rm -f ./$(DEPDIR)/finit-schedule.Po -rm -f ./$(DEPDIR)/finit-service.Po -rm -f ./$(DEPDIR)/finit-sig.Po -rm -f ./$(DEPDIR)/finit-sm.Po -rm -f ./$(DEPDIR)/finit-stty.Po -rm -f ./$(DEPDIR)/finit-svc.Po -rm -f ./$(DEPDIR)/finit-tty.Po -rm -f ./$(DEPDIR)/finit-util.Po -rm -f ./$(DEPDIR)/finit-utmp-api.Po -rm -f ./$(DEPDIR)/getty-getty.Po -rm -f ./$(DEPDIR)/getty-logrotate.Po -rm -f ./$(DEPDIR)/getty-stty.Po -rm -f ./$(DEPDIR)/getty-utmp-api.Po -rm -f ./$(DEPDIR)/initctl-cgutil.Po -rm -f ./$(DEPDIR)/initctl-client.Po -rm -f ./$(DEPDIR)/initctl-cond.Po -rm -f ./$(DEPDIR)/initctl-initctl.Po -rm -f ./$(DEPDIR)/initctl-reboot.Po -rm -f ./$(DEPDIR)/initctl-serv.Po -rm -f ./$(DEPDIR)/initctl-util.Po -rm -f ./$(DEPDIR)/keventd-iwatch.Po -rm -f ./$(DEPDIR)/keventd-keventd.Po -rm -f ./$(DEPDIR)/keventd-util.Po -rm -f ./$(DEPDIR)/logit-logit.Po -rm -f ./$(DEPDIR)/logit-logrotate.Po -rm -f ./$(DEPDIR)/runparts-runparts.Po -rm -f ./$(DEPDIR)/sulogin-sulogin.Po -rm -f ./$(DEPDIR)/tmpfiles-tmpfiles.Po -rm -f ./$(DEPDIR)/tmpfiles-util.Po -rm -f ./$(DEPDIR)/watchdogd-watchdog.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-finit_pkglibSCRIPTS install-pkgincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-dist_pkglibexecSCRIPTS \ install-pkglibexecPROGRAMS install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/finit-api.Po -rm -f ./$(DEPDIR)/finit-cgroup.Po -rm -f ./$(DEPDIR)/finit-client.Po -rm -f ./$(DEPDIR)/finit-cond-w.Po -rm -f ./$(DEPDIR)/finit-cond.Po -rm -f ./$(DEPDIR)/finit-conf.Po -rm -f ./$(DEPDIR)/finit-devmon.Po -rm -f ./$(DEPDIR)/finit-exec.Po -rm -f ./$(DEPDIR)/finit-finit.Po -rm -f ./$(DEPDIR)/finit-helpers.Po -rm -f ./$(DEPDIR)/finit-iwatch.Po -rm -f ./$(DEPDIR)/finit-log.Po -rm -f ./$(DEPDIR)/finit-logrotate.Po -rm -f ./$(DEPDIR)/finit-mdadm.Po -rm -f ./$(DEPDIR)/finit-mount.Po -rm -f ./$(DEPDIR)/finit-pid.Po -rm -f ./$(DEPDIR)/finit-plugin.Po -rm -f ./$(DEPDIR)/finit-runparts.Po -rm -f ./$(DEPDIR)/finit-schedule.Po -rm -f ./$(DEPDIR)/finit-service.Po -rm -f ./$(DEPDIR)/finit-sig.Po -rm -f ./$(DEPDIR)/finit-sm.Po -rm -f ./$(DEPDIR)/finit-stty.Po -rm -f ./$(DEPDIR)/finit-svc.Po -rm -f ./$(DEPDIR)/finit-tty.Po -rm -f ./$(DEPDIR)/finit-util.Po -rm -f ./$(DEPDIR)/finit-utmp-api.Po -rm -f ./$(DEPDIR)/getty-getty.Po -rm -f ./$(DEPDIR)/getty-logrotate.Po -rm -f ./$(DEPDIR)/getty-stty.Po -rm -f ./$(DEPDIR)/getty-utmp-api.Po -rm -f ./$(DEPDIR)/initctl-cgutil.Po -rm -f ./$(DEPDIR)/initctl-client.Po -rm -f ./$(DEPDIR)/initctl-cond.Po -rm -f ./$(DEPDIR)/initctl-initctl.Po -rm -f ./$(DEPDIR)/initctl-reboot.Po -rm -f ./$(DEPDIR)/initctl-serv.Po -rm -f ./$(DEPDIR)/initctl-util.Po -rm -f ./$(DEPDIR)/keventd-iwatch.Po -rm -f ./$(DEPDIR)/keventd-keventd.Po -rm -f ./$(DEPDIR)/keventd-util.Po -rm -f ./$(DEPDIR)/logit-logit.Po -rm -f ./$(DEPDIR)/logit-logrotate.Po -rm -f ./$(DEPDIR)/runparts-runparts.Po -rm -f ./$(DEPDIR)/sulogin-sulogin.Po -rm -f ./$(DEPDIR)/tmpfiles-tmpfiles.Po -rm -f ./$(DEPDIR)/tmpfiles-util.Po -rm -f ./$(DEPDIR)/watchdogd-watchdog.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_pkglibexecSCRIPTS \ uninstall-finit_pkglibSCRIPTS uninstall-pkgincludeHEADERS \ uninstall-pkglibexecPROGRAMS uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pkglibexecPROGRAMS \ clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_pkglibexecSCRIPTS install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook \ install-finit_pkglibSCRIPTS install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkgincludeHEADERS \ install-pkglibexecPROGRAMS install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-dist_pkglibexecSCRIPTS uninstall-finit_pkglibSCRIPTS \ uninstall-hook uninstall-pkgincludeHEADERS \ uninstall-pkglibexecPROGRAMS uninstall-sbinPROGRAMS .PRECIOUS: Makefile # Hook in install to add finit and reboot symlink(s) install-exec-hook: @for file in $(INIT_LNKS); do \ lnk=$(DESTDIR)$(sbindir)/$$file; \ if [ -e $$lnk ]; then \ echo "Skipping $$lnk exists."; \ else \ $(LN_S) finit $$lnk; \ fi; \ done @for file in $(REBOOT_LNKS); do \ lnk=$(DESTDIR)$(sbindir)/$$file; \ if [ -e $$lnk ]; then \ echo "Skipping $$lnk exists."; \ else \ $(LN_S) initctl $$lnk; \ fi; \ done uninstall-hook: @for file in $(INIT_LNKS); do \ lnk=$(DESTDIR)$(sbindir)/$$file; \ dst=`readlink $$lnk`; \ if [ "$$dst" != "finit" ]; then \ continue; \ fi; \ $(RM) $(DESTDIR)$(sbindir)/$$file; \ done @for file in $(REBOOT_LNKS); do \ lnk=$(DESTDIR)$(sbindir)/$$file; \ dst=`readlink $$lnk`; \ if [ "$$dst" != "initctl" ]; then \ continue; \ fi; \ $(RM) $$lnk; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/src/helpers.c0000644000175100001660000002645715054341541010652 /* Misc. utility functions for finit and its plugins * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include /* isblank() */ #include #include #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "helpers.h" #include "conf.h" #include "log.h" #include "private.h" #include "sig.h" #include "util.h" #include "utmp-api.h" static pstyle_t progress_onoff = PROGRESS_DEFAULT; static pstyle_t progress_style = PROGRESS_DEFAULT; #ifndef HOSTNAME_PATH #define HOSTNAME_PATH "/etc/hostname" #endif /* * Note: the pending status (⋯) must be last item. Also, ⋯ is not * off-by-one, it's a multi-byte character. */ #define STATUS_CLASS { \ CHOOSE(" OK ", " OK ", "\e[1;32m"), /* Green */ \ CHOOSE("FAIL", "FAIL", "\e[1;31m"), /* Red */ \ CHOOSE("WARN", "WARN", "\e[1;33m"), /* Yellow */ \ CHOOSE(" \\/ ", " ⋯ ", "\e[1;33m"), /* Yellow */ \ } #define CHOOSE(x,y,z) x static const char *status1[] = STATUS_CLASS; #undef CHOOSE #define CHOOSE(x,y,z) y static const char *status2[] = STATUS_CLASS; #undef CHOOSE #define CHOOSE(x,y,z) z static const char *color[] = STATUS_CLASS; char *console(void) { return _PATH_CONSOLE; } void console_init(void) { /* Enable line wrap, if disabled previously, e.g., qemu */ dprint(STDOUT_FILENO, "\033[?7h", 5); /* Reset attributes, background and foreground color */ dprint(STDOUT_FILENO, "\033[49m\033[39m\e[2J", 14); log_init(); } ssize_t cprintf(const char *fmt, ...) { const size_t len = strlen(fmt) * 2; char buf[len < 256 ? 256 : len]; size_t size; va_list ap; va_start(ap, fmt); size = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); dprint(STDERR_FILENO, buf, size); return size; } void tabstospaces(char *line) { if (!line) return; for (int i = 0; line[i]; i++) { if (line[i] == '\t') line[i] = ' '; } } char *strip_line(char *line) { char *ptr; /* Trim leading whitespace */ while (*line && isblank(*line)) line++; /* Strip any comment at end of line */ ptr = line; while (*ptr && *ptr != '#') ptr++; *ptr = 0; return line; } void enable_progress(int onoff) { if (onoff) progress_style = progress_onoff; else progress_style = PROGRESS_SILENT; } void show_progress(pstyle_t style) { progress_onoff = style; } /* * Find PRETTY_NAME in /etc/os-release to use as heading at boot * and on runlevel changes. Fallback: "Finit vX.YY" */ char *release_heading(void) { char *name = NULL; char buf[256]; FILE *fp; fp = fopen("/etc/os-release", "r"); if (fp) { while (fgets(buf, sizeof(buf), fp)) { char *ptr = &buf[12]; if (strncmp(buf, "PRETTY_NAME=", 12)) continue; if (*ptr == '"' || *ptr == '\'') { char *end = &ptr[strlen(ptr) - 1]; char q = *ptr; while (end > ptr && isspace(*end)) *end-- = 0; if (*end == q) { *end = 0; ptr++; } } name = strdup(ptr); break; } fclose(fp); } if (!name) name = strdup(PACKAGE_NAME " v" PACKAGE_VERSION); return name; } /* * Return screen length of string, not counting escape chars, and * accounting for unicode characters as only one screen byte wide */ size_t slen(char *string) { unsigned char *buf = (unsigned char *)string; size_t len = 0; while (*buf) { /* Skip ANSI escape sequences */ if (*buf == '\e') { while (*buf && !isalpha(*buf)) buf++; continue; } /* Skip 3-byte unicode */ if (*buf == 0xe2) { for (int cnt = 3; *buf && cnt >= 0; cnt--) buf++; continue; } len++; buf++; } return len; } /* * ch may be an ascii or unicode character */ static char *pad(char *buf, size_t len, char *ch, size_t width) { size_t i = slen(buf); strlcat(buf, " ", len); width -= 8; /* Skip leading '[ STAT ]' */ while (i < width) { strlcat(buf, ch, len); i++; } return buf; } void print_banner(const char *heading) { char buf[4 * ttcols]; if (progress_style == PROGRESS_SILENT) return; buf[0] = 0; strlcat(buf, "\r\e[K", sizeof(buf)); if (progress_style == PROGRESS_CLASSIC) { strlcat(buf, "\e[1m", sizeof(buf)); strlcat(buf, heading, sizeof(buf)); pad(buf, sizeof(buf), "=", ttcols + 10); } else { size_t wmax = 80 <= ttcols ? 80 : ttcols; /* • • • Foo System ═══════════════════════════════════════════════ */ /* ⬤ ⬤ ⬤ Foo System ═══════════════════════════════════════════════ */ /* ⚉ ⚉ ⚉ Foo System ═══════════════════════════════════════════════ */ /* o o o Foo System ═══════════════════════════════════════════════ */ /* ◉ ◉ ◉ Foo System ═══════════════════════════════════════════════ */ /* ⦿⦿⦿ Foo System ═══════════════════════════════════════════════ */ strlcat(buf, "\e[1;31m● \e[1;33m● \e[1;32m● \e[0m\e[1m ", sizeof(buf)); strlcat(buf, heading, sizeof(buf)); /* * Padding with full-width '═' sign from unicode, * we could also use '―' or something else. */ pad(buf, sizeof(buf), "═", wmax); } strlcat(buf, "\e[0m\n", sizeof(buf)); cprintf("%s", buf); } static size_t print_timestamp(char *buf, size_t len) { #if defined(CONFIG_PRINTK_TIME) FILE *fp; float stamp, dummy; fp = fopen("/proc/uptime", "r"); if (!fp) return; fgets(buf, len, fp); fclose(fp); sscanf(buf, "%f %f", &stamp, &dummy); return snprintf(buf, len, "[ %.6f ]", stamp); #else (void)buf; (void)len; return 0; #endif } static char *status(int rc) { static char buf[64]; if (rc < 0 || rc >= (int)NELEMS(status1)) rc = NELEMS(status1) - 1; /* Default to "⋯" (pending) */ if (progress_style == PROGRESS_CLASSIC) { int hl = 1; if (rc == 1 || rc == 2) hl = 7; snprintf(buf, sizeof(buf), "\e[%dm[%s]\e[0m", hl, status1[rc]); } else snprintf(buf, sizeof(buf), "\e[1m[%s%s\e[0m\e[1m]\e[0m ", color[rc], status2[rc]); return buf; } void printv(const char *fmt, va_list ap) { char buf[ttcols]; size_t len; if (!fmt || progress_style == PROGRESS_SILENT) return; delline(); buf[0] = 0; len = print_timestamp(buf, sizeof(buf)); vsnprintf(&buf[len], sizeof(buf) - len, fmt, ap); if (progress_style == PROGRESS_CLASSIC) cprintf("\r%s ", pad(buf, sizeof(buf), ".", sizeof(buf))); else cprintf("\r\e[K%s%s", status(3), buf); } void print(int rc, const char *fmt, ...) { if (progress_style == PROGRESS_SILENT) return; if (fmt) { va_list ap; va_start(ap, fmt); printv(fmt, ap); va_end(ap); } if (rc < 0) return; if (progress_style == PROGRESS_CLASSIC) cprintf("%s\n", status(rc)); else cprintf("\r%s\n", status(rc)); } void print_desc(char *action, char *desc) { print(-1, "%s%s", action ?: "", desc ?: ""); } int print_result(int fail) { print(!!fail, NULL); return fail; } void set_hostname(char **hostname) { FILE *fp; if (rescue) goto done; fp = fopen(HOSTNAME_PATH, "r"); if (fp) { struct stat st; if (fstat(fileno(fp), &st)) { fclose(fp); return; } *hostname = realloc(*hostname, st.st_size); if (!*hostname) { fclose(fp); return; } if (fgets(*hostname, st.st_size, fp)) chomp(*hostname); fclose(fp); } done: if (*hostname) { if (sethostname(*hostname, strlen(*hostname))) err(1, "Failed sethostname(%s)", *hostname); } } /* * Bring up networking, but only if not single-user or rescue mode */ void networking(int updown) { /* No need to report errors if network is already down */ if (!prevlevel && !updown) return; if (updown) dbg("Setting up networking ..."); else dbg("Taking down networking ..."); /* Run user network start script if enabled */ if (updown && network) { run_interactive(network, "Starting networking: %s", network); goto done; } /* Debian/Ubuntu/Busybox/RH/Suse */ if (!whichp("ifup")) goto fallback; if (fexist("/etc/network/interfaces")) { pid_t pid; pid = fork(); if (pid == 0) { const char *cmd; char buf[256]; FILE *pp; int rc; setsid(); sig_unblock(); if (updown) cmd = "ifup -a 2>&1"; else if (whichp("ifquery")) /* Regular ifodwn supports --force but not -f */ cmd = "ifdown -a --force 2>&1"; else /* Busybox ifdown support -f, but not --force */ cmd = "ifdown -a -f 2>&1"; pp = popen(cmd, "r"); if (!pp) _exit(EX_OSERR); while (fgets(buf, sizeof(buf), pp)) logit(LOG_NOTICE, "network: %s", chomp(buf)); rc = pclose(pp); if (rc == -1) _exit(EX_OSERR); _exit(WEXITSTATUS(rc)); } cgroup_service("network", pid, NULL); print(pid > 0 ? 0 : 1, "%s network interfaces ...", updown ? "Bringing up" : "Taking down"); goto done; } fallback: /* Fall back to bring up at least loopback */ ifconfig("lo", "127.0.0.1", "255.0.0.0", updown); done: /* Hooks that rely on loopback, or basic networking being up. */ if (updown) { dbg("Calling all network up hooks ..."); plugin_run_hooks(HOOK_NETWORK_UP); } else { dbg("Calling all network down hooks ..."); plugin_run_hooks(HOOK_NETWORK_DN); } } /* * Very basic, and incomplete, check if we're running in a container. */ int in_container(void) { const char *containers[] = { "lxc", "docker", "kubepod", "unshare", "systemd-nspawn" }; const char *files[] = { "/run/.containerenv", "/.dockerenv" }; static int incont = -1; size_t i; char *c; if (incont > 0) return incont; c = getenv("container"); if (c) { for (i = 0; i < NELEMS(containers); i++) { if (!strcmp(containers[i], c)) return incont = 1; } } for (i = 0; i < NELEMS(files); i++) { if (!access(files[i], F_OK)) return incont = 1; } return 0; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/initctl.h0000644000175100001660000000434415054341541010652 /* New client tool, replaces old /dev/initctl API and telinit tool * * Copyright (c) 2015-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_INITCTL_H_ #define FINIT_INITCTL_H_ #include #include "finit.h" #include "util.h" extern char *finit_conf; extern char *finit_rcsd; extern int icreate; /* initctl -c */ extern int iforce; /* initctl -f */ extern int ionce; /* initctl -1 */ extern int heading; /* initctl -t */ extern int json; /* initctl -j */ extern int noerr; /* initctl -n */ extern int verbose; /* initctl -v */ extern int plain; /* initctl -p */ extern int quiet; /* initctl -q */ #define ERR(rc, fmt, args...) do { if (!quiet) err(rc, fmt, ##args); else exit(rc); } while (0) #define ERRX(rc, fmt, args...) do { if (!quiet) errx(rc, fmt, ##args); else exit(rc); } while (0) #define WARN(fmt, args...) do { if (!quiet) warn(fmt, ##args); } while (0) #define WARNX(fmt, args...) do { if (!quiet) warnx(fmt, ##args); } while (0) extern void print_header(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); #endif /* FINIT_INITCTL_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/cgroup.c0000644000175100001660000002751215054341541010500 /* Finit control group support functions * * Copyright (c) 2019-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #ifdef _LIBITE_LITE # include # include /* BSD sys/queue.h API */ #else # include # include /* BSD sys/queue.h API */ #endif #include #include /* get_nprocs_conf() */ #include "cgroup.h" #include "finit.h" #include "iwatch.h" #include "conf.h" #include "service.h" #include "log.h" #include "util.h" struct cg { TAILQ_ENTRY(cg) link; char *name; /* top-level group name */ char *cfg; /* kernel settings */ int active; /* for mark & sweep */ int is_protected; /* for init/, user/, & system/ */ }; static TAILQ_HEAD(, cg) cgroups = TAILQ_HEAD_INITIALIZER(cgroups); static char controllers[256]; static struct iwatch iw_cgroup; static uev_t cgw; static int avail; static void cgset(const char *path, char *ctrl, char *prop) { char *val; dbg("path %s, ctrl %s, prop %s", path ?: "NIL", ctrl ?: "NIL", prop ?: "NIL"); if (!path || !ctrl) { errx(1, "Missing path or controller, skipping!"); return; } if (!prop) { prop = strchr(ctrl, '.'); if (!prop) { errx(1, "Invalid cgroup ctrl syntax: %s", ctrl); return; } *prop++ = 0; } val = strchr(prop, ':'); if (!val) { errx(1, "Missing cgroup ctrl value, prop %s", prop); return; } *val++ = 0; /* unquote value, if quoted */ if (unquote(&val, NULL)) { errx(1, "Syntax error, unterminated quote in %s/%s.%s=%s", path, ctrl, prop, val); return; } /* disallow sneaky relative paths */ if (strstr(ctrl, "..") || strstr(prop, "..")) { errx(1, "Possible security violation; '..' not allowed in cgroup config!"); return; } dbg("%s/%s.%s <= %s", path, ctrl, prop, val); if (fnwrite(val, "%s/%s.%s", path, ctrl, prop)) err(1, "Failed setting %s/%s.%s = %s", path, ctrl, prop, val); } /* * Settings for a cgroup are on the form: cpu.weight:1234,mem.max:4321,... * Finit supports the short-form 'mem.', replacing it with 'memory.' when * writing the setting to the file system. */ static void group_init(char *path, int leaf, const char *cfg) { char *ptr, *s; dbg("path %s, leaf %d, cfg %s", path, leaf, cfg ?: "NIL"); if (!fisdir(path)) { if (mkdir(path, 0755)) { err(1, "Failed creating cgroup %s", path); return; } /* enable detected controllers on domain groups */ if (!leaf && fnwrite(controllers, "%s/cgroup.subtree_control", path)) err(1, "Failed enabling %s for %s", controllers, path); } if (!cfg || !cfg[0]) return; s = strdupa(cfg); if (!s) { err(1, "Failed activating cgroup cfg for %s", path); return; } dbg("%s <=> %s", path, s); ptr = strtok(s, ","); while (ptr) { dbg("ptr: %s", ptr); if (!strncmp("mem.", ptr, 4)) cgset(path, "memory", &ptr[4]); else cgset(path, ptr, NULL); ptr = strtok(NULL, ","); } } static int cgroup_leaf_init(char *group, char *name, int pid, const char *cfg) { char path[256]; dbg("group %s, name %s, pid %d, cfg %s", group, name, pid, cfg ?: "NIL"); if (pid < 0 || pid == 1) { errno = EINVAL; return 1; } /* create and initialize new group */ snprintf(path, sizeof(path), "/sys/fs/cgroup/%s/%s", group, name); group_init(path, 1, cfg); /* move process to new group */ if (fnwrite(str("%d", pid), "%s/cgroup.procs", path)) err(1, "Failed moving pid %d to group %s", pid, path); strlcat(path, "/cgroup.events", sizeof(path)); return iwatch_add(&iw_cgroup, path, 0); } int cgroup_user(char *name, int pid) { if (!avail) return 0; return cgroup_leaf_init("user", name, pid, NULL); } int cgroup_service(char *name, int pid, struct cgroup *cg) { char *group = "system"; if (!avail) return 0; if (cg && cg->name[0]) { char path[256]; if (!strcmp(cg->name, "root")) return fnwrite(str("%d", pid), FINIT_CGPATH "/cgroup.procs"); if (!strcmp(cg->name, "init")) return fnwrite(str("%d", pid), FINIT_CGPATH "/init/cgroup.procs"); snprintf(path, sizeof(path), "/sys/fs/cgroup/%s", cg->name); if (fisdir(path)) group = cg->name; } return cgroup_leaf_init(group, name, pid, cg ? cg->cfg : NULL); } static void append_ctrl(char *ctrl) { if (controllers[0]) strlcat(controllers, " ", sizeof(controllers)); strlcat(controllers, "+", sizeof(controllers)); strlcat(controllers, ctrl, sizeof(controllers)); } static void cgroup_handle_event(char *event, uint32_t mask) { char path[strlen(event) + 1]; char buf[80]; char *ptr; FILE *fp; dbg("event: '%s', mask: %08x", event, mask); if (!(mask & IN_MODIFY)) return; fp = fopen(event, "r"); if (!fp) { dbg("Failed opening %s, skipping ...", event); return; } while (fgets(buf, sizeof(buf), fp)) { if (strncmp(buf, "populated", 9)) continue; chomp(buf); if (atoi(&buf[10])) break; strlcpy(path, event, sizeof(path)); ptr = strrchr(path, '/'); if (ptr) { *ptr = 0; if (!cgroup_del(path)) { /* * try with parent, top-level group, we * may get events out-of-order *sigh* */ ptr = strrchr(path, '/'); if (!ptr) break; *ptr = 0; cgroup_del(path); } } break; } fclose(fp); } static void cgroup_events_cb(uev_t *w, void *arg, int events) { static char ev_buf[8 *(sizeof(struct inotify_event) + NAME_MAX + 1) + 1]; struct inotify_event *ev; ssize_t sz; size_t off; (void)arg; if (UEV_ERROR == events) { dbg("%s(): inotify socket %d invalid.", __func__, w->fd); return; } sz = read(w->fd, ev_buf, sizeof(ev_buf) - 1); if (sz <= 0) { err(1, "invalid inotify event"); return; } ev_buf[sz] = 0; for (off = 0; off < (size_t)sz; off += sizeof(*ev) + ev->len) { struct iwatch_path *iwp; if (off + sizeof(*ev) > (size_t)sz) break; ev = (struct inotify_event *)&ev_buf[off]; if (off + sizeof(*ev) + ev->len > (size_t)sz) break; if (!ev->mask) continue; /* Find base path for this event */ iwp = iwatch_find_by_wd(&iw_cgroup, ev->wd); if (!iwp || !iwp->path) continue; cgroup_handle_event(iwp->path, ev->mask); } #ifdef AUTO_RELOAD if (conf_any_change()) sm_reload(); #endif } static struct cg *cgroup_find(char *name) { struct cg *cg; TAILQ_FOREACH(cg, &cgroups, link) { if (strcmp(cg->name, name)) continue; return cg; } return NULL; } /* * Marks all unprotected cgroups for deletion (during reload) */ void cgroup_mark_all(void) { struct cg *cg; if (!avail) return; TAILQ_FOREACH(cg, &cgroups, link) { if (cg->is_protected) continue; cg->active = 0; } } /* * Remove (try to) all unused cgroups */ void cgroup_cleanup(void) { struct cg *cg, *tmp; char path[256]; if (!avail) return; TAILQ_FOREACH_SAFE(cg, &cgroups, link, tmp) { if (cg->active) continue; snprintf(path, sizeof(path), FINIT_CGPATH "/%s", cg->name); cgroup_del(path); } } /* * Add, or update, settings for top-level cgroup */ int cgroup_add(char *name, char *cfg, int is_protected) { struct cg *cg; if (!avail) return 0; if (!name) return -1; if (!cfg) cfg = ""; cg = cgroup_find(name); if (!cg) { cg = malloc(sizeof(struct cg)); if (!cg) { err(1, "Failed allocating 'struct cg' for %s", name); return -1; } cg->name = strdup(name); if (!cg->name) { err(1, "Failed setting cgroup name %s", name); free(cg); return -1; } TAILQ_INSERT_TAIL(&cgroups, cg, link); } else free(cg->cfg); cg->cfg = strdup(cfg); if (!cg->cfg) { err(1, "Failed add/update of cgroup %s", name); TAILQ_REMOVE(&cgroups, cg, link); free(cg->name); free(cg); return -1; } cg->is_protected = is_protected; cg->active = 1; return 0; } /* * Remove inactive top-level cgroup */ int cgroup_del(char *dir) { struct cg *cg; char path[256]; if (!avail) return 0; TAILQ_FOREACH(cg, &cgroups, link) { snprintf(path, sizeof(path), FINIT_CGPATH "/%s", cg->name); if (strcmp(path, dir)) continue; if (cg->active) return -1; break; } if (rmdir(dir) && errno != ENOENT) { dbg("Failed removing %s: %s", dir, strerror(errno)); return -1; } if (cg) { TAILQ_REMOVE(&cgroups, cg, link); free(cg->name); free(cg->cfg); free(cg); } return 0; } /* the top-level init cgroup is a leaf, that's ensured in cgroup_init() */ void cgroup_config(void) { struct cg *cg; if (!avail) return; TAILQ_FOREACH(cg, &cgroups, link) { char path[256]; int leaf = 0; if (!cg->active) continue; if (!strcmp(cg->name, "init")) leaf = 1; /* reserved */ snprintf(path, sizeof(path), "%s/%s", FINIT_CGPATH, cg->name); group_init(path, leaf, cg->cfg); strlcat(path, "/cgroup.events", sizeof(path)); iwatch_add(&iw_cgroup, path, 0); } } /* * Called by Finit at early boot to mount initial cgroups */ void cgroup_init(uev_ctx_t *ctx) { int opts = MS_NODEV | MS_NOEXEC | MS_NOSUID; char buf[80]; FILE *fp; int fd; #ifndef CGROUP2_ENABLED avail = 0; return; #endif if (mount("none", FINIT_CGPATH, "cgroup2", opts, NULL)) { if (errno == ENOENT) logit(LOG_INFO, "Kernel does not support cgroups v2, disabling."); else if (errno == EPERM) /* Probably inside an unprivileged container */ logit(LOG_INFO, "Not allowed to mount cgroups v2, disabling."); else err(1, "Failed mounting cgroup v2"); avail = 0; return; } avail = 1; /* Find available controllers */ fp = fopen(FINIT_CGPATH "/cgroup.controllers", "r"); if (!fp) { err(1, "Failed opening %s", FINIT_CGPATH "/cgroup.controllers"); abort: umount(FINIT_CGPATH); avail = 0; return; } if (fgets(buf, sizeof(buf), fp)) { char *cgroup; cgroup = strtok(chomp(buf), "\t "); while (cgroup) { append_ctrl(cgroup); cgroup = strtok(NULL, "\t "); } } fclose(fp); /* Check for cpu controller, abort if missing */ if (!strstr(controllers, "+cpu")) { logit(LOG_NOTICE, "Missing CPU controller, disabling cgroup support."); goto abort; } /* Enable all controllers */ if (fnwrite(controllers, FINIT_CGPATH "/cgroup.subtree_control")) { err(1, "Failed enabling %s for %s", controllers, FINIT_CGPATH "/cgroup.subtree_control"); goto abort; } /* prepare cgroup.events watcher */ fd = iwatch_init(&iw_cgroup); if (fd == -1) goto abort; if (uev_io_init(ctx, &cgw, cgroup_events_cb, NULL, fd, UEV_READ)) { err(1, "Failed setting up cgroup.events watcher"); iwatch_exit(&iw_cgroup); close(fd); goto abort; } /* Default (protected) groups, PID 1, services, and user/login processes */ cgroup_add("init", "cpu.weight:100", 1); cgroup_add("system", "cpu.weight:9800", 1); cgroup_add("user", "cpu.weight:100", 1); cgroup_config(); /* Move ourselves to init (best effort, otherwise run in 'root' group */ if (fnwrite("1", FINIT_CGPATH "/init/cgroup.procs")) { err(1, "Failed moving PID 1 to cgroup %s", FINIT_CGPATH "/init"); uev_io_stop(&cgw); iwatch_exit(&iw_cgroup); close(fd); goto abort; } } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/finit.h0000644000175100001660000001040115054341541010304 /* Finit - Fast /sbin/init replacement w/ I/O, hook & service plugins * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_H_ #define FINIT_H_ #include #include #include #include #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include /* just in case */ #ifndef _PATH_STDPATH #define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" #endif #ifndef _PATH_VARRUN #define _PATH_VARRUN "/var/run/" #endif #ifndef FINIT_CGPATH #define FINIT_CGPATH "/sys/fs/cgroup" #endif /* Prevent users from logging in at critical stages */ #ifndef FINIT_NOLOGIN_PATH #define FINIT_NOLOGIN_PATH _PATH_NOLOGIN #endif /* To use these, include config.h, or define FINIT_EXECPATH_ */ #define _PATH_LOGIT FINIT_EXECPATH_ "/logit" #define _PATH_RUNPARTS FINIT_EXECPATH_ "/runparts" #define _PATH_SULOGIN FINIT_EXECPATH_ "/sulogin" #define _PATH_GETTY FINIT_EXECPATH_ "/getty" #define _PATH_TMPFILES FINIT_EXECPATH_ "/tmpfiles" #define CMD_SIZE 1024 #define LINE_SIZE 1024 #define BUF_SIZE 4096 #define INIT_SOCKET _PATH_VARRUN "finit/socket" #define INIT_MAGIC 0x03091969 #define INIT_LEVEL 10 /* We extend the INIT_CMD_ range for the new initctl tool. */ #define INIT_CMD_START 0 #define INIT_CMD_RUNLVL 1 #define INIT_CMD_POWERFAIL 2 #define INIT_CMD_POWERFAILNOW 3 #define INIT_CMD_POWEROK 4 #define INIT_CMD_BSD 5 #define INIT_CMD_SETENV 6 #define INIT_CMD_UNSETENV 7 /* Finit extensions over std SysV */ #define INIT_CMD_DEBUG 8 /* Toggle Finit debug */ #define INIT_CMD_RELOAD 9 /* Reload *.conf in /etc/finit.d/ */ #define INIT_CMD_START_SVC 10 /* START service */ #define INIT_CMD_STOP_SVC 11 #define INIT_CMD_RELOAD_SVC 12 /* SIGHUP service */ #define INIT_CMD_RESTART_SVC 13 /* START service, clearing blocks */ #define INIT_CMD_GET_PLUGINS 14 /* Fill data[] with loaded plugins */ #define INIT_CMD_PLUGIN_DEPS 15 /* Fill data[] with plugin deps */ #define INIT_CMD_GET_RUNLEVEL 16 #define INIT_CMD_REBOOT 20 #define INIT_CMD_HALT 21 #define INIT_CMD_POWEROFF 22 #define INIT_CMD_SUSPEND 23 #define INIT_CMD_WDOG_HELLO 128 /* Watchdog register and hello */ #define INIT_CMD_SVC_ITER 129 #define INIT_CMD_SVC_QUERY 130 #define INIT_CMD_SVC_FIND 131 #define INIT_CMD_SVC_FIND_BYC 132 #define INIT_CMD_SIGNAL 133 #define INIT_CMD_NACK 254 #define INIT_CMD_ACK 255 /* Traditionally aligned on 384 bytes */ struct init_request { int magic; /* Magic number */ int cmd; /* What kind of request */ int runlevel; /* Runlevel to change to */ int sleeptime; /* Time between TERM and KILL */ char data[368]; }; #endif /* FINIT_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/client.c0000644000175100001660000001067015054341541010454 /* External client API, using UNIX domain socket. * * Copyright (c) 2015-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include #include "client.h" #include "log.h" #define REQUEST_TIMEOUT 15000 static int sd = -1; int client_connect(void) { struct sockaddr_un sun = { .sun_family = AF_UNIX, .sun_path = INIT_SOCKET, }; sd = socket(AF_UNIX, SOCK_SEQPACKET, 0); if (-1 == sd) { warn("Failed creating UNIX domain socket"); return -1; } if (connect(sd, (struct sockaddr*)&sun, sizeof(sun)) == -1) { if (errno != ENOENT) warnx("Failed connecting to finit"); close(sd); sd = -1; } return sd; } int client_disconnect(void) { int rc; if (sd < 0) { errno = EINVAL; return -1; } rc = close(sd); sd = -1; return rc; } /* Only valid after client_connect() */ int client_socket(void) { return sd; } int client_request(struct init_request *rq, ssize_t len) { struct pollfd pfd = { 0 }; int rc; if (client_connect() == -1) return -1; pfd.fd = sd; pfd.events = POLLOUT; if (poll(&pfd, 1, REQUEST_TIMEOUT) <= 0) { warn("Timed out waiting for Finit, errno %d", errno); return -1; } if (write(sd, rq, len) != len) { warn("Failed communicating with Finit, errno %d", errno); return -1; } pfd.fd = sd; pfd.events = POLLIN | POLLERR | POLLHUP; if ((rc = poll(&pfd, 1, REQUEST_TIMEOUT)) <= 0) { if (rc) { if (errno == EINTR) /* shutdown/reboot */ return -1; warn("poll(), errno %d", errno); } else warnx("Timed out waiting for reply from Finit."); return -1; } if (read(sd, rq, len) != len) { warn("Failed reading reply from Finit, errno %d", errno); return -1; } if (rq->cmd == INIT_CMD_NACK) return -1; return 0; } int client_send(struct init_request *rq, ssize_t len) { int rc = 0; if (client_request(rq, len)) rc = 255; client_disconnect(); return rc; } int client_command(int cmd) { struct init_request rq = { .magic = INIT_MAGIC, .runlevel = getpid(), .cmd = cmd, }; return client_request(&rq, sizeof(rq)); } svc_t *client_svc_iterator(int first) { struct init_request rq = { .magic = INIT_MAGIC, .cmd = INIT_CMD_SVC_ITER, }; static svc_t svc; if (client_connect() == -1) return NULL; if (first) rq.runlevel = 1; else rq.runlevel = 0; if (write(sd, &rq, sizeof(rq)) != sizeof(rq)) goto error; if (read(sd, &svc, sizeof(svc)) != sizeof(svc)) goto error; client_disconnect(); if (svc.pid < 0) return NULL; return &svc; error: warn("Failed communicating with finit, error %d", errno); client_disconnect(); sd = -1; return NULL; } static svc_t *do_find(int cmd, const char *arg) { struct init_request rq = { .magic = INIT_MAGIC, .cmd = cmd, }; static svc_t svc; if (client_connect() == -1) return NULL; strlcpy(rq.data, arg, sizeof(rq.data)); if (write(sd, &rq, sizeof(rq)) != sizeof(rq)) goto error; if (read(sd, &svc, sizeof(svc)) != sizeof(svc)) goto error; client_disconnect(); if (svc.pid < 0) return NULL; return &svc; error: client_disconnect(); warn("Failed communicating with finit, error %d", errno); return NULL; } svc_t *client_svc_find(const char *arg) { return do_find(INIT_CMD_SVC_FIND, arg); } svc_t *client_svc_find_by_cond(const char *arg) { return do_find(INIT_CMD_SVC_FIND_BYC, arg); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/reboot.c0000644000175100001660000001203715054341541010467 /* reboot, halt, poweroff, shutdown, suspend for finit * * Copyright (c) 2009-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include "util.h" typedef enum { CMD_UNKNOWN = -1, CMD_REBOOT = 0, CMD_HALT, CMD_POWEROFF, CMD_SUSPEND, } cmd_t; static cmd_t cmd = CMD_UNKNOWN; static char *msg = NULL; /* initctl API */ extern int timeout; extern int do_reboot (char *arg); extern int do_halt (char *arg); extern int do_poweroff(char *arg); extern int do_suspend (char *arg); static void transform(char *nm) { if (!nm) nm = prognm; if (cmd == CMD_UNKNOWN) { if (!strcmp(nm, "halt")) cmd = CMD_HALT; else if (!strcmp(nm, "poweroff") || !strcmp(nm, "shutdown")) cmd = CMD_POWEROFF; else if (!strcmp(nm, "suspend")) cmd = CMD_SUSPEND; else cmd = CMD_REBOOT; } switch (cmd) { case CMD_REBOOT: msg = "reboot"; break; case CMD_HALT: msg = "halt"; break; case CMD_POWEROFF: msg = "power-off"; break; case CMD_SUSPEND: msg = "suspend"; break; case CMD_UNKNOWN: cmd = CMD_REBOOT; msg = "reboot"; break; } } /* * fallback in case of initctl API failure */ static void do_kill(int signo, char *msg) { if (kill(1, signo)) err(1, "Failed signalling init to %s", msg); do_sleep(5); } static int usage(int rc) { fprintf(stderr, "Usage: %s [OPTIONS]\n\n" "Options:\n" " -?, --help This help text\n" " -f, --force Force unsafe %s now, do not contact the init system.\n" " --halt Halt system, regardless of how the command is called.\n" " -h Halt or power off after shutdown.\n" " -P, --poweroff Power-off system, regardless of how the command is called.\n" " -r, --reboot Reboot system, regardless of how the command is called.\n" " -t, --timeout=SEC Force reboot/shutdown after a given timeout\n" "\n", prognm, msg); return rc; } int reboot_main(int argc, char *argv[]) { struct option long_options[] = { {"help", 0, NULL, '?'}, {"force", 0, NULL, 'f'}, {"halt", 0, NULL, 'H'}, {"poweroff", 0, NULL, 'p'}, {"reboot", 0, NULL, 'r'}, {"timeout", 1, NULL, 't'}, {NULL, 0, NULL, 0} }; int c, force = 0; int tmp; /* Initial command taken from program name */ transform(prognm); while ((c = getopt_long(argc, argv, "h?fHPprt:", long_options, NULL)) != EOF) { switch(c) { case '?': return usage(0); case 'f': force = 1; break; case 'H': cmd = CMD_HALT; break; case 'h': case 'P': case 'p': cmd = CMD_POWEROFF; break; case 'r': cmd = CMD_REBOOT; break; case 't': tmp = atoi(optarg); if (tmp < 1) errx(1, "Invalid forced timeout value."); timeout = tmp; break; default: return usage(1); } } /* Check for any overrides */ transform(NULL); /* Check if we're in sulogin shell */ if (getenv("SULOGIN")) force = 1; if (force) { sync(); switch (cmd) { case CMD_REBOOT: c = reboot(RB_AUTOBOOT); break; case CMD_HALT: c = reboot(RB_HALT_SYSTEM); break; case CMD_POWEROFF: c = reboot(RB_POWER_OFF); break; case CMD_SUSPEND: c = suspend(); if (c && errno == EINVAL) errx(1, "Kernel does not support suspend to RAM."); break; case CMD_UNKNOWN: errx(1, "Invalid command"); break; } if (c) err(1, "Failed forced %s", msg); return 0; } switch (cmd) { case CMD_REBOOT: if (do_reboot(NULL)) do_kill(SIGTERM, msg); break; case CMD_HALT: if (do_halt(NULL)) do_kill(SIGUSR2, msg); break; case CMD_POWEROFF: if (do_poweroff(NULL)) do_kill(SIGUSR2, msg); break; case CMD_SUSPEND: /* * Only initctl supports suspend, we avoid adding * another signal to finit for compat reasons. */ do_suspend(NULL); break; case CMD_UNKNOWN: errx(1, "Invalid command"); break; } return 0; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/service.h0000644000175100001660000000455015054341541010643 /* Finit service monitor, task starter and generic API for managing svc_t * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_SERVICE_H_ #define FINIT_SERVICE_H_ #include "svc.h" int service_register (int type, char *line, struct rlimit rlimit[], char *file); void service_unregister (svc_t *svc); void service_runtask_clean (void); void service_update_rdeps (void); void service_mark_unavail (void); void service_ready_script (svc_t *svc); /* XXX: only for pidfile plugin before notify framework */ int service_timeout_after (svc_t *svc, int timeout, void (*cb)(svc_t *svc)); int service_timeout_cancel (svc_t *svc); void service_forked (svc_t *svc); void service_ready (svc_t *svc, int ready); int service_stop (svc_t *svc); int service_step (svc_t *svc); void service_step_all (int types); void service_worker (void *unused); int service_completed (svc_t **svc); void service_notify_reconf (void); void service_init (uev_ctx_t *ctx); #endif /* FINIT_SERVICE_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/devmon.c0000644000175100001660000001377515054341541010477 /* Device node monitor for the Finit condition engine * * Copyright (c) 2022-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include #include "finit.h" #include "cond.h" #include "helpers.h" #include "pid.h" #include "plugin.h" #include "service.h" #include "iwatch.h" static struct iwatch iw_devmon; static uev_t devw; static int fd; struct dev_node { TAILQ_ENTRY(dev_node) link; char *name; size_t refcnt; }; static TAILQ_HEAD(, dev_node) dev_node_list = TAILQ_HEAD_INITIALIZER(dev_node_list); static struct dev_node *find_node(const char *cond) { struct dev_node *node, *tmp; TAILQ_FOREACH_SAFE(node, &dev_node_list, link, tmp) { if (string_compare(node->name, cond)) return node; } return NULL; } static void drop_node(struct dev_node *node) { if (!node) return; node->refcnt--; if (node->refcnt) return; TAILQ_REMOVE(&dev_node_list, node, link); free(node->name); free(node); } void devmon_add_cond(const char *cond) { struct dev_node *node; if (!cond || strncmp(cond, "dev/", 4)) { // dbg("no match %s", cond ?: ""); return; } // dbg("%s", cond); node = find_node(cond); if (node) { node->refcnt++; return; } node = malloc(sizeof(*node)); if (!node) { fail: warn("failed allocating node %s", cond); return; } node->name = strdup(cond); if (!node->name) { free(node); goto fail; } node->refcnt = 1; TAILQ_INSERT_TAIL(&dev_node_list, node, link); } void devmon_del_cond(const char *cond) { if (!cond || strcmp(cond, "dev/")) return; drop_node(find_node(cond)); } static int devmon_add_path(struct iwatch *iw, char *path) { char *ptr; ptr = strstr(path, "dev/"); if (ptr) { char *slash; ptr += 4; slash = strchr(ptr, '/'); if (slash) { ptr = slash++; slash = strchr(ptr, '/'); if (slash) { dbg("Path too deep, skipping."); return -1; } } } return iwatch_add1(iw, path, IN_CREATE | IN_DELETE); } static void devmon_update_conds(char *dir, char *name, uint32_t mask) { char fn[PATH_MAX]; char *cond; paste(fn, sizeof(fn), dir, name); cond = &fn[1]; // dbg("path: %s, mask: %08x, cond: %s", fn, mask, cond); if (!find_node(cond)) { // dbg("unregistered, skipping %s", cond); return; } if (mask & IN_CREATE) cond_set(cond); else if (mask & IN_DELETE) cond_clear(cond); } /* synthesize events in case of new run dirs */ static void devmon_scandir(struct iwatch *iw, char *dir, int len) { char path[len + 6]; glob_t gl; size_t i; int rc; (void)iw; snprintf(path, sizeof(path), "%s/*", dir); rc = glob(path, GLOB_NOSORT, NULL, &gl); if (rc && rc != GLOB_NOMATCH) return; for (i = 0; i < gl.gl_pathc; i++) { // dbg("scan found %s", gl.gl_pathv[i]); devmon_update_conds(dir, gl.gl_pathv[i], IN_CREATE); } globfree(&gl); } /* * create/remove sub-directory in monitored directory */ static void devmon_handle_dir(struct iwatch *iw, char *dir, char *name, int mask) { char path[strlen(dir) + strlen(name) + 2]; struct iwatch_path *iwp; paste(path, sizeof(path), dir, name); dbg("path: %s", path); iwp = iwatch_find_by_path(iw, path); if (mask & IN_CREATE) { if (!iwp) { if (!devmon_add_path(iw, path)) devmon_scandir(iw, path, sizeof(path)); } } else if (mask & IN_DELETE) { if (iwp) iwatch_del(&iw_devmon, iwp); } } static void devmon_cb(uev_t *w, void *arg, int events) { static char ev_buf[8 *(sizeof(struct inotify_event) + NAME_MAX + 1) + 1]; struct inotify_event *ev; ssize_t sz; size_t off; (void)arg; if (UEV_ERROR == events) { errx(1, "Unrecoverable error in devmon watcher"); return; } sz = read(w->fd, ev_buf, sizeof(ev_buf) - 1); if (sz <= 0) { err(1, "invalid inotify event"); return; } ev_buf[sz] = 0; for (off = 0; off < (size_t)sz; off += sizeof(*ev) + ev->len) { struct iwatch_path *iwp; if (off + sizeof(*ev) > (size_t)sz) break; ev = (struct inotify_event *)&ev_buf[off]; if (off + sizeof(*ev) + ev->len > (size_t)sz) break; if (!ev->mask) continue; /* Find base path for this event */ iwp = iwatch_find_by_wd(&iw_devmon, ev->wd); if (!iwp) continue; if (ev->mask & IN_ISDIR) { devmon_handle_dir(&iw_devmon, iwp->path, ev->name, ev->mask); continue; } // dbg("Got %s", ev->name); if (ev->mask & (IN_CREATE | IN_DELETE)) devmon_update_conds(iwp->path, ev->name, ev->mask); } } void devmon_init(uev_ctx_t *ctx) { char dir[MAX_ARG_LEN]; fd = iwatch_init(&iw_devmon); if (fd < 0) return; if (mkpath(pid_runpath(_PATH_CONDDEV, dir, sizeof(dir)), 0755) && errno != EEXIST) { err(1, "Failed creating %s condition directory, %s", COND_DEV, _PATH_CONDDEV); return; } if (uev_io_init(ctx, &devw, devmon_cb, NULL, fd, UEV_READ)) { err(1, "Failed setting up I/O callback for /dev watcher"); close(fd); return; } strlcpy(dir, _PATH_DEV, sizeof(dir)); if (devmon_add_path(&iw_devmon, dir)) iwatch_exit(&iw_devmon); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/util.h0000644000175100001660000001376515054341541010170 /* Misc. shared utility functions for initctl, reboot and finit * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_UTIL_H_ #define FINIT_UTIL_H_ #include "config.h" #include #ifdef HAVE_TERMIOS_H #include #include #include #include #endif #ifndef RB_SW_SUSPEND /* Since Linux 2.5.18, but not in GLIBC until 2.19 */ #define RB_SW_SUSPEND 0xd000fce2 #endif extern int debug; /* defined in finit or initctl */ extern int ttrows; extern int ttcols; extern char *prognm; /* Define for printheader() from conio.h, used in initctl */ #ifndef SCREEN_WIDTH #define SCREEN_WIDTH ttcols #endif #ifdef _LIBITE_LITE # include # include #else # include # include #endif #include "log.h" char *progname (char *arg0); const char *basenm (const char *path); char *str (char *fmt, ...) __attribute__ ((format (printf, 1, 2))); int getuser (char *username, char **home); int getgroup (char *group); int getcuser (char *buf, size_t len); int getcgroup (char *buf, size_t len); int mksubsys (const char *dir, mode_t mode, char *user, char *group); int fnread (char *buf, size_t len, char *fmt, ...) __attribute__ ((format (printf, 3, 4))); int fnwrite (char *value, char *fmt, ...) __attribute__ ((format (printf, 2, 3))); int fngetint (char *path, int *val); int suspend (void); int strtobytes (char *arg); char *sig2str (int sig); int str2sig (char *sig); char *code2str (int code); void do_sleep (unsigned int sec); void do_usleep (unsigned int usec); long jiffies (void); char *uptime (long secs, char *buf, size_t len); char *memsz (uint64_t sz, char *buf, size_t len); char *sanitize (char *arg, size_t len); void de_dotdot (char *file); int ismnt (char *file, char *dir, char *mode); int fismnt (char *dir); int fistmpfs (char *dir); #ifdef HAVE_TERMIOS_H int ttinit (void); int ttraw (void); int ttcooked (void); #else #define ttinit() ttcols #define ttraw() 0 #define ttcooked() 0 #endif /* * Defaults to user "root" and group "wheel" (root) if: * 1) the user is missing * 2) the group or the file /etc/group is missing */ static inline int create(char *path, mode_t mode, char *user, char *group) { int fd, uid, gid; if (!path) { errno = EINVAL; return -1; } uid = getuser(user, NULL); if (uid < 0) uid = 0; gid = getgroup(group); if (gid < 0) gid = 0; fd = creat(path, mode); if (fd == -1) { warn("Failed creating %s properly", path); return -1; } close(fd); if (chown(path, uid, gid)) { warn("Failed chowning %s properly", path); return -1; } return 0; } static inline int ln(const char *target, const char *linkpath) { if (!target || !linkpath) { errno = EINVAL; return -1; } if (symlink(target, linkpath)) { if (errno != EEXIST) warn("Failed creating %s -> %s symlink", target, linkpath); return -1; } return 0; } static inline char *strterm(char *str, size_t len) { str[len - 1] = 0; return str; } /* paste dir/file into buf */ static inline int paste(char *buf, size_t len, const char *dir, const char *file) { if (!dir) dir = ""; if (!file) file = ""; return snprintf(buf, len, "%s%s%s", dir, fisslashdir(dir) ? "" : file[0] == '/' ? "" : "/", file); } /* ensure path has suffix */ static inline int suffix(char *path, size_t len, const char *sfx) { size_t slen = strlen(sfx); size_t plen = strlen(path); if (plen < slen) slen = strlcat(path, sfx, len); else { plen -= slen; if (strcmp(&path[plen], sfx)) slen = strlcat(path, sfx, len); } if (slen >= len) return -1; return 0; } static inline void hexdump(const char *buf, size_t len) { size_t i, j; for (i = 0; i < len; i += 16) { printf("%08zx ", i); for (j = 0; j < 8 && i + j < len; j++) printf("%02x ", buf[i + j]); if (j == 8) { printf(" "); } else { for (; j < 8; j++) printf(" "); printf(" "); } for (j = 8; j < 16 && i + j < len; j++) printf("%02x ", buf[i + j]); for (; j < 16; j++) printf(" "); printf(" |"); for (j = 0; j < 16 && i + j < len; j++) { char c = buf[i + j]; printf("%c", isprint(c) ? c : '.'); } printf("|\n"); } } /* drop quotes from a string at point, if any */ static inline int unquote(char **str, char *end) { char *ptr = *str; /* unquote value, if quoted */ if (ptr[0] == '"' || ptr[0] == '\'') { char q = ptr[0]; if (!end && !(end = strchr(&ptr[1], q))) return -1; if (*end == q) { *str = &ptr[1]; *end = 0; } } return 0; } #endif /* FINIT_UTIL_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/tty.h0000644000175100001660000000346415054341541010026 /* Finit TTY handling * * Copyright (c) 2013 Mattias Walström * Copyright (c) 2013-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_TTY_H_ #define FINIT_TTY_H_ #include #include "svc.h" struct tty { char *cmd; char *args[MAX_NUM_SVC_ARGS]; size_t num; char *dev; char *baud; char *term; char noclear; char nowait; char nologin; char notty; char rescue; }; char *tty_canonicalize (char *dev); int tty_isatcon (char *dev); char *tty_atcon (void); int tty_parse_args (struct tty *tty, char *cmd, char **args); int tty_exists (char *dev); int tty_exec (svc_t *tty); #endif /* FINIT_TTY_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/plugin.h0000644000175100001660000001324115054341541010476 /* Plugin based services architecture for finit * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_PLUGIN_H_ #define FINIT_PLUGIN_H_ #include #ifdef _LIBITE_LITE # include /* BSD sys/queue.h API */ #else # include /* BSD sys/queue.h API */ #endif #include "svc.h" #define PLUGIN_DEP_MAX 10 /* * Event flags for I/O plugins */ #define PLUGIN_IO_ERROR UEV_ERROR #define PLUGIN_IO_READ UEV_READ #define PLUGIN_IO_WRITE UEV_WRITE #define PLUGIN_IO_PRI UEV_PRI #define PLUGIN_IO_HUP UEV_HUP #define PLUGIN_IO_RDHUP UEV_RDHUP #define PLUGIN_INIT(x) static void __attribute__ ((constructor)) x(void) #define PLUGIN_EXIT(x) static void __attribute__ ((destructor)) x(void) #define PLUGIN_ITERATOR(x, tmp) TAILQ_FOREACH_SAFE(x, &plugins, link, tmp) /* * Predefined hook points and corresponding conditions in Finit, * for use by plugins and scripts. Recommended to use the task * or run stanzas: task /bin/rescue.sh * * Some of the below hooks cannot (currently) be realized as conditions. * The idea was to rename them action scripts, with optional argument, * according to the following scheme: * * - HOOK_SVC_RECONF :: action/svc/reconf * - HOOK_RUNLEVEL_CHANGE :: action/sys/runlevel * * However, the implementation did not turn out to be stable enough for * general release, so it was pulled. */ #define HOOK_TYPES { \ /* Bootstrap hooks, runlevel [S] */ \ CHOOSE(HOOK_BANNER = 0, "hook/sys/banner"), \ CHOOSE(HOOK_ROOTFS_UP, "hook/mount/root"), \ CHOOSE(HOOK_MOUNT_ERROR, "hook/mount/error"), \ CHOOSE(HOOK_MOUNT_POST, "hook/mount/post"), \ CHOOSE(HOOK_BASEFS_UP, "hook/mount/all"), \ CHOOSE(HOOK_SVC_PLUGIN, "hook/svc/plugin"), \ CHOOSE(HOOK_NETWORK_UP, "hook/net/up"), \ CHOOSE(HOOK_SVC_UP, "hook/svc/up"), \ CHOOSE(HOOK_SYSTEM_UP, "hook/sys/up"), \ \ /* Runtime hooks, runlevel [S1-9] */ \ CHOOSE(HOOK_SVC_RECONF, "nop"), \ CHOOSE(HOOK_RUNLEVEL_CHANGE, "nop"), \ \ /* Shutdown hooks, runlevel [06] */ \ CHOOSE(HOOK_NETWORK_DN, "hook/net/down"), \ CHOOSE(HOOK_SHUTDOWN, "hook/sys/shutdown"), \ CHOOSE(HOOK_SVC_DN, "hook/svc/down"), \ CHOOSE(HOOK_SYS_DN, "hook/sys/down"), \ CHOOSE(HOOK_MAX_NUM, "nop") \ } #define CHOOSE(x, y) x typedef enum HOOK_TYPES hook_point_t; #undef CHOOSE /** * plugin_t - Finit &plugin_t object * @link: BSD sys/queue.h linked list node * @name: Plugin name, or identifier to match against a &svc_t object * @svc: Service callback for a loaded &svc_t object * @hook: Hook callback definitions * @io: I/O hook callback * * To setup an &svc_t object callback for a service monitor the @name * must match the @svc_t @cmd exactly for them to "pair". * * A &plugin_t object may contain a service callback, several hooks * and/or an I/O callback as well. This way all critical extensions * to finit can fit in one single plugin, if needed. * * The "dynamic events" discussed in the svc callback is for external * service plugins to implement. However, it can be anything that * can cause a service to need to SIGHUP at runtime. E.g., acquiring * a DHCP lease, or an interface going UP/DOWN. The event itself can * be passed as an integer @event and any optional argument @event_arg * * It is up to the external service plugin to track these events and * relay them to each @dynamic service plugins' callback. I.e., to * all those with the dynamic flag set. */ typedef struct plugin { /* BSD sys/queue.h linked list node. */ TAILQ_ENTRY(plugin) link; /* Handle to be sent to dlclose() when plugins is unloaded. */ void *handle; /* Event loop handler, used internally by Finit */ uev_t watcher; /* Plugin name, defaults to basename of plugin path if unset. */ char *name; /* List of hook callbacks. */ struct { void *arg; /* Optional argument to callback func. */ void (*cb)(void *arg); } hook[HOOK_MAX_NUM]; /* I/O Plugin */ struct { int fd, flags; /* 1:READ, 2:WRITE */ void *arg; void (*cb)(void *arg, int fd, int events); } io; char *depends[PLUGIN_DEP_MAX]; /* List of other .name's this depends on. */ } plugin_t; /* Public plugin API */ int plugin_io_init (plugin_t *plugin); int plugin_list (char *buf, size_t len); int plugin_deps (char *buf, size_t len); int plugin_register (plugin_t *plugin); int plugin_unregister (plugin_t *plugin); /* Helper API */ plugin_t *plugin_find (char *name); #endif /* FINIT_PLUGIN_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/cgutil.c0000644000175100001660000003254415054341541010471 /* New client tool, replaces old /dev/initctl API and telinit tool * * Copyright (c) 2019-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include /* sysinfo() */ #include "cgutil.h" #include "initctl.h" #include "log.h" #define CDIM plain ? "" : "\e[2m" #define CRST plain ? "" : "\e[0m" #define NONE " " #define PIPE plain ? "| " : "│ " #define FORK plain ? "|-" : "├─" #define END plain ? "`-" : "└─" uint64_t total_ram; /* From sysinfo() */ struct cg dummy; /* empty result "NULL" */ struct cg *list; int cgroup_avail(void) { return fismnt(FINIT_CGPATH); } static size_t flen(FILE *fp) { size_t total = 0, sz; char buf[512]; while ((sz = fread(buf, 1, sizeof(buf), fp)) > 0) total += sz; rewind(fp); return total; } char *pid_cmdline(int pid) { size_t i, len; char *buf; FILE *fp; fp = fopenf("r", "/proc/%d/cmdline", pid); if (!fp) return strdup(""); /* regular process */ len = flen(fp); if (len == 0) { fail: fclose(fp); return NULL; /* kernel thread */ } buf = calloc(len + 1, 1); if (!buf) goto fail; if (fread(buf, 1, len, fp) < len) { free(buf); goto fail; } /* replace all NUL chars with space */ for (i = 0; i < len; i++) { if (buf[i] == '\0') buf[i] = ' '; } return buf; } char *pid_cgroup(int pid) { char *buf, *ptr = NULL; size_t len; FILE *fp; fp = fopenf("r", "/proc/%d/cgroup", pid); if (!fp) return NULL; len = flen(fp); if (len == 0) { fclose(fp); return NULL; } len++; buf = calloc(1, len); if (!buf) { fclose(fp); return NULL; } if (fgets(buf, len, fp)) ptr = chomp(buf); fclose(fp); if (ptr) { ptr = strchr(ptr, '/'); if (ptr) { memmove(buf, ptr, strlen(ptr) + 1); return buf; } } free(buf); return NULL; } static char *cgroup_val(char *path, char *file, char *buf, size_t len) { char *val = NULL; FILE *fp; fp = fopenf("r", "%s/%s", path, file); if (fp) { if (fgets(buf, len, fp)) { val = chomp(buf); len = strcspn(val, " \t"); val[len] = 0; } fclose(fp); } return val; } static uint64_t cgroup_uint64(char *path, char *file) { uint64_t val = 0; char buf[42]; if (cgroup_val(path, file, buf, sizeof(buf))) val = strtoull(buf, NULL, 10); return val; } static char *cgroup_memval(char *path, char *file, char *buf, size_t len) { char data[42]; if (cgroup_val(path, file, data, sizeof(data))) { if (!strcmp(data, "max")) strlcpy(buf, data, len); else memsz(strtoull(data, NULL, 10), buf, len); } else buf[0] = 0; return buf; } static uint64_t cgroup_memuse(struct cg *cg) { char buf[42]; FILE *fp; fp = fopenf("r", "%s/memory.stat", cg->cg_path); if (fp) { cg->cg_rss = 0; cg->cg_vmlib = 0; while (fgets(buf, sizeof(buf), fp)) { chomp(buf); if (!strncmp(buf, "anon", 4)) { cg->cg_rss += strtoull(&buf[5], NULL, 10); continue; } if (!strncmp(buf, "slab", 4)) { cg->cg_rss += strtoull(&buf[5], NULL, 10); continue; } if (!strncmp(buf, "kernel_stack", 12)) { cg->cg_rss += strtoull(&buf[5], NULL, 10); continue; } if (!strncmp(buf, "pagetables", 10)) { cg->cg_rss += strtoull(&buf[5], NULL, 10); continue; } if (!strncmp(buf, "percpu", 6)) { cg->cg_rss += strtoull(&buf[5], NULL, 10); continue; } if (!strncmp(buf, "sock", 4)) { cg->cg_rss += strtoull(&buf[5], NULL, 10); continue; } if (!strncmp(buf, "file", 4)) { cg->cg_vmlib += strtoull(&buf[5], NULL, 10); continue; } if (!strncmp(buf, "file_mapped", 11)) { cg->cg_vmlib += strtoull(&buf[5], NULL, 10); continue; } } fclose(fp); } cg->cg_memshare = (float)(cg->cg_rss * 100 / total_ram); return cg->cg_vmsize = cgroup_uint64(cg->cg_path, "memory.current"); } uint64_t cgroup_memory(char *group) { char path[256]; paste(path, sizeof(path), FINIT_CGPATH, group); return cgroup_uint64(path, "memory.current"); } static float cgroup_cpuload(struct cg *cg) { char fn[256]; char buf[64]; FILE *fp; snprintf(fn, sizeof(fn), "%s/cpu.stat", cg->cg_path); fp = fopen(fn, "r"); if (!fp) ERR(72, "Cannot open %s", fn); while (fgets(buf, sizeof(buf), fp)) { uint64_t curr; chomp(buf); if (strncmp(buf, "usage_usec", 10)) continue; curr = strtoull(&buf[11], NULL, 10); if (cg->cg_prev != 0) { uint64_t diff = curr - cg->cg_prev; /* this expects 1 sec poll interval */ cg->cg_load = (float)(diff / 1000000); cg->cg_load *= 100.0; } cg->cg_prev = curr; break; } fclose(fp); return cg->cg_load; } static struct cg *append(char *path) { struct cg *cg; char fn[256]; ENTRY item; snprintf(fn, sizeof(fn), "%s/cpu.stat", path); if (access(fn, F_OK)) { /* older kernels, 4.19, don't have summary cpu.stat in root */ if (strcmp(path, FINIT_CGPATH)) WARN("not a cgroup path with cpu controller, %s", path); return NULL; } cg = calloc(1, sizeof(struct cg)); if (!cg) ERR(71, "failed allocating struct cg"); cg->cg_path = strdup(path); if (list) cg->cg_next = list; list = cg; item.key = cg->cg_path; item.data = cg; if (!hsearch(item, ENTER)) ERR(70, "failed adding to hash table"); return cg; } static struct cg *find(char *path) { ENTRY *ep, item = { path, NULL }; ep = hsearch(item, FIND); if (ep) return ep->data; return append(path); } /* update stats */ struct cg *cg_stats(char *path) { struct cg *cg; cg = find(path); if (!cg) return &dummy; cgroup_cpuload(cg); cgroup_memuse(cg); return cg; } /* query config */ struct cg *cg_conf(char *path) { static struct cg cg; cgroup_val(path, "memory.min", cg.cg_mem.min, sizeof(cg.cg_mem.min)); cgroup_memval(path, "memory.max", cg.cg_mem.max, sizeof(cg.cg_mem.max)); cgroup_val(path, "cpu.weight", cg.cg_cpu.weight, sizeof(cg.cg_cpu.weight)); cgroup_val(path, "cpu.max", cg.cg_cpu.max, sizeof(cg.cg_cpu.max)); cgroup_val(path, "cpuset.cpus.effective", cg.cg_cpu.set, sizeof(cg.cg_cpu.set)); cg.cg_vmsize = cgroup_uint64(path, "memory.current"); return &cg; } static int cgroup_filter(const struct dirent *entry) { /* Skip current dir ".", and prev dir "..", from list of files */ if ((1 == strlen(entry->d_name) && entry->d_name[0] == '.') || (2 == strlen(entry->d_name) && !strcmp(entry->d_name, ".."))) return 0; if (entry->d_name[0] == '.') return 0; if (entry->d_type != DT_DIR) return 0; return 1; } int cgroup_tree(char *path, char *pfx, int mode, int pos) { struct dirent **namelist = NULL; char s[32], r[32], l[32]; char row[ttcols + 9]; /* + control codes */ size_t rlen = sizeof(row) - 1; size_t rplen = rlen - 9; struct stat st; struct cg *cg; char buf[512]; int rc = 0; FILE *fp; int i, n; int num; if (pos >= ttrows) return 0; if (-1 == lstat(path, &st)) return 1; if ((st.st_mode & S_IFMT) != S_IFDIR) { errno = ENOTDIR; return -1; } fp = fopenf("r", "%s/cgroup.procs", path); if (!fp) return -1; num = 0; while (fgets(buf, sizeof(buf), fp)) num++; if (!pfx) { pfx = ""; switch (mode) { case 1: cg = cg_stats(path); snprintf(row, rplen, "\r %6.6s %6.6s %6.6s %5.1f %5.1f %s", memsz(cg->cg_vmsize, s, sizeof(s)), memsz(cg->cg_rss, r, sizeof(r)), memsz(cg->cg_vmlib, l, sizeof(l)), cg->cg_memshare, cg->cg_load, path); break; case 2: cg = cg_conf(path); snprintf(row, rplen, "\r%6.6s [%-6.6s%6.6s] %6s [%-6.6s%6.6s] %s", memsz(cg->cg_vmsize, s, sizeof(s)), cg->cg_mem.min, cg->cg_mem.max, cg->cg_cpu.set, cg->cg_cpu.weight, cg->cg_cpu.max, path); break; default: strlcpy(row, "\r", rplen); strlcat(row, path, rplen); break; } puts(row); } if (num > 0) { rewind(fp); i = 0; while (fgets(buf, sizeof(buf), fp)) { char *cmdline; pid_t pid; pid = atoi(chomp(buf)); if (pid <= 0) continue; /* skip kernel threads for now (no cmdline) */ cmdline = pid_cmdline(pid); if (cmdline) { char proc[ttcols]; switch (mode) { case 1: snprintf(row, rplen, "\r%37s", " "); break; case 2: snprintf(row, rplen, "\r --.-- [ ] [ ] "); break; default: strlcpy(row, "\r", rplen); break; } strlcat(row, pfx, rplen); strlcat(row, ++i == num ? END : FORK, rlen); snprintf(proc, sizeof(proc), " %d %s", pid, cmdline); if (plain) { strlcat(row, proc, rplen); } else { int len; strlcat(row, CDIM, rlen); strlcat(row, proc, rlen); len = strlen(row) + strlen(CRST); if (len > (int)rlen) row[rlen - strlen(CRST)] = 0; strlcat(row, CRST, sizeof(row)); } puts(row); free(cmdline); } if (mode == 1) { pos += i; if (pos >= ttrows) break; } } } fclose(fp); n = scandir(path, &namelist, cgroup_filter, alphasort); if (n > 0) { for (i = 0; i < n; i++) { char *nm = namelist[i]->d_name; char prefix[80]; snprintf(buf, sizeof(buf), "%s/%s", path, nm); switch (mode) { case 1: cg = cg_stats(buf); snprintf(row, rplen, "\r %6.6s %6.6s %6.6s %5.1f %5.1f ", memsz(cg->cg_vmsize, s, sizeof(s)), memsz(cg->cg_rss, r, sizeof(r)), memsz(cg->cg_vmlib, l, sizeof(l)), cg->cg_memshare, cg->cg_load); break; case 2: cg = cg_conf(buf); snprintf(row, rplen, "\r%6.6s [%-6.6s%6.6s] %6.6s [%-6.6s%6.6s] ", memsz(cg->cg_vmsize, s, sizeof(s)), cg->cg_mem.min, cg->cg_mem.max, cg->cg_cpu.set, cg->cg_cpu.weight, cg->cg_cpu.max); break; default: strlcpy(row, "\r", rplen); break; } strlcat(row, pfx, rplen); if (i + 1 == n) { strlcat(row, END, rplen); snprintf(prefix, sizeof(prefix), "%s ", pfx); } else { strlcat(row, FORK, rplen); snprintf(prefix, sizeof(prefix), "%s%s ", pfx, PIPE); } strlcat(row, " ", rplen); strlcat(row, nm, rplen); strlcat(row, "/ ", rplen); puts(row); rc += cgroup_tree(buf, prefix, mode, pos + i); free(namelist[i]); } free(namelist); } return rc; } int show_cgps(char *arg) { char path[512]; if (!arg) arg = FINIT_CGPATH; else if (arg[0] != '/') { paste(path, sizeof(path), FINIT_CGPATH, arg); arg = path; } return cgroup_tree(arg, NULL, 0, 0); } static void cgtop(uev_t *w, void *arg, int events) { (void)w; (void)events; fputs("\e[2J\e[1;1H", stdout); if (heading) print_header(" VmSIZE RSS VmLIB %%MEM %%CPU GROUP"); cgroup_tree(arg, NULL, 1, 0); } static void cleanup(void) { ttcooked(); showcursor(); puts(""); } static void leave(uev_t *w, void *arg, int events) { (void)arg; (void)events; uev_exit(w->ctx); } static void key(uev_t *w, void *arg, int events) { char ch; (void)arg; (void)events; if (read(w->fd, &ch, sizeof(ch)) != -1) { switch (ch) { case 'q': uev_exit(w->ctx); break; default: dbg("Got char 0x%02x", ch); break; } } } int show_cgtop(char *arg) { struct sysinfo si = { 0 }; uev_t timer, input, sigint, sigterm, sigquit; char path[512]; uev_ctx_t ctx; if (!arg) arg = FINIT_CGPATH; else if (arg[0] != '/') { paste(path, sizeof(path), FINIT_CGPATH, arg); arg = path; } if (!hcreate(ttrows + 25)) ERR(70, "failed creating hash table"); sysinfo(&si); total_ram = si.totalram * si.mem_unit; uev_init(&ctx); uev_timer_init(&ctx, &timer, cgtop, arg, 1, ionce ? 0 : 1000); if (!ionce && !plain) { int flags; atexit(cleanup); ttraw(); hidecursor(); flags = fcntl(STDIN_FILENO, F_GETFL); if (flags != -1) (void)fcntl(STDIN_FILENO, F_SETFL, flags | O_NONBLOCK); (void)uev_io_init(&ctx, &input, key, NULL, STDIN_FILENO, UEV_READ); (void)uev_signal_init(&ctx, &sigint, leave, NULL, SIGINT); (void)uev_signal_init(&ctx, &sigterm, leave, NULL, SIGTERM); (void)uev_signal_init(&ctx, &sigquit, leave, NULL, SIGQUIT); } return uev_run(&ctx, 0); } int show_cgroup(char *arg) { char path[512]; if (!arg) arg = FINIT_CGPATH; else if (arg[0] != '/') { paste(path, sizeof(path), FINIT_CGPATH, arg); arg = path; } /* memory.current memory.min memory.max cpuset.cpus cpu.weight cpu.max */ if (heading) print_header(" MEM [MIN MAX] CPU [WEIGHT MAX] GROUP"); return cgroup_tree(arg, NULL, 2, 0); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/runparts.c0000644000175100001660000001132315054341541011050 #include /* isdigit() */ #include #include #include #include #include #include #include #include #include #ifdef _LIBITE_LITE # include # include #else # include # include #endif #include "log.h" #include "sig.h" #include "util.h" #ifdef __FINIT__ #include "helpers.h" #else #include const char *active_msg = NULL; int interactive = 1; int debug; static void print_desc(const char *prefix, const char *msg) { if (interactive) fprintf(stderr, "\e[1m[\e[0m\e[1;33m ⋯ \e[0m\e[1m]\e[0m %s %s", prefix, msg); else fprintf(stderr, "%s %s ...\n", prefix, msg); active_msg = msg; } static void print_result(int rc) { if (interactive) { if (rc) fputs("\r\e[1m[\e[0m\e[1;31mFAIL\e[0m\e[1m]\e[0m\n", stderr); else fputs("\r\e[1m[\e[0m\e[1;32m OK \e[0m\e[1m]\e[0m\n", stderr); } else fprintf(stderr, "[%s] %s\n", rc ? "FAIL" : " OK ", active_msg ?: ""); } void sig_unblock(void) { struct sigaction sa; sigset_t nmask; int i; sigemptyset(&nmask); sigaddset(&nmask, SIGHUP); sigaddset(&nmask, SIGCHLD); sigaddset(&nmask, SIGINT); sigaddset(&nmask, SIGPWR); sigaddset(&nmask, SIGSTOP); sigaddset(&nmask, SIGTSTP); sigaddset(&nmask, SIGCONT); sigaddset(&nmask, SIGTERM); sigaddset(&nmask, SIGUSR1); sigaddset(&nmask, SIGUSR2); sigprocmask(SIG_UNBLOCK, &nmask, NULL); /* Reset signal handlers that were set by the parent process */ for (i = 1; i < NSIG; i++) DFLSIG(sa, i, 0); } #endif /* __FINIT__ */ static void run_env(const char *env[]) { size_t i = 0; if (!env) return; while (env[i]) { size_t j = i + 1; if (!env[j]) break; setenv(env[i], env[j], 1); i += 2; } } int run_parts(char *dir, char *cmd, const char *env[], int progress, int sysv) { size_t cmdlen = cmd ? strlen(cmd) : strlen("start"); struct dirent **d; int i, num; int rc = 0; num = scandir(dir, &d, NULL, alphasort); if (num < 0) { dbg("No files found in %s, skipping ...", dir); return -1; } for (i = 0; i < num; i++) { char path[strlen(dir) + strlen(d[i]->d_name) + 3 + cmdlen]; const char *name = d[i]->d_name; char *argv[4] = { "sh", "-c", path, NULL }; struct stat st; int result = 0; pid_t pid = 0; int status; /* skip backup files */ if (name[strlen(name) - 1] == '~') continue; /* cannot rely on d_type, not supported on all filesystems */ paste(path, sizeof(path), dir, name); if (stat(path, &st)) { warn("failed stat(%s)", path); continue; } /* skip non-executable files and directories */ if (!S_ISEXEC(st.st_mode) || S_ISDIR(st.st_mode)) { dbg("skipping %s not an executable or is a directory", path); continue; } if (sysv && name[0] != 'S' && name[0] != 'K') { dbg("S-only flag set, skipping non-SysV script: %s", name); continue; } /* If the callee didn't supply a run_parts() argument */ if (!cmd) { /* Check if Sservice or Kservice notation is used */ if (name[0] == 'S' && isdigit(name[1])) strlcat(path, " start", sizeof(path)); else if (name[0] == 'K' && isdigit(name[1])) strlcat(path, " stop", sizeof(path)); } else { strlcat(path, " ", sizeof(path)); strlcat(path, cmd, sizeof(path)); } if (progress) print_desc("Calling", path); pid = fork(); if (!pid) { sig_unblock(); run_env(env); _exit(execvp(_PATH_BSHELL, argv)); } if (waitpid(pid, &status, 0) == -1) { warnx("failed starting %s, error %d: %s", path, errno, strerror(errno)); result = 1; } else { if (WIFEXITED(status)) { result = WEXITSTATUS(status); dbg("%s exited with status %d", path, result); } else if (WIFSIGNALED(status)) { warnx("%s terminated by signal %d", path, WTERMSIG(status)); result = 1; } else result = 1; } if (progress) print_result(result); rc += result; } while (num--) free(d[num]); free(d); return rc; } #ifndef __FINIT__ static int usage(int rc) { warnx("usage: runparts [-bdhps?] DIRECTORY"); return rc; } int main(int argc, char *argv[]) { int rc, c, progress = 0, sysv = 0; char *dir; while ((c = getopt(argc, argv, "bdh?ps")) != EOF) { switch(c) { case 'b': /* batch mode */ interactive = 0; break; case 'd': debug = 1; break; case 'h': case '?': return usage(0); case 'p': progress = 1; break; case 's': sysv = 1; break; default: return usage(1); } } if (optind >= argc) return usage(1); dir = argv[optind]; if (!fisdir(dir)) return usage(1); prctl(PR_SET_CHILD_SUBREAPER, 1); rc = run_parts(dir, NULL, NULL, progress, sysv); if (rc == -1) err(1, "failed run-parts %s", dir); return rc; } #endif /* __FINIT__ */ finit-4.14/src/conf.c0000644000175100001660000011212315054341541010117 /* Parser for /etc/finit.conf and /etc/finit.d/.conf * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include #include #include #ifdef _LIBITE_LITE # include # include /* BSD sys/queue.h API */ #else # include # include /* BSD sys/queue.h API */ #endif #include #include #include "finit.h" #include "cond.h" #include "devmon.h" #include "iwatch.h" #include "private.h" #include "service.h" #include "tty.h" #include "helpers.h" #include "util.h" #define BOOTSTRAP (runlevel == INIT_LEVEL) int runlevel = INIT_LEVEL; /* Bootstrap 'S' */ int cfglevel = RUNLEVEL; /* Fallback if no configured runlevel */ int cmdlevel = 0; /* runlevel override from cmdline */ int prevlevel = -1; int debug = 0; /* debug mode from kernel cmdline */ int rescue = 0; /* rescue mode from kernel cmdline */ int single = 0; /* single user mode from kernel cmdline */ int bootstrap = 1; /* set while bootstrapping (for TTYs) */ int kerndebug = 0; /* set if /proc/sys/kernel/printk > 7 */ int syncsec = 0; /* reboot delay */ int readiness = SVC_NOTIFY_PID; char *finit_conf= NULL; char *finit_rcsd= NULL; char *fstab = NULL; char *sdown = NULL; char *network = NULL; char *hostname = NULL; char *osheading = NULL; int logfile_size_max = 200000; /* 200 kB */ int logfile_count_max = 5; struct env_entry { TAILQ_ENTRY(env_entry) link; char *name; }; static TAILQ_HEAD(, env_entry) env_list = TAILQ_HEAD_INITIALIZER(env_list); struct rlimit initial_rlimit[RLIMIT_NLIMITS]; struct rlimit global_rlimit[RLIMIT_NLIMITS]; /* * --enable-fastboot => fsck_mode: NULL => no fsck by default * --enable-fsckfix => fsck_mode: "-f" + fsck_repair: "y" */ #ifdef FSCK_FIX # ifdef FAST_BOOT char *fsck_mode = NULL; # else char *fsck_mode = "-f"; # endif char *fsck_repair = "-y"; #else # ifdef FAST_BOOT char *fsck_mode = NULL; # else char *fsck_mode = ""; # endif char *fsck_repair = "-p"; #endif char *runparts = NULL; int runparts_progress; int runparts_sysv; char cgroup_current[16]; /* cgroup.NAME sets current cgroup for a set of services */ struct conf_change { TAILQ_ENTRY(conf_change) link; char *name; }; static struct iwatch iw_conf; static int iwatch_fd; static uev_t etcw; static TAILQ_HEAD(, conf_change) conf_change_list = TAILQ_HEAD_INITIALIZER(conf_change_list); static char *path; static char *shell; static int parse_conf(char *file, int is_rcsd); static void drop_changes(void); static int get_bool(char *arg, int default_value) { if (!arg) goto fallback; if (string_compare(arg, "true") || string_compare(arg, "on") || string_compare(arg, "1")) return 1; if (string_compare(arg, "false") || string_compare(arg, "off") || string_compare(arg, "0")) return 0; fallback: return default_value; } static int validate_arg(char *arg, const char *opt) { if (!arg) { errx(1, "option %s missing argument, skipping.", opt); return 1; } return 0; } /* * finit.cond = foo (=> ) * finit.config = /path/to/etc/alt-finit.conf * finit.debug = [on,off] * finit.fstab = /path/to/etc/fstab.aternative * finit.status = [on,off] (compat finit.show_status) * finit.status_style = [old,classic,modern] */ static void parse_finit_opts(char *opt) { char *arg; arg = strchr(opt, '='); if (arg) *arg++ = 0; if (string_compare(opt, "cond")) { if (validate_arg(arg, "finit.cond")) return; cond_boot_parse(arg); return; } if (string_compare(opt, "config")) { if (validate_arg(arg, "finit.config")) return; if (finit_conf) free(finit_conf); finit_conf = strdup(arg); return; } if (string_compare(opt, "debug")) { debug = get_bool(arg, 1); return; } if (string_compare(opt, "fstab")) { if (validate_arg(arg, "finit.fstab")) return; if (fstab) free(fstab); fstab = strdup(arg); return; } if (string_compare(opt, "status_style")) { if (validate_arg(arg, "finit.status_style")) return; if (string_compare(arg, "old") || string_compare(arg, "classic")) show_progress(PROGRESS_CLASSIC); else show_progress(PROGRESS_MODERN); return; } if (string_compare(opt, "status") || string_compare(opt, "show_status")) { show_progress(get_bool(arg, 1) ? PROGRESS_DEFAULT : PROGRESS_SILENT); return; } } static void parse_fsck_opts(char *opt) { char *arg; arg = strchr(opt, '='); if (arg) *arg++ = 0; if (string_compare(opt, "mode")) { if (validate_arg(arg, "fsck.mode")) return; if (!strcmp(arg, "skip")) fsck_mode = NULL; if (!strcmp(arg, "auto")) fsck_mode = ""; if (!strcmp(arg, "force")) fsck_mode = "-f"; return; } if (string_compare(opt, "repair")) { if (validate_arg(arg, "fsck.repair")) return; if (!strcmp(arg, "no")) fsck_repair = "-n"; if (!strcmp(arg, "preen")) fsck_repair = "-p"; if (!strcmp(arg, "yes")) fsck_repair = "-y"; return; } } /* * When runlevel (single integer) is given on the command line, * it overrides the runlevel in finit.conf and the built-in * default (from configure). It do however have to pass the * same sanity checks. */ static int parse_runlevel(char *arg) { const char *err = NULL; char *ptr = arg; long long num; /* Sanity check the token is just digit(s) */ while (*ptr) { if (!isdigit(*ptr++)) return 0; } num = strtonum(arg, 1, 9, &err); if (err || num == 6) { dbg("Not a valid runlevel (%s), valid levels are [1-9], excluding 6, skipping.", arg); return 0; } return (int)num; } static void parse_arg(char *arg) { if (!strncmp(arg, "finit.", 6)) { parse_finit_opts(&arg[6]); return; } if (!strncmp(arg, "fsck.", 5)) { parse_fsck_opts(&arg[5]); return; } #ifdef RESCUE_MODE if (string_compare(arg, "rescue") || string_compare(arg, "recover")) { rescue = 1; return; } #endif if (string_compare(arg, "single") || string_compare(arg, "S")) { single = 1; return; } /* Put any new command line options before this line. */ cmdlevel = parse_runlevel(arg); } #ifdef KERNEL_CMDLINE /* * Parse /proc/cmdline to find args for init. Don't use this! * * Instead, rely on the kernel to give Finit its arguments as * regular argc + argv[]. Only use this if the system you run * on has a broken initramfs system that cannot forward args * to Finit properly. */ static void parse_kernel_cmdline(void) { char line[LINE_SIZE], *cmdline, *tok; FILE *fp; fp = fopen("/proc/cmdline", "r"); if (!fp) return; if (!fgets(line, sizeof(line), fp)) { fclose(fp); return; } cmdline = chomp(line); dbg("%s", cmdline); while ((tok = strtok(cmdline, " \t"))) { cmdline = NULL; parse_arg(tok); } fclose(fp); } #else #define parse_kernel_cmdline() #endif static void parse_kernel_loglevel(void) { char line[LINE_SIZE], *ptr; FILE *fp; int val; fp = fopen("/proc/sys/kernel/printk", "r"); if (!fp) return; if (!fgets(line, sizeof(line), fp)) { fclose(fp); return; } fclose(fp); ptr = chomp(line); dbg("%s", ptr); val = atoi(ptr); if (val >= 7) kerndebug = 1; } /* * Kernel gives us all non-kernel options on our cmdline */ void conf_parse_cmdline(int argc, char *argv[]) { const char *ptr; /* Set up defaults */ if ((ptr = FINIT_FSTAB)) fstab = strdup(ptr); finit_conf = strdup(FINIT_CONF); finit_rcsd = strdup(FINIT_RCSD); path = getenv("PATH"); shell = getenv("SHELL"); for (int i = 1; i < argc; i++) parse_arg(argv[i]); parse_kernel_cmdline(); parse_kernel_loglevel(); } /* * Clear all environment variables read in parse_env(), they may be * removed now so let the next call to parse_env() restore them. */ void conf_reset_env(void) { struct env_entry *node, *tmp; TAILQ_FOREACH_SAFE(node, &env_list, link, tmp) { TAILQ_REMOVE(&env_list, node, link); if (node->name) { unsetenv(node->name); free(node->name); } free(node); } if (path) setenv("PATH", path, 1); else setenv("PATH", _PATH_STDPATH, 1); if (shell) setenv("SHELL", shell, 1); else setenv("SHELL", _PATH_BSHELL, 1); setenv("LOGNAME", "root", 1); setenv("USER", "root", 1); } /* * Sourced mainly by initctl and other Finit helper tools */ void conf_saverc(void) { FILE *fp; mkpath(_PATH_VARRUN "finit", 0755); fp = fopen(_PATH_VARRUN "finit/.initrc", "w"); if (!fp) { err(1, "failed creating .finitrc"); return; } fprintf(fp, "FINIT_CONF=%s\n", finit_conf); fprintf(fp, "FINIT_RCSD=%s\n", finit_rcsd); fprintf(fp, "FINIT_CGPATH=%s\n", FINIT_CGPATH); fprintf(fp, "INIT_SOCKET=%s\n", INIT_SOCKET); fprintf(fp, "INIT_MAGIC=0x%08x\n", INIT_MAGIC); fclose(fp); } /* * Called at bootstrap to log execution order (for debug) */ void conf_save_exec_order(svc_t *svc, char *cmdline, int result) { const char *fn = _PATH_VARRUN "finit/exec.order"; const char *ststr = !result ? "[ OK ]" : "[FAIL]"; static char *prepared = NULL; int first = !fexist(fn); FILE *fp; fp = fopen(fn, "a+"); if (!fp) { err(1, "failed writing to %s", fn); return; } if (first) { fprintf(fp, "# Execution order of run/task/services at bootstrap\n"); fprintf(fp, "# ST TYPE COMMAND LINE (DESC)\n"); } if (result == -1) { int len; len = snprintf(NULL, 0, " %-7s %-64s (%s)", svc_typestr(svc), cmdline, svc->desc); if (len > 0) { if (prepared) free(prepared); prepared = malloc(++len); if (!prepared) goto done; snprintf(prepared, len, " %-7s %-64s (%s)", svc_typestr(svc), cmdline, svc->desc); } } else { if (prepared) { memcpy(prepared, ststr, strlen(ststr)); fprintf(fp, "%s\n", prepared); free(prepared); prepared = NULL; } else { fprintf(fp, "%s %-7s %-64s (%s)\n", ststr, svc_typestr(svc), cmdline, svc->desc); } } done: fclose(fp); } /* * Called by plugins and similar that dynamically generate system services */ void conf_save_service(int type, char *cfg, char *file) { char fn[256]; svc_t foo; FILE *fp; mkpath(FINIT_RUNPATH_, 0755); snprintf(fn, sizeof(fn), "%s/%s", FINIT_RUNPATH_, file); if (fexist(fn)) warnx("File %s already exists, overwriting.", fn); fp = fopen(fn, "w"); if (!fp) { err(1, "Failed creating %s", fn); return; } foo.type = type; fprintf(fp, "# Generated by finit:%s()\n", __func__); fprintf(fp, "%s %s\n", svc_typestr(&foo), cfg); fclose(fp); } /** * conf_parse_env - Parse a key=value line * @line: Line buffer without newline * @value: Whitespace trimmed value * * Returns: * %NULL on error, otherwise a whitespace trimmed key. */ char *conf_parse_env(char *line, char **value) { char *key, *val, *end; /* skip any leading whitespace */ key = line; while (isspace(*key)) key++; /* find end of line */ end = key; while (*end) end++; /* strip trailing whitespace */ if (end > key) { end--; while (isspace(*end)) *end-- = 0; } val = strchr(key, '='); if (!val) return NULL; *val++ = 0; /* strip leading whitespace from value */ while (isspace(*val)) val++; /* unquote value, if quoted */ unquote(&val, end); *value = val; /* find end of key */ end = key; while (*end) end++; /* strip trailing whitespace */ if (end > key) { end--; while (isspace(*end)) *end-- = 0; } /* strip any leading 'set ' */ end = key; if (!strncmp(key, "set", 3)) end += 3; /* check key, no spaces allowed */ while (*end && isspace(*end)) end++; key = end; while (*end && !isspace(*end)) end++; if (*end != 0) { warnx("'%s=%s': not a valid identifier", key, val); return NULL; /* invalid key */ } return key; } /* * Sets, and makes a note of, all KEY=VALUE lines in a given .conf line * from finit.conf, or other .conf file. Note, PATH is always reset in * the conf_reset_env() function. */ static void parse_env(char *line) { struct env_entry *node; char *key, *val; key = conf_parse_env(line, &val); if (!key) return; dbg("Global env '%s'='%s'", key, val); setenv(key, val, 1); node = malloc(sizeof(*node)); if (!node) { nomem: err(1, "Out of memory cannot track env vars"); return; } node->name = strdup(key); if (!node->name) { free(node); goto nomem; } TAILQ_INSERT_HEAD(&env_list, node, link); } static int kmod_exists(char *mod) { char buf[256]; int found = 0; FILE *fp; fp = fopen("/proc/modules", "r"); if (!fp) return 0; while (!found && fgets(buf, sizeof(buf), fp)) { char *kmod = strtok(buf, " \t"); if (kmod && !strcmp(kmod, mod)) found = 1; } fclose(fp); return found; } static void kmod_load(char *mod) { char module[64] = { 0 }; char cmd[CMD_SIZE]; if (runlevel != INIT_LEVEL) return; /* Strip args for progress below and kmod_exists() */ strlcpy(module, mod, sizeof(module)); if (!strtok(module, " \t")) return; if (kmod_exists(module)) return; strcpy(cmd, "modprobe "); strlcat(cmd, mod, sizeof(cmd)); run_interactive(cmd, "Loading kernel module %s", module); } /* Convert optional "[!123456789S]" string into a bitmask */ int conf_parse_runlevels(char *runlevels) { int i, not = 0, bitmask = 0; if (!runlevels) runlevels = "[234]"; i = 1; while (i) { int level; char lvl = runlevels[i++]; if (']' == lvl || 0 == lvl) break; if ('!' == lvl) { not = 1; bitmask = 0x7FE; continue; } if ('s' == lvl || 'S' == lvl) level = INIT_LEVEL; else level = lvl - '0'; if (level > INIT_LEVEL || level < 0) continue; if (not) CLRBIT(bitmask, level); else SETBIT(bitmask, level); } return bitmask; } void conf_parse_cond(svc_t *svc, char *cond) { size_t i = 0; char *ptr; char *c; if (!svc) { errx(1, "Invalid service pointer"); return; } /* By default we assume UNIX daemons support SIGHUP */ if (svc_is_daemon(svc)) svc->sighup = 1; if (!cond) { memset(svc->cond, 0, sizeof(svc->cond)); return; } /* * First character must be '!' if: * - service: SIGHUP is not supported * - run/task: Do not block bootstrap */ ptr = cond; if (ptr[i] == '!') { ptr++; if (svc_is_runtask(svc)) { /* see service_runtask_clean() */ svc->sighup = 1; svc->once = 1; } else { svc->sighup = 0; } } while (ptr[i] != '>' && ptr[i] != 0) i++; ptr[i] = 0; if (i >= sizeof(svc->cond)) { logit(LOG_WARNING, "%s: too long list of conditions: %s", svc_ident(svc, NULL, 0), ptr); return; } svc->cond[0] = 0; for (i = 0, c = strtok(ptr, ","); c; c = strtok(NULL, ","), i++) { devmon_add_cond(c); if (i) strlcat(svc->cond, ",", sizeof(svc->cond)); strlcat(svc->cond, c, sizeof(svc->cond)); } } struct rlimit_name { char *name; int val; }; static const struct rlimit_name rlimit_names[] = { { "as", RLIMIT_AS }, { "core", RLIMIT_CORE }, { "cpu", RLIMIT_CPU }, { "data", RLIMIT_DATA }, { "fsize", RLIMIT_FSIZE }, { "locks", RLIMIT_LOCKS }, { "memlock", RLIMIT_MEMLOCK }, { "msgqueue", RLIMIT_MSGQUEUE }, { "nice", RLIMIT_NICE }, { "nofile", RLIMIT_NOFILE }, { "nproc", RLIMIT_NPROC }, { "rss", RLIMIT_RSS }, { "rtprio", RLIMIT_RTPRIO }, #ifdef RLIMIT_RTTIME { "rttime", RLIMIT_RTTIME }, #endif { "sigpending", RLIMIT_SIGPENDING }, { "stack", RLIMIT_STACK }, { NULL, 0 } }; int str2rlim(char *str) { const struct rlimit_name *rn; for (rn = rlimit_names; rn->name; rn++) { if (!strcmp(str, rn->name)) return rn->val; } return -1; } char *rlim2str(int rlim) { const struct rlimit_name *rn; for (rn = rlimit_names; rn->name; rn++) { if (rn->val == rlim) return rn->name; } return "unknown"; } char *lim2str(struct rlimit *rlim) { char tmp[25]; static char buf[42]; buf[0] = 0; if (RLIM_INFINITY == rlim->rlim_cur) snprintf(tmp, sizeof(tmp), "unlimited, "); else snprintf(tmp, sizeof(tmp), "%llu, ", (unsigned long long)rlim->rlim_cur); strlcat(buf, tmp, sizeof(buf)); if (RLIM_INFINITY == rlim->rlim_max) snprintf(tmp, sizeof(tmp), "unlimited, "); else snprintf(tmp, sizeof(tmp), "%llu, ", (unsigned long long)rlim->rlim_max); strlcat(buf, tmp, sizeof(buf)); return buf; } /* First form: `rlimit RESOURCE LIMIT` */ void conf_parse_rlimit(char *line, struct rlimit arr[]) { char *level, *limit, *val; int resource = -1; rlim_t cfg; level = strtok(line, " \t"); if (!level) goto error; limit = strtok(NULL, " \t"); if (!limit) goto error; val = strtok(NULL, " \t"); if (!val) { /* Second form: `rlimit RESOURCE LIMIT` */ val = limit; limit = level; level = "both"; } resource = str2rlim(limit); if (resource < 0 || resource > RLIMIT_NLIMITS) goto error; /* Official keyword from v3.1 is `unlimited`, from prlimit(1) */ if (!strcmp(val, "unlimited") || !strcmp(val, "infinity")) { cfg = RLIM_INFINITY; } else { const char *err = NULL; cfg = strtonum(val, 0, (long long)2 << 31, &err); if (err) { logit(LOG_WARNING, "rlimit: invalid %s value: %s", rlim2str(resource), val); return; } } if (!strcmp(level, "soft")) arr[resource].rlim_cur = cfg; else if (!strcmp(level, "hard")) arr[resource].rlim_max = cfg; else if (!strcmp(level, "both")) arr[resource].rlim_max = arr[resource].rlim_cur = cfg; else goto error; return; error: logit(LOG_WARNING, "rlimit: parse error"); } /* cgroup NAME ctrl.prop:value,ctrl.prop:value ... */ static void conf_parse_cgroup(char *line) { char config[strlen(line) + 1]; char *ptr, *name; name = strtok(line, " \t"); if (!name) return; if (strstr(name, "..") || strchr(name, '/')) return; /* illegal */ config[0] = 0; while ((ptr = strtok(NULL, " \t"))) { if (config[0]) strlcat(config, ",", sizeof(config)); strlcat(config, ptr, sizeof(config)); } cgroup_add(name, config, 0); } static int parse_static(char *line, int is_rcsd) { char cmd[CMD_SIZE]; char *x; if (BOOTSTRAP && (MATCH_CMD(line, "host ", x) || MATCH_CMD(line, "hostname ", x))) { if (hostname) free(hostname); hostname = strdup(strip_line(x)); return 0; } if (BOOTSTRAP && MATCH_CMD(line, "mknod ", x)) { char *dev = strip_line(x); strcpy(cmd, "mknod "); strlcat(cmd, dev, sizeof(cmd)); run_interactive(cmd, "Creating device node %s", dev); return 0; } /* Kernel module to load */ if (BOOTSTRAP && MATCH_CMD(line, "module ", x)) { kmod_load(strip_line(x)); return 0; } if (BOOTSTRAP && MATCH_CMD(line, "network ", x)) { if (network) free(network); network = strdup(strip_line(x)); return 0; } if (BOOTSTRAP && MATCH_CMD(line, "rcsd ", x)) { if (finit_rcsd) free(finit_rcsd); finit_rcsd = strdup(strip_line(x)); return 0; } if (BOOTSTRAP && MATCH_CMD(line, "runparts ", x)) { if (runparts) free(runparts); runparts_progress = runparts_sysv = 0; while (x) { if (MATCH_CMD(x, "progress", x)) runparts_progress = 1; else if (MATCH_CMD(x, "sysv", x)) runparts_sysv = 1; else break; } runparts = strdup(strip_line(x)); return 0; } if (BOOTSTRAP && MATCH_CMD(line, "set ", x)) { parse_env(x); return 0; } if (MATCH_CMD(line, "include ", x)) { char *file = strip_line(x); strlcpy(cmd, file, sizeof(cmd)); if (!fexist(cmd)) { errx(1, "Cannot find include file %s, absolute path required!", x); return 1; } return parse_conf(cmd, is_rcsd); } if (MATCH_CMD(line, "log ", x)) { char *tok; static int size = 200000, count = 5; tok = strtok(x, ":= "); while (tok) { if (!strncmp(tok, "size", 4)) size = strtobytes(strtok(NULL, ":= ")); else if (!strncmp(tok, "count", 5)) count = strtobytes(strtok(NULL, ":= ")); tok = strtok(NULL, ":= "); } if (size >= 0) logfile_size_max = size; if (count >= 0) logfile_count_max = count; return 0; } if (MATCH_CMD(line, "shutdown ", x)) { if (sdown) free(sdown); sdown = strdup(strip_line(x)); return 0; } /* * The desired runlevel to start when leaving bootstrap (S). * Finit supports 1-9, but most systems only use 1-6, where * 6 is reserved for reboot and 0 for halt/poweroff. */ if (BOOTSTRAP && MATCH_CMD(line, "runlevel ", x)) { char *token = strip_line(x); const char *err = NULL; cfglevel = strtonum(token, 1, 9, &err); if (err) cfglevel = RUNLEVEL; if (cfglevel < 1 || cfglevel > 9 || cfglevel == 6) cfglevel = 2; /* Fallback */ return 0; } /* * Before Finit 5 the default readiness notification is PID. * This default can be changed by setting 'readiness none' in * the file /etc/finit.conf, only read once at bootstrap. */ if (BOOTSTRAP && MATCH_CMD(line, "readiness ", x)) { char *token = strip_line(x); if (!strcmp(token, "none")) readiness = SVC_NOTIFY_NONE; } if (MATCH_CMD(line, "reboot-delay ", x)) { syncsec = strtonum(strip_line(x), 0, 60, NULL); return 0; } /* * Periodic check and instability index leveler, seconds */ if (MATCH_CMD(line, "service-interval ", x)) { char *token = strip_line(x); const char *err = NULL; int val; /* 0 min to 1 day, should check at least daily */ val = strtonum(token, 0, 1440, &err); if (!err) { int disabled = !service_interval; service_interval = val * 1000; /* to milliseconds */ if (disabled) service_init(NULL); } return 0; } return 1; } static int parse_dynamic(char *line, struct rlimit rlimit[], char *file) { char *x; /* Monitored daemon, will be respawned on exit */ if (MATCH_CMD(line, "service ", x)) { service_register(SVC_TYPE_SERVICE, x, rlimit, file); return 0; } /* One-shot task, will not be respawned */ if (MATCH_CMD(line, "task ", x)) { service_register(SVC_TYPE_TASK, x, rlimit, file); return 0; } /* Like task but waits for completion, useful w/ [S] */ if (MATCH_CMD(line, "run ", x)) { service_register(SVC_TYPE_RUN, x, rlimit, file); return 0; } /* Similar to task but is treated like a SysV init script */ if (MATCH_CMD(line, "sysv ", x)) { service_register(SVC_TYPE_SYSV, x, rlimit, file); return 0; } /* Read resource limits */ if (MATCH_CMD(line, "rlimit ", x)) { conf_parse_rlimit(x, rlimit); return 0; } /* Read control group limits */ if (MATCH_CMD(line, "cgroup ", x)) { conf_parse_cgroup(x); return 0; } /* Set current cgroup for the following services/run/tasks */ if (MATCH_CMD(line, "cgroup.", x)) { strlcpy(cgroup_current, x, sizeof(cgroup_current)); return 0; } /* Regular or serial TTYs to run getty */ if (MATCH_CMD(line, "tty ", x)) { service_register(SVC_TYPE_TTY, strip_line(x), rlimit, file); return 0; } return 1; } /* * Very simple and crude implementation, only supports '%i' */ static char *instantiate(char *line, char *name) { char *ptr, *end = strchr(line, 0); char *pos = line; size_t num = 0; if (!name[0] || !end) return line; while ((ptr = strchr(pos, '%'))) { num++; pos++; } ptr = realloc(line, strlen(line) + num * strlen(name) + 1); if (!ptr) return line; pos = line = ptr; while ((ptr = strchr(pos, '%'))) { if (!strncmp(ptr, "%i", 2)) { char *rest = &ptr[2]; char *next = ptr + strlen(name); memmove(next, rest, strlen(rest) + 1); memcpy(ptr, name, strlen(name)); pos += strlen(name); } else pos++; } return line; } static int is_template(const char *file, char *name, size_t len) { char *ptr, *nm; size_t i = 0; ptr = strchr(file, '@'); if (!ptr) return 0; /* not a template */ nm = ptr + 1; ptr = strstr(nm, ".conf"); if (!strcmp(nm, ".conf") || !ptr) return 1; /* template itself or invalid */ while (nm < ptr && i < len - 1) name[i++] = *nm++; name[i] = 0; return 1; /* instantiated template */ } static int parse_conf(char *file, int is_rcsd) { struct rlimit rlimit[RLIMIT_NLIMITS]; char name[65] = { 0 }; FILE *fp; if (is_template(file, name, sizeof(name))) { if (!name[0]) { dbg("*** Skipping template file %s", file); return 0; } dbg("*** instantiating %s from %s ...", name, file); } fp = fopen(file, "r"); if (!fp) return 1; /* Prepare default limits and group for each service in /etc/finit.d/ */ if (is_rcsd) { memcpy(rlimit, global_rlimit, sizeof(rlimit)); cgroup_current[0] = 0; } dbg("*** Parsing %s", file); while (!feof(fp)) { char *line; line = fparseln(fp, NULL, NULL, NULL, FPARSELN_UNESCCOMM); if (!line) continue; tabstospaces(line); // dbg("raw: %s", line); line = instantiate(line, name); // dbg("ins: %s", line); if (!parse_static(line, is_rcsd)) ; else if (!parse_dynamic(line, is_rcsd ? rlimit : global_rlimit, file)) ; else parse_env(line); free(line); } fclose(fp); return 0; } static void glob_append(glob_t *gl, int append, const char *fmt, ...) { va_list ap; size_t len; char *path; va_start(ap, fmt); len = vsnprintf(NULL, 0, fmt, ap); va_end(ap); path = alloca(++len); if (!path) { warn("failed alloca() in glob_append()"); return; } va_start(ap, fmt); vsnprintf(path, len, fmt, ap); va_end(ap); dbg("conf_reload(): glob %s ...", path); glob(path, append ? GLOB_APPEND : 0, NULL, gl); } /* * Reload /etc/finit.conf and all *.conf in /etc/finit.d/ */ int conf_reload(void) { glob_t gl; size_t i; /* Set time according to current time zone */ tzset(); dbg("Set time daylight: %d timezone: %ld tzname: %s %s", daylight, timezone, tzname[0], tzname[1]); /* Mark and sweep */ cgroup_mark_all(); svc_mark_dynamic(); conf_reset_env(); /* * Reset global rlimit to bootstrap values from conf_init(). */ memcpy(global_rlimit, initial_rlimit, sizeof(global_rlimit)); /* * When built with --disable-rescue mode many other 'if (rescue)' * code paths are #ifdeffed out. This one, and the ones in the * plugins, are not because a hook or plugin can still trigger * the alternative rescue.conf instead of finit.conf. This for * very advanced use-cases where files on /etc are generated at * bootstrap, including users and passwords, from other sources. */ if (rescue) { int rc; char line[80] = "tty [12345789] rescue"; /* If rescue.conf is missing, fall back to a root shell */ rc = parse_conf(RESCUE_CONF, 0); if (rc) service_register(SVC_TYPE_TTY, line, global_rlimit, NULL); print(rc, "Entering rescue mode"); goto done; } /* First, read /etc/finit.conf */ parse_conf(finit_conf, 0); /* Set global limits */ for (int i = 0; i < RLIMIT_NLIMITS; i++) { if (setrlimit(i, &global_rlimit[i]) == -1) logit(LOG_WARNING, "rlimit: Failed setting %s: %s", rlim2str(i), lim2str(&global_rlimit[i])); } /* * Next, read all *.conf in /lib/finit/system and /etc/finit.d/ * The system files were previously created at runtime by plugins * but are now regular files that can be overridden by files in * /etc/finit.d -- similar to how tmfiles.d(5) work. E.g., add * an override .conf, or an ignore by symlinking to /dev/null * * The .conf files (and run/task/service stanzas) are parsed and * started in order. Each directory is sorted alphanumerically * and then the result is appended to the overall order: * * /lib/finit/system/10-hotplug.conf * /lib/finit/system/90-testserv.conf * /run/finit/system/dbus.conf * /run/finit/system/tty.conf * /etc/finit.d/10-abc.conf * /etc/finit.d/20-abc.conf * /etc/finit.d/enabled/1-aaa.conf * /etc/finit.d/enabled/1-abc.conf * /etc/finit.d/enabled/2-aaa.conf */ glob_append(&gl, 0, "%s/*.conf", FINIT_SYSPATH_); glob_append(&gl, 1, "%s/*.conf", FINIT_RUNPATH_); glob_append(&gl, 1, "%s/*.conf", finit_rcsd); glob_append(&gl, 1, "%s/enabled/*.conf", finit_rcsd); if (bootstrap) { const char *fn = _PATH_VARRUN "finit/conf.order"; FILE *fp; fp = fopen(fn, "w"); if (!fp) { err(1, "failed creating %s", fn); } else { fprintf(fp, "# Evaluation & execution order of .conf files\n"); for (i = 0; i < gl.gl_pathc; i++) fprintf(fp, "%s\n", gl.gl_pathv[i]); fclose(fp); } } for (i = 0; i < gl.gl_pathc; i++) { char *path = gl.gl_pathv[i]; char *rp = NULL; struct stat st; size_t j, len; /* check for FINIT_SYSPATH_ or FINIT_RUNPATH_ overrides */ for (j = i + 1; j < gl.gl_pathc; j++) { if (strncmp(path, FINIT_SYSPATH_, strlen(FINIT_SYSPATH_)) && strncmp(path, FINIT_RUNPATH_, strlen(FINIT_RUNPATH_))) continue; if (strcmp(basenm(path), basenm(gl.gl_pathv[j]))) continue; path = NULL; /* replacement later in list, skip this */ break; } if (!path) continue; /* skip, override exists */ /* Check that it's an actual file ... beyond any symlinks */ if (lstat(path, &st)) { dbg("Skipping %s, cannot access: %s", path, strerror(errno)); continue; } /* Skip directories */ if (S_ISDIR(st.st_mode)) { dbg("Skipping directory %s", path); continue; } /* Check for dangling symlinks */ if (S_ISLNK(st.st_mode)) { rp = realpath(path, NULL); if (!rp) { logit(LOG_WARNING, "Skipping %s, dangling symlink: %s", path, strerror(errno)); continue; } } /* Check that file ends with '.conf' */ len = strlen(path); if (len < 6 || strcmp(&path[len - 5], ".conf")) dbg("Skipping %s, not a Finit .conf file ... ", path); else parse_conf(path, 1); if (rp) free(rp); } globfree(&gl); /* Mark any reverse deps as chenaged. */ service_update_rdeps(); /* Prune according to if:[!]ident or if:<[!]cond> */ service_mark_unavail(); /* Set up top-level cgroups */ cgroup_config(); done: /* Remove all unused top-level cgroups */ cgroup_cleanup(); /* Drop record of all .conf changes */ drop_changes(); if (bootstrap) wdog = svc_find("watchdog", "finit"); /* Override configured runlevel, user said 'S' on /proc/cmdline */ if (BOOTSTRAP && single) cfglevel = 1; /* * Set host name, from %DEFHOST, *.conf or /etc/hostname. The * latter wins, if neither exists we default to "noname" */ set_hostname(&hostname); return 0; } static struct conf_change *conf_find(char *file) { struct conf_change *node, *tmp; TAILQ_FOREACH_SAFE(node, &conf_change_list, link, tmp) { if (string_compare(node->name, file)) return node; } return NULL; } static void drop_change(struct conf_change *node) { if (!node) return; TAILQ_REMOVE(&conf_change_list, node, link); free(node->name); free(node); } static void drop_changes(void) { struct conf_change *node, *tmp; TAILQ_FOREACH_SAFE(node, &conf_change_list, link, tmp) drop_change(node); } static int conf_change_act(char *dir, char *name, uint32_t mask) { char fn[strlen(dir) + strlen(name) + 2]; struct conf_change *node; char *rp = NULL; /* Check for actual printable characters, sometimes STX */ if (name[0] && name[0] >= ' ') paste(fn, sizeof(fn), dir, name); else strlcpy(fn, dir, sizeof(fn)); dbg("path: %s mask: %08x", fn, mask); if (strchr(name, '@')) { /* Skip realpath for templates */ rp = strdup(fn); } else { /* Handle disabling/removal of service */ rp = realpath(fn, NULL); if (!rp) { if (errno != ENOENT) goto fail; rp = strdup(fn); } } if (!rp) goto fail; node = conf_find(rp); if (node) { dbg("event already registered for %s ...", name); free(rp); return 0; } node = malloc(sizeof(*node)); if (!node) { free(rp); goto fail; } node->name = rp; TAILQ_INSERT_HEAD(&conf_change_list, node, link); dbg("event registered for %s, mask 0x%x", rp, mask); return 0; fail: warn("failed registering %s event mask %08x", fn, mask); return 1; } int conf_any_change(void) { if (TAILQ_EMPTY(&conf_change_list)) return 0; return 1; } int conf_changed(char *file) { int rc = 0; char *rp; if (!file) return 0; if (strchr(file, '@')) rp = strdup(file); else rp = realpath(file, NULL); if (!rp) return 0; if (conf_find(rp)) rc = 1; free(rp); return rc; } static int conf_iwatch_read(int fd) { static char ev_buf[8 *(sizeof(struct inotify_event) + NAME_MAX + 1) + 1]; struct inotify_event *ev; ssize_t sz; size_t off; sz = read(fd, ev_buf, sizeof(ev_buf) - 1); if (sz <= 0) return -1; ev_buf[sz] = 0; for (off = 0; off < (size_t)sz; off += sizeof(*ev) + ev->len) { struct iwatch_path *iwp; if (off + sizeof(*ev) > (size_t)sz) break; ev = (struct inotify_event *)&ev_buf[off]; if (off + sizeof(*ev) + ev->len > (size_t)sz) break; if (!ev->mask) continue; dbg("name %s, event: 0x%08x", ev->name, ev->mask); /* Find base path for this event */ iwp = iwatch_find_by_wd(&iw_conf, ev->wd); if (!iwp) continue; if (conf_change_act(iwp->path, ev->name, ev->mask)) break; } return 0; } static void conf_cb(uev_t *w, void *arg, int events) { (void)arg; if (UEV_ERROR == events) { dbg("%s(): iwatch socket %d invalid.", __func__, w->fd); return; } if (conf_iwatch_read(w->fd)) { err(1, "invalid inotify event"); return; } #ifdef AUTO_RELOAD if (conf_any_change()) sm_reload(); #endif } void conf_flush_events(void) { while (!conf_iwatch_read(iwatch_fd)) dbg("emptying inotify queue ..."); } /* * Set up inotify watcher and load all *.conf in /etc/finit.d/ */ int conf_monitor(void) { char path[strlen(finit_rcsd) + 16]; int rc = 0; /* * If only one watcher fails, that's OK. A user may have only * one of /etc/finit.conf or /etc/finit.d in use, and may also * have or not have symlinks in place. We need to monitor for * changes to either symlink or target. */ rc |= iwatch_add(&iw_conf, finit_rcsd, IN_ONLYDIR); snprintf(path, sizeof(path), "%s/available/", finit_rcsd); rc |= iwatch_add(&iw_conf, path, IN_ONLYDIR | IN_DONT_FOLLOW); snprintf(path, sizeof(path), "%s/enabled/", finit_rcsd); rc |= iwatch_add(&iw_conf, path, IN_ONLYDIR | IN_DONT_FOLLOW); rc |= iwatch_add(&iw_conf, finit_conf, 0); /* * Systems with /etc/default, /etc/conf.d, or similar, can also * monitor changes in env files sourced by .conf files (above) * define your own with --with-sysconfig=/path/to/envfiles */ rc |= iwatch_add(&iw_conf, "/etc/default/", IN_ONLYDIR); rc |= iwatch_add(&iw_conf, "/etc/conf.d/", IN_ONLYDIR); #ifdef FINIT_SYSCONFIG rc |= iwatch_add(&iw_conf, FINIT_SYSCONFIG, IN_ONLYDIR); #endif rc |= conf_reload(); return rc; } /* * Prepare .conf parser and load /etc/finit.conf for global settings */ int conf_init(uev_ctx_t *ctx) { /* default hostname */ hostname = strdup(DEFHOST); /* * Get current global limits, which may be overridden from both * finit.conf, for Finit and its services like getty+watchdogd, * and *.conf in finit.d/, for each service(s) listed there. */ for (int i = 0; i < RLIMIT_NLIMITS; i++) { if (getrlimit(i, &initial_rlimit[i])) logit(LOG_WARNING, "rlimit: Failed reading setting %s: %s", rlim2str(i), strerror(errno)); } /* Initialize global rlimits, e.g. for built-in services */ memcpy(global_rlimit, initial_rlimit, sizeof(global_rlimit)); /* * Start built-in watchdogd as soon as possible, if enabled */ #ifdef WDT_DEVNODE if (whichp(FINIT_EXECPATH_ "/watchdogd") && fexist(WDT_DEVNODE)) { conf_save_service(SVC_TYPE_SERVICE, "[S0123456789] cgroup.init notify:none name:watchdog :finit " FINIT_EXECPATH_ "/watchdogd -- Finit watchdog daemon", "watchdogd.conf"); } #endif /* * Start kernel event daemon as soon as possible, if enabled */ if (whichp(FINIT_EXECPATH_ "/keventd")) conf_save_service(SVC_TYPE_SERVICE, "[S12345789] cgroup.init notify:none " FINIT_EXECPATH_ "/keventd -- Finit kernel event daemon", "keventd.conf"); dbg("Allow plugins to register early runlevel 1 run/task/services ..."); plugin_run_hooks(HOOK_SVC_PLUGIN); /* Read global rlimits and global cgroup setup from /etc/finit.conf */ parse_conf(finit_conf, 0); /* prepare /etc watcher */ iwatch_fd = iwatch_init(&iw_conf); if (iwatch_fd < 0) return 1; if (uev_io_init(ctx, &etcw, conf_cb, NULL, iwatch_fd, UEV_READ)) { err(1, "Failed setting up I/O callback for /etc watcher"); close(iwatch_fd); return 1; } /* * Background startup scripts in the runparts directory, if any. */ if (runparts && fisdir(runparts) && !rescue) { char conf[sizeof(_PATH_RUNPARTS) + strlen(runparts) + 100]; char args[10] = { 0 }; if (debug) strlcat(args, "-d ", sizeof(args)); if (runparts_progress) strlcat(args, "-p ", sizeof(args)); if (runparts_sysv) strlcat(args, "-s ", sizeof(args)); snprintf(conf, sizeof(conf), "[S] notify:none log:console %s %s %s" " -- Calling runparts %s in the background", _PATH_RUNPARTS, args, runparts, runparts); conf_save_service(SVC_TYPE_TASK, conf, "runparts.conf"); } return 0; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/Makefile.am0000644000175100001660000001022715054341541011064 EXTRA_DIST = rescue.conf sample.conf AM_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE if STATIC AM_CPPFLAGS += -DENABLE_STATIC AM_LDFLAGS = -static-libtool-libs else AM_LDFLAGS = -export-dynamic endif sbin_PROGRAMS = finit initctl pkglibexec_PROGRAMS = getty logit runparts tmpfiles if SULOGIN pkglibexec_PROGRAMS += sulogin endif if KEVENTD pkglibexec_PROGRAMS += keventd endif if WATCHDOGD pkglibexec_PROGRAMS += watchdogd endif dist_pkglibexec_SCRIPTS = coldplug finit_pkglibdir = $(pkglibdir) finit_pkglib_SCRIPTS = rescue.conf sample.conf getty_SOURCES = finit.h getty.c helpers.h logrotate.c stty.c utmp-api.c utmp-api.h getty_CFLAGS = -W -Wall -Wextra -std=gnu99 getty_CFLAGS += $(lite_CFLAGS) getty_LDADD = $(lite_LIBS) keventd_SOURCES = keventd.c iwatch.c iwatch.h util.c util.h keventd_CFLAGS = -W -Wall -Wextra -std=gnu99 keventd_CFLAGS += $(lite_CFLAGS) keventd_LDADD = $(lite_LIBS) runparts_SOURCES = runparts.c runparts_CFLAGS = -W -Wall -Wextra -std=gnu99 runparts_CFLAGS += $(lite_CFLAGS) runparts_LDADD = $(lite_LIBS) sulogin_SOURCES = sulogin.c sulogin_CFLAGS = -W -Wall -Wextra -std=gnu99 sulogin_LDADD = -lcrypt tmpfiles_SOURCES = tmpfiles.c util.c util.h log.h tmpfiles_CFLAGS = -W -Wall -Wextra -std=gnu99 tmpfiles_CFLAGS += $(lite_CFLAGS) $(uev_CFLAGS) tmpfiles_LDADD = $(lite_LIBS) $(uev_LIBS) logit_SOURCES = logit.c logrotate.c logit_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99 logit_CFLAGS += $(lite_CFLAGS) logit_LDADD = $(lite_LIBS) finit_SOURCES = api.c cgroup.c cgroup.h \ client.c client.h \ cond.c cond-w.c cond.h \ conf.c conf.h \ devmon.c devmon.h \ exec.c finit.c finit.h \ stty.c \ helpers.c helpers.h \ iwatch.c iwatch.h \ log.c log.h \ mdadm.c mount.c \ pid.c pid.h \ plugin.c plugin.h private.h \ runparts.c schedule.c schedule.h \ service.c service.h \ sig.c sig.h \ sm.c sm.h \ svc.c svc.h \ tty.c tty.h \ util.c util.h \ utmp-api.c utmp-api.h if LOGROTATE finit_SOURCES += logrotate.c endif pkginclude_HEADERS = cgroup.h cond.h conf.h finit.h helpers.h log.h \ plugin.h svc.h service.h finit_CPPFLAGS = $(AM_CPPFLAGS) -D__FINIT__ finit_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99 finit_CFLAGS += $(lite_CFLAGS) $(uev_CFLAGS) finit_LDADD = $(lite_LIBS) $(uev_LIBS) if STATIC finit_LDADD += ../plugins/libplug.la else finit_LDADD += -ldl endif initctl_SOURCES = initctl.c initctl.h cgutil.c cgutil.h \ client.c client.h cond.c cond.h reboot.c \ serv.c serv.h svc.h util.c util.h log.h initctl_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99 initctl_CFLAGS += $(lite_CFLAGS) $(uev_CFLAGS) initctl_LDADD = $(lite_LIBS) $(uev_LIBS) INIT_LNKS = init telinit REBOOT_LNKS = reboot shutdown halt poweroff suspend if WATCHDOGD watchdogd_SOURCES = watchdog.c watchdog.h watchdogd_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99 endif # Hook in install to add finit and reboot symlink(s) install-exec-hook: @for file in $(INIT_LNKS); do \ lnk=$(DESTDIR)$(sbindir)/$$file; \ if [ -e $$lnk ]; then \ echo "Skipping $$lnk exists."; \ else \ $(LN_S) finit $$lnk; \ fi; \ done @for file in $(REBOOT_LNKS); do \ lnk=$(DESTDIR)$(sbindir)/$$file; \ if [ -e $$lnk ]; then \ echo "Skipping $$lnk exists."; \ else \ $(LN_S) initctl $$lnk; \ fi; \ done uninstall-hook: @for file in $(INIT_LNKS); do \ lnk=$(DESTDIR)$(sbindir)/$$file; \ dst=`readlink $$lnk`; \ if [ "$$dst" != "finit" ]; then \ continue; \ fi; \ $(RM) $(DESTDIR)$(sbindir)/$$file; \ done @for file in $(REBOOT_LNKS); do \ lnk=$(DESTDIR)$(sbindir)/$$file; \ dst=`readlink $$lnk`; \ if [ "$$dst" != "initctl" ]; then \ continue; \ fi; \ $(RM) $$lnk; \ done finit-4.14/src/plugin.c0000644000175100001660000002722615054341541010501 /* Plugin based services architecture for finit * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include /* dlopen() et al */ #include /* readdir() et al */ #include #include #ifdef _LIBITE_LITE # include # include /* BSD sys/queue.h API */ #else # include # include /* BSD sys/queue.h API */ #endif #include "cond.h" #include "finit.h" #include "helpers.h" #include "plugin.h" #include "private.h" #include "service.h" #include "sig.h" #include "util.h" #define is_io_plugin(p) ((p)->io.cb && (p)->io.fd > 0) #define SEARCH_PLUGIN(str) \ PLUGIN_ITERATOR(p, tmp) { \ if (!strcmp(p->name, str)) \ return p; \ } static int plugloaded = 0; /* Set while plugins are loaded */ static char *plugpath = NULL; /* Set by first load. */ static TAILQ_HEAD(plugin_head, plugin) plugins = TAILQ_HEAD_INITIALIZER(plugins); #ifndef ENABLE_STATIC static void check_plugin_depends(plugin_t *plugin); #endif static char *trim_ext(char *name) { char *ptr; if (name) { ptr = strstr(name, ".so"); if (!ptr) ptr = strstr(name, ".c"); if (ptr) *ptr = 0; } return name; } int plugin_register(plugin_t *plugin) { const char *nm; if (!plugin) { errno = EINVAL; return 1; } /* Setup default name if none is provided */ nm = plugin->name; if (!nm) { #ifndef ENABLE_STATIC Dl_info info; if (dladdr(plugin, &info) && info.dli_fname) nm = basenm(info.dli_fname); #endif if (!nm) nm = "unknown"; } plugin->name = trim_ext(strdup(nm)); /* Already registered? */ if (plugin_find(plugin->name)) { dbg("... %s already loaded", plugin->name); free(plugin->name); return 0; } #ifndef ENABLE_STATIC /* Resolve plugin dependencies */ check_plugin_depends(plugin); #endif TAILQ_INSERT_TAIL(&plugins, plugin, link); return 0; } /* Not called, at the moment plugins cannot be unloaded. */ int plugin_unregister(plugin_t *plugin) { if (is_io_plugin(plugin)) uev_io_stop(&plugin->watcher); #ifndef ENABLE_STATIC TAILQ_REMOVE(&plugins, plugin, link); dbg("%s exiting ...", plugin->name); free(plugin->name); #else dbg("Finit built statically, cannot unload %s ...", plugin->name); #endif return 0; } /** * plugin_find - Find a plugin by name * @name: With or without path, or .so extension * * This function uses an opporunistic search for a suitable plugin and * returns the first match. Albeit with at least some measure of * heuristics. * * First it checks for an exact match. If no match is found and @name * starts with a slash the search ends. Otherwise a new search with the * plugin path prepended to @name is made. Also, if @name does not end * with .so it too is added to @name before searching. * * Returns: * On success the pointer to the matching &plugin_t is returned, * otherwise %NULL is returned. */ plugin_t *plugin_find(char *name) { plugin_t *p, *tmp; if (!name) { errno = EINVAL; return NULL; } SEARCH_PLUGIN(name); if (plugpath && name[0] != '/') { char path[CMD_SIZE]; int noext; noext = strcmp(name + strlen(name) - 3, ".so"); snprintf(path, sizeof(path), "%s%s%s%s", plugpath, fisslashdir(plugpath) ? "" : "/", name, noext ? ".so" : ""); SEARCH_PLUGIN(path); } errno = ENOENT; return NULL; } /* Private daemon API *******************************************************/ #define CHOOSE(x, y) y static const char *hook_cond[] = HOOK_TYPES; #undef CHOOSE const char *plugin_hook_str(hook_point_t no) { return hook_cond[no]; } int plugin_exists(hook_point_t no) { plugin_t *p, *tmp; PLUGIN_ITERATOR(p, tmp) { if (p->hook[no].cb) return 1; } return 0; } #if defined(HAVE_HOOK_SCRIPTS_PLUGIN) && defined(PLUGIN_HOOK_SCRIPTS_PATH) #define CHOOSE(x, y) y static const char *hscript_paths[] = HOOK_TYPES; #undef CHOOSE void plugin_script_run(hook_point_t no) { const char *hook_name = hscript_paths[no]; const char *env[] = { "FINIT_HOOK_NAME", hook_name, "FINIT_SHUTDOWN", NULL, NULL, }; char path[CMD_SIZE] = ""; strlcat(path, PLUGIN_HOOK_SCRIPTS_PATH, sizeof(path)); strlcat(path, hook_name + 4, sizeof(path)); if (no >= HOOK_SHUTDOWN) { switch (halt) { case SHUT_OFF: env[3] = "poweroff"; break; case SHUT_HALT: env[3] = "halt"; break; case SHUT_REBOOT: env[3] = "reboot"; break; } } else env[2] = NULL; run_parts(path, NULL, env, 0, 0); } #else void plugin_script_run(hook_point_t no) { (void)no; } #endif /* Some hooks are called with a fixed argument */ void plugin_run_hook(hook_point_t no, void *arg) { plugin_t *p, *tmp; #ifdef HAVE_HOOK_SCRIPTS_PLUGIN if (!cond_is_available() && !plugloaded) { dbg("conditions not available, calling script based hooks only!"); plugin_script_run(no); } #endif PLUGIN_ITERATOR(p, tmp) { if (p->hook[no].cb) { dbg("Calling %s hook n:o %d (arg: %p) ...", basenm(p->name), no, arg ?: "NIL"); p->hook[no].cb(arg ? arg : p->hook[no].arg); } } /* * Conditions are stored in /run, so don't try to signal * conditions for any hooks before filesystems have been * mounted. */ if (cond_is_available() && no >= HOOK_BASEFS_UP && no <= HOOK_SHUTDOWN) cond_set_oneshot(hook_cond[no]); service_step_all(SVC_TYPE_RUNTASK); } /* Regular hooks are called with the registered plugin's argument */ void plugin_run_hooks(hook_point_t no) { plugin_run_hook(no, NULL); } /* * Generic libev I/O callback, looks up correct plugin and calls its * callback. libuEv might return UEV_ERROR in events, it is up to the * plugin callback to handle this. */ static void generic_io_cb(uev_t *w, void *arg, int events) { plugin_t *p = (plugin_t *)arg; if (is_io_plugin(p) && p->io.fd == w->fd) { /* Stop watcher, callback may close descriptor on us ... */ uev_io_stop(w); // dbg("Calling I/O %s from runloop...", basename(p->name)); p->io.cb(p->io.arg, w->fd, events); /* Update fd, may be changed by plugin callback, e.g., if FIFO */ uev_io_set(w, p->io.fd, p->io.flags); } } int plugin_io_init(plugin_t *p) { if (!is_io_plugin(p)) return 0; dbg("Initializing plugin %s for I/O", basenm(p->name)); if (uev_io_init(ctx, &p->watcher, generic_io_cb, p, p->io.fd, p->io.flags)) { warn("Failed setting up I/O plugin %s", basenm(p->name)); return 1; } return 0; } /* Setup any I/O callbacks for plugins that use them */ static int init_plugins(uev_ctx_t *ctx) { plugin_t *p, *tmp; int fail = 0; (void)ctx; PLUGIN_ITERATOR(p, tmp) { if (plugin_io_init(p)) fail++; } return fail; } #ifndef ENABLE_STATIC /** * load_one - Load one plugin * @path: Path to finit plugins, usually %PLUGIN_PATH * @name: Name of plugin, optionally ending in ".so" * * Loads a plugin from @path/@name[.so]. Note, if ".so" is missing from * the plugin @name it is added before attempting to load. * * It is up to the plugin itself or register itself as a "ctor" with the * %PLUGIN_INIT macro so that plugin_register() is called automatically. * * Returns: * POSIX OK(0) on success, non-zero otherwise. */ static int load_one(char *path, char *name) { int noext; char sofile[CMD_SIZE]; void *handle; plugin_t *plugin; if (!path || !fisdir(path) || !name) { errno = EINVAL; return 1; } /* Compose full path, with optional .so extension, to plugin */ noext = strcmp(name + strlen(name) - 3, ".so"); snprintf(sofile, sizeof(sofile), "%s/%s%s", path, name, noext ? ".so" : ""); dbg("Loading plugin %s ...", sofile); handle = dlopen(sofile, RTLD_LAZY | RTLD_LOCAL); if (!handle) { char *error = dlerror(); warn("Failed loading plugin %s: %s", sofile, error ? error : "unknown error"); return 1; } plugin = TAILQ_LAST(&plugins, plugin_head); if (!plugin) { warn("Plugin %s failed to register, unloading from memory", sofile); dlclose(handle); return 1; } /* Remember handle from dlopen() for plugin_unregister() */ plugin->handle = handle; return 0; } /** * check_plugin_depends - Check and load any plugins this one depends on. * @plugin: Plugin with possible depends to check * * Very simple dependency resolver, should actually load the plugin of * the correct .name, but currently loads a matching filename. * * Works, but only for now. A better way might be to have a try_load() * that actually loads all plugins and checks their &plugin_t for the * correct .name. */ static void check_plugin_depends(plugin_t *plugin) { int i; for (i = 0; i < PLUGIN_DEP_MAX && plugin->depends[i]; i++) { // dbg("Plugin %s depends on %s ...", plugin->name, plugin->depends[i]); if (plugin_find(plugin->depends[i])) { // dbg("OK plugin %s was already loaded.", plugin->depends[i]); continue; } load_one(plugpath, plugin->depends[i]); } } static int load_plugins(char *path) { struct dirent *entry; int fail = 0; DIR *dp; dp = opendir(path); if (!dp) { if (errno == ENOENT) return 0; warn("Failed, cannot open plugin directory %s: %s", path, strerror(errno)); return 1; } plugpath = path; while ((entry = readdir(dp))) { if (entry->d_name[0] == '.') continue; /* Skip . and .. directories */ if (load_one(path, entry->d_name)) fail++; } closedir(dp); return fail; } #else static int load_plugins(char *path) { print_desc("Initializing plugins", NULL); return 0; } #endif /* ENABLE_STATIC */ int plugin_list(char *buf, size_t len) { #ifndef ENABLE_STATIC plugin_t *p, *tmp; buf[0] = 0; PLUGIN_ITERATOR(p, tmp) { if (buf[0]) strlcat(buf, " ", len); strlcat(buf, p->name, len); } #else buf[0] = 0; #endif return 0; } int plugin_deps(char *buf, size_t len) { #ifndef ENABLE_STATIC plugin_t *p; p = plugin_find(buf); buf[0] = 0; if (p) { int i; for (i = 0; i < PLUGIN_DEP_MAX; i++) { if (!p->depends[i]) continue; if (buf[0]) strlcat(buf, " ", len); strlcat(buf, p->depends[i], len); } } #else buf[0] = 0; #endif return 0; } int plugin_init(uev_ctx_t *ctx) { load_plugins(PLUGIN_PATH); #ifdef EXTERNAL_PLUGIN_PATH char *paths = strdup(EXTERNAL_PLUGIN_PATH); char *path; if (paths) { dbg("Loading external plugins from %s ...", paths); path = strtok(paths, ":"); while (path) { load_plugins(path); path = strtok(NULL, ":"); } free(paths); } plugloaded = 1; #endif return init_plugins(ctx); } void plugin_exit(void) { #ifndef ENABLE_STATIC plugin_t *p, *tmp; PLUGIN_ITERATOR(p, tmp) { if (dlclose(p->handle)) { char *error = dlerror(); warn("Failed unloading plugin %s: %s", p->name, error ? error : "unknown error"); } } plugloaded = 0; #endif } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/conf.h0000644000175100001660000000477115054341541010135 /* Parser for /etc/finit.conf and /etc/finit.d/.conf * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_CONF_H_ #define FINIT_CONF_H_ #include "cgroup.h" #include "svc.h" extern int runlevel; extern int cfglevel; extern int cmdlevel; extern int prevlevel; extern int debug; extern int rescue; extern int single; extern int bootstrap; extern int kerndebug; extern int syncsec; extern int readiness; extern char *fstab; extern char *sdown; extern char *network; extern char *hostname; extern char *runparts; extern char *osheading; extern int logfile_size_max; extern int logfile_count_max; extern struct rlimit global_rlimit[]; extern char cgroup_current[]; int str2rlim(char *str); char *rlim2str(int rlim); int conf_init (uev_ctx_t *ctx); void conf_reload (void); int conf_any_change (void); int conf_changed (char *file); int conf_monitor (void); void conf_reset_env (void); void conf_saverc (void); void conf_save_exec_order (svc_t *svc, char *cmdline, int result); void conf_save_service (int type, char *cfg, char *file); void conf_parse_cmdline (int argc, char *argv[]); char *conf_parse_env (char *line, char **val); int conf_parse_runlevels (char *runlevels); void conf_parse_cond (svc_t *svc, char *cond); #endif /* FINIT_CONF_H_ */ /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/initctl.c0000644000175100001660000010714115054341541010644 /* New client tool, replaces old /dev/initctl API and telinit tool * * Copyright (c) 2015-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "initctl.h" #include "client.h" #include "cond.h" #include "serv.h" #include "service.h" #include "cgutil.h" #include "util.h" #include "utmp-api.h" struct cmd { char *cmd; struct cmd *ctx; int (*cb)(char *arg); int *cond; int (*cb_multiarg)(int argc, char **argv); }; char *finit_conf = NULL; char *finit_rcsd = NULL; int icreate = 0; int iforce = 0; int ionce = 0; int debug = 0; int heading = 1; int json = 0; int noerr = 0; int verbose = 0; int plain = 0; int quiet = 0; int runlevel = 0; int timeout = 0; int cgrp = 0; int utmp = 0; int iw, pw; extern int reboot_main(int argc, char *argv[]); /* figure ut width of IDENT and PID columns */ static void col_widths(void) { char ident[MAX_IDENT_LEN]; char pid[10]; svc_t *svc; iw = 0; pw = 0; for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) { int w, p; svc_ident(svc, ident, sizeof(ident)); w = (int)strlen(ident); if (w > iw) iw = w; p = snprintf(pid, sizeof(pid), "%d", svc->pid); if (p > pw) pw = p; } /* adjust for min col width */ if (iw < 6) iw = 6; if (pw < 3) pw = 3; } void print_header(const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (plain) { int len; vfprintf(stdout, fmt, ap); fputs("\n", stdout); for (len = 0; len < ttcols; len++) fputc('=', stdout); fputs("\n", stdout); } else { char buf[ttcols]; vsnprintf(buf, sizeof(buf), fmt, ap); printheader(stdout, buf, 0); } va_end(ap); } static int runlevel_get(int *prevlevel) { struct init_request rq; int rc; rq.cmd = INIT_CMD_GET_RUNLEVEL; rq.magic = INIT_MAGIC; rc = client_send(&rq, sizeof(rq)); if (!rc) { rc = rq.runlevel; if (prevlevel) *prevlevel = rq.sleeptime; } return rc; } static int toggle_debug(char *arg) { struct init_request rq = { .magic = INIT_MAGIC, .cmd = INIT_CMD_DEBUG, }; return client_send(&rq, sizeof(rq)); } static int do_log(svc_t *svc, char *tail) { const char *logfile = "/var/log/syslog"; pid_t pid; char *nm; if (svc) { nm = svc_ident(svc, NULL, 0); pid = svc->pid; if (!pid) return 0; /* not running */ } else { nm = "finit"; pid = 1; } if (!fexist(logfile)) { logfile = "/var/log/messages"; if (!fexist(logfile)) return 0; /* bail out, maybe in container */ } return systemf("cat %s | grep '\\[%d\\]\\|%s' %s", logfile, pid, nm, tail); } static int show_log(char *arg) { svc_t *svc = NULL; if (arg) { svc = client_svc_find(arg); if (!svc) ERRX(noerr ? 0 : 69, "no such task or service(s): %s", arg); } return do_log(svc, ""); } static int do_runlevel(char *arg) { struct init_request rq = { .magic = INIT_MAGIC, .cmd = INIT_CMD_RUNLVL, }; if (!arg) { int prevlevel = 0; int currlevel; char prev, curr; currlevel = runlevel_get(&prevlevel); switch (currlevel) { case 255: printf("unknown\n"); return 0; case INIT_LEVEL: curr = 'S'; break; default: curr = currlevel + '0'; break; } prev = prevlevel + '0'; if (prev <= '0' || prev > '9') prev = 'N'; printf("%c %c\n", prev , curr); return 0; } /* set runlevel */ rq.runlevel = (int)arg[0]; return client_send(&rq, sizeof(rq)); } static int do_svc(int cmd, char *arg) { struct init_request rq = { .magic = INIT_MAGIC, .cmd = cmd, .data = "", }; if (arg) strlcpy(rq.data, arg, sizeof(rq.data)); return client_send(&rq, sizeof(rq)); } /* * This is a wrapper for do_svc() that adds a simple sanity check of * the service(s) provided as argument. If a service does not exist * we make sure to return an error code. */ static int do_startstop(int cmd, char *arg) { struct init_request rq = { .magic = INIT_MAGIC, .cmd = INIT_CMD_SVC_QUERY }; if (!arg || !arg[0]) ERRX(2, "missing command argument"); strlcpy(rq.data, arg, sizeof(rq.data)); if (client_send(&rq, sizeof(rq))) ERRX(noerr ? 0 : 69, "no such task or service(s): %s", arg); return do_svc(cmd, arg); } static int do_start (char *arg) { return do_startstop(INIT_CMD_START_SVC, arg); } static int do_stop (char *arg) { return do_startstop(INIT_CMD_STOP_SVC, arg); } static int do_reload (char *arg) { if (!arg || !arg[0]) return do_svc(INIT_CMD_RELOAD, NULL); return do_startstop(INIT_CMD_RELOAD_SVC, arg); } static int do_restart(char *arg) { if (do_startstop(INIT_CMD_RESTART_SVC, arg)) ERRX(noerr ? 0 : 7, "failed restarting %s", arg); return 0; } /** * do_signal - Ask finit to send a signal to a service. * @argv: must point to an array of strings, containing a service * and signal name, in that order. * @argc: must be 2. * * A signal can be a complete signal name such as "SIGHUP", or * it can be the shortest unique name, such as "HUP" (no SIG prefix). * It can also be a raw signal number, such as "9" (SIGKILL). */ int do_signal(int argc, char *argv[]) { struct init_request rq = { .magic = INIT_MAGIC, .cmd = INIT_CMD_SVC_QUERY }; int signo; if (argc != 2) ERRX(2, "invalid number of arguments to signal"); strlcpy(rq.data, argv[0], sizeof(rq.data)); if (client_send(&rq, sizeof(rq))) ERRX(noerr ? 0 : 69, "no such task or service(s): %s", argv[0]); signo = str2sig(argv[1]); if (signo == -1) { const char *errstr = NULL; signo = (int)strtonum(argv[1], 1, 31, &errstr); if (errstr) ERRX(65, "%s signal: %s", errstr, argv[1]); } /* Reuse runlevel for signal number. */ rq.magic = INIT_MAGIC; rq.cmd = INIT_CMD_SIGNAL; rq.runlevel = signo; strlcpy(rq.data, argv[0], sizeof(rq.data)); return client_send(&rq, sizeof(rq)); } int dump_once; char *dump_filter; static int dump_one_cond(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf) { const char *cond, *asserted; char *nm = "init"; pid_t pid = 1; if (tflag != FTW_F) return 0; if (!strcmp(fpath, _PATH_RECONF)) return 0; asserted = condstr(cond_get_path(fpath)); cond = &fpath[strlen(_PATH_COND)]; if (dump_filter && dump_filter[0] && strncmp(cond, dump_filter, strlen(dump_filter))) return 0; if (strncmp("pid/", cond, 4) == 0) { svc_t *svc; svc = client_svc_find_by_cond(cond); if (!svc) { nm = "unknown"; pid = 0; } else { nm = svc_ident(svc, NULL, 0); pid = svc->pid; } } else if (strncmp("usr/", cond, 4) == 0) { nm = "static"; pid = 0; } else if (strncmp("hook/", cond, 4) == 0) { nm = "static"; pid = 1; } if (json) { if (!dump_once) puts("["); printf("%s {\n" " \"pid\": %d,\n" " \"identity\": \"%s\",\n" " \"status\": \"%s\",\n" " \"condition\": \"%s\"\n" " }", dump_once ? ",\n" : "", pid, nm, asserted, cond); dump_once++; } else printf("%-*d %-*s %-6s <%s>\n", pw, pid, iw, nm, asserted, cond); return 0; } static int do_cond_dump(char *arg) { col_widths(); if (heading && !json) print_header("%-*s %-*s %-6s %s", pw, "PID", iw, "IDENT", "STATUS", "CONDITION"); dump_once = 0; dump_filter = arg; if (nftw(_PATH_COND, dump_one_cond, 20, 0) == -1) { WARNX("Failed parsing %s", _PATH_COND); return 1; } if (dump_once) puts("\n]"); return 0; } typedef enum { COND_CLR, COND_SET, COND_GET } condop_t; static cond_state_t cond_read(char *path) { int now, gen; if (fngetint(path, &gen) == -1) return COND_OFF; /* * if we cannot read the reconf generation, then either sth is * very wrong, or we are called very early/late boot/shutdown. */ if (fngetint(_PATH_RECONF, &now) == -1) return COND_FLUX; /* classify as flux */ if (now != gen) return COND_FLUX; return COND_ON; } /* * cond get allows only one argument * cond set|clr iterate over multiple args */ static int do_cond_act(char *args, condop_t op) { cond_state_t cstate; char path[256]; char *arg; if (!args || !args[0]) ERRX(2, "Invalid condition (empty)"); arg = strtok(args, " \t"); while (arg) { size_t off; if (strncmp(arg, COND_USR, strlen(COND_USR)) == 0) arg += strlen(COND_USR); /* allowed to read any condition, but not set/clr */ if (op != COND_GET) { if (strchr(arg, '/')) ERRX(2, "Invalid condition (slashes)"); if (strchr(arg, '.')) ERRX(2, "Invalid condition (periods)"); } if (strchr(arg, '/')) snprintf(path, sizeof(path), _PATH_COND "%s", arg); else snprintf(path, sizeof(path), _PATH_CONDUSR "%s", arg); off = strlen(_PATH_COND); switch (op) { case COND_GET: cstate = cond_read(path); if (verbose) puts(condstr(cstate)); switch (cstate) { case COND_ON: return 0; case COND_OFF: return 1; case COND_FLUX: default: break; } return 255; case COND_SET: if (symlink(_PATH_RECONF, path) && errno != EEXIST) ERR(73, "Failed asserting condition <%s>", &path[off]); break; case COND_CLR: if (erase(path) && errno != ENOENT) ERR(73, "Failed deasserting condition <%s>", &path[off]); break; } arg = strtok(NULL, " \t"); } return 0; } static int do_cond_get(char *arg) { return do_cond_act(arg, COND_GET); } static int do_cond_set(char *arg) { return do_cond_act(arg, COND_SET); } static int do_cond_clr(char *arg) { return do_cond_act(arg, COND_CLR); } static char *svc_cond(svc_t *svc, char *buf, size_t len, int ansi) { char *cond, *conds; buf[0] = 0; if (!svc->cond[0]) return buf; conds = strdupa(svc->cond); if (!conds) return buf; if (json) strlcat(buf, "[ ", len); for (cond = strtok(conds, ","); cond; cond = strtok(NULL, ",")) { if (cond != conds) { strlcat(buf, ",", len); if (json) strlcat(buf, " ", len); } if (json) strlcat(buf, "\"", len); switch (cond_get(cond)) { case COND_ON: strlcat(buf, "+", len); strlcat(buf, cond, len); break; case COND_FLUX: if (ansi) strlcat(buf, "\e[1m", len); strlcat(buf, "~", len); strlcat(buf, cond, len); if (ansi) strlcat(buf, "\e[0m", len); break; case COND_OFF: if (ansi) strlcat(buf, "\e[1m", len); strlcat(buf, "-", len); strlcat(buf, cond, len); if (ansi) strlcat(buf, "\e[0m", len); break; } if (json) strlcat(buf, "\"", len); } if (json) strlcat(buf, " ]", len); return buf; } static int do_cond_show(char *arg) { enum cond_state cond; char buf[512]; int once = 0; svc_t *svc; col_widths(); if (heading && !json) print_header("%-*s %-*s %-6s %s", pw, "PID", iw, "IDENT", "STATUS", "CONDITION (+ ON, ~ FLUX, - OFF)"); for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) { if (!svc->cond[0]) continue; cond = cond_get_agg(svc->cond); svc_ident(svc, buf, sizeof(buf)); if (json) { if (!once) puts("["); printf("%s {\n" " \"pid\": %d,\n" " \"identity\": \"%s\",\n" " \"status\": \"%s\",\n", once ? ",\n" : "", svc->pid, buf, condstr(cond)); svc_cond(svc, buf, sizeof(buf), !plain); printf(" \"condition\": %s\n" " }", buf); once++; continue; } printf("%-*d %-*s ", pw, svc->pid, iw, buf); if (cond == COND_ON) printf("%-6.6s ", condstr(cond)); else printf("\e[1m%-6.6s\e[0m ", condstr(cond)); svc_cond(svc, buf, sizeof(buf), !plain); if (buf[0]) printf("<%s>", buf); puts(""); } if (json && once) puts("\n]"); return 0; } static int do_cmd(int cmd) { struct init_request rq = { .magic = INIT_MAGIC, .cmd = cmd, .sleeptime = timeout, }; if (client_send(&rq, sizeof(rq))) { if (rq.cmd == INIT_CMD_NACK) puts(rq.data); return 1; } /* Wait here for systemd to shutdown/reboot */ sleep(5); return 0; } int do_reboot (char *arg) { return do_cmd(INIT_CMD_REBOOT); } int do_halt (char *arg) { return do_cmd(INIT_CMD_HALT); } int do_poweroff(char *arg) { return do_cmd(INIT_CMD_POWEROFF); } int do_suspend (char *arg) { return do_cmd(INIT_CMD_SUSPEND); } int utmp_show(char *file) { struct utmp *ut; time_t sec; if (heading) { static int once = 0; print_header("%s%s ", once ? "\n" : "", file); once++; } utmpname(file); setutent(); while ((ut = getutent())) { char user[sizeof(ut->ut_user) + 1]; char id[sizeof(ut->ut_id) + 1]; struct tm *sectm; char when[80]; char addr[64]; int pid; strlcpy(id, ut->ut_id, sizeof(id)); strlcpy(user, ut->ut_user, sizeof(user)); sec = ut->ut_tv.tv_sec; sectm = localtime(&sec); strftime(when, sizeof(when), "%F %T", sectm); pid = ut->ut_pid; if (ut->ut_addr_v6[1] || ut->ut_addr_v6[2] || ut->ut_addr_v6[3]) inet_ntop(AF_INET6, ut->ut_addr_v6, addr, sizeof(addr)); else inet_ntop(AF_INET, &ut->ut_addr, addr, sizeof(addr)); printf("[%d] [%05d] [%-4.4s] [%-8.8s] [%-12.12s] [%-20.20s] [%-15.15s] [%-19.19s]\n", ut->ut_type, pid, id, user, ut->ut_line, ut->ut_host, addr, when); } endutent(); return 0; } static int do_utmp(char *file) { if (!utmp) return 1; if (fexist(file)) return utmp_show(file); return utmp_show(_PATH_WTMP) || utmp_show(_PATH_UTMP); } static int show_version(char *arg) { puts(PACKAGE_STRING); printf("Bug report address: %-40s\n", PACKAGE_BUGREPORT); #ifdef PACKAGE_URL printf("Project homepage: %s\n", PACKAGE_URL); #endif return 0; } static int plugins_list(char *arg) { struct init_request rq = { .magic = INIT_MAGIC, .cmd = INIT_CMD_GET_PLUGINS, }; char buf[sizeof(rq.data) + 1]; char *ptr; int rc; rc = client_send(&rq, sizeof(rq)); if (rc) { if (rc == 255) return 69; else ERRX(69, "No such command"); } memcpy(buf, rq.data, sizeof(buf) - 1); buf[sizeof(rq.data)] = 0; if (heading) print_header("%-18s %s", "PLUGIN", "DEPENDENCIES"); ptr = strtok(buf, " "); while (ptr) { rq.cmd = INIT_CMD_PLUGIN_DEPS; strlcpy(rq.data, ptr, sizeof(rq.data)); rc = client_send(&rq, sizeof(rq)); if (rc) printf("%s\n", ptr); else printf("%-18s %s\n", ptr, rq.data); ptr = strtok(NULL, " "); } return 0; } /** * runlevel_string - Convert a bit encoded runlevel to .conf syntax * @levels: Bit encoded runlevels * * Returns: * Pointer to string on the form [2345], may be up to 12 chars long, * plus escape sequences for highlighting current runlevel. */ char *runlevel_string(int currlevel, int levels) { static char lvl[32]; int i = INIT_LEVEL; strlcpy(lvl, "[", sizeof(lvl)); do { if (ISSET(levels, i)) { char l[2] = { '0' + i, 0 }; if (!plain && currlevel == i) strlcat(lvl, "\e[1m", sizeof(lvl)); strlcat(lvl, i == INIT_LEVEL ? "S" : l, sizeof(lvl)); if (!plain && currlevel == i) strlcat(lvl, "\e[0m", sizeof(lvl)); } else { strlcat(lvl, "-", sizeof(lvl)); } /* XXX: ugly hack to get order right: S0123456789 */ if (i == INIT_LEVEL) i = 0; else i++; } while (i < INIT_LEVEL); strlcat(lvl, "]", sizeof(lvl)); return lvl; } char *runlevel_arr(int levels) { static char lvl[42]; int i = INIT_LEVEL; int p = 2, s = 0; strlcpy(lvl, "[ ", sizeof(lvl)); do { if (ISSET(levels, i)) { if (i == INIT_LEVEL) p += snprintf(&lvl[p], sizeof(lvl) - p, "\"S\""); else p += snprintf(&lvl[p], sizeof(lvl) - p, "%s%c", s ? ", " : "", '0' + i); s++; } /* XXX: ugly hack to get order right: S0123456789 */ if (i == INIT_LEVEL) i = 0; else i++; } while (i < INIT_LEVEL); strlcat(lvl, " ]", sizeof(lvl)); return lvl; } static int missing(svc_t *svc) { if (svc->state == SVC_HALTED_STATE && svc_is_missing(svc)) return 1; return 0; } static char *svc_command(svc_t *svc, char *buf, size_t len, int ansi) { int bold = missing(svc) && ansi; if (whichp(svc->cmd)) bold = 0; strlcpy(buf, bold ? "\e[1m" : "", len); strlcat(buf, svc->cmd, len); for (int i = 1; i < MAX_NUM_SVC_ARGS; i++) { if (!svc->args[i][0]) break; strlcat(buf, " ", len); strlcat(buf, svc->args[i], len); } if (svc_is_sysv(svc)) { char *cmd = svc->state == SVC_HALTED_STATE ? "stop" : "start"; strlcat(buf, " ", len); strlcat(buf, cmd, len); } strlcat(buf, bold ? "\e[0m" : "", len); return buf; } static char *svc_environ(svc_t *svc, char *buf, size_t len, int ansi) { int bold = missing(svc); if (!ansi || svc_checkenv(svc)) bold = 0; strlcpy(buf, bold ? "\e[1m" : "", len); strlcat(buf, svc->env, len); strlcat(buf, bold ? "\e[0m" : "", len); return buf; } static char *exit_status(svc_t *svc, char *buf, size_t len) { int rc, sig; char *str; rc = WEXITSTATUS(svc->status); sig = WTERMSIG(svc->status); if (WIFEXITED(svc->status)) { str = code2str(rc); snprintf(buf, len, " (code=exited, status=%d%s%s%s)", rc, str[0] ? "/" : "", str, svc->manual ? ", manual=yes" : ""); } else if (WIFSIGNALED(svc->status)) { str = sig2str(sig); snprintf(buf, len, " (code=signal, status=%d%s%s)", sig, str[0] ? "/" : "", str); } return buf; } static char *status(svc_t *svc, int full) { static char buf[96]; const char *color; char ok[48] = {0}; char *s; s = svc_status(svc); switch (svc->state) { case SVC_HALTED_STATE: exit_status(svc, ok, sizeof(ok)); color = "\e[1m"; break; case SVC_RUNNING_STATE: color = "\e[1;32m"; break; case SVC_DONE_STATE: exit_status(svc, ok, sizeof(ok)); if (WIFEXITED(svc->status)) { if (WEXITSTATUS(svc->status)) color = "\e[1;31m"; else color = "\e[1;32m"; } else { if (full && WIFSIGNALED(svc->status)) color = "\e[1;31m"; else color = "\e[1;33m"; } break; default: exit_status(svc, ok, sizeof(ok)); color = "\e[1;33m"; break; } if (!full || plain) color = NULL; if (!full) snprintf(buf, sizeof(buf), "%-8.8s", s); else snprintf(buf, sizeof(buf), "%s%s%s%s", color ? color : "", s, ok, color ? "\e[0m" : ""); return buf; } static void show_cgroup_tree(char *group, char *pfx) { char path[256]; if (!group) { puts(""); return; } strlcpy(path, FINIT_CGPATH, sizeof(path)); strlcat(path, group, sizeof(path)); cgroup_tree(path, pfx, 0, 0); } /* * arg: 'foo' should match foo:1 foo:2, etc. but not foobar * arg: 'foo:1' should only match foo:1 * arg: 'foo:' is allowed to fail, unsupported syntax atm * arg: 'foo:*' is allowed to fail, unsupported syntax atm */ static int svc_compare(svc_t *svc, char *arg) { char ident[MAX_IDENT_LEN]; char *ptr; svc_ident(svc, ident, sizeof(ident)); ptr = strchr(ident, ':'); if (ptr && !strchr(arg, ':')) *ptr = 0; if (!strcmp(ident, arg)) return 1; return 0; } static int json_status_one(FILE *fp, svc_t *svc, char *indent, int prev) { long now = jiffies(); char *pidfn = NULL; char buf[512]; pidfn = svc->pidfile; if (pidfn[0] == '!') pidfn++; else if (pidfn[0] == 0) pidfn = "none"; fprintf(fp, "%s" "%s{\n" "%s \"identity\": \"%s\",\n" "%s \"description\": \"%s\",\n" "%s \"type\": \"%s\",\n" "%s \"forking\": %s,\n" "%s \"status\": \"%s\",\n", prev ? ",\n" : indent, prev ? indent : "", indent, svc_ident(svc, NULL, 0), indent, svc->desc, indent, svc_typestr(svc), indent, svc->forking ? "true" : "false", indent, svc_status(svc)); if (svc->state != SVC_RUNNING_STATE) { int rc, sig; rc = WEXITSTATUS(svc->status); sig = WTERMSIG(svc->status); if (WIFEXITED(svc->status)) fprintf(fp, "%s \"exit\": { \"%s\": %d },\n", indent, "code", rc); else if (WIFSIGNALED(svc->status)) fprintf(fp, "%s \"exit\": { \"%s\": %d },\n", indent, "signal", sig); } fprintf(fp, "%s \"origin\": \"%s\",\n" "%s \"command\": \"%s\",\n", indent, svc->file[0] ? svc->file : "built-in", indent, svc_command(svc, buf, sizeof(buf), 0)); svc_environ(svc, buf, sizeof(buf), 0); if (buf[0]) fprintf(fp, "%s \"environment\": \"%s\",\n", indent, buf); svc_cond(svc, buf, sizeof(buf), 0); if (buf[0]) fprintf(fp, "%s \"condition\": %s,\n", indent, buf); if (svc->manual) fprintf(fp, "%s \"starts\": %d,\n", indent, svc->once); fprintf(fp, "%s \"restarts\": %d,\n", indent, svc->restart_tot); /* XXX: add restart_cnt and restart_max */ fprintf(fp, "%s \"pidfile\": \"%s\",\n" "%s \"pid\": %d,\n" "%s \"user\": \"%s\",\n" "%s \"group\": \"%s\",\n" "%s \"uptime\": %ld,\n" "%s \"runlevels\": %s\n" "%s}", indent, pidfn, indent, svc->pid, indent, svc->username, indent, svc->group, indent, svc->pid ? now - svc->start_time : 0, indent, runlevel_arr(svc->runlevels), indent); return 0; } static int show_status(char *arg) { char ident[MAX_IDENT_LEN]; char buf[512]; int num = 0; svc_t *svc; runlevel = runlevel_get(NULL); while (arg && arg[0]) { long now = jiffies(); char uptm[42] = "N/A"; char *pidfn = NULL; for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) num += svc_compare(svc, arg); if (num > 1) break; svc = client_svc_find(arg); if (!svc) ERRX(noerr ? 0 : 69, "no such task or service(s): %s", arg); if (quiet) { if (svc_is_runtask(svc)) { if (svc->started) return 0; return 1; } return svc->state != SVC_RUNNING_STATE; } if (json) { int rc; rc = json_status_one(stdout, svc, "", 0); puts(""); return rc; } pidfn = svc->pidfile; if (pidfn[0] == '!') pidfn++; else if (pidfn[0] == 0) pidfn = "none"; printf(" Status : %s\n", status(svc, 1)); printf(" Identity : %s\n", svc_ident(svc, ident, sizeof(ident))); printf("Description : %s\n", svc->desc); printf(" Origin : %s\n", svc->file[0] ? svc->file : "built-in"); svc_environ(svc, buf, sizeof(buf), !plain); if (buf[0]) printf("Environment : %s\n", buf); svc_cond(svc, buf, sizeof(buf), !plain); if (buf[0]) printf("Condition(s): <%s>\n", buf); printf(" Command : %s\n", svc_command(svc, buf, sizeof(buf), !plain)); printf(" PID file : %s\n", pidfn); printf(" PID : %d\n", svc->pid); printf(" User : %s\n", svc->username); printf(" Group : %s\n", svc->group); printf(" Uptime : %s\n", svc->pid ? uptime(now - svc->start_time, uptm, sizeof(uptm)) : uptm); if (svc->manual) printf(" Starts : %d\n", svc->once); printf(" Restarts : %d (%d/%d)\n", svc->restart_tot, svc->restart_cnt, svc->restart_max); printf(" Runlevels : %s\n", runlevel_string(runlevel, svc->runlevels)); if (cgrp && svc->pid > 1) { const struct cg *cg; char path[256]; char *group; group = pid_cgroup(svc->pid); if (!group) goto no_cgroup; /* ... or PID doesn't exist (anymore) */ snprintf(path, sizeof(path), "%s/%s", FINIT_CGPATH, group); cg = cg_conf(path); printf(" Memory : %s\n", memsz(cgroup_memory(group), uptm, sizeof(uptm))); printf(" CGroup : %s cpu %s [%s, %s] mem [%s, %s]\n", group, cg->cg_cpu.set, cg->cg_cpu.weight, cg->cg_cpu.max, cg->cg_mem.min, cg->cg_mem.max); show_cgroup_tree(group, " "); free(group); } no_cgroup: printf("\n"); return do_log(svc, "| tail -10"); } if (json) { int prev = 0; for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) { svc_ident(svc, ident, sizeof(ident)); if (num && !svc_compare(svc, arg)) continue; if (!prev) fputs("[\n", stdout); json_status_one(stdout, svc, " ", prev++); } if (prev) fputs("\n]\n", stdout); return 0; } col_widths(); if (heading) { char title[80]; snprintf(title, sizeof(title), "%-*s %-*s %-8s %-13s ", pw, "PID", iw, "IDENT", "STATUS", "RUNLEVELS"); if (!verbose) strlcat(title, "DESCRIPTION", sizeof(title)); else strlcat(title, "COMMAND", sizeof(title)); print_header("%s", title); } for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) { char *lvls; svc_ident(svc, ident, sizeof(ident)); if (num && !svc_compare(svc, arg)) continue; printf("%-*d ", pw, svc->pid); printf("%-*s %s ", iw, ident, status(svc, 0)); lvls = runlevel_string(runlevel, svc->runlevels); if (strchr(lvls, '\e')) printf("%-21.21s ", lvls); else printf("%-13.13s ", lvls); if (!verbose) puts(svc->desc); else puts(svc_command(svc, buf, sizeof(buf), !plain)); } return 0; } static int show_ident(char *arg) { svc_t *svc; for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) { char ident[MAX_IDENT_LEN]; size_t len; char *pos; svc_ident(svc, ident, sizeof(ident)); pos = strchr(ident, ':'); if (pos) len = pos - ident; else len = strlen(ident); if (arg && arg[0] && strncasecmp(ident, arg, len)) continue; puts(ident); } return 0; } static int transform(char *nm) { char *names[] = { "reboot", "shutdown", "poweroff", "halt", "suspend", NULL }; size_t i; for (i = 0; names[i]; i++) { if (!strcmp(nm, names[i])) return 1; } return 0; } static int has_conf(char *path, size_t len, char *name) { paste(path, len, finit_rcsd, name); if (!fisdir(path)) { strlcpy(path, finit_rcsd, len); return 0; } return 1; } static int usage(int rc) { int has_rcsd = fisdir(finit_rcsd); int has_ena; char avail[256]; char ena[256]; has_conf(avail, sizeof(avail), "available"); has_ena = has_conf(ena, sizeof(ena), "enabled"); fprintf(stderr, "Usage: %s [OPTIONS] [COMMAND]\n" "\n" "Options:\n" " -b, --batch Batch mode, no screen size probing\n" " -c, --create Create missing paths (and files) as needed\n" " -f, --force Ignore missing files and arguments, never prompt\n" " -h, --help This help text\n" " -j, --json JSON output in 'status' and 'cond' commands\n" " -n, --noerr Ignore error, e.g., already started/enabled/...\n" " -1, --once Only one lap in commands like 'top'\n" " -p, --plain Use plain table headings, no ctrl chars\n" " -q, --quiet Silent, only return status of command\n" " -t, --no-heading Skip table headings\n" " -v, --verbose Verbose output\n" " -V, --version Show program version\n" "\n" "Commands:\n" " debug Toggle Finit (daemon) debug\n" " help This help text\n" " version Show program version\n" "\n", prognm); if (has_rcsd) fprintf(stderr, " ls | list List all .conf in %s\n" " create Create .conf in %s\n" " delete Delete .conf in %s\n" " show Show .conf in %s\n" " edit Edit .conf in %s\n" " touch Change .conf in %s\n", finit_rcsd, avail, avail, avail, avail, avail); else fprintf(stderr, " show Show %s\n", finit_conf); if (has_ena) fprintf(stderr, " enable Enable .conf in %s\n", avail); if (has_ena) fprintf(stderr, " disable Disable .conf in %s\n", ena); if (has_rcsd) fprintf(stderr, " reload Reload *.conf in %s (activate changes)\n", finit_rcsd); else fprintf(stderr, " reload Reload %s (activate changes)\n", finit_conf); fprintf(stderr, "\n" " cond set Set (assert) user-defined conditions +usr/COND\n" " cond get Get status of user-defined condition, see $? and -v\n" " cond clear Clear (deassert) user-defined conditions -usr/COND\n" " cond status Show condition status, default cond command\n" " cond dump [TYPE] Dump all, or a type of, conditions and their status\n" "\n" " log [NAME] Show ten last Finit, or NAME, messages from syslog\n" " start [:ID] Start service by name, with optional ID\n" " stop [:ID] Stop/Pause a running service by name\n" " reload [:ID] Reload service as if .conf changed (SIGHUP or restart)\n" " This allows restart of run/tasks that have already run\n" " Note: Finit .conf file(s) are *not* reloaded!\n" " restart [:ID] Restart (stop/start) service by name\n" " kill [:ID] Send signal S to service by name, with optional ID\n" " ident [NAME] Show matching identities for NAME, or all\n" " status [:ID] Show service status, by name\n" " status Show status of services, default command\n"); if (cgrp) fprintf(stderr, "\n" " cgroup List cgroup config overview\n" " ps List processes based on cgroups\n" " top Show top-like listing based on cgroups\n"); fprintf(stderr, "\n" " plugins List installed plugins\n" "\n" " runlevel [0-9] Show or set runlevel: 0 halt, 6 reboot\n" " reboot Reboot system\n" " halt Halt system\n" " poweroff Halt and power off system\n" " suspend Suspend system\n"); if (utmp) fprintf(stderr, "\n" " utmp show Raw dump of UTMP/WTMP db\n"); fprintf(stderr, "\n"); return rc; } static int do_devel(char *arg) { (void)arg; printf("Screen %dx%d\n", ttcols, ttrows); return 0; } static int do_help(char *arg) { return usage(0); } static int cmd_cond(struct cmd *cmd) { if (!cmd || !cmd->cond) return 1; return *cmd->cond; } static int cmd_parse(int argc, char *argv[], struct cmd *command) { int i, j; for (i = 0; argc > 0 && command[i].cmd; i++) { if (!cmd_cond(&command[i])) continue; if (!string_compare(command[i].cmd, argv[0])) continue; if (command[i].ctx) return cmd_parse(argc - 1, &argv[1], command[i].ctx); if (command[i].cb_multiarg) return command[i].cb_multiarg(argc - 1, argv + 1); if (command[i].cb) { int rc = 0; if (argc == 1) return command[i].cb(NULL); for (j = 1; j < argc; j++) rc |= command[i].cb(argv[j]); return rc; } } if (argv[0] && strlen(argv[0]) > 0) ERRX(3, "No such command. See 'initctl help' for an overview of available commands."); return command[0].cb(NULL); /* default cmd */ } static void cleanup(void) { if (finit_conf) free(finit_conf); if (finit_rcsd) free(finit_rcsd); } static void sourcerc(void) { char *line; FILE *fp; fp = fopen(_PATH_VARRUN "finit/.initrc", "r"); if (!fp) goto fallback; while ((line = fparseln(fp, NULL, NULL, NULL, 0))) { char *val; if ((val = fgetval(line, "FINIT_CONF", "="))) { if (finit_conf) free(finit_conf); finit_conf = val; } if ((val = fgetval(line, "FINIT_RCSD", "="))) { if (finit_rcsd) free(finit_rcsd); finit_rcsd = val; } free(line); } fallback: if (!finit_conf) finit_conf = strdup(FINIT_CONF); if (!finit_rcsd) finit_rcsd = strdup(FINIT_RCSD); atexit(cleanup); } int main(int argc, char *argv[]) { struct option long_options[] = { { "batch", 0, NULL, 'b' }, { "create", 0, NULL, 'c' }, { "debug", 0, NULL, 'd' }, { "force", 0, NULL, 'f' }, { "help", 0, NULL, 'h' }, { "json", 0, NULL, 'j' }, { "noerr", 0, NULL, 'n' }, { "once", 0, NULL, '1' }, { "plain", 0, NULL, 'p' }, { "quiet", 0, NULL, 'q' }, { "no-heading", 0, NULL, 't' }, { "verbose", 0, NULL, 'v' }, { "version", 0, NULL, 'V' }, { NULL, 0, NULL, 0 } }; struct cmd cond[] = { { "status", NULL, do_cond_show, NULL, NULL }, /* default cmd */ { "dump", NULL, do_cond_dump, NULL, NULL }, { "set", NULL, do_cond_set, NULL, NULL }, { "get", NULL, do_cond_get, NULL, NULL }, { "clr", NULL, do_cond_clr, NULL, NULL }, { "clear", NULL, do_cond_clr, NULL, NULL }, { NULL, NULL, NULL, NULL, NULL } }; struct cmd command[] = { { "status", NULL, show_status, NULL, NULL }, /* default cmd */ { "ident", NULL, show_ident, NULL, NULL }, { "debug", NULL, toggle_debug, NULL, NULL }, { "devel", NULL, do_devel, NULL, NULL }, { "help", NULL, do_help, NULL, NULL }, { "version", NULL, show_version, NULL, NULL }, { "list", NULL, serv_list, NULL, NULL }, { "ls", NULL, serv_list, NULL, NULL }, { "enable", NULL, serv_enable, NULL, NULL }, { "disable", NULL, serv_disable, NULL, NULL }, { "touch", NULL, serv_touch, NULL, NULL }, { "show", NULL, serv_show, NULL, NULL }, { "cat", NULL, serv_show, NULL, NULL }, /* alias */ { "edit", NULL, serv_edit, NULL, NULL }, { "create", NULL, serv_creat, NULL, NULL }, { "delete", NULL, serv_delete, NULL, NULL }, { "reload", NULL, do_reload, NULL, NULL }, { "cond", cond, NULL, NULL, NULL }, { "log", NULL, show_log, NULL, NULL }, { "start", NULL, do_start, NULL, NULL }, { "stop", NULL, do_stop, NULL, NULL }, { "restart", NULL, do_restart, NULL, NULL }, { "signal", NULL, NULL, NULL, do_signal }, { "kill", NULL, NULL, NULL, do_signal }, /* alias */ { "cgroup", NULL, show_cgroup, &cgrp, NULL }, { "ps", NULL, show_cgps, &cgrp, NULL }, { "top", NULL, show_cgtop, &cgrp, NULL }, { "plugins", NULL, plugins_list, NULL, NULL }, { "runlevel", NULL, do_runlevel, NULL, NULL }, { "reboot", NULL, do_reboot, NULL, NULL }, { "halt", NULL, do_halt, NULL, NULL }, { "poweroff", NULL, do_poweroff, NULL, NULL }, { "suspend", NULL, do_suspend, NULL, NULL }, { "utmp", NULL, do_utmp, &utmp, NULL }, { NULL, NULL, NULL, NULL, NULL } }; int interactive = 1, c; if (transform(progname(argv[0]))) return reboot_main(argc, argv); /* Enable functionality depending on system capabilities */ sourcerc(); cgrp = cgroup_avail(); utmp = has_utmp(); while ((c = getopt_long(argc, argv, "1bcdfh?jnpqtvV", long_options, NULL)) != EOF) { switch(c) { case '1': ionce = 1; break; case 'b': interactive = 0; break; case 'c': icreate = 1; break; case 'd': debug = 1; break; case 'f': iforce = 1; break; case 'h': case '?': return usage(0); case 'j': json = 1; break; case 'n': noerr = 1; break; case 'p': plain = 1; break; case 'q': quiet = 1; break; case 't': heading = 0; break; case 'v': verbose = 1; break; case 'V': return show_version(NULL); } } if (interactive) ttinit(); return cmd_parse(argc - optind, &argv[optind], command); } void logit(int prio, const char *fmt, ...) { va_list ap; if (quiet) return; va_start(ap, fmt); if (prio <= LOG_ERR) verrx(1, fmt, ap); else vwarnx(fmt, ap); va_end(ap); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/getty.c0000644000175100001660000002261615054341541010335 /* Initialize and serve a login terminal * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include /* LOGIN_NAME_MAX */ #include #include #include #include #include #include #include /* Not included by default in musl libc */ #include #include #include /* sysconf() */ #include "finit.h" #include "helpers.h" #include "utmp-api.h" #ifndef _PATH_LOGIN #define _PATH_LOGIN "/bin/login" #endif #ifndef LOGIN_NAME_MIN #define LOGIN_NAME_MIN 64 #endif struct osrel { char name[32]; char pretty[64]; char id[32]; char version[32]; char version_id[32]; char home_url[128]; char doc_url[128]; char bug_url[128]; char support_url[128]; }; static long logname_len = 32; /* useradd(1) limit at 32 chars */ static int passenv = 0; /* Set /bin/login -p or not */ static void get_val(char *line, const char *key, char *buf, size_t len) { char *val; if ((val = fgetval(line, key, "="))) { strlcpy(buf, val, len); free(val); } } /* * Parse os-release */ static int osrel(struct osrel *rel) { char codename[30]; char *line; FILE *fp; fp = fopen("/etc/os-release", "r"); if (!fp) { fp = fopen("/usr/lib/os-release", "r"); if (!fp) return -1; } memset(rel->version, 0, sizeof(rel->version)); memset(codename, 0, sizeof(codename)); while ((line = fparseln(fp, NULL, NULL, NULL, 0))) { get_val(line, "NAME", rel->name, sizeof(rel->name)); get_val(line, "PRETTY_NAME", rel->pretty, sizeof(rel->pretty)); get_val(line, "ID", rel->id, sizeof(rel->id)); get_val(line, "VERSION", rel->version, sizeof(rel->version)); get_val(line, "VERSION_ID", rel->version_id, sizeof(rel->version_id)); get_val(line, "VERSION_CODENAME", codename, sizeof(codename)); get_val(line, "HOME_URL", rel->home_url, sizeof(rel->home_url)); get_val(line, "DOCUMENTATION_URL", rel->doc_url, sizeof(rel->doc_url)); get_val(line, "SUPPORT_URL", rel->support_url, sizeof(rel->support_url)); get_val(line, "BUG_REPORT_URL", rel->bug_url, sizeof(rel->bug_url)); free(line); } fclose(fp); /* * Many distros don't set VERSION or VERSION_ID for their * rolling, or unstable, branches. However, most set the * version code name, so we use that as VERSION. */ if (!rel->version[0] && codename[0]) { if (codename[0] == '(') strlcpy(rel->version, codename, sizeof(rel->version)); else snprintf(rel->version, sizeof(rel->version), "(%s)", codename); } if (rel->id[0] && !strcmp(rel->id, "alpine")) return 1; /* compat mode for \r et al. */ return 0; } /* * Read one character from stdin. */ static int readch(void) { char ch1; int st; st = read(STDIN_FILENO, &ch1, 1); if (st <= 0) return -1; return ch1 & 0xFF; } /* * Parse and display a line from /etc/issue * * Includes Finit-specific extensions to display information from * /etc/os-release instead of relying on legacy uname. Activated * only if /etc/os-release or /usr/lib/os-release exist. * * https://www.unix.com/man-page/Linux/8/getty/ * https://www.systutorials.com/docs/linux/man/8-mingetty/ */ static void parseln(char *line, struct utsname *uts, struct osrel *rel, char *tty, int compat) { char buf[32] = { 0 }; char *s, *s0; time_t now; s0 = line; for (s = line; *s != 0; s++) { if (*s == '\\') { if ((s - s0) > 0) dprint(STDOUT_FILENO, s0, s - s0); s0 = s + 2; switch (*++s) { case 'B': if (!compat) dprint(STDOUT_FILENO, rel->bug_url, 0); break; case 'D': if (!compat) dprint(STDOUT_FILENO, rel->doc_url, 0); break; case 'H': if (!compat) dprint(STDOUT_FILENO, rel->home_url, 0); break; case 'I': if (!compat) dprint(STDOUT_FILENO, rel->id, 0); break; case 'l': dprint(STDOUT_FILENO, tty, 0); break; case 'm': dprint(STDOUT_FILENO, uts->machine, 0); break; case 'N': if (!compat) dprint(STDOUT_FILENO, rel->name, 0); break; case 'n': dprint(STDOUT_FILENO, uts->nodename, 0); break; #ifdef _GNU_SOURCE case 'o': dprint(STDOUT_FILENO, uts->domainname, 0); break; #endif case 'r': if (compat) dprint(STDOUT_FILENO, uts->release, 0); else dprint(STDOUT_FILENO, rel->version_id, 0); break; case 'S': if (!compat) dprint(STDOUT_FILENO, rel->support_url, 0); break; case 's': if (compat) dprint(STDOUT_FILENO, uts->sysname, 0); else dprint(STDOUT_FILENO, rel->pretty, 0); break; case 't': now = time(NULL); ctime_r(&now, buf); dprint(STDOUT_FILENO, chomp(buf), 0); break; case 'v': if (compat) dprint(STDOUT_FILENO, uts->version, 0); else dprint(STDOUT_FILENO, rel->version, 0); break; case 0: goto leave; default: s0 = s - 1; } } } leave: if ((s - s0) > 0) dprint(STDOUT_FILENO, s0, s - s0); } /* * Parse and display /etc/issue */ static void issue(char *tty) { char buf[BUFSIZ] = "Welcome to \\s \\v \\n \\l\n\n"; struct utsname uts; struct osrel rel; int compat; FILE *fp; /* * Get data about this machine. */ uname(&uts); compat = osrel(&rel); fp = fopen("/etc/issue", "r"); if (fp) { while (fgets(buf, sizeof(buf), fp)) parseln(buf, &uts, &rel, tty, compat); fclose(fp); } else { parseln(buf, &uts, &rel, tty, compat); } parseln("\\n login: ", &uts, &rel, tty, compat); } /* * Handle the process of a GETTY. */ static int get_logname(char *tty, char *name, size_t len) { char *np; int ch; /* * Display prompt. */ ch = ' '; *name = '\0'; while (ch != '\n') { issue(tty); np = name; while ((ch = readch()) != '\n') { if (ch < 0) return 1; if (np < name + len) *np++ = ch; } *np = '\0'; if (*name == '\0') ch = ' '; /* blank line typed! */ } name[len - 1] = 0; return 0; } /* * Start login(1) with the current username as its argument. It replies * to the calling user by typing "Password: " ... */ static int exec_login(char *name) { struct stat st; if (passenv) execl(_PATH_LOGIN, _PATH_LOGIN, "-p", "--", name, NULL); else execl(_PATH_LOGIN, _PATH_LOGIN, "--", name, NULL); /* * Failed to exec login, should not happen on normal systems. * Try a starting a rescue shell instead. */ if (fstat(0, &st) == 0 && S_ISCHR(st.st_mode)) { warnx("Failed exec %s, attempting fallback to %s ...", _PATH_LOGIN, _PATH_SULOGIN); execl(_PATH_SULOGIN, _PATH_SULOGIN, NULL); warnx("Failed exec %s, attempting fallback to %s ...", _PATH_SULOGIN, _PATH_BSHELL); execl(_PATH_BSHELL, _PATH_BSHELL, NULL); } return 1; /* We shouldn't get here ... */ } static int getty(char *tty, speed_t speed, char *term, char *user) { const char cln[] = "\r\e[K\n"; char name[logname_len + 1]; /* +1 for NUL termination */ pid_t sid; /* * Clean up tty name. */ if (!strncmp(tty, _PATH_DEV, strlen(_PATH_DEV))) tty += 5; /* The getty process is responsible for the UTMP login record */ utmp_set_login(tty, NULL); /* Replace "Please press enter ..." with login: */ dprint(STDERR_FILENO, cln, strlen(cln)); restart: stty(STDIN_FILENO, speed); if (!user) { if (get_logname(tty, name, sizeof(name))) goto restart; } else strlcpy(name, user, sizeof(name)); /* check current session associated with our tty */ sid = tcgetsid(0); if (sid < 0 || getpid() != sid) { if (ioctl(STDIN_FILENO, TIOCSCTTY, 1) == -1) err(1, "failed stealing controlling TTY"); } if (term && term[0]) setenv("TERM", term, 1); return exec_login(name); } static int usage(int rc) { warnx("usage: getty [-h?p] tty [speed [term]]"); return rc; } int main(int argc, char *argv[]) { char *tty, *speed = "0", *term = NULL; int c; while ((c = getopt(argc, argv, "h?p")) != EOF) { switch(c) { case 'h': case '?': return usage(0); case 'p': passenv = 1; break; default: return usage(1); } } if (optind >= argc) return usage(1); tty = argv[optind++]; if (optind < argc) speed = argv[optind++]; if (optind < argc) term = argv[optind++]; logname_len = sysconf(_SC_LOGIN_NAME_MAX); if (logname_len == -1i) logname_len = LOGIN_NAME_MAX; if (logname_len < LOGIN_NAME_MIN) logname_len = LOGIN_NAME_MIN; return getty(tty, atoi(speed), term, NULL); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/src/schedule.h0000644000175100001660000000264215054341541010777 /* Work queue helper functions * * Copyright (c) 2018-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_SCHEDULE_H_ #define FINIT_SCHEDULE_H_ struct wq { uev_t watcher; int init; int delay; /* msec delay before starting work */ void (*cb)(void *); void *arg; }; int schedule_work(struct wq *work); #endif /* FINIT_SCHEDULE_H_ */ finit-4.14/src/devmon.h0000644000175100001660000000256415054341541010476 /* Device node monitor for the Finit condition engine * * Copyright (c) 2022-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef FINIT_DEVMON_H_ #define FINIT_DEVMON_H_ void devmon_add_cond(const char *cond); void devmon_del_cond(const char *cond); void devmon_init(uev_ctx_t *ctx); #endif /* FINIT_DEVMON_H_ */ finit-4.14/src/pid.c0000644000175100001660000001335415054341541007754 /* PID and PID file helpers * * Copyright (c) 2008-2010 Claudio Matsuoka * Copyright (c) 2008-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #include #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "pid.h" #include "svc.h" #include "helpers.h" /** * pid_alive - Check if a given process ID is running * @pid: Process ID to check for. * * Returns: * %TRUE(1) if pid is alive (/proc/pid exists), otherwise %FALSE(0) */ int pid_alive(pid_t pid) { char name[24]; /* Enough for max pid_t */ snprintf(name, sizeof(name), "/proc/%d/status", pid); return fexist(name); } /** * pid_get_name - Find name of a process * @pid: PID of process to find. * @name: Pointer to buffer where to return process name, may be %NULL * @len: Length in bytes of @name buffer. * * If @name is %NULL, or @len is zero the function will return * a static string. This may be useful to one-off calls. * * Returns: * %NULL on error, otherwise a va */ char *pid_get_name(pid_t pid, char *name, size_t len) { static char line[64]; char *pname = NULL; char path[32]; int ret = 1; FILE *fp; snprintf(path, sizeof(path), "/proc/%d/status", pid); fp = fopen(path, "r"); if (fp) { if (fgets(line, sizeof (line), fp)) { pname = line + 6; /* Skip first part of line --> "Name:\t" */ chomp(pname); if (name) strlcpy(name, pname, len); ret = 0; /* Found it! */ } fclose(fp); } if (ret) return NULL; if (name) return name; return pname; } char *pid_file(svc_t *svc) { if (svc->pidfile[0]) { if (svc->pidfile[0] == '!') return &svc->pidfile[1]; return svc->pidfile; } errno = ENOENT; return NULL; } pid_t pid_file_read(const char *fn) { pid_t pid = 0; char buf[42]; FILE *fp; fp = fopen(fn, "r"); if (!fp) return -1; if (fgets(buf, sizeof(buf), fp)) { chomp(buf); pid = atoi(buf); } fclose(fp); return pid; } int pid_file_create(svc_t *svc) { FILE *fp; if (!svc->pidfile[0] || svc->pidfile[0] == '!') return 1; fp = fopen(svc->pidfile, "w"); if (!fp) return 1; fprintf(fp, "%d\n", svc->pid); return fclose(fp); } int pid_file_set(svc_t *svc, char *file, int not) { char buf[sizeof(svc->pidfile)]; if (!file) { file = pid_file(svc); if (!file) return -1; } if (file[0] == '!') { not = 1; file++; } if (svc_is_forking(svc) && !not) { logit(LOG_WARNING, "Service %s is forking, adjusting to pid:!%s", svc->name, file); not = 1; } de_dotdot(file); pid_runpath(file, buf, sizeof(buf)); strlcpy(&svc->pidfile[not], buf, sizeof(svc->pidfile) - not); if (not) svc->pidfile[0] = '!'; return 0; } /* * This function parses a PID file @arg for @svc. * * The logic is explained below. Please note that using the first form * of the syntax not only creates and removes the PID file, but it also * calls touch to update the mtime on service_restart(), only applicable * to processes that accept SIGHUP. This to ensure dependent services * are sent SIGCONT properly on reload, otherwise their condition would * never be asserted again after `initctl reload`. * * pid --> /run/$(basename).pid * pid:foo --> /run/foo.pid * pid:foo.pid --> /run/foo.pid * pid:foo.tla --> /run/foo.tla.pid * pid:/tmp/foo --> /tmp/foo.pid (Not handled by pidfile plugin!) * * An exclamation mark, or logical NOT, in the first character position * indicates that Finit should *not* manage the PID file, and that the * process uses a "non-standard" location. Eg. if service is 'bar' * Finit would assume the PID file is /run/bar.pid and the below simply * 'redirects' Finit to use the correct PID file. * * pid:!foo --> !/run/foo.pid * pid:!/run/foo.pid --> !/run/foo.pid * * Note, nothing is created or removed by Finit in this latter form. */ int pid_file_parse(svc_t *svc, char *arg) { /* Sanity check ... */ if (!arg || !arg[0]) return 1; /* 'pid:' implies argument following*/ if (!strncmp(arg, "pid:", 4)) { char path[MAX_ARG_LEN]; int len, not = 0; arg += 4; if ((arg[0] == '!' && arg[1] == '/') || arg[0] == '/') return pid_file_set(svc, arg, 0); if (arg[0] == '!') { arg++; not++; } len = snprintf(path, sizeof(path), "%s%s%s", not ? "!" : "", _PATH_VARRUN, arg); if (len > 4 && strcmp(&path[len - 4], ".pid")) strlcat(path, ".pid", sizeof(path)); return pid_file_set(svc, path, 0); } /* 'pid' arg, no argument following */ if (!strcmp(arg, "pid")) return pid_file_set(svc, NULL, 0); return 1; } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/0000755000175100001660000000000015054341601007775 5finit-4.14/plugins/netlink.c0000644000175100001660000002344615054341541011541 /* Netlink plugin for IFUP/IFDN and GW events * * Copyright (C) 2009-2011 Mårten Wikström * Copyright (C) 2009-2025 Joachim Wiberg * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include #include #include /* IFNAMSIZ */ #include #include #include #include #include #include "finit.h" #include "cond.h" #include "log.h" #include "helpers.h" #include "plugin.h" #include "service.h" #define NL_BUFSZ 4096 struct nl_request { struct nlmsghdr nh; union { struct rtmsg rtm; struct ifinfomsg ifi; }; }; static int nl_defidx; static int nl_ifdown; static char *nl_buf; static void nl_route(struct nlmsghdr *nlmsg, ssize_t len) { char daddr[INET_ADDRSTRLEN]; char gaddr[INET_ADDRSTRLEN]; struct in_addr ind, ing; struct rtmsg *r; struct rtattr *a; int plen = 0; int dst = 0; int idx = 0; int gw = 0; int la; if (nlmsg->nlmsg_len < NLMSG_LENGTH(sizeof(struct rtmsg))) { errx(1, "Packet too small or truncated!"); return; } r = NLMSG_DATA(nlmsg); a = RTM_RTA(r); la = RTM_PAYLOAD(nlmsg); if (la >= len) { errx(1, "Packet too large!"); return; } while (RTA_OK(a, la)) { void *data = RTA_DATA(a); switch (a->rta_type) { case RTA_GATEWAY: gw = *((int *)data); //dbg("GW: 0x%04x", gw); break; case RTA_DST: dst = *((int *)data); plen = r->rtm_dst_len; //dbg("Prefix LEN: 0x%04x", plen); break; case RTA_OIF: idx = *((int *)data); //dbg("IDX: 0x%04x", idx); break; } a = RTA_NEXT(a, la); } ind.s_addr = dst; ing.s_addr = gw; inet_ntop(AF_INET, &ind, daddr, sizeof(daddr)); inet_ntop(AF_INET, &ing, gaddr, sizeof(gaddr)); dbg("Got gw %s dst/len %s/%d ifindex %d", gaddr, daddr, plen, idx); if ((!dst && !plen) && (gw || idx)) { if (nlmsg->nlmsg_type == RTM_DELROUTE) { cond_clear("net/route/default"); nl_defidx = 0; } else { cond_set("net/route/default"); nl_defidx = idx; } } } static void net_cond_set(char *ifname, char *cond, int set) { char msg[MAX_ARG_LEN]; snprintf(msg, sizeof(msg), "net/%s/%s", ifname, cond); if (set) cond_set(msg); else cond_clear(msg); } static int validate_ifname(const char *ifname) { if (!ifname || !ifname[0]) return 1; if (strnlen(ifname, IFNAMSIZ) == IFNAMSIZ) return 1; if (!strcmp(ifname, ".") || !strcmp(ifname, "..")) return 1; while (*ifname) { if (*ifname == '/' || *ifname == ':' || isspace(*ifname)) return 1; ifname++; } return 0; } /* * Check if this interface was associated with the default route * previously, or if it's been removed. If so, trigger a recheck * of the system default route. */ static void nl_check_default(char *ifname) { int idx = (int)if_nametoindex(ifname); if ((nl_defidx > 0 && nl_defidx == idx) || (idx == 0 && errno == ENODEV)) nl_ifdown = 1; } static void nl_link(struct nlmsghdr *nlmsg, ssize_t len) { char ifname[IFNAMSIZ + 1]; struct ifinfomsg *i; struct rtattr *a; int la; if (nlmsg->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifinfomsg))) { errx(1, "Packet too small or truncated!"); return; } i = NLMSG_DATA(nlmsg); a = (struct rtattr *)((char *)i + NLMSG_ALIGN(sizeof(struct ifinfomsg))); la = NLMSG_PAYLOAD(nlmsg, sizeof(struct ifinfomsg)); if (la >= len) { errx(1, "Packet too large!"); return; } for (; RTA_OK(a, la); a = RTA_NEXT(a, la)) { if (a->rta_type != IFLA_IFNAME) continue; strlcpy(ifname, RTA_DATA(a), sizeof(ifname)); if (validate_ifname(ifname)) { dbg("Invalid interface name '%s', skipping ...", ifname); continue; } switch (nlmsg->nlmsg_type) { case RTM_NEWLINK: /* * New interface has appeared, or interface flags has changed. * Check ifi_flags here to see if the interface is UP/DOWN */ dbg("%s: New link, flags 0x%x, change 0x%x", ifname, i->ifi_flags, i->ifi_change); net_cond_set(ifname, "exist", 1); net_cond_set(ifname, "up", i->ifi_flags & IFF_UP); net_cond_set(ifname, "running", i->ifi_flags & IFF_RUNNING); if (!(i->ifi_flags & IFF_UP) || !(i->ifi_flags & IFF_RUNNING)) nl_check_default(ifname); break; case RTM_DELLINK: /* NOTE: Interface has disappeared, not link down ... */ dbg("%s: Delete link", ifname); net_cond_set(ifname, "exist", 0); net_cond_set(ifname, "up", 0); net_cond_set(ifname, "running", 0); nl_check_default(ifname); break; case RTM_NEWADDR: dbg("%s: New Address", ifname); break; case RTM_DELADDR: dbg("%s: Deconfig Address", ifname); break; default: dbg("%s: Msg 0x%x", ifname, nlmsg->nlmsg_type); break; } } } static int nl_parse(int sd) { while (1) { struct nlmsghdr *nh; ssize_t len; size_t l; while ((len = recv(sd, nl_buf, NL_BUFSZ, 0)) < 0) { switch (errno) { case EAGAIN: /* Nothing more right now. */ return 0; case EINTR: /* Signal */ continue; case ENOBUFS: /* netlink(7) */ break; default: err(1, "recv()"); break; } return -1; } // dbg("recv %zd bytes", len); l = (size_t)len; for (nh = (struct nlmsghdr *)nl_buf; NLMSG_OK(nh, l); nh = NLMSG_NEXT(nh, l)) { struct nlmsgerr *nle; switch (nh->nlmsg_type) { case NLMSG_DONE: // dbg("Done with netlink messages."); return 0; case NLMSG_ERROR: // dbg("Kernel netlink comm. error."); nle = NLMSG_DATA(nh); if (nle) { errno = -nle->error; err(1, "Kernel netlink error %d", errno); } return -1; case RTM_NEWROUTE: case RTM_DELROUTE: // dbg("Netlink route ..."); nl_route(nh, len); break; case RTM_NEWLINK: case RTM_DELLINK: // dbg("Netlink link ..."); nl_link(nh, len); break; default: warnx("unhandled netlink message, type %d", nh->nlmsg_type); break; } } } } static int nl_request(int sd, unsigned int seq, int type) { struct nl_request *nlr = (struct nl_request *)nl_buf; memset(nlr, 0, sizeof(struct nl_request)); nlr->nh.nlmsg_type = type; nlr->nh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; nlr->nh.nlmsg_seq = seq; nlr->nh.nlmsg_pid = 1; switch (type) { case RTM_GETROUTE: // dbg("RTM_GETROUTE"); nlr->rtm.rtm_family = AF_INET; nlr->rtm.rtm_table = RT_TABLE_MAIN; nlr->nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); break; case RTM_GETLINK: // dbg("RTM_GETLINK"); nlr->ifi.ifi_family = AF_UNSPEC; nlr->ifi.ifi_change = 0xFFFFFFFF; nlr->nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); break; default: warnx("Cannot resync, unhandled message type %d", type); return -1; } if (send(sd, nlr, nlr->nh.nlmsg_len, 0) < 0) return 1; return nl_parse(sd); } static void nl_resync_routes(int sd, unsigned int seq) { if (nl_request(sd, seq, RTM_GETROUTE)) err(1, "Failed netlink route request"); } static void nl_resync_ifaces(int sd, unsigned int seq) { if (nl_request(sd, seq, RTM_GETLINK)) err(1, "Failed netlink link request"); } /* * We've potentially lost netlink events, let's resync with kernel. */ static void nl_resync(int all) { unsigned int seq = 0; int sd; sd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); if (sd < 0) { err(1, "netlink socket"); return; } if (all) { dbg("============================ RESYNC ================================="); /* this doesn't update conditions, and thus does not stop services */ cond_deassert("net/"); nl_resync_ifaces(sd, seq++); nl_resync_routes(sd, seq++); /* delayed update after we've corrected things */ service_step_all(SVC_TYPE_ANY); dbg("=========================== RESYNCED ================================"); } else nl_resync_routes(sd, seq++); close(sd); } static void nl_callback(void *arg, int sd, int events) { if (nl_parse(sd) < 0) { if (errno == ENOBUFS) { /* netlink(7) */ warnx("busy system, resynchronizing with kernel."); nl_resync(1); return; } } /* * Linux doesn't send route changes when interfaces go down, so * we need to check ourselves, e.g. for loss of default route. */ if (nl_ifdown) { dbg("interface down, checking default route."); if (nl_defidx > 0) { nl_defidx = 0; nl_resync(0); if (nl_defidx <= 0) { cond_clear("net/route/default"); nl_defidx = 0; } } nl_ifdown = 0; } } static void nl_reconf(void *arg) { cond_reassert("net/"); } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_SVC_RECONF] = { .cb = nl_reconf }, .io = { .cb = nl_callback, .flags = PLUGIN_IO_READ, }, }; PLUGIN_INIT(__init) { struct sockaddr_nl sa; int sd; sd = socket(AF_NETLINK, SOCK_RAW | SOCK_NONBLOCK | SOCK_CLOEXEC, NETLINK_ROUTE); if (sd < 0) { err(1, "socket()"); return; } memset(&sa, 0, sizeof(sa)); sa.nl_family = AF_NETLINK; sa.nl_groups = RTMGRP_IPV4_ROUTE | RTMGRP_LINK; sa.nl_pid = getpid(); if (bind(sd, (struct sockaddr *)&sa, sizeof(sa)) < 0) { err(1, "bind()"); close(sd); return; } nl_buf = malloc(NL_BUFSZ); if (!nl_buf) { err(1, "malloc()"); close(sd); return; } plugin.io.fd = sd; plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); close(plugin.io.fd); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/tty.c0000644000175100001660000000651315054341541010711 /* Optional TTY Watcher, used to catch new TTYs that are discovered, e.g., USB * * Copyright (c) 2013 Mattias Walström * Copyright (c) 2013-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include /* O_RDONLY et al */ #include /* read() */ #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "helpers.h" #include "plugin.h" #include "service.h" #include "tty.h" #include "log.h" static void tty_watcher(void *arg, int fd, int events); static plugin_t plugin = { .io = { .cb = tty_watcher, .flags = PLUGIN_IO_READ, }, }; static void setup(void) { if (plugin.io.fd > 0) close(plugin.io.fd); plugin.io.fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); if (-1 == plugin.io.fd || inotify_add_watch(plugin.io.fd, "/dev", IN_CREATE | IN_DELETE) < 0) err(1, "Failed starting TTY watcher"); } static void do_tty(char *tty, size_t len, int creat) { char name[len + 6]; svc_t *svc; snprintf(name, sizeof(name), "/dev/%s", tty); svc = svc_find_by_tty(name); if (svc) { if (svc_is_blocked(svc) && creat) { dbg("%s: blocked, re-enabling", svc_ident(svc, NULL, 0)); svc_start(svc); } else if (svc->pid) { dbg("%s: missing ...", svc_ident(svc, NULL, 0)); svc_missing(svc); } service_step_all(SVC_TYPE_TTY); } } static void tty_watcher(void *arg, int fd, int events) { static char ev_buf[8 *(sizeof(struct inotify_event) + NAME_MAX + 1) + 1]; struct inotify_event *ev; ssize_t sz; size_t off; sz = read(fd, ev_buf, sizeof(ev_buf) - 1); if (sz <= 0) { err(1, "invalid inotify event"); return; } ev_buf[sz] = 0; for (off = 0; off < (size_t)sz; off += sizeof(*ev) + ev->len) { if (off + sizeof(*ev) > (size_t)sz) break; ev = (struct inotify_event *)&ev_buf[off]; if (off + sizeof(*ev) + ev->len > (size_t)sz) break; if (!ev->mask) continue; dbg("tty %s, event: 0x%08x", ev->name, ev->mask); do_tty(ev->name, ev->len, ev->mask & IN_CREATE); } } PLUGIN_INIT(__init) { setup(); plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); if (plugin.io.fd) close(plugin.io.fd); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/dbus.c0000644000175100001660000001042015054341541011016 /* Setup and start system message bus, D-Bus * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "config.h" #include "helpers.h" #include "plugin.h" #include "service.h" #include "util.h" #include "conf.h" #include "log.h" #define DBUS_DAEMON "dbus-daemon" #define DBUS_ARGS "--nofork --system --syslog-only" #define DBUS_DESC "D-Bus message bus daemon" #ifndef DBUS_DAEMONUSER #define DBUS_DAEMONUSER "messagebus" #endif #ifndef DBUS_DAEMONGROUP #define DBUS_DAEMONGROUP "messagebus" #endif /* * Dumnpster diving for the D-Bus main configuration file * where is defined. */ static char *dbus_pidfn(void) { char *alt[] = { "/usr/share/dbus-1/system.conf", "/etc/dbus-1/system.conf", NULL }; int i; for (i = 0; alt[i]; i++) { char *fn = alt[i]; char buf[256]; FILE *fp; fp = fopen(fn, "r"); if (!fp) continue; fn = NULL; while (fgets(buf, sizeof(buf), fp)) { char *pos; pos = strstr(buf, ""); if (!pos) continue; fn = pos + strlen(""); pos = strstr(fn, ""); if (!pos) { fn = NULL; break; } *pos = 0; break; } fclose(fp); if (fn) return strdup(fn); } return NULL; } static void setup(void *arg) { char *group = DBUS_DAEMONGROUP; char *user = DBUS_DAEMONUSER; char line[256]; char *pidfn; mode_t prev; char *cmd; if (rescue) { dbg("Skipping %s plugin in rescue mode.", __FILE__); return; } cmd = which(DBUS_DAEMON); if (!cmd) { dbg("Skipping plugin, %s is not installed.", DBUS_DAEMON); return; } if (getuser(user, NULL) == -1) { if (getuser("dbus", NULL) == -1) user = "root"; /* fallback */ else user = "dbus"; /* e.g., Buildroot */ } if (getgroup(group) == -1) { if (getgroup("dbus") == -1) group = "root"; /* fallback */ else group = "dbus"; /* e.g., Buildroot */ } /* Clean up from any previous pre-bootstrap run */ pidfn = dbus_pidfn(); if (pidfn) remove(pidfn); dbg("Creating D-Bus Required Directories ..."); prev = umask(0); mksubsys("/var/run/dbus", 0755, user, group); mksubsys("/var/run/lock/subsys", 0755, user, group); mksubsys("/var/lib/dbus", 0755, user, group); mksubsys("/tmp/dbus", 0755, user, group); umask(prev); /* Generate machine id for dbus */ if (whichp("dbus-uuidgen")) run_interactive("dbus-uuidgen --ensure", "Verifying D-Bus machine UUID"); /* * Register service with Finit * Note: dbus drops privs after starting up. */ if (pidfn) { snprintf(line, sizeof(line), "[S123456789] cgroup.system notify:none name:dbus pid:!%s %s %s -- %s", pidfn, cmd, DBUS_ARGS, DBUS_DESC); free(pidfn); } else snprintf(line, sizeof(line), "[S123456789] cgroup.system notify:none name:dbus %s %s -- %s", cmd, DBUS_ARGS, DBUS_DESC); conf_save_service(SVC_TYPE_SERVICE, line, "dbus.conf"); free(cmd); } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_SVC_PLUGIN] = { .cb = setup }, }; PLUGIN_INIT(__init) { plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/pidfile.c0000644000175100001660000002240015054341541011476 /* Simple pidfile event monitor for the Finit condition engine * * Copyright (c) 2015-2016 Tobias Waldekranz * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include #include "finit.h" #include "cond.h" #include "helpers.h" #include "pid.h" #include "plugin.h" #include "service.h" #include "iwatch.h" #include "log.h" static struct iwatch iw_pidfile; static int pidfile_add_path(struct iwatch *iw, char *path) { char *ptr; ptr = strstr(path, "run/"); if (ptr) { char *slash; ptr += 4; slash = strchr(ptr, '/'); if (slash) { ptr = slash++; slash = strchr(ptr, '/'); if (slash) { dbg("Path too deep, skipping %s", path); return -1; } } } return iwatch_add(iw, path, IN_ONLYDIR | IN_CLOSE_WRITE); } static void pidfile_update_conds(char *dir, char *name, uint32_t mask) { char cond[MAX_COND_LEN]; char fn[PATH_MAX]; svc_t *svc; char *nm; paste(fn, sizeof(fn), dir, name); if (fnmatch("*\\.pid", fn, 0) && fnmatch("*/pid", fn, 0)) return; dbg("path: %s, mask: %08x", fn, mask); svc = svc_find_by_pidfile(fn); if (!svc) { dbg("No matching svc for %s", fn); return; } switch (svc->state) { case SVC_TEARDOWN_STATE: case SVC_CLEANUP_STATE: case SVC_SETUP_STATE: /* * E.g., a setup script for a container may run in lieu * of crun, trying to fetch a container image from the * network. This script may want to advertise its PID * to the system for clean and swift reboots. */ dbg("%s[%d]: ignoring any PID file changes in CLEANUP/TEARDOWN/SETUP", svc_ident(svc, NULL, 0), svc->pid); return; default: break; } /* Service condistion to set/clear */ mkcond(svc, cond, sizeof(cond)); nm = svc_ident(svc, NULL, 0); dbg("Found svc %s for %s with pid %d", nm, fn, svc->pid); if (svc_is_stopping(svc)) { dbg("Ignoring pidfile death rattles while service %s is %s", nm, svc_status(svc)); goto sneaky_zebra; } if (mask & (IN_CLOSE_WRITE | IN_ATTRIB | IN_MODIFY | IN_MOVED_TO)) { /* * only mark native services as started, the s6 and * systemd style services rely on their respective * readiness notification. Issue #343 */ if (svc->notify == SVC_NOTIFY_PID) svc_started(svc); if (!svc_has_pidfile(svc)) { dbg("Setting %s PID file to %s", svc->name, fn); pid_file_set(svc, fn, 1); } if (svc_is_forking(svc)) { pid_t pid; pid = pid_file_read(fn); if (pid == -1) { /* handle case when service dies immediately */ if (!fexist(fn)) cond_clear(cond); return; } /* Service is not crashing, let's tell state machine! */ service_forked(svc); if (pid != svc->pid) { dbg("Forking service %s (cmd %s) changed PID from %d to %d", svc_ident(svc, NULL, 0), svc->cmd, svc->pid, pid); svc->pid = pid; /* Complement log in service.c for non-forking services */ logit(LOG_CONSOLE | LOG_NOTICE, "Started %s[%d]", svc_ident(svc, NULL, 0), pid); } } if (svc->notify == SVC_NOTIFY_PID) cond_set(cond); if (svc->notify == SVC_NOTIFY_PID || svc->notify == SVC_NOTIFY_NONE) service_ready(svc, 1); } else if (mask & IN_DELETE) { sneaky_zebra: cond_clear(cond); if (svc->notify == SVC_NOTIFY_PID) service_ready(svc, 0); } } /* synthesize events in case of new run dirs */ static void pidfile_scandir(struct iwatch *iw, char *dir, int len) { glob_t gl; size_t i; char path[len + 6]; int rc; snprintf(path, sizeof(path), "%s/*.pid", dir); rc = glob(path, GLOB_NOSORT, NULL, &gl); if (rc && rc != GLOB_NOMATCH) return; snprintf(path, sizeof(path), "%s/pid", dir); rc = glob(path, GLOB_NOSORT | GLOB_APPEND, NULL, &gl); if (rc && rc != GLOB_NOMATCH) return; for (i = 0; i < gl.gl_pathc; i++) { dbg("scan found %s", gl.gl_pathv[i]); pidfile_update_conds(dir, gl.gl_pathv[i], IN_CREATE); } globfree(&gl); } /* * create/remove sub-directory in monitored directory */ static void pidfile_handle_dir(struct iwatch *iw, char *dir, char *name, int mask) { char path[strlen(dir) + strlen(name) + 2]; struct iwatch_path *iwp; paste(path, sizeof(path), dir, name); dbg("path: %s", path); iwp = iwatch_find_by_path(iw, path); if (mask & IN_CREATE) { if (!iwp) { if (!pidfile_add_path(iw, path)) pidfile_scandir(iw, path, sizeof(path)); } } else if (mask & IN_DELETE) { if (iwp) iwatch_del(&iw_pidfile, iwp); } } static void pidfile_callback(void *arg, int fd, int events) { static char ev_buf[8 *(sizeof(struct inotify_event) + NAME_MAX + 1) + 1]; struct inotify_event *ev; ssize_t sz; size_t off; sz = read(fd, ev_buf, sizeof(ev_buf) - 1); if (sz <= 0) { err(1, "invalid inotify event"); return; } ev_buf[sz] = 0; for (off = 0; off < (size_t)sz; off += sizeof(*ev) + ev->len) { struct iwatch_path *iwp; if (off + sizeof(*ev) > (size_t)sz) break; ev = (struct inotify_event *)&ev_buf[off]; if (off + sizeof(*ev) + ev->len > (size_t)sz) break; if (!ev->mask) continue; /* Find base path for this event */ iwp = iwatch_find_by_wd(&iw_pidfile, ev->wd); if (!iwp) continue; if (ev->mask & IN_ISDIR) { pidfile_handle_dir(&iw_pidfile, iwp->path, ev->name, ev->mask); continue; } if (ev->mask & (IN_CLOSE_WRITE | IN_DELETE | IN_ATTRIB | IN_MODIFY | IN_MOVED_TO)) pidfile_update_conds(iwp->path, ev->name, ev->mask); } } /* * This function is called after `initctl reload` to reassert conditions * for services that have not been changed. * * We reassert the run/task/service's condition only if it is running, * but not if it's recently been changed or while it's starting up. */ static void pidfile_reconf(void *arg) { static char cond[MAX_COND_LEN]; svc_t *svc, *iter = NULL; for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) { if (svc->state != SVC_RUNNING_STATE) continue; if (svc_is_changed(svc) || svc_is_starting(svc)) continue; if (svc->notify == SVC_NOTIFY_PID) service_ready(svc, 1); mkcond(svc, cond, sizeof(cond)); if (cond_get(cond) == COND_ON) continue; cond_set_path(cond_path(cond), COND_ON); } /* * This calls service_step(), which in turn schedules itself as * long as stepped services change state. Services going from * PAUSED to RUNNING reassert their conditions in that loop, * which in turn may unlock other services, and so on. */ service_step_all(SVC_TYPE_SERVICE | SVC_TYPE_RUNTASK); } static void pidfile_init(void *arg) { char piddir[MAX_ARG_LEN]; char *path; if (mkpath(pid_runpath(_PATH_CONDPID, piddir, sizeof(piddir)), 0755) && errno != EEXIST) { err(1, "Failed creating %s condition directory, %s", COND_PID, _PATH_CONDPID); return; } /* * The bootmisc plugin is responsible for setting up /var/run. * and/or /run, with proper symlinks etc. We depend on bootmisc * so it's safe here to query realpath() and set up inotify. */ path = realpath(_PATH_VARRUN, NULL); if (!path) { dbg("Failed querying realpath(%s): %s", _PATH_VARRUN, strerror(errno)); path = realpath("/run", NULL); if (!path) { errx(1, "System does not have %s or /run, aborting.", _PATH_VARRUN); return; } } if (pidfile_add_path(&iw_pidfile, path)) iwatch_exit(&iw_pidfile); free(path); } /* * When performing an `initctl reload` with one (unchanged) service * depending on, e.g. `net/iface/lo`, its condition will not be set * to ON by the pidfile plugin unless the netlink plugin hook runs * first. * * Example: * * service /sbin/dropbear ... * * This service provides the condition, which will not be * set by pidfile.so during `initctl reload` because dropbear is still * SIGSTP:ed (in state PAUSED) waiting for . */ static plugin_t plugin = { .name = __FILE__, .hook[HOOK_BASEFS_UP] = { .cb = pidfile_init }, .hook[HOOK_SVC_RECONF] = { .cb = pidfile_reconf }, .depends = { "netlink" }, /* bootmisc depends on us */ }; PLUGIN_INIT(__init) { int fd; fd = iwatch_init(&iw_pidfile); if (fd < 0) return; plugin.io.fd = fd; plugin.io.cb = pidfile_callback; plugin.io.flags = PLUGIN_IO_READ; plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); iwatch_exit(&iw_pidfile); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/hook-scripts.c0000644000175100001660000000617415054341541012521 /* Trigger scripts to run from finit's hooks * * Copyright (c) 2022 Tobias Waldekranz * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "finit.h" #include "helpers.h" #include "plugin.h" #include "config.h" extern void plugin_script_run(hook_point_t no); static void hscript_run_parts(hook_point_t no) { plugin_script_run(no); } static void hscript_banner(void *arg) { hscript_run_parts(HOOK_BANNER); } static void hscript_rootfs_up(void *arg) { hscript_run_parts(HOOK_ROOTFS_UP); } static void hscript_mount_error(void *arg) { hscript_run_parts(HOOK_MOUNT_ERROR); } static void hscript_mount_post(void *arg) { hscript_run_parts(HOOK_MOUNT_POST); } static void hscript_basefs_up(void *arg) { hscript_run_parts(HOOK_BASEFS_UP); } static void hscript_network_up(void *arg) { hscript_run_parts(HOOK_NETWORK_UP); } static void hscript_svc_up(void *arg) { hscript_run_parts(HOOK_SVC_UP); } static void hscript_system_up(void *arg) { hscript_run_parts(HOOK_SYSTEM_UP); } static void hscript_shutdown(void *arg) { hscript_run_parts(HOOK_SHUTDOWN); } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_BANNER] = { .cb = hscript_banner }, .hook[HOOK_ROOTFS_UP] = { .cb = hscript_rootfs_up }, .hook[HOOK_MOUNT_ERROR] = { .cb = hscript_mount_error }, .hook[HOOK_MOUNT_POST] = { .cb = hscript_mount_post }, .hook[HOOK_BASEFS_UP] = { .cb = hscript_basefs_up }, .hook[HOOK_NETWORK_UP] = { .cb = hscript_network_up }, .hook[HOOK_SVC_UP] = { .cb = hscript_svc_up }, .hook[HOOK_SYSTEM_UP] = { .cb = hscript_system_up }, .hook[HOOK_SHUTDOWN] = { .cb = hscript_shutdown }, /* * We have exited here, so these are handled a bit differently by Finit, * when hook scripts are enabled, just to provide the user with the same * interface: * * .hook[HOOK_SVC_DN] = { .cb = hscript_svc_down }, * .hook[HOOK_SYS_DN] = { .cb = hscript_system_down }, */ }; PLUGIN_INIT(__init) { plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/bootmisc.c0000644000175100001660000001057015054341541011706 /* Setup necessary system files for, e.g. UTMP (tracking logins) * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" /* Generated by configure script */ #include #ifdef HAVE_MNTENT_H #include #endif #include #ifdef _LIBITE_LITE # include #else # include #endif #include "config.h" #include "finit.h" #include "helpers.h" #include "plugin.h" #include "util.h" #include "utmp-api.h" #include "log.h" static int is_tmpfs(char *path) { struct mntent mount; struct mntent *mnt; char buf[256]; int tmpfs = 0; FILE *fp; char *dir; /* If path is a symlink, check what it resolves to */ dir = realpath(path, NULL); if (!dir) return 0; /* Outlook not so good */ fp = setmntent("/proc/mounts", "r"); if (!fp) { free(dir); return 0; /* Dunno, maybe not */ } while ((mnt = getmntent_r(fp, &mount, buf, sizeof(buf)))) { if (!strcmp(dir, mnt->mnt_dir)) break; } if (mnt && !strcmp("tmpfs", mnt->mnt_type)) tmpfs = 1; endmntent(fp); free(dir); return tmpfs; } static int bootclean(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftw) { if (ftw->level == 0) return 1; dbg("Removing %s ...", fpath); (void)remove(fpath); return 0; } /* * Cleanup stale files from previous boot, if any still linger on. * Some systems, e.g. Alpine Linux, still have a persistent /run and * /tmp, i.e. not tmpfs. * * We can safely skip tmpfs, nothing to clean there. */ static void clean(void *arg) { char *dir[] = { "/tmp/", "/var/run/", "/var/lock/", NULL }; for (int i = 0; dir[i]; i++) { if (is_tmpfs(dir[i])) continue; nftw(dir[i], bootclean, 20, FTW_DEPTH); } } /* Kernel defines the following compulsory and recommended links * https://github.com/torvalds/linux/blob/v5.18/Documentation/admin-guide/devices.rst#compulsory-links */ static void kernel_links(void) { struct { char *tgt, *lnk; int optional; } k[] = { { "/proc/self/fd", "/dev/fd", 0 }, { "fd/0", "/dev/stdin", 0 }, { "fd/1", "/dev/stdout", 0 }, { "fd/2", "/dev/stderr", 0 }, { "socksys", "/dev/nfsd", 0 }, { "null", "/dev/X0R", 0 }, { "/proc/kcore", "/dev/core", 1 }, { "ram0", "/dev/ramdisk", 1 }, { "qft0", "/dev/ftape", 1 }, { "video0", "/dev/bttv0", 1 }, { "radio0", "/dev/radio", 1 }, }; char *fn, buf[80]; size_t i; for (i = 0; i < NELEMS(k); i++) { fn = k[i].tgt; if (k[i].optional) { if (fn[0] != '/') { snprintf(buf, sizeof(buf), "/dev/%s", k[i].tgt); fn = buf; } if (!fexist(fn)) continue; } ln(k[i].tgt, k[i].lnk); } } /* * Setup standard FHS 2.3 structure in /var, and write runlevel to UTMP */ static void setup(void *arg) { mode_t prev; prev = umask(0); /* Kernel symlinks, e.g. /proc/self/fd -> /dev/fd */ kernel_links(); /* Create all system tmpfiles.d(5) */ run_interactive(_PATH_TMPFILES " --create", "Creating required directories and files"); /* Set BOOT_TIME UTMP entry */ utmp_set_boot(); umask(prev); } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_MOUNT_POST] = { .cb = clean }, .hook[HOOK_BASEFS_UP] = { .cb = setup }, .depends = { "pidfile" }, }; PLUGIN_INIT(__init) { plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/alsa-utils.c0000644000175100001660000000430215054341541012141 /* Save and restore ALSA sound settings using alsactl * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifdef _LIBITE_LITE # include #else # include #endif #include "conf.h" #include "finit.h" #include "helpers.h" #include "plugin.h" #include "log.h" #define ALSACTL "alsactl" static void save(void *arg) { if (rescue) { dbg("Skipping %s plugin in rescue mode.", __FILE__); return; } if (whichp(ALSACTL)) { dbg("Saving sound settings ..."); run_interactive(ALSACTL " -g store", "Saving sound settings"); } } static void restore(void *arg) { if (rescue) { dbg("Skipping %s plugin in rescue mode.", __FILE__); return; } if (whichp(ALSACTL)) { dbg("Restoring sound settings ..."); run_interactive(ALSACTL " -g restore", "Restoring sound settings"); } } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_BASEFS_UP] = { .cb = restore }, .hook[HOOK_SHUTDOWN] = { .cb = save } }; PLUGIN_INIT(__init) { plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/sys.c0000644000175100001660000001176415054341541010713 /* System condition event monitor for the Finit condition engine * * Copyright (c) 2021-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include #include #include "finit.h" #include "cond.h" #include "pid.h" #include "plugin.h" #include "iwatch.h" #include "log.h" static struct iwatch iw_sys; static int sys_add_path(struct iwatch *iw, char *path) { return iwatch_add(iw, path, IN_ONLYDIR | IN_CLOSE_WRITE); } /* * unlink conditions with no active task/service, otherwise they may * trigger inadvertently when calling `initctl reload` to activate * a new configuration. */ static void sys_update_conds(char *dir, char *name, uint32_t mask) { char path[256]; char *cond; char *ptr; ptr = strrchr(name, '/'); if (ptr) snprintf(path, sizeof(path), "%s/%s", dir, ++ptr); else snprintf(path, sizeof(path), "%s/%s", dir, name); cond = strstr(path, COND_BASE); if (!cond) return; cond += strlen(COND_BASE) + 1; dbg("cond: %s set: %d", cond, (mask & IN_CREATE) ? 1 : 0); if (!cond_update(cond)) unlink(path); } /* synthesize events in case of new run dirs */ static void sys_scandir(struct iwatch *iw, char *dir, int len) { glob_t gl; size_t i; char path[len + 6]; int rc; snprintf(path, sizeof(path), "%s/*", dir); rc = glob(path, GLOB_NOSORT, NULL, &gl); if (rc && rc != GLOB_NOMATCH) return; for (i = 0; i < gl.gl_pathc; i++) { dbg("scan found %s", gl.gl_pathv[i]); sys_update_conds(dir, gl.gl_pathv[i], IN_CREATE); } globfree(&gl); } /* * create/remove sub-directory in monitored directory */ static void sys_handle_dir(struct iwatch *iw, char *dir, char *name, int mask) { char path[strlen(dir) + strlen(name) + 2]; struct iwatch_path *iwp; paste(path, sizeof(path), dir, name); dbg("path: %s", path); iwp = iwatch_find_by_path(iw, path); if (mask & IN_CREATE) { if (!iwp) { if (!sys_add_path(iw, path)) sys_scandir(iw, path, sizeof(path)); } } else if (mask & IN_DELETE) { if (iwp) iwatch_del(&iw_sys, iwp); } } static void sys_callback(void *arg, int fd, int events) { static char ev_buf[8 *(sizeof(struct inotify_event) + NAME_MAX + 1) + 1]; struct inotify_event *ev; ssize_t sz; size_t off; sz = read(fd, ev_buf, sizeof(ev_buf) - 1); if (sz <= 0) { err(1, "invalid inotify event"); return; } ev_buf[sz] = 0; for (off = 0; off < (size_t)sz; off += sizeof(*ev) + ev->len) { struct iwatch_path *iwp; if (off + sizeof(*ev) > (size_t)sz) break; ev = (struct inotify_event *)&ev_buf[off]; if (off + sizeof(*ev) + ev->len > (size_t)sz) break; dbg("name %s, event: 0x%08x", ev->name, ev->mask); if (!ev->mask) continue; /* Find base path for this event */ iwp = iwatch_find_by_wd(&iw_sys, ev->wd); if (!iwp) continue; if (ev->mask & IN_ISDIR) { sys_handle_dir(&iw_sys, iwp->path, ev->name, ev->mask); continue; } if (ev->mask & (IN_CREATE | IN_DELETE)) sys_update_conds(iwp->path, ev->name, ev->mask); } } static void sys_init(void *arg) { char sysdir[MAX_ARG_LEN]; char *path; mkpath(_PATH_COND, 0755); if (mkpath(pid_runpath(_PATH_CONDSYS, sysdir, sizeof(sysdir)), 0755) && errno != EEXIST) { err(1, "Failed creating %s condition directory, %s", COND_SYS, _PATH_CONDSYS); return; } path = realpath(_PATH_CONDSYS, NULL); if (!path) { err(1, "Cannot figure out real path to %s, aborting", _PATH_CONDSYS); return; } if (iwatch_add(&iw_sys, path, IN_ONLYDIR)) iwatch_exit(&iw_sys); free(path); } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_BASEFS_UP] = { .cb = sys_init }, .depends = { "bootmisc", }, }; PLUGIN_INIT(__init) { int fd; fd = iwatch_init(&iw_sys); if (fd < 0) return; plugin.io.fd = fd; plugin.io.cb = sys_callback; plugin.io.flags = PLUGIN_IO_READ; plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); iwatch_exit(&iw_sys); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/urandom.c0000644000175100001660000001157215054341541011537 /* Setup and save random seed at boot/shutdown * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include /* gettimeofday() */ #include #include /* getrusage() */ #ifdef _LIBITE_LITE # include #else # include #endif #include #include "config.h" #include "finit.h" #include "helpers.h" #include "plugin.h" #include "conf.h" #include "log.h" #ifndef RANDOM_BYTES #define RANDOM_BYTES (32*1024) #endif #ifdef RANDOMSEED /* * This is the fallback seed function, please make sure you have drivers * enabling /dev/hwrng instead. */ static void fallback(FILE *fp) { unsigned long seed; struct timeval tv; struct rusage ru; int iter = 128; gettimeofday(&tv, NULL); getrusage(RUSAGE_SELF, &ru); /* Mix multiple sources of "randomness" */ seed = tv.tv_sec ^ (tv.tv_usec << 16); seed ^= ru.ru_utime.tv_sec ^ (ru.ru_utime.tv_usec << 16); seed ^= ru.ru_stime.tv_sec ^ (ru.ru_stime.tv_usec << 16); seed ^= getpid() << 8; srandom(seed); while (iter--) { uint32_t i, prng = random(); for (i = 0; i < sizeof(prng); i++) fputc((prng >> (i * CHAR_BIT)) & UCHAR_MAX, fp); } } #endif static void setup(void *arg) { #ifdef RANDOMSEED struct rand_pool_info *rpi; unsigned char *rpi_buf; ssize_t len = 0; struct stat st; int rc = -1; int fd, err; if (rescue) { dbg("Skipping %s plugin in rescue mode.", __FILE__); return; } if (stat(RANDOMSEED, &st) || st.st_size < 512) { int ret = 1; mode_t prev; FILE *fp; print_desc("Bootstrapping random seed", NULL); prev = umask(077); fp = fopen(RANDOMSEED, "w"); if (fp) { const char *hwrng = "/dev/hwrng"; FILE *hw; hw = fopen(hwrng, "r"); if (hw) { char buf[512]; size_t num; num = fread(buf, sizeof(buf[0]), sizeof(buf), hw); if (num == 0) fallback(fp); else fwrite(buf, sizeof(buf[0]), num, fp); fclose(hw); } else { fallback(fp); } ret = fclose(fp); } print_result(ret); umask(prev); } print_desc("Seeding random number generator", NULL); /* * Simply copying our saved entropy to /dev/urandom doesn't * increment the kernel "entropy count", instead we must use * the ioctl below. */ fd = open(RANDOMSEED, O_RDONLY); if (fd < 0) goto fallback; rpi = malloc(sizeof(*rpi) + RANDOM_BYTES); if (!rpi) { close(fd); goto fallback; } rpi_buf = (unsigned char *)rpi->buf; do { ssize_t num; num = read(fd, &rpi_buf[len], RANDOM_BYTES - len); if (num <= 0) { if (num == -1 && errno == EINTR) continue; if (len > 0) break; close(fd); free(rpi); goto fallback; } len += num; } while (len < RANDOM_BYTES); close(fd); fd = open("/dev/urandom", O_WRONLY); if (fd < 0) { free(rpi); goto fallback; } rpi->buf_size = len; rpi->entropy_count = len * 8; rc = ioctl(fd, RNDADDENTROPY, rpi); err = errno; close(fd); free(rpi); if (rc < 0) logit(LOG_WARNING, "Failed adding entropy to kernel random pool: %s", strerror(err)); print_result(rc < 0); return; fallback: print_result(512 > copyfile(RANDOMSEED, "/dev/urandom", 0, 0)); #endif } static void save(void *arg) { #ifdef RANDOMSEED mode_t prev; if (rescue) { dbg("Skipping %s plugin in rescue mode.", __FILE__); return; } prev = umask(077); print_desc("Saving random seed", NULL); print_result(RANDOM_BYTES != copyfile("/dev/urandom", RANDOMSEED, RANDOM_BYTES, 0)); umask(prev); #endif } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_BASEFS_UP] = { .cb = setup }, .hook[HOOK_SHUTDOWN] = { .cb = save }, .depends = { "bootmisc", } }; PLUGIN_INIT(__init) { plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/modules-load.c0000644000175100001660000001355515054341541012462 /* Scans /etc/modules-load.d for modules to load. * * Copyright (c) 2018 Robert Andersson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /* * This plugin scans files in /etc/modules-load.d/, for each line in the * file it assumes the name of a kernel module, with optional arguments. * Each module is loaded when entering runlevel 2, 3, 4, or 5, using the * modprobe tool. * * Loading is done by inserting a `task` stanza in Finit, ensuring all * modules are loaded in parallel, with other modules and programs. * Each `task` stanza is by default given the name:modprobe.module and * indexed with `:ID`, starting with 1. * * Indexing can be disabled per file in /etc/modules-load.d/, anywwhere * in a file, by putting the keyword `noindex` on a line of its own. A * noindex command can appear anywhere in the file, and up to the point * it is read, tasks will be indexed with an incrementing `:ID`. When * `noindex` is read indexing is disabled and all subseequent tasks will * not have any `:ID` at all. * * Please note, the :ID is there for your benefit, it ensures that tasks * in Finit are unique. If you have two tasks with the same name and ID * (or no ID), the last one read replaces any preceding one! */ #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "helpers.h" #include "plugin.h" #include "service.h" #include "conf.h" #include "log.h" #ifndef MODULES_LOAD_PATH #define MODULES_LOAD_PATH "/etc/modules-load.d" #endif #define MODPROBE_PATH "/sbin/modprobe" #define SERVICE_LINE \ "cgroup.init name:modprobe.%s :%d [%s] %s %s %s --" #define SERVICE_LINE_NOINDEX \ "cgroup.init name:modprobe.%s [%s] %s %s %s --" static int modules_load(const char *file, int index) { char module_path[PATH_MAX]; char *modprobe_path; int num = 0; char *line; char *lvl; FILE *fp; strlcpy(module_path, MODULES_LOAD_PATH "/", sizeof(module_path)); strlcat(module_path, file, sizeof(module_path)); fp = fopen(module_path, "r"); if (!fp) { warnx("failed opening %s for reading, skipping ...", module_path); return 0; } modprobe_path = strdup(MODPROBE_PATH); if (!modprobe_path) { fail: warnx("failed allocating memory in modules-load plugin."); fclose(fp); return -1; } lvl = strdup("S"); if (!lvl) { free(modprobe_path); goto fail; } while ((line = fparseln(fp, NULL, NULL, NULL, 0))) { char cmd[CMD_SIZE], *mod, *args, *set; /* * fparseln() skips regular UNIX comments only. * This is for modules-load.d(5) compat. */ if (line[0] == ';') goto next; /* trim whitespace */ mod = strip_line(line); if (!mod[0]) goto next; /* Finit extension 'set foo bar' */ if ((set = fgetval(mod, "set", "= \t"))) { char *val = mod; if (!strcmp(set, "noindex")) { index = 0; free(set); goto next; } if ((val = fgetval(set, "index", "= \t"))) { index = atoi(val); free(set); free(val); goto next; } if ((val = fgetval(set, "runlevel", "= \t"))) { free(lvl); lvl = val; free(set); goto next; } if ((val = fgetval(set, "modprobe", "= \t"))) { if (access(val, X_OK)) { warn("%s: cannot use %s", module_path, val); free(set); free(val); free(line); goto skip; } else { free(modprobe_path); modprobe_path = val; } free(set); goto next; } /* unknown 'set' command, ignore. */ goto next; } mod = strtok_r(mod, " ", &args); if (!mod) goto next; if (!index) snprintf(cmd, sizeof(cmd), SERVICE_LINE_NOINDEX, mod, lvl, modprobe_path, mod, args); else snprintf(cmd, sizeof(cmd), SERVICE_LINE, mod, index++, lvl, modprobe_path, mod, args); dbg("task %s", cmd); service_register(SVC_TYPE_TASK, cmd, global_rlimit, NULL); num++; next: free(line); } skip: free(modprobe_path); free(lvl); fclose(fp); return num; } /* XXX: check here for .conf only? */ static int module_filter(const struct dirent *d) { if (d->d_type == DT_DIR) return 0; if (d->d_name[0] == '.') return 0; /* skip dot files */ if (d->d_name[strlen(d->d_name) - 1] == '~') return 0; /* skip backup files */ return 1; } static void load(void *arg) { struct dirent **dentry; int index = 1; int i, num; dbg("Scanning " MODULES_LOAD_PATH " for config files ..."); num = scandir(MODULES_LOAD_PATH, &dentry, module_filter, alphasort); if (num > 0) { for (i = 0; i < num; i++) { index += modules_load(dentry[i]->d_name, index); free(dentry[i]); } free(dentry); } } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_SVC_PLUGIN] = { .cb = load }, }; PLUGIN_INIT(__init) { plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/usr.c0000644000175100001660000000643515054341541010705 /* User-defined condition event monitor for the Finit condition engine * * Copyright (c) 2021-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #include #include "finit.h" #include "cond.h" #include "pid.h" #include "plugin.h" #include "iwatch.h" #include "log.h" static struct iwatch iw_usr; static void usr_cond(char *name, uint32_t mask) { char cond[MAX_COND_LEN] = COND_USR; strlcat(cond, name, sizeof(cond)); cond_update(cond); } static void usr_callback(void *arg, int fd, int events) { static char ev_buf[8 *(sizeof(struct inotify_event) + NAME_MAX + 1) + 1]; struct inotify_event *ev; ssize_t sz; size_t off; sz = read(fd, ev_buf, sizeof(ev_buf) - 1); if (sz <= 0) { err(1, "invalid inotify event"); return; } ev_buf[sz] = 0; for (off = 0; off < (size_t)sz; off += sizeof(*ev) + ev->len) { if (off + sizeof(*ev) > (size_t)sz) break; ev = (struct inotify_event *)&ev_buf[off]; if (off + sizeof(*ev) + ev->len > (size_t)sz) break; dbg("name %s, event: 0x%08x", ev->name, ev->mask); if (!ev->mask) continue; if (ev->mask & IN_ISDIR) continue; /* unsupported */ if (ev->mask & IN_DELETE) sync(); /* dont ask */ usr_cond(ev->name, ev->mask); } } static void usr_init(void *arg) { char usrdir[MAX_ARG_LEN]; char *path; mkpath(_PATH_COND, 0755); if (mkpath(pid_runpath(_PATH_CONDUSR, usrdir, sizeof(usrdir)), 0755) && errno != EEXIST) { err(1, "Failed creating %s condition directory, %s", COND_USR, _PATH_CONDUSR); return; } path = realpath(_PATH_CONDUSR, NULL); if (!path) { err(1, "Cannot figure out real path to %s, aborting", _PATH_CONDUSR); return; } if (iwatch_add(&iw_usr, path, IN_ONLYDIR)) iwatch_exit(&iw_usr); free(path); } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_BASEFS_UP] = { .cb = usr_init }, .depends = { "bootmisc", }, }; PLUGIN_INIT(__init) { int fd; fd = iwatch_init(&iw_usr); if (fd < 0) return; plugin.io.fd = fd; plugin.io.cb = usr_callback; plugin.io.flags = PLUGIN_IO_READ; plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); iwatch_exit(&iw_usr); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/Makefile.in0000644000175100001660000010446315054341567012005 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @BUILD_ALSA_UTILS_PLUGIN_TRUE@@STATIC_TRUE@am__append_1 = alsa-utils.c @BUILD_DBUS_PLUGIN_TRUE@@STATIC_TRUE@am__append_2 = dbus.c @BUILD_MODULES_LOAD_PLUGIN_TRUE@@STATIC_TRUE@am__append_3 = modules-load.c @BUILD_MODPROBE_PLUGIN_TRUE@@STATIC_TRUE@am__append_4 = modprobe.c @BUILD_NETLINK_PLUGIN_TRUE@@STATIC_TRUE@am__append_5 = netlink.c @BUILD_RESOLVCONF_PLUGIN_TRUE@@STATIC_TRUE@am__append_6 = resolvconf.c @BUILD_RTC_PLUGIN_TRUE@@STATIC_TRUE@am__append_7 = rtc.c @BUILD_TTY_PLUGIN_TRUE@@STATIC_TRUE@am__append_8 = tty.c @BUILD_URANDOM_PLUGIN_TRUE@@STATIC_TRUE@am__append_9 = urandom.c @BUILD_X11_COMMON_PLUGIN_TRUE@@STATIC_TRUE@am__append_10 = x11-common.c @BUILD_ALSA_UTILS_PLUGIN_TRUE@@STATIC_FALSE@am__append_11 = alsa-utils.la @BUILD_DBUS_PLUGIN_TRUE@@STATIC_FALSE@am__append_12 = dbus.la @BUILD_HOOK_SCRIPTS_PLUGIN_TRUE@@STATIC_FALSE@am__append_13 = hook-scripts.la @BUILD_MODULES_LOAD_PLUGIN_TRUE@@STATIC_FALSE@am__append_14 = modules-load.la @BUILD_MODPROBE_PLUGIN_TRUE@@STATIC_FALSE@am__append_15 = modprobe.la @BUILD_NETLINK_PLUGIN_TRUE@@STATIC_FALSE@am__append_16 = netlink.la @BUILD_RESOLVCONF_PLUGIN_TRUE@@STATIC_FALSE@am__append_17 = resolvconf.la @BUILD_RTC_PLUGIN_TRUE@@STATIC_FALSE@am__append_18 = rtc.la @BUILD_TTY_PLUGIN_TRUE@@STATIC_FALSE@am__append_19 = tty.la @BUILD_URANDOM_PLUGIN_TRUE@@STATIC_FALSE@am__append_20 = urandom.la @BUILD_X11_COMMON_PLUGIN_TRUE@@STATIC_FALSE@am__append_21 = x11-common.la subdir = plugins ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) alsa_utils_la_LIBADD = alsa_utils_la_SOURCES = alsa-utils.c alsa_utils_la_OBJECTS = alsa-utils.lo AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @BUILD_ALSA_UTILS_PLUGIN_TRUE@@STATIC_FALSE@am_alsa_utils_la_rpath = \ @BUILD_ALSA_UTILS_PLUGIN_TRUE@@STATIC_FALSE@ -rpath \ @BUILD_ALSA_UTILS_PLUGIN_TRUE@@STATIC_FALSE@ $(pkglibdir) bootmisc_la_LIBADD = bootmisc_la_SOURCES = bootmisc.c bootmisc_la_OBJECTS = bootmisc.lo @STATIC_FALSE@am_bootmisc_la_rpath = -rpath $(pkglibdir) dbus_la_LIBADD = dbus_la_SOURCES = dbus.c dbus_la_OBJECTS = dbus.lo @BUILD_DBUS_PLUGIN_TRUE@@STATIC_FALSE@am_dbus_la_rpath = -rpath \ @BUILD_DBUS_PLUGIN_TRUE@@STATIC_FALSE@ $(pkglibdir) hook_scripts_la_LIBADD = hook_scripts_la_SOURCES = hook-scripts.c hook_scripts_la_OBJECTS = hook-scripts.lo @BUILD_HOOK_SCRIPTS_PLUGIN_TRUE@@STATIC_FALSE@am_hook_scripts_la_rpath = \ @BUILD_HOOK_SCRIPTS_PLUGIN_TRUE@@STATIC_FALSE@ -rpath \ @BUILD_HOOK_SCRIPTS_PLUGIN_TRUE@@STATIC_FALSE@ $(pkglibdir) libplug_la_LIBADD = am__libplug_la_SOURCES_DIST = bootmisc.c pidfile.c procps.c sys.c \ usr.c alsa-utils.c dbus.c modules-load.c modprobe.c netlink.c \ resolvconf.c rtc.c tty.c urandom.c x11-common.c @BUILD_ALSA_UTILS_PLUGIN_TRUE@@STATIC_TRUE@am__objects_1 = \ @BUILD_ALSA_UTILS_PLUGIN_TRUE@@STATIC_TRUE@ alsa-utils.lo @BUILD_DBUS_PLUGIN_TRUE@@STATIC_TRUE@am__objects_2 = dbus.lo @BUILD_MODULES_LOAD_PLUGIN_TRUE@@STATIC_TRUE@am__objects_3 = \ @BUILD_MODULES_LOAD_PLUGIN_TRUE@@STATIC_TRUE@ modules-load.lo @BUILD_MODPROBE_PLUGIN_TRUE@@STATIC_TRUE@am__objects_4 = modprobe.lo @BUILD_NETLINK_PLUGIN_TRUE@@STATIC_TRUE@am__objects_5 = netlink.lo @BUILD_RESOLVCONF_PLUGIN_TRUE@@STATIC_TRUE@am__objects_6 = \ @BUILD_RESOLVCONF_PLUGIN_TRUE@@STATIC_TRUE@ resolvconf.lo @BUILD_RTC_PLUGIN_TRUE@@STATIC_TRUE@am__objects_7 = rtc.lo @BUILD_TTY_PLUGIN_TRUE@@STATIC_TRUE@am__objects_8 = tty.lo @BUILD_URANDOM_PLUGIN_TRUE@@STATIC_TRUE@am__objects_9 = urandom.lo @BUILD_X11_COMMON_PLUGIN_TRUE@@STATIC_TRUE@am__objects_10 = \ @BUILD_X11_COMMON_PLUGIN_TRUE@@STATIC_TRUE@ x11-common.lo @STATIC_TRUE@am_libplug_la_OBJECTS = bootmisc.lo pidfile.lo procps.lo \ @STATIC_TRUE@ sys.lo usr.lo $(am__objects_1) $(am__objects_2) \ @STATIC_TRUE@ $(am__objects_3) $(am__objects_4) \ @STATIC_TRUE@ $(am__objects_5) $(am__objects_6) \ @STATIC_TRUE@ $(am__objects_7) $(am__objects_8) \ @STATIC_TRUE@ $(am__objects_9) $(am__objects_10) libplug_la_OBJECTS = $(am_libplug_la_OBJECTS) @STATIC_TRUE@am_libplug_la_rpath = modprobe_la_LIBADD = modprobe_la_SOURCES = modprobe.c modprobe_la_OBJECTS = modprobe.lo @BUILD_MODPROBE_PLUGIN_TRUE@@STATIC_FALSE@am_modprobe_la_rpath = \ @BUILD_MODPROBE_PLUGIN_TRUE@@STATIC_FALSE@ -rpath $(pkglibdir) modules_load_la_LIBADD = modules_load_la_SOURCES = modules-load.c modules_load_la_OBJECTS = modules-load.lo @BUILD_MODULES_LOAD_PLUGIN_TRUE@@STATIC_FALSE@am_modules_load_la_rpath = \ @BUILD_MODULES_LOAD_PLUGIN_TRUE@@STATIC_FALSE@ -rpath \ @BUILD_MODULES_LOAD_PLUGIN_TRUE@@STATIC_FALSE@ $(pkglibdir) netlink_la_LIBADD = netlink_la_SOURCES = netlink.c netlink_la_OBJECTS = netlink.lo @BUILD_NETLINK_PLUGIN_TRUE@@STATIC_FALSE@am_netlink_la_rpath = -rpath \ @BUILD_NETLINK_PLUGIN_TRUE@@STATIC_FALSE@ $(pkglibdir) pidfile_la_LIBADD = pidfile_la_SOURCES = pidfile.c pidfile_la_OBJECTS = pidfile.lo @STATIC_FALSE@am_pidfile_la_rpath = -rpath $(pkglibdir) procps_la_LIBADD = procps_la_SOURCES = procps.c procps_la_OBJECTS = procps.lo @STATIC_FALSE@am_procps_la_rpath = -rpath $(pkglibdir) resolvconf_la_LIBADD = resolvconf_la_SOURCES = resolvconf.c resolvconf_la_OBJECTS = resolvconf.lo @BUILD_RESOLVCONF_PLUGIN_TRUE@@STATIC_FALSE@am_resolvconf_la_rpath = \ @BUILD_RESOLVCONF_PLUGIN_TRUE@@STATIC_FALSE@ -rpath \ @BUILD_RESOLVCONF_PLUGIN_TRUE@@STATIC_FALSE@ $(pkglibdir) rtc_la_LIBADD = rtc_la_SOURCES = rtc.c rtc_la_OBJECTS = rtc.lo @BUILD_RTC_PLUGIN_TRUE@@STATIC_FALSE@am_rtc_la_rpath = -rpath \ @BUILD_RTC_PLUGIN_TRUE@@STATIC_FALSE@ $(pkglibdir) sys_la_LIBADD = sys_la_SOURCES = sys.c sys_la_OBJECTS = sys.lo @STATIC_FALSE@am_sys_la_rpath = -rpath $(pkglibdir) tty_la_LIBADD = tty_la_SOURCES = tty.c tty_la_OBJECTS = tty.lo @BUILD_TTY_PLUGIN_TRUE@@STATIC_FALSE@am_tty_la_rpath = -rpath \ @BUILD_TTY_PLUGIN_TRUE@@STATIC_FALSE@ $(pkglibdir) urandom_la_LIBADD = urandom_la_SOURCES = urandom.c urandom_la_OBJECTS = urandom.lo @BUILD_URANDOM_PLUGIN_TRUE@@STATIC_FALSE@am_urandom_la_rpath = -rpath \ @BUILD_URANDOM_PLUGIN_TRUE@@STATIC_FALSE@ $(pkglibdir) usr_la_LIBADD = usr_la_SOURCES = usr.c usr_la_OBJECTS = usr.lo @STATIC_FALSE@am_usr_la_rpath = -rpath $(pkglibdir) x11_common_la_LIBADD = x11_common_la_SOURCES = x11-common.c x11_common_la_OBJECTS = x11-common.lo @BUILD_X11_COMMON_PLUGIN_TRUE@@STATIC_FALSE@am_x11_common_la_rpath = \ @BUILD_X11_COMMON_PLUGIN_TRUE@@STATIC_FALSE@ -rpath \ @BUILD_X11_COMMON_PLUGIN_TRUE@@STATIC_FALSE@ $(pkglibdir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/alsa-utils.Plo \ ./$(DEPDIR)/bootmisc.Plo ./$(DEPDIR)/dbus.Plo \ ./$(DEPDIR)/hook-scripts.Plo ./$(DEPDIR)/modprobe.Plo \ ./$(DEPDIR)/modules-load.Plo ./$(DEPDIR)/netlink.Plo \ ./$(DEPDIR)/pidfile.Plo ./$(DEPDIR)/procps.Plo \ ./$(DEPDIR)/resolvconf.Plo ./$(DEPDIR)/rtc.Plo \ ./$(DEPDIR)/sys.Plo ./$(DEPDIR)/tty.Plo \ ./$(DEPDIR)/urandom.Plo ./$(DEPDIR)/usr.Plo \ ./$(DEPDIR)/x11-common.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ 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 = alsa-utils.c bootmisc.c dbus.c hook-scripts.c \ $(libplug_la_SOURCES) modprobe.c modules-load.c netlink.c \ pidfile.c procps.c resolvconf.c rtc.c sys.c tty.c urandom.c \ usr.c x11-common.c DIST_SOURCES = alsa-utils.c bootmisc.c dbus.c hook-scripts.c \ $(am__libplug_la_SOURCES_DIST) modprobe.c modules-load.c \ netlink.c pidfile.c procps.c resolvconf.c rtc.c sys.c tty.c \ urandom.c usr.c x11-common.c 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) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibdir = $(plugin_path) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ AM_LDFLAGS = -module -avoid-version -shared AM_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99 AM_CPPFLAGS = -I$(top_srcdir)/src -D_XOPEN_SOURCE=600 -D_BSD_SOURCE \ -D_GNU_SOURCE -D_DEFAULT_SOURCE -D__FINIT__ $(lite_CFLAGS) \ $(uev_CFLAGS) @STATIC_TRUE@noinst_LTLIBRARIES = libplug.la @STATIC_TRUE@libplug_la_SOURCES = bootmisc.c pidfile.c procps.c sys.c \ @STATIC_TRUE@ usr.c $(am__append_1) $(am__append_2) \ @STATIC_TRUE@ $(am__append_3) $(am__append_4) $(am__append_5) \ @STATIC_TRUE@ $(am__append_6) $(am__append_7) $(am__append_8) \ @STATIC_TRUE@ $(am__append_9) $(am__append_10) @STATIC_FALSE@pkglib_LTLIBRARIES = bootmisc.la pidfile.la procps.la \ @STATIC_FALSE@ sys.la usr.la $(am__append_11) $(am__append_12) \ @STATIC_FALSE@ $(am__append_13) $(am__append_14) \ @STATIC_FALSE@ $(am__append_15) $(am__append_16) \ @STATIC_FALSE@ $(am__append_17) $(am__append_18) \ @STATIC_FALSE@ $(am__append_19) $(am__append_20) \ @STATIC_FALSE@ $(am__append_21) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign plugins/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } alsa-utils.la: $(alsa_utils_la_OBJECTS) $(alsa_utils_la_DEPENDENCIES) $(EXTRA_alsa_utils_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_alsa_utils_la_rpath) $(alsa_utils_la_OBJECTS) $(alsa_utils_la_LIBADD) $(LIBS) bootmisc.la: $(bootmisc_la_OBJECTS) $(bootmisc_la_DEPENDENCIES) $(EXTRA_bootmisc_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_bootmisc_la_rpath) $(bootmisc_la_OBJECTS) $(bootmisc_la_LIBADD) $(LIBS) dbus.la: $(dbus_la_OBJECTS) $(dbus_la_DEPENDENCIES) $(EXTRA_dbus_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_dbus_la_rpath) $(dbus_la_OBJECTS) $(dbus_la_LIBADD) $(LIBS) hook-scripts.la: $(hook_scripts_la_OBJECTS) $(hook_scripts_la_DEPENDENCIES) $(EXTRA_hook_scripts_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_hook_scripts_la_rpath) $(hook_scripts_la_OBJECTS) $(hook_scripts_la_LIBADD) $(LIBS) libplug.la: $(libplug_la_OBJECTS) $(libplug_la_DEPENDENCIES) $(EXTRA_libplug_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libplug_la_rpath) $(libplug_la_OBJECTS) $(libplug_la_LIBADD) $(LIBS) modprobe.la: $(modprobe_la_OBJECTS) $(modprobe_la_DEPENDENCIES) $(EXTRA_modprobe_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_modprobe_la_rpath) $(modprobe_la_OBJECTS) $(modprobe_la_LIBADD) $(LIBS) modules-load.la: $(modules_load_la_OBJECTS) $(modules_load_la_DEPENDENCIES) $(EXTRA_modules_load_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_modules_load_la_rpath) $(modules_load_la_OBJECTS) $(modules_load_la_LIBADD) $(LIBS) netlink.la: $(netlink_la_OBJECTS) $(netlink_la_DEPENDENCIES) $(EXTRA_netlink_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_netlink_la_rpath) $(netlink_la_OBJECTS) $(netlink_la_LIBADD) $(LIBS) pidfile.la: $(pidfile_la_OBJECTS) $(pidfile_la_DEPENDENCIES) $(EXTRA_pidfile_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_pidfile_la_rpath) $(pidfile_la_OBJECTS) $(pidfile_la_LIBADD) $(LIBS) procps.la: $(procps_la_OBJECTS) $(procps_la_DEPENDENCIES) $(EXTRA_procps_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_procps_la_rpath) $(procps_la_OBJECTS) $(procps_la_LIBADD) $(LIBS) resolvconf.la: $(resolvconf_la_OBJECTS) $(resolvconf_la_DEPENDENCIES) $(EXTRA_resolvconf_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_resolvconf_la_rpath) $(resolvconf_la_OBJECTS) $(resolvconf_la_LIBADD) $(LIBS) rtc.la: $(rtc_la_OBJECTS) $(rtc_la_DEPENDENCIES) $(EXTRA_rtc_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_rtc_la_rpath) $(rtc_la_OBJECTS) $(rtc_la_LIBADD) $(LIBS) sys.la: $(sys_la_OBJECTS) $(sys_la_DEPENDENCIES) $(EXTRA_sys_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_sys_la_rpath) $(sys_la_OBJECTS) $(sys_la_LIBADD) $(LIBS) tty.la: $(tty_la_OBJECTS) $(tty_la_DEPENDENCIES) $(EXTRA_tty_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_tty_la_rpath) $(tty_la_OBJECTS) $(tty_la_LIBADD) $(LIBS) urandom.la: $(urandom_la_OBJECTS) $(urandom_la_DEPENDENCIES) $(EXTRA_urandom_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_urandom_la_rpath) $(urandom_la_OBJECTS) $(urandom_la_LIBADD) $(LIBS) usr.la: $(usr_la_OBJECTS) $(usr_la_DEPENDENCIES) $(EXTRA_usr_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_usr_la_rpath) $(usr_la_OBJECTS) $(usr_la_LIBADD) $(LIBS) x11-common.la: $(x11_common_la_OBJECTS) $(x11_common_la_DEPENDENCIES) $(EXTRA_x11_common_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_x11_common_la_rpath) $(x11_common_la_OBJECTS) $(x11_common_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsa-utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bootmisc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hook-scripts.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modprobe.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modules-load.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pidfile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procps.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolvconf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tty.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/urandom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11-common.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @STATIC_TRUE@install-exec-hook: @STATIC_TRUE@uninstall-hook: clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/alsa-utils.Plo -rm -f ./$(DEPDIR)/bootmisc.Plo -rm -f ./$(DEPDIR)/dbus.Plo -rm -f ./$(DEPDIR)/hook-scripts.Plo -rm -f ./$(DEPDIR)/modprobe.Plo -rm -f ./$(DEPDIR)/modules-load.Plo -rm -f ./$(DEPDIR)/netlink.Plo -rm -f ./$(DEPDIR)/pidfile.Plo -rm -f ./$(DEPDIR)/procps.Plo -rm -f ./$(DEPDIR)/resolvconf.Plo -rm -f ./$(DEPDIR)/rtc.Plo -rm -f ./$(DEPDIR)/sys.Plo -rm -f ./$(DEPDIR)/tty.Plo -rm -f ./$(DEPDIR)/urandom.Plo -rm -f ./$(DEPDIR)/usr.Plo -rm -f ./$(DEPDIR)/x11-common.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/alsa-utils.Plo -rm -f ./$(DEPDIR)/bootmisc.Plo -rm -f ./$(DEPDIR)/dbus.Plo -rm -f ./$(DEPDIR)/hook-scripts.Plo -rm -f ./$(DEPDIR)/modprobe.Plo -rm -f ./$(DEPDIR)/modules-load.Plo -rm -f ./$(DEPDIR)/netlink.Plo -rm -f ./$(DEPDIR)/pidfile.Plo -rm -f ./$(DEPDIR)/procps.Plo -rm -f ./$(DEPDIR)/resolvconf.Plo -rm -f ./$(DEPDIR)/rtc.Plo -rm -f ./$(DEPDIR)/sys.Plo -rm -f ./$(DEPDIR)/tty.Plo -rm -f ./$(DEPDIR)/urandom.Plo -rm -f ./$(DEPDIR)/usr.Plo -rm -f ./$(DEPDIR)/x11-common.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-hook uninstall-pkglibLTLIBRARIES .PRECIOUS: Makefile # Clean up .la files installed by libtool despite being in -module mode @STATIC_FALSE@install-exec-hook: @STATIC_FALSE@ @(cd $(DESTDIR)$(pkglibdir) && $(RM) $(pkglib_LTLIBRARIES)) @STATIC_FALSE@uninstall-hook: @STATIC_FALSE@ @(cd $(DESTDIR)$(pkglibdir) && for file in $(pkglib_LTLIBRARIES); do $(RM) `basename $$file .la`.so; done) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/plugins/resolvconf.c0000644000175100001660000000423515054341541012250 /* Setup necessary files for resolvconf * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "helpers.h" #include "plugin.h" #include "log.h" /* * No need to clean up files in /etc/resolvconf/run/interface/ * this is already taken care of by bootclean */ static void setup(void *arg) { dbg("Setting up the resolver ..."); mkpath("/etc/resolvconf", 0755); mkpath("/etc/resolvconf/run", 0755); mkpath("/var/run/resolvconf", 0755); mkpath("/var/run/resolvconf/interface", 0755); touch("/etc/resolvconf/run/enable-updates"); chdir("/etc/resolvconf/run/interface"); run_parts("/etc/resolvconf/update.d", "-i", NULL, 0, 0); chdir("/"); } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_BASEFS_UP] = { .cb = setup }, .depends = { "bootmisc", }, }; PLUGIN_INIT(__init) { plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/rtc.c0000644000175100001660000001626115054341541010662 /* Save and restore RTC using hwclock * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "config.h" #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "helpers.h" #include "plugin.h" #include "private.h" #include "conf.h" #include "log.h" /* * Kernel RTC driver validates against this date for sanity check. The * on NTP sync the driver can also update the RTC every 11 mins. We use * the same update interval to handle manual time set and file save. */ #define RTC_TIMESTAMP_BEGIN_2000 "2000-01-01 00:00:00" #define RTC_FMT "%Y-%m-%d %H:%M:%S" #define RTC_PERIOD (11 * 60 * 1000) #ifdef RTC_TIMESTAMP_CUSTOM static char *rtc_timestamp = RTC_TIMESTAMP_CUSTOM; #else static char *rtc_timestamp = RTC_TIMESTAMP_BEGIN_2000; #endif static time_t rtc_date_fallback = 946684800LL; static char *rtc_file = RTC_FILE; static uev_t rtc_timer; static void tz_set(char *tz, size_t len) { char *ptr; ptr = getenv("TZ"); if (!ptr) memset(tz, 0, len); else strlcpy(tz, ptr, len); setenv("TZ", "UTC0", 1); tzset(); } static void tz_restore(char *tz) { if (!tz || !tz[0]) unsetenv("TZ"); else setenv("TZ", tz, 1); tzset(); } static int time_set(struct tm *tm) { struct tm fallback = { 0 }; struct timeval tv = { 0 }; char tz[128]; int rc = 0; tz_set(tz, sizeof(tz)); if (!tm) { logit(LOG_NOTICE, "Resetting system clock to kernel default, %s.", rtc_timestamp); tm = &fallback; /* Attempt to set RTC to a sane value ... */ tv.tv_sec = rtc_date_fallback; if (!gmtime_r(&tv.tv_sec, tm)) { rc = 1; goto out; } } tm->tm_isdst = -1; /* Use tzdata to figure it out, please. */ tv.tv_sec = mktime(tm); if (tv.tv_sec == (time_t)-1 || tv.tv_sec < rtc_date_fallback) { errno = EINVAL; rc = 2; } else { if (settimeofday(&tv, NULL) == -1) rc = 1; } out: tz_restore(tz); return rc; } static int time_get(struct tm *tm) { struct timeval tv = { 0 }; char tz[128]; int rc = 0; tz_set(tz, sizeof(tz)); rc = gettimeofday(&tv, NULL); if (rc < 0 || tv.tv_sec < rtc_date_fallback) rc = 2; else gmtime_r(&tv.tv_sec, tm); tz_restore(tz); return rc; } static void file_save(void *arg) { struct tm tm = { 0 }; int rc = 0; FILE *fp; if (!rtc_file) return; fp = fopen(rtc_file, "w"); if (!fp) { logit(LOG_WARNING, "Failed saving system clock to %s, code %d: %s", rtc_file, errno, strerror(errno)); return; } if ((rc = time_get(&tm))) { logit(LOG_WARNING, "System clock invalid, before %s, not saving", rtc_timestamp); print_desc(NULL, "System clock invalid, skipping"); } else { char buf[32] = { 0 }; print_desc(NULL, "Saving system clock to file"); strftime(buf, sizeof(buf), RTC_FMT, &tm); fprintf(fp, "%s\n", buf); } print(rc, NULL); fclose(fp); } static void file_restore(void *arg) { struct tm tm = { 0 }; int rc = 1; FILE *fp; if (!rtc_file) { logit(LOG_NOTICE, "System has no RTC (missing driver?), skipping restore."); return; } print_desc(NULL, "Restoring system clock from backup"); fp = fopen(rtc_file, "r"); if (fp) { char buf[32]; if (fgets(buf, sizeof(buf), fp)) { chomp(buf); strptime(buf, RTC_FMT, &tm); rc = time_set(&tm); } fclose(fp); } else logit(LOG_WARNING, "Missing %s", rtc_file); if (rc) { time_set(NULL); rc = 2; } print(rc, NULL); } static int rtc_open(void) { char *alt[] = { "/dev/rtc", "/dev/rtc0", "/dev/misc/rtc" }; size_t i; int fd; for (i = 0; i < NELEMS(alt); i++) { fd = open(alt[i], O_RDONLY); if (fd < 0) continue; return fd; } return -1; } static void rtc_save(void *arg) { struct tm tm = { 0 }; int fd, rc = 0; if (rescue) { dbg("Skipping %s plugin in rescue mode.", __FILE__); return; } fd = rtc_open(); if (fd < 0) return; if ((rc = time_get(&tm))) { print_desc(NULL, "System clock invalid, not saving to RTC"); } else { print_desc(NULL, "Saving system clock (UTC) to RTC"); rc = ioctl(fd, RTC_SET_TIME, &tm); } if (rc && errno == EINVAL) { logit(LOG_WARNING, "System clock invalid, before %s, not saving to RTC", rtc_timestamp); rc = 2; } print(rc, NULL); close(fd); } static void rtc_restore(void *arg) { struct tm tm = { 0 }; int fd, rc = 0; if (rescue) { dbg("Skipping %s plugin in rescue mode.", __FILE__); return; } fd = rtc_open(); if (fd < 0) { file_restore(arg); return; } if ((rc = ioctl(fd, RTC_RD_TIME, &tm)) < 0) { char msg[120]; snprintf(msg, sizeof(msg), "Failed restoring system clock, %s", EINVAL == errno ? "RTC time is too old" : ENOENT == errno ? "RTC has no saved time" : "see log for details"); print_desc(NULL, msg); } else { print_desc(NULL, "Restoring system clock (UTC) from RTC"); rc = time_set(&tm); } if (rc) { logit(LOG_WARNING, "Failed restoring system clock from RTC."); if (EINVAL == errno) logit(LOG_WARNING, "RTC time is too old (before %s)", rtc_timestamp); else if (ENOENT == errno) logit(LOG_WARNING, "RTC has no previously saved (valid) time."); else logit(LOG_WARNING, "RTC error code %d: %s", errno, strerror(errno)); print(2, NULL); /* Try restoring from last save game */ if (rtc_file) file_restore(arg); } else print(0, NULL); close(fd); } static void save(void *arg) { rtc_save(arg); file_save(arg); } static void update(uev_t *w, void *arg, int events) { save(arg); } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_BASEFS_UP] = { .cb = rtc_restore }, .hook[HOOK_SHUTDOWN] = { .cb = save } }; PLUGIN_INIT(__init) { struct tm tm = { 0 }; if (!strptime(rtc_timestamp, RTC_FMT, &tm)) { logit(LOG_WARNING, "Invalid restore date '%s', reverting to '%s'", rtc_timestamp, RTC_TIMESTAMP_BEGIN_2000); rtc_timestamp = RTC_TIMESTAMP_BEGIN_2000; } else rtc_date_fallback = mktime(&tm); uev_timer_init(ctx, &rtc_timer, update, NULL, RTC_PERIOD, RTC_PERIOD); plugin_register(&plugin); } PLUGIN_EXIT(__exit) { uev_timer_stop(&rtc_timer); plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/Makefile.am0000644000175100001660000000420615054341541011756 pkglibdir = $(plugin_path) AM_LDFLAGS = -module -avoid-version -shared AM_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99 AM_CPPFLAGS = -I$(top_srcdir)/src AM_CPPFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE AM_CPPFLAGS += -D__FINIT__ $(lite_CFLAGS) $(uev_CFLAGS) if STATIC noinst_LTLIBRARIES = libplug.la libplug_la_SOURCES = bootmisc.c pidfile.c procps.c sys.c usr.c if BUILD_ALSA_UTILS_PLUGIN libplug_la_SOURCES += alsa-utils.c endif if BUILD_DBUS_PLUGIN libplug_la_SOURCES += dbus.c endif if BUILD_MODULES_LOAD_PLUGIN libplug_la_SOURCES += modules-load.c endif if BUILD_MODPROBE_PLUGIN libplug_la_SOURCES += modprobe.c endif if BUILD_NETLINK_PLUGIN libplug_la_SOURCES += netlink.c endif if BUILD_RESOLVCONF_PLUGIN libplug_la_SOURCES += resolvconf.c endif if BUILD_RTC_PLUGIN libplug_la_SOURCES += rtc.c endif if BUILD_TTY_PLUGIN libplug_la_SOURCES += tty.c endif if BUILD_URANDOM_PLUGIN libplug_la_SOURCES += urandom.c endif if BUILD_X11_COMMON_PLUGIN libplug_la_SOURCES += x11-common.c endif else pkglib_LTLIBRARIES = bootmisc.la pidfile.la procps.la sys.la usr.la if BUILD_ALSA_UTILS_PLUGIN pkglib_LTLIBRARIES += alsa-utils.la endif if BUILD_DBUS_PLUGIN pkglib_LTLIBRARIES += dbus.la endif if BUILD_HOOK_SCRIPTS_PLUGIN pkglib_LTLIBRARIES += hook-scripts.la endif if BUILD_MODULES_LOAD_PLUGIN pkglib_LTLIBRARIES += modules-load.la endif if BUILD_MODPROBE_PLUGIN pkglib_LTLIBRARIES += modprobe.la endif if BUILD_NETLINK_PLUGIN pkglib_LTLIBRARIES += netlink.la endif if BUILD_RESOLVCONF_PLUGIN pkglib_LTLIBRARIES += resolvconf.la endif if BUILD_RTC_PLUGIN pkglib_LTLIBRARIES += rtc.la endif if BUILD_TTY_PLUGIN pkglib_LTLIBRARIES += tty.la endif if BUILD_URANDOM_PLUGIN pkglib_LTLIBRARIES += urandom.la endif if BUILD_X11_COMMON_PLUGIN pkglib_LTLIBRARIES += x11-common.la endif # Clean up .la files installed by libtool despite being in -module mode install-exec-hook: @(cd $(DESTDIR)$(pkglibdir) && $(RM) $(pkglib_LTLIBRARIES)) uninstall-hook: @(cd $(DESTDIR)$(pkglibdir) && for file in $(pkglib_LTLIBRARIES); do $(RM) `basename $$file .la`.so; done) endif finit-4.14/plugins/modprobe.c0000644000175100001660000001154015054341541011674 /* Coldplug modules using modalias magic * * Copyright (c) 2021-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /* * Cold plug magic taken from Buildroot * https://github.com/buildroot/buildroot/commit/b4fc5a180c81689a982d5c595844331684c14f51 * * The plugin basically does this, only in C: * * system("find /sys/devices -name modalias -print0" * " | xargs -0 sort -u -z" * " | xargs -0 modprobe -abq"); * * Note: BusyBox must *not* be built with CONFIG_MODPROBE_SMALL */ #include #include #include #include #include /* gettimeofday() */ #include #ifdef _LIBITE_LITE # include #else # include #endif #include "config.h" #include "finit.h" #include "util.h" #include "plugin.h" #include "log.h" struct module { TAILQ_ENTRY(module) link; char *alias; }; static TAILQ_HEAD(, module) modules = TAILQ_HEAD_INITIALIZER(modules); static int modprobe(char *alias) { char *args[] = { "modprobe", "-abq", alias, NULL, }; pid_t pid; pid = fork(); switch (pid) { case -1: err(1, "Failed forking modprobe child"); return 1; case 0: execvp(args[0], args); break; default: if (!complete(args[0], pid)) dbg("Successful modprobe of %s", alias); break; } return 0; } static void alias_add(char *alias) { struct module *m; m = malloc(sizeof(*m)); if (!m) return; m->alias = strdup(alias); if (!m->alias) { free(m); return; } TAILQ_INSERT_TAIL(&modules, m, link); } static void alias_remove(struct module *m) { TAILQ_REMOVE(&modules, m, link); free(m->alias); free(m); } static int alias_exist(char *alias) { struct module *m; TAILQ_FOREACH(m, &modules, link) { if (!strcmp(m->alias, alias)) return 1; } return 0; } static void alias_add_uniq(char *alias) { if (alias_exist(alias)) return; alias_add(alias); } static FILE *maybe_fopen_alias(const char *file, const char *path) { const char *basename; basename = basenm(path); if (!strcmp(basename, path)) return NULL; if (strcmp(file, basename)) return NULL; return fopen(path, "r"); } static int scan_modalias(const char *path) { char buf[256]; FILE *fp; fp = maybe_fopen_alias("modalias", path); if (!fp) return 1; if (fgets(buf, sizeof(buf), fp)) { chomp(buf); alias_add_uniq(buf); } fclose(fp); return 0; } static int scan_uevent(const char *path) { char buf[256]; FILE *fp; fp = maybe_fopen_alias("uevent", path); if (!fp) return 1; while (fgets(buf, sizeof(buf), fp)) { if (strstr(buf, "MODALIAS=") != buf) continue; chomp(buf); alias_add_uniq(buf + strlen("MODALIAS=")); break; } fclose(fp); return 0; } static int scan_alias(const char *path, const struct stat *st, int flag, struct FTW *unused) { /* Sanity check: is this a regular file we can read? */ if (!(S_ISREG(st->st_mode) && (st->st_mode & S_IRUSR))) return 0; if (!scan_uevent(path)) return 0; scan_modalias(path); return 0; } static void coldplug(void *arg) { struct module *m, *tmp; int rc = 0; /* Skip for systems without modules, e.g. small embedded or containers */ if (!fisdir("/lib/modules")) return; if (!fismnt("/sys")) { print(1, "Cannot modprobe system, /sys is not mounted"); return; } print_desc("Cold plugging system", NULL); rc = nftw("/sys/devices", scan_alias, 200, FTW_DEPTH | FTW_PHYS); if (!rc) { TAILQ_FOREACH_SAFE(m, &modules, link, tmp) { rc += modprobe(m->alias); alias_remove(m); } } print_result(rc); } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_BASEFS_UP] = { .cb = coldplug }, .depends = { "bootmisc", } }; PLUGIN_INIT(__init) { plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/procps.c0000644000175100001660000000502615054341541011375 /* Set kernel variables from /etc/sysctl.conf et al * * Copyright (c) 2016-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "helpers.h" #include "plugin.h" #include "conf.h" #include "log.h" #ifndef SYSCTL_PATH #define SYSCTL_PATH "/sbin/sysctl" #endif static void setup(void *arg) { glob_t gl; if (rescue) { dbg("Skipping %s plugin in rescue mode.", __FILE__); return; } glob("/run/sysctl.d/*.conf", 0, NULL, &gl); glob("/etc/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl); glob("/usr/local/lib/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl); glob("/usr/lib/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl); glob("/lib/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl); glob("/mnt/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl); glob("/etc/sysctl.conf", GLOB_APPEND, NULL, &gl); if (gl.gl_pathc > 0) { size_t i; for (i = 0; i < gl.gl_pathc; i++) { char cmd[160]; snprintf(cmd, sizeof(cmd), "%s -e -p %s >/dev/null", SYSCTL_PATH, gl.gl_pathv[i]); run(cmd, "sysctl"); } globfree(&gl); } } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_BASEFS_UP] = { .cb = setup }, .depends = { "bootmisc", }, }; PLUGIN_INIT(__init) { plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/plugins/x11-common.c0000644000175100001660000000362515054341541011771 /* Console setup (for X) * * Copyright (c) 2012-2025 Joachim Wiberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include #ifdef _LIBITE_LITE # include #else # include #endif #include "finit.h" #include "helpers.h" #include "plugin.h" #include "conf.h" #include "log.h" static void setup(void *arg) { if (rescue) { dbg("Skipping %s plugin in rescue mode.", __FILE__); return; } if (fexist("/var/run/console/console.lock") && which("pam_console_apply")) run("pam_console_apply", "pam-console"); } static plugin_t plugin = { .name = __FILE__, .hook[HOOK_SVC_PLUGIN] = { .cb = setup }, }; PLUGIN_INIT(__init) { plugin_register(&plugin); } PLUGIN_EXIT(__exit) { plugin_unregister(&plugin); } /** * Local Variables: * indent-tabs-mode: t * c-file-style: "linux" * End: */ finit-4.14/aux/0000755000175100001660000000000015054341601007111 5finit-4.14/aux/missing0000755000175100001660000001533615054341567010453 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: finit-4.14/aux/config.sub0000755000175100001660000010511615054341567011033 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | 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 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # 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 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | 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 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: finit-4.14/aux/config.guess0000755000175100001660000014051215054341566011366 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { 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 } # 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 PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 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 test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then 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 # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; 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 FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then LIBCABI=${LIBC}x32 fi fi GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; x86_64:Haiku:*:*) GUESS=x86_64-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: finit-4.14/aux/test-driver0000755000175100001660000001141715054341567011246 #! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <"$log_file" "$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: finit-4.14/aux/ltmain.sh0000755000175100001660000121237515054341565010700 #! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.7 Debian-2.4.7-7build1" package_revision=2.4.7 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh 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 case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! 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 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. if test -z "$_G_HAVE_PLUSEQ_OP" && \ __PLUSEQ_TEST="a" && \ __PLUSEQ_TEST+=" b" 2>/dev/null && \ test "a b" = "$__PLUSEQ_TEST"; then _G_HAVE_PLUSEQ_OP=yes fi if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd _G_rc_run_hooks=false case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion Debian-2.4.7-7build1 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. -pthread) case $host in *solaris2*) ;; *) case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac ;; esac continue ;; -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $func_quote_arg_result" func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $wl$func_quote_arg_result" func_append compiler_flags " $wl$func_quote_arg_result" func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xassembler) prev=xassembler continue ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC # -static-* direct GCC to link specific libraries statically # -fcilkplus Cilk Plus language extension features for C/C++ # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_arg pretty "$arg" arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type '$version_type'" ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty "$var_value" relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done func_quote eval cd "`pwd`" func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty,unquoted "$var_value" relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. func_quote eval cd "`pwd`" relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote_arg pretty,unquoted "$relink_command" relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: finit-4.14/aux/compile0000755000175100001660000001635015054341566010426 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: finit-4.14/aux/install-sh0000755000175100001660000003577615054341567011072 #!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: finit-4.14/aux/depcomp0000755000175100001660000005602015054341567010424 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: finit-4.14/Makefile.in0000644000175100001660000007255315054341567010330 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @CONTRIB_TRUE@am__append_1 = contrib @DOC_TRUE@am__append_2 = doc @LIBSYSTEMD_TRUE@am__append_3 = libsystemd test @LIBSYSTEMD_FALSE@am__append_4 = test subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(dist_doc_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docdir)" DATA = $(dist_doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.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. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = man plugins src system tmpfiles.d contrib doc \ libsystemd test am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/aux/compile $(top_srcdir)/aux/config.guess \ $(top_srcdir)/aux/config.sub $(top_srcdir)/aux/install-sh \ $(top_srcdir)/aux/ltmain.sh $(top_srcdir)/aux/missing \ README.md aux/compile aux/config.guess aux/config.sub \ aux/install-sh aux/ltmain.sh aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" 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 pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = man plugins src system tmpfiles.d $(am__append_1) \ $(am__append_2) $(am__append_3) $(am__append_4) dist_doc_DATA = README.md LICENSE contrib/finit.conf DISTCHECK_CONFIGURE_FLAGS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --enable-testserv-plugin --enable-x11-common-plugin \ --with-watchdog --with-keventd --with-fstab=/etc/fstab \ --with-libsystemd --with-bash-completion-dir=no all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) 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 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ 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) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_docDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_docDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dist_docDATA 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-dist_docDATA .PRECIOUS: Makefile # Explicit dependency to ensure libsystemd is built before test @LIBSYSTEMD_TRUE@test: libsystemd # Compat hook install-dev: @make -C src install-pkgincludeHEADERS # Target to run when building a release release: distcheck @for file in $(DIST_ARCHIVES); do \ md5sum $$file > ../$$file.md5; \ sha256sum $$file > ../$$file.sha256; \ done @mv $(DIST_ARCHIVES) ../ @echo @echo "Resulting release files:" @echo "=================================================================" @for file in $(DIST_ARCHIVES); do \ printf "$$file \tDistribution tarball\n"; \ printf "$$file.md5\t"; cat ../$$file.md5 | cut -f1 -d' '; \ printf "$$file.sha256\t"; cat ../$$file.sha256 | cut -f1 -d' '; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/man/0000755000175100001660000000000015054341600007066 5finit-4.14/man/finit.80000644000175100001660000002534415054341541010224 .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .Dd Jul 9, 2025 .\" Please adjust this date whenever revising the manpage. .Dt FINIT 8 SMM .Os Linux .Sh NAME .Nm finit .Nd Fast init for Linux systems .Sh SYNOPSIS .Nm /sbin/finit -- .Op debug .Op quiet .Op rescue | recover .Op single | S .Op panic=SEC .Op loglevel=<0-7> .Op fsck.mode=[auto,skip,force] .Op fsck.repair=[no,yes,preen] .Op finit.debug= .Op finit.fstab=/path/to/fstab .Op finit.cond=foo[,bar[,baz]] .Op finit.config=/path/to/finit.conf .Op finit.status_style= .Op finit.status= .Nm /sbin/telinit .Op Fl hv .Op q | Q | s | S | 0-9 .Sh DESCRIPTION Fast init for Linux systems. Reverse engineered from the EeePC fastinit, 10+ years ago by Claudio Matsuoka, "gaps filled with frog DNA ...". Focus is on small and embedded systems, although Finit is fully usable on server and desktop systems as well. .Sh OPTIONS When .Sy not started as PID 1, .Nm behaves like .Nm telinit , following classic UNIX command line syntax. The options are: .Pp .Bl -tag -width Ds -compact -offset indent .It Fl h Show built-in help text. .It Fl v Show program version. .El .Pp More options are implemented for SysV init support, but are ignored. .Sh ARGUMENTS When .Sy not started as PID 1, .Nm , or .Nm telinit , take these arguments: .Pp .Bl -tag -width Ds -compact -offset indent .It q | Q Reload configuration, same as .Cm initctl reload . .It 0 - 9 Go to runlevel N, same as .Cm initctl reload N . .It s | S Go to single user mode, runlevel 1. .El .Sh FEATURES .Bl -bullet -width 1n -compact .It Runlevels, defined per service .It One-shot tasks, services (daemons), or SysV init start/stop scripts .It Runparts and .Pa /etc/rc.local support .It Process supervision similar to .Xr systemd 8 .It Sourcing environment files .It Conditions for network/process/custom dependencies .It Process readiness notification for synchronizing system startup as well as reconfiguration at runtime. Natively PID files are used, but systemd .Cm sd_notify() and s6 notification is also supported. .It Limited support for .Xr tmpfiles.d 5 , no aging, attributes, or subvolumes .It Pre/Post script actions .It Tooling to enable/disable services .It Built-in getty .It Built-in watchdog, with support for hand-over to .Lk https://troglobit.com/watchdogd.html watchdogd .It Built-in support for Debian/BusyBox .Pa /etc/network/interfaces .It Cgroups v2, both configuration and monitoring in `initctl top` .It Plugin support for customization .It Proper rescue mode with bundled `sulogin` for protected maintenance shell .El .Sh BOOTPARAM .Nm support the following command line parameters to alter the behavior at boot. Notice the .Cm -- separator needed to tell the kernel which paramters should be given to PID 1. For more information on this, and available kernel command line options, see .Xr bootparam 7 . .Bl -tag -width pid -offset indent .It Cm debug Enable kernel debug. Debug messages are printed to the console until Finit starts up, unless .Cm loglevel=7 (below) is used. .It Cm fsck.mode= Defaults to .Cm auto , unless Finit is built with .Cm configure --enable-fastboot , in which case the default is .Cm skip . .It Cm fsck.repair= Defaults to .Cm preen , unless Finit is built with .Cm configure --enable-fsckfix , in which case the default is .Cm yes . This configure option also sets .Cm fsck.mode=force , unless fastboot is also enabled. I.e., .Cm configure --enable-fastboot build option overrides the .Cm fsck.mode default value. .It Cm finit.cond=foo[,bar[,baz]] set .Cm condition, optionally multiple conditions can be set using the same option, separated with a comma. Alternatively, multiple .Cm foo.cond=arg can be given. Each will result in a .Cm condition being set to control the rest of the system bootstrap. .Pp Very useful for selecting different boot modes, e.g. manufacturing test, firmware upgrade, or rescue mode. .Pp .Sy Note: .Cm conditions cannot be cleared with .Nm initctl ! .It Cm finit.config=/path/to/alternative/finit.conf override the compile-time bootstrap config file, default: .Bd -unfilled -offset indent ./configure --with-config=/etc/finit.conf .Ed Useful when starting up in various rescue mode, factory, or production test setups. Use the top-level configuration file directive .Cm rcsd Ar /path/to/finit.d to override the default rcS.d directory. .It Cm finit.debug Enable Finit debug messages on system console and log. Sometimes useful when doing board bringup. Before the system log daemon has started, Finit use the kernel ring buffer, .Pa /dev/kmsg . .It Cm finit.fstab=/path/to/fstab.alt Tell .Nm to use an alternate .Cm fstab to mount the file system from. Remember, this file must be on the .Cm root=... file system provided to Finit from the kernel. If this file is missing, .Nm falls back to its built-in default, which can be changed at build time using the .Cm --with-fstab=/path/to/footab configure option. It is even possible to completely disable the built-in using .Cm --without-fstab , meaning .Nm .Sy must be started with the .Cm finit.fstab option. .Pp Should .Nm discover that there is no fstab file available, including the fallback, it triggers the same failure mode as when .Cm fsck fails, starting .Xr sulogin 8 , if that is availble. When .Cm sulogin is missing, or when the user exits from .Cm sulogin , the system is rebooted. .Pp Default fstab, unless changed at build-time: .Pa /etc/fstab .It Cm finit.status= Control finit boot progress, including banner. This used to be called .Cm finit.show_status , which still works but is deprecated. .It Cm finit.status_style= Set Finit boot progress style, when enabled. .It Cm loglevel=<0-7> set the kernel's log level, which is more granular than .Cm debug . Also, when .Cm loglevel=7 , Finit will .Em not disable kernel logs to the console. This is very useful when debugging the kernel at system bring-up. Since .Cm loglevel=7 is the same as .Cm debug this means you have to use .Cm quiet for a quiet boot, until sysklogd takes over logging of kernel events. .It Cm panic=SEC By default the kernel does not reboot after a kernel panic. This setting will cause a kernel reboot after .Ar SEC seconds. .It Cm quiet Suppress kernel logging to console, except for warnings and errors. Also, see .Cm loglevel and .Cm quiet above. .It Cm rescue | recover Start rescue/maintenance mode. If your system comes with the bundled .Cm sulogin program (Finit, or from util-linux/Busybox), you will be given a root login to a maintenance shell. However, if .Cm sulogin is missing, the file .Pa /lib/finit/rescue.conf is read and the system booted in a limited fallback mode. See .Xr finit.conf 5 for more information. .It Cm single | S Single user mode, runlevel 1, in Finit. Useful to debug problems with the regular runlevel. All services and TTYs in .Cm [1] will be started, e.g., a .Cm tty [1] @console nologin configuration presents you with a root console without login. .Pp .Sy Note: by definition, single user mode does not have networking enabled. This is also true for runlevel 1. .El .Sh BOOTING .Pp Before laucnhing services, the system needs to be bootstrapped. This involves mounting all filesystems (not already mounted by an initramfs) in .Pa /etc/fstab , or any alternate .Pa fstab file provided on the Finit command line using .Cm finit.fstab , ensuring that necessary filesystems like: .Pa /dev , .Pa /proc , .Pa /sys , and .Pa /run are available and can provide the system with the services required. .Pp With that out of the way, a set of plugins take over: .Pp .Bl -tag -width bootmisc.so -offset indent .It Cm bootmisc.so Cleans up stale files from previous boots and default directories are created in tmpfs filesystems .It Cm modprobe.so Probes kernel modules required by the system .It Cm procps.so Set kernel variables from .Pa /etc/sysctl.conf et al .El .Pp When the plugins are done, finit reads .Pa /etc/finit.conf and all other enabled services in .Pa /etc/finit.d/* . First all services, run/tasks in runlevel S (bootStrap) are started, When all run/tasks have completed, Finit changes to the configured runlevel (default 2), Processes are started in parallel, in dependency order according to their conditions. .Pp When all services and run/tasks have been started, the console progress is disabled and all configured getty services are started. .Sh CONDITIONS The condition subysystem in Finit was initially created to track PID files of daemons. If service/task B requires service A to have started, Finit waits for the PID file of service A to be created/updated before it starts service B. Conversely, if service A is stopped and its PID file removed, service B is also stopped. .Pp The following condition families are available today: .Pp .Bl -tag -width service -offset indent .It Cm net Linux netlink events, e.g. net/route/default, net/eth0/up, and net/et0/running .It Cm pid PID files based on the service declaration .Cm name:id , gives the condition pid/name:id .It Cm service Tracks run/task/service state stansitions, including readiness. E.g., .Cm service/foo/ready can be used as a condition for service .Cm bar , provided .Cm foo properly signals its readiness to Finit. .It Cm sys System conditions, e.g. sys/key/ctrlaltdel and sys/pwr/fail .It Cm usr User conditions, assert and deassert using .Cm initctl cond [set|clr] foo .El .Sh SIGNALS PID 1 is the only process that by default blocks all signals. Finit allows for the following signals to control operation, but recommends instead using the .Xr initctl 8 tool. .Pp .Bl -tag -width TERM .It HUP Tell .Nm to reload its configuration file(s), same as .Cm initctl reload .It USR1 Restart API .Cm ( initctl ) socket. .It USR2 Tell .Nm to perform a system shutdown, same as .Cm initctl poweroff .It TERM Like SIGUSR2 but performs a reboot, same as .Cm initctl reboot .It INT Sent from kernel when Ctrl-Alt-Del is pressed (on the console), this asserts the sys/key/ctrlaltdel condition, which can be used to start tasks or services .It PWR Sent from a a power daemon on changes to UPS status, Finit asserts the sys/pwr/fail condition .El .Sh FILES .Bl -tag -width /etc/finit.d/available/*.conf -compact .It Pa /etc/finit.conf Main configuration file .It Pa /etc/finit.d/*.conf Static service definitions .It Pa /etc/finit.d/available/*.conf Available services .It Pa /etc/finit.d/enabled/*.conf Symlinks from available .It Pa /run/finit/ Runtime files, including the condition subsystem .El .Sh SEE ALSO .Xr finit.conf 5 .Xr initctl 8 .Xr tmpfiles.d 5 .Sh AUTHORS .Nm was conceived and reverse engineered by Claudio Matsuoka. Since v1.0, maintained by Joachim Wiberg, with contributions by many others. finit-4.14/man/finit.conf.50000644000175100001660000010077715054341541011151 .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .Dd July 10, 2025 .Dt FINIT.CONF 5 SMM .Os Linux .Sh NAME .Nm finit.conf .Nd Finit configuration file format .Sh SYNOPSIS .Nm /etc/finit.conf .Nm /etc/finit.d/*.conf .Nm /etc/finit.d/available/*.conf .Nm /etc/finit.d/enabled/*.conf .Sh DESCRIPTION .Nm Finit based systems can be set up with a single file: .Pa /etc/finit.conf . This is the traditional way of doing it which can be ideal for some setups since it gives a great overview of the system configuration. .Pp More comprehensive setups, however, require more careful planning. The recommendation is per-package .Cm *.conf files in .Pa /etc/finit.d/available/ . This allows end users to enable and disable parts of the system configuration at runtime. Finit tracks which tasks and services belong to a given file, so that when the user calls .Cm initctl reload to activate the changes they have made, only the affected tasks and services are stopped, started, or restarted. Hence, this approach is useful for modern package-based Linux distributions. .Pp The following sections describe the more of this in detail, starting with files, the file format, and available directives. Remember to also visit the other manual pages (references at the bottom). .Sh FILES .Bl -tag -width /etc/finit.d/available/*.conf -compact .It Pa /etc/finit.conf Main configuration file, optional .It Pa /etc/finit.d/*.conf Static (system) service definitions .It Pa /etc/finit.d/available/*.conf Available (installed) services .It Pa /etc/finit.d/enabled/*.conf Enabled services (symlink back) .El .Pp Static services, .Cm .conf files in .Pa /etc/finit.d/ , cannot be enabled or disabled using .Cm initctl [enable | disable] service[.conf] . An enabled service is a symlink back to the corresponding .Cm ../available/ service .Cm .conf file. Please use the .Cm initctl tool to manage these symlinks to ensure proper operation. .Pp .Sy NOTE: Previous versions of .Nm Finit created symlinks in .Pa /etc/finit.d/ if .Pa /etc/finit.d/enabled/ was missing, this is as of v4.4 not supported. .Sh FILE FORMAT The file format is line based, empty lines and comments, lines starting with `#', are ignored. A configuration directive starts with a keyword followed by a space and the rest of the line is treated as the value. .Pp As of Finit v4.4, configuration directives can be broken up in multiple lines using the continuation character `\\', and trailing comments are also allowed. Example: .Bd -unfilled -offset indent # Escape \\# chars if you want them literal in, e.g., descriptions service name:sysklogd [S123456789] \\ env:-/etc/default/sysklogd \\ syslogd -F $SYSLOGD_ARGS \\ -- System log daemon \\# 1 # Comments allowed now .Ed .Sh DIRECTIVES This section lists all supported configuration directives. There also exist deprecated directives, see the Markdown documentation for details on these. .Pp .Bl -tag -width 1n .It Cm rlimit Oo hard|soft Oc Ar RESOURCE Aq LIMIT | unlimited .Pp Set the hard or soft limit for a resource, or both if that argument is omitted. .Ar RESOURCE is the lower-case .Cm RLIMIT_ string constants from .Xr setrlimit 2 , without prefix. E.g. to set .Cm RLIMIT_CPU , use .Cm cpu . .Pp .Ar LIMIT is an integer that depends on the resource being modified, see the man page, or the kernel .Pa /proc/PID/limits file, for details. Finit versions before v3.1 used .Cm infinity for .Cm unlimited , which is still supported, albeit deprecated. .Bd -unfilled -offset indent # No process is allowed more than 8MB of address space rlimit hard as 8388608 # Core dumps may be arbitrarily large rlimit soft core infinity # CPU limit for all services, soft & hard = 10 sec rlimit cpu 10 .Ed .Pp .Cm rlimit can be set globally, in .Pa /etc/finit.conf , or locally per each .Pa /etc/finit.d/*.conf read. I.e., a set of task/run/service stanzas can share the same rlimits if they are in the same .conf. .It Cm runlevel Aq N The system runlevel to go to after bootstrap (S) has completed. .Cm N is the runlevel number 0-9, where 6 is reserved for reboot and 0 for halt. All other can be used by operating system administrators. Default: 2 .Pp It s recommended to keep runlevel 1 as single-user mode, because .Nm disables networking in this mode. .Pp .Sy Note: only read and executed in runlevel S (bootstrap). .It Cm run Oo LVLS Oc Ao COND Ac Ar /path/to/cmd ARGS Op -- Optional description One-shot command to run in sequence when entering a runlevel, with optional arguments and description. .Pp .Cm run commands are guaranteed to be completed before running the next command. Highly useful if true serialization is needed. Usually only used in the bootstrap (S) runlevel. .Pp .Cm Aq COND conditions are described in .Xr finit 8 , see also the .Sx Examples section below. .It Cm task Oo LVLS Oc Ao COND Ac Ar /path/to/cmd ARGS Op -- Optional description One-shot like .Cm run , but starts in parallel with the next command. .Pp Both .Cm run and .Cm task commands are run in a shell, so pipes and redirects can be freely used: .Bd -unfilled -offset indent task [s] echo "foo" | cat >/tmp/bar .Ed .It Cm sysv Oo LVLS Oc Ao COND Ac Ar /path/to/script ARGS Op -- Optional description Similar to .Cm service is the .Cm sysv directive, which can be used to call SysV style start/stop scripts. The primary intention for this command is to be able to re-use traditional SysV init scripts in Linux distributions. .Pp When entering an allowed runlevel, Finit calls .Cm init-script start , when entering a disallowed runlevel, Finit calls .Cm init-script stop , and if the Finit .conf, where the .Cm sysv stanza is declared, is modified, Finit calls .Cm init-script restart on .Cm initctl reload . Similar to how .Cm service directives work. .Pp Forking services started with .Cm sysv scripts can be monitored by Finit by declaring the PID file to look for: .Bd -unfilled -offset indent sysv pid:!/path/to/pidfile.pid /path/to/script ... .Ed .Pp The leading '!' is to prevent Finit from managing the PID file, which is the default behavior for the .Cm pid: command modifier. .It Cm service Oo LVLS Oc Ao COND Ac Ar /path/to/daemon ARGS Op -- Optional description Service, or daemon, to be monitored and automatically restarted if it exits prematurely. Finit tries to restart services that die, by default 10 times, before giving up and marking them as .Em crashed . After which they have to be restarted manually using .Cm initctl restart NAME . The number of restarts, the delay between each restart, and more is configurable, see the options below. .Pp .Bd -filled -offset indent .Sy Tip: to allow endless restarts, see below option .Cm respawn .Ed .Pp For daemons that support it, we recommend appending .Cm --foreground , --no-background , -n , -F , or similar command line argument to prevent them from forking off a sub-process in the background. This is the most reliable way to monitor a service. .Pp However, not all daemons support running in the foreground, or they may start logging to the foreground as well, these are called forking services and are supported using the same syntax as forking .Cm sysv services, using the .Cm pid:!/path/to/pidfile.pid command modifier syntax. There is an alternative syntax that may be more intuitive, where Finit can also guess the PID file based on the daemon's command name: .Bd -unfilled -offset indent service type:forking ntpd -- NTP daemon .Ed .Pp Here we let BusyBox .Nm ntpd daemonize itself. Finit uses the basename of the binary to guess the PID file to watch for the PID: .Pa /var/run/ntpd.pid . If Finit guesses wrong, you have to submit the full .Cm pid:!/path/to/file.pid option to your service stanza. .Pp .Sy Example: in the case of .Cm ospfd (below), we omit the .Cm -d flag (daemonize) to prevent it from forking to the background: .Bd -unfilled -offset indent service [2345] /sbin/ospfd -- OSPF daemon .Ed .Pp .Cm [2345] denote the runlevels .Cm ospfd is allowed to run in, they are optional and default to runlevel 2-5 if omitted. .Pp .Cm is the condition for starting .Cm ospfd . In this example Finit waits for another service, .Cm zebra , to have created its PID file in .Pa /var/run/quagga/zebra.pid before starting .Cm ospfd . Finit watches *all* files in .Pa /var/run , for each file named .Cm *.pid , .Cm */pid , Finit opens it and find the matching .Cm NAME:ID using the PID. .Pp Some services do not maintain a PID file and rather than patching each application Finit provides a workaround. A .Cm pid modifier keyword can be set to have Finit automatically create (when starting) and later remove (when stopping) the PID file. The file is created in the .Pa /var/run directory using the .Xr basename 3 of the service. The full syntax of the .Cm pid modifier is: .Bd -unfilled -offset indent pid[:[!][/path/to/]filename[.pid]] .Ed .Pp For example, by adding .Cm pid:/run/foo.pid to the service .Cm /sbin/bar , that PID file will, not only be created and removed automatically, but also be used by the Finit condition subsystem. So a service/run/task can depend on the .Cm condition. .Pp As an alternative "readiness" notification, Finit supports both systemd and s6 style notification. This can be enabled by using the `notify` option: .Bl -tag -width 1n .It Cm notify:systemd tells Finit the service uses the .Cm sd_notify() API to signal PID 1 when it has completed its startup and is ready to service events. This API expects the environment variable .Cm NOTIFY_SOCKET to be set to the socket where the application can send .Cm "READY=1\n" when it is starting up or has processed a .Cm SIGHUP . For details, see: .Pp .Lk https://www.freedesktop.org/software/systemd/man/sd_notify.html .It Cm notify:s6 puts Finit in s6 compatibility mode. Compared to the systemd notification, s6 expect compliant daemons to send .Cm "\\n" and then close their socket. For details, see: .Pp .Lk https://skarnet.org/software/s6/notifywhenup.html .Pp Finit takes care of "hard-wiring" the READY state as long as the application is running, events across any `SIGHUP`. Since s6 can give its applications the descriptor number (must be >3) on then command line, Finit provides the following syntax ( .Cm %n is replaced by Finit with then descriptor number): .Bd -unfilled -offset indent service notify:s6 mdevd -C -O 4 -D %n .Ed .Pp When a service is ready, either by Finit detecting its PID file, or their respective readiness mechanism has been triggered, Finit creates then service's ready condition which other services can depend on: .Bd -unfilled -offset indent $ initctl -v cond get service/mdevd/ready on .Ed .El .Pp If a service should not be automatically started, it can be configured as manual with the .Cm manual:yes command modifier. The service can then be started at any time by running .Cm initctl start NAME .Pp The name of a service, shown by the .Cm initctl tool, defaults to the basename of the service executable. It can be changed with the .Cm name:foo command modifier. .Pp As mentioned previously, services are automatically restarted should they crash, this is configurable with the following options: .Bl -tag -width 1n .It Cm restart:NUM number of times Finit tries to restart a crashing service, default: 10. When this limit is reached the service is marked .Em crashed and must be restarted manually with .Xr initctl 8 . .It Cm restart_sec:SEC number of seconds before Finit tries to restart a crashing service, default: 2 seconds for the first five retries, then back-off to 5 seconds. The maximum of this configured value and the above (2 and 5) will be used .It Cm restart:always no upper limit on the number of times Finit tries to restart a crashing service. Same as .Cm restart:-1 .It Cm norestart dont restart on failures, same as .Cm restart:0 .It Cm respawn bypasses the .Cm restart mechanism completely, allows endless restarts. Useful in many use-cases, but not what .Cm service was originally designed for so not the default behavior. .It Cm oncrash:reboot when all retries have failed, and the service has .Em crashed , if this option is set the system is rebooted. .It Cm oncrash:script Similar to .Cm oncrash:reboot , but instead of rebooting this action calls the .Cm post:script (see below) to let the operator decide the best course of action. If the post:script option is not set, this is a no-op. .Pp The post:script is called with the same environment variables .Sy except for the .Cm EXIT_CODE variable which is set to .Cm "crashed" .It Cm reload:'script [args]' some services do not support SIGHUP but may have other ways to update the configuration of a running daemon. When .Cm reload:script is defined it is preferred over SIGHUP. Like systemd, .Nm finit sets .Cm $MAINPID as a convenience to scripts, which in effect also allow .Cm reload:'kill -HUP $MAINPID' .It Cm stop:'script [args]' Some services may require alternate methods to be stopped. When .Cm stop:script is defined it is preferred over SIGTERM and stop, for .Cm service and .Cm sysv directives, respectively. Similar to .Cm reload:script , .Nm finit sets .Cm $MAINPID . .El .Pp When stopping a service (run/task/sysv/service), either manually or when moving to another runlevel, Finit starts by sending SIGTERM, to allow the process to shut down gracefully. If the process has not been collected within 3 seconds, Finit sends SIGKILL. To halt the process using a different signal, use the command modifier .Cm halt:SIGNAL , e.g., .Cm halt:SIGPWR . To change the delay between your halt signal and KILL, use the command modifier .Cm kill:SEC , e.g., .Cm kill:10 to wait 10 seconds before sending SIGKILL. .Pp Services, including the .Cm sysv variant, support pre/post/ready and cleanup scripts: .Bl -tag -width 1n .It Cm pre:[0-3600,]script called before the sysv/service is stated .It Cm post:[0-3600,]script called after the sysv/service has stopped .It Cm ready:[0-3600,]script called when the sysv/service is ready .It Cm cleanup:[0-3600,]script called when run/task/sysv/service is removed .El .Pp The optional number (0-3600) is the timeout before Finit kills the script, it defaults to the kill delay value and can be disabled by setting it to zero. These scripts run as the same .Cm @USER:GROUP as the service itself, with any .Cm env:file sourced. The scripts must use an absolute path, but are executed from the .Cm $HOME of the given user. The scripts are not called with any argument, but both get a set of environment variables: .Pp .Bl -tag -width 1n -compact .It Cm SERVICE_IDENT=foo:1 .It Cm SERVICE_NAME=foo .It Cm SERVICE_ID=1 .El .Pp The .Cm post:script is called with an additional set of environment variables, and yes the naming looks like it should be swapped: .Bl -tag -offset indent -width 1n .It Cm EXIT_CODE=[exited,signal,crashed] set to one of .Cm exited , .Cm signal , or .Cm crashed (see above). .It Cm EXIT_STATUS=[num,SIGNAME] set to one of exit status code from the program, if it exited normally, or the signal name (HUP, TERM, etc.) if it exited due to signal .El .Pp When a run/task/sys/service is removed (disable + reload) it is first stopped and then removed from the runlevel. The .Cm post:script always runs when the process has stopped, and the .Cm cleanup:script runs when the the stanza has been removed from the runlevel. .It Cm runparts Aq DIR Call .Xr run-parts 8 on .Cm DIR to run start scripts. All executable files, or scripts, in the directory are called, in alphabetic order. The scripts in this directory are executed at the very end of bootstrap, runlevel S. .Pp It can be beneficial to use .Cm S01name , .Cm S02othername , etc. if there is a dependency order between the scripts. Symlinks to existing daemons can talso be used, but make sure they daemonize by default. .Pp Similar to the .Pa /etc/rc.local shell script, make sure that all your services and programs either terminate or start in the background or you will block Finit. .Sy Note: only read and executed in runlevel S (bootstrap). .It Cm include Aq CONF Include another configuration file. Absolute path required. .It Cm log size:BYTES count:NUM Log rotation for run/task/services using the .Cm log command modifier with redirection to a log file. Global setting, applies to all services. .Pp The size can be given as bytes, without a specifier, or in `k`, `M`, or `G`, e.g. .Cm size:10M , or .Cm size:3G . A value of .Cm size:0 disables log rotation. The default is .Cm size:200k . .Pp The count value is recommended to be between 1-5, with a default 5. Setting count to 0 means the logfile will be truncated when the MAX size limit is reached. .It Cm tty Oo LVLS Oc Ao COND Ac Ar DEV Oo BAUD Oc Oo noclear Oc Oo nowait Oc Oo nologin Oc Oo TERM Oc This form of the .Cm tty directive uses the built-in getty on the given TTY device .Ar DEV , in the given runlevels. .Ar DEV may be the special keyword .Cm @console , or `console`, which is expanded from `/sys/class/tty/console/active`, useful on embedded systems. .Pp The default baud rate is 0, i.e., keep kernel default. .Pp The `tty` directive inherits runlevel, condition (and other feature) parsing from the `service` directive. So TTYs can run in one or many runlevels and depend on any condition supported by Finit. This is useful e.g. to depend on `` before starting a TTY. .Bd -unfilled -offset indent tty [12345] /dev/ttyAMA0 115200 noclear vt220 .Ed .It Cm tty Oo LVLS Oc Ao COND Ac Ar CMD DEV Oo noclear Oc Oo nowait Oc This form of the .Cm tty directive is for using an external getty, like agetty or the BusyBox getty. .Pp By default, these first two syntax variants .Em clear the TTY and .Em wait for the user to press enter before starting getty. .Bd -unfilled -offset indent tty [12345] /sbin/getty -L 115200 /dev/ttyAMA0 vt100 tty [12345] /sbin/agetty -L ttyAMA0 115200 vt100 nowait .Ed .Pp The .Cm noclear option disables clearing the TTY after each session. Clearing the TTY when a user logs out is usually preferable. .Pp The .Cm nowait option disables the .Cm Please press Enter to activate console message before actually starting the getty program. On small and embedded systems running multiple unused getty wastes both memory and CPU cycles, so `wait` is the preferred default. .Pp The .Cm nologin option disables getty and .Pa /bin/login , and gives the user a root (login) shell on the given TTY .Cm DEV immediately. Needless to say, this is a rather insecure option, but can be very useful for developer builds, during board bringup, or similar. .Pp Notice the ordering, the .Cm TERM option to the built-in getty must be the last argument. .Pp Embedded systems may want to enable automatic `DEV` by supplying the special .Cm @console device. This works regardless weather the system uses .Cm ttyS0 , ttyAMA0 , ttyMXC0 , or anything else. Finit figures it out by querying sysfs: .Pa /sys/class/tty/console/active . The speed can be omitted to keep the kernel default. .Pp Most systems get by fine by just using `console`, which will evaluate to .Pa /dev/console . If you have to use .Cm @console to get any output, you may have some issue with your kernel config. .Bd -unfilled -offset indent tty [12345] @console noclear vt220 .Ed .Pp On really bare bones systems, or for board bringup, Finit can give you a shell prompt as soon as bootstrap is done, without opening any device node: .Bd -unfilled -offset indent tty [12345789] notty .Ed .Pp This should of course not be enabled on production systems. Because it may give a user root access without having to log in. However, for board bringup and system debugging it can come in handy. .Pp One can also use the .Cm service directive to start a stand-alone shell: .Bd -unfilled -offset indent service [12345] /bin/sh -l .Ed .Pp .It Cm tty Oo LVLS Oc Ao COND Ac Oo notty Oc Oo rescue Oc The third .Cm tty form is for board bringup and the .Cm rescue boot mode. No device node is required in this variant, the same output that the kernel uses is reused for stdio. If the .Cm rescue option is omitted, a shell is started. The flags .Cm nologin , noclear , and .Cm nowait are implied. If the .Cm rescue option is set the bundled .Pa /libexec/finit/sulogin is started to present a bare-bones root login prompt. If the root (uid:0, gid:0) user does not have a password set, no rescue is possible. .El .Sh COMMAND MODIFIERS The run/task/tty/service/sysv directives take modifiers, or options, to control their behavior. This section lists them with their limitations. All modifiers must be placed between the directive and its command. .Bl -tag -width 1n .It Cm @user:group Every .Cm run , task , or .Cm service can also list the privileges the .Cm /path/to/cmd should be executed with. Prefix the command with .Cm @USR[:GRP] , group is optional, like this: .Bd -unfilled -offset indent run [2345] @joe:users logger "Hello world" .Ed .Pp For multiple instances of the same command, e.g. a DHCP client or multiple web servers, add .Cm :ID somewhere between the .Cm run , task , service keyword and the command, like this: .Bd -unfilled -offset indent service :80 [2345] httpd -f -h /http -p 80 -- Web server service :8080[2345] httpd -f -h /http -p 8080 -- Old web server .Ed .Pp Without the .Cm :ID to the service the latter will overwrite the former and only the old web server would be started and supervised. .It Cm log:/path/to/file Redirect stdout/stderr of a command to the given log file. See the global log directive, above, for details on log rotation. .It Cm log:console Redirect stdout/stderr of a command to .Pa /dev/console , only use this for debugging or bringup. .It Cm log:null Redirect stdout/stderr of a command to .Pa /dev/null . .It Cm log:prio:facility.level,tag:ident Redirect stdout/stderr of a command to syslog using the given priority and tag identity. .Bd -unfilled -offset indent service log:prio:user.warn,tag:ntpd /sbin/ntpd pool.ntp.org -- NTP daemon .Ed .It Cm log Default .Cm prio is .Cm daemon.info and the default .Cm tag identity is the basename of the service or run/task command. .El .Sh RESCUE MODE Finit supports a rescue mode which is activated by the .Cm rescue option on the kernel command line. The rescue mode comes in two flavors: .Em traditional and .Em fallback . .Ss Traditional This is what most users expect. A very early maintenance login prompt, served by the bundled .Pa /libexec/finit/sulogin program, or the standard .Cm sulogin from util-linux or BusyBox is searched for in the UNIX default .Cm $PATH . If a successful login is made, or the user exits (Ctrl-D), the rescue mode is ended and the system boots up normally. .Pp .Sy Note: if the user (UID 0 and GID 0) does not have a password, or .Em the account is locked , the user is presented with a password-less prompt: .Cm "Press enter to enter maintenance mode." , which opens up a root shell. .Ss Fallback If no .Cm sulogin program is found, Finit tries to bring up as much of its own functionality as possible, yet limiting many aspects, meaning; no network, no`fsck` of file systems in .Pa /etc/fstab , no .Pa /etc/rc.local , no .Cm runparts , and most plugins are skipped (except those that provide functionality for the condition subsystem). .Pp Instead of reading .Pa /etc/finit.conf et al, system configuration is read from .Pa /lib/finit/rescue.conf , which can be freely modified by the system administrator. .Pp The bundled default `rescue.conf` contains nothing more than: .Bd -unfilled -offset indent runlevel 1 tty [12345] rescue .Ed .Pp The .Cm tty has the .Cm rescue option set, which works similar to the board bring-up tty option .Cm notty . The major difference being that `sulogin` is started to query for root/admin password. If .Cm sulogin is not found, .Cm rescue behaves like .Cm notty and gives a plain root shell prompt. .Pp If Finit cannot find .Pa /lib/finit/rescue.conf it defaults to: .Bd -unfilled -offset indent tty [12345] rescue .Ed .Pp There is no way to exit the .Em fallback rescue mode. .Sh SERVICE ENVIRONMENT Finit supports sourcing environment variables from .Pa /etc/default/* , or similar. This is a common pattern from SysV init scripts, where the start/stop script is a generic script for the given service, .Cm foo , and the options for the service are sourced from the file .Pa /etc/default/foo . Like this: .Bd -unfilled -offset indent /etc/default/foo: FOO_OPTIONS=--extra-arg="bar" -s -x /etc/finit.conf: service [2345] env:-/etc/default/foo foo -n $FOO_OPTIONS -- Example foo daemon .Ed .Pp Here the service .Cm foo is started with .Op Fl -n , to make sure it runs in the foreground, and the with the options found in the environment file. With the .Cm ps command we can see that the process is started with: .Bd -unfilled -offset indent foo -n --extra-arg=bar -s -x .Ed .Pp .Sy Note: the leading `-` determines if Finit should treat a missing environment file as blocking the start of the service or not. When `-` is used, a missing environment file does .Em not block the start. .Sh SERVICE WRAPPER SCRIPTS If your service requires to run additional commands, executed before the service is actually started, like the systemd `ExecStartPre`, you can use a wrapper shell script to start your service. .Pp The Finit service .Cm .conf file can be put into .Pa /etc/finit.d/available , so you can control the service using .Cm initctl . Then use the path to the wrapper script in the Finit .Cm .conf service stanza. The following example employs a wrapper script in .Pa /etc/start.d . .Bd -unfilled /etc/finit.d/available/program.conf: service [235] /etc/start.d/program -- Example Program /etc/start.d/program: #!/bin/sh # Prepare the command line options OPTIONS="-u $(cat /etc/username)" # Execute the program exec /usr/bin/program $OPTIONS .Ed .Pp .Sy Note: the example sets .Cm to denote that it doesn't support SIGHUP. That way Finit will stop/start the service instead of sending SIGHUP at restart/reload events. .Sh TEMPLATING Finit comes with rudimentary support for templating, similar to that of systemd. Best illustrated with an example: .Bd -unfilled -offset indent $ initctl show avahi-autoipd@ service :%i avahi-autoipd --syslog %i -- ZeroConf for %i .Ed .Pp To enable ZeroConf for, e.g., .Cm eth0 , use .Bd -unfilled -offset indent $ initctl enable avahi-autoipd@eth0.conf .Ed .Pp The enabled symlink will be set up to .Cm avahi-autoipd@.conf and every instance of .Cm %i will in the instantiated directive be replaced with .Cm eth0 . Inspect the result with: .Bd -unfilled -offset indent $ initctl status avahi-autoipd:eth0 .Ed .Sh CGROUPS There are three major cgroup configuration directives: .Pp .Bl -enum -offset indent -compact .It Global top-level group: init, system, user, or a custom group .It Selecting a top-level group for a set of run/task/services .It Per run/task/service limits .El .Pp Top-level group configuration. .Bd -unfilled -offset indent # Top-level cgroups and their default settings. All groups mandatory # but more can be added, max 8 groups in total currently. The cgroup # 'root' is also available, reserved for RT processes. Settings are # as-is, only one shorthand 'mem.' exists, other than that it's the # cgroup v2 controller default names. cgroup init cpu.weight:100 cgroup user cpu.weight:100 cgroup system cpu.weight:9800 .Ed .Pp Adding an extra cgroup .Cm maint/ will require you to adjust the weight of the above three. We leave .Cm init/ and .Cm user/ as-is reducing weight of .Cm system/ to 9700. .Bd -unfilled -offset indent cgroup system cpu.weight:9700 # Example extra cgroup 'maint' cgroup maint cpu.weight:100 .Ed .Pp By default, the .Cm system/ cgroup is selected for almost everything. The .Cm init/ cgroup is reserved for PID 1 itself and its closest relatives. The .Cm user/ cgroup is for local TTY logins spawned by getty. .Pp To select a different top-level cgroup, e.g. .Cm maint/ , one can either define it for a group of run/task/service directives in a .Cm .conf or per each stanza: .Bd -unfilled -offset indent cgroup.maint service [...] <...> /path/to/foo args -- description service [...] <...> /path/to/bar args -- description .Ed .Pp or .Bd -unfilled -offset indent service [...] <...> cgroup.maint /path/to/foo args -- description .Ed .Pp The latter form also allows per-stanza limits on the form (notice the single quotes for arguments that contain spaces): .Bd -unfilled -offset indent service [...] <...> cgroup.maint:cpu.max:'200000 100000',mem.max:655360 /path/to/foo args -- description .Ed .Pp Notice the comma separation and the .Cm mem. exception to the rule: every cgroup setting maps directly to cgroup v2 syntax. I.e., .Cm cpu.max maps to the file .Pm /sys/fs/cgroup/maint/foo/cpu.max . There is no filtering, except for expanding the shorthand .Cm mem. to .Cm memory. , if the file is not available, either the cgroup controller is not available in your Linux kernel, or the name is misspelled. .Pp Linux cgroups and details surrounding values are not explained in the Finit documentation. The Linux admin-guide cover this well: .Lk https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html .Sh CONDITIONAL LOADING Finit support conditional loading of stanzas. The following example is take from the .Pa system/hotplug.conf file in the Finit distribution. Here we only show a simplified subset. .Pp Starting with the .Cm nowarn option. .Bd -unfilled -offset indent service nowarn name:udevd pid:udevd /lib/systemd/systemd-udevd service nowarn name:udevd pid:udevd udevd .Ed .Pp When loading the .conf file Finit looks for .Pa /lib/systemd/systemd-udevd if that is not found Finit automatically logs a warning. The .Cm nowarn option disables this warning so that the second line can be evaluated, which also provides a service named .Cm udevd . .Bd -unfilled -offset indent run nowarn if:udevd :1 udevadm settle -t 0 .Ed .Pp This line is only loaded if we know of a service named .Cm udevd . Again, we do not warn if .Cm udevadm is not found, execution will also stop here until the PID condition is asserted, i.e., Finit detecting udevd has started. .Bd -unfilled -offset indent run nowarn conflict:udevd [S] mdev -s -- Populating device tree .Ed .Pp If .Cm udevd is not available, we try to run .Cm mdev , but if that is not found, again we do not warn. .Pp Conditional loading statements can also be negated, so the previous stanza can also be written as: .Bd -unfilled -offset indent run nowarn if:!udevd [S] mdev -s -- Populating device tree .Ed .Pp The reason for using .Cm conflict in this example is that a conflict can be resolved. Stanzas marked with .C, conflict:foo are rechecked at runtime. .Sh CONDITIONAL EXECUTION Similar to conditional loading of stanzas there is conditional runtime execution. This can be confusing at first, since Finit already has a condition subsystem, but this is more akin to the qualification to a runlevel. E.g., a .Cm task [123] is qualified to run only in runlevel 1, 2, and 3. It is not considered for other runlevels. .Pp Conditional execution qualify a run/task/service based on a condition. Consider this (simplified) example from the Infix operating system: .Bd -unfilled -offset indent run [S] name:startup confd -b --load startup-config run [S] if: name:failure confd --load failure-config .Ed .Pp The two run statements reside in the same .conf file so Finit runs them in true sequence. If loading the file .Cm startup-config fails .Cm confd sets the condition .Cm usr/fail-startup , thus allowing the next run statement to load .Cm failure-config . .Pp Notice the critical difference between the .Cm condition and .Cm if: . The former is a condition for starting and the latter is a condition to check if a run/task/service is qualified to even be considered. .Pp Conditional execution statements can also be negated, so provided the file loaded did the opposite, i.e., set a condition on success, the previous stanza can also be written as: .Bd -unfilled -offset indent run [S] if: name:failure confd ... .Ed .Sh LIMITATIONS As of Finit v4 there are no limitations to where .Cm .conf settings can be placed. Except for the system/global .Cm rlimit and .Cm cgroup top-level group declarations, which can only be set from .Pa /etc/finit.conf , since it is the first .Cm .conf file Finit reads. .Pp Originally, .Pp /etc/finit.conf was the only way to set up a Finit system. Today it is mainly used for bootstrap settings like system hostname, early module loading for watchdogd, network bringup and system shutdown. These can now also be set in any .Cm .conf file in .Pa /etc/finit.d . .Pp There is, however, nothing preventing you from having all configuration settings in .Pa /etc/finit.conf . .Sh SEE ALSO .Xr finit 8 , .Xr initctl 8 .Sh AUTHORS .Nm Finit was conceived and reverse engineered by Claudio Matsuoka. Since v1.0, maintained by Joachim Wiberg, with contributions by many others. finit-4.14/man/initctl.80000644000175100001660000001546515054341541010564 .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .Dd July 10, 2025 .\" Please adjust this date whenever revising the manpage. .Dt INITCTL 8 SMM .Os Linux .Sh NAME .Nm initctl .Nd Control tool for Finit .Sh SYNOPSIS .Nm /sbin/initctl .Op Fl bcfhjlpqtvV .Op COMMAND .Sh DESCRIPTION .Nm is the official tool for interacting with .Xr finit 8 . It comes with functions for showing status, querying health of services, as well as editing, enabling and disabling services. .Sh OPTIONS This program follows the usual UNIX command line syntax, with long options starting with two dashes (`-'). The options are as follows: .Bl -tag -width Ds .It Fl b, -batch Batch mode, no screen size probing. Useful for scripting .It Fl c, -create Create missing paths (and files) as needed. Useful with the .Cm edit command .It Fl f, -force Ignore missing files and arguments, never prompt .It Fl h, -help Show built-in help text .It Fl j, -json JSON output in .Ar status and .Ar cond commands .It Fl n, -noerr When scripting .Nm to stop, start, restart, or signal a task or service, this option can be used to ignore error 69 (no such task or service) and instead return 0 (OK) .It Fl 1, -once Only one lap in commands like top .It Fl p, -plain Use plain table headings, no ANSI control characters .It Fl q, -quiet Silent, only return status of command .It Fl t, -no-heading Skip table headings .It Fl v, -verbose Verbose output, where applicable .It Fl V, -version Show program version .El .Sh COMMANDS .Bl -tag -width Ds .It Nm Ar debug Toggle .Nm finit (daemon) debug to .Pa /dev/console .It Nm Ar help Show built-in help text .It Nm Ar version Show program version .It Nm Ar ls | list List all .Cm *.conf files in .Pa /etc/finit.d .It Nm Ar create Ar CONF Create .Cm .conf in .Pa /etc/finit.d/available . .Pp Piping the contents into .Nm works as one would expect: .Bd -literal -offset indent echo "task name:foo /tmp/foo.sh -- Foo logger" | initctl create foo initctl enable foo initctl reload .Ed .It Nm Ar delete Ar CONF Delete .Cm .conf in .Pa /etc/finit.d/available .It Nm Ar show Ar CONF Show .Cm .conf in .Pa /etc/finit.d/available .It Nm Ar edit Ar CONF Edit .Cm .conf in .Pa /etc/finit.d/available .It Nm Ar touch Ar CONF Change (mark as modified) .Cm .conf in .Pa /etc/finit.d/available , like .Ar edit this tells .Nm finit that a configuration has been changed and is a candidate to be reloaded (SIGHUP'ed or restarted) on .Cm initctl reload in dependency order .It Nm Ar enable Ar CONF Enable .Cm .conf in .Pa /etc/finit.d/available , i.e., add symlink in .Pa /etc/finit.d/enabled .It Nm Ar disable Ar CONF Disable .Cm .conf in .Pa /etc/finit.d/enabled , i.e., removes symlink .It Nm Ar reload Reload all (touched) .Cm *.conf in .Pa /etc/finit.d and activate changes .It Nm Ar cond set Ar COND Op COND ... Set (assert) user-defined condition, .Cm +usr/COND .It Nm Ar cond get Ar COND Get (quietly) the status of any condition. Defaults to user-defined condions, but if a slash is detected, e.g., .Cm pid/foo or .Cm net/eth0/exist , then any condition can be read. .Pp The command is geared for scripting, check the exit code to get the status of the condition: 0 - on, 1 - off, 255 - flux. For a more verbose output, use the .Fl v option .It Nm Ar cond clr | clear Ar COND Op COND ... Clear (deassert) user-defined condition, .Cm -usr/COND .It Nm Ar cond status Show condition status, default .Cm cond command. Also supports the .Fl j option for detailed JSON output .It Nm Ar cond dump Op Cm TYPE Dump all, or a given type of, conditions and their status. Also supports the .Fl j option for detailed JSON output .It Nm Ar ident Op Cm NAME Display indentities of all run/task/services, or only instances matching .Cm NAME . A partial string, e.g., .Cm NAM , will not match anything .It Nm Ar log Op Cm NAME Show ten last Finit, or .Cm NAME , messages from syslog .It Nm Ar start Cm NAME[:ID] Start service by name, with optional ID, e.g., .Cm initctl start tty:1 .It Nm Ar stop Cm NAME[:ID] Stop/Pause a running service by name .It Nm Ar reload Cm NAME[:ID] Reload service as if its configuration had changed. Internally, .Nm finit marks the named service as "dirty" and turns the state machine, resulting in a SIGHUP or restart of (at least) the named service. Any dependant services are also restarted. .Pp .Sy Note: no .conf file is reloaded with this variant of the command. Essentially it is the same as calling .Cm restart . Except for two things: .Bl -enum -offset indent -compact .It if the service supports HUP (or has a .Cm reload:script ) it is signaled instead of stop-started, and .It it allows restarting run/task in the same runlevel -- which is otherwise restricted .El .It Nm Ar Cm NAME:[ID] S Send signal S to service, by name. .Cm S may be a complete signal name such as SIGHUP, or short name such as HUP, or the signal number such as 1 (SIGHUP) .It Nm Ar restart Cm NAME[:ID] Restart (stop/start) service by name .It Nm Ar status Cm NAME[:ID] Show service status, by name. If only .Cm NAME is given and multiple instances exits, a summary of all matching instances are shown. Only an exact match displays detailed status for a given instance. .Pp With the .Fl q option this command is silent, provided the .Ar NAME[:ID] selection matches a single run/task/service. The exit code of .Nm is non-zero if there is a problem. Zero is returned if a run/task has run (at least) once in the current runlevel, and when a service is running (as expected). See the .Fl j option for detailed JSON output suitable for machine parsing. .Pp .Sy Tip: .Xr jq 1 is a useful scripting tool in combination with JSON output .It Nm Ar status Show status of all services, default command. Also supports the .Fl j option for detailed JSON output .It Nm Ar cgroup List cgroup config overview .It Nm Ar ps List processes based on cgroups .It Nm Ar top Show top-like listing based on cgroups .It Nm Ar plugins List installed plugins .It Nm Ar runlevel Op Ar 0-9 Show or set runlevel: 0 halt, 6 reboot. .Pp If called at boot (runlevel S) to set the runlevel, Finit only schedules the change, effectively overriding the configured runlevel from .Pa /etc/finit.conf . Useful to trigger a fail-safe mode, or similar .It Nm Ar reboot Reboot system, default if .Cm reboot is symlinked to .Nm .It Nm Ar halt Halt system, default if .Cm halt is symlinked to .Nm .It Nm Ar poweroff Power-off system, default if .Cm poweroff is symlinked to .Nm .It Nm Ar suspend Suspend system, default if .Cm suspend is symlinked to .Nm .It Nm Ar utmp show Raw dump of UTMP/WTMP db .El .Sh SEE ALSO .Xr finit.conf 5 .Xr finit 8 .Sh AUTHORS .Nm finit was conceived and reverse engineered by Claudio Matsuoka. Since v1.0, maintained by Joachim Wiberg, with contributions by many others. finit-4.14/man/Makefile.in0000644000175100001660000004204615054341567011075 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man5dir = $(mandir)/man5 am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man5_MANS) $(dist_man8_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(dist_man5_MANS) $(dist_man8_MANS) \ $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ dist_man8_MANS = finit.8 initctl.8 dist_man5_MANS = finit.conf.5 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign man/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man5: $(dist_man5_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man5_MANS)'; \ list2=''; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(dist_man5_MANS)'; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man8: $(dist_man8_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man8_MANS)'; \ list2=''; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(dist_man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man5 install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man5 uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir 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-man5 install-man8 install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-man uninstall-man5 uninstall-man8 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/man/Makefile.am0000644000175100001660000000010115054341541011036 dist_man8_MANS = finit.8 initctl.8 dist_man5_MANS = finit.conf.5 finit-4.14/test/0000755000175100001660000000000015054341601007273 5finit-4.14/test/start-stop-service-sub-config.sh0000755000175100001660000000120215054341541015360 #!/bin/sh set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_RCSD/service.conf" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say "Add service stanza in $FINIT_RCSD/service.conf" run "echo 'service [2345] kill:20 log service.sh -- Subserv' > $FINIT_RCSD/service.conf" say 'Reload Finit' run "initctl reload" sleep 2 run "ps" retry 'assert_num_children 1 service.sh' say 'Stop the service' run "initctl stop service.sh" retry 'assert_num_children 0 service.sh' say 'Start the service again' run "initctl start service.sh" retry 'assert_num_children 1 service.sh' finit-4.14/test/depserv.sh0000755000175100001660000000360315054341541011227 #!/bin/sh # Verify handling of dependent services, bug #314 # Two services: foo and bar, where bar depends on foo: # # - bar must not start until foo is ready # - bar must be stopped when foo goes down # - bar must be restarted when foo is restarted # # Regression test bug #314, that bar is not in a restart loop when foo # is stopped. Also, verify that changing between runlevels, where foo # is not allowed to run, but bar is, that bar is stopped also for that. set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" "/tmp/post" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" #run "initctl debug" #run "ls -l /run/finit/cond/pid/ /lib/finit/plugins/" test_one() { cond=$1 say "Verifying foo -> <$cond> bar ..." run "echo service log:stderr name:foo serv -np -i foo -f /tmp/arrakis > $FINIT_CONF" run "echo service log:stderr name:bar \ serv -np -i bar -F /tmp/arrakis >> $FINIT_CONF" run "cat $FINIT_CONF" say 'Reload Finit' run "initctl reload" run "initctl status" assert_status "foo" "running" assert_cond "$cond" assert_status "bar" "running" say "Verify bar is restarted when foo is ..." pid=$(texec initctl |grep bar | awk '{print $1;}') run "initctl restart foo" run "initctl status" assert "bar is restarted" "$(texec initctl |grep bar | awk '{print $1;}')" != "$pid" # Wait for spice to be stolen by the Harkonnen sleep 3 # bar should now have detected the loss of spice and be in restart run "initctl status" assert_status "bar" "restart" # verify bar is stopped->waiting and no longer in restart after stopping foo run "initctl stop foo" run "initctl status" run "initctl status bar" assert_status "bar" "waiting" } sep test_one "pid/foo" sep run "initctl debug" test_one "service/foo/running" finit-4.14/test/README.md0000644000175100001660000000242715054341541010502 Finit Test Suite ================ Finit comes with a set of tests and a small framework for running them. Contributors are encouraged to write new tests when implementing features, or fixing bugs. Each test is run in isolation, in it's own namespace. Finit will therefore be able to be launched as PID 1. Since it's also running with it's own root directory it will be able to function properly without having any super user privileges in the host environment. Running tests ------------- To run the test suite, first [build](../doc/build.md) Finit, e.g: ./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc --localstatedir=/var --enable-testserv-plugin make -j9 clean all Then run (parallel does not work atm): make check `make check` will set up the required assets for the test environment, and then run the full set of tests. The environment is not removed afterwards so at this point individual tests can be executed without having to run the entire test suite, which is handy when developing new tests or debugging existing test. To execute an individual test, simply invoke the script containing it: ./test/name-of-the-test.sh Another way to run a single (or more) test(s) is to define the `TESTS` environment variable: TESTS="start-kill-service" make check finit-4.14/test/pidfile.sh0000755000175100001660000000203015054341541011164 #!/bin/sh # Verify parsing of pid: argument set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" "/tmp/post" } test_one() { pidfn=$1 service=$2 sep say "Add service stanza '$service' to $FINIT_CONF ..." run "echo '$service' > $FINIT_CONF" run "initctl reload" assert_is_pidfile "serv" "$pidfn" say "Done, drop service from $FINIT_CONF ..." run "rm $FINIT_CONF" run "initctl reload" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" #run "initctl debug" #run "ls -l /run/finit/cond/pid/ /lib/finit/plugins/" test_one "/run/serv.pid" "service serv -np" test_one "/run/serv.pid" "service pid:!/run/serv.pid serv" test_one "/run/serv.pid" "service type:forking serv" test_one "/run/serv.pid" "service pid:!//run/serv.pid serv -np" test_one "/run/serv.pid" "service pid://run/serv.pid serv -n" test_one "/run/serv.pid" "service pid://../run/serv.pid serv -n" test_one "/run/serv.pid" "service pid://run/../run//serv.pid serv -n" sep finit-4.14/test/setup-sysroot.sh0000755000175100001660000000120215054341541012430 #!/bin/sh set -eu # shellcheck disable=SC2154 make -C "$top_builddir" DESTDIR="$SYSROOT" install mkdir -p "$SYSROOT/sbin/" cp "$top_builddir/test/src/serv" "$SYSROOT/sbin/" # shellcheck disable=SC2154 FINITBIN="$(pwd)/$top_builddir/src/finit" DEST="$SYSROOT" make -f "$srcdir/lib/sysroot.mk" # Drop plugins we don't need in test, only causes confusing FAIL in logs. for plugin in tty.so urandom.so rtc.so modprobe.so; do find "$SYSROOT" -name $plugin -delete done # Drop system .conf files we don't need in test, same as above # shellcheck disable=SC2043 for conf in 10-hotplug.conf; do find "$SYSROOT" -name $conf -delete done finit-4.14/test/bootstrap-crash.sh0000755000175100001660000000063415054341541012673 #!/bin/sh # Regression test for issue #351. A run/task that never completes # successfully in runlevel S should not respawn forever. #set -eu TEST_DIR=$(dirname "$0") #DEBUG=1 # shellcheck disable=SC2034 BOOTSTRAP="run [S] crasher.sh -- Party crasher" # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say "Hello SMTP Spoken here" run initctl run initctl status crasher.sh sleep 10 say "We are done" finit-4.14/test/notify.sh0000755000175100001660000000630615054341541011072 #!/bin/sh # Verify service readiness notification set -eu #set -x TEST_DIR=$(dirname "$0") test_setup() { run "mkdir -p /etc/default" } test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } test_one() { type=$1 service=$2 # Skip systemd tests if serv doesn't have libsystemd support if [ "$type" = "systemd" ]; then if ! "$TEST_DIR/src/serv" -C | grep -q "libsystemd"; then sep say "Skipping systemd test - serv built without libsystemd support" return 0 fi fi sep # num=$(run "find /proc/1/fd |wc -l") # say "finit: number of open file descriptors before test: $num" say "Testing $(echo "$service" | sed -n -e 's/^.*-- //p')" run "echo $service > $FINIT_CONF" say 'Reload Finit' run "initctl reload" sleep 1 # run "initctl status serv" assert_status "serv" "running" sleep 2 # run "initctl cond dump" assert_cond "service/serv/ready" say "Verify 'ready' is set after SIGHUP ..." run "initctl reload serv" sleep 2 assert_status "serv" "running" assert_cond "service/serv/ready" # Issue #343 say "Verify 'ready' is reasserted if service crashes and is restarted ..." # run "initctl status serv" run "initctl signal serv 9" retry 'assert_status "serv" "running"' 2 1 retry 'assert_cond "service/serv/ready"' 3 1 # Issue #343 say "Verify 'ready' is reasserted on 'initctl restart serv' ..." run "initctl restart serv" sleep 1 retry 'assert_status "serv" "running"' retry 'assert_cond "service/serv/ready"' 5 0.5 say "Verify 'ready' is reasserted on 'initctl reload' ..." run "initctl reload" sleep 1 # run "initctl; initctl cond dump" assert_status "serv" "running" assert_cond "service/serv/ready" # Issue #343; pidfile.so inadvertently marked systemd services as # 'started' when they created their PID file. The serv test daemon # waits 3 sec between pidfile and notify to trigger this bug. if [ "$type" != "pid" ]; then say "Verify 'ready' is *not* asserted immediately on restart + reload" run "initctl restart serv" run "initctl reload" sleep 1 assert_nocond "service/serv/ready" retry 'assert_cond "service/serv/ready"' 5 0.5 fi say "Verify 'ready' is deasserted on stop ..." run "initctl stop serv" sleep 1 assert_status "serv" "stopped" assert_nocond "service/serv/ready" say "Cleaning up after test." run "rm -f $FINIT_CONF" run "initctl reload" # sleep 2 # num=$(run "find /proc/1/fd |wc -l") # say "finit: number of open file descriptors after test: $num" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" #run "initctl debug" test_one "pid" "service log:stdout notify:pid serv -np -- pid file readiness" test_one "s6" "service log:stdout notify:s6 serv -n -N %n -- s6 readiness" test_one "systemd" "service log:stdout notify:systemd serv -n -- systemd readiness" test_one "s6" "service log:stdout notify:s6 serv -np -N %n -- s6 readiness with pidfile" test_one "systemd" "service log:stdout notify:systemd serv -np -- systemd readiness with pidfile" return 0 finit-4.14/test/start-stop-service.sh0000755000175100001660000000111615054341541013332 #!/bin/sh set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say "Add service stanza in $FINIT_CONF" run "echo 'service [2345] kill:20 log service.sh -- Test service' > $FINIT_CONF" say 'Reload Finit' run "initctl reload" retry 'assert_num_children 1 service.sh' say 'Stop the service' run "initctl stop service.sh" retry 'assert_num_children 0 service.sh' say 'Start the service again' run "initctl start service.sh" retry 'assert_num_children 1 service.sh' finit-4.14/test/cond-start-task.sh0000755000175100001660000000355115054341541012577 #!/bin/sh # A run/task runs once per runlevel, unless its .conf is touched # then it will run again on initctl reload. This test verifies # this behavior, with the added twist of starting the task by # asserting a condition. set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $TEST_CONF" } test_one() { cond=$1 stanza=$2 sleep 5 say 'Enable finit debug, try to figure out what is going on ...' run "initctl debug" say "Add stanza '$stanza' to $TEST_CONF ..." run "echo '$stanza' > $TEST_CONF" run "ls -l /run/ /run/finit/" say 'Reload Finit' run "initctl ls" run "initctl reload" run "initctl status" run "ps" date sleep 2 date run "ls -l /run/ /run/finit/" say 'Asserting condition' run "initctl cond set $cond" date sleep 2 date run "ls -l /run/ /run/finit/" run "initctl status" run "ps" run "initctl status task.sh" sleep 1 run "echo Hej; cat /run/task.state" assert_file_contains /run/task.state 1 say 'Reload Finit' run "initctl reload" sleep 1 say 'Ensure task has not run again ...' assert_file_contains /run/task.state 1 say 'Switch to another runlevel ...' run "initctl runlevel 3" sleep 1 say 'Ensure task has run again ...' assert_file_contains /run/task.state 2 say 'Touch task.sh .conf file and reload Finit ...' run "touch $TEST_CONF" run "initctl reload" sleep 1 # run "initctl status task.sh" assert_file_contains /run/task.state 3 say "Done, drop stanza from $TEST_CONF ..." run "rm $TEST_CONF" run "initctl reload" # Done, disable debug run "initctl debug" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" TEST_CONF=$FINIT_RCSD/cond.conf test_one "hello" "task task.sh -- Hello task" finit-4.14/test/svc-env.sh0000755000175100001660000000111715054341541011136 #!/bin/sh # Ensure service environment variables are sourced and expanded properly. set -e TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" sep "/etc/env:" run "cat /etc/env" run "echo 'service env:/etc/env serv -np -e xyzzy:bar -e \"FOO_ARGS:-i bar -l bar endarg\" -- serv checks xyzzy=bar' > $FINIT_CONF" say 'Reload Finit' run "initctl reload" retry 'assert_num_children 1 serv' say "Done, drop service from $FINIT_CONF ..." run "rm $FINIT_CONF" run "initctl reload" finit-4.14/test/run-task-tricks.sh0000755000175100001660000000245215054341541012621 #!/bin/sh # # Verifies that a run task can call initctl at bootstrap and runlevel 2, # without blocking, performing several tasks: # # 1. Query running services # 2. Stop/Start a running service # 3. Restart a service # TEST_DIR=$(dirname "$0") #DEBUG=1 # shellcheck disable=SC2034 BOOTSTRAP="run [S] /bin/ready.sh -- Ready steady go\n\ run [S] name:one initctl -- Query status\n\ service [S234] /sbin/service.sh -- Background service\n\ run [2] name:two initctl stop service.sh -- Stopping service\n\ run [3] name:three initctl start service.sh -- Starting service again\n\ run [4] name:four initctl restart service.sh -- Restart service" # shellcheck disable=SC2034 RCLOCAL="echo \"$0 ==============\" &1>2" # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say "$FINIT_CONF:" run "cat $FINIT_CONF" say "/etc/rc.local:" run "cat /etc/rc.local" say "Waiting for runlevel 2" sleep 2 assert_status "service.sh" "stopped" say "Changing to runlevel 3" run "initctl runlevel 3" sleep 2 assert_status "service.sh" "running" run "initctl" oldpid=$(texec initctl |awk '/service.sh/{print $1}') say "Changing to runlevel 4" run "initctl runlevel 4" sleep 2 assert_status "service.sh" "running" assert_pidiff "service.sh" "$oldpid" run "initctl" finit-4.14/test/sysvparts.sh0000755000175100001660000000151015054341541011630 #!/bin/sh # # Verifies SysV runparts behavior: to run all scripts in a directory at # the end of system bootstrap, right before calling /etc/rc.local: # # - only SNNfoo or KNNfoo executable scripts should be called # - always in alphabetical order # - SNNfoo should be called with a 'start' argument # - KNNfoo should be called with a 'stop' argument # # shellcheck disable=2034 BOOTSTRAP="runparts sysv /etc/rcS.d" TEST_DIR=$(dirname "$0") DEBUG=1 # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" while true; do lvl=$(texec initctl runlevel) say "Current runlevel $lvl" if [ "$lvl" = "N 2" ]; then break; fi sleep 1 done sleep 1 texec cat /tmp/sysv.log texec diff -u /usr/share/runparts/sysv.log /tmp/sysv.log texec cmp /usr/share/runparts/sysv.log /tmp/sysv.log || fail "runparts sysv in wrong order" finit-4.14/test/process-depends.sh0000755000175100001660000000265715054341541012665 #!/bin/sh # Regression test for issue #392 set -eu #set -x TEST_DIR=$(dirname "$0") test_setup() { run "mkdir -p /etc/default" } test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } srv() { say "Adding service $(echo "$1" | sed -n -e 's/^.*-- //p')" run "echo '$1' >> $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" #run "initctl debug" # Test systemd notify srv 'service name:test1_systemd [2345] notify:systemd restart:0 serv -i test1 -n -- Systemd proc' srv 'service name:test2 [2345] serv -i test2 -np -- Dependency test 1' # Test pid notify srv "service name:test3_pid [2345] notify:pid serv -i test3 -np -- Dependency test 2" srv "service name:test4 [2345] serv -i test4 -np -- Dependency test 3" sep "$FINIT_CONF" run "cat $FINIT_CONF" sep say 'Reload Finit' run "initctl reload" say "Waiting for all services to start" retry 'assert_status "test4" "running"' 5 1 # Load bearing debug. Without this the bug cannot be reproduced! run "initctl debug" sep say "Stopping root service, all others should also stop" run "initctl stop test1_systemd" retry 'assert_status "test3_pid" "waiting"' 5 1 sep say "Verify test4 does not restart" run "initctl status" run "initctl cond dump" assert_status "test4" "waiting" return 0 finit-4.14/test/start-kill-service.sh0000755000175100001660000000160715054341541013305 #!/bin/sh # Verifies Finit restarts crashing services and registers their new PID # from their (default) PID file. set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" rm -f "$SYSROOT"/oldpid say "Add service stanza in $FINIT_CONF" run "echo 'service [2345] respawn log:stderr service.sh -- Test service' > $FINIT_CONF" say 'Reload Finit' run "initctl reload" #run "initctl status" #run "initctl debug" retry 'assert_num_children 1 service.sh' run "initctl status service.sh" say 'Simulate service crash (kill -9 ..)' i=0 laps=1000 while [ $i -lt $laps ]; do i=$((i + 1)) say "Lap $i/$laps, killing service ..." # we have this, no sleep needed run "slay service.sh" done retry 'assert_new_pid service.sh /run/service.pid' retry 'assert_num_children 1 service.sh' finit-4.14/test/devmon.sh0000755000175100001660000000165115054341541011050 #!/bin/sh # # Verify device monitor (built-in plugin) # set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF /tmp/post" } # Cannot run mknod as non-root even in a chroot # touch is close enough for our needs mkdev() { dir=$(dirname "$1") run "mkdir -p $dir" run "touch $1" } rmdev() { run "rm $1" } test_one() { cond="$1" node="/$cond" say "Checking cond $cond and device $node ..." run "echo service log:null \<$cond\> serv -np >> $FINIT_CONF" run "cat $FINIT_CONF" run "initctl reload" assert_status "serv" "waiting" mkdev "$node" assert_status "serv" "running" rmdev "$node" assert_status "serv" "waiting" say "Cleaning up ..." run "rm $FINIT_CONF" run "initctl reload" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" sep test_one "dev/fbsplash" sep test_one "dev/subdir/42" sep finit-4.14/test/src/0000755000175100001660000000000015054341601010062 5finit-4.14/test/src/serv.c0000644000175100001660000001614015054341541011132 /* * Basic UNIX daemon * * Options to run in foreground and to create a PID file. When running * in foregrund it does not create a PID file by default. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBSYSTEMD #include "sd-daemon.h" #endif #define PROGNM "serv" #define err(rc, fmt, args...) do {fprintf(stderr, "%s: " fmt ": %s\n", ident, ##args, strerror(errno)); exit(rc);} while(0) #define errx(rc, fmt, args...) do {fprintf(stderr, "%s: " fmt "\n", ident, ##args); exit(rc);} while(0) #define inf(fmt, args...) do {fprintf(stderr, "%s: " fmt "\n", ident, ##args);} while(0) volatile sig_atomic_t reloading = 1; volatile sig_atomic_t running = 1; static char *ident = PROGNM; static char fn[80]; static void verify_env(char *arg) { char *key, *value; char *replica; char *env; key = replica = strdupa(arg); if (!replica) err(1, "Failed duplicating arg %s", arg); value = strchr(replica, ':'); if (!value) errx(1, "Invalid format of KEY:VALUE arg, missing ':' in %s", replica); *(value++) = 0; env = getenv(key); if (!env) errx(1, "No '%s' in environment", key); if (strcmp(env, value)) errx(1, "Mismatch, environment '%s' vs expected value '%s'", env, value); } static void verify_noenv(char *key) { char *val; val = getenv(key); if (val) errx(1, "Error, key %s is set in environment to '%s'", key, val); } static void inc_restarts(void) { char buf[10]; int cnt = 0; FILE *fp; fp = fopen("/tmp/serv-restart.cnt", "r+"); if (!fp) { fp = fopen("/tmp/serv-restart.cnt", "w"); if (!fp) err(1, "failed creating restart counter file"); } else { if (fgets(buf, sizeof(buf), fp)) cnt = atoi(buf); } cnt++; fseek(fp, SEEK_SET, 0); fprintf(fp, "%d", cnt); fclose(fp); } static void cleanup(void) { remove(fn); } static void sig(int signo) { inf("Got signal %d ...", signo); switch (signo) { case SIGHUP: reloading = 1; break; case SIGTERM: running = 0; break; } } static void writefn(char *fn, int val) { FILE *fp; fp = fopen(fn, "w"); if (!fp) err(1, "failed creating file %s", fn); fprintf(fp, "%d\n", val); fclose(fp); } static int checkfn(char *fn) { return !access(fn, R_OK); } static void mine(char *fn) { inf("Mining for spice in %s", fn); writefn(fn, 4711); } static void pidfile(char *pidfn) { if (!pidfn) { if (fn[0] == 0) snprintf(fn, sizeof(fn), "%s%s.pid", _PATH_VARRUN, ident); pidfn = fn; } if (!checkfn(pidfn)) { pid_t pid; pid = getpid(); inf("Creating PID file %s with %d", pidfn, pid); writefn(pidfn, pid); atexit(cleanup); } else { inf("Touching PID file %s", pidfn); utimensat(0, fn, NULL, 0); } } static int capabilities(void) { #ifdef HAVE_LIBSYSTEMD puts("libsystemd"); #endif puts("s6"); return 0; } static int usage(int rc) { FILE *fp = rc ? stderr : stdout; fprintf(fp, "%s [-nhp] [-P FILE]\n" "\n" " -C Show capabilities and exit\n" " -c Crash (exit) immediately\n" " -e K:V Verify K environment variable is V value\n" " -E K Verify K is not set in the environment\n" " -f FILE Container file to keep the Melange in\n" " -F FILE Where to look spice ...\n" " -h Show help text (this)\n" " -i IDENT Change process identity, incl. logs, pidfile, etc.\n" " -n Run in foreground\n" " -N SOCK Send '\\n' on SOCK (integer), for s6 readiness\n" " -p Create PID file despite running in foreground\n" " -P FILE Create PID file using FILE\n" " -r SVC Call initctl to restart service SVC (self)\n" "\n" "By default this program daemonizes itself to the background, and,\n" "when it's done setting up its signal handler(s), creates a PID file\n" "to let the rest of the system know it's done. When the program runs\n" "in the foreground it does not create a PID file by default.\n" "\n" "When acting as a systemd daemon, this program expects NOTIFY_SOCKET\n" "\n" "Regardless of how This daemon is started it provides a single service\n" "to others, spice ... guarded by sandworms.\n", ident); return rc; } int main(int argc, char *argv[]) { int do_background = 1; int notify_s6 = 0; int do_pidfile = 1; int do_restart = 0; int do_notify = 0; int do_crash = 0; int vanish = 0; char *pidfn = NULL; char *melange = NULL; char *spice = NULL; char cmd[80]; int c; while ((c = getopt(argc, argv, "cCe:E:f:F:hi:nN:pP:r:")) != EOF) { switch (c) { case 'c': do_crash = 1; break; case 'C': return capabilities(); case 'e': verify_env(optarg); break; case 'E': verify_noenv(optarg); break; case 'f': melange = optarg; break; case 'F': spice = optarg; break; case 'h': return usage(0); case 'i': ident = optarg; break; case 'n': do_background = 0; do_pidfile--; break; case 'N': do_notify = atoi(optarg); notify_s6 = 1; break; case 'p': do_pidfile++; break; case 'P': pidfn = optarg; do_pidfile++; break; case 'r': snprintf(cmd, sizeof(cmd), "initctl restart %s", optarg); do_restart = 1; break; default: return usage(1); } } /* Daemonize, fork to background etc. */ if (do_background) { if (daemon(0, 1)) return 1; } /* Signal handlers first *then* PID file */ signal(SIGTERM, sig); signal(SIGHUP, sig); /* This is our only service to the world */ if (melange) mine(melange); /* Tell world where we are, but not if bg w/o pid file */ if (do_pidfile > 0) pidfile(pidfn); if (!do_notify && getenv("NOTIFY_SOCKET")) do_notify = 1; if (do_notify) inf("Will notify %s ...", notify_s6 ? "s6" : "systemd"); else inf("No notify socket ..."); if (do_crash) { inf("Simulating crash, exiting with code %d", EX_SOFTWARE); exit(EX_SOFTWARE); } inf("Entering while(1) loop"); while (running) { if (spice) { inf("Checking for spice in %s ...", spice); if (!checkfn(spice)) err(1, "Melange"); } if (reloading) { if (do_notify > 0) { /* Issue #343: see notify.sh test for more details */ inf("Delaying notify by 3 seconds for notify.sh ..."); sleep(3); if (notify_s6) { inf("Notifying Finit on socket %d", do_notify); if (write(do_notify, "\n", 1) < 1) err(1, "Failed sending ready notification to Finit"); inf("s6 notify, closing socket %d ...", do_notify); if (close(do_notify)) err(1, "Failed closing notify socket"); do_notify = 0; } else { #ifdef HAVE_LIBSYSTEMD int rc; inf("Notifying Finit on NOTIFY_SOCKET"); rc = sd_notify(0, "READY=1"); inf("sd_notify () => %d", rc); #else inf("Skipping systemd notify - built without libsystemd support"); #endif } } if (do_pidfile > 0) pidfile(NULL); reloading = 0; } sleep(1); if (do_restart) { inc_restarts(); if (system(cmd)) return 1; break; } if (melange && vanish++ > 0) { if (checkfn(melange)) { inf("Oh no, sandworms! Harvest interrupted ..."); remove(melange); } } } inf("Leaving ..."); return 0; } finit-4.14/test/src/Makefile.in0000644000175100001660000005727315054341567012100 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = serv$(EXEEXT) @LIBSYSTEMD_TRUE@am__append_1 = -I$(top_srcdir)/libsystemd $(lite_CFLAGS) @LIBSYSTEMD_TRUE@am__append_2 = $(top_srcdir)/libsystemd/sd-daemon.c subdir = test/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__serv_SOURCES_DIST = serv.c $(top_srcdir)/libsystemd/sd-daemon.c am__dirstamp = $(am__leading_dot)dirstamp @LIBSYSTEMD_TRUE@am__objects_1 = $(top_builddir)/libsystemd/serv-sd-daemon.$(OBJEXT) am_serv_OBJECTS = serv-serv.$(OBJEXT) $(am__objects_1) serv_OBJECTS = $(am_serv_OBJECTS) am__DEPENDENCIES_1 = @LIBSYSTEMD_TRUE@serv_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = \ $(top_builddir)/libsystemd/$(DEPDIR)/serv-sd-daemon.Po \ ./$(DEPDIR)/serv-serv.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ 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 = $(serv_SOURCES) DIST_SOURCES = $(am__serv_SOURCES_DIST) 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) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ serv_SOURCES = serv.c $(am__append_2) serv_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE \ -D_DEFAULT_SOURCE -I$(top_builddir) $(am__append_1) @LIBSYSTEMD_TRUE@serv_LDADD = $(lite_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list $(top_builddir)/libsystemd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/libsystemd @: > $(top_builddir)/libsystemd/$(am__dirstamp) $(top_builddir)/libsystemd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/libsystemd/$(DEPDIR) @: > $(top_builddir)/libsystemd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/libsystemd/serv-sd-daemon.$(OBJEXT): \ $(top_builddir)/libsystemd/$(am__dirstamp) \ $(top_builddir)/libsystemd/$(DEPDIR)/$(am__dirstamp) serv$(EXEEXT): $(serv_OBJECTS) $(serv_DEPENDENCIES) $(EXTRA_serv_DEPENDENCIES) @rm -f serv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(serv_OBJECTS) $(serv_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/libsystemd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/libsystemd/$(DEPDIR)/serv-sd-daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serv-serv.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< serv-serv.o: serv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(serv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT serv-serv.o -MD -MP -MF $(DEPDIR)/serv-serv.Tpo -c -o serv-serv.o `test -f 'serv.c' || echo '$(srcdir)/'`serv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/serv-serv.Tpo $(DEPDIR)/serv-serv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='serv.c' object='serv-serv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(serv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o serv-serv.o `test -f 'serv.c' || echo '$(srcdir)/'`serv.c serv-serv.obj: serv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(serv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT serv-serv.obj -MD -MP -MF $(DEPDIR)/serv-serv.Tpo -c -o serv-serv.obj `if test -f 'serv.c'; then $(CYGPATH_W) 'serv.c'; else $(CYGPATH_W) '$(srcdir)/serv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/serv-serv.Tpo $(DEPDIR)/serv-serv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='serv.c' object='serv-serv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(serv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o serv-serv.obj `if test -f 'serv.c'; then $(CYGPATH_W) 'serv.c'; else $(CYGPATH_W) '$(srcdir)/serv.c'; fi` $(top_builddir)/libsystemd/serv-sd-daemon.o: $(top_builddir)/libsystemd/sd-daemon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(serv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/libsystemd/serv-sd-daemon.o -MD -MP -MF $(top_builddir)/libsystemd/$(DEPDIR)/serv-sd-daemon.Tpo -c -o $(top_builddir)/libsystemd/serv-sd-daemon.o `test -f '$(top_builddir)/libsystemd/sd-daemon.c' || echo '$(srcdir)/'`$(top_builddir)/libsystemd/sd-daemon.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/libsystemd/$(DEPDIR)/serv-sd-daemon.Tpo $(top_builddir)/libsystemd/$(DEPDIR)/serv-sd-daemon.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/libsystemd/sd-daemon.c' object='$(top_builddir)/libsystemd/serv-sd-daemon.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(serv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/libsystemd/serv-sd-daemon.o `test -f '$(top_builddir)/libsystemd/sd-daemon.c' || echo '$(srcdir)/'`$(top_builddir)/libsystemd/sd-daemon.c $(top_builddir)/libsystemd/serv-sd-daemon.obj: $(top_builddir)/libsystemd/sd-daemon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(serv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/libsystemd/serv-sd-daemon.obj -MD -MP -MF $(top_builddir)/libsystemd/$(DEPDIR)/serv-sd-daemon.Tpo -c -o $(top_builddir)/libsystemd/serv-sd-daemon.obj `if test -f '$(top_builddir)/libsystemd/sd-daemon.c'; then $(CYGPATH_W) '$(top_builddir)/libsystemd/sd-daemon.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/libsystemd/sd-daemon.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/libsystemd/$(DEPDIR)/serv-sd-daemon.Tpo $(top_builddir)/libsystemd/$(DEPDIR)/serv-sd-daemon.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/libsystemd/sd-daemon.c' object='$(top_builddir)/libsystemd/serv-sd-daemon.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(serv_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/libsystemd/serv-sd-daemon.obj `if test -f '$(top_builddir)/libsystemd/sd-daemon.c'; then $(CYGPATH_W) '$(top_builddir)/libsystemd/sd-daemon.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/libsystemd/sd-daemon.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(top_builddir)/libsystemd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/libsystemd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/libsystemd/$(am__dirstamp)" || rm -f $(top_builddir)/libsystemd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/libsystemd/$(DEPDIR)/serv-sd-daemon.Po -rm -f ./$(DEPDIR)/serv-serv.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/libsystemd/$(DEPDIR)/serv-sd-daemon.Po -rm -f ./$(DEPDIR)/serv-serv.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-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-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/test/src/Makefile.am0000644000175100001660000000047515054341541012047 noinst_PROGRAMS = serv serv_SOURCES = serv.c serv_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE -I$(top_builddir) if LIBSYSTEMD serv_CPPFLAGS += -I$(top_srcdir)/libsystemd $(lite_CFLAGS) serv_SOURCES += $(top_srcdir)/libsystemd/sd-daemon.c serv_LDADD = $(lite_LIBS) endif finit-4.14/test/start-stop-serv.sh0000755000175100001660000000321615054341541012654 #!/bin/sh set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } test_one() { pidfn=$1 service=$2 say "Add service stanza '$service' to $FINIT_CONF ..." run "echo '$service' > $FINIT_CONF" say 'Reload Finit' #run "initctl debug" run "initctl reload" #run "initctl status" #run "ps" #run "initctl status" #run "ps" #run "initctl status serv" retry 'assert_num_children 1 serv' retry "assert_has_pidfile $pidfn" 1 say 'Stop the service' run "initctl stop serv" retry 'assert_num_children 0 serv' say 'Start the service again' run "initctl start serv" retry 'assert_num_children 1 serv' say "Done, drop service from $FINIT_CONF ..." run "rm $FINIT_CONF" run "initctl reload" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" test_one "/run/serv.pid" "service pid:!/run/serv.pid serv -- Forking service, type 1" test_one "/run/serv.pid" "service type:forking serv -- Forking service, type 2" # This one could never be started by and monitored by Finit: it forks to # background and does not create a PID file. Essentially it's lost to # Finit, and any other sane process monitor. #test_one "/run/serv.pid" "service pid:/run/serv.pid serv -p -- Forking service w/o PID file" test_one "/run/serv.pid" "service pid:/run/serv.pid serv -n -- Foreground service w/o PID file" test_one "/run/serv.pid" "service serv -n -p -- Foreground service w/ PID file" test_one "/run/servy.pid" "service pid:/run/servy.pid serv -n -p -P /run/servy.pid -- Foreground service w/ custom PID file" finit-4.14/test/testserv.sh0000755000175100001660000000053515054341541011437 #!/bin/sh # Verify service readiness notification # shellcheck disable=SC2034 set -eu #set -x #DEBUG=true FINIT_ARGS="finit.cond=testserv" TEST_DIR=$(dirname "$0") # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" run "initctl" run "initctl status testserv" run "initctl cond dump" sleep 1 retry 'assert_norestart testserv' 1 1 return 0 finit-4.14/test/signal-service.sh0000755000175100001660000000146215054341541012473 #!/bin/sh # Verifies initctl can send arbitrary signals (USR1 in this case) to finit managed services set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say 'Ensure file system is cleared' run "rm -f /tmp/usr1.log" # Verifies line continuation as well say "Add service stanza in $FINIT_CONF" run "echo 'service [2345] kill:20 \\ log service.sh \\ -- Test service' > $FINIT_CONF" run "cat $FINIT_CONF" #run "initctl debug" say 'Reload Finit' run "initctl reload" #run "initctl status service.sh" say 'Send SIGUSR1 to service...' run "initctl signal service.sh SIGUSR1" # shellcheck disable=SC2016 retry 'assert "service.sh received SIGUSR" "$(texec cat /tmp/usr1.log)" = "USR1"' 10 1 finit-4.14/test/run-restart-forever.sh0000755000175100001660000000166515054341541013521 #!/bin/sh # Regression test for issue #351 - verify that a dirty run/task in # runlevel S is not restarted forever just because it exits with a # non-zero error code. set -eu #export DEBUG=true TEST_DIR=$(dirname "$0") test_setup() { run "mkdir -p /etc/default" export TEST_TIMEOUT=5 } test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" test_one() { num=$1 say "Reloading Finit ..." run "initctl reload" # run "initctl status fail.sh" say "Reloading Finit ..." run "initctl reload" # run "initctl status fail.sh" assert_restart_cnt "$num" "0/10" fail.sh } sep say "Add stanza to $FINIT_CONF" run "echo 'run /sbin/fail.sh -- Failure' > $FINIT_RCSD/fail.conf" run "echo 'run initctl touch fail' > $FINIT_RCSD/touch.conf" test_one 2 sep say "Changing runlevel ..." run "initctl runlevel 3" test_one 4 return 0 finit-4.14/test/test.env.in0000644000175100001660000000026615054341541011320 prefix=@prefix@ exec_prefix=@exec_prefix@ export TESTENV_PATH=/bin:/sbin:/usr/bin:/usr/sbin:"@bindir@":"@sbindir@" export FINIT_CONF="@FINIT_CONF@" export FINIT_RCSD="@FINIT_RCSD@" finit-4.14/test/pre-post-serv.sh0000755000175100001660000000477315054341541012316 #!/bin/sh # # Verify pre:script and post:script runs as intended when starting, # stopping and disabling services in various configurations and # conditions. # set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } startit() { service=$1 conf=$2 pre=$3 precont=$4 say "Add stanza '$service' to $conf ..." run "echo '$service' > $conf" if echo "$conf" |grep -q available; then # configlets need must be enabled run "initctl enable serv" fi say 'Reload Finit' run "initctl reload" # Ensure service has started before checking pre condition retry 'assert_num_children 1 serv' # Verify pre:script has run if [ -n "$pre" ]; then assert_file_contains "$pre" "$precont" # Drop pre condition indicator for next test run "rm -f $pre" fi } stopit() { conf=$1 post=$2 postcont=$3 if echo "$conf" |grep -q available; then say 'Disable service & reload' run "initctl disable serv" run "initctl reload" else say 'Stop the service' run "initctl stop serv" fi # Ensure service has stopped before checking for post condition retry 'assert_num_children 0 serv' # Verify post:script has run if [ -n "$post" ]; then assert_file_contains "$post" "$postcont" # Drop post condition indicator for next test run "rm -f $post" fi say "Done, drop $conf ..." run "rm $conf" run "initctl reload" } test_one() { pre=$1 precont=$2 service=$3 post=$4 postcont=$5 avail="$FINIT_RCSD/available/serv.conf" sep "Stage 1/2" startit "$service" "$FINIT_CONF" "$pre" "$precont" stopit "$FINIT_CONF" "$post" "$postcont" sep "Stage 2/2" startit "$service" "$avail" "$pre" "$precont" stopit "$avail" "$post" "$postcont" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" #run "initctl debug" test_one "" "" "service serv -np -- Regular fg service, no pre/post scripts" "" "" test_one "" "" "service env:/etc/env serv -np -e foo:bar -- serv + env, no pre/post scripts" "" "" test_one /tmp/pre PRE "service pre:/bin/pre.sh serv -np -- serv + pre script" "" "" test_one /tmp/pre bar "service env:/etc/env pre:/bin/pre.sh serv -np -e baz:qux -- Env + pre script" "" "" test_one "" "" "service post:/bin/post.sh serv -np -- Regular fg service, post script" /tmp/post POST test_one "" "" "service env:/etc/env post:/bin/post.sh serv -np -- Regular fg service, post script" /tmp/post qux finit-4.14/test/rclocal.sh0000755000175100001660000000047315054341541011200 #!/bin/sh # Regression test for basic /etc/rc.local functionality # shellcheck disable=2317,2034 set -eu RCLOCAL="echo 'KILROY WAS HERE' > /tmp/rclocal" TEST_DIR=$(dirname "$0") #DEBUG=1 # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" sleep 1 assert_file_contains /tmp/rclocal "KILROY WAS HERE" exit 0 finit-4.14/test/pre-fail.sh0000755000175100001660000000112215054341541011250 #!/bin/sh # Verify Finit: # - does not start main process when pre:script fails # - times out and kills long running pre:script set -eu #export DEBUG=true TEST_DIR=$(dirname "$0") # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" vrfy() { nm=serv tmo=$1 msg=$2 err=$3 run "echo 'service [2345] pre:$tmo,fail.sh $nm -n -- $msg' > $FINIT_CONF" run "initctl reload" retry "assert_status_full $nm 'crashed $err'" 50 } #run "initctl debug" vrfy 5 "Failing pre: script" "(code=exited, status=42)" vrfy 1 "Timeout pre: script" "(code=signal, status=9/KILL)" finit-4.14/test/global-envs.sh0000755000175100001660000000226415054341541011772 #!/bin/sh set -eu TEST_DIR=$(dirname "$0") # shellcheck disable=SC2034 BOOTSTRAP="foo=bar\n\ set COLORTERM=yes\n\ b aq=oroszoe\n\ baz=qux" test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say "Waiting for runlevel 2" sleep 2 run "initctl debug" say "Add service stanza to $FINIT_CONF ..." run "echo 'service serv -np -e foo:bar -- Verify foo=bar' >> $FINIT_CONF" run "cat $FINIT_CONF" say 'Reload Finit' run "initctl reload" sleep 1 run "initctl" retry 'assert_num_children 1 serv' say "Modify $FINIT_CONF slightly ..." run "sed -i 's/foo:bar/baz:qux/; s/foo=bar/baz=qux/' $FINIT_CONF" say 'Reload Finit' run "initctl reload" sleep 1 retry 'assert_num_children 1 serv' say "Swap envs completely in $FINIT_CONF ..." run "echo 'bar=foo' > $FINIT_CONF" run "echo 'qux=baz' >> $FINIT_CONF" say "Add swapped service stanza to $FINIT_CONF ..." run "echo 'service serv -np -e bar:foo -E baz -- Verify bar=foo and no baz' >> $FINIT_CONF" say 'Reload Finit' run "initctl reload" sleep 1 retry 'assert_num_children 1 serv' say "Done, drop service from $FINIT_CONF ..." run "rm $FINIT_CONF" run "initctl reload" finit-4.14/test/Makefile.in0000644000175100001660000010617715054341567011307 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @TESTSERV_TRUE@am__append_1 = testserv.sh subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = test.env CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ check recheck distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.sh.log=.log) SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/aux/test-driver SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/test.env.in \ $(top_srcdir)/aux/test-driver README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ SUBDIRS = lib src EXTRA_DIST = skel/bin/busybox-x86_64.sha256 skel/sbin/service.sh \ skel/etc/env skel/bin/pre.sh skel/bin/post.sh \ skel/bin/ready.sh skel/bin/slay skel/sbin/fail.sh \ skel/usr/share/runparts/ref.log \ skel/usr/share/runparts/sysv.log skel/etc/rc.d/foo.sh \ skel/etc/rc.d/S01abc.sh skel/etc/rc.d/test.sh \ skel/etc/rc.d/S02def.sh skel/etc/rcS.d/foo.sh \ skel/etc/rcS.d/test.sh skel/etc/rcS.d/S01abc.sh \ skel/etc/rcS.d/S02def.sh skel/cdrom/.empty skel/dev/shm/.empty \ skel/dev/pts/.empty skel/etc/inittab skel/etc/hostname \ skel/etc/fstab skel/etc/init.d/rcS skel/etc/init.d/rcK \ skel/tmp/.empty skel/etc/finit.d/.empty \ skel/etc/finit.d/available/.empty \ skel/etc/finit.d/enabled/.empty skel/sbin/task.sh \ skel/bin/crasher.sh skel/bin/fail.sh \ skel/etc/init.d/S01-service.sh skel/etc/init.d/S02-serv.sh \ skel/proc/.empty skel/root/.empty skel/run/.empty \ skel/sbin/chrootsetup.sh skel/srv/.empty skel/sys/.empty \ skel/usr/bin/.empty skel/usr/lib/.empty skel/usr/sbin/.empty \ skel/home/.empty skel/usr/games/.empty skel/usr/src/.empty \ skel/usr/share/.empty skel/usr/include/.empty \ skel/usr/local/games/.empty skel/usr/local/sbin/.empty \ skel/usr/local/share/.empty skel/usr/local/src/.empty \ skel/usr/local/lib/.empty skel/usr/local/bin/.empty \ skel/usr/local/etc/.empty skel/var/.empty setup-sysroot.sh \ add-remove-dynamic-service.sh \ add-remove-dynamic-service-sub-config.sh bootstrap-crash.sh \ cond-start-task.sh crashing.sh depserv.sh devmon.sh \ failing-sysv.sh svc-env.sh global-envs.sh \ initctl-status-subset.sh notify.sh pidfile.sh pre-post-serv.sh \ pre-fail.sh process-depends.sh rclocal.sh ready-serv.sh \ restart-self.sh runlevel.sh run-restart-forever.sh \ run-task-tricks.sh runparts.sh sysvparts.sh \ start-stop-service.sh start-stop-service-sub-config.sh \ start-kill-service.sh start-kill-stop.sh start-stop-sysv.sh \ start-stop-serv.sh signal-service.sh testserv.sh \ unexpected-restart.sh AM_TESTS_ENVIRONMENT = SYSROOT='$(abs_builddir)/sysroot/'; export \ SYSROOT; export LD_LIBRARY_PATH; top_builddir=$(top_builddir); \ export top_builddir; TEST_EXTENSIONS = .sh TESTS = checkself.sh add-remove-dynamic-service.sh \ add-remove-dynamic-service-sub-config.sh bootstrap-crash.sh \ cond-start-task.sh crashing.sh depserv.sh devmon.sh \ failing-sysv.sh svc-env.sh global-envs.sh \ initctl-status-subset.sh notify.sh pidfile.sh pre-post-serv.sh \ pre-fail.sh process-depends.sh rclocal.sh ready-serv.sh \ restart-self.sh runlevel.sh sysvparts.sh \ run-restart-forever.sh run-task-tricks.sh runparts.sh \ start-stop-service.sh start-stop-service-sub-config.sh \ start-kill-service.sh start-kill-stop.sh start-stop-sysv.sh \ start-stop-serv.sh signal-service.sh $(am__append_1) \ unexpected-restart.sh all: all-recursive .SUFFIXES: .SUFFIXES: .log .sh .sh$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): test.env: $(top_builddir)/config.status $(srcdir)/test.env.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? .sh.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.sh$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-TESTS check-am clean clean-generic clean-libtool \ clean-local cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-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-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile check-recursive: setup-chroot .PHONY: checkself.sh checkself.sh: @echo '#!/bin/sh' > $@ @echo 'set -eu' >> $@ @echo 'cd "$$srcdir" 2>/dev/null || cd "." || exit 1' >> $@ @echo 'TESTS="$(filter %.sh,$(filter-out $@, $(TESTS)))"' >> $@ @echo 'shellcheck $$TESTS' >> $@ @chmod 0755 $@ .PHONY: setup-chroot setup-chroot: @SYSROOT='$(abs_builddir)/sysroot/' srcdir=$(srcdir) top_builddir=$(top_builddir) $(srcdir)/setup-sysroot.sh clean-local: -rm -rf $(builddir)/sysroot/ -rm -f checkself.sh # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/test/runparts.sh0000755000175100001660000000143615054341541011437 #!/bin/sh # # Verifies basic runparts behavior: to run all scripts in a directory at # the end of system bootstrap, right before calling /etc/rc.local: # # - only executable scripts should be called # - always in alphabetical order # - SNNfoo should be called with a 'start' argument # - KNNfoo should be called with a 'stop' argument # # shellcheck disable=SC2034 BOOTSTRAP="runparts /etc/rc.d" TEST_DIR=$(dirname "$0") #DEBUG=1 # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" while true; do lvl=$(texec initctl runlevel) say "Current runlevel $lvl" if [ "$lvl" = "N 2" ]; then break; fi sleep 1 done sleep 1 texec diff -u /usr/share/runparts/ref.log /tmp/runparts.log texec cmp /usr/share/runparts/ref.log /tmp/runparts.log || fail "runparts in wrong order" finit-4.14/test/restart-self.sh0000755000175100001660000000131615054341541012171 #!/bin/sh # Verify that a service can restart itself, issue #280 set -eu TEST_DIR=$(dirname "$0") test_setup() { run "mkdir -p /etc/default" } test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } check_restarts() { assert "serv restarts" "$(texec cat "$1" | awk '{print $1;}')" -ge "$2" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say "Add stanza to $FINIT_CONF" run "echo 'service serv -np -r serv -- Restart self' > $FINIT_CONF" say 'Reload Finit' run "initctl reload" sleep 2 run "initctl status serv" run "ps" sleep 2 run "initctl status serv" run "ps" say 'Pending restarts by itself ...' retry 'check_restarts /tmp/serv-restart.cnt 3' 20 1 return 0 finit-4.14/test/skel/0000755000175100001660000000000015054341601010231 5finit-4.14/test/skel/usr/0000755000175100001660000000000015054341601011042 5finit-4.14/test/skel/usr/local/0000755000175100001660000000000015054341601012134 5finit-4.14/test/skel/usr/local/etc/0000755000175100001660000000000015054341601012707 5finit-4.14/test/skel/usr/local/etc/.empty0000644000175100001660000000000015054341541013757 finit-4.14/test/skel/usr/local/sbin/0000755000175100001660000000000015054341601013067 5finit-4.14/test/skel/usr/local/sbin/.empty0000644000175100001660000000000015054341541014137 finit-4.14/test/skel/usr/local/share/0000755000175100001660000000000015054341601013236 5finit-4.14/test/skel/usr/local/share/.empty0000644000175100001660000000000015054341541014306 finit-4.14/test/skel/usr/local/src/0000755000175100001660000000000015054341601012723 5finit-4.14/test/skel/usr/local/src/.empty0000644000175100001660000000000015054341541013773 finit-4.14/test/skel/usr/local/bin/0000755000175100001660000000000015054341601012704 5finit-4.14/test/skel/usr/local/bin/.empty0000644000175100001660000000000015054341541013754 finit-4.14/test/skel/usr/local/games/0000755000175100001660000000000015054341601013230 5finit-4.14/test/skel/usr/local/games/.empty0000644000175100001660000000000015054341541014300 finit-4.14/test/skel/usr/local/lib/0000755000175100001660000000000015054341601012702 5finit-4.14/test/skel/usr/local/lib/.empty0000644000175100001660000000000015054341541013752 finit-4.14/test/skel/usr/sbin/0000755000175100001660000000000015054341601011775 5finit-4.14/test/skel/usr/sbin/.empty0000644000175100001660000000000015054341541013045 finit-4.14/test/skel/usr/share/0000755000175100001660000000000015054341601012144 5finit-4.14/test/skel/usr/share/.empty0000644000175100001660000000000015054341541013214 finit-4.14/test/skel/usr/share/runparts/0000755000175100001660000000000015054341601014022 5finit-4.14/test/skel/usr/share/runparts/sysv.log0000644000175100001660000000006615054341541015456 /etc/rcS.d/S01abc.sh start /etc/rcS.d/S02def.sh start finit-4.14/test/skel/usr/share/runparts/ref.log0000644000175100001660000000012715054341541015224 /etc/rc.d/S01abc.sh start /etc/rc.d/S02def.sh start /etc/rc.d/foo.sh /etc/rc.d/test.sh finit-4.14/test/skel/usr/src/0000755000175100001660000000000015054341601011631 5finit-4.14/test/skel/usr/src/.empty0000644000175100001660000000000015054341541012701 finit-4.14/test/skel/usr/bin/0000755000175100001660000000000015054341601011612 5finit-4.14/test/skel/usr/bin/.empty0000644000175100001660000000000015054341541012662 finit-4.14/test/skel/usr/games/0000755000175100001660000000000015054341601012136 5finit-4.14/test/skel/usr/games/.empty0000644000175100001660000000000015054341541013206 finit-4.14/test/skel/usr/include/0000755000175100001660000000000015054341601012465 5finit-4.14/test/skel/usr/include/.empty0000644000175100001660000000000015054341541013535 finit-4.14/test/skel/usr/lib/0000755000175100001660000000000015054341601011610 5finit-4.14/test/skel/usr/lib/.empty0000644000175100001660000000000015054341541012660 finit-4.14/test/skel/etc/0000755000175100001660000000000015054341601011004 5finit-4.14/test/skel/etc/hostname0000644000175100001660000000000515054341541012463 test finit-4.14/test/skel/etc/init.d/0000755000175100001660000000000015054341601012171 5finit-4.14/test/skel/etc/init.d/S01-service.sh0000755000175100001660000000143715054341541014461 #!/bin/sh # SysV style start script for service.sh DAEMON="/sbin/service.sh" PIDFILE="/var/run/service.pid" start() { printf 'Starting %s: ' "$DAEMON" start-stop-daemon -S -b -q -p "$PIDFILE" -x "$DAEMON" status=$? if [ "$status" -eq 0 ]; then echo "OK" else echo "FAIL" fi return "$status" } stop() { printf 'Stopping %s: ' "$DAEMON" start-stop-daemon -K -q -p "$PIDFILE" status=$? if [ "$status" -eq 0 ]; then echo "OK" else echo "FAIL" fi return "$status" } reload() { if [ -f "$PIDFILE" ]; then PID=$(cat "$PIDFILE") kill -HUP "$PID" fi } restart() { stop sleep 1 start } case "$1" in start|stop|reload|restart) "$1" ;; *) echo "Usage: $0 {start|stop|reload|restart}, got $0 $1" exit 1 esac finit-4.14/test/skel/etc/init.d/rcK0000755000175100001660000000005315054341541012557 #!/bin/sh echo "Shutting down ..." exit 0 finit-4.14/test/skel/etc/init.d/rcS0000755000175100001660000000006115054341541012566 #!/bin/sh echo "Starting up ..." poweroff -d 2 finit-4.14/test/skel/etc/init.d/S02-serv.sh0000755000175100001660000000137515054341541014002 #!/bin/sh # SysV style start script for serv DAEMON="/sbin/serv" PIDFILE="/var/run/serv.pid" # shellcheck source=/dev/null [ -r "/etc/default/serv" ] && . "/etc/default/serv" start() { printf 'Starting %s: ' "$DAEMON $SERV_ARGS" # shellcheck disable=SC2086 start-stop-daemon -S -b -q -p "$PIDFILE" -x "$DAEMON" -- $SERV_ARGS status=$? if [ "$status" -eq 0 ]; then echo "OK" else echo "FAIL" fi return "$status" } stop() { printf 'Stopping %s: ' "$DAEMON" start-stop-daemon -K -q -p "$PIDFILE" status=$? if [ "$status" -eq 0 ]; then echo "OK" else echo "FAIL" fi return "$status" } restart() { stop sleep 1 start } case "$1" in start|stop|restart) "$1" ;; *) echo "Usage: $0 {start|stop|restart}, got $0 $1" exit 1 esac finit-4.14/test/skel/etc/rcS.d/0000755000175100001660000000000015054341601011755 5finit-4.14/test/skel/etc/rcS.d/foo.sh0000755000175100001660000000004615054341541013022 #!/bin/sh echo "$0" >> /tmp/sysv.log finit-4.14/test/skel/etc/rcS.d/test.sh0000755000175100001660000000004615054341541013216 #!/bin/sh echo "$0" >> /tmp/sysv.log finit-4.14/test/skel/etc/rcS.d/S01abc.sh0000755000175100001660000000005115054341541013244 #!/bin/sh echo "$0 $*" >> /tmp/sysv.log finit-4.14/test/skel/etc/rcS.d/S02def.sh0000755000175100001660000000005115054341541013256 #!/bin/sh echo "$0 $*" >> /tmp/sysv.log finit-4.14/test/skel/etc/env0000644000175100001660000000023115054341541011436 # Some environments to be sourced by Finit services # and their pre:- and post:scripts foo=bar baz=qux xyzzy=$foo FOO_ARGS="-i $foo -l $xyzzy endarg" finit-4.14/test/skel/etc/finit.d/0000755000175100001660000000000015054341601012337 5finit-4.14/test/skel/etc/finit.d/.empty0000644000175100001660000000000015054341541013407 finit-4.14/test/skel/etc/finit.d/enabled/0000755000175100001660000000000015054341601013731 5finit-4.14/test/skel/etc/finit.d/enabled/.empty0000644000175100001660000000000015054341541015001 finit-4.14/test/skel/etc/finit.d/available/0000755000175100001660000000000015054341601014257 5finit-4.14/test/skel/etc/finit.d/available/.empty0000644000175100001660000000000015054341541015327 finit-4.14/test/skel/etc/rc.d/0000755000175100001660000000000015054341601011632 5finit-4.14/test/skel/etc/rc.d/foo.sh0000755000175100001660000000005215054341541012674 #!/bin/sh echo "$0" >> /tmp/runparts.log finit-4.14/test/skel/etc/rc.d/test.sh0000755000175100001660000000005215054341541013070 #!/bin/sh echo "$0" >> /tmp/runparts.log finit-4.14/test/skel/etc/rc.d/S01abc.sh0000755000175100001660000000005515054341541013125 #!/bin/sh echo "$0 $*" >> /tmp/runparts.log finit-4.14/test/skel/etc/rc.d/S02def.sh0000755000175100001660000000005515054341541013137 #!/bin/sh echo "$0 $*" >> /tmp/runparts.log finit-4.14/test/skel/etc/inittab0000644000175100001660000000241215054341541012303 # /etc/inittab # # Copyright (C) 2001 Erik Andersen # # Note: BusyBox init doesn't support runlevels. The runlevels field is # completely ignored by BusyBox init. If you want runlevels, use # sysvinit. # # Format for each entry: ::: # # id == tty to run on, or empty for /dev/console # runlevels == ignored # action == one of sysinit, respawn, askfirst, wait, and once # process == program to run # Startup the system #::sysinit:/bin/mount -t proc proc /proc #::sysinit:/bin/mount -o remount,rw / #::sysinit:/bin/mkdir -p /dev/pts /dev/shm #::sysinit:/bin/mount -a #::sysinit:/bin/mkdir -p /run/lock/subsys #::sysinit:/sbin/swapon -a null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr ::sysinit:/bin/hostname -F /etc/hostname # now run any rc scripts ::sysinit:/etc/init.d/rcS # Put a getty on the serial port #ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL # Stuff to do for the 3-finger salute #::ctrlaltdel:/sbin/reboot # Stuff to do before rebooting ::shutdown:/etc/init.d/rcK #::shutdown:/sbin/swapoff -a #::shutdown:/bin/umount -a -r finit-4.14/test/skel/etc/fstab0000644000175100001660000000061415054341541011752 # tmpfs /tmp tmpfs mode=1777 0 0 mkdir#-p#-m0755 /tmp/etc.u helper none 0 0 mkdir#-p#-m0755 /tmp/etc.w helper none 0 0 tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0 tmpfs /var tmpfs mode=0777 0 0 # Each test needs a dedicated /etc for finit.conf etc. etc /etc overlay lowerdir=/etc,upperdir=/tmp/etc.u,workdir=/tmp/etc.w 0 0 finit-4.14/test/skel/sbin/0000755000175100001660000000000015054341601011164 5finit-4.14/test/skel/sbin/service.sh0000755000175100001660000000075715054341541013117 #!/bin/sh cleanup() { echo "Got signal, stopping ..." rm -f /run/service.pid exit 0 } reload() { echo echo "Ready." echo sleep 1 echo $$ > /run/service.pid } # Hook SIGUSR1 and dump trace to file system # shellcheck disable=SC2172 trap 'echo USR1 > /tmp/usr1.log' USR1 trap reload HUP trap cleanup INT trap cleanup TERM trap cleanup QUIT trap cleanup EXIT reload # sleep may exit on known signal, so # we cannot use 'set -e' while true; do sleep 1 done finit-4.14/test/skel/sbin/fail.sh0000755000175100001660000000017215054341541012361 #!/bin/sh # This run/task always fails, it is used by the run-restart-forever test echo "Aiiee, I've failed!" >&2 exit 1 finit-4.14/test/skel/sbin/chrootsetup.sh0000755000175100001660000000346115054341541014031 #!/bin/sh # Setup the things (mount /proc, /tmp, etc.) that needs to be set up from # within the namespace/chroot and then start PID 1. # # Copyright (c) 2021 Jacques de Laval # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. set -eu export PATH="$PATH":/usr/bin:/usr/sbin # It would have been nice to mount /dev as devtmpfs, but unfortunately # that's not possible if you're not privileged. For now tmpfs will # have to do. mount -n -t tmpfs none /dev # Silence BusyBox init touch /dev/null mount -t proc none /proc mount -t sysfs none /sys if [ "$(ls -A /tmp)" ]; then mkdir -p /tmp.shadow mount --bind /tmp /tmp.shadow mount -t tmpfs none /tmp cp -a /tmp.shadow/* /tmp/ else mount -t tmpfs none /tmp fi mkdir -p "$FINIT_RCSD" tty=/dev/$(cat /sys/class/tty/console/active) mkfifo "$tty" exec "$@" finit-4.14/test/skel/sbin/task.sh0000755000175100001660000000016715054341541012414 #!/bin/sh num=$(cat /run/task.state) if [ -z "$num" ]; then num=0 fi num=$((num + 1)) echo $num > /run/task.state finit-4.14/test/skel/var/0000755000175100001660000000000015054341601011021 5finit-4.14/test/skel/var/.empty0000644000175100001660000000000015054341541012071 finit-4.14/test/skel/cdrom/0000755000175100001660000000000015054341601011335 5finit-4.14/test/skel/cdrom/.empty0000644000175100001660000000000015054341541012405 finit-4.14/test/skel/run/0000755000175100001660000000000015054341601011035 5finit-4.14/test/skel/run/.empty0000644000175100001660000000000015054341541012105 finit-4.14/test/skel/home/0000755000175100001660000000000015054341601011161 5finit-4.14/test/skel/home/.empty0000644000175100001660000000000015054341541012231 finit-4.14/test/skel/bin/0000755000175100001660000000000015054341601011001 5finit-4.14/test/skel/bin/fail.sh0000755000175100001660000000003315054341541012172 #!/bin/sh sleep 2 exit 42 finit-4.14/test/skel/bin/post.sh0000755000175100001660000000034715054341541012254 #!/bin/sh marker="POST" # shellcheck disable=SC2154 if [ -n "$baz" ]; then marker=$baz fi echo "$marker" > /tmp/post echo "EXIT_CODE=$EXIT_CODE" >> /tmp/post echo "EXIT_STATUS=$EXIT_STATUS" >> /tmp/post finit-4.14/test/skel/bin/crasher.sh0000755000175100001660000000005115054341541012706 #!/bin/sh #sleep 2 kill -11 $$ exit 1 finit-4.14/test/skel/bin/busybox-x86_64.sha2560000644000175100001660000000012115054341541014277 297fee002c1a4dad65e98634880afb530637af5ec0659115bec5e487ea2cc384 busybox-x86_64 finit-4.14/test/skel/bin/ready.sh0000755000175100001660000000004515054341541012366 #!/bin/sh echo "READY" > /tmp/ready finit-4.14/test/skel/bin/pre.sh0000755000175100001660000000017115054341541012050 #!/bin/sh marker="PRE" # shellcheck disable=SC2154 if [ -n "$foo" ]; then marker=$foo fi echo "$marker" > /tmp/pre finit-4.14/test/skel/bin/slay0000755000175100001660000000162215054341541011623 #!/bin/sh nm=$1 getpid() { initctl status "$1" |awk '/PID :/{ print $3; }' } pid=$(getpid "$nm") if [ -f oldpid ]; then oldpid=$(cat oldpid) if [ "$oldpid" = "$pid" ]; then echo "Looks bad, wait for it ..." sleep 3 pid=$(getpid "$nm") if [ "$oldpid" = "$pid" ]; then echo "Finit did not deregister old PID $oldpid vs $pid" initctl status "$nm" ps echo "Reloading finit ..." initctl reload sleep 1 initctl status "$nm" exit 1 fi fi fi timeout=50 while [ "$pid" -le 1 ]; do sleep 0.1 pid=$(getpid "$nm") if [ "$pid" -le 1 ]; then timeout=$((timeout - 1)) if [ "$timeout" -gt 0 ]; then continue fi if [ $pid -ne 0 ]; then echo "Got a bad PID: $pid, aborting ..." ps sleep 1 initctl status "$nm" ps fi exit 1 fi break done echo "$pid" > /tmp/oldpid #echo "PID $pid, kill -9 ..." kill -9 "$pid" finit-4.14/test/skel/srv/0000755000175100001660000000000015054341601011043 5finit-4.14/test/skel/srv/.empty0000644000175100001660000000000015054341541012113 finit-4.14/test/skel/tmp/0000755000175100001660000000000015054341601011031 5finit-4.14/test/skel/tmp/.empty0000644000175100001660000000000015054341541012101 finit-4.14/test/skel/proc/0000755000175100001660000000000015054341601011174 5finit-4.14/test/skel/proc/.empty0000644000175100001660000000000015054341541012244 finit-4.14/test/skel/root/0000755000175100001660000000000015054341601011214 5finit-4.14/test/skel/root/.empty0000644000175100001660000000000015054341541012264 finit-4.14/test/skel/dev/0000755000175100001660000000000015054341601011007 5finit-4.14/test/skel/dev/pts/0000755000175100001660000000000015054341601011615 5finit-4.14/test/skel/dev/pts/.empty0000644000175100001660000000000015054341541012665 finit-4.14/test/skel/dev/shm/0000755000175100001660000000000015054341601011576 5finit-4.14/test/skel/dev/shm/.empty0000644000175100001660000000000015054341541012646 finit-4.14/test/skel/sys/0000755000175100001660000000000015054341601011047 5finit-4.14/test/skel/sys/.empty0000644000175100001660000000000015054341541012117 finit-4.14/test/add-remove-dynamic-service.sh0000755000175100001660000000105315054341541014657 #!/bin/sh set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say "Add a dynamic service in $FINIT_CONF" run "echo 'service [2345] kill:20 log service.sh -- Dyn service' > $FINIT_CONF" say 'Reload Finit' run "initctl reload" retry 'assert_num_children 1 service.sh' say 'Remove the dynamic service from /etc/finit.conf' run "echo > $FINIT_CONF" say 'Reload Finit' run "initctl reload" retry 'assert_num_children 0 service.sh' finit-4.14/test/start-stop-sysv.sh0000755000175100001660000000330415054341541012677 #!/bin/sh # shellcheck disable=2034 source=/dev/null set -eu STANZA1="sysv [2345] pid:!/run/service.pid name:service.sh log:stdout \ /etc/init.d/S01-service.sh -- SysV test service" STANZA2="sysv [2345] pid:!/run/service.pid name:service.sh log:stdout \ reload:'/etc/init.d/S01-service.sh reload' \ stop:'/etc/init.d/S01-service.sh stop' \ /etc/init.d/S01-service.sh -- SysV test service" STANZA3="sysv [2345] pid:!/run/service.pid name:service.sh log:stdout \ reload:'kill -HUP \\\$MAINPID' \ stop:'kill -TERM \\\$MAINPID' \ /etc/init.d/S01-service.sh -- SysV test service" TEST_DIR=$(dirname "$0") #DEBUG=1 test_teardown() { assert "Running test teardown." "run rm -f $FINIT_RCSD/service.conf" } test_one() { say "Add sysv stanza #1 in $FINIT_CONF" run "echo \"$1\" > $FINIT_RCSD/service.conf" say "Reload Finit" run "initctl reload" retry 'assert_num_children 1 service.sh' retry 'assert_cond service/service.sh/ready' sep 'Stop the sysv service' run "initctl stop service.sh" retry 'assert_num_children 0 service.sh' sep 'Start the sysv service again' run "initctl start service.sh" retry 'assert_num_children 1 service.sh' retry 'assert_cond service/service.sh/ready' sep 'Touch the sysv service' run "initctl touch service.conf" run "initctl reload" #run "initctl cond dump" retry 'assert_num_children 1 service.sh' retry 'assert_cond service/service.sh/ready' } . "$TEST_DIR/lib/setup.sh" sep "―― 1) Basic stop/start/HUP sysv daemon" test_one "$STANZA1" sep "―― 2) Custom stop/reload script" test_one "$STANZA2" sep "―― 3) Custom stop/start/reload with \$MAINPID" test_one "$STANZA3" return 0 finit-4.14/test/ready-serv.sh0000755000175100001660000000223215054341541011635 #!/bin/sh # Verify ready:script for pid/systemd/s6 style services set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } test_one() { service=$(echo "$1" | tr -s " ") file=/tmp/ready sep say "Add service stanza '$service' to $FINIT_CONF ..." run "echo '$service' > $FINIT_CONF" say 'Reload Finit' run "initctl reload" retry 'assert_num_children 1 serv' retry 'assert_ready "serv"' 5 1 # run "initctl status" # run "initctl cond dump" assert_file_contains "$file" "READY" run "rm -f $file" say 'Stop the service' run "initctl stop serv" retry 'assert_num_children 0 serv' say "Done, drop service from $FINIT_CONF ..." run "rm $FINIT_CONF" run "initctl reload" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" #run "initctl debug" test_one "service ready:/bin/ready.sh serv -np -- Native PID style notification" test_one "service notify:s6 ready:/bin/ready.sh serv -n -N %n -- s6 style notification" test_one "service notify:systemd ready:/bin/ready.sh serv -n -- systemd style notification" finit-4.14/test/failing-sysv.sh0000755000175100001660000000204115054341541012165 #!/bin/sh # Verify what happens when sysv scripts start services that keep # crashing -- hint: crashing sysv services should be detected by # Finit just like regular services. set -eu TEST_DIR=$(dirname "$0") test_setup() { run "mkdir -p /etc/default" } test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" # This instructs serv to check the environment, and exit # if it cannot find "xyzzy", thus triggering a premature # exit which Finit should act on to retstart it. say "Setting up bogus /etc/default/serv" run "echo 'SERV_ARGS=\"-e xyzzy:lives\"' > /etc/default/serv" say "Add sysv stanza to $FINIT_CONF" run "echo 'sysv restart:5 [2345] pid:!/run/serv.pid name:serv /etc/init.d/S02-serv.sh -- Crashing SysV service' > $FINIT_CONF" #run "initctl debug" say 'Reload Finit' run "initctl reload" #run "initctl status serv" #run "ps" say 'Pending sysv restarts by Finit ...' #run "initctl status serv" #run "ps" retry 'assert_restarts 5 serv' 20 1 return 0 finit-4.14/test/initctl-status-subset.sh0000755000175100001660000000214415054341541014050 #!/bin/sh # Verify that the status command 'initctl status foo' matches three # instances of tasks called foo:1, foo:2, and foo:3. It should not # match the fourth task called foobar. This is a regression test to # ensure issue #275 doesn't happen again. set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" } test_init() { run "echo '# Three foo and one bar enter Finit' > $FINIT_CONF" } test_add_one() { service=$1 say "Add service stanza '$service' to $FINIT_CONF ..." run "echo '$service' >> $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" test_init test_add_one "task manual:yes name:foo :1 serv -- Foo \#1" test_add_one "task manual:yes name:foo :2 serv -- Foo \#2" test_add_one "task manual:yes name:foo :3 serv -- Foo \#3" test_add_one "task manual:yes name:foobar serv -- Foobar" say 'Reload Finit' #run "initctl debug" run "initctl reload" run "initctl status" #run "initctl status" #run "ps" #run "initctl status serv" assert_num_services 3 foo assert_desc "Foobar" foobar assert_desc "Foo #1" foo:1 finit-4.14/test/add-remove-dynamic-service-sub-config.sh0000755000175100001660000000114615054341541016714 #!/bin/sh set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_RCSD/service.conf" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say "Add a dynamic service in $FINIT_RCSD/service.conf" run "echo 'service [2345] kill:20 log service.sh -- Dyn serv' > $FINIT_RCSD/service.conf" say 'Reload Finit' run "initctl reload" retry 'assert_num_children 1 service.sh' say 'Remove the dynamic service from /etc/finit.d/service.conf' run "echo > $FINIT_RCSD/service.conf" say 'Reload Finit' run "initctl reload" retry 'assert_num_children 0 service.sh' finit-4.14/test/start-kill-stop.sh0000755000175100001660000000252615054341541012633 #!/bin/sh # Regression test for Finit bug #313: # - services get the 'forking' flag on initctl reload # - stopping a crashing task while its restart callback is pending # causes state 'running' with pid:0 (i.e., not running at all.) # set -eu TEST_DIR=$(dirname "$0") test_teardown() { # run "initctl status -j serv" say "Running test teardown." run "rm -f $FINIT_CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say "Check deps ..." check_dep jq rm -f "$SYSROOT"/oldpid say "Add service stanza in $FINIT_CONF" run "echo 'service [2345] log:stderr serv -np -- Test service' > $FINIT_CONF" say 'Reload Finit' run "initctl reload" say 'Verify serv is running ...' retry 'assert_num_children 1 serv' say 'Verify reload does not change forking type of service' #run "initctl status -j serv" run "initctl reload" #run "initctl status -j serv" assert_forking serv false say 'Simulate service crash (kill -9 ..)' run "initctl debug" i=0 laps=7 while [ $i -lt $laps ]; do i=$((i + 1)) say "Lap $i/$laps, killing service ..." # we have this, no sleep needed run "slay serv" done say 'Verify stopping service actually stops it' sleep 1 run "initctl stop serv" sleep 5 #run "initctl status serv" assert_status serv stopped say 'Verify restarting service actually starts it' run "initctl start serv" retry 'assert_num_children 1 serv' finit-4.14/test/Makefile.am0000644000175100001660000001074415054341541011260 SUBDIRS = lib src EXTRA_DIST = skel/bin/busybox-x86_64.sha256 skel/sbin/service.sh skel/etc/env \ skel/bin/pre.sh skel/bin/post.sh skel/bin/ready.sh skel/bin/slay \ skel/sbin/fail.sh skel/usr/share/runparts/ref.log \ skel/usr/share/runparts/sysv.log \ skel/etc/rc.d/foo.sh skel/etc/rc.d/S01abc.sh \ skel/etc/rc.d/test.sh skel/etc/rc.d/S02def.sh \ skel/etc/rcS.d/foo.sh skel/etc/rcS.d/test.sh \ skel/etc/rcS.d/S01abc.sh skel/etc/rcS.d/S02def.sh \ skel/cdrom/.empty skel/dev/shm/.empty skel/dev/pts/.empty \ skel/etc/inittab skel/etc/hostname skel/etc/fstab \ skel/etc/init.d/rcS skel/etc/init.d/rcK skel/tmp/.empty \ skel/etc/finit.d/.empty skel/etc/finit.d/available/.empty \ skel/etc/finit.d/enabled/.empty \ skel/sbin/task.sh skel/bin/crasher.sh skel/bin/fail.sh \ skel/etc/init.d/S01-service.sh skel/etc/init.d/S02-serv.sh \ skel/proc/.empty skel/root/.empty skel/run/.empty \ skel/sbin/chrootsetup.sh skel/srv/.empty skel/sys/.empty \ skel/usr/bin/.empty skel/usr/lib/.empty skel/usr/sbin/.empty \ skel/home/.empty skel/usr/games/.empty skel/usr/src/.empty \ skel/usr/share/.empty skel/usr/include/.empty \ skel/usr/local/games/.empty skel/usr/local/sbin/.empty \ skel/usr/local/share/.empty skel/usr/local/src/.empty \ skel/usr/local/lib/.empty skel/usr/local/bin/.empty \ skel/usr/local/etc/.empty skel/var/.empty EXTRA_DIST += setup-sysroot.sh EXTRA_DIST += add-remove-dynamic-service.sh EXTRA_DIST += add-remove-dynamic-service-sub-config.sh EXTRA_DIST += bootstrap-crash.sh EXTRA_DIST += cond-start-task.sh EXTRA_DIST += crashing.sh EXTRA_DIST += depserv.sh EXTRA_DIST += devmon.sh EXTRA_DIST += failing-sysv.sh EXTRA_DIST += svc-env.sh EXTRA_DIST += global-envs.sh EXTRA_DIST += initctl-status-subset.sh EXTRA_DIST += notify.sh EXTRA_DIST += pidfile.sh EXTRA_DIST += pre-post-serv.sh EXTRA_DIST += pre-fail.sh EXTRA_DIST += process-depends.sh EXTRA_DIST += rclocal.sh EXTRA_DIST += ready-serv.sh EXTRA_DIST += restart-self.sh EXTRA_DIST += runlevel.sh EXTRA_DIST += run-restart-forever.sh EXTRA_DIST += run-task-tricks.sh EXTRA_DIST += runparts.sh EXTRA_DIST += sysvparts.sh EXTRA_DIST += start-stop-service.sh EXTRA_DIST += start-stop-service-sub-config.sh EXTRA_DIST += start-kill-service.sh EXTRA_DIST += start-kill-stop.sh EXTRA_DIST += start-stop-sysv.sh EXTRA_DIST += start-stop-serv.sh EXTRA_DIST += signal-service.sh EXTRA_DIST += testserv.sh EXTRA_DIST += unexpected-restart.sh AM_TESTS_ENVIRONMENT = SYSROOT='$(abs_builddir)/sysroot/'; AM_TESTS_ENVIRONMENT += export SYSROOT; AM_TESTS_ENVIRONMENT += export LD_LIBRARY_PATH; AM_TESTS_ENVIRONMENT += top_builddir=$(top_builddir); AM_TESTS_ENVIRONMENT += export top_builddir; TEST_EXTENSIONS = .sh TESTS = checkself.sh TESTS += add-remove-dynamic-service.sh TESTS += add-remove-dynamic-service-sub-config.sh TESTS += bootstrap-crash.sh TESTS += cond-start-task.sh TESTS += crashing.sh TESTS += depserv.sh TESTS += devmon.sh TESTS += failing-sysv.sh TESTS += svc-env.sh TESTS += global-envs.sh TESTS += initctl-status-subset.sh TESTS += notify.sh TESTS += pidfile.sh TESTS += pre-post-serv.sh TESTS += pre-fail.sh TESTS += process-depends.sh TESTS += rclocal.sh TESTS += ready-serv.sh TESTS += restart-self.sh TESTS += runlevel.sh TESTS += sysvparts.sh TESTS += run-restart-forever.sh TESTS += run-task-tricks.sh TESTS += runparts.sh TESTS += start-stop-service.sh TESTS += start-stop-service-sub-config.sh TESTS += start-kill-service.sh TESTS += start-kill-stop.sh TESTS += start-stop-sysv.sh TESTS += start-stop-serv.sh TESTS += signal-service.sh if TESTSERV TESTS += testserv.sh endif TESTS += unexpected-restart.sh check-recursive: setup-chroot .PHONY: checkself.sh checkself.sh: @echo '#!/bin/sh' > $@ @echo 'set -eu' >> $@ @echo 'cd "$$srcdir" 2>/dev/null || cd "." || exit 1' >> $@ @echo 'TESTS="$(filter %.sh,$(filter-out $@, $(TESTS)))"' >> $@ @echo 'shellcheck $$TESTS' >> $@ @chmod 0755 $@ .PHONY: setup-chroot setup-chroot: @SYSROOT='$(abs_builddir)/sysroot/' srcdir=$(srcdir) top_builddir=$(top_builddir) $(srcdir)/setup-sysroot.sh clean-local: -rm -rf $(builddir)/sysroot/ -rm -f checkself.sh finit-4.14/test/crashing.sh0000755000175100001660000000222615054341541011355 #!/bin/sh # Verifies that Finit calls post:script for crashing services set -eu TEST_DIR=$(dirname "$0") test_teardown() { say "Running test teardown." run "rm -f $FINIT_CONF" "/tmp/post" } crashit() { nm=$1 say 'Simulate service crash (kill -9 ..)' i=0 laps=100 while [ $i -lt $laps ]; do i=$((i + 1)) say "Lap $i/$laps, killing service $nm ..." # we have this, no sleep needed if ! run "slay $nm"; then break; fi done } test_one() { type=$1 shift nm=$1 shift args=$* say "Add service stanza in $FINIT_CONF" run "echo service log:stderr oncrash:script post:/bin/post.sh $nm $args > $FINIT_CONF" say 'Reload Finit' run "initctl reload" if [ "$type" = "sig" ]; then retry "assert_num_children 1 $nm" run "initctl status $nm" crashit "$nm" fi retry "assert_status $nm crashed" 500 run "cat /tmp/post" assert_file_contains "/tmp/post" "POST" run "rm -f /tmp/post" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" #run "initctl debug" test_one sig service.sh " -- Test crashing service.sh" test_one app serv "-np -c -- Test crashing serv" finit-4.14/test/unexpected-restart.sh0000755000175100001660000000337715054341541013415 #!/bin/sh # A service (B) going into flux, 'initctl reload' with no changes to # activate, should do not cause ripple effects removing any service # conditions, e.g., . During reload all services # are paused while Finit checks for any service3 changes to activate, # which may mean stopping or restarting existing services. # # Issue #382 set -e #DEBUG=true TEST_DIR=$(dirname "$0") test_setup() { run "cat >> $FINIT_CONF" < name:B serv -np -i B -- B needs A (systemd) service log:stdout notify:s6 name:C serv -np -i C -N %n -- C needs B (s6) service log:stdout notify:none name:D type:forking serv -i D -- D needs A (forking) task name:allup initctl cond set allup -- Everything is up EOF } pidof() { texec initctl -j status "$1" | jq .pid } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" sep "$FINIT_CONF" run "cat $FINIT_CONF" sep run "initctl reload" run "initctl status" run "initctl cond dump" sep run "initctl debug" say "waiting for primary startup to complete" retry 'assert_status allup "done"' 10 1 assert_status C "running" oldpid=$(pidof C) sep "pre-reload status" run "initctl status" run "initctl cond dump" sep say "Reload Finit, who gets restarted?" #run "initctl debug" run "initctl reload" sleep 2 sep "post-reload status" run "initctl status" run "initctl cond dump" sep assert_status A "running" assert_status B "running" assert_status C "running" newpid=$(pidof C) # shellcheck disable=SC2086 assert "C was not restarted" $oldpid -eq $newpid finit-4.14/test/lib/0000755000175100001660000000000015054341601010041 5finit-4.14/test/lib/setup.sh0000755000175100001660000002023215054341541011462 #!/bin/sh # Small framework for executing tests in a test environment. # # Copyright (c) 2021 Jacques de Laval # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. assert_file_contains() { assert "File $1 contains the string $2" "$(texec grep "$2" "$1")" } assert_num_children() { assert "$1 services are running" "$(texec pgrep -P 1 "$2" | wc -l)" -eq "$1" } assert_num_services() { assert "$1 services are loaded" "$(texec initctl -t status "$2" | wc -l)" -eq "$1" } assert_forking() { assert "service $1 forking:$2" "$(texec initctl -j status "$1" | jq -M .forking)" = "$2" } assert_nopid() { assert "service $1 pid:0" "$(texec initctl -j status "$1" | jq -M .pid)" -eq 0 } # shellcheck disable=SC2086 assert_new_pid() { assert "Finit has registered new PID" "$(texec initctl |grep $1 | awk '{print $1;}')" -eq "$(texec cat $2)" } assert_pidiff() { assert "PID has changed (old PID $2)" "$(texec initctl |awk -v svc="$1" '$0 ~ svc {print $1}')" -ne "$2" } assert_restarts() { assert "Finit has registered restarts" "$(texec initctl status "$2" | awk '/Restarts/{print $3;}')" -ge "$1" } assert_restart_cnt() { assert "Finit restart total $1 cnt $2" "$(texec initctl status "$3" | awk '/Restarts/{print $3 $4;}')" = "$1($2)" } assert_norestart() { assert "Service $1 is stable, no restarts" "$(texec initctl status "$1" | awk '/Restarts/{print $3;}')" -eq "0" } assert_desc() { assert "Service description == $1" "$(texec initctl status "$2" | grep 'Description' | sed 's/Description : //')" = "$1" } assert_status() { service=$1 status=$2 assert "Service $service $status" "$(texec initctl -p status "$service" | awk '/Status/{print $3}')" = "$status" } # Used by, e.g., pre-fail.sh assert_status_full() { service=$1; shift status="$*" assert "Service $service status is: $status" "$(texec initctl -p status "$service" | awk '/Status/{sub("^ *Status : ", ""); print}')" = "$status" } assert_cond() { cond=$1 assert "Condition $cond asserted" "$(texec initctl -v cond get "$cond")" = "on" } assert_nocond() { cond=$1 assert "Condition $cond cleared" "$(texec initctl -v cond get "$cond")" = "off" } assert_ready() { srv=$1 cond="service/$srv/ready" assert "$cond asserted" "$(texec initctl cond dump |grep "<$cond>" |awk '{print $3}')" = "on" } assert_is_pidfile() { assert "Process has PID file: $2" "$(texec initctl -p status "$1" | awk '/PID file/{print $4}')" = "$2" } # shellcheck disable=SC2086 assert_has_pidfile() { assert "Process has PID file" "$(texec find $1 2>/dev/null)" } # shellcheck disable=SC2154 texec() { "$TEST_DIR/lib/exec.sh" "$finit_pid" "$@" } run() { texec sh -c "$@" } pause() { echo "Press any key to continue... " read -r REPLY } toggle_finit_debug() { say 'Toggle finit debug' texec initctl debug sleep 0.5 } color_reset='\e[0m' fg_red='\e[1;31m' fg_green='\e[1;32m' fg_yellow='\e[1;33m' log() { test=$(basename "$0" ".sh") printf "\e[2m[%s]\e[0m %b%b%b %s\n" "$test" "$1" "$2" "$color_reset" "$3" } sep() { heading=${1:-} if [ -n "$heading" ]; then num=$((72 - ${#heading} - 1)) printf "\e[1m%s " "$heading" printf -- "―%.0s" $(seq 1 $num) printf "\e[0m\n" else printf "\e[1m――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――\e[0m\n" fi } say() { log "$fg_yellow" • "$@" } skip() { log "$fg_yellow" − "$*" exit 77 } fail() { log "$fg_red" ✘ "$*" exit 99 } # shellcheck disable=SC2068 check_dep() { if ! command -v "$1"; then skip "Cannot find $1, skipping test." fi } assert() { __assert_msg=$1 shift if [ ! "$@" ]; then log "$fg_red" ✘ "$__assert_msg ($*)" return 1 fi log "$fg_green" ✔ "$__assert_msg" return 0 } retry() { __retry_cmd=$1 shift case "$#" in 2) __retry_n=$1 __retry_sleep=$2 ;; 1) __retry_n=$1 __retry_sleep=0.1 ;; *) __retry_n=50 __retry_sleep=0.1 ;; esac for _ in $(seq 1 "$__retry_n"); do sleep "$__retry_sleep" __retry_cmd_out=$(eval "$__retry_cmd") && \ echo "$__retry_cmd_out" && \ return 0 done __retry_cmd_exit="$?" echo "$__retry_cmd_out" return "$__retry_cmd_exit" } wdstart() { ( sleep "$1" if ps -p "$finit_pid" > /dev/null; then kill -9 "$finit_pid" 2>/dev/null fi ) & wdpid=$! } wdkill() { say "Stopping test watchdog, pid $wdpid" kill -KILL $wdpid } teardown() { test_status="$?" echo "Test done $(date)" wdkill if type test_teardown > /dev/null 2>&1 ; then test_teardown fi log "$color_reset" '--' '' if [ "$test_status" -eq 0 ]; then log "$fg_green" 'TEST PASS' '' elif [ "$test_status" -eq 77 ]; then log "$fg_yellow" 'TEST SKIP' '' else log "$fg_red" 'TEST FAIL' '' fi set +e say "Telling Finit to shut down (set -$-) ..." while [ -n "${finit_pid+x}" ]; do if ! kill -USR2 "${finit_pid}" 2>/dev/null; then break fi say "Retrying shutdown ..." sleep 1 done say "Waiting for Finit to shut down ..." wait say "Final cleanup ..." rm -f "$SYSROOT"/running_test.pid rm -f "$SYSROOT$FINIT_CONF" rm -f "$SYSROOT/etc/rc.local" say "EXIT: $test_status" exit $test_status } trap teardown EXIT SYSROOT="${SYSROOT:-$(pwd)/${TEST_DIR}/sysroot}" export SYSROOT TEST_TIMEOUT=300 # shellcheck source=/dev/null . "$SYSROOT/../test.env" # Setup test environment if [ -n "${DEBUG:-}" ]; then FINIT_ARGS="${FINIT_ARGS:-} finit.debug=on" fi # Tests may want to override runlevel if [ -n "${FINIT_RUNLEVEL:-}" ]; then FINIT_ARGS="${FINIT_ARGS:-} $FINIT_RUNLEVEL" else FINIT_RUNLEVEL=2 fi set +u rm -f "$SYSROOT$FINIT_CONF" touch "$SYSROOT$FINIT_CONF" if [ -n "$BOOTSTRAP" ]; then say "Setting up bootstrap tasks ..." echo "$BOOTSTRAP" >> "$SYSROOT$FINIT_CONF" fi if [ -n "$RUNPARTS" ]; then say "Setting up runparts task ..." echo "runparts /etc/rc.d" >> "$SYSROOT$FINIT_CONF" mkdir "$SYSROOT/etc/rc.d" echo "$RUNPARTS" > "$SYSROOT/etc/rc.d/start.sh" chmod +x "$SYSROOT/etc/rc.d/start.sh" fi if [ -n "$RCLOCAL" ]; then while [ -f "$SYSROOT/etc/rc.local" ]; do echo "$SYSROOT/etc/rc.local busy ... waiting ..." sleep 1 done say "Setting up /etc/rc.local ..." echo "$RCLOCAL" > "$SYSROOT/etc/rc.local" chmod +x "$SYSROOT/etc/rc.local" fi set -u # shellcheck disable=2086 "$TEST_DIR/lib/start.sh" finit ${FINIT_ARGS:-} & finit_ppid=$! echo "$finit_ppid" > "$SYSROOT"/running_test.pid #>&2 echo "Hint: Execute 'SYSROOT=$SYSROOT $TEST_DIR/lib/enter.sh' to enter the test namespace" log "$color_reset" 'Setup of test environment done, waiting for Finit ...' '' finit_pid=$(retry "pgrep -P $finit_ppid") echo "Finit running as PID $finit_pid" #tty=/dev/$(texec cat /sys/class/tty/console/active) #texec cat "$tty" & sep "Test start $(date)" # Allow Finit to start up properly before launching the test i=0 set +u while [ -z "$BOOTSTRAP" ] && [ $i -lt 10 ]; do lvl=$(texec sh -c "initctl runlevel | awk '{print \$2;}'") if [ "$lvl" = "$FINIT_RUNLEVEL" ]; then say "Reached runlevel $FINIT_RUNLEVEL, releasing test." break; fi i=$((i + 1)) sleep 1 done set -u if type test_setup > /dev/null 2>&1 ; then test_setup fi wdstart $TEST_TIMEOUT finit-4.14/test/lib/exec.sh0000755000175100001660000000335115054341541011251 #!/bin/sh # Execute a given command from within the test environment. # # Copyright (c) 2021 Jacques de Laval # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. set -eu if [ "$#" -lt 2 ]; then echo "Usage:" echo " $0 [target-pid] [command [arguments]]" exit 1 fi target="$1" shift TEST_DIR=$(dirname "$0"../) SYSROOT="${SYSROOT:-$(pwd)/${TEST_DIR}/sysroot}" nsenter=$(command -v nsenter) chroot=$(command -v chroot) export PS1='\w \$ ' export PS2='> ' export PS3='#? ' export PS4='+ ' PATH="$TESTENV_PATH" export PATH "$nsenter" \ --preserve-credentials \ --user \ --mount \ --uts \ --ipc \ --net \ --pid \ -w -t "$target" \ "$chroot" "$SYSROOT" "$@" finit-4.14/test/lib/sysroot.mk0000644000175100001660000000574315054341541012050 # Root file system for test environment. # # Copyright (c) 2021 Jacques de Laval # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. srcdir ?= ../ SKEL ?= $(srcdir)/skel DEST ?= ../sysroot CACHE ?= ~/.cache ARCH ?= x86_64 FINITBIN ?= ./sbin/finit BBVER ?= 1_35_0 BBBIN = busybox-$(ARCH) BBHOME ?= https://github.com/troglobit/busybox-builder/releases/download BBURL ?= $(BBHOME)/$(BBVER)/$(BBBIN) _libs_src = $(shell ldd $(FINITBIN) | grep -Eo '/[^ ]+') libs = $(foreach path,$(_libs_src),$(abspath $(DEST))$(path)) all: $(libs) $(DEST)/bin/$(BBBIN) @(cd $(DEST); \ for prg in `./bin/$(BBBIN) --list-full`; do \ case $$prg in \ usr/bin/* | usr/sbin/*) \ ln -sf ../../bin/$(BBBIN) $$prg;; \ bin/* | sbin/*) \ ln -sf ../bin/$(BBBIN) $$prg;; \ *) \ ln -sf bin/$(BBBIN) $$prg;; \ esac; \ done) $(DEST)/bin/$(BBBIN).sha256: @mkdir -p $(DEST) @cp -a $(SKEL)/* $(DEST)/ @chmod -R u+w $(DEST)/ @find $(DEST) -name .empty -delete $(DEST)/bin/$(BBBIN): $(DEST)/bin/$(BBBIN).sha256 @(cd $(dir $@); \ if ! sha256sum --status -c $(BBBIN).sha256 2>/dev/null; then \ if [ -d $(CACHE) ]; then \ echo "Cannot find $(BBBIN), checking $(CACHE) ..."; \ cd $(CACHE); \ cp -v $(DEST)/bin/$(BBBIN).sha256 .; \ if ! sha256sum --status -c $(BBBIN).sha256; then \ echo "No $(BBBIN), downloading $(BBURL) ..."; \ wget -O $(BBBIN) $(BBURL); \ else \ echo "Found valid $(BBBIN) in cache!"; \ fi; \ cp $(BBBIN) $@; \ cd $(dir $@); \ else \ echo "Cannot find $(BBBIN), downloading ..."; \ wget -O $@ $(BBURL); \ fi; \ sha256sum -c $(BBBIN).sha256 || (rm $@; false); \ fi) @chmod +x $@ $(libs): $(DEST)/bin/$(BBBIN).sha256 mkdir -p $(dir $@) cp $(patsubst $(abspath $(DEST))%,%,$@) $@ finit-4.14/test/lib/Makefile.in0000644000175100001660000003056115054341567012046 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = test/lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_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) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ EXTRA_DIST = exec.sh setup.sh start.sh sysroot.mk all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir 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-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/test/lib/start.sh0000755000175100001660000000327215054341541011464 #!/bin/sh # Start a new test environment. # # Copyright (c) 2021 Jacques de Laval # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. set -eu TEST_DIR=$(dirname "$0"../) SYSROOT="${SYSROOT:-$(pwd)/${TEST_DIR}/sysroot}" unshare=$(command -v unshare) chroot=$(command -v chroot) export container="unshare" export PS1='\w \$ ' export PS2='> ' export PS3='#? ' export PS4='+ ' PATH="$TESTENV_PATH" export PATH # Not supported by Busybox unshare: # --cgroup --time exec "$unshare" \ --user --map-root-user --map-auto \ --fork --pid --mount-proc \ --mount \ --mount-proc \ --uts --ipc --net \ "$chroot" "$SYSROOT" /sbin/chrootsetup.sh "$@" finit-4.14/test/lib/Makefile.am0000644000175100001660000000006315054341541012017 EXTRA_DIST = exec.sh setup.sh start.sh sysroot.mk finit-4.14/test/runlevel.sh0000755000175100001660000000050515054341541011411 #!/bin/sh # Verify selecting alternate runlevel from cmdline # shellcheck disable=SC2034 set -eu TEST_DIR=$(dirname "$0") FINIT_RUNLEVEL=9 # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" say 'Check runlevel' lvl=$(run "initctl runlevel | awk '{print \$2;}'") if [ "$lvl" -eq "9" ]; then return 0 fi return 1 finit-4.14/configure0000755000175100001660000201271515054341566010165 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for Finit 4.14. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (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 case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; 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 # The user is always right. if ${PATH_SEPARATOR+false} :; 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 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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 done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (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 case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: https://github.com/troglobit/finit/issues about your $0: system, including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $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" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # 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 : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # 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 : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. 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 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # 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*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) 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 else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Finit' PACKAGE_TARNAME='finit' PACKAGE_VERSION='4.14' PACKAGE_STRING='Finit 4.14' PACKAGE_BUGREPORT='https://github.com/troglobit/finit/issues' PACKAGE_URL='https://troglobit.com/projects/finit/' ac_unique_file="src/finit.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS BASH_DIR system_path finit_tmpfiles tmpfiles_path plugin_path pkglibexecdir TESTSERV_FALSE TESTSERV_TRUE CONTRIB_FALSE CONTRIB_TRUE DOC_FALSE DOC_TRUE LIBSYSTEMD_FALSE LIBSYSTEMD_TRUE WATCHDOGD_FALSE WATCHDOGD_TRUE SULOGIN_FALSE SULOGIN_TRUE KEVENTD_FALSE KEVENTD_TRUE STATIC_FALSE STATIC_TRUE BASH_FALSE BASH_TRUE FINIT_RCSD FINIT_CONF BASH_COMPLETION_LIBS BASH_COMPLETION_CFLAGS LOGROTATE_FALSE LOGROTATE_TRUE BUILD_TESTSERV_PLUGIN_FALSE BUILD_TESTSERV_PLUGIN_TRUE BUILD_URANDOM_PLUGIN_FALSE BUILD_URANDOM_PLUGIN_TRUE BUILD_TTY_PLUGIN_FALSE BUILD_TTY_PLUGIN_TRUE BUILD_RTC_PLUGIN_FALSE BUILD_RTC_PLUGIN_TRUE BUILD_HOTPLUG_PLUGIN_FALSE BUILD_HOTPLUG_PLUGIN_TRUE BUILD_HOOK_SCRIPTS_PLUGIN_FALSE BUILD_HOOK_SCRIPTS_PLUGIN_TRUE BUILD_NETLINK_PLUGIN_FALSE BUILD_NETLINK_PLUGIN_TRUE BUILD_X11_COMMON_PLUGIN_FALSE BUILD_X11_COMMON_PLUGIN_TRUE BUILD_RESOLVCONF_PLUGIN_FALSE BUILD_RESOLVCONF_PLUGIN_TRUE BUILD_MODPROBE_PLUGIN_FALSE BUILD_MODPROBE_PLUGIN_TRUE BUILD_MODULES_LOAD_PLUGIN_FALSE BUILD_MODULES_LOAD_PLUGIN_TRUE BUILD_DBUS_PLUGIN_FALSE BUILD_DBUS_PLUGIN_TRUE BUILD_ALSA_UTILS_PLUGIN_FALSE BUILD_ALSA_UTILS_PLUGIN_TRUE lite_LIBS lite_CFLAGS uev_LIBS uev_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_shared enable_static with_aix_soname enable_fast_install with_pic enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_auto_reload enable_kernel_cmdline enable_fastboot enable_fsckfix enable_cgroup enable_redirect enable_kernel_logging enable_logrotate enable_doc enable_contrib enable_rescue enable_all_plugins enable_alsa_utils_plugin enable_dbus_plugin enable_modules_load_plugin enable_modprobe_plugin enable_resolvconf_plugin enable_x11_common_plugin enable_netlink_plugin enable_hook_scripts_plugin enable_hotplug_plugin enable_rtc_plugin enable_tty_plugin enable_urandom_plugin enable_testserv_plugin with_bash_completion_dir with_fstab with_heading with_config with_rcsd with_rc_local with_sysconfig with_group with_hostname with_runlevel with_random_seed with_keventd with_sulogin with_watchdog with_libsystemd with_hook_scripts_path with_plugin_path with_rtc_date with_rtc_file ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR uev_CFLAGS uev_LIBS lite_CFLAGS lite_LIBS BASH_COMPLETION_CFLAGS BASH_COMPLETION_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Finit 4.14 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/finit] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Finit 4.14:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=no] --enable-fast-install[=PKGS] optimize for fast installation [default=no] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --enable-auto-reload Automatic reload on any .conf change --enable-kernel-cmdline Parse init args from /proc/cmdline (don't use!) --enable-fastboot Skip fsck check on filesystems listed in /etc/fstab --enable-fsckfix Run fsck fix mode (options: -yf) on filesystems listed in /etc/fstab --disable-cgroup Disable cgroup v2 support, default: autodetect from /sys/fs/cgroup --disable-redirect Disable redirection of service output to /dev/null --disable-kernel-logging Disable kernel logging to console (use 'quiet' instead! --disable-logrotate Disable built-in rotation of /var/log/wtmp --disable-doc Disable build and install of doc/ section --disable-contrib Disable build and install of contrib section --disable-rescue Disable potentially unsafe rescue mode --enable-all-plugins Enable all plugins, default: auto Optional Plugins: --enable-alsa-utils-plugin Save and restore ALSA sound settings using alsactl --enable-dbus-plugin Setup and start system message bus, D-Bus --enable-modules-load-plugin Scans /etc/modules-load.d for modules to load --enable-modprobe-plugin Coldplug modules using modalias magic --enable-resolvconf-plugin Setup necessary files for resolvconf --enable-x11-common-plugin Console setup (for X) --disable-netlink-plugin Basic netlink plugin for IFUP/IFDN and GW events. Can be replaced with externally built plugin that links with libnl or similar. --enable-hook-scripts-plugin Trigger script execution from hook points --disable-hotplug-plugin Start udevd or mdev kernel event datamon --disable-rtc-plugin Save and restore RTC using hwclock --disable-tty-plugin Automatically activate new TTYs, e.g. USB-to-serial --disable-urandom-plugin Setup and save random seed at boot/shutdown --enable-testserv-plugin Test plugin to start test serv daemon Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=both]. --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-bash-completion-dir=PATH Directory to install Bash completion, default: auto --with-fstab=FILE System default fstab, default $sysconfdir/fstab --with-heading=GREET Heading for boot progress. Default: PRETTY_NAME from /etc/os-release, fallback to "Finit vX.YY" --with-config=CONFIG Finit bootstrap config file, default /etc/finit.conf --with-rcsd=DIR Finit rcS.d/ directory, default /etc/finit.d --with-rc-local=FILE SysV init /etc/rc.local file, default /etc/rc.local --with-sysconfig=DIR System environment directory, sourced by .conf files, default /etc/default & /etc/conf.d --with-group=NAME Group for /run/finit/socket (initctl), default: root --with-hostname=NAME If /etc/hostname is missing, default: noname --with-runlevel=N Runlevel to switch to after bootstrap [1-9], default: 2 --with-random-seed=FILE Save a random seed for /dev/urandom across reboots, default /var/lib/misc/random-seed --with-keventd Enable built-in keventd, default: no --with-sulogin[=USER] Enable built-in sulogin, optional USER to request password for (default root), default: no. --with-watchdog[=DEV] Enable built-in watchdog, default: /dev/watchdog --with-libsystemd Build replacement libsystemd library, default: yes --with-hook-scripts-path=DIR Base directory for hook scripts, default $libexecdir/finit/hook --with-plugin-path=DIR Search path for external plugins, default /usr/lib/finit/plugins:/usr/local/lib/finit/plugins --with-rtc-date=DATE If RTC date/time is too old, restore to DATE, format "YYYY-MM-DD HH:MM:SS", default "2000-01-01 00:00:00" --with-rtc-file=FILE If RTC is missing, save and restore system clock from this file, default: no Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory LT_SYS_LIBRARY_PATH User-defined run-time library search path. PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path uev_CFLAGS C compiler flags for uev, overriding pkg-config uev_LIBS linker flags for uev, overriding pkg-config lite_CFLAGS C compiler flags for lite, overriding pkg-config lite_LIBS linker flags for lite, overriding pkg-config BASH_COMPLETION_CFLAGS C compiler flags for BASH_COMPLETION, overriding pkg-config BASH_COMPLETION_LIBS linker flags for BASH_COMPLETION, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . Finit home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. 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|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$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/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Finit configure 4.14 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 printf %s "checking for uint$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : else $as_nop break fi done fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Finit $as_me 4.14, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="compile config.guess config.sub ltmain.sh missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}/aux" # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='finit' VERSION='4.14' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ac_config_headers="$ac_config_headers config.h" ac_config_files="$ac_config_files Makefile contrib/Makefile contrib/alpine/Makefile contrib/alpine/finit.d/Makefile contrib/alpine/finit.d/available/Makefile contrib/debian/Makefile contrib/debian/finit.d/Makefile contrib/debian/finit.d/available/Makefile contrib/void/Makefile contrib/void/finit.d/Makefile contrib/void/finit.d/available/Makefile doc/Makefile doc/config/Makefile libsystemd/Makefile libsystemd/libsystemd.pc man/Makefile plugins/Makefile src/Makefile system/Makefile system/10-hotplug.conf test/test.env test/Makefile test/lib/Makefile test/src/Makefile tmpfiles.d/Makefile" # Older versions of autoconf (<2.58) do not have AC_CONFIG_MACRO_DIR() #m4_include([m4/plugin.m4]) #m4_include([m4/expand.m4]) # Handle building plugins either as dynamically loadable, or built-in case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.7' macro_revision='2.4.7' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else $as_nop i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else $as_nop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ld_reload_flag='-r' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. set dummy ${ac_tool_prefix}file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FILECMD="${ac_tool_prefix}file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_FILECMD"; then ac_ct_FILECMD=$FILECMD # Extract the first word of "file", so it can be a program name with args. set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_FILECMD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_FILECMD"; then ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_FILECMD="file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD if test -n "$ac_ct_FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 printf "%s\n" "$ac_ct_FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_FILECMD" = x; then FILECMD=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac FILECMD=$ac_ct_FILECMD fi else FILECMD="$ac_cv_prog_FILECMD" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else $as_nop with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else $as_nop lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else $as_nop lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi # Set options # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop enable_shared=yes fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop enable_static=no fi enable_dlopen=yes shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else $as_nop if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_with_aix_soname=both fi with_aix_soname=$lt_cv_with_aix_soname fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop enable_fast_install=no fi enable_win32_dll=no # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop pic_mode=default fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else $as_nop lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else $as_nop ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else $as_nop lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char shl_load (); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else $as_nop ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else $as_nop ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else $as_nop ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dld_link (); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else $as_nop ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # Configuration. ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes then : printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "mntent.h" "ac_cv_header_mntent_h" "$ac_includes_default" if test "x$ac_cv_header_mntent_h" = xyes then : printf "%s\n" "#define HAVE_MNTENT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" if test "x$ac_cv_header_sys_sysmacros_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SYSMACROS_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" if test "x$ac_cv_func_strstr" = xyes then : printf "%s\n" "#define HAVE_STRSTR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt" if test "x$ac_cv_func_getopt" = xyes then : printf "%s\n" "#define HAVE_GETOPT 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getmntent" "ac_cv_func_getmntent" if test "x$ac_cv_func_getmntent" = xyes then : printf "%s\n" "#define HAVE_GETMNTENT 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getmntent_r" "ac_cv_func_getmntent_r" if test "x$ac_cv_func_getmntent_r" = xyes then : printf "%s\n" "#define HAVE_GETMNTENT_R 1" >>confdefs.h fi # Check for uint[8,16,32]_t ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) printf "%s\n" "#define _UINT8_T 1" >>confdefs.h printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h ;; esac ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) printf "%s\n" "#define _UINT32_T 1" >>confdefs.h printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h ;; esac # Check for pkg-config first, warn if it's not installed if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else $as_nop case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 printf "%s\n" "$PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else $as_nop case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi # Check for required libraries pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuev >= 2.2.0" >&5 printf %s "checking for libuev >= 2.2.0... " >&6; } if test -n "$uev_CFLAGS"; then pkg_cv_uev_CFLAGS="$uev_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuev >= 2.2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libuev >= 2.2.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_uev_CFLAGS=`$PKG_CONFIG --cflags "libuev >= 2.2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$uev_LIBS"; then pkg_cv_uev_LIBS="$uev_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuev >= 2.2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libuev >= 2.2.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_uev_LIBS=`$PKG_CONFIG --libs "libuev >= 2.2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then uev_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libuev >= 2.2.0" 2>&1` else uev_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libuev >= 2.2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$uev_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libuev >= 2.2.0) were not met: $uev_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables uev_CFLAGS and uev_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables uev_CFLAGS and uev_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else uev_CFLAGS=$pkg_cv_uev_CFLAGS uev_LIBS=$pkg_cv_uev_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libite >= 2.2.0" >&5 printf %s "checking for libite >= 2.2.0... " >&6; } if test -n "$lite_CFLAGS"; then pkg_cv_lite_CFLAGS="$lite_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libite >= 2.2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libite >= 2.2.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_lite_CFLAGS=`$PKG_CONFIG --cflags "libite >= 2.2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$lite_LIBS"; then pkg_cv_lite_LIBS="$lite_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libite >= 2.2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libite >= 2.2.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_lite_LIBS=`$PKG_CONFIG --libs "libite >= 2.2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then lite_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libite >= 2.2.0" 2>&1` else lite_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libite >= 2.2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$lite_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libite >= 2.2.0) were not met: $lite_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables lite_CFLAGS and lite_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables lite_CFLAGS and lite_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else lite_CFLAGS=$pkg_cv_lite_CFLAGS lite_LIBS=$pkg_cv_lite_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi # Check for configured Finit features # Check whether --enable-auto_reload was given. if test ${enable_auto_reload+y} then : enableval=$enable_auto_reload; else $as_nop enable_auto_reload=no fi # Check whether --enable-kernel_cmdline was given. if test ${enable_kernel_cmdline+y} then : enableval=$enable_kernel_cmdline; else $as_nop enable_kernel_cmdline=no fi # Check whether --enable-fastboot was given. if test ${enable_fastboot+y} then : enableval=$enable_fastboot; else $as_nop enable_fastboot=no fi # Check whether --enable-fsckfix was given. if test ${enable_fsckfix+y} then : enableval=$enable_fsckfix; else $as_nop enable_fsckfix=no fi # Check whether --enable-cgroup was given. if test ${enable_cgroup+y} then : enableval=$enable_cgroup; else $as_nop enable_cgroup=yes fi # Check whether --enable-redirect was given. if test ${enable_redirect+y} then : enableval=$enable_redirect; else $as_nop enable_redirect=yes fi # Check whether --enable-kernel_logging was given. if test ${enable_kernel_logging+y} then : enableval=$enable_kernel_logging; else $as_nop enable_kernel_logging=yes fi # Check whether --enable-logrotate was given. if test ${enable_logrotate+y} then : enableval=$enable_logrotate; else $as_nop enable_logrotate=yes fi # Check whether --enable-doc was given. if test ${enable_doc+y} then : enableval=$enable_doc; else $as_nop enable_doc=yes fi # Check whether --enable-contrib was given. if test ${enable_contrib+y} then : enableval=$enable_contrib; else $as_nop enable_contrib=yes fi # Check whether --enable-rescue was given. if test ${enable_rescue+y} then : enableval=$enable_rescue; else $as_nop enable_rescue=yes fi # Check for extra plugins to enable # Check whether --enable-all_plugins was given. if test ${enable_all_plugins+y} then : enableval=$enable_all_plugins; enable_all_plugins=$enableval else $as_nop enable_all_plugins=auto fi # Check whether --enable-alsa-utils-plugin was given. if test ${enable_alsa_utils_plugin+y} then : enableval=$enable_alsa_utils_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xno" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_ALSA_UTILS_PLUGIN 1" >>confdefs.h plugins="alsa-utils $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_ALSA_UTILS_PLUGIN_TRUE= BUILD_ALSA_UTILS_PLUGIN_FALSE='#' else BUILD_ALSA_UTILS_PLUGIN_TRUE='#' BUILD_ALSA_UTILS_PLUGIN_FALSE= fi # Check whether --enable-dbus-plugin was given. if test ${enable_dbus_plugin+y} then : enableval=$enable_dbus_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xno" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_DBUS_PLUGIN 1" >>confdefs.h plugins="dbus $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_DBUS_PLUGIN_TRUE= BUILD_DBUS_PLUGIN_FALSE='#' else BUILD_DBUS_PLUGIN_TRUE='#' BUILD_DBUS_PLUGIN_FALSE= fi # Check whether --enable-modules-load-plugin was given. if test ${enable_modules_load_plugin+y} then : enableval=$enable_modules_load_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xno" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_MODULES_LOAD_PLUGIN 1" >>confdefs.h plugins="modules-load $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_MODULES_LOAD_PLUGIN_TRUE= BUILD_MODULES_LOAD_PLUGIN_FALSE='#' else BUILD_MODULES_LOAD_PLUGIN_TRUE='#' BUILD_MODULES_LOAD_PLUGIN_FALSE= fi # Check whether --enable-modprobe-plugin was given. if test ${enable_modprobe_plugin+y} then : enableval=$enable_modprobe_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xno" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_MODPROBE_PLUGIN 1" >>confdefs.h plugins="modprobe $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_MODPROBE_PLUGIN_TRUE= BUILD_MODPROBE_PLUGIN_FALSE='#' else BUILD_MODPROBE_PLUGIN_TRUE='#' BUILD_MODPROBE_PLUGIN_FALSE= fi # Check whether --enable-resolvconf-plugin was given. if test ${enable_resolvconf_plugin+y} then : enableval=$enable_resolvconf_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xno" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_RESOLVCONF_PLUGIN 1" >>confdefs.h plugins="resolvconf $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_RESOLVCONF_PLUGIN_TRUE= BUILD_RESOLVCONF_PLUGIN_FALSE='#' else BUILD_RESOLVCONF_PLUGIN_TRUE='#' BUILD_RESOLVCONF_PLUGIN_FALSE= fi # Check whether --enable-x11-common-plugin was given. if test ${enable_x11_common_plugin+y} then : enableval=$enable_x11_common_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xno" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_X11_COMMON_PLUGIN 1" >>confdefs.h plugins="x11-common $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_X11_COMMON_PLUGIN_TRUE= BUILD_X11_COMMON_PLUGIN_FALSE='#' else BUILD_X11_COMMON_PLUGIN_TRUE='#' BUILD_X11_COMMON_PLUGIN_FALSE= fi # Check whether --enable-netlink-plugin was given. if test ${enable_netlink_plugin+y} then : enableval=$enable_netlink_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xyes" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_NETLINK_PLUGIN 1" >>confdefs.h plugins="netlink $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_NETLINK_PLUGIN_TRUE= BUILD_NETLINK_PLUGIN_FALSE='#' else BUILD_NETLINK_PLUGIN_TRUE='#' BUILD_NETLINK_PLUGIN_FALSE= fi # Check whether --enable-hook-scripts-plugin was given. if test ${enable_hook_scripts_plugin+y} then : enableval=$enable_hook_scripts_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xno" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_HOOK_SCRIPTS_PLUGIN 1" >>confdefs.h plugins="hook-scripts $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_HOOK_SCRIPTS_PLUGIN_TRUE= BUILD_HOOK_SCRIPTS_PLUGIN_FALSE='#' else BUILD_HOOK_SCRIPTS_PLUGIN_TRUE='#' BUILD_HOOK_SCRIPTS_PLUGIN_FALSE= fi # Check whether --enable-hotplug-plugin was given. if test ${enable_hotplug_plugin+y} then : enableval=$enable_hotplug_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xyes" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_HOTPLUG_PLUGIN 1" >>confdefs.h plugins="hotplug $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_HOTPLUG_PLUGIN_TRUE= BUILD_HOTPLUG_PLUGIN_FALSE='#' else BUILD_HOTPLUG_PLUGIN_TRUE='#' BUILD_HOTPLUG_PLUGIN_FALSE= fi # Check whether --enable-rtc-plugin was given. if test ${enable_rtc_plugin+y} then : enableval=$enable_rtc_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xyes" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_RTC_PLUGIN 1" >>confdefs.h plugins="rtc $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_RTC_PLUGIN_TRUE= BUILD_RTC_PLUGIN_FALSE='#' else BUILD_RTC_PLUGIN_TRUE='#' BUILD_RTC_PLUGIN_FALSE= fi # Check whether --enable-tty-plugin was given. if test ${enable_tty_plugin+y} then : enableval=$enable_tty_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xyes" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_TTY_PLUGIN 1" >>confdefs.h plugins="tty $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_TTY_PLUGIN_TRUE= BUILD_TTY_PLUGIN_FALSE='#' else BUILD_TTY_PLUGIN_TRUE='#' BUILD_TTY_PLUGIN_FALSE= fi # Check whether --enable-urandom-plugin was given. if test ${enable_urandom_plugin+y} then : enableval=$enable_urandom_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xyes" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_URANDOM_PLUGIN 1" >>confdefs.h plugins="urandom $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_URANDOM_PLUGIN_TRUE= BUILD_URANDOM_PLUGIN_FALSE='#' else BUILD_URANDOM_PLUGIN_TRUE='#' BUILD_URANDOM_PLUGIN_FALSE= fi # Check whether --enable-testserv-plugin was given. if test ${enable_testserv_plugin+y} then : enableval=$enable_testserv_plugin; if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else $as_nop if test "x$enable_all_plugins" = "xauto"; then if test "xno" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi fi if test "x$enable_plugin" = "xyes"; then printf "%s\n" "#define HAVE_TESTSERV_PLUGIN 1" >>confdefs.h plugins="testserv $plugins" fi if test "x$enable_plugin" = "xyes"; then BUILD_TESTSERV_PLUGIN_TRUE= BUILD_TESTSERV_PLUGIN_FALSE='#' else BUILD_TESTSERV_PLUGIN_TRUE='#' BUILD_TESTSERV_PLUGIN_FALSE= fi # Check for extra arguments or packages # Check whether --with-bash-completion-dir was given. if test ${with_bash_completion_dir+y} then : withval=$with_bash_completion_dir; bash_dir=$withval else $as_nop bash_dir=yes fi # Check whether --with-fstab was given. if test ${with_fstab+y} then : withval=$with_fstab; fstab=$withval else $as_nop fstab=yes fi # Check whether --with-heading was given. if test ${with_heading+y} then : withval=$with_heading; heading=$withval else $as_nop heading=yes fi # Check whether --with-config was given. if test ${with_config+y} then : withval=$with_config; conf=$withval else $as_nop conf=yes fi # Check whether --with-rcsd was given. if test ${with_rcsd+y} then : withval=$with_rcsd; rcsd=$withval else $as_nop rcsd=yes fi # Check whether --with-rc-local was given. if test ${with_rc_local+y} then : withval=$with_rc_local; rclocal=$withval else $as_nop rclocal=yes fi # Check whether --with-sysconfig was given. if test ${with_sysconfig+y} then : withval=$with_sysconfig; sysconfig=$withval else $as_nop sysconfig=default fi # Check whether --with-group was given. if test ${with_group+y} then : withval=$with_group; group=$withval else $as_nop group=root fi # Check whether --with-hostname was given. if test ${with_hostname+y} then : withval=$with_hostname; hostname=$withval else $as_nop hostname=yes fi # Check whether --with-runlevel was given. if test ${with_runlevel+y} then : withval=$with_runlevel; runlevel=$withval else $as_nop runlevel=yes fi # Check whether --with-random-seed was given. if test ${with_random_seed+y} then : withval=$with_random_seed; random_seed=$withval else $as_nop random_seed=yes fi # Check whether --with-keventd was given. if test ${with_keventd+y} then : withval=$with_keventd; else $as_nop with_keventd=no fi # Check whether --with-sulogin was given. if test ${with_sulogin+y} then : withval=$with_sulogin; sulogin=$withval else $as_nop with_sulogin=no fi # Check whether --with-watchdog was given. if test ${with_watchdog+y} then : withval=$with_watchdog; watchdog=$withval else $as_nop with_watchdog=no watchdog= fi # Check whether --with-libsystemd was given. if test ${with_libsystemd+y} then : withval=$with_libsystemd; with_libsystemd=$withval else $as_nop with_libsystemd=no fi # Check whether --with-hook-scripts-path was given. if test ${with_hook_scripts_path+y} then : withval=$with_hook_scripts_path; hook_scripts_path=$withval else $as_nop hook_scripts_path=yes fi # Check whether --with-plugin-path was given. if test ${with_plugin_path+y} then : withval=$with_plugin_path; plugin_path=$withval else $as_nop plugin_path=yes fi # Check whether --with-rtc-date was given. if test ${with_rtc_date+y} then : withval=$with_rtc_date; rtc_date=$withval else $as_nop rtc_date=no fi # Check whether --with-rtc-file was given. if test ${with_rtc_file+y} then : withval=$with_rtc_file; rtc_file=$withval else $as_nop rtc_file=no fi ### Enable features ########################################################################### # Create config.h from selected features and fallback defaults if test "x$enable_auto_reload" = "xyes" then : printf "%s\n" "#define AUTO_RELOAD 1" >>confdefs.h fi if test "x$enable_kernel_cmdline" = "xyes" then : printf "%s\n" "#define KERNEL_CMDLINE 1" >>confdefs.h fi if test "x$enable_kernel_logging" = "xyes" then : printf "%s\n" "#define KERNEL_LOGGING 1" >>confdefs.h fi if test "x$enable_cgroup" = "xyes" then : printf "%s\n" "#define CGROUP2_ENABLED 1" >>confdefs.h fi if test "x$enable_fastboot" = "xyes" then : printf "%s\n" "#define FAST_BOOT 1" >>confdefs.h fi if test "x$enable_fsckfix" = "xyes" then : printf "%s\n" "#define FSCK_FIX 1" >>confdefs.h fi if test "x$enable_redirect" = "xyes" then : printf "%s\n" "#define REDIRECT_OUTPUT 1" >>confdefs.h fi ### Disable features ########################################################################### if test "x$enable_logrotate" != "xno" then : printf "%s\n" "#define LOGROTATE_ENABLED 1" >>confdefs.h fi if test "x$enable_rescue" != "xno" then : printf "%s\n" "#define RESCUE_MODE 1" >>confdefs.h fi if test "x$enable_logrotate" = "xyes"; then LOGROTATE_TRUE= LOGROTATE_FALSE='#' else LOGROTATE_TRUE='#' LOGROTATE_FALSE= fi ### With features ############################################################################## if test "x$bash_dir" = "xyes" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bash-completion >= 2.0" >&5 printf %s "checking for bash-completion >= 2.0... " >&6; } if test -n "$BASH_COMPLETION_CFLAGS"; then pkg_cv_BASH_COMPLETION_CFLAGS="$BASH_COMPLETION_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bash-completion >= 2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "bash-completion >= 2.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BASH_COMPLETION_CFLAGS=`$PKG_CONFIG --cflags "bash-completion >= 2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$BASH_COMPLETION_LIBS"; then pkg_cv_BASH_COMPLETION_LIBS="$BASH_COMPLETION_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bash-completion >= 2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "bash-completion >= 2.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BASH_COMPLETION_LIBS=`$PKG_CONFIG --libs "bash-completion >= 2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then BASH_COMPLETION_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bash-completion >= 2.0" 2>&1` else BASH_COMPLETION_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bash-completion >= 2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$BASH_COMPLETION_PKG_ERRORS" >&5 BASH_DIR="$datadir/bash-completion/completions" elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } BASH_DIR="$datadir/bash-completion/completions" else BASH_COMPLETION_CFLAGS=$pkg_cv_BASH_COMPLETION_CFLAGS BASH_COMPLETION_LIBS=$pkg_cv_BASH_COMPLETION_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } BASH_DIR="$(pkg-config --variable=completionsdir bash-completion)" fi else $as_nop BASH_DIR="$bash_dir" fi if test "x$with_fstab" != "xno" then : if test "x$fstab" = "xyes" then : fstab=$sysconfdir/fstab fi fstab_path="$fstab" fstab_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$fstab_path"\" )` printf "%s\n" "#define FINIT_FSTAB \"$fstab_path\"" >>confdefs.h else $as_nop printf "%s\n" "#define FINIT_FSTAB NULL" >>confdefs.h fi if test "x$with_config" != "xno" then : if test "x$conf" = "xyes" then : conf=$sysconfdir/finit.conf fi fi conf_path="$conf" conf_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$conf_path"\" )` printf "%s\n" "#define FINIT_CONF \"$conf_path\"" >>confdefs.h FINIT_CONF="$conf_path" if test "x$with_rcsd" != "xno" then : if test "x$rcsd" = "xyes" then : rcsd=$sysconfdir/finit.d fi fi rcsd_path="$rcsd" rcsd_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$rcsd_path"\" )` printf "%s\n" "#define FINIT_RCSD \"$rcsd_path\"" >>confdefs.h FINIT_RCSD="$rcsd_path" if test "x$with_rc_local" != "xno" then : if test "x$rclocal" = "xyes" then : rclocal=$sysconfdir/rc.local fi rclocal_path="$rclocal" rclocal_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$rclocal_path"\" )` printf "%s\n" "#define FINIT_RC_LOCAL \"$rclocal_path\"" >>confdefs.h fi if test "x$with_sysconfig" != "xno" then : if test "x$sysconfig" != "xdefault" then : sysconfig_path="$sysconfig" sysconfig_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$sysconfig_path"\" )` printf "%s\n" "#define FINIT_SYSCONFIG \"$sysconfig_path\"" >>confdefs.h fi fi if test "x$with_heading" != "xno" then : if test "x$heading" = "xyes" then : heading="" fi printf "%s\n" "#define INIT_OSHEADING \"$heading\"" >>confdefs.h fi if test "x$with_group" != "xno" then : if test "x$group" = "xyes" then : group=root fi fi printf "%s\n" "#define DEFGROUP \"$group\"" >>confdefs.h if test "x$with_hostname" != "xno" then : if test "x$hostname" = "xyes" then : hostname=noname fi fi printf "%s\n" "#define DEFHOST \"$hostname\"" >>confdefs.h if test "x$with_runlevel" != "xno" then : if test "x$runlevel" = "xyes" then : runlevel=2 printf "%s\n" "#define RUNLEVEL $runlevel" >>confdefs.h fi printf "%s\n" "#define RUNLEVEL $runlevel" >>confdefs.h fi if test "x$with_random_seed" != "xno" then : if test "x$random_seed" = "xyes" then : random_seed=/var/lib/misc/random-seed fi random_path="$random_seed" random_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$random_path"\" )` printf "%s\n" "#define RANDOMSEED \"$random_path\"" >>confdefs.h fi if test "x$rtc_date" != "xno" then : printf "%s\n" "#define RTC_TIMESTAMP_CUSTOM \"$rtc_date\"" >>confdefs.h else $as_nop rtc_date="" fi if test "x$rtc_file" != "xno" then : if test "x$rtc_file" = "xyes" then : rtc_file=/var/lib/misc/rtc fi rtcfile_path="$rtc_file" rtcfile_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$rtcfile_path"\" )` printf "%s\n" "#define RTC_FILE \"$rtcfile_path\"" >>confdefs.h else $as_nop printf "%s\n" "#define RTC_FILE NULL" >>confdefs.h fi if test "x$with_keventd" != "xno" then : with_keventd=yes fi if test "x$with_sulogin" != "xno" then : if test "x$sulogin" = "xyes" then : sulogin=root fi with_sulogin=yes printf "%s\n" "#define SULOGIN_USER \"$sulogin\"" >>confdefs.h else $as_nop sulogin= fi if test "x$with_watchdog" != "xno" then : if test "x$watchdog" = "xyes" then : watchdog=/dev/watchdog fi with_watchdog=yes printf "%s\n" "#define WDT_DEVNODE \"$watchdog\"" >>confdefs.h else $as_nop watchdog= fi if test "x$with_libsystemd" != "xno" then : printf "%s\n" "#define HAVE_LIBSYSTEMD 1" >>confdefs.h fi if test "x$enable_hook_scripts_plugin" != "xno" then : if test "x$hook_scripts_path" = "xyes" then : hook_scripts_path=$libexecdir/finit/hook fi hook_scripts_path="$hook_scripts_path" hook_scripts_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$hook_scripts_path"\" )` printf "%s\n" "#define PLUGIN_HOOK_SCRIPTS_PATH \"$hook_scripts_path\"" >>confdefs.h fi if test "x$with_plugin_path" != "xno" then : if test "x$plugin_path" = "xyes" then : plugin_path=/usr/lib/finit/plugins:/usr/local/lib/finit/plugins fi plugin_path="$plugin_path" plugin_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$plugin_path"\" )` printf "%s\n" "#define EXTERNAL_PLUGIN_PATH \"$plugin_path\"" >>confdefs.h fi # Control build with automake flags if test "x$bash_dir" != "xno"; then BASH_TRUE= BASH_FALSE='#' else BASH_TRUE='#' BASH_FALSE= fi if test "x$enable_static" = "xyes"; then STATIC_TRUE= STATIC_FALSE='#' else STATIC_TRUE='#' STATIC_FALSE= fi if test "x$with_keventd" != "xno"; then KEVENTD_TRUE= KEVENTD_FALSE='#' else KEVENTD_TRUE='#' KEVENTD_FALSE= fi if test "x$with_sulogin" != "xno"; then SULOGIN_TRUE= SULOGIN_FALSE='#' else SULOGIN_TRUE='#' SULOGIN_FALSE= fi if test "x$with_watchdog" != "xno"; then WATCHDOGD_TRUE= WATCHDOGD_FALSE='#' else WATCHDOGD_TRUE='#' WATCHDOGD_FALSE= fi if test "x$with_libsystemd" != "xno"; then LIBSYSTEMD_TRUE= LIBSYSTEMD_FALSE='#' else LIBSYSTEMD_TRUE='#' LIBSYSTEMD_FALSE= fi if test "x$enable_doc" = "xyes"; then DOC_TRUE= DOC_FALSE='#' else DOC_TRUE='#' DOC_FALSE= fi if test "x$enable_contrib" = "xyes"; then CONTRIB_TRUE= CONTRIB_FALSE='#' else CONTRIB_TRUE='#' CONTRIB_FALSE= fi if test "x$enable_testserv_plugin" = "xyes"; then TESTSERV_TRUE= TESTSERV_FALSE='#' else TESTSERV_TRUE='#' TESTSERV_FALSE= fi # Workaround for as-of-yet unreleased runstatedir support, planned for # autoconf 2.70, which some major distros have backported. if test -z "$runstatedir" then : runstatedir="$localstatedir/run" fi # Override default libdir, used for plugins and rescue.conf pkglibdir=$libdir/finit pkglibexecdir="$libexecdir/finit" pkglibexecdir=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$pkglibexecdir"\" )` printf "%s\n" "#define FINIT_EXECPATH_ \"$pkglibexecdir\"" >>confdefs.h finit_runpath="$runstatedir/finit/system" finit_runpath=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$finit_runpath"\" )` printf "%s\n" "#define FINIT_RUNPATH_ \"$finit_runpath\"" >>confdefs.h plugin_path="$pkglibdir/plugins" plugin_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$plugin_path"\" )` printf "%s\n" "#define PLUGIN_PATH \"$plugin_path\"" >>confdefs.h tmpfiles_path="$libdir/tmpfiles.d" tmpfiles_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$tmpfiles_path"\" )` printf "%s\n" "#define TMPFILES_PATH_ \"$tmpfiles_path\"" >>confdefs.h finit_tmpfiles="$pkglibdir/tmpfiles.d" finit_tmpfiles=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$finit_tmpfiles"\" )` printf "%s\n" "#define FINIT_TMPFILES \"$finit_tmpfiles\"" >>confdefs.h system_path="$pkglibdir/system" system_path=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$system_path"\" )` printf "%s\n" "#define FINIT_SYSPATH_ \"$system_path\"" >>confdefs.h rescue_conf="$pkglibdir/rescue.conf" rescue_conf=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$rescue_conf"\" )` printf "%s\n" "#define RESCUE_CONF \"$rescue_conf\"" >>confdefs.h sample_conf="$pkglibdir/sample.conf" sample_conf=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$sample_conf"\" )` printf "%s\n" "#define SAMPLE_CONF \"$sample_conf\"" >>confdefs.h bash_completion_dir="$BASH_DIR" bash_completion_dir=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$bash_completion_dir"\" )` BASH_DIR="$bash_completion_dir" if test "$heading" = "" then : heading="" fi if test "$heading" = "no" then : heading="" fi RTC_DATE=$rtc_date if test "$rtc_date" = "" then : RTC_DATE="" fi if test "$rtc_date" = "no" then : RTC_DATE="" fi # Generate all files cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_ALSA_UTILS_PLUGIN_TRUE}" && test -z "${BUILD_ALSA_UTILS_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_ALSA_UTILS_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_DBUS_PLUGIN_TRUE}" && test -z "${BUILD_DBUS_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_DBUS_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_MODULES_LOAD_PLUGIN_TRUE}" && test -z "${BUILD_MODULES_LOAD_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_MODULES_LOAD_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_MODPROBE_PLUGIN_TRUE}" && test -z "${BUILD_MODPROBE_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_MODPROBE_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_RESOLVCONF_PLUGIN_TRUE}" && test -z "${BUILD_RESOLVCONF_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_RESOLVCONF_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_X11_COMMON_PLUGIN_TRUE}" && test -z "${BUILD_X11_COMMON_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_X11_COMMON_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_NETLINK_PLUGIN_TRUE}" && test -z "${BUILD_NETLINK_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_NETLINK_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_HOOK_SCRIPTS_PLUGIN_TRUE}" && test -z "${BUILD_HOOK_SCRIPTS_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_HOOK_SCRIPTS_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_HOTPLUG_PLUGIN_TRUE}" && test -z "${BUILD_HOTPLUG_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_HOTPLUG_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_RTC_PLUGIN_TRUE}" && test -z "${BUILD_RTC_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_RTC_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_TTY_PLUGIN_TRUE}" && test -z "${BUILD_TTY_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_TTY_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_URANDOM_PLUGIN_TRUE}" && test -z "${BUILD_URANDOM_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_URANDOM_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_TESTSERV_PLUGIN_TRUE}" && test -z "${BUILD_TESTSERV_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"BUILD_TESTSERV_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LOGROTATE_TRUE}" && test -z "${LOGROTATE_FALSE}"; then as_fn_error $? "conditional \"LOGROTATE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BASH_TRUE}" && test -z "${BASH_FALSE}"; then as_fn_error $? "conditional \"BASH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STATIC_TRUE}" && test -z "${STATIC_FALSE}"; then as_fn_error $? "conditional \"STATIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${KEVENTD_TRUE}" && test -z "${KEVENTD_FALSE}"; then as_fn_error $? "conditional \"KEVENTD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SULOGIN_TRUE}" && test -z "${SULOGIN_FALSE}"; then as_fn_error $? "conditional \"SULOGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WATCHDOGD_TRUE}" && test -z "${WATCHDOGD_FALSE}"; then as_fn_error $? "conditional \"WATCHDOGD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LIBSYSTEMD_TRUE}" && test -z "${LIBSYSTEMD_FALSE}"; then as_fn_error $? "conditional \"LIBSYSTEMD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DOC_TRUE}" && test -z "${DOC_FALSE}"; then as_fn_error $? "conditional \"DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONTRIB_TRUE}" && test -z "${CONTRIB_FALSE}"; then as_fn_error $? "conditional \"CONTRIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TESTSERV_TRUE}" && test -z "${TESTSERV_FALSE}"; then as_fn_error $? "conditional \"TESTSERV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # 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 : 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 case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; 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 # The user is always right. if ${PATH_SEPARATOR+false} :; 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 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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 done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. 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 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. 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 : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # 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 : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # 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*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) 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 else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $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" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Finit $as_me 4.14, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . Finit home page: ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ Finit config.status 4.14 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 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='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -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 ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$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"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; "contrib/alpine/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/alpine/Makefile" ;; "contrib/alpine/finit.d/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/alpine/finit.d/Makefile" ;; "contrib/alpine/finit.d/available/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/alpine/finit.d/available/Makefile" ;; "contrib/debian/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/debian/Makefile" ;; "contrib/debian/finit.d/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/debian/finit.d/Makefile" ;; "contrib/debian/finit.d/available/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/debian/finit.d/available/Makefile" ;; "contrib/void/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/void/Makefile" ;; "contrib/void/finit.d/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/void/finit.d/Makefile" ;; "contrib/void/finit.d/available/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/void/finit.d/available/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/config/Makefile") CONFIG_FILES="$CONFIG_FILES doc/config/Makefile" ;; "libsystemd/Makefile") CONFIG_FILES="$CONFIG_FILES libsystemd/Makefile" ;; "libsystemd/libsystemd.pc") CONFIG_FILES="$CONFIG_FILES libsystemd/libsystemd.pc" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "plugins/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "system/Makefile") CONFIG_FILES="$CONFIG_FILES system/Makefile" ;; "system/10-hotplug.conf") CONFIG_FILES="$CONFIG_FILES system/10-hotplug.conf" ;; "test/test.env") CONFIG_FILES="$CONFIG_FILES test/test.env" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/lib/Makefile") CONFIG_FILES="$CONFIG_FILES test/lib/Makefile" ;; "test/src/Makefile") CONFIG_FILES="$CONFIG_FILES test/src/Makefile" ;; "tmpfiles.d/Makefile") CONFIG_FILES="$CONFIG_FILES tmpfiles.d/Makefile" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | 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;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$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 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $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" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. 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|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$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/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' 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;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t 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 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' 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' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) 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 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 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;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $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" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } 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;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 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/:.*$//'` # 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 # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $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" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: 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 (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_fn_error $? "Something went wrong bootstrapping makefile fragments 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; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # What type of objects to build. pic_mode=$pic_mode # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi cat < 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) finit-4.14/m4/ltversion.m40000755000175100001660000000131215054341565011054 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, # Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4245 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.7]) m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.7' macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) finit-4.14/m4/lt~obsolete.m40000755000175100001660000001400715054341565011406 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free # Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) finit-4.14/m4/plugin.m40000644000175100001660000000204315054341541010316 # From https://github.com/collectd/collectd/blob/master/configure.ac # Dependency handling currently unused define([enadis], [ifelse([$1], [yes], [disable], [enable])]) # AC_PLUGIN(name, default, info) # ------------------------------------------------------------ AC_DEFUN([AC_PLUGIN],[ m4_divert_once([HELP_ENABLE], [ Optional Plugins:]) define(PLUGGY, m4_translit([$1],[a-z-][A-Z-]))dnl AC_ARG_ENABLE([$1-plugin], AS_HELP_STRING([--enadis($2)-$1-plugin], [$3]), [ if test "x$enableval" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi], [ if test "x$enable_all_plugins" = "xauto"; then if test "x$2" = "xyes"; then enable_plugin="yes" else enable_plugin="no" fi else enable_plugin="$enable_all_plugins" fi]) if test "x$enable_plugin" = "xyes"; then AC_DEFINE(HAVE_[]m4_translit($1,[-a-z],[_A-Z])_PLUGIN, 1, [Define to 1 if the $1 plugin is enabled.]) plugins="$1 $plugins" fi AM_CONDITIONAL(BUILD_[]m4_translit($1,[-a-z],[_A-Z])_PLUGIN, test "x$enable_plugin" = "xyes")]) finit-4.14/m4/libtool.m40000755000175100001660000113165215054341565010507 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 59 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -z "$STRIP"; then AC_MSG_RESULT([no]) else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_FILECMD # ---------------- # Check for a file(cmd) program that can be used to detect file type and magic m4_defun([_LT_DECL_FILECMD], [AC_CHECK_TOOL([FILECMD], [file], [:]) _LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) ])# _LD_DECL_FILECMD # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS finit-4.14/m4/expand.m40000644000175100001660000000113315054341541010276 # From https://github.com/kakaroto/e17/blob/master/BINDINGS/javascript/elixir/m4/ac_expand_dir.m4 # By Alexandre Oliva # AC_EXPAND_DIR(VARNAME, DIR) # ------------------------------------------------------------ # Expands occurrences of ${prefix} and ${exec_prefix} in the # given DIR, and assigns the resulting string to VARNAME # # Example: AC_DEFINE_DIR(DATADIR, "$datadir") AC_DEFUN([AC_EXPAND_DIR], [ $1=$2 $1=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""[$]$1"\" )` ]) finit-4.14/m4/ltoptions.m40000755000175100001660000003427515054341565011100 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free # Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) finit-4.14/contrib/0000755000175100001660000000000015054341601007754 5finit-4.14/contrib/README.md0000644000175100001660000000053415054341541011160 Finit Examples ============== This section provides configuration examples and helpful tools to install and try out Finit on various Linux distributions. * [Alpine](alpine/) * [Debian](debian/) * [Void](void/) If you have ideas on how to simplify, extend, or even add new example configurations for other distributions you are most welcome! :) finit-4.14/contrib/finit.conf0000644000175100001660000000636215054341541011666 # Sample finit.conf to demonstrate the syntax # host testbed # Linux kernel modules to load module button module evdev module loop module psmouse # Top-level cgroups and their default settings. All groups mandatory # but more can be added, max 8 groups in total currently. The cgroup # 'root' is also available, reserved for RT processes. Settings are # as-is, only one shorthand 'mem.' exists, other than that it's the # cgroup v2 controller default names. cgroup init cpu.weight:100 cgroup user cpu.weight:100 cgroup system cpu.weight:9700 cpu.max:50000 # Example extra cgroup cgroup maint cpu.weight:100 # Runlevel to start after bootstrap, runlevel 'S' runlevel 2 # Network bringup script network service networking start # Max file size for each log file: 100 kiB, rotate max 4 copies: # log => log.1 => log.2.gz => log.3.gz => log.4.gz log size:100k count:4 # Virtual consoles to start getty on tty /dev/tty1 tty /dev/tty2 tty /dev/tty3 # Task to run if ctrl-alt-del is pressed. This condition is asserted by # Finit upon receiving SIGINT (from the kernel). task [12345789] initctl reboot -- Rebooting system # Task to run if the kernel gets a power fail condition is pressed. # Asserted by Finit upon receiving SIGPWR (from the kernel). task [12345789] initctl poweroff -- Shutting down system # Alternative method instead of runparts #task [S] /etc/init.d/keyboard-setup start -- Setting up preliminary keymap #task [S] /etc/init.d/acpid start -- Starting ACPI Daemon #task [S] /etc/init.d/kbd start -- Preparing console #run [2] /etc/init.d/networking start -- Start networking # Services to be monitored and respawned as needed # klgod and syslogd are placed in the maint cgroup cgroup.maint service [2345] klogd -n -- Kernel logging server service [2345] syslogd -n -- Syslog server # gdm in the system cgroup (default when read from it's own .conf file) cgroup.system service [3] cgroup:cpu.weight:250,mem.max:10M gdm -- GNOME Display Manager # Start SSH daemon with opts from /etc/default/ssh (if available), move # to user cgroup with cpu.weight:250. Default for services is system # group. Default weight in user group is 100 (above). Max length of # cgroup argument is (currently) 63 chars. # # Notice alternative syntax where current cgroup is only set for this # particular service. service [2345] cgroup.user:cpu.weight:250,mem.max:10M env:-/etc/default/ssh /usr/sbin/sshd -D $SSHD_OPTS -- OpenSSH daemon # The BusyBox ntpd does not use syslog when running in the foreground # So we use this trick to redirect stdout/stderr to a log file. The # log file is rotated with the above settings. The condition declares # a dependency on a system default route (gateway) to be set. A single # at the beginning means ntpd does not respect SIGHUP for restart. service [2345] log:/var/log/ntpd.log ntpd -n -l -I eth0 -- NTP daemon # Run start scripts from this directory # runparts /etc/start.d # For multiple instances of the same service, add :ID somewhere between # the service/run/task keyword and the command. service :80 [2345] /sbin/httpd -f -h /http -p 80 -- Web server service :8080 [2345] /sbin/httpd -f -h /http -p 8080 -- Old web server finit-4.14/contrib/Makefile.in0000644000175100001660000005355515054341567011771 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_bash_DATA_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_bash_DATA_DIST = initctl am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bashdir)" "$(DESTDIR)$(docsdir)" DATA = $(dist_bash_DATA) $(docs_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ SUBDIRS = alpine debian void bin_SCRIPT = service docsdir := @docdir@/contrib docs_DATA = README.md finit.conf procmon.sh EXTRA_DIST = $(docs_DATA) @BASH_TRUE@bashdir = $(BASH_DIR) @BASH_TRUE@dist_bash_DATA = initctl all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_bashDATA: $(dist_bash_DATA) @$(NORMAL_INSTALL) @list='$(dist_bash_DATA)'; test -n "$(bashdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bashdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bashdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bashdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(bashdir)" || exit $$?; \ done uninstall-dist_bashDATA: @$(NORMAL_UNINSTALL) @list='$(dist_bash_DATA)'; test -n "$(bashdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(bashdir)'; $(am__uninstall_files_from_dir) install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docsdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bashdir)" "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_bashDATA install-docsDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_bashDATA uninstall-docsDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_bashDATA install-docsDATA 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-dist_bashDATA uninstall-docsDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/contrib/alpine/0000755000175100001660000000000015054341601011224 5finit-4.14/contrib/alpine/README.md0000644000175100001660000000401015054341541012421 HowTo: Finit on Alpine Linux 3.4...3.19 ======================================= > [!TIP] > https://troglobit.com/post/2021-02-12-alpine-linux-with-finit/ HowTo use Finit to boot an [Alpine Linux][] system. It is assumed that the user has already installed make, a compiler, C library header files, and other tools needed to build a GNU configure based project. To start with you need to first install [libuEv][] and [libite][]. They default to install to `/usr/local`, but unlike Debian and Ubuntu based distros, Alpine's `pkg-config` does not look for libraries and header files there. So the `PKG_CONFIG_LIBDIR` environment variable must be used, or change the install prefix to `/usr`. The bundled [build.sh](build.sh) script can be used to configure and build finit: alpine:~# cd finit alpine:~/finit# ./contrib/alpine/build.sh Then run the [install.sh](install.sh) script to install all necessary files, including the sample `finit.conf` and `finit.d/*.conf` files. More on that below. alpine:~/finit# ./contrib/alpine/install.sh The install script is non-destructive by default, you have to answer *Yes* twice to set up Finit as the system default init. Pay close attention to the last question: *** Install Finit as the system default Init (y/N)? If you answer `No`, simply by pressing enter, you can change the symlink yourself later on, to point to `finit` instead of `/bin/busybox`: alpine:~/finit# cd /sbin alpine:/sbin# rm init alpine:/sbin# ln -s finit init Before rebooting, make sure to set up a [/etc/finit.conf](finit.conf), and [/etc/finit.d/](finit.d/) for your services. Samples are included in this directory. Notice the symlinks in `/etc/finit.d/`, which can be managed by the operator at runtime using `initctl enable SERVICE`. You can also use a standard [/etc/rc.local](rc.local) for one-shot tasks and initialization like keyboard language etc. [libuEv]: https://github.com/troglobit/libuev [libite]: https://github.com/troglobit/libite [Alpine Linux]: https://www.alpinelinux.org/ finit-4.14/contrib/alpine/install.sh0000755000175100001660000000302115054341541013150 #!/bin/sh if [ "$(id -u)" != "0" ]; then printf "\n\e[1m*** This script must run as root\e[0m\n\n" exit 1 fi # shellcheck disable=SC3037,SC3045,SC2154 yorn() { printf "\e[1m> %s (y/N)?\e[0m " "$*" read -rn1 yorn echo if [ "$yorn" = "y" ] || [ "$yorn" = "Y" ]; then return 0 fi return 1 } # Adjust base directory if grep -q contrib/alpine Makefile 2>/dev/null; then cd ../.. fi if [ ! -e configure.ac ]; then printf "\n\e[1m*** Please run this script from the Finit base directory.\e[0m\n" exit 1 fi printf "\n\e[1mInstall Finit on Alpine Linux\n" printf "========================================================================\e[0m\n" printf "/sbin/finit - PID 1\n" printf "/lib/finit/plugins/* - All enabled Finit plugins\n" printf "/etc/finit.conf - Finit configuration file\n" printf "/etc/finit.d/ - Finit services\n" if yorn "Do you want to continue"; then printf "\n\e[1m*** Installing Finit files ...\e[0m\n" make install cd /usr/share/doc/finit/contrib/alpine || exit 1 for file in finit.conf rc.local; do install -vbD $file /etc/$file done cp -va finit.d /etc/ if yorn "Install Finit as the system default Init"; then printf "\e[1m*** Updating /sbin/init symlink --> finit ...\e[0m\n" cd /sbin || exit 1 rm init ln -s finit init rm halt shutdown suspend ln -s reboot halt ln -s reboot shutdown ln -s reboot suspend fi printf "\n\e[1m*** Done\e[0m\n" echo else printf "\n\e[1m*** Aborting install.\e[0m\n\n" fi finit-4.14/contrib/alpine/finit.d/0000755000175100001660000000000015054341601012557 5finit-4.14/contrib/alpine/finit.d/Makefile.in0000644000175100001660000004653615054341567014575 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib/alpine/finit.d ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ SUBDIRS = available docsdir := @docdir@/contrib/alpine/finit.d d_LINKS = acpid.conf crond.conf dropbear.conf getty.conf \ keymap.conf modules.conf ntpd.conf syslogd.conf all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/alpine/finit.d/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/alpine/finit.d/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: $(am__recursive_targets) install-am install-exec-am \ install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-hook .PRECIOUS: Makefile install-exec-hook: @$(MKDIR_P) $(DESTDIR)$(docsdir)/available @$(MKDIR_P) $(DESTDIR)$(docsdir)/enabled @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ rm -f $$lnk; \ $(LN_S) ../$$src $$lnk; \ done uninstall-hook: @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ $(RM) -f $$lnk; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/contrib/alpine/finit.d/available/0000755000175100001660000000000015054341601014477 5finit-4.14/contrib/alpine/finit.d/available/keymap.conf0000644000175100001660000000016415054341541016560 # Oneshot task to run once at bootstrap task [S] env:/etc/conf.d/loadkmap zcat $KEYMAP | loadkmap -- Loading keymap finit-4.14/contrib/alpine/finit.d/available/acpid.conf0000644000175100001660000000030215054341541016344 # Handle PWR button to shutdown/reboot -- useful in Qemu (virt-manager) # Depends on syslogd having started. Redirect any output to log. service [2345] log acpid -f -- ACPI daemon finit-4.14/contrib/alpine/finit.d/available/lxdm.conf0000644000175100001660000000006115054341541016232 service [2345] lxdm -- Lightweight Login Manager finit-4.14/contrib/alpine/finit.d/available/ntpd.conf0000644000175100001660000000023615054341541016237 # Busybox ntpd has no option to use syslog when running in foreground service [2345] env:-/etc/conf.d/ntpd log ntpd -n $NTPD_OPTS -- NTP daemon finit-4.14/contrib/alpine/finit.d/available/getty.conf0000644000175100001660000000030015054341541016416 # Consoles to start getty on when system is up tty [12345] /dev/ttyS0 noclear tty [12345] /dev/tty1 noclear nowait tty [2345] /dev/tty2 noclear nowait tty [2345] /dev/tty3 noclear nowait finit-4.14/contrib/alpine/finit.d/available/watchdog.conf0000644000175100001660000000015015054341541017065 service [S123456789] env:-/etc/conf.d/watchdog watchdog $WATCHDOG_OPTS $WATCHDOG_DEV -- System watchdog finit-4.14/contrib/alpine/finit.d/available/crond.conf0000644000175100001660000000013215054341541016372 service [2345] env:-/etc/conf.d/crond crond -f -S $CRON_OPTS -- Cron daemon finit-4.14/contrib/alpine/finit.d/available/syslogd.conf0000644000175100001660000000045015054341541016754 # Start syslogd as soon as possible, should always run # Start klogd as soon as possible, but after syslogd service [S12345] env:-/etc/conf.d/syslog syslogd -n $SYSLOGD_OPTS -- Syslog daemon service [S12345] env:-/etc/conf.d/klogd klogd -n $KLOGD_OPTS -- Kernel log daemon finit-4.14/contrib/alpine/finit.d/available/Makefile.in0000644000175100001660000003536215054341567016510 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib/alpine/finit.d/available ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ docsdir := @docdir@/contrib/alpine/finit.d/available docs_DATA = acpid.conf crond.conf dropbear.conf getty.conf keymap.conf \ lxdm.conf modules.conf ntpd.conf syslogd.conf watchdog.conf EXTRA_DIST = $(docs_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/alpine/finit.d/available/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/alpine/finit.d/available/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-docsDATA 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-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-docsDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/contrib/alpine/finit.d/available/modules.conf0000644000175100001660000000017315054341541016742 ## Linux kernel modules to load #module fbcon #module button #module evdev #module mousedev #module 8139cp #module softdog finit-4.14/contrib/alpine/finit.d/available/dropbear.conf0000644000175100001660000000022615054341541017067 # Start SSH daemon as soon as basic networking comes up service [2345] env:-/etc/conf.d/dropbear dropbear -R -F $DROPBEAR_OPTS -- Dropbear SSH daemon finit-4.14/contrib/alpine/finit.d/available/Makefile.am0000644000175100001660000000034415054341541016457 docsdir := @docdir@/contrib/alpine/finit.d/available docs_DATA = acpid.conf crond.conf dropbear.conf getty.conf keymap.conf \ lxdm.conf modules.conf ntpd.conf syslogd.conf watchdog.conf EXTRA_DIST = $(docs_DATA) finit-4.14/contrib/alpine/finit.d/Makefile.am0000644000175100001660000000114415054341541014536 SUBDIRS = available docsdir := @docdir@/contrib/alpine/finit.d d_LINKS = acpid.conf crond.conf dropbear.conf getty.conf \ keymap.conf modules.conf ntpd.conf syslogd.conf install-exec-hook: @$(MKDIR_P) $(DESTDIR)$(docsdir)/available @$(MKDIR_P) $(DESTDIR)$(docsdir)/enabled @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ rm -f $$lnk; \ $(LN_S) ../$$src $$lnk; \ done uninstall-hook: @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ $(RM) -f $$lnk; \ done finit-4.14/contrib/alpine/rc.local0000755000175100001660000000026715054341541012577 #!/bin/sh # This script is executed once at boot, at the very end, # right before starting the TTYs. # # Each line is run in sequence. # # NOTE: Remember to set the executable bit! # finit-4.14/contrib/alpine/finit.conf0000644000175100001660000000206115054341541013126 # /etc/finit.conf: Example for Alpine Linux # See /etc/finit.d/*.conf and `initctl list` for other services ## Runlevel to start after bootstrap, runlevel 'S' # Default is 2 #runlevel 2 # Top-level cgroups and their default settings. All groups mandatory # but more can be added, max 8 groups in total currently. The cgroup # 'root' is also available, reserved for RT processes. Settings are # as-is, only one shorthand 'mem.' exists, other than that it's the # cgroup v2 controller default names. #cgroup init cpu.weight:100 #cgroup user cpu.weight:100 #cgroup system cpu.weight:9700 # Task to run if ctrl-alt-del is pressed. This condition is asserted by # Finit upon receiving SIGINT (from the kernel). #task [12345789] initctl reboot -- Rebooting system # Task to run if the kernel gets a power fail condition is pressed. # Asserted by Finit upon receiving SIGPWR (from the kernel). #task [12345789] initctl poweroff -- Shutting down system ## Bootstrap services and tasks # Can be listed here or in /etc/finit.d/*.conf finit-4.14/contrib/alpine/Makefile.in0000644000175100001660000005151515054341567013233 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib/alpine ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ SUBDIRS = finit.d docsdir := @docdir@/contrib/alpine docs_DATA = README.md finit.conf build.sh install.sh rc.local EXTRA_DIST = $(docs_DATA) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/alpine/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/alpine/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docsdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-docsDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-docsDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-docsDATA 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-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-docsDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/contrib/alpine/build.sh0000755000175100001660000000170115054341541012604 #!/bin/sh -e echo echo "*** Configuring Finit for Alpine Linux" if [ ! -e configure ]; then echo " The configure script is missing, maybe you're using a version from GIT?" echo " Attempting to run the autogen.sh script, you will need these tools:" echo " autoconf, automake, libtool, pkg-config ..." echo ./autogen.sh fi # The plugins are optional, but you may need D-Bus and X11 if you want # to run X-Window, the other configure flags are however required. PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig ./configure \ --prefix=/usr --exec-prefix= \ --sysconfdir=/etc --localstatedir=/var \ --enable-dbus-plugin --enable-x11-common-plugin \ --enable-alsa-utils-plugin --without-watchdog \ --with-keventd --with-sulogin echo echo "*** Building ..." echo make if [ $? -ne 0 ]; then echo echo "*** The build failed for some reason" echo exit 1 fi echo echo "*** Done" echo finit-4.14/contrib/alpine/Makefile.am0000644000175100001660000000022415054341541013201 SUBDIRS = finit.d docsdir := @docdir@/contrib/alpine docs_DATA = README.md finit.conf build.sh install.sh rc.local EXTRA_DIST = $(docs_DATA) finit-4.14/contrib/procmon.sh0000755000175100001660000000300115054341541011705 #!/bin/sh USAGE="Usage: $0 processName" LOG_FILE="/tmp/memusage.csv" ELAPSED_TIME=0 PERIOD=1 # seconds if [ $# -ne 1 ]; then echo $USAGE exit 1 fi echo "ElapsedTime,VmSize,VmRSS" > $LOG_FILE # Monitor memory usage forever until script is killed while : do SUM_VM_SIZE=0 SUM_RSS_SIZE=0 # In case the monitored process has not yet started # keep searching until its PID is found PROCESS_PIDS="" while : do PROCESS_PIDS=`/bin/pidof $1` if [ "$PROCESS_PIDS.X" != ".X" ]; then break fi done for PID in ${PROCESS_PIDS} ; do VM_SIZE=`awk '/VmSize/ {print $2}' < /proc/$PID/status` if [ "$VM_SIZE.X" = ".X" ]; then continue fi #echo exprVM_ $SUM_VM_SIZE + $VM_SIZE SUM_VM_SIZE=`expr $SUM_VM_SIZE + $VM_SIZE` VM_RSS=`awk '/VmRSS/ {print $2}' < /proc/$PID/status` if [ "$VM_RSS.X" = ".X" ]; then continue fi SUM_RSS_SIZE=`expr $SUM_RSS_SIZE + $VM_RSS` done echo "$ELAPSED_TIME sec, $SUM_VM_SIZE KB, $SUM_RSS_SIZE KB" echo "$ELAPSED_TIME,$SUM_VM_SIZE,$SUM_RSS_SIZE" >> $LOG_FILE sleep $PERIOD VM_SIZE="" VM_RSS="" # Needs to get actual elapsed time instead of doing this ELAPSED_TIME=`expr $ELAPSED_TIME + $PERIOD` done finit-4.14/contrib/Makefile.am0000644000175100001660000000034715054341541011737 SUBDIRS = alpine debian void bin_SCRIPT = service docsdir := @docdir@/contrib docs_DATA = README.md finit.conf procmon.sh EXTRA_DIST = $(docs_DATA) if BASH bashdir = $(BASH_DIR) dist_bash_DATA = initctl endif finit-4.14/contrib/void/0000755000175100001660000000000015054341601010715 5finit-4.14/contrib/void/README.md0000644000175100001660000000453015054341541012121 HowTo: Finit on Void Linux ========================== HowTo use Finit to boot an [Void Linux][] system. It is assumed that the user has already installed make, a compiler, C library header files, and other tools needed to build a GNU configure based project. To start with you need to first install [libuEv][] and [libite][]. They default to install to `/usr/local`, but unlike Debian and Ubuntu based distros, Void's `pkg-config` does not look for libraries and header files there. So the `PKG_CONFIG_LIBDIR` environment variable must be used, or change the install prefix to `/usr`. The bundled [build.sh](build.sh) script can be used to configure and build finit: void:~# cd finit void:~/finit# ./contrib/void/build.sh Then run the [install.sh](install.sh) script to install all necessary files, including the sample `finit.conf` and `finit.d/*.conf` files. More on that below. void:~/finit# ./contrib/void/install.sh The install script is (supposed to be) non-destructive by default, you have to answer *Yes* twice to set up Finit as the system default init. Pay close attention to the last question: *** Install Finit as the system default Init (y/N)? If you answer `No`, simply by pressing enter, you can change the symlink yourself later on, to point to `finit` instead of `runit`: void:~/finit# cd /sbin void:/sbin# rm init void:/sbin# ln -s finit init Another option is to change the Grub defaults, in `/etc/default/grub`: #GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 slub_debug=P page_poison=1" GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 init=/sbin/finit" Alternatively, you can simply modify the default Grub entry at boot, or set up an alternative Grub entry to include: linux /boot/vmlinuz-X.YY.Z ... init=/sbin/finit If you modify a Grub configuration file, remember to run: update-grub Before rebooting, make sure to set up a [/etc/finit.conf](finit.conf), and [/etc/finit.d/](finit.d/) for your services. Samples are included in this directory. Notice the symlinks in `/etc/finit.d/`, which can be managed by the operator at runtime using `initctl enable SERVICE`. You can also use a standard [/etc/rc.local](rc.local) for one-shot tasks and initialization like keyboard language etc. [libuEv]: https://github.com/troglobit/libuev [libite]: https://github.com/troglobit/libite [Void Linux]: https://www.voidlinux.eu/ finit-4.14/contrib/void/install.sh0000755000175100001660000000250315054341541012645 #!/bin/sh if [ "x`id -u`" != "x0" ]; then echo echo "*** This script must run as root" echo exit 1 fi # Adjust base directory grep -q void Makefile 2>/dev/null if [ $? -eq 0 ]; then cd ../.. elif [ ! -e configure.ac ]; then echo "*** Please run this script from the Finit base directory." exit 1 fi echo echo "*** Install Finit on Void Linux" echo "========================================================================" echo "/sbin/finit - PID 1" echo "/lib/finit/plugins/* - All enabled Finit plugins" echo "/etc/finit.conf - Finit configuration file" echo "/etc/finit.d/ - Finit services" echo "/etc/grub.d/40_custom - Add menu entry to the Grub boot loader" echo read -p "Do you want to continue (y/N)? " yorn if [ "x$yorn" = "xy" -o "x$yorn" = "xY" ]; then echo echo "*** Installing Finit files ..." make install cd /usr/share/doc/finit/contrib/void for file in finit.conf rc.local; do install -vbD $file /etc/$file done cp -va finit.d /etc/ read -p "*** Install Finit as the system default Init (y/N)? " yorn if [ "x$yorn" = "xy" -o "x$yorn" = "xY" ]; then echo "*** Updating /sbin/init symlink --> finit ..." cd /sbin rm init ln -s finit init fi echo "*** Done" echo else echo echo "*** Aborting install." echo fi finit-4.14/contrib/void/finit.d/0000755000175100001660000000000015054341601012250 5finit-4.14/contrib/void/finit.d/Makefile.in0000644000175100001660000004644515054341567014265 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib/void/finit.d ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ SUBDIRS = available docsdir := @docdir@/contrib/void/finit.d d_LINKS = acpid.conf dhcpcd.conf getty.conf sshd.conf uuidd.conf all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/void/finit.d/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/void/finit.d/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: $(am__recursive_targets) install-am install-exec-am \ install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-hook .PRECIOUS: Makefile install-exec-hook: @$(MKDIR_P) $(DESTDIR)$(docsdir)/available @$(MKDIR_P) $(DESTDIR)$(docsdir)/enabled @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ rm -f $$lnk; \ $(LN_S) ../$$src $$lnk; \ done uninstall-hook: @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ $(RM) -f $$lnk; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/contrib/void/finit.d/available/0000755000175100001660000000000015054341601014170 5finit-4.14/contrib/void/finit.d/available/keymap.conf0000644000175100001660000000015215054341541016246 # Oneshot task to run once at bootstrap task [S] zcat /etc/keymap/se.bmap.gz | loadkmap -- Loading keymap finit-4.14/contrib/void/finit.d/available/dmeventd.conf0000644000175100001660000000007315054341541016570 service [S12345] dmeventd -f -- Device mapper event daemon finit-4.14/contrib/void/finit.d/available/acpid.conf0000644000175100001660000000026015054341541016040 # Handle PWR button to shutdown/reboot -- useful in Qemu (virt-manager) # Depends on syslogd having started. Redirect any output to log. service [2345] acpid -f -- ACPI daemon finit-4.14/contrib/void/finit.d/available/sshd.conf0000644000175100001660000000015315054341541015722 # Start SSH daemon as soon as basic networking comes up service [2345] /usr/sbin/sshd -D -- OpenSSH daemon finit-4.14/contrib/void/finit.d/available/lxdm.conf0000644000175100001660000000006115054341541015723 service [2345] lxdm -- Lightweight Login Manager finit-4.14/contrib/void/finit.d/available/dhcpcd.conf0000644000175100001660000000005315054341541016205 service [2345] dhcpcd -B -M -- DHCP client finit-4.14/contrib/void/finit.d/available/ntpd.conf0000644000175100001660000000022615054341541015727 # Silly Busybox ntpd has no option to use syslog when running in foreground service [2345] log ntpd -n -N -p pool.ntp.org -- NTP daemon finit-4.14/contrib/void/finit.d/available/getty.conf0000644000175100001660000000025515054341541016120 # Consoles to start Finit built-in getty on when system is up tty [12345] /dev/tty1 noclear nowait tty [2345] /dev/tty2 noclear nowait tty [2345] /dev/tty3 noclear nowait finit-4.14/contrib/void/finit.d/available/crond.conf0000644000175100001660000000011115054341541016060 service [2345] crond -f -S -c /etc/crontabs -- Cron daemon finit-4.14/contrib/void/finit.d/available/Makefile.in0000644000175100001660000003541415054341567016177 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib/void/finit.d/available ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ docsdir := @docdir@/contrib/void/finit.d/available docs_DATA = acpid.conf crond.conf dhcpcd.conf dmeventd.conf getty.conf \ keymap.conf lxdm.conf modules.conf ntpd.conf \ sshd.conf syslog.conf uuidd.conf EXTRA_DIST = $(docs_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/void/finit.d/available/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/void/finit.d/available/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-docsDATA 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-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-docsDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/contrib/void/finit.d/available/modules.conf0000644000175100001660000000017215054341541016432 ## Linux kernel modules to load #module fbcon #module button #module evdev #module mousedev #module 8139cp module softdog finit-4.14/contrib/void/finit.d/available/uuidd.conf0000644000175100001660000000007715054341541016100 service @uuidd:uuidd [2345] uuidd -F -- UUID generation daemon finit-4.14/contrib/void/finit.d/available/Makefile.am0000644000175100001660000000040415054341541016145 docsdir := @docdir@/contrib/void/finit.d/available docs_DATA = acpid.conf crond.conf dhcpcd.conf dmeventd.conf getty.conf \ keymap.conf lxdm.conf modules.conf ntpd.conf \ sshd.conf syslog.conf uuidd.conf EXTRA_DIST = $(docs_DATA) finit-4.14/contrib/void/finit.d/available/syslog.conf0000644000175100001660000000034215054341541016301 # Start syslogd as soon as possible, should always run # Start klogd as soon as possible, but after syslogd service [S12345] syslogd -n -- Syslog daemon service [S12345] klogd -n -- Kernel log daemon finit-4.14/contrib/void/finit.d/Makefile.am0000644000175100001660000000106215054341541014226 SUBDIRS = available docsdir := @docdir@/contrib/void/finit.d d_LINKS = acpid.conf dhcpcd.conf getty.conf sshd.conf uuidd.conf install-exec-hook: @$(MKDIR_P) $(DESTDIR)$(docsdir)/available @$(MKDIR_P) $(DESTDIR)$(docsdir)/enabled @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ rm -f $$lnk; \ $(LN_S) ../$$src $$lnk; \ done uninstall-hook: @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ $(RM) -f $$lnk; \ done finit-4.14/contrib/void/rc.local0000755000175100001660000000026515054341541012266 #!/bin/sh # This script is executed once at boot, at the very end, # right before starting the TTYs. # # Each line is run in sequence. # # NOTE: Remember to set the executable bit! finit-4.14/contrib/void/finit.conf0000644000175100001660000000205715054341541012624 # /etc/finit.conf: Example for Void Linux # See /etc/finit.d/*.conf and `initctl list` for other services ## Runlevel to start after bootstrap, runlevel 'S' # Default is 2 #runlevel 2 # Top-level cgroups and their default settings. All groups mandatory # but more can be added, max 8 groups in total currently. The cgroup # 'root' is also available, reserved for RT processes. Settings are # as-is, only one shorthand 'mem.' exists, other than that it's the # cgroup v2 controller default names. #cgroup init cpu.weight:100 #cgroup user cpu.weight:100 #cgroup system cpu.weight:9700 # Task to run if ctrl-alt-del is pressed. This condition is asserted by # Finit upon receiving SIGINT (from the kernel). #task [12345789] initctl reboot -- Rebooting system # Task to run if the kernel gets a power fail condition is pressed. # Asserted by Finit upon receiving SIGPWR (from the kernel). #task [12345789] initctl poweroff -- Shutting down system ## Bootstrap services and tasks # Can be listed here or in /etc/finit.d/*.conf finit-4.14/contrib/void/Makefile.in0000644000175100001660000005150515054341567012723 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib/void ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ SUBDIRS = finit.d docsdir := @docdir@/contrib/void docs_DATA = README.md finit.conf build.sh install.sh rc.local EXTRA_DIST = $(docs_DATA) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/void/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/void/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docsdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-docsDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-docsDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-docsDATA 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-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-docsDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/contrib/void/build.sh0000755000175100001660000000175715054341541012310 #!/bin/sh -e echo echo "*** Configuring Finit for Void Linux" if [ ! -e configure ]; then echo " The configure script is missing, maybe you're using a version from GIT?" echo " Attempting to run the autogen.sh script, you will need these tools:" echo " autoconf, automake, libtool, pkg-config ..." echo ./autogen.sh fi # The plugins are optional, but you may need D-Bus and X11 if you want # to run X-Window, the other configure flags are however required. PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig ./configure \ --prefix=/usr --exec-prefix= \ --sysconfdir=/etc --localstatedir=/var \ --enable-dbus-plugin --enable-x11-common-plugin \ --enable-alsa-utils-plugin --with-watchdog \ --with-keventd --with-sulogin echo echo "*** Building ..." echo make if [ $? -ne 0 ]; then echo echo "*** The build failed for some reason" echo exit 1 fi echo echo "*** Done" echo finit-4.14/contrib/void/Makefile.am0000644000175100001660000000022115054341541012667 SUBDIRS = finit.d docsdir := @docdir@/contrib/void docs_DATA = README.md finit.conf build.sh install.sh rc.local EXTRA_DIST = $(docs_DATA) finit-4.14/contrib/debian/0000755000175100001660000000000015054341601011176 5finit-4.14/contrib/debian/README.md0000644000175100001660000000516315054341541012405 HowTo: Finit on Debian GNU/Linux ================================ HowTo use Finit to boot a Debian GNU/Linux system. It is assumed that the user has already installed a compiler, C library header files, and other tools needed to build a GNU configure based project. I.e., at the very least: root@debian:~# apt install build-essential Like the [Alpine HowTo](../alpine/), you need to install [libuEv][] and [libite][], but since this is Debian — which takes infinite care of its users ♥ ♥ ♥ we don't need to worry about `pkg-config`, except for having it installed so it can locate the uEv and lite libraries. > With Debian everything just works!™ ... just make sure to install the following, so `ifup` and other basic tools pre-systemd work as intended. root@debian:~# apt install initscripts console-setup > [!TIP] > As of Debian 11 (Bullseye), libuev and libite are part of the main > section of Debian. So just install the -dev packages :) The following script can then be used to configure, build, install and set up your system to run Finit: user@debian:~/finit$ contrib/debian/build.sh However, since `/sbin/init` already exists on your system, the script creates another entry in your GRUB config by updating `$SUPPORTED_INITS` in `/etc/grub.d/10_inux` and run `update-grub`. On reboot you will find a (finit) entry in the "Advanced options for Debian GNU/Linux" section. It is of course also possible to change the default init to Finit: user@debian:~/finit# cd /sbin user@debian:/sbin# sudo mv init oldinit user@debian:/sbin# sudo ln -s finit init Before rebooting, check the default [/etc/finit.conf](finit.conf) and `/etc/finit.d/*.conf` files. The build + install script above provides a few sample `.conf` files. See `initctl ls` after boot for a list of enabled and available services, you can then use `enable` and `disable` comands to `initctl`, followed by `reload` to activate your changes. You can also use a standard [/etc/rc.local](rc.local) for one-shot tasks and initialization like keyboard language etc. > [!NOTE] > For the X Window system, you may need to `sudo apt install elogind` > (Bullseye and later), followed by `initctl reload` to activate it (it > is enabled by default), and logout/login again. The elogind daemon > ensures a regular non-root user can start and interact with an X > session, otherwise keyboard and mouse won't work. When you're happy, > you can enable the lightdm.conf, change the default runlevel to 3, and > presto! you have a desktop again. Have fun! /Joachim ツ [libuEv]: https://github.com/troglobit/libuev [libite]: https://github.com/troglobit/libite finit-4.14/contrib/debian/install.sh0000755000175100001660000000306215054341541013127 #!/bin/sh if [ "x`id -u`" != "x0" ]; then echo echo "=> Unfortunately this script must run as root (sudo) <=" echo exit 1 fi # Adjust base directory grep -q debian Makefile 2>/dev/null if [ $? -eq 0 ]; then cd ../.. elif [ ! -e configure.ac ]; then echo "*** Please run this script from the Finit base directory." exit 1 fi echo echo "*** Install Finit on Debian GNU/Linux" echo "========================================================================" echo "/sbin/finit - PID 1" echo "/lib/finit/plugins/* - All enabled Finit plugins" echo "/etc/finit.conf - Finit configuration file" echo "/etc/finit.d/ - Finit services" echo "/etc/grub.d/10_linux - Add Finit to Grub's SUPPORTED_INITS" echo read -p "Do you want to continue (y/N)? " yorn echo if [ "x$yorn" = "xy" -o "x$yorn" = "xY" ]; then echo "Installing Finit files ..." make install cd /usr/share/doc/finit/contrib/debian for file in finit.conf; do install -vbD $file /etc/$file done cp -va finit.d /etc/ echo "*** Setting up a GRUB boot entry ..." fn=/etc/grub.d/10_linux if [ -e $fn ]; then if `grep SUPPORTED_INITS $fn |head -1 |grep -q finit`; then echo "Already installed, done." else echo "Adding Finit to list of SUPPORTED_INITS ..." sed -i 's/SUPPORTED_INITS="[^"]*/& finit:\/sbin\/finit/' $fn update-grub fi else echo "Cannot find $fn, you'll have to set up your bootloader on your own." fi echo echo "*** Done" echo else echo echo "*** Aborting install." echo fi finit-4.14/contrib/debian/finit.d/0000755000175100001660000000000015054341601012531 5finit-4.14/contrib/debian/finit.d/Makefile.in0000644000175100001660000004670215054341567014542 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib/debian/finit.d ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ SUBDIRS = available docsdir := @docdir@/contrib/debian/finit.d d_LINKS = acpid.conf apparmor.conf avahi-daemon.conf \ bluetooth.conf console-setup.conf elogind.conf \ getty.conf keyboard-setup.conf modules.conf \ plymouth-quit.conf rsyslogd.conf sshd.conf all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/debian/finit.d/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/debian/finit.d/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: $(am__recursive_targets) install-am install-exec-am \ install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-hook .PRECIOUS: Makefile install-exec-hook: @$(MKDIR_P) $(DESTDIR)$(docsdir)/available @$(MKDIR_P) $(DESTDIR)$(docsdir)/enabled @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ rm -f $$lnk; \ $(LN_S) ../$$src $$lnk; \ done uninstall-hook: @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ $(RM) -f $$lnk; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/contrib/debian/finit.d/available/0000755000175100001660000000000015054341601014451 5finit-4.14/contrib/debian/finit.d/available/apparmor.conf0000644000175100001660000000007215054341541017063 sysv [S] /etc/init.d/apparmor -- AppArmor initialization finit-4.14/contrib/debian/finit.d/available/acpid.conf0000644000175100001660000000035315054341541016324 # Handle PWR button to shutdown/reboot -- useful in Qemu (virt-manager) # Depends on a syslog daemon having started. Redirect any output to log. service [2345] env:-/etc/default/acpid log acpid -f $OPTIONS -- ACPI daemon finit-4.14/contrib/debian/finit.d/available/sshd.conf0000644000175100001660000000023015054341541016177 # Start SSH daemon as soon as basic networking comes up service [2345] env:-/etc/default/ssh /usr/sbin/sshd -D $SSHD_OPTS -- OpenSSH daemon finit-4.14/contrib/debian/finit.d/available/lightdm.conf0000644000175100001660000000005515054341541016673 service [3] lightdm -- Light Display Manager finit-4.14/contrib/debian/finit.d/available/plymouth-quit.conf0000644000175100001660000000016715054341541020110 # Need to stop plymouth, or it'll block stdin on tty1 task [S] /usr/bin/plymouth quit -- Stopping Plymouth Boot Screen finit-4.14/contrib/debian/finit.d/available/getty.conf0000644000175100001660000000041115054341541016373 # Consoles to start getty on when system is up tty [12345] /dev/tty1 linux noclear nowait tty [2345] /dev/tty2 linux nowait tty [2345] /dev/tty3 linux nowait tty [2345] /dev/tty4 linux nowait tty [2345] /dev/tty5 linux nowait tty [2345] /dev/tty6 linux nowait finit-4.14/contrib/debian/finit.d/available/bluetooth.conf0000644000175100001660000000040515054341541017247 # To ignore errors like "org.freedesktop.hostname1", update the env file with # "--noplugin=hostname", i.e. append to BLUETOOTHD_OPTS service [2345] log:null env:-/etc/default/bluetooth /usr/libexec/bluetooth/bluetoothd -n $BLUETOOTHD_OPTS -- Bluetooth service finit-4.14/contrib/debian/finit.d/available/sntpd.conf0000644000175100001660000000017515054341541016376 # Simple NTP client (SNTP) service [2345] env:-/etc/default/sntpd sntpd -n $SNTPD_OPTIONS -- SNTP client finit-4.14/contrib/debian/finit.d/available/rsyslogd.conf0000644000175100001660000000031115054341541017104 # Start rsyslogd as soon as possible, should always run # Provides pid/syslogd condition service [S12345] name:syslogd env:-/etc/default/rsyslog rsyslogd -n $RSYSLOGD_OPTIONS -- Reliable syslog daemon finit-4.14/contrib/debian/finit.d/available/xdm.conf0000644000175100001660000000034515054341541016035 # Here we use XDM since it has few dependencies (relatively speaking). # It is also an example of a service without a -- description. # service [3] lxdm -- Lightweight Login Manager service [3] xdm -nodaemon -- X Display Manager finit-4.14/contrib/debian/finit.d/available/syslogd.conf0000644000175100001660000000024715054341541016732 # Start sysklogd as soon as possible, should always run if enabled service [S123456789] env:-/etc/default/syslogd syslogd -F $SYSLOGD_OPTIONS -- System logging daemon finit-4.14/contrib/debian/finit.d/available/console-setup.conf0000644000175100001660000000017315054341541020044 # Oneshot task to run once at bootstrap task [S] /lib/console-setup/console-setup.sh -- Setting up console font and keymap finit-4.14/contrib/debian/finit.d/available/Makefile.in0000644000175100001660000003555515054341567016466 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib/debian/finit.d/available ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ docsdir := @docdir@/contrib/debian/finit.d/available docs_DATA = acpid.conf apparmor.conf avahi-daemon.conf bluetooth.conf \ console-setup.conf elogind.conf getty.conf \ keyboard-setup.conf lightdm.conf modules.conf sntpd.conf \ plymouth-quit.conf rsyslogd.conf sshd.conf syslogd.conf \ xdm.conf EXTRA_DIST = $(docs_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/debian/finit.d/available/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/debian/finit.d/available/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-docsDATA 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-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-docsDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/contrib/debian/finit.d/available/modules.conf0000644000175100001660000000021015054341541016704 ## Linux kernel modules to load #module fbcon #module button #module evdev #module loop #module psmouse #module mousedev #module 8139cp finit-4.14/contrib/debian/finit.d/available/keyboard-setup.conf0000644000175100001660000000017415054341541020203 # Oneshot task to run once at bootstrap task [S] /lib/console-setup/keyboard-setup.sh -- Setting up console keyboard layout finit-4.14/contrib/debian/finit.d/available/avahi-daemon.conf0000644000175100001660000000015415054341541017574 service [2345] env:-/etc/default/avahi-daemon avahi-daemon -s $AVAHI_DAEMON_OPTS -- Avahi mDNS/DNS-SD Stack finit-4.14/contrib/debian/finit.d/available/Makefile.am0000644000175100001660000000054015054341541016427 docsdir := @docdir@/contrib/debian/finit.d/available docs_DATA = acpid.conf apparmor.conf avahi-daemon.conf bluetooth.conf \ console-setup.conf elogind.conf getty.conf \ keyboard-setup.conf lightdm.conf modules.conf sntpd.conf \ plymouth-quit.conf rsyslogd.conf sshd.conf syslogd.conf \ xdm.conf EXTRA_DIST = $(docs_DATA) finit-4.14/contrib/debian/finit.d/available/elogind.conf0000644000175100001660000000041015054341541016657 # On some systems, bootstrap can be really quick and cause elogind # to not start before a user has managed to log in. To prevent # this, add as condition to your TTYs in getty.conf service [2345] /lib/elogind/elogind -- Login manager finit-4.14/contrib/debian/finit.d/Makefile.am0000644000175100001660000000131015054341541014503 SUBDIRS = available docsdir := @docdir@/contrib/debian/finit.d d_LINKS = acpid.conf apparmor.conf avahi-daemon.conf \ bluetooth.conf console-setup.conf elogind.conf \ getty.conf keyboard-setup.conf modules.conf \ plymouth-quit.conf rsyslogd.conf sshd.conf install-exec-hook: @$(MKDIR_P) $(DESTDIR)$(docsdir)/available @$(MKDIR_P) $(DESTDIR)$(docsdir)/enabled @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ rm -f $$lnk; \ $(LN_S) ../$$src $$lnk; \ done uninstall-hook: @for file in $(d_LINKS); do \ lnk=$(DESTDIR)$(docsdir)/enabled/$$file; \ src=available/$$file; \ $(RM) -f $$lnk; \ done finit-4.14/contrib/debian/finit.conf0000644000175100001660000000206515054341541013104 # /etc/finit.conf: Example for Debian GNU/Linux # See /etc/finit.d/*.conf and `initctl list` for other services ## Runlevel to start after bootstrap, runlevel 'S' # Default is 2 #runlevel 2 # Top-level cgroups and their default settings. All groups mandatory # but more can be added, max 8 groups in total currently. The cgroup # 'root' is also available, reserved for RT processes. Settings are # as-is, only one shorthand 'mem.' exists, other than that it's the # cgroup v2 controller default names. #cgroup init cpu.weight:100 #cgroup user cpu.weight:100 #cgroup system cpu.weight:9700 # Task to run if ctrl-alt-del is pressed. This condition is asserted by # Finit upon receiving SIGINT (from the kernel). #task [12345789] initctl reboot -- Rebooting system # Task to run if the kernel gets a power fail condition is pressed. # Asserted by Finit upon receiving SIGPWR (from the kernel). #task [12345789] initctl poweroff -- Shutting down system ## Bootstrap services and tasks # Can be listed here or in /etc/finit.d/*.conf finit-4.14/contrib/debian/Makefile.in0000644000175100001660000005150415054341567013203 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib/debian ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/expand.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/plugin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BASH_DIR = @BASH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ FINIT_CONF = @FINIT_CONF@ FINIT_RCSD = @FINIT_RCSD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ finit_tmpfiles = @finit_tmpfiles@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lite_CFLAGS = @lite_CFLAGS@ lite_LIBS = @lite_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugin_path = @plugin_path@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ system_path = @system_path@ target_alias = @target_alias@ tmpfiles_path = @tmpfiles_path@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uev_CFLAGS = @uev_CFLAGS@ uev_LIBS = @uev_LIBS@ SUBDIRS = finit.d docsdir := @docdir@/contrib/debian docs_DATA = README.md finit.conf build.sh install.sh EXTRA_DIST = $(docs_DATA) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/debian/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/debian/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docsdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-docsDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-docsDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-docsDATA 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-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-docsDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: finit-4.14/contrib/debian/build.sh0000755000175100001660000000300215054341541012552 #!/bin/sh # # This script configures Finit for Debian, which needs a few more plugins # and tweaks than an embedded system usually does. # # Usage: # user@jessie:~/finit$ contrib/debian/build.sh # echo echo "*** Configuring Finit for Debian" if [ ! -e configure ]; then echo " The configure script is missing, maybe you're using a version from GIT?" echo " Attempting to run the autogen.sh script, you will need these tools:" echo " autoconf, automake, libtool, pkg-config ..." echo ./autogen.sh fi echo # The plugins are optional, but you may need D-Bus and X11 if you want # to run X-Window, the other configure flags are however required. ./configure \ --prefix=/usr --exec-prefix= \ --sysconfdir=/etc --localstatedir=/var \ --enable-dbus-plugin --enable-x11-common-plugin \ --enable-alsa-utils-plugin --with-keventd \ --with-random-seed=/var/lib/urandom/random-seed if [ $? -ne 0 ]; then echo echo "*** Configure script failed, have you installed libuEv and libite?" echo exit 1 fi echo echo "*** Building ..." echo make if [ $? -ne 0 ]; then echo echo "*** The build failed for some reason" echo exit 1 fi echo echo "*** Done" echo read -p "*** Run (sudo) install script (y/N)? " yorn if [ "x$yorn" = "xy" -o "x$yorn" = "xY" ]; then sudo contrib/debian/install.sh else echo echo "*** Use 'sudo contrib/debian/install.sh' later to install Finit" echo fi finit-4.14/contrib/debian/Makefile.am0000644000175100001660000000021215054341541013150 SUBDIRS = finit.d docsdir := @docdir@/contrib/debian docs_DATA = README.md finit.conf build.sh install.sh EXTRA_DIST = $(docs_DATA) finit-4.14/contrib/initctl0000644000175100001660000000556615054341541011304 _cond() { initctl -pt cond dump | awk '{print $4}' | sed 's/<\(.*\)>/\1/' } _ident() { if [ -n "$1" ]; then initctl ident | grep -q $1 else initctl ident fi } _svc() { initctl ls -pt | grep $1 | sed "s/.*\/\(.*\)/\1/g" | sort -u } _enabled() { echo "$(_svc enabled)" } _available() { all=$(mktemp) ena=$(mktemp) echo "$(_svc available)" >$all echo "$(_svc enabled)" >$ena grep -v -f $ena $all rm $all $ena } # Determine first non-option word. Usually the command _firstword() { local firstword i firstword= for ((i = 1; i < ${#COMP_WORDS[@]}; ++i)); do if [[ ${COMP_WORDS[i]} != -* ]]; then firstword=${COMP_WORDS[i]} break fi done echo $firstword } # Determine last non-option word. Uusally a sub-command _lastword() { local lastword i lastword= for ((i = 1; i < ${#COMP_WORDS[@]}; ++i)); do if [[ ${COMP_WORDS[i]} != -* ]] && [[ -n ${COMP_WORDS[i]} ]] && [[ ${COMP_WORDS[i]} != $cur ]]; then lastword=${COMP_WORDS[i]} fi done echo $lastword } _initctl() { local cur command cur=${COMP_WORDS[COMP_CWORD]} prev="${COMP_WORDS[COMP_CWORD-1]}" firstword=$(_firstword) lastword=$(_lastword) commands="status cond debug help kill ls log version list enable \ disable touch show cat edit create delete reload start \ stop restart signal cgroup ps top plugins runlevel reboot \ halt poweroff suspend utmp" cond_cmds="set get clear status dump" cond_types="hook net pid service task usr" signals="int term hup stop tstp cont usr1 usr2 pwr" options="-b --batch \ -c --create \ -d --debug \ -f --force \ -h --help \ -j --json \ -n --noerr \ -1 --once \ -p --plain \ -q --quiet \ -t --no-heading \ -v --verbose \ -V --version" case "${firstword}" in enable) COMPREPLY=($(compgen -W "$(_available)" -- $cur)) ;; disable|touch) COMPREPLY=($(compgen -W "$(_enabled)" -- $cur)) ;; show|cat|edit|delete) COMPREPLY=($(compgen -W "$(_svc .)" -- $cur)) ;; start|stop|restart|log|status) COMPREPLY=($(compgen -W "$(_ident)" -- $cur)) ;; signal|kill) if $(_ident "${prev}"); then COMPREPLY=($(compgen -W "$signals" -- $cur)) else COMPREPLY=($(compgen -W "$(_ident)" -- $cur)) fi ;; cond) case "${lastword}" in set|clear) compopt -o nospace COMPREPLY=($(compgen -W "usr/" -- $cur)) ;; get) COMPREPLY=($(compgen -W "$(_cond)" -- $cur)) ;; dump) COMPREPLY=($(compgen -W "$cond_types" -- $cur)) ;; *) COMPREPLY=($(compgen -W "$cond_cmds" -- $cur)) ;; esac ;; *) COMPREPLY=($(compgen -W "$commands" -- $cur)) ;; esac if [[ $cur == -* ]]; then COMPREPLY=($(compgen -W "$options" -- $cur)) fi } complete -F _initctl initctl finit-4.14/Makefile.am0000644000175100001660000000246215054341541010277 ACLOCAL_AMFLAGS = -I m4 SUBDIRS = man plugins src system tmpfiles.d dist_doc_DATA = README.md LICENSE contrib/finit.conf if CONTRIB SUBDIRS += contrib endif if DOC SUBDIRS += doc endif if LIBSYSTEMD SUBDIRS += libsystemd endif if LIBSYSTEMD SUBDIRS += test # Explicit dependency to ensure libsystemd is built before test test: libsystemd else SUBDIRS += test endif # Compat hook install-dev: @make -C src install-pkgincludeHEADERS # Target to run when building a release release: distcheck @for file in $(DIST_ARCHIVES); do \ md5sum $$file > ../$$file.md5; \ sha256sum $$file > ../$$file.sha256; \ done @mv $(DIST_ARCHIVES) ../ @echo @echo "Resulting release files:" @echo "=================================================================" @for file in $(DIST_ARCHIVES); do \ printf "$$file \tDistribution tarball\n"; \ printf "$$file.md5\t"; cat ../$$file.md5 | cut -f1 -d' '; \ printf "$$file.sha256\t"; cat ../$$file.sha256 | cut -f1 -d' '; \ done DISTCHECK_CONFIGURE_FLAGS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --enable-testserv-plugin --enable-x11-common-plugin \ --with-watchdog --with-keventd --with-fstab=/etc/fstab \ --with-libsystemd --with-bash-completion-dir=no