# bootstrap.conf (luaposix) version 2013-06-27
# Written by Gary V. Vaughan, 2010

# Copyright (C) 2013 Free Software Foundation, Inc.

# This file is part of luaposix.
# See README for license.

## -------------- ##
## Configuration. ##
## -------------- ##

# List of slingshot files to link into stdlib tree before autotooling.
slingshot_files='
	.autom4te.cfg
	GNUmakefile
	Makefile.am
	build-aux/do-release-commit-and-tag
	build-aux/gitlog-to-changelog
	build-aux/mkrockspecs
	build-aux/release.mk
	build-aux/rockspecs.mk
	build-aux/sanity.mk
	build-aux/specl.mk
	m4/ax_compare_version.m4
	m4/ax_lua.m4
	m4/slingshot.m4
	travis.yml.in
'

# Additional gnulib-tool options to use.
gnulib_tool_options='
        --no-changelog
	--avoid=dummy
'

# gnulib modules used by this package.
gnulib_modules='
        warnings
        manywarnings
'

# Extra gnulib files that are not in modules, which override files of
# the same name installed by other bootstrap tools.
gnulib_non_module_files='
        doc/INSTALL
        build-aux/config.guess
        build-aux/config.sub
        build-aux/install-sh
'

# We don't actually use any gnulib C code, but that's no reason to
# let the defaults nuke our lib directory!
source_base=unused

# The not-synced with gnulib warning is bogus until upstream adopts
# the saner bootstrap script.
require_bootstrap_uptodate=:


## -------------------------------- ##
## Source Slingshot customisations. ##
## -------------------------------- ##

# Integrate the Slingshot submodule bootstrap.
# Make sure that bootstrap.slingshot is sourced from the current
# directory if we were invoked with "sh bootstrap".
case $0 in
  */*) . "$0.slingshot" ;;
  *)   . ./"$0.slingshot" ;;
esac


## --------------- ##
## Hook functions. ##
## --------------- ##

# Even though we don't get our gitlog-to-changelog from gnulib, this
# function is still useful to us!
func_add_hook func_gnulib_tool func_ensure_changelog


# luaposix_ignore_gnulib_ignore
# ----------------------------
# gnulib-tool updates m4/.gitignore and lib/.gitignore, and keeping
# generated files under version control does not make sense.  Since
# lib is entirely ignored, we only need to prepopulate the m4 ignore
# files with generated files not tracked by gnulib-tool.
luaposix_ignore_gnulib_ignore ()
{
    $debug_cmd

    $require_macro_dir

    if test -f "$macro_dir/.gitignore" ; then
      :
    else
      func_verbose "creating initial \`$macro_dir/.gitignore'"
      cat > $macro_dir/.gitignore <<\EOF
# files created by bootstrap, but that gnulib doesn't track
*~
/.gitignore
/gnulib-cache.m4
/gnulib-comp.m4
/libtool.m4
/ltoptions.m4
/ltsugar.m4
/ltversion.m4
/lt~obsolete.m4
EOF
    fi
}
func_add_hook func_prep luaposix_ignore_gnulib_ignore


# luaposix_remove_empty_lib
# -------------------------
# No need to maintain the always empty lib subdir.
luaposix_remove_empty_lib ()
{
    $debug_cmd

    rm -rf $source_base
}
func_add_hook func_gnulib_tool luaposix_remove_empty_lib


# luaposix_force_readme
# ---------------------
# Automake (without --foreign requires that README exists).
luaposix_force_readme ()
{
    $debug_cmd

    $LN_S README.md README 2>/dev/null
}
func_add_hook func_gnulib_tool luaposix_force_readme


# Local variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "# bootstrap.conf (luaposix) version "
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "$"
# End:
