custom_subdirs.m4 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. dnl * Copyright 2014 Luke Dashjr
  2. dnl *
  3. dnl * This program is free software; you can redistribute it and/or modify it
  4. dnl * under the terms of the GNU General Public License as published by the Free
  5. dnl * Software Foundation; either version 3 of the License, or (at your option)
  6. dnl * any later version. See COPYING for more details.
  7. m4_divert_text([DEFAULTS], [
  8. custom_subdirs=
  9. ])
  10. AC_DEFUN([BFG_CUSTOM_SUBDIR],[
  11. if false; then
  12. AC_CONFIG_SUBDIRS([$1])
  13. fi
  14. custom_subdirs="$custom_subdirs $1"
  15. custom_subdir_[]AS_TR_SH([$1])_args="$2"
  16. custom_subdir_[]AS_TR_SH([$1])_forceargs="$3"
  17. ])
  18. AC_DEFUN([BFG_CUSTOM_SUBDIRS_OUTPUT],[
  19. if test "$no_recursion" != yes; then
  20. orig_subdirs="$subdirs"
  21. orig_ac_configure_args="$ac_configure_args"
  22. for custom_subdir in $custom_subdirs; do
  23. subdirs="$custom_subdir"
  24. custom_subdir_base="AS_TR_SH([$custom_subdir])"
  25. eval 'ac_configure_args="$custom_subdir_'"$custom_subdir_base"'_args $orig_ac_configure_args $custom_subdir_'"$custom_subdir_base"'_forceargs"'
  26. _AC_OUTPUT_SUBDIRS
  27. done
  28. subdirs="$orig_subdirs"
  29. ac_configure_args="$orig_ac_configure_args"
  30. fi
  31. ])