1 $! 22 September 2009. SMS.
3 $! Extract the AC_INIT strings from the "configure.ac" file.
5 $! P1 = input file spec.
6 $! P2, P3, P4 = logical names to be defined with the extracted text.
8 $! We're expecting to extract the bracketed text from the "[text]"
9 $! tokens from a block of text like:
13 $! [bug-wget@gnu.org])
15 $! That is, starting with "AC_INIT", and ending with ")".
20 $ on error then goto tidy
22 $ open /error = tidy /read file_in 'p1'
24 $ state = 0 ! Looking for "AC_INIT".
28 $ read /error = tidy file_in line
29 $ line_len = f$length( line)
32 $ if (f$locate( "AC_INIT", line) .lt line_len)
35 $ state = 1 ! Looking for ")".
38 $ if (f$locate( ")", line) .lt line_len)
40 $ state = 2 ! Found ")". (Done.)
42 $ ac_init = ac_init+ line
45 $ if (state .ne. 2) then goto loop_read
47 $ t1 = f$element( 0, "]", f$element( 1, "[", ac_init))
48 $ t2 = f$element( 0, "]", f$element( 2, "[", ac_init))
49 $ t3 = f$element( 0, "]", f$element( 3, "[", ac_init))
55 $ write sys$output " 1: >''t1'<"
62 $ write sys$output " 2: >''t2'<"
69 $ write sys$output " 3: >''t3'<"