head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC5:1.1.1.1.2.2
	netbsd-11:1.1.1.1.0.2
	expat-2-8-1:1.1.1.1
	expat:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2026.06.13.16.41.48;	author jdc;	state Exp;
branches
	1.1.1.1;
next	;
commitid	OvLcw9veAeJ0QEJG;

1.1.1.1
date	2026.06.13.16.41.48;	author jdc;	state Exp;
branches
	1.1.1.1.2.1;
next	;
commitid	OvLcw9veAeJ0QEJG;

1.1.1.1.2.1
date	2026.06.13.16.41.48;	author martin;	state dead;
branches;
next	1.1.1.1.2.2;
commitid	CEh2BY99NRqLYZJG;

1.1.1.1.2.2
date	2026.06.16.08.23.19;	author martin;	state Exp;
branches;
next	;
commitid	CEh2BY99NRqLYZJG;


desc
@@


1.1
log
@Initial revision
@
text
@# Style guidelines for `configure.ac`

Version `2019.08.09.21.54`


## Purpose

Define a small set of rules for style used in Expat's `configure.ac`
so that we have a common ground and something documented to refer to
in pull requests, when style is off.


## 1. Quoting
Quote "everything":
```
AC_DEFINE([HAVE_FOO], [1], [Define to 1 if you have the `foo' function.])
```

## 2. Parameter indentation

Parameters to functions either go
- (a) on the the same line or
- (b) align vertically or
- (c) go to the next line, with the first character indented 2 spaces more
  than the first *non-`[`*(!) parent level character,
  i.e. 2 or [3 columns further right](https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Autoconf-Language.html):

```
CALL([parameter], [parameter], [parameter])

CALL([parameter],
     [parameter],
     [parameter])

CALL([parameter], [parameter],
  [CALL(
     [CALL()])])

  ^  ^
  |  2 + 3(!) spaces
  2 spaces
```

## 3. Consecutive call / multi-line indentation

Consecutive calls to macros (= on the the same nesting level) are aligned vertically:

```
CALL([parameter],
  [CALL([])
   CALL([])
   CALL([])])
```

## 4. Closing bracket placement
Closing braces accumulate on the same line in general...

```
CALL(
  [CALL([CALL([])],
        [CALL([])])
   CALL([])])
```

...but can go a new line (e.g. with `AC_LANG_SOURCE`) to match parameter indentation rule (2), i.e. either

```
CALL([CALL([
    one
    two
  ])],
  [CALL()])
```

.. or ..
```
CALL([CALL([
        one
        two
     ])],
     [CALL()])
```


EOF
@


1.1.1.1
log
@Import expat 2.8.1 as expat-2-8-1
@
text
@@


1.1.1.1.2.1
log
@file configure-ac-style.md was added on branch netbsd-11 on 2026-06-16 08:23:19 +0000
@
text
@d1 85
@


1.1.1.1.2.2
log
@Pull up the following revisions, requested by jdc in ticket #311:

	external/mit/expat/dist/lib/libexpat.map.in     up to 1.1.1.1
	external/mit/expat/dist/lib/random_arc4random.c up to 1.1.1.1
	external/mit/expat/dist/lib/random_arc4random.h up to 1.1.1.1
	external/mit/expat/dist/lib/random_arc4random_buf.c up to 1.1.1.1
	external/mit/expat/dist/lib/random_arc4random_buf.h up to 1.1.1.1
	external/mit/expat/dist/lib/random_dev_urandom.c up to 1.1.1.1
	external/mit/expat/dist/lib/random_dev_urandom.h up to 1.1.1.1
	external/mit/expat/dist/lib/random_getentropy.c up to 1.1.1.1
	external/mit/expat/dist/lib/random_getentropy.h up to 1.1.1.1
	external/mit/expat/dist/lib/random_getrandom.c  up to 1.1.1.1
	external/mit/expat/dist/lib/random_getrandom.h  up to 1.1.1.1
	external/mit/expat/dist/lib/random_rand_s.c     up to 1.1.1.1
	external/mit/expat/dist/lib/random_rand_s.h     up to 1.1.1.1
	external/mit/expat/dist/coverage.sh             up to 1.1.1.1
	external/mit/expat/dist/cmake/autotools/expat__linux.cmake.in up to 1.1.1.1
	external/mit/expat/dist/cmake/autotools/expat__macos.cmake.in up to 1.1.1.1
	external/mit/expat/dist/cmake/autotools/expat__windows.cmake.in up to 1.1.1.1
	external/mit/expat/dist/qa.sh                   up to 1.1.1.1
	external/mit/expat/dist/gennmtab/gennmtab.c     up to 1.1.1.1
	external/mit/expat/dist/.clang-format           up to 1.1.1.1
	external/mit/expat/dist/apply-clang-format.sh   up to 1.1.1.1
	external/mit/expat/dist/apply-clang-tidy.sh     up to 1.1.1.1
	external/mit/expat/dist/clean_coverage.sh       up to 1.1.1.1
	external/mit/expat/dist/configure-ac-style.md   up to 1.1.1.1
	external/mit/expat/dist/distribute.sh           up to 1.1.1.1
	external/mit/expat/dist/memory-sanitizer-blacklist.txt up to 1.1.1.1
	external/mit/expat/dist/Makefile.in             delete
	external/mit/expat/dist/aclocal.m4              delete
	external/mit/expat/dist/configure               delete
	external/mit/expat/dist/expat_config.h.in       delete
	external/mit/expat/dist/cmake/autotools/expat.cmake delete
	external/mit/expat/dist/conftools/compile       delete
	external/mit/expat/dist/conftools/ar-lib        delete
	external/mit/expat/dist/conftools/config.guess  delete
	external/mit/expat/dist/conftools/config.sub    delete
	external/mit/expat/dist/conftools/depcomp       delete
	external/mit/expat/dist/conftools/expat.m4      delete
	external/mit/expat/dist/conftools/missing       delete
	external/mit/expat/dist/conftools/install-sh    delete
	external/mit/expat/dist/conftools/ltmain.sh     delete
	external/mit/expat/dist/conftools/test-driver   delete
	external/mit/expat/dist/doc/Makefile.in         delete
	external/mit/expat/dist/doc/xmlwf.1             delete
	external/mit/expat/dist/examples/Makefile.in    delete
	external/mit/expat/dist/lib/Makefile.in         delete
	external/mit/expat/dist/m4/libtool.m4           delete
	external/mit/expat/dist/m4/ltoptions.m4         delete
	external/mit/expat/dist/m4/ltsugar.m4           delete
	external/mit/expat/dist/m4/ltversion.m4         delete
	external/mit/expat/dist/m4/lt~obsolete.m4       delete
	external/mit/expat/dist/tests/benchmark/Makefile.in delete
	external/mit/expat/dist/tests/Makefile.in       delete
	external/mit/expat/dist/tests/acc_tests_cxx.cpp delete
	external/mit/expat/dist/tests/alloc_tests_cxx.cpp delete
	external/mit/expat/dist/tests/basic_tests_cxx.cpp delete
	external/mit/expat/dist/tests/chardata_cxx.cpp  delete
	external/mit/expat/dist/tests/common_cxx.cpp    delete
	external/mit/expat/dist/tests/dummy_cxx.cpp     delete
	external/mit/expat/dist/tests/handlers_cxx.cpp  delete
	external/mit/expat/dist/tests/memcheck_cxx.cpp  delete
	external/mit/expat/dist/tests/minicheck_cxx.cpp delete
	external/mit/expat/dist/tests/misc_tests_cxx.cpp delete
	external/mit/expat/dist/tests/ns_tests_cxx.cpp  delete
	external/mit/expat/dist/tests/nsalloc_tests_cxx.cpp delete
	external/mit/expat/dist/tests/runtests_cxx.cpp  delete
	external/mit/expat/dist/tests/structdata_cxx.cpp delete
	external/mit/expat/dist/xmlwf/Makefile.in       delete
	external/mit/expat/dist/CMake.README            up to 1.1.1.9
	external/mit/expat/dist/CMakeLists.txt          up to 1.1.1.9
	external/mit/expat/dist/Changes                 up to 1.1.1.10
	external/mit/expat/dist/ConfigureChecks.cmake   up to 1.1.1.5
	external/mit/expat/dist/Makefile.am             up to 1.1.1.5
	external/mit/expat/dist/README.md               up to 1.1.1.5
	external/mit/expat/dist/configure.ac            up to 1.1.1.8
	external/mit/expat/dist/expat_config.h.cmake    up to 1.1.1.4
	external/mit/expat/dist/fix-xmltest-log.sh      up to 1.1.1.4
	external/mit/expat/dist/doc/reference.html      up to 1.1.1.9
	external/mit/expat/dist/doc/xmlwf.xml           up to 1.1.1.6
	external/mit/expat/dist/examples/element_declarations.c up to 1.1.1.2
	external/mit/expat/dist/fuzz/xml_lpm_fuzzer.cpp up to 1.1.1.2
	external/mit/expat/dist/fuzz/xml_parse_fuzzer.c up to 1.1.1.3
	external/mit/expat/dist/fuzz/xml_parsebuffer_fuzzer.c up to 1.1.1.3
	external/mit/expat/dist/lib/Makefile.am         up to 1.1.1.4
	external/mit/expat/dist/lib/expat.h             up to 1.1.1.10
	external/mit/expat/dist/lib/expat_external.h    up to 1.1.1.6
	external/mit/expat/dist/lib/internal.h          up to 1.1.1.7
	external/mit/expat/dist/lib/libexpat.def.cmake  up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c          up to 1.12
	external/mit/expat/dist/lib/xmlrole.c           up to 1.1.1.8
	external/mit/expat/dist/lib/xmlrole.h           up to 1.1.1.5
	external/mit/expat/dist/lib/xmltok.c            up to 1.8
	external/mit/expat/dist/lib/xmltok.h            up to 1.6
	external/mit/expat/dist/lib/xmltok_ns.c         up to 1.1.1.4
	external/mit/expat/dist/tests/Makefile.am       up to 1.1.1.4
	external/mit/expat/dist/tests/alloc_tests.c     up to 1.1.1.2
	external/mit/expat/dist/tests/basic_tests.c     up to 1.1.1.2
	external/mit/expat/dist/tests/common.c          up to 1.1.1.3
	external/mit/expat/dist/tests/handlers.c        up to 1.1.1.2
	external/mit/expat/dist/tests/handlers.h        up to 1.1.1.2
	external/mit/expat/dist/tests/memcheck.c        up to 1.1.1.5
	external/mit/expat/dist/tests/minicheck.c       up to 1.1.1.7
	external/mit/expat/dist/tests/minicheck.h       up to 1.1.1.8
	external/mit/expat/dist/tests/misc_tests.c      up to 1.1.1.3
	external/mit/expat/dist/tests/nsalloc_tests.c   up to 1.1.1.2
	external/mit/expat/dist/tests/structdata.c      up to 1.1.1.4
	external/mit/expat/dist/tests/xmltest.sh        up to 1.7
	external/mit/expat/dist/win32/README.txt        up to 1.1.1.7
	external/mit/expat/dist/win32/build_expat_iss.bat up to 1.1.1.4
	external/mit/expat/dist/win32/expat.iss         up to 1.1.1.10
	external/mit/expat/dist/xmlwf/unixfilemap.c     up to 1.1.1.6
	external/mit/expat/dist/xmlwf/xmlfile.c         up to 1.1.1.7
	external/mit/expat/dist/xmlwf/xmlwf.c           up to 1.1.1.9
	external/mit/expat/dist/xmlwf/xmlwf_helpgen.py  up to 1.1.1.4


Import expat 2.8.1 as expat-2-8-1
Merge expat 2.8.1
@
text
@a0 85
# Style guidelines for `configure.ac`

Version `2019.08.09.21.54`


## Purpose

Define a small set of rules for style used in Expat's `configure.ac`
so that we have a common ground and something documented to refer to
in pull requests, when style is off.


## 1. Quoting
Quote "everything":
```
AC_DEFINE([HAVE_FOO], [1], [Define to 1 if you have the `foo' function.])
```

## 2. Parameter indentation

Parameters to functions either go
- (a) on the the same line or
- (b) align vertically or
- (c) go to the next line, with the first character indented 2 spaces more
  than the first *non-`[`*(!) parent level character,
  i.e. 2 or [3 columns further right](https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Autoconf-Language.html):

```
CALL([parameter], [parameter], [parameter])

CALL([parameter],
     [parameter],
     [parameter])

CALL([parameter], [parameter],
  [CALL(
     [CALL()])])

  ^  ^
  |  2 + 3(!) spaces
  2 spaces
```

## 3. Consecutive call / multi-line indentation

Consecutive calls to macros (= on the the same nesting level) are aligned vertically:

```
CALL([parameter],
  [CALL([])
   CALL([])
   CALL([])])
```

## 4. Closing bracket placement
Closing braces accumulate on the same line in general...

```
CALL(
  [CALL([CALL([])],
        [CALL([])])
   CALL([])])
```

...but can go a new line (e.g. with `AC_LANG_SOURCE`) to match parameter indentation rule (2), i.e. either

```
CALL([CALL([
    one
    two
  ])],
  [CALL()])
```

.. or ..
```
CALL([CALL([
        one
        two
     ])],
     [CALL()])
```


EOF
@


