bootstrap 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. unset bs_srcdir
  3. if test X"`dirname / 2>/dev/null`" = X"/"; then
  4. bs_scrdir=`dirname $0`
  5. else
  6. bs_scrdir="${0%/*}"
  7. fi
  8. test -n "$bs_scrdir" && cd "$bs_scrdir" || echo "Warning: cannot get sources directory" 1>&2
  9. # This is more portable than `which' but comes with
  10. # the caveat of not(?) properly working on busybox's ash:
  11. existence()
  12. {
  13. command -v "$1" >/dev/null 2>&1
  14. }
  15. if existence uncrustify; then
  16. echo "Installing uncrustify hook and configuration"
  17. # Install uncrustify format symlink (if possible)
  18. ln -s contrib/uncrustify.cfg uncrustify.cfg 2> /dev/null
  19. # Install pre-commit hook (if possible)
  20. ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null
  21. else
  22. echo "Uncrustify not detected, hook not installed. Please install uncrustify if you plan on doing development"
  23. fi
  24. if existence libtool || existence libtoolize || existence glibtoolize || existence slibtool; then
  25. autoreconf -I m4 -i ${1+"$@"}
  26. else
  27. echo "*** No libtoolize (libtool) or libtool found, please install it ***" >&2;
  28. exit 1
  29. fi