forked from xythian/wp-lambdamoo
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathextensions2_tutorial.ac
More file actions
100 lines (79 loc) · 3.69 KB
/
extensions2_tutorial.ac
File metadata and controls
100 lines (79 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
MOO_XT_DECLARE_EXTENSIONS([
#| Everything above this line is boilerplate; do not edit.
#| Run "autoconf -f" after any changes to extensions2.ac
#| To start the tutorial (see Extensions.md), copy this file to
#| extensions2.ac, make that writable and do all editing there.
#| And yes, this file is nothing but comments and,
#| in its initial state, does nothing.
#| Lines beginning with #| are supposed to stay commented forever.
#| Lines beginning with #(tab) get uncommented at various times;
#| just delete the # but leave the tab there, then put the line
#| back the way it was when it comes time to recomment it.
#| The "TOP" section for tutorial purposes is
#| everything from here down to "[ end of extension declarations ]"
#| This all being the first argument to MOO_XT_DECLARE_EXTENSIONS(),
#| (other arguments except the 9th are M4-expanded and ignored),
#| will be a sequence of cmds in the "MOO_XT Language".
#| Indentation matters in this language.
# %%extension hello
# %disabled
# %? Hello Facilities:
#| Only one of these 3 lines should be uncommented:
# --enable- hello
# --enable- hi
# --enable- hi = KWD,...
# %?- no hello() function, sorry
# %? provide a hello() function
# XT_CSRCS = hello.c
# %cdefine HELLO_CORE
# %option esmtp HELLO_ESMTP
# %alt ehlo
# %? do the esmtp thing
#| Next line is boilerplate; do not edit.
],,,,,,,,[ end of extension declarations ],,,,,,,,
#| Everything from here to the last closing paren is straight
#| autoconf/M4 code that is expanded/evaluated for side-effects only.
#| The main m4 parsing weirdness to know about is that, in argument
#| lists, whitespace after the initial open paren and after any top-level
#| commas gets discarded, but a comment will end whatever run of
#| whitespace it's in, meaning any whitespace *after* the comment
#| (starting on the next line) will be kept and become part of the
#| argument, which may mess things up, so try not to do that.
#| At this point we begin the "MIDDLE" section, for declaring
#| options associated with your extension:
MOO_DECLARE_OPTIONS(
dnl [[HELLO_ESMTP], [bool], no, [make hello() do The ESMTP Thing]],
dnl|
dnl| As a general rule, do not use '#' comments in m4 argument lists
dnl| unless you are sure the macro you are invoking can discard them.
dnl|
dnl| MOO_XT_DECLARE_EXTENSIONS, which encloses this whole file,
dnl| is good at discarding '#' comments;
dnl| MOO_DECLARE_OPTIONS and most other m4 macros are *not*.
dnl|
dnl| So here we use 'dnl' (Delete to NewLine, and that means the
dnl| newline goes away, too) comments which don't have this problem,
dnl| since they expand to *nothing* rather than expanding to themselves
dnl| the way '#' comments do.
dnl|
dnl| You do, however, still want to make sure you do not *INDENT*
dnl| the next line after this comment ends, because that *will*
dnl| introduce whitespace that will not go away.
)
#| ____________________________________________________
#| And, finally, the "BOTTOM" section. Everything from here to the next
#| line of underscores is for your own macro definitions (m4_define() or
#| AC_DEFUN()) if you need to have any.
#| ____________________________________________________
#| The next closing paren is boilerplate; do not edit.
)dnl| --- end of extensions2.ac ---
dnl|
dnl| We're using 'dnl's here because, now that we're done with
dnl| MOO_XT_DECLARE_EXTENSIONS, we're essentially back out in configure.ac,
dnl| where everything being expanded shows up in ./configure,
dnl| including the '#' comments, which, in this case, is
dnl| not what anyone wants.
dnl|
dnl| Uncomment the next line and rerun autoconf
dnl| if you want to see what the MOO_XT_* things actually do:
dnl MOO_XT_DUMP_EVERYTHING()