\n"; main lexbuf } (* Font changes *) | "{\\it" " "* | "{\\itshape" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\em" " "* | "{\\sl" " "* | "{\\slshape" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\bf" " "* | "{\\sf" " "* | "{\\bfseries" " "* | "{\\sffamily" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\sc" " "* | "{\\scshape" " "* | "{\\normalfont" " "* | "{\\upshape" " "* | "{\\mdseries" " "* | "{\\rmfamily" " "* { save_state main lexbuf; main lexbuf } | "{\\tt" " "* | "{\\ttfamily" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\small" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\rm" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\cal" " "* { save_state main lexbuf; main lexbuf } | "\\cal" " "* { main lexbuf } (* Double quotes *) (*** | '"' { print_s ""; indoublequote lexbuf; print_s ""; main lexbuf } ***) (* Verb, verbatim *) | ("\\verb" | "\\path") _ { verb_delim := Lexing.lexeme_char lexbuf 5; print_s ""; inverb lexbuf; print_s ""; main lexbuf } | "\\begin{verbatim}" { print_s "
"; inverbatim lexbuf; print_s ""; main lexbuf } (* Raw html, latex only *) | "\\begin{rawhtml}" { rawhtml lexbuf; main lexbuf } | "\\begin{latexonly}" { latexonly lexbuf; main lexbuf } (* Itemize and similar environments *) | "\\item[" [^ ']']* "]" { print_s "
"; MathDisplay | MathNoDisplay -> MathNoDisplay | MathDisplay -> print_s "\n"; MathNone end; main lexbuf } (* \hkip *) | "\\hskip" space* dimension (space* "plus" space* dimension)? (space* "minus" space* dimension)? { print_s " "; main lexbuf } (* Special characters *) | "\\char" ['0'-'9']+ { let lxm = Lexing.lexeme lexbuf in let code = String.sub lxm 5 (String.length lxm - 5) in print_c(Char.chr(int_of_string code)); main lexbuf } | "<" { print_s "<"; main lexbuf } | ">" { print_s ">"; main lexbuf } | "~" { print_s " "; main lexbuf } | "``" { print_s "“"; main lexbuf } | "''" { print_s "”"; main lexbuf } | "--" { print_s (if !html_entities then "–" else "-"); main lexbuf } | "---" { print_s (if !html_entities then "—" else "-"); main lexbuf } | "^" { if is_math_mode() then begin let buf = Lexing.from_string (raw_arg lexbuf) in print_s ""; save_state main buf; print_s"" end else print_s "^"; main lexbuf } | "_" { if is_math_mode() then begin let buf = Lexing.from_string (raw_arg lexbuf) in print_s ""; save_state main buf; print_s"" end else print_s "_"; main lexbuf } (* URLs *) | "\\url" { let url = raw_arg lexbuf in if !hevea_url then let text = raw_arg lexbuf in print_hevea_url url text else print_latex_url url; main lexbuf } | "\\" " " { print_s " "; main lexbuf } (* General case for environments and commands *) | ("\\begin{" | "\\end{") ['A'-'Z' 'a'-'z' '@']+ "}" | "\\" (['A'-'Z' 'a'-'z' '@']+ '*'? " "? | [^ 'A'-'Z' 'a'-'z']) { let rec exec_action = function | Print str -> print_s str | Print_arg -> print_arg lexbuf | Raw_arg f -> f (raw_arg lexbuf) | Skip_arg -> save_nesting skip_arg lexbuf | Recursive s -> main (Lexing.from_string s) | Parameterized f -> List.iter exec_action (f (raw_arg lexbuf)) in let m = chop_last_space (Lexing.lexeme lexbuf) in List.iter exec_action (find_macro m); main lexbuf } (* Nesting of braces *) | '{' { incr brace_nesting; main lexbuf } | '}' { if !brace_nesting <= 0 then () else begin decr brace_nesting; main lexbuf end } (* Default rule for other characters *) | eof { () } | ['A'-'Z' 'a'-'z']+ { if is_math_mode() then print_s ""; print_s(Lexing.lexeme lexbuf); if is_math_mode() then print_s ""; main lexbuf } | _ { print_c(Lexing.lexeme_char lexbuf 0); main lexbuf } and indoublequote = parse '"' { () } | "<" { print_s "<"; indoublequote lexbuf } | ">" { print_s ">"; indoublequote lexbuf } | "&" { print_s "&"; indoublequote lexbuf } | "\\\"" { print_s "\""; indoublequote lexbuf } | "\\\\" { print_s "\\"; indoublequote lexbuf } | eof { () } | _ { print_c(Lexing.lexeme_char lexbuf 0); indoublequote lexbuf } and inverb = parse "<" { print_s "<"; inverb lexbuf } | ">" { print_s ">"; inverb lexbuf } | "&" { print_s "&"; inverb lexbuf } | eof { () } | _ { let c = Lexing.lexeme_char lexbuf 0 in if c == !verb_delim then () else (print_c c; inverb lexbuf) } and inverbatim = parse "<" { print_s "<"; inverbatim lexbuf } | ">" { print_s ">"; inverbatim lexbuf } | "&" { print_s "&"; inverbatim lexbuf } | "\\end{verbatim}" { () } | eof { () } | _ { print_c(Lexing.lexeme_char lexbuf 0); inverbatim lexbuf } and rawhtml = parse "\\end{rawhtml}" { () } | eof { () } | _ { print_c(Lexing.lexeme_char lexbuf 0); rawhtml lexbuf } and latexonly = parse "\\end{latexonly}" { () } | eof { () } | _ { latexonly lexbuf } and print_arg = parse "{" { save_nesting main lexbuf } | "[" { skip_optional_arg lexbuf; print_arg lexbuf } | " " { print_arg lexbuf } | eof { () } | _ { print_c(Lexing.lexeme_char lexbuf 0); main lexbuf } and skip_arg = parse "{" { incr brace_nesting; skip_arg lexbuf } | "}" { decr brace_nesting; if !brace_nesting > 0 then skip_arg lexbuf } | "[" { if !brace_nesting = 0 then skip_optional_arg lexbuf; skip_arg lexbuf } | " " { skip_arg lexbuf } | eof { () } | _ { if !brace_nesting > 0 then skip_arg lexbuf } and raw_arg = parse " " { raw_arg lexbuf } | '{' { nested_arg lexbuf } | "[" { skip_optional_arg lexbuf; raw_arg lexbuf } | '\\' ['A'-'Z' 'a'-'z']+ { Lexing.lexeme lexbuf } | eof { "" } | _ { Lexing.lexeme lexbuf } and nested_arg = parse '}' { "" } | '{' { let l = nested_arg lexbuf in "{" ^ l ^ "}" ^ (nested_arg lexbuf) } | eof { "" } | [^ '{' '}']+{ let x = Lexing.lexeme lexbuf in x ^ (nested_arg lexbuf) } and skip_optional_arg = parse "]" { () } | eof { () } | _ { skip_optional_arg lexbuf } (* ajout personnel: [read_macros] pour lire les macros (La)TeX *) and read_macros = parse | "\\def" ('\\' ['a'-'z' 'A'-'Z' '@']+ as s) ("#" (['0'-'9']+ as n))? { let b = raw_arg lexbuf in def_macro s n b; read_macros lexbuf } | "\\newcommand" space* "{" ("\\" ['a'-'z' 'A'-'Z']+ as s) "}" ("[" (['0'-'9']+ as n) "]")? { let b = raw_arg lexbuf in def_macro s n b; read_macros lexbuf } | "\\let" ('\\' ['a'-'z' 'A'-'Z' '@']+ as s) '=' { let b = raw_arg lexbuf in def_macro s None b; read_macros lexbuf } | eof { () } | _ { read_macros lexbuf } bibtex2html-1.97/latex_accents.mll 0000644 0002463 0000264 00000023534 11713717752 017121 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (* Normalize both ISO-latin characters and LaTeX accents to HTML entities *) { let string_buf = Buffer.create 79 let add_string s = Buffer.add_string string_buf s let add lexbuf = Buffer.add_string string_buf (Lexing.lexeme lexbuf) let produce_regexp = ref false } let space = [ '\t'] rule next_char = parse '\\'{ control lexbuf } | '{' { next_char lexbuf } | '}' { next_char lexbuf } | 'ç' { add_string "ç" ; next_char lexbuf } | 'Ç' { add_string "Ç" ; next_char lexbuf } | 'ñ' { add_string "ñ"; next_char lexbuf } | 'Ñ' { add_string "Ñ"; next_char lexbuf } | 'ã' { add_string "ã"; next_char lexbuf } | 'Ã' { add_string "Ã"; next_char lexbuf } | 'õ' { add_string "õ"; next_char lexbuf } | 'Õ' { add_string "Õ"; next_char lexbuf } | 'ä' { add_string "ä"; next_char lexbuf } | 'ö' { add_string "ö"; next_char lexbuf } | 'ü' { add_string "ü"; next_char lexbuf } | 'ë' { add_string "ë"; next_char lexbuf } | 'Ä' { add_string "Ä"; next_char lexbuf } | 'Ö' { add_string "Ö"; next_char lexbuf } | 'Ü' { add_string "Ü"; next_char lexbuf } | 'Ë' { add_string "Ë"; next_char lexbuf } | 'ï' { add_string "ï"; next_char lexbuf } | 'Ï' { add_string "Ï"; next_char lexbuf } | 'á' { add_string "á"; next_char lexbuf } | 'ó' { add_string "ó"; next_char lexbuf } | 'ú' { add_string "ú"; next_char lexbuf } | 'é' { add_string "é"; next_char lexbuf } | 'Á' { add_string "Á"; next_char lexbuf } | 'Ó' { add_string "Ó"; next_char lexbuf } | 'Ú' { add_string "Ú"; next_char lexbuf } | 'É' { add_string "É"; next_char lexbuf } | 'í' { add_string "í"; next_char lexbuf } | 'Í' { add_string "Í"; next_char lexbuf } | 'à' { add_string "à"; next_char lexbuf } | 'ò' { add_string "ò"; next_char lexbuf } | 'ù' { add_string "ù"; next_char lexbuf } | 'è' { add_string "è"; next_char lexbuf } | 'À' { add_string "À"; next_char lexbuf } | 'Ò' { add_string "Ò"; next_char lexbuf } | 'Ù' { add_string "Ù"; next_char lexbuf } | 'È' { add_string "È"; next_char lexbuf } | 'ì' { add_string "ì"; next_char lexbuf } | 'Ì' { add_string "Ì"; next_char lexbuf } | 'â' { add_string "â"; next_char lexbuf } | 'ô' { add_string "ô"; next_char lexbuf } | 'û' { add_string "û"; next_char lexbuf } | 'ê' { add_string "ê"; next_char lexbuf } | 'î' { add_string "î"; next_char lexbuf } | 'Â' { add_string "Â"; next_char lexbuf } | 'Ô' { add_string "Ô"; next_char lexbuf } | 'Û' { add_string "Û"; next_char lexbuf } | 'Ê' { add_string "Ê"; next_char lexbuf } | 'Î' { add_string "Î"; next_char lexbuf } | _ { add lexbuf ; next_char lexbuf } | eof { () } (* called when we have seen "\\" *) and control = parse '"' { quote_char lexbuf } | '\'' { right_accent lexbuf } | '`' { left_accent lexbuf } | '^' { hat lexbuf } | "c{c}" { add_string "ç" ; next_char lexbuf } | "c{C}" { add_string "Ç" ; next_char lexbuf } | 'v' { czech lexbuf } | 'u' { breve lexbuf } | '~' { tilde lexbuf } | _ { add_string "\\" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\" } (* called when we have seen "\\\"" *) and quote_char = parse ('a'|"{a}") { add_string "ä" ; next_char lexbuf } | ('o'|"{o}") { add_string "ö" ; next_char lexbuf } | ('u'|"{u}") { add_string "ü" ; next_char lexbuf } | ('e'|"{e}") { add_string "ë" ; next_char lexbuf } | ('A'|"{A}") { add_string "Ä" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ö" ; next_char lexbuf } | ('U'|"{U}") { add_string "Ü" ; next_char lexbuf } | ('E'|"{E}") { add_string "Ë" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space*|"{\\i}") { add_string "ï" ; next_char lexbuf } | ('I'|"{I}") { add_string "Ï" ; next_char lexbuf } | _ { add_string "\\\"" ; add lexbuf } | eof { add_string "\\\"" } (* called when we have seen "\\'" *) and right_accent = parse | ('a'|"{a}") { add_string "á" ; next_char lexbuf } | ('o'|"{o}") { add_string "ó" ; next_char lexbuf } | ('u'|"{u}") { add_string "ú" ; next_char lexbuf } | ('e'|"{e}") { add_string "é" ; next_char lexbuf } | ('A'|"{A}") { add_string "Á" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ó" ; next_char lexbuf } | ('U'|"{U}") { add_string "Ú" ; next_char lexbuf } | ('E'|"{E}") { add_string "É" ; next_char lexbuf } | ('\'') { add_string "”" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space*|"{\\i}") { add_string "í" ; next_char lexbuf } | ('I'|"{I}") { add_string "Í" ; next_char lexbuf } | _ { add_string "\\'" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\'" } (* called when we have seen "\\`" *) and left_accent = parse ('a'|"{a}") { add_string "à" ; next_char lexbuf } | ('o'|"{o}") { add_string "ò" ; next_char lexbuf } | ('u'|"{u}") { add_string "ù" ; next_char lexbuf } | ('e'|"{e}") { add_string "è" ; next_char lexbuf } | ('A'|"{A}") { add_string "À" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ò" ; next_char lexbuf } | ('U'|"{U}") { add_string "Ù" ; next_char lexbuf } | ('E'|"{E}") { add_string "È" ; next_char lexbuf } | ('`') { add_string "“" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space* |"{\\i}") { add_string "ì" ; next_char lexbuf } | ('I'|"{I}") { add_string "Ì" ; next_char lexbuf } | _ { add_string "\\`" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\`" } (* called when we have seen "\\^" *) and hat = parse ('a'|"{a}") { add_string "â" ; next_char lexbuf } | ('o'|"{o}") { add_string "ô" ; next_char lexbuf } | ('u'|"{u}") { add_string "û" ; next_char lexbuf } | ('e'|"{e}") { add_string "ê" ; next_char lexbuf } | ('A'|"{A}") { add_string "Â" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ô" ; next_char lexbuf } | ('U'|"{U}") { add_string "Û" ; next_char lexbuf } | ('E'|"{E}") { add_string "Ê" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space* |"{\\i}") { add_string "î" ; next_char lexbuf } | ('I'|"{I}") { add_string "Î" ; next_char lexbuf } | _ { add_string "\\^" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\^" } (* called when we have seen "\\~" *) and tilde = parse ('a'|"{a}") { add_string "ã" ; next_char lexbuf } | ('o'|"{o}") { add_string "õ" ; next_char lexbuf } | ('A'|"{A}") { add_string "Ã" ; next_char lexbuf } | ('O'|"{O}") { add_string "Õ" ; next_char lexbuf } | ('n'|"{n}") { add_string "ñ" ; next_char lexbuf } | ('N'|"{N}") { add_string "Ñ" ; next_char lexbuf } | _ { add_string "\\~" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\~" } (* called when we have seen "\\v" *) and czech = parse ('r'|"{r}") { add_string "ř" ; next_char lexbuf } | ('R'|"{R}") { add_string "Ř" ; next_char lexbuf } | ('s'|"{s}") { add_string "š" ; next_char lexbuf } | ('S'|"{S}") { add_string "Š" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space* |"{\\i}") { add_string "ĭ" ; next_char lexbuf } | ('I'|"{I}") { add_string "Ĭ" ; next_char lexbuf } | _ { add_string "\\^" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\^" } (* called when we have seen "\\u" *) and breve = parse ('a'|"{a}") { add_string "ă" ; next_char lexbuf } | ('o'|"{o}") { add_string "ŏ" ; next_char lexbuf } | ('u'|"{u}") { add_string "ŭ" ; next_char lexbuf } | ('e'|"{e}") { add_string "ĕ" ; next_char lexbuf } | ('A'|"{A}") { add_string "Ă" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ŏ" ; next_char lexbuf } | ('U'|"{U}") { add_string "Ŭ" ; next_char lexbuf } | ('E'|"{E}") { add_string "Ĕ" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space* |"{\\i}") { add_string "ĭ" ; next_char lexbuf } | ('I'|"{I}") { add_string "Ĭ" ; next_char lexbuf } | _ { add_string "\\u" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\u" } { let normalize to_regexp s = Buffer.clear string_buf; produce_regexp := to_regexp; next_char (Lexing.from_string s); Buffer.contents string_buf ;; } bibtex2html-1.97/bibtex.ml 0000644 0002463 0000264 00000020054 11713717752 015377 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Datatype for BibTeX bibliographies. *) type entry_type = string type key = string module KeySet = Set.Make(struct type t = key let compare = compare end) type atom = | Id of string | String of string type command = | Comment of string | Preamble of atom list | Abbrev of string * atom list | Entry of entry_type * key * (string * atom list) list (*s biblio is stored as a list. Beware, this in reverse order: the first entry is at the end of the list. This is intentional! *) type biblio = command list let empty_biblio = [] let size b = List.length b (*s the natural iterator on biblio must start at the first entry, so it is the [fold_right] function on lists, NOT the [fold_left]! *) let fold = List.fold_right let find_entry key biblio = let rec find key b = match b with | [] -> raise Not_found | (Entry (_,s,_) as e) :: b -> if String.lowercase s = key then e else find key b | _ :: b -> find key b in find (String.lowercase key) biblio let add_new_entry command biblio = command :: biblio let rec remove_entry key biblio = match biblio with | [] -> raise Not_found | (Entry(_,s,_) as e) :: b -> if s = key then b else e :: (remove_entry key b) | e :: b -> e :: (remove_entry key b) (*s [add_entry k c b] adds an entry of key [k] and command [c] in biblio [b] and returns the new biblio. If an entry of key [k] already exists in [b], it is replaced by the new one. *) let add_entry command biblio = match command with | Entry(_,key,_) -> begin try let new_bib = remove_entry key biblio in command :: new_bib with Not_found -> command :: biblio end | _ -> command::biblio let merge_biblios b1 b2 = let b2keys = fold (fun entry accu -> match entry with | Entry (_,key,_) -> KeySet.add key accu | _ -> accu) b2 KeySet.empty and b1abbrevs = fold (fun entry accu -> match entry with | Abbrev (key,_) -> KeySet.add key accu | _ -> accu) b1 KeySet.empty in let new_b1 = fold (fun entry accu -> match entry with | Entry (_,key,_) -> if KeySet.mem key b2keys then begin Format.eprintf "Warning, key '%s' duplicated@." key; if !Options.warn_error then exit 2; accu end else entry :: accu | _ -> entry :: accu) b1 empty_biblio in let new_bib = fold (fun entry accu -> match entry with | Abbrev (key,_) -> if KeySet.mem key b1abbrevs then begin Format.eprintf "Warning, key '%s' duplicated@." key; if !Options.warn_error then exit 2; accu end else entry :: accu | _ -> entry :: accu) b2 new_b1 in new_bib let month_env = List.map (fun s -> (s,[Id s])) [ "jan" ; "feb" ; "mar" ; "apr" ; "may" ; "jun" ; "jul" ; "aug" ; "sep" ; "oct" ; "nov" ; "dec" ] let abbrev_is_implicit key = try let _ = int_of_string key in true with Failure "int_of_string" -> try let _ = List.assoc key month_env in true with Not_found -> false (*i let rec abbrev_exists key biblio = match biblio with | [] -> false | (Abbrev (s,_)) :: b -> s = key || abbrev_exists key b | _ :: b -> abbrev_exists key b i*) let rec find_abbrev key biblio = match biblio with | [] -> raise Not_found | (Abbrev (s,_) as e) :: b -> if s = key then e else find_abbrev key b | _ :: b -> find_abbrev key b let concat_atom_lists a1 a2 = match (a1,a2) with | ([String s1], [String s2]) -> [String (s1 ^ s2)] | _ -> a1 @ a2 let abbrev_table = Hashtbl.create 97 let add_abbrev a l = Hashtbl.add abbrev_table a l let _ = List.iter (fun (a,l) -> add_abbrev a l) month_env let find_abbrev_in_table a = Hashtbl.find abbrev_table a let rec expand_list = function | [] -> [] | ((Id s) as a) :: rem -> begin try let v = find_abbrev_in_table s in concat_atom_lists v (expand_list rem) with Not_found -> concat_atom_lists [a] (expand_list rem) end | ((String _) as a) :: rem -> concat_atom_lists [a] (expand_list rem) let rec expand_fields = function | [] -> [] | (n,l) :: rem -> (n, expand_list l) :: (expand_fields rem) let rec expand_abbrevs biblio = fold (fun command accu -> match command with | Abbrev (a,l) -> let s = expand_list l in add_abbrev a s; accu | Entry (t,k,f) -> Entry (t,k,expand_fields f) :: accu | e -> e :: accu) biblio [] let add_crossref_fields = List.fold_left (fun acc ((x,_) as d) -> if List.mem_assoc x acc then acc else d::acc) let rec expand_crossrefs biblio = let crossref_table = Hashtbl.create 97 in let add_crossref a l = Hashtbl.add crossref_table (String.lowercase a) l in let find_crossref a = Hashtbl.find crossref_table (String.lowercase a) in let replace_crossref a l = Hashtbl.replace crossref_table (String.lowercase a) l in (* first phase: record needed crossrefs in table *) List.iter (fun command -> match command with | Entry (t,k,f) -> begin try match List.assoc "crossref" f with | [String(s)] -> add_crossref s [] | _ -> begin Format.eprintf "Warning: invalid cross-reference in entry '%s'.@." k; if !Options.warn_error then exit 2; end with Not_found -> (); end | _ -> ()) biblio; (* second phase: record crossrefs data in table *) List.iter (fun command -> match command with | Entry (t,k,f) -> begin try let _ = find_crossref k in if !Options.debug then Format.eprintf "recording cross-reference '%s'.@." k; replace_crossref k f with Not_found -> () end | _ -> ()) biblio; (* third phase: expand crossrefs *) fold (fun command accu -> match command with | Entry (t,k,f) -> begin try match List.assoc "crossref" f with | [String(s)] -> begin try let f = List.remove_assoc "crossref" f in let f' = find_crossref s in if f' = [] then begin Format.eprintf "Warning: cross-reference '%s' not found.@." s; if !Options.warn_error then exit 2; end; Entry (t,k,add_crossref_fields f f') :: accu with Not_found -> assert false end | _ -> command :: accu with Not_found -> command :: accu end | e -> e :: accu) biblio [] let sort comp bib = let comments,preambles,abbrevs,entries = List.fold_left (fun (c,p,a,e) command -> match command with | Comment _ -> (command::c,p,a,e) | Preamble _ -> (c,command::p,a,e) | Abbrev _ -> (c,p,command::a,e) | Entry _ -> (c,p,a,command::e)) ([],[],[],[]) bib in let sort_abbrevs = List.sort comp abbrevs and sort_entries = List.sort comp entries in List.rev_append sort_entries (List.rev_append sort_abbrevs (List.rev_append preambles (List.rev comments))) let current_key = ref "" bibtex2html-1.97/latex_accents.mli 0000644 0002463 0000264 00000002515 11713717752 017112 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (* replace LaTeX control sequences for special characters. first arg is a boolean to tell if result should be a regexp, i.e escaping some characters *) val normalize : bool-> string -> string bibtex2html-1.97/biboutput.ml 0000644 0002463 0000264 00000016407 11713717752 016146 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Output a BibTeX bibliography. *) open Printf open Bibtex let link_fields = ref [] let add_link_field f = link_fields := f :: !link_fields let is_link_field f = List.mem f !link_fields let needs_output k = function | None -> true | Some s -> KeySet.mem k s let url_re = Str.regexp "\\(ftp\\|http\\)://.*" let is_url s = Str.string_match url_re s 0 let print_atom html ch = function | Id s -> if html & not (abbrev_is_implicit s) then begin Html.open_href ch ("#" ^ s); output_string ch s; Html.close_href ch end else output_string ch s | String s when html & is_url s -> output_string ch "{"; Html.open_href ch s; output_string ch s; Html.close_href ch; output_string ch "}" | String s -> output_string ch ("{"^s^"}") let print_atom_list html ch = function | [] -> () | a::l -> print_atom html ch a; List.iter (fun a -> output_string ch " # "; print_atom html ch a) l let print_crossref html ch = function | [String s] -> output_string ch "{"; if html then Html.open_href ch ("#" ^ s); output_string ch s; if html then Html.close_href ch; output_string ch "}" | l -> if not !Options.quiet then eprintf "Warning: cross-references must be constant strings\n"; if !Options.warn_error then exit 2; print_atom_list html ch l let print_link_field ch = function | [String s] -> output_string ch "{"; Html.open_href ch s; output_string ch s; Html.close_href ch; output_string ch "}" | l -> if not !Options.quiet then eprintf "Warning: web links must be constant strings\n"; if !Options.warn_error then exit 2; print_atom_list true ch l let print_command remove rename html html_file ch keys = function | Comment s -> if html then output_string ch "
\n"; output_string ch ("@comment{{" ^ s ^ "}}\n"); if html then output_string ch "\n"; output_string ch "\n" | Preamble l -> if html then output_string ch "
\n"; output_string ch "@preamble{"; print_atom_list html ch l; output_string ch "}\n"; if html then output_string ch "\n"; output_string ch "\n" | Abbrev(s,l) -> if needs_output s keys then begin if html then begin Html.open_anchor ch s; Html.close_anchor ch end; if html then output_string ch "
\n"; output_string ch ("@string{" ^ s ^ " = "); print_atom_list html ch l; output_string ch "}\n"; if html then output_string ch "\n"; output_string ch "\n" end | Entry (entry_type,key,fields) -> if needs_output key keys then begin (*if html then Html.open_balise ch "p";*) if html then begin Html.open_anchor ch key; Html.close_anchor ch end; if html then output_string ch "
\n"; output_string ch ("@" ^ entry_type ^ "{"); begin match html_file with | Some f -> Html.open_href ch (f ^ "#" ^ key); output_string ch key; Html.close_href ch | None -> output_string ch key end; List.iter (fun (field,l) -> if not (List.mem field remove) then begin let ofield = try List.assoc field rename with Not_found -> field in output_string ch (",\n " ^ ofield ^ " = "); if html & field = "crossref" then print_crossref html ch l else if html & is_link_field field then print_link_field ch l else print_atom_list html ch l end) fields; output_string ch "\n}\n"; if html then output_string ch "\n"; (*if html then Html.close_balise ch "p";*) output_string ch "\n" end (*s PHP output *) open Printf exception Bad_input_for_php of string let php_print_atom ch = function | Id s -> fprintf ch "\"%s\"" s | String s -> let s = String.copy s in for i=0 to String.length s - 1 do s.[i] <- match s.[i] with | '\n' | '\t' -> ' ' | c -> c done; fprintf ch "\"%s\"" (String.escaped s) let php_print_atom_list ch = function | [] -> () | [a] -> php_print_atom ch a | a::l -> php_print_atom ch a; List.iter (fun a -> fprintf ch "."; php_print_atom ch a) l let php_print_command index remove rename ch keys = function | Comment s -> raise (Bad_input_for_php "comments not supported, use option --no-comment") (* output_string ch "
\n"; output_string ch ("@comment{{" ^ s ^ "}}\n"); output_string ch "\n"; output_string ch "\n" *) | Preamble l -> raise (Bad_input_for_php "preamble not supported") (* output_string ch "
\n"; output_string ch "@preamble{"; php_print_atom_list ch l; output_string ch "}\n"; output_string ch "\n"; output_string ch "\n" *) | Abbrev(s,l) -> raise (Bad_input_for_php "string not supported, use option --expand") (* if needs_output s keys then begin Html.open_anchor ch s; Html.close_anchor ch; output_string ch "
\n"; output_string ch ("@string{" ^ s ^ " = "); php_print_atom_list ch l; output_string ch "}\n"; output_string ch "\n"; output_string ch "\n" end *) | Entry (entry_type,key,fields) -> if needs_output key keys then begin if index > 0 then fprintf ch ",\n\n"; fprintf ch "%-5d => Array (\n" index; fprintf ch " \"entrytype\" => \"%s\",\n" entry_type; fprintf ch " \"cite\" => \"%s\"" key; List.iter (fun (field,l) -> if not (List.mem field remove) then begin let ofield = try List.assoc field rename with Not_found -> field in fprintf ch ",\n \"%s\" => " ofield; php_print_atom_list ch l end) fields; fprintf ch ")"; succ index end else index let output_bib ?(remove=[]) ?(rename=[]) ?(php=false) ~html ?html_file ch bib keys = let _ = Bibtex.fold (fun entry i -> if php then php_print_command i remove rename ch keys entry else (print_command remove rename html html_file ch keys entry; succ i)) bib 0 in () bibtex2html-1.97/manual.tex 0000644 0002463 0000264 00000076601 11713717752 015600 0 ustar filliatr demons %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % bibtex2html - A BibTeX to HTML translator % % Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché % % % % This software is free software; you can redistribute it and/or % % modify it under the terms of the GNU General Public % % License version 2, as published by the Free Software Foundation. % % % % This software is distributed in the hope that it will be useful, % % but WITHOUT ANY WARRANTY; without even the implied warranty of % % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. % % % % See the GNU General Public License version 2 for more details % % (enclosed in the file GPL). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[11pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{fullpage} \usepackage{url} %BEGIN LATEX \newcommand{\link}[2]{#2} %END LATEX %HEVEA\newcommand{\link}[2]{\ahref{#1}{#2}} \newcommand{\monurl}[1]{\link{#1}{#1}} \newcommand{\mm}{\symbol{45}\symbol{45}} \input{version.tex} \title{{\Huge\bfseries BibTeX2HTML} \\ A translator of BibTeX bibliographies into HTML\\ ~\\ Version \version{} --- \today} \author{Jean-Christophe Filli\^{a}tre and Claude March\'e \\ \normalsize\monurl{\url{http://www.lri.fr/~filliatr/bibtex2html}}} \date{} \begin{document} \sloppy \maketitle \tableofcontents \section{Introduction} BibTeX2HTML is a collection of tools for producing automatically HTML documents from bibliographies written in the BibTeX format. It consists in three command line tools: \begin{itemize} \item \texttt{bib2bib} is a filter tool that reads one or several bibliography files, filters the entries with respect to a given criterion, and outputs the list of selected keys together with a new bibliography file containing only the selected entries; \item \texttt{bibtex2html} is a translator that reads a bibliography file and outputs two HTML documents that contains respectively the cited bibliography in a nice presentation, and the original BibTeX file augmented with several transparent HTML links to allow easy navigation. \texttt{bibtex2html} can handle \emph{any} BibTeX style file, including those producing multiple bibliographies. \item \texttt{aux2bib} reads a \texttt{.aux} file as produced by \LaTeX\ and writes to standard output a BibTeX file containing exactly the BibTeX entries refereed in the \texttt{.aux} file. \end{itemize} \section{The \texttt{bibtex2html} command tool} bibtex2html is a BibTeX to HTML translator. It is invocated as \begin{flushleft} \texttt{bibtex2html} [options] [\textit{file.bib}] \end{flushleft} where the possible \link{\#options}{options} are described below and where \textit{file.bib} is the name of the BibTeX file, which must have a \textit{.bib} suffix. If this file is not given, then entries are input from standard input. Then two HTML documents are created (unless option \verb|-nobibsource| is selected or input is standard input, see below) : \begin{itemize} \item \textit{file.html} which is the bibliography in HTML format %HEVEA, like \link{examples/biblio-these.html}{this} ; \item \textit{file\_bib.html} which contains all the entries in ASCII format. %HEVEA ,like \link{examples/biblio-these_bib.html}{this} \end{itemize} \texttt{bibtex} is called on \textit{file.bib} in order to produce the a LaTeX document, and then this LaTeX document is translated into an HTML document. The BibTeX file \textit{file.bib} is also parsed in order to collect additional fields (abstract, url, ps, http, etc.) that will be used in the translation. If input is standard input and option \verb|--output| is not given, the first file is output to standard output, and the second is not created. %HEVEA\begin{rawhtml}\end{rawhtml} \subsection{Additional fields and automatic web links} The main interest of \texttt{bibtex2html} with respect to a traditional LaTeX to HTML translator is the use of additional fields in the BibTeX database and the automatic insertion of web links. A link is inserted: \begin{itemize} \item at each cross-reference inside the bibliography entries; \item when the \verb|\url| LaTeX macro is used in the text; \item for each BibTeX field whose name is "ftp", "http", "url", "ps" ,"dvi", "rtf", "pdf", "documenturl", "urlps" or "urldvi". The name of this link depends on the nature of the link: \begin{itemize} \item it is the file suffix, whenever this suffix is \texttt{.dvi}, \texttt{.ps}, \texttt{.pdf}, \texttt{.rtf}, \texttt{.txt} or \texttt{.html}, possibly followed by a compression sufix, \texttt{.gz}, \texttt{.Z} or \texttt{.zip}; \item otherwise the name of the link is either \texttt{http} or \texttt{ftp} depending on the protocol. \end{itemize} You can insert web link for other fields and/or specify alternative names for the links using the options \texttt{-f} and \texttt{-nf} (see below). \end{itemize} %HEVEA See the result on \link{examples/biblio-these.html}{this example}. \subsubsection{Abstracts} If a BibTeX entry contains a field \texttt{abstract} then its contents is quoted right after the bibliography entry %HEVEA , like \link{examples/publis-abstracts.html}{this} . This behavior may be suppressed with the option \texttt{\mm{}no-abstract}. If you want both versions with and without abstracts, use the option \texttt{\mm{}both}. In that case, links named "Abstract" will be inserted from the page without abstracts to the page with abstracts, %HEVEA like \link{examples/publis.html}{this}. \subsubsection{Keywords} If a BibTeX entry contains a field \texttt{keywords} then its contents is displayed after the bibliography entry (and after the abstract if any). This behavior may be suppressed with the option \texttt{\mm{}no-keywords}. %HEVEA\begin{rawhtml}\end{rawhtml} \subsection{Command line options} Most of the command line options have a short version of one character (e.g. \texttt{-r}) and an easy-to-remember/understand long version (e.g. \texttt{\mm{}reverse-sort}). \subsubsection{General aspect of the HTML document} \begin{description} \item[\texttt{-t} \textit{string}, \texttt{\mm{}title} \textit{string}] ~ specify the title of the HTML file (default is the file name). \item[\texttt{\mm{}header} \textit{string}] ~ give an additional header for the HTML document. \item[\texttt{\mm{}footer} \textit{string}] ~ give an additional footer for the HTML document. \item[\texttt{-s} \textit{string}, \texttt{\mm{}style} \textit{string}] ~ use BibTeX style \textit{string} (plain, alpha, etc.). Default style is plain. \item[\texttt{-noabstract}, \texttt{\mm{}no-abstract}] ~ do not print the abstracts (if any). \item[\texttt{-nokeywords}, \texttt{\mm{}no-keywords}] ~ do not print the keywords (if any). \item[\texttt{-both}, \texttt{\mm{}both}] ~ produce both pages with and without abstracts. If the BibTeX file is foo.bib then the two pages will be respectively foo.html and foo\_abstracts.html (The suffix may be different, see option \texttt{\mm{}suffix}). Links are inserted from the page without abstracts to the page with abstracts. \item[\texttt{-nokeys}, \texttt{\mm{}no-keys}] ~ do not print the cite keys. Note: this option implicitly suppresses the use of HTML tables to format the entries; to enforce the use of tables, use option \texttt{-use-table} (passing it \emph{after} option \texttt{-nokeys} on the command line). \item[\texttt{-use-keys}, \texttt{\mm{}use-keys}] ~ use the cite keys from the BibTeX input file (and not the ones generated by the BibTeX style file). \item[\texttt{-rawurl}, \texttt{\mm{}raw-url}] ~ print URLs instead of files' types. \item[\texttt{-heveaurl}, \texttt{\mm{}hevea-url}] ~ interpret the macro \verb!\url! as HeVeA's one, i.e. with two arguments, the first one being the url and the second one the text to print. The default behavior is to interpret the macro \verb!\url! as the one from the package \texttt{url}, which has only one argument (the url itself). \item[\texttt{-f} \textit{field}, \texttt{\mm{}field} \textit{field}] ~ add a web link for that BibTeX field. \item[\texttt{-nf} \textit{field} \textit{string}, \texttt{\mm{}named-field} \textit{field} \textit{string}] ~ similar to \texttt{-f} but specifies the way to display the link (e.g. \texttt{-nf springer "At Springer's"}). \item[\texttt{-note} \textit{field}, \texttt{\mm{}note} \textit{field}] ~ declare that a field must be treated like the \texttt{abstract} field, i.e. is an annotation to be displayed as a text paragraph below the entry. \item[\texttt{-multiple}, \texttt{\mm{}multiple}] ~ make a separate web page for each entry. \textit{Beware: this option produces as many HTML files as BibTeX entries!} \item[\texttt{-single}, \texttt{\mm{}single}] ~ produce a single document, inserting each BibTeX entry (the input) right after its BibTeX output \item[\texttt{-bg} \textit{color}, \texttt{\mm{}background} \textit{color}] ~ set the background color of the HTML file (default is none). \item[\texttt{-css} \textit{file}, \texttt{\mm{}style-sheet} \textit{file}] ~ set a style sheet file for the HTML document (default is none). \item[\texttt{-dl}, \texttt{\mm{}dl}] ~ use HTML \texttt{DL} lists instead of HTML tables to format entries. \item[\texttt{-unicode}, \texttt{\mm{}unicode}] ~ use Unicode entities for the following macros : \begin{verbatim} \models \curlyvee \curlywedge \bigcirc \varepsilon \not{\models} \end{verbatim} \item[\texttt{-html-entities}, \texttt{\mm{}html-entities}] ~ use HTML entities for the following macros : \begin{verbatim} \= \Im \Leftarrow \Re \Rightarrow \aleph \ang \angle \approx \ast \cdot \cdots \cong \copyright \cup \dagger \diamond \emptyset \equiv \exists \forall \ge \geq \in \infty \int \land \lang \lceil \le \leftarrow \leftrightarrow \leq \lfloor \longleftarrow \longrightarrow \lor \lozenge \nabla \ne \neg \neq \ni \notin \oplus \otimes \partial \perp \pm \prod \propto \rang \rceil \rfloor \rightarrow \sim \simeq \sqrt \subset \subseteq \sum \supset \supseteq \therefore \times \tm \to \vartheta \vee \wedge \wp \end{verbatim} \end{description} \subsubsection{Controlling the translation} \begin{description} \item[\texttt{-m} \textit{file}, \texttt{\mm{}macros-from} \textit{file}] ~ read the \LaTeX\ macros in the given file. Note: \texttt{bibtex2html} does not handle macros arguments; arguments are simply discarded. \item[\texttt{-noexpand} \texttt{\mm{}no-expand}] ~ do not expand the abbreviation strings, leave them in the output file. \end{description} \subsubsection{Selecting the entries} \begin{description} \item[\texttt{-citefile} \textit{filename}, \texttt{\mm{}citefile} \textit{filename}] ~ Select only keys appearing in \textit{filename}. To be used manually or in conjonction with \verb|bib2bib|. \item[\texttt{-e} \textit{key}, \texttt{\mm{}exclude} \textit{key}] ~ exclude an particular entry. \end{description} \subsubsection{Sorting the entries} \begin{description} \item[\texttt{-d}, \texttt{\mm{}sort-by-date}] ~ sort by date. \item[\texttt{-a}, \texttt{\mm{}sort-as-bibtex}] ~ sort as BibTeX (usually by author). \item[\texttt{-u}, \texttt{\mm{}unsorted}] ~ unsorted i.e. same order as in .bib file (default). \item[\texttt{-r}, \texttt{\mm{}reverse-sort}] ~ reverse the sort. \item[\texttt{\mm{}revkeys}] ~ number entries in reverse order (i.e. from $n$ to 1 in plain style). \end{description} \subsubsection{Miscellaneous options} \begin{description} \item[\texttt{-nodoc}, \texttt{\mm{}nodoc}] ~ do not produce a full HTML document but only its body (useful to merge the HTML bibliography in a bigger HTML document). \item[\texttt{-nobibsource}, \texttt{\mm{}nobibsource}] ~ do not produce the \verb|_bib.html| file. In that case, no ``BibTeX entry'' link are inserted in the HTML file. \item[\texttt{-suffix} \textit{string}, \texttt{\mm{}suffix} \textit{string}] ~ give an alternate suffix \textit{string} for both HTML files and links (default is \texttt{.html}). \item[\texttt{-fsuffix} \textit{string}, \texttt{\mm{}file-suffix} \textit{string}] ~ give an alternate suffix \textit{string} for HTML files (default is \texttt{.html}). \item[\texttt{-lsuffix} \textit{string}, \texttt{\mm{}link-suffix} \textit{string}] ~ give an alternate suffix \textit{string} for HTML links (default is \texttt{.html}). \item[\texttt{-o} \textit{file}, \texttt{\mm{}output} \textit{file}] ~ specifies the output file. If \textit{file} is \verb!-!, then the standard output is selected. \item[\texttt{-c} \textit{command}, \texttt{\mm{}command} \textit{command}] ~ specify the BibTeX command (default is \texttt{bibtex -min-crossrefs=1000}). May be useful for example if you need to specify the full path of the \texttt{bibtex} command. \item[\texttt{\mm{}print-keys}] ~ print the BibTeX entries on the standard output (one per line), as selected and sorted by \texttt{bibtex2html}. This is useful if you want to use the selection and sorting facilities of \texttt{bibtex2html} in another program. Note: you may need to set also the \texttt{-q} option (quiet) to suppress the usual output. \item[\texttt{-i}, \texttt{\mm{}ignore-errors}] ~ ignore BibTeX errors. \item[\texttt{-q}, \texttt{\mm{}quiet}] ~ be quiet. \item[\texttt{-w}, \texttt{\mm{}warn-error}] ~ stop at the first warning. \item[\texttt{-h}, \texttt{\mm{}help}] ~ print a short usage and exit. \item[\texttt{-v}, \texttt{\mm{}version}] ~ print the version and exit. \item[\texttt{-noheader}, \texttt{\mm{}no-header}] ~ do not insert the \texttt{bibtex2html} command in the HTML document (default is to insert it as a comment at the beginning). \end{description} \section{The \texttt{bib2bib} command line tool} \texttt{bib2bib} is a tool for extracting some entries from a list of bibliography files. It is invocated as \begin{flushleft} \texttt{bib2bib} [options] \textit{file1.bib} $\cdots$ \textit{filen.bib} \end{flushleft} where the possible options are described below and where \textit{file1.bib} $\cdots$ \textit{filen.bib} are the names of the BibTeX files, which must have a \textit{.bib} suffix. If no files at all are given on the command line, then input is taken from standard input. The options allow to specify a filter condition to test against each references read from bib files. The result will be a new BibTeX file containing all the entries of the input files that satisfy the condition. Notice that this output file contains all the necessary informations: each string and each cross-reference needed will be also in that file. Additionally, \textit{bib2bib} may output a file containing all the keys of entries that satisfy the condition. This second file is suitable for input as option \verb|-citefile| to \verb|bibtex2html|. \subsection{Command line options} \begin{description} \item[\texttt{-c} \textit{condition}] ~ specify a condition for selecting the entries. The output will retain only the entries that satisfy this condition. If several such condition are given, then only the entries that satisfy all the conditions are selected. The syntax of conditions is given below, notice that it is better to escape shell expansions in that conditions, in other words, you should write conditions between quotes. \item[\texttt{-ob} \textit{filename}] ~ specify the filename where the selected entries are output. If not given, it defaults to standard output. \item[\texttt{-oc} \textit{filename}] ~ specify the filename where the list of selected keys is output. If not given, this file is not created. Notice that the two output files above are suitable for use with bibtex2html. A typical use would be \begin{flushleft} \texttt{bib2bib -oc $citefile$ -ob $bibfile.bib$ -c $condition$ file1.bib file2.bib ... } \\ \texttt{bibtex2html -citefile $citefile$ bibfile.bib} \end{flushleft} which will produce exactly the HTML file for the selected references. \item[\texttt{\mm{}expand}] ~ expand all abbreviations in the output file. \item[\texttt{\mm{}expand-xrefs}] ~ expand all crossrefs in the output file. Notice that the meaning of such an expansion is not completely obvious: it's better to let bibtex (via bibtex2html) handle the cross-references itself, depending on the style considered. Notice that \texttt{bibtex2html} itself will expand the strings (by default, unless you specify the \verb|-noexpand| option) but not the cross-references. \item[\texttt{\mm{}no-comment}] ~ prevent generation of extra comments at beginning of output bib file. \item[\texttt{\mm{}remove} \textit{f}] ~ remove all occurrences of field \textit{f}. This option can be used several times to remove several fields. \item[\texttt{\mm{}rename} \textit{f1} \textit{f2}] ~ rename all occurrences of field \textit{f1} into \texttt{f2}. This option can be used several times to rename several fields. Beware that if an entry already has both fields \texttt{f1} and \texttt{f2}, this will result in two fields \textit{f2}, and BibTeX styles usually take only the first occurrence into account. Example: \begin{flushleft} \texttt{bib2bib \mm{}remove abstract \mm{}remove copyright \mm{}rename x-pdf url $bibfile.bib$} \end{flushleft} removes all \texttt{abstract} and \texttt{copyright} fields and rename all \texttt{x-pdf} fields into name \texttt{url}. \item[\texttt{-s} \textit{f}] ~ sorts the entries of the bibliography with respect to the given field \textit{f}, which may also be \texttt{\$key} or \texttt{\$type} to refer to the key or to the entry type, as for filter conditions. It may also be \texttt{\$date}, to ask for sorting from oldest to newest, as for option \texttt{-d} of bibtex2html. This option may be used several times to specify a lexicographic order, such as by author, then by type, then by date: \begin{flushleft} \texttt{bib2bib -s 'author' -s '\$type' -s '\$date' $bibfile.bib$} \end{flushleft} When sorting, the resulting bibliography will always contains the comments first, then the preambles, then the abbreviations, and finally the regular entries. Be warned that such a sort may put cross-references before entries that refer to them, so be cautious. \item[\texttt{-r}] ~ reverses the sort order. \item[\texttt{-q}, \texttt{\mm{}quiet}] ~ be quiet. \item[\texttt{-w}, \texttt{\mm{}warn-error}] ~ stop at the first warning. \item[\texttt{\mm{}php-output} \textit{file}] ~ outputs the bib file as a two-dimensional array in PHP syntax, in \textit{file}. \end{description} \subsection{Filter conditions} \label{sec:conditions} A filter condition is a boolean expression that is evaluated against a BibTeX entry to decide whether this entry should be selected. A condition is either: \begin{itemize} \item a \emph{comparison} between two \emph{expressions}, written as $e_1~op~e_2$ ; \item a matching of a field name with respect to a \emph{regular expression}, written as $field : regexp$ ; \item a conjunction of two conditions, written as $c_1 \verb| and | c_2$ (or $c_1 \verb| & | c_2$) ; \item a disjunction of two conditions, written as $c_1 \verb| or | c_2$ (or $c_1 \verb+ | + c_2$); \item a negation of a condition, written as $\verb|not | c$ (or $\verb|! | c$) ; \item a test of existence of a field, written as $\verb|exists | f$ (or $\verb|? | f$) where $f$ is a field name ; \end{itemize} where an expression is either: \begin{itemize} \item a string constant, written either between double quotes or single quotes ; \item an integer constant ; \item a field name ; \item the special ident \verb|$key| which corresponds to the key of an entry. \item the special ident \verb|$type| which corresponds to the type of an entry (ARTICLE, INPROCEEDINGS, etc.). Notice that an entry type is always written in uppercase letters. \end{itemize} Comparison operators are the usual ones: \texttt{=}, \texttt{<}, \texttt{>}, \texttt{<=}, \texttt{>=} and \texttt{<>}. The field names are any sequences of lowercase or uppercase letters (but no distinction is made between lowercase and uppercase letters). Be careful when writing conditions in a shell command: the shell must not interpret anything in a condition, such as \verb|$key|. So usually you need to put conditions inside quote characters that forbid shell interpretation: single quotes under Unix shell, or double quotes under Microsoft Windows shell. This is why strings in conditions may be put indifferently between single or double quotes: you will use the ones which are not the ones you use to forbid shell interpretation. In examples below, we will use Unix convention, so under Windows you have to permute the use of single and double quotes. Note that within \texttt{Makefile}s you have to escape the \verb|$| character in \verb|$key| or \verb|$type| (using \verb|$$key| and \verb|$$type| instead, at least with GNU make). Regular expressions must be put between single or double quotes, and must follow the GNU syntax of regular expressions, as for example in GNU Emacs. Any character other than \verb|$^.*+?[]| matches itself, see Table~\ref{table:regexp} for the meaning of the special characters. \begin{table}[t] \begin{center} \begin{tabular}{|l|p{100mm}|} \hline \verb|.| & matches any character except newline \\\hline \verb|[..]| & character set; ranges are denoted with \verb|-|, as in \verb|[a-z]|; an initial \verb|^|, as in \verb|[^0-9]|, complements the set \\\hline \verb|^| & matches the beginning of the string matched \\\hline \verb|$| & matches the end of the string matched \\\hline \verb|\r| & matches a carriage return \\\hline \verb|\n| & matches a linefeed \\\hline \verb|\t| & matches a tabulation \\\hline \verb|\b| & matches word boundaries \\\hline \verb|\|\textsl{ddd} & matches character with ASCII code \textsl{ddd} in decimal \\\hline \verb|\|\textsl{char} & quotes special character \textsl{char} among \verb#$^.*+?[]\# \\\hline \textsl{regexp}\verb|*| & matches \textsl{regexp} zero, one or several times \\\hline \textsl{regexp}\verb|+| & matches \textsl{regexp} one or several times \\\hline \textsl{regexp}\verb|?| & matches \textsl{regexp} once or not at all \\\hline \textsl{regexp1} \verb+\|+ \textsl{regexp2} & alternative between two regular expressions, this operator has low priority against \verb|*|, \verb|+| and \verb|?| \\\hline \verb|\(| \textsl{regexp} \verb|\)| & grouping regular expression \\\hline \end{tabular} \end{center} \caption{Syntax of regular expressions} \label{table:regexp} \end{table} Notice that if several conditions are given with option \verb|-c| on the command line, then they are understood as the conjunction of them, in other words \begin{flushleft} \texttt{bib2bib -c '$c_1$' $\cdots$ -c '$c_n$'} \end{flushleft} is equivalent to \begin{flushleft} \texttt{bib2bib -c '$c_1$ and $\cdots$ and $c_n$'} \end{flushleft} Table~\ref{table:syntax} shows a formal grammar for conditions. \begin{table}[t] \begin{eqnarray*} Cond & \rightarrow & Cond \verb| and | Cond \mid Cond \verb| or | Cond \mid \verb|not | Cond \mid \verb|exists | Id \\ Cond & \rightarrow & Cond \verb| & | Cond \mid Cond \verb+ | + Cond \mid \verb|! | Cond \mid \verb|? | Id\\ && \mid Expr ~ Comp ~ Expr \mid Expr \verb|:| String \mid \verb|( | Cond \verb| )|\\ Comp & \rightarrow & \verb|=| \mid \verb|>| \mid \verb|<| \mid \verb|>=| \mid \verb|<=| \mid \verb|<>| \\ Expr & \rightarrow & Id \mid String \mid Int \mid \verb|$key| \mid \verb|$type| \\ Id & \rightarrow & [\verb|a|-\verb|z|\verb|A|-\verb|Z|]^+ \\ String & \rightarrow & \verb|"| ([\verb|^"\|] \mid \verb|\"| \mid \verb|\\| )^* \verb|"| \mid \verb|'| ([\verb|^'\|] \mid \verb|\'| \mid \verb|\\| )^* \verb|'| \\ Integer & \rightarrow & [\verb|0|-\verb|9|]^+ \end{eqnarray*} \caption{Syntax of conditions} \label{table:syntax} \end{table} \subsubsection*{Remarks on evaluation of conditions} \begin{itemize} \item According to BibTeX conventions, entry types, keys and field names have to be considered case insensitive, that is no distinction is made between uppercase and lowercase letters. Inside \verb|bib2bib|, these are always converted to uppercase, so you may take this into account when writting conditions (see below). \item On the other hand, case matters when comparing strings, or matching them against regular expressions. For example, \verb|title : "Computer"| may return \verb|true| if the title contains the word \verb|Computer| with a capital letter, whereas \verb|title : "computer"| would return \verb|false|. \item A consequence of the two previous remarks, is that if you want for example to check equality of the entry type and a string value, put the value in uppercase, as for example \verb|$type = "INPROCEEDINGS"|, otherwise the condition would be always false. \item When performing a comparison with an non-existent field, the result is always false ; beware that this means that for example \verb|not (f = "value")| and \verb|f <> "value"| are not equivalent: for an entry that does not have a field \verb|f|, the first condition is true whereas the second is false. \item As usual, \verb|not| has higher priority than \verb|and|, which itself has higher priority than \verb|or|. \verb|and| and \verb|or| associate to the left. \item Comparison using \verb|>|, \verb|<|, \verb|>=| and \verb|<=| may only be used between integer values. In any other case, a warning is displayed and the result is false. \item There is a special handling for strings containing LaTeX accented letters (or for backward compatibility, ISO-Latin1 accented characters): each variant of writing such letters are considered the same, and equivalent to their HTML entity form, for example strings \verb|"Filli\^atre"|, \verb|"Filli{\^a}tre"|, \verb|"Filli\^{a}tre"| and \verb|"Filliâtre"| are considered identical and indeed equal to \verb|"Filliâtre"|. Note that when using such a string as a regular expression, there is no need to escape the backslash, since interpretation of LaTeX accenting commands is made before interpretation into a regexp. Using HTML entities for matching accented names is thus considered as the safest method. \end{itemize} \subsection{Examples} Here are some examples to help you writing the filter conditions you are interested in. \subsubsection{Selecting entries of a given year} The following command reads input files \verb|biblio1.bib| and \verb|biblio2.bib|, and select only entries that appeared in 1999 : \begin{verbatim} bib2bib -oc cite1999 -ob 1999.bib -c 'year=1999' biblio1.bib biblio2.bib \end{verbatim} The resulting file \verb|cite1999| contains the list of keys selected. You can then produce the HTML file by \begin{verbatim} bibtex2html -citefile cite1999 1999.bib \end{verbatim} You may also select references appeared after and/or before a given year. For example, references after 1997: \begin{verbatim} bib2bib -oc citeaft1997 -ob aft1997.bib -c 'year>1997' biblio.bib \end{verbatim} or between 1990 and 1995: \begin{verbatim} bib2bib -oc cite90-95 -ob 90-95.bib -c 'year>=1990 and year<=1995' biblio.bib \end{verbatim} \subsubsection{Selecting references of a given author} The following command reads input files \verb|biblio.bib| and select only entries whose (co)author is Donald Knuth: \begin{verbatim} bib2bib -oc knuth-citations -ob knuth.bib -c 'author : "Knuth"' biblio.bib \end{verbatim} More complicated, if you would like to have only the references whose author is Knuth only, you may try \begin{verbatim} bib2bib -oc knuth-citations -ob knuth.bib \ -c 'author : "^\(Donald \(E. \)?Knuth\|Knuth, Donald \(E.\)?\)$"' biblio.bib \end{verbatim} or equivalently but missing the possible ``\verb|E.|'': \begin{verbatim} bib2bib -oc knuth-citations -ob knuth.bib -c 'author = "Donald Knuth" or author = "Knuth, Donald"' biblio.bib \end{verbatim} \subsubsection{Other examples} Any boolean combination of comparison and/or matching are possible. For example, the following command extract the references that appeared since 1995 and have lambda-calculus in their title, with anything between ``lambda'' and ``calculus'': \begin{verbatim} bib2bib -oc lambda -c 'year >= 1995 and title : "lambda.*calculus"' biblio.bib \end{verbatim} for example, it will select a title containing \verb|$\lambda$-calculus|. \subsection{Note on duplicates entries} \verb|bib2bib| has the effect of merging several bib files into a single one. This process may result in duplicate entries in the resulting files, which is considered as erroneous by \verb|bibtex|. Of course, this is not really a bug of \verb|bib2bib| since it is of your own to take care not having entries with the same key. However, there are two particular cases when this occurs naturally: when two bib files share common abbreviations, or when they share common cross-references. In order to make \verb|bib2bib| behaves correctly in such a case, it is designed as follows: for repeated abbrevs, the first abbrev is kept and the others are ignored, and for repeated regular entries, the last entry is kept and the others are ignored. With this behaviour, everything works well as soon as repeated abbrevs are really duplicate abbrevs of the same sentence, and repeated keys are really duplicate entries. \section{The \texttt{aux2bib} command line tool} \texttt{aux2bib} is a tool extracting the BibTeX references from a \texttt{.aux} file (as produced by \LaTeX) and building the corresponding BibTeX file. It is invocated as \begin{flushleft} \texttt{aux2bib} \textit{file.aux} \end{flushleft} The BibTeX file is written on the standard output. \section{Frequently Asked Questions} \begin{enumerate} \item \textbf{How may I tell bibtex2html to expand cross-references?} ~ By default, all entries of the input BibTeX file are translated into HTML, including cross-references. Since the latter are there, bibtex will never expand them. If you want them to be expanded, you have to tell bibtex2html that crossref entries need not be in the resulting file. To do that you have to use the option \verb|-citefile| to give the exact list of entries you want to see. If a cross-reference is not in that list, then its fields will be expanded into all entries that cross-refers to it. (Technically, this work because bibtex2html calls bibtex with option \verb|-min-crossrefs=1000| by default.) \item \textbf{When running} \begin{verbatim} bib2bib -oc knuth-citations -ob knuth.bib -c 'author : "Knuth"' biblio.bib \end{verbatim} \textbf{I get "Lexical error in condition: Unterminated string". What's going wrong?} You are probably running \verb|bib2bib| under Microsoft Windows, hence you should permute the use of single quotes and double quotes, as explained in Section~\ref{sec:conditions}: \begin{verbatim} bib2bib -oc knuth-citations -ob knuth.bib -c "author : 'Knuth'" biblio.bib \end{verbatim} \end{enumerate} %HEVEA\begin{rawhtml}
"]; def "\\end{alltt}" [Print ""]; def "\\textbf" [Print "" ; Print_arg ; Print ""]; def "\\mathbf" [Print "" ; Print_arg ; Print ""]; def "\\texttt" [Print "" ; Print_arg ; Print ""]; def "\\mathtt" [Print "" ; Print_arg ; Print ""]; def "\\textit" [Print "" ; Print_arg ; Print ""]; def "\\mathit" [Print "" ; Print_arg ; Print ""]; def "\\textsl" [Print "" ; Print_arg ; Print ""]; def "\\textem" [Print "" ; Print_arg ; Print ""]; def "\\textrm" [Print_arg]; def "\\mathrm" [Print_arg]; def "\\textmd" [Print_arg]; def "\\textup" [Print_arg]; def "\\textnormal" [Print_arg]; def "\\mathnormal" [Print "" ; Print_arg ; Print ""]; def "\\mathcal" [Print_arg]; def "\\mathbb" [Print_arg]; def "\\mathfrak" [Print_arg]; def "\\textin" [Print ""; Print_arg; Print ""]; def "\\textsu" [Print ""; Print_arg; Print ""]; def "\\textsi" [Print "" ; Print_arg ; Print ""]; (* Basic color support. *) def "\\textcolor" [ Parameterized (function name -> match String.lowercase name with (* At the moment, we support only the 16 named colors defined in HTML 4.01. *) | "black" | "silver" | "gray" | "white" | "maroon" | "red" | "purple" | "fuchsia" | "green" | "lime" | "olive" | "yellow" | "navy" | "blue" | "teal" | "aqua" -> [ Print (Printf.sprintf "" name); Print_arg ; Print "" ] (* Other, unknown colors have no effect. *) | _ -> [ Print_arg ] )]; (* Fonts without HTML equivalent *) def "\\textsf" [Print "" ; Print_arg ; Print ""]; def "\\mathsf" [Print "" ; Print_arg ; Print ""]; def "\\textsc" [Print_arg]; def "\\textln" [Print_arg]; def "\\textos" [Print_arg]; def "\\textdf" [Print_arg]; def "\\textsw" [Print_arg]; def "\\rm" []; def "\\cal" []; def "\\emph" [Print "" ; Print_arg ; Print ""]; def "\\mbox" [Print_arg]; def "\\footnotesize" []; def "\\etalchar" [ Print "" ; Raw_arg print_s ; Print "" ]; def "\\newblock" [Print " "]; (* Environments *) def "\\begin{itemize}" [Print "
"]; def "\\end{center}" [Print ""]; def "\\begin{htmlonly}" []; def "\\end{htmlonly}" []; def "\\begin{flushleft}" [Print "
"]; def "\\end{flushleft}" [Print ""]; (* Special characters *) def "\\ " [Print " "]; def "\\\n" [Print " "]; def "\\{" [Print "{"]; def "\\}" [Print "}"]; def "\\l" [Print "l"]; def "\\L" [Print "L"]; def "\\oe" [Print "œ"]; def "\\OE" [Print "Œ"]; def "\\o" [Print "ø"]; def "\\O" [Print "Ø"]; def "\\ae" [Print "æ"]; def "\\AE" [Print "Æ"]; def "\\aa" [Print "å"]; def "\\AA" [Print "Å"]; def "\\i" [Print "i"]; def "\\j" [Print "j"]; def "\\&" [Print "&"]; def "\\$" [Print "$"]; def "\\%" [Print "%"]; def "\\_" [Print "_"]; def "\\slash" [Print "/"]; def "\\copyright" [Print "(c)"]; def "\\th" [Print "þ"]; def "\\TH" [Print "Þ"]; def "\\dh" [Print "ð"]; def "\\DH" [Print "Ð"]; def "\\ss" [Print "ß"]; def "\\'" [Raw_arg(function "e" -> print_s "é" | "E" -> print_s "É" | "a" -> print_s "á" | "A" -> print_s "Á" | "o" -> print_s "ó" | "O" -> print_s "Ó" | "i" -> print_s "í" | "\\i" -> print_s "í" | "I" -> print_s "Í" | "u" -> print_s "ú" | "U" -> print_s "Ú" | "'" -> print_s "”" | "c" -> print_s "ć" | "C" -> print_s "Ć" | "g" -> print_s "ǵ" | "G" -> print_s "G" | "l" -> print_s "ĺ" | "L" -> print_s "Ĺ" | "n" -> print_s "ń" | "N" -> print_s "Ń" | "r" -> print_s "ŕ" | "R" -> print_s "Ŕ" | "s" -> print_s "ś" | "S" -> print_s "Ś" | "y" -> print_s "ý" | "Y" -> print_s "Ý" | "z" -> print_s "Ź" | "Z" -> print_s "ź" | "" -> print_c '\'' | s -> print_s s)]; def "\\`" [Raw_arg(function "e" -> print_s "è" | "E" -> print_s "È" | "a" -> print_s "à" | "A" -> print_s "À" | "o" -> print_s "ò" | "O" -> print_s "Ò" | "i" -> print_s "ì" | "\\i" -> print_s "ì" | "I" -> print_s "Ì" | "u" -> print_s "ù" | "U" -> print_s "Ù" | "`" -> print_s "“" | "" -> print_s "‘" | s -> print_s s)]; def "\\~" [Raw_arg(function "n" -> print_s "ñ" | "N" -> print_s "Ñ" | "o" -> print_s "õ" | "O" -> print_s "Õ" | "i" -> print_s "ĩ" | "\\i" -> print_s "ĩ" | "I" -> print_s "Ĩ" | "a" -> print_s "ã" | "A" -> print_s "Ã" | "u" -> print_s "©" | "U" -> print_s "¨" | "" -> print_s "˜" | s -> print_s s)]; def "\\k" [Raw_arg(function "A" -> print_s "Ą" | "a" -> print_s "ą" | "i" -> print_s "Į" | "I" -> print_s "į" | s -> print_s s)]; def "\\c" [Raw_arg(function "c" -> print_s "ç" | "C" -> print_s "Ç" | s -> print_s s)]; def "\\^" [Raw_arg(function "a" -> print_s "â" | "A" -> print_s "Â" | "e" -> print_s "ê" | "E" -> print_s "Ê" | "i" -> print_s "î" | "\\i" -> print_s "î" | "I" -> print_s "Î" | "o" -> print_s "ô" | "O" -> print_s "Ô" | "u" -> print_s "û" | "U" -> print_s "Û" | "w" -> print_s "ŵ" | "W" -> print_s "Ŵ" | "y" -> print_s "ŷ" | "Y" -> print_s "Ŷ" | "" -> print_c '^' | s -> print_s s)]; def "\\hat" [Raw_arg(function "a" -> print_s "â" | "A" -> print_s "Â" | "e" -> print_s "ê" | "E" -> print_s "Ê" | "i" -> print_s "î" | "\\i" -> print_s "î" | "I" -> print_s "Î" | "o" -> print_s "ô" | "O" -> print_s "Ô" | "u" -> print_s "û" | "U" -> print_s "Û" | "" -> print_c '^' | s -> print_s s)]; def "\\\"" [Raw_arg(function "e" -> print_s "ë" | "E" -> print_s "Ë" | "a" -> print_s "ä" | "A" -> print_s "Ä" | "\\i" -> print_s "ï" | "i" -> print_s "ï" | "I" -> print_s "Ï" | "o" -> print_s "ö" | "O" -> print_s "Ö" | "u" -> print_s "ü" | "U" -> print_s "Ü" | "y" -> print_s "ÿ" | "Y" -> print_s "Ÿ" | s -> print_s s)]; def "\\d" [Raw_arg print_s ]; def "\\." [Raw_arg (function "a" -> print_s "ȧ" | "A" -> print_s "Ȧ" | "c" -> print_s "ċ" | "C" -> print_s "Ċ" | "e" -> print_s "ė" | "E" -> print_s "Ė" | "g" -> print_s "ġ" | "G" -> print_s "Ġ" | "i" -> print_s "i" | "\\i" -> print_s "i" | "I" -> print_s "İ" | "o" -> print_s "ȯ" | "O" -> print_s "Ȯ" | "z" -> print_s "ż" | "Z" -> print_s "Ż" | s -> print_s s)]; def "\\u" [Raw_arg(function "a" -> print_s "ă" | "A" -> print_s "Ă" | "e" -> print_s "ĕ" | "E" -> print_s "Ĕ" | "i" -> print_s "Ĭ" | "\\i" -> print_s "Ĭ" | "I" -> print_s "ĭ" | "g" -> print_s "ğ" | "G" -> print_s "Ğ" | "o" -> print_s "ŏ" | "O" -> print_s "Ŏ" | "u" -> print_s "ŭ" | "U" -> print_s "Ŭ" | s -> print_s s)]; def "\\v" [Raw_arg(function | "C" -> print_s "Č" | "c" -> print_s "č" | "D" -> print_s "Ď" | "d" -> print_s "ď" | "E" -> print_s "Ě" | "e" -> print_s "ě" | "N" -> print_s "Ň" | "n" -> print_s "ň" | "r" -> print_s "ř" | "R" -> print_s "Ř" | "s" -> print_s "š" (*"š"*) | "S" -> print_s "Š" (*"Š"*) | "T" -> print_s "Ť" | "t" -> print_s "ť" | "\\i" -> print_s "ĭ" | "i" -> print_s "ĭ" | "I" -> print_s "Ĭ" | "Z" -> print_s "Ž" | "z" -> print_s "ž" | s -> print_s s)]; def "\\H" [Raw_arg (function | "O" -> print_s "Ő" | "o" -> print_s "ő" | "U" -> print_s "Ű" | "u" -> print_s "ű" | s -> print_s s)]; def "\\r" [Raw_arg (function | "U" -> print_s "Ů" | "u" -> print_s "ů" | s -> print_s s)]; (* Math macros *) def "\\[" [Print "
"]; def "\\]" [Print "\n"]; def "\\le" [Print "<="]; def "\\leq" [Print "<="]; def "\\log" [Print "log"]; def "\\ge" [Print ">="]; def "\\geq" [Print ">="]; def "\\neq" [Print "<>"]; def "\\circ" [Print "o"]; def "\\bigcirc" [Print "O"]; def "\\sim" [Print "~"]; def "\\(" [Print ""]; def "\\)" [Print ""]; def "\\mapsto" [Print "|->"]; def "\\times" [Print "×"]; def "\\neg" [Print "¬"]; def "\\frac" [Print "("; Print_arg; Print ")/("; Print_arg; Print ")"]; def "\\not" [Print "not "]; (* Math symbols printed as texts (could we do better?) *) def "\\ne" [Print "=/="]; def "\\in" [Print "in"]; def "\\forall" [Print "for all"]; def "\\exists" [Print "there exists"]; def "\\vdash" [Print "|-"]; def "\\ln" [Print "ln"]; def "\\gcd" [Print "gcd"]; def "\\min" [Print "min"]; def "\\max" [Print "max"]; def "\\exp" [Print "exp"]; def "\\rightarrow" [Print "->"]; def "\\to" [Print "->"]; def "\\longrightarrow" [Print "-->"]; def "\\Rightarrow" [Print "=>"]; def "\\leftarrow" [Print "<-"]; def "\\longleftarrow" [Print "<--"]; def "\\Leftarrow" [Print "<="]; def "\\leftrightarrow" [Print "<->"]; def "\\sqrt" [Print "sqrt("; Print_arg; Print ")"]; def "\\vee" [Print "V"]; def "\\lor" [Print "V"]; def "\\wedge" [Print "/\\"]; def "\\land" [Print "/\\"]; def "\\Vert" [Print "||"]; def "\\parallel" [Print "||"]; def "\\mid" [Print "|"]; def "\\cup" [Print "U"]; def "\\inf" [Print "inf"]; (* Misc. macros. *) def "\\TeX" [Print "TEX"]; def "\\LaTeX" [Print "LATEX"]; def "\\LaTeXe" [Print "LATEX 2e"]; def "\\tm" [Print "TM"]; def "\\par" [Print "
"];
def "\\@" [];
def "\\#" [Print "#"];
def "\\/" [];
def "\\-" [];
def "\\left" [];
def "\\right" [];
def "\\smallskip" [];
def "\\medskip" [];
def "\\bigskip" [];
def "\\relax" [];
def "\\markboth" [Skip_arg; Skip_arg];
def "\\dots" [Print "..."];
def "\\dot" [Print "."];
def "\\simeq" [Print "˜="];
def "\\approx" [Print "˜"];
def "\\^circ" [Print "°"];
def "\\ldots" [Print "..."];
def "\\cdot" [Print "·"];
def "\\cdots" [Print "..."];
def "\\newpage" [];
def "\\hbox" [Print_arg];
def "\\noindent" [];
def "\\label" [Print ""];
def "\\ref" [Print "(ref)"];
def "\\index" [Skip_arg];
def "\\\\" [Print "
"];
def "\\," [];
def "\\;" [];
def "\\!" [];
def "\\hspace" [Skip_arg; Print " "];
def "\\symbol"
[Raw_arg (function s ->
try let n = int_of_string s in print_c (Char.chr n)
with _ -> ())];
def "\\html" [Raw_arg print_s];
(* hyperref *)
def "\\href"
[Print ""; Print_arg; Print ""];
(* Bibliography *)
def "\\begin{thebibliography}" [Print "
no more enclosed in; bibtex fields now typeset in lowercase; added links back to f.html o macros \textin (), \textsu (), \textsi (), and macros \textln, \textos, \textdf, \textsw without translation o fixed bug in --quiet under Windows o option -t now sets the title of f_bib.html too (and of entries files when used with -multiple) Version 1.84, 19/10/2006 ======================== o improved support for MRNUMBER of AMS styles: only first word used in URL link Version 1.83, 13/09/2006 ======================== o support for DOI links: a field "DOI = {xxx}" will be recognized, if any, and a link to http://dx.doi.org/xxx will be displayed; option -no-doi turns it off and option -doi-prefix
sets a different prefix for the DOI urls o macro \H (Hungarian umlauts) o new option -linebreak to insert a linebreak between an entry and its links o new option -use-table to enforce the use of a table (to be used _after_ -no-keys if needed) Version 1.82, 07/06/2006 ======================== o `` and '' translated to “ and ” o aesthetic changes: - no more line break between the entry and the links; - more space between an abstract and the next entry o improving date parsing: month field such as "2~" # dec is now parsed o fixed bug: a space after a macro is now discarded Version 1.81, 12/05/2006 ======================== o new option --print-keys to display the sorted keys (and exit) o improved date sorting to handle months such as mar # "\slash " # apr o no table anymore with -nokeys (only HTML paragraphs) Version 1.80, 15/3/2006 ======================= o remove leading ./ in front of relative URLs (was introduced a long time ago to circumvent an Internet Explorer bug; see below) o no more escaping of the character & in URLs Version 1.79, 22/2/2006 ======================= o fixed bug with ISO-latin characters in bib2bib conditions o fixed bug with implicit abbrevs (jan, feb, etc.) Version 1.78, 16/12/2005 Version 1.77, 18/11/2005 ======================== o fixed bug with unbalanced brackets in bib2bib/bibtex2html output Version 1.76, 22/9/2005 ======================= o translation of \'c o replaced ISO latin 1 characters with their entity codes o support for Czech characters (both contributed by Danny Chrastina) Version 1.75, 2/2/2005 ====================== o updated manual (the manual was not reflecting the change of f-bib into f_bib in version 1.74; see below) Version 1.74, 22/10/2004 ======================== o bib2bib: special characters \n \r \t and \ddd in regular expressions o fix minor bug: when looking for cross-references, comparison of keys is now case-insensitive o footer and bibtex entries now enclosed in HTML paragraphs ( ...
) o in case of syntax error, the key of the entry where the error occurred is shown o new option -no-links to disable weblinks o fix bug in bib2bib: preamble now enclosed with a single pair of braces o bibtex entries now in f_bib.html (instead of f-bib.html) Version 1.72, 3/9/2004 ====================== o --help now prints on standard output and exits successfully o fixed bug with very long keys (when bibtex inserts % to cut lines) o arguments to macros read from a file (option -m) are discarded Version 1.71, 24/8/2004 ======================= o improved date sorting algorithm to handle days (e.g. month = "June 29") o bib2bib: crossrefs are expanded before conditions are checked o bib2bib: '_' allowed in field identifiers o added option -w (--warn-error) to stop immediately when a warning is issued. Version 1.70, 30/6/2004 ======================= o fixed bug with crossrefs not translated from LaTeX to HTML o macros for Greek letters now translated to HTML entities Version 1.69, 6/4/2004 ====================== o macros \bysame, \MR and \MRhref for AMS* stylew o modified -bib.html output to circumvent a Konqueror bug Version 1.68, 16/03/2004 ======================== o fixed bug with parentheses-enclosed entries o macros \relax, \hskip Version 1.66, 18/02/2004 ======================== o characters ( and ) in keys o New FAQ: pb with quotes under MS Windows Version 1.65, 3/10/2003 ======================== o better handling of accented letters, in particular LaTeX commands for accents are taken into account in regular expressions. o fixed bug: keywords were duplicated with -single o web links automatically inserted for -f and -nf fields in the .bib file o new option -use-keys to use the original keys from the .bib file o new option -single to put everything into a single page o HTML links inserted in the BibTeX entries page Version 1.61, 15/7/2003 ======================= o quoted & in URLS (&) o macro \href o bib2bib does not stop anymore when no matching citation is found, and in such a case an empty file is generated. Version 1.60, 19/6/2003 ======================= o new bib2bib option -s to sort the bibliography (and -r to reverse the sort) o macros \cal, \small Version 1.59, 16/6/2003 ======================= o LaTeX '~' translated into o field "postscript" treated as "ps" o fixed links when -o used with a full path o fixed behavior with -nf abstract ... o macro \$ Version 1.57, 9/4/2003 ====================== o option --note f to declare field f as an annotation (and then displayed like an "abstract" field) Version 1.56 12/11/2002 ======================= o bib2bib: fixed bug in conditions lexer o fixed parser error in @preamble o ./configure updated Version 1.54 10/7/2002 ====================== o option --no-header to suppress bibtex2html command in the HTML output o HTML output: tags in lowercase, quoted attributes,
->
o fixed bug in Makefile.in (man pages installation) Version 1.53 18/6/2002 ====================== o keywords displayed if a field "keywords" is present; option --no-keywords o aux2bib now handles multiple citations (\citation{foo,bar,gee}) (patch by Jose Ramon Alvarez Sanchez) Version 1.52 15/01/2002 ======================= o fixed bug in evaluation of <> operator in bib2bib conditions o fixed bugs in URLs display o new tool aux2bib by Ralf Treinen o removed when option -css is used o added macro \frac o added .txt and .html as recognized file extensions Version 1.51 15/10/2001 ======================= o fixed bug in links to not compressed documents; nicer names for links o fixed bug in --quiet o option -dl to format entries withinstead of
o spaces quoted in HTML comment giving the bibtex2html command o macro \path (treated like \verb) Version 1.5 10/10/2001 ====================== o less invasive links (to BibTeX entries and files) o option -css to specify a style sheet o macro \textcolor now translated (patch by François Pottier) o option -bg to set background color (patch by François Pottier) o fixed HTML errors (unclosed tags) Version 1.46 21/2/2001 ====================== o code documented with ocamlweb (but still poor comments) o fixed bug for links' names o fixed a minor HTML error (inversion of
and ) Version 1.45 31/1/2001 ====================== o option -nf to specify how to display the link (patch by François Pottier) Version 1.44 11/1/2001 ====================== o bibtex2html: href bugfix for generation in output dir (Jan Nieuwenhuizen) o macros \lor and \land (translation of raw ASCII) o brackets { } are now ignored when comparing or matching strings in bib2bib conditions Version 1.41 30/6/2000 ====================== o configured by GNU autoconf o option -labelname to use the label name when inserting a link o fixed bug in option -t when bibtex file read on standard input o relative URL not prefixed with ./ when email addresses o macro \par translated tonot
o added symbols '&', '|', '!' and '?' resp. for synonyms of 'and', 'or', 'not' and 'exists' o replaced notations '$' and '#' resp. by '$key' and '$type' in bib2bib conditions o all macros \xxfamily, \xxseries and \xxshape o fixed bug in translating unbalanced quotes to HTML o bib2bib: predicate "exists" added in conditions to check existence of a field o bib2bib: new semantics for non-existent fields in conditions o bib2bib: added # in conditions to refer to the entry type o bib2bib: strings may now be written between single quotes o macros \mathsf, \mathtt, \mathnormal, \TeX, \LaTeXe o option -q, --quiet: do not write anything to stderr except errors Version 1.4, 19/6/2000 ====================== o fixed 2 bugs in bib2bib: it is now allowed to have the same key for an abbrev and for a regular entry. An abbrev that refer itself to other abbrevs is now correctly handled. o fixed bug: abbreviations were not correctly expansed in the -bib file o relative URL now prefixed by ./ (otherwise Internet Explorer can't resolve them correctly) o arguments to option -f are now turned into uppercase o added options -fsuffix / -lsuffix to specify different suffixes for HTML files and links (-suffix s is equivalent to -fsuffix s -lsuffix s) o fixed bug: entries were sorted in reverse order when no order specified o remove nested tags (incorrect HTML) o closed tagswith o added macro \html (raw HTML) o fixed bug with both -nodoc and -multiple Version 1.3, 2/6/2000 ===================== o sorting according to dates: bibtex2html no more fails on incorrect dates but issues a warning; if no date is present, the date of the crossref is used, if any. o macros: \LaTeX, \v, \tm, \sl o character / in keys o option --hevea-url to translate macro \url as HeVeA's instead of LaTeX's o bib2bib now takes care of repeated entries (See the manual) o \textsf now translated as \textbf (i.e. to bold face) o production of valid HTML (Thanks to John Kewley) Version 1.2, 1999/02/10 ======================= o manual.tex does not require hevea.sty anymore o fixed wrong link to bibtex entries in the page with abstracts o implementation: use of the ocaml module Buffer o fixed bug: authorize & in keys o bib2bib conditions now take LaTeX accents into account. For example \'e, \'{e} and é are all considered identical. Some accents still have to be considered. A new module Latex_accents has been added for that purpose. o much more LaTeX macros translated o macro \u (a romanian accent) recognized (but \u{s} simply outputs s) o option --raw-url to print URL instead of files's types. Version 1.1, 1999/11/05 ======================= o bibtex2html version is written at the end of the document and inside the HTML source o options --output and --nobibsource for bibtex2html o bibtex2html now reads on standard input if no input file is given, and writes on standard output (if no output file is specified). o new option of bib2bib: --expand expands the abbreviations o macro \neq -> <> o Readbib now outputs messages on standard error, not standard output o in bib2bib conditions, $ means the key of an entry o changed behaviour of bib2bib, in order to be used as a filter : . if no input files, input is taken from standard input . if no -ob option, output is done on standard output . if no -oc option, no citation file created at all o bib2bib now supports options --version and --warranty o macro \% -> % o macro \ss -> ß o authorize + in keys Version 1.0, 1999/07/15 ======================= o option --footer o condition are now arbitrary boolean expressions over comparaisons and matchings o macro \mathcal o bib2bib is able to parse conditions of the form field:regexp (but only one condition at a time) o the bib output : . is in the same order as the original one . option -noexpand produces an bib output still containing @STRINGs (but notice that crossrefs are never expanded) o the default bibtex command is "bibtex -min-crossrefs=1000" in order to avoid citation to the crossrefs. (This behaviour is obtained only when using a -citefile where the crossrefs are not included.) o macros with nested braces now recognized correctly o macros \textrm and \textsl o option -citefile to read keys to cite from a file o macros \sim, \symbol; macros for accents without argument (\~{}, \'{}, etc.) Version 0.95, 1999/06/02 ======================== o german macros when using a german BibTeX style o comma suppressed after last field in BibTeX entries file o macro \textit o comma after "BibTeX entry" suppressed when not needed Version 0.91, 1999/04/19 ======================== o bug fix in links to BibTeX entries in the page with abstracts o code optimization Version 0.9, 1999/02/12 ======================= o option -both to make both versions with and without abstracts o suffix .zip added for compressed files Version 0.8, 1999/02/08 ======================= o option -multiple (one file per entry) o bug fixed in syntax error line report o translation for macros \DH, \th o file types prefixed by "Compressed" when it is the case o file suffixes PDF and RTF recognized o abstracts printed in a smaller font () Version 0.72, 1999/01/21 ======================== o option -warranty to get the warranty conditions o translation of various LaTeX accents Version 0.71, 1999/01/11 ======================== o translation for macros \o, \O, \ae, \AE, \aa, \AA Version 0.7, 1998/11/18 ======================= o on-line documentation o option -f, --field o long names for all options o more math macros, better handling of {sub,sup}scripts o option -noabstract o option -nofooter Version 0.61, 1998/10/19 ======================== o option -nokeys Version 0.6, 1998/02/17 ======================= o spaces in URL are removed o compilation in native code Version 0.4, 1998/01/28 ======================= o multiple bibliographies o read macros in a file Version 0.3, 1997/11/06 ======================= o option -c to specify a command o quick sort of entries o macro \url is translated into a HTML link Version 0.2, 1997/10/24 ======================= o new presentation with only 2 files (F.html and F-bib.html) Version 0.1, 1997/07/17 ======================= o first public release Local Variables: mode: text End: bibtex2html-1.97/expand.mli 0000644 0002463 0000264 00000003475 11713717752 015562 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Expansion of abbreviations in BibTeX databases. *) type fields = (string * string) list type entry = Bibtex.entry_type * Bibtex.key * fields val expand : Bibtex.biblio -> entry list val expand_fields : (string * Bibtex.atom list) list -> (string * string) list (*s Compare the dates of two entries. *) val date_order : entry list -> entry -> entry -> bool val date_compare : entry list -> entry -> entry -> int (*s Access to the fields of a given entry. *) val get_field : entry -> string -> string val get_lowercase_field : entry -> string -> string val get_title : entry -> string val get_year : entry -> string val get_month : entry -> string val get_author : entry -> string bibtex2html-1.97/bibtex_parser.mly 0000644 0002463 0000264 00000006100 11713717752 017140 0 ustar filliatr demons /**************************************************************************/ /* bibtex2html - A BibTeX to HTML translator */ /* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché */ /* */ /* This software is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU General Public */ /* License version 2, as published by the Free Software Foundation. */ /* */ /* This software is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /* */ /* See the GNU General Public License version 2 for more details */ /* (enclosed in the file GPL). */ /**************************************************************************/ /* * bibtex2html - A BibTeX to HTML translator * Copyright (C) 1997 Jean-Christophe FILLIATRE * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License version 2 for more details * (enclosed in the file GPL). */ /*i $Id: bibtex_parser.mly,v 1.15 2010-02-22 07:38:19 filliatr Exp $ i*/ /*s Parser for BibTeX files. */ %{ open Bibtex %} %tokenTident Tstring Tcomment %token Tentry %token Tabbrev Tpreamble Tlbrace Trbrace Tcomma Tequal EOF Tsharp %start command_list %type command_list %start command %type command %% command_list: commands EOF { $1 } ; commands: commands command { add_new_entry $2 $1 } | /* epsilon */ { empty_biblio } ; command: Tcomment { Comment $1 } | Tpreamble sharp_string_list Trbrace { Preamble $2 } | Tabbrev Tident Tequal sharp_string_list Trbrace { Abbrev (String.lowercase $2,$4) } | entry Tcomma comma_field_list Trbrace { let et,key = $1 in Entry (String.lowercase et, key, $3) } ; entry: | Tentry { let et,key = $1 in Bibtex.current_key := key; (et,key) } comma_field_list: field Tcomma comma_field_list { $1::$3 } | field { [$1] } | field Tcomma { [$1] } ; field: field_name Tequal sharp_string_list { ($1,$3) } | field_name Tequal { ($1,[String ""]) } ; field_name: Tident { String.lowercase $1 } | Tcomment { "comment" } ; sharp_string_list: atom Tsharp sharp_string_list { $1::$3 } | atom { [$1] } ; atom: Tident { Id (String.lowercase $1) } | Tstring { String $1 } ; %% bibtex2html-1.97/condition.ml 0000644 0002463 0000264 00000010237 11713717752 016112 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) open Printf;; type constante = | Key | Entrytype | Field of string | Cte of string ;; type condition = | True | False | And of condition * condition | Or of condition * condition | Not of condition | Comp of constante * string * constante | Match of constante * Str.regexp | Exists of string ;; exception Unavailable;; let evaluate_constante entrytype key fields = function Key -> key | Entrytype -> entrytype | Field(f) -> begin try match List.assoc f fields with | [Bibtex.String(v)] -> Latex_accents.normalize false v | [Bibtex.Id(v)] -> v | _ -> raise Unavailable with Not_found -> raise Unavailable end | Cte(x) -> Latex_accents.normalize false x ;; let eval_comp v1 op v2 = match op with | "=" -> String.lowercase v1 = String.lowercase v2 | "<>" -> String.lowercase v1 <> String.lowercase v2 | "==" -> v1 = v2 | "!=" -> v1 <> v2 | _ -> let n1 = int_of_string v1 and n2 = int_of_string v2 in match op with | ">" -> n1 > n2 | "<" -> n1 < n2 | ">=" -> n1 >= n2 | "<=" -> n1 <= n2 | _ -> assert false ;; let rec evaluate_rec entrytype key fields = function | True -> true | False -> false | And(c1,c2) -> if evaluate_rec entrytype key fields c1 then evaluate_rec entrytype key fields c2 else false | Or(c1,c2) -> if evaluate_rec entrytype key fields c1 then true else evaluate_rec entrytype key fields c2 | Not(c) -> not (evaluate_rec entrytype key fields c) | Comp(c1,op,c2) -> begin try let v1 = evaluate_constante entrytype key fields c1 and v2 = evaluate_constante entrytype key fields c2 in try eval_comp v1 op v2 with Failure "int_of_string" -> if not !Options.quiet then begin eprintf "Warning: cannot compare non-numeric values "; eprintf "%s and %s in entry %s\n" v1 v2 key end; if !Options.warn_error then exit 2; false with Unavailable -> false end | Match(c,r) -> begin try let v = evaluate_constante entrytype key fields c in let _ = Str.search_forward r v 0 in true with Not_found -> false | Unavailable -> false end | Exists(f) -> begin try let _ = List.assoc f fields in true with Not_found -> false end ;; let evaluate_cond entrytype key fields c = try evaluate_rec entrytype key fields c with Not_found -> assert false ;; let string_of_constante = function Key -> "(key)" | Entrytype -> "(entrytype)" | Field(f) -> f | Cte(x) -> "\"" ^ x ^ "\"" ;; let rec print = function | True -> printf "true" | False -> printf "false" | And(c1,c2) -> printf "("; print c1; printf " and "; print c2; printf ")" | Or(c1,c2) -> printf "("; print c1; printf " or "; print c2; printf ")" | Not(c) -> printf "(not "; print c; printf ")" | Comp(c1,op,c2) -> printf "%s %s %s" (string_of_constante c1) op (string_of_constante c2) | Match(c,s) -> printf "%s : (regexp)" (string_of_constante c) | Exists(f) -> printf "exists %s" f ;; bibtex2html-1.97/configure 0000755 0002463 0000264 00000275204 11713717752 015510 0 ustar filliatr demons #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.67. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="bibtex.mli" ac_subst_vars='LTLIBOBJS LIBOBJS enable_doc EXE CAMLLIB OCAMLVERSION OCAMLBEST PDFLATEX PERL OCAMLDEP OCAMLLEXDOTOPT OCAMLLEX OCAMLOPTDOTOPT OCAMLCDOTOPT OCAMLOPT OCAMLC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_doc ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-doc build the PDF documentation Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5 ; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # options # Check whether --enable-doc was given. if test "${enable_doc+set}" = set; then : enableval=$enable_doc; else enable_doc=yes fi # Check for Ocaml compilers # we first look for ocamlc in the path; if not present, we abort # Extract the first word of "ocamlc", so it can be a program name with args. set dummy ocamlc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OCAMLC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLC"; then ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OCAMLC="ocamlc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLC" && ac_cv_prog_OCAMLC="no" fi fi OCAMLC=$ac_cv_prog_OCAMLC if test -n "$OCAMLC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 $as_echo "$OCAMLC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLC" = no ; then as_fn_error $? "Cannot find ocamlc." "$LINENO" 5 fi # we extract Ocaml version number and library path OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` echo "ocaml version is $OCAMLVERSION" # IMPORTANT! do not use OCAMLLIB, because it is already set under Windows CAMLLIB=`ocamlc -where` echo "ocaml library path is $CAMLLIB" case $OCAMLVERSION in 0.*|1.*|2.00|3.00*|3.01*|3.02*|3.03*|3.04*|3.05*|3.06*) as_fn_error $? "You need Objective 3.07 or later" "$LINENO" 5 ;; esac # then we look for ocamlopt; if not present, we issue a warning # if the version is not the same, we also discard it # we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not # Extract the first word of "ocamlopt", so it can be a program name with args. set dummy ocamlopt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OCAMLOPT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLOPT"; then ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OCAMLOPT="ocamlopt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLOPT" && ac_cv_prog_OCAMLOPT="no" fi fi OCAMLOPT=$ac_cv_prog_OCAMLOPT if test -n "$OCAMLOPT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5 $as_echo "$OCAMLOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi OCAMLBEST=byte if test "$OCAMLOPT" = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5 $as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking ocamlopt version" >&5 $as_echo_n "checking ocamlopt version... " >&6; } TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: differs from ocamlc; ocamlopt discarded." >&5 $as_echo "differs from ocamlc; ocamlopt discarded." >&6; } OCAMLOPT=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } OCAMLBEST=opt fi fi # checking for ocamlc.opt # Extract the first word of "ocamlc.opt", so it can be a program name with args. set dummy ocamlc.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OCAMLCDOTOPT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLCDOTOPT"; then ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OCAMLCDOTOPT="ocamlc.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLCDOTOPT" && ac_cv_prog_OCAMLCDOTOPT="no" fi fi OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT if test -n "$OCAMLCDOTOPT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5 $as_echo "$OCAMLCDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLCDOTOPT" != no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking ocamlc.opt version" >&5 $as_echo_n "checking ocamlc.opt version... " >&6; } TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: differs from ocamlc; ocamlc.opt discarded." >&5 $as_echo "differs from ocamlc; ocamlc.opt discarded." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } OCAMLC=$OCAMLCDOTOPT fi fi # checking for ocamlopt.opt if test "$OCAMLOPT" != no ; then # Extract the first word of "ocamlopt.opt", so it can be a program name with args. set dummy ocamlopt.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OCAMLOPTDOTOPT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLOPTDOTOPT"; then ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OCAMLOPTDOTOPT="ocamlopt.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLOPTDOTOPT" && ac_cv_prog_OCAMLOPTDOTOPT="no" fi fi OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT if test -n "$OCAMLOPTDOTOPT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5 $as_echo "$OCAMLOPTDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLOPTDOTOPT" != no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking ocamlc.opt version" >&5 $as_echo_n "checking ocamlc.opt version... " >&6; } TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVER" != "$OCAMLVERSION" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: differs from ocamlc; ocamlopt.opt discarded." >&5 $as_echo "differs from ocamlc; ocamlopt.opt discarded." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } OCAMLOPT=$OCAMLOPTDOTOPT fi fi fi # Extract the first word of "ocamllex", so it can be a program name with args. set dummy ocamllex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OCAMLLEX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLLEX"; then ac_cv_prog_OCAMLLEX="$OCAMLLEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OCAMLLEX="ocamllex" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLLEX" && ac_cv_prog_OCAMLLEX="no" fi fi OCAMLLEX=$ac_cv_prog_OCAMLLEX if test -n "$OCAMLLEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5 $as_echo "$OCAMLLEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLLEX" = no ; then as_fn_error $? "Cannot find ocamllex." "$LINENO" 5 else # Extract the first word of "ocamllex.opt", so it can be a program name with args. set dummy ocamllex.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OCAMLLEXDOTOPT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLLEXDOTOPT"; then ac_cv_prog_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OCAMLLEXDOTOPT="ocamllex.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLLEXDOTOPT" && ac_cv_prog_OCAMLLEXDOTOPT="no" fi fi OCAMLLEXDOTOPT=$ac_cv_prog_OCAMLLEXDOTOPT if test -n "$OCAMLLEXDOTOPT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5 $as_echo "$OCAMLLEXDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLLEXDOTOPT" != no ; then OCAMLLEX=$OCAMLLEXDOTOPT fi fi # ocamldep should also be present in the path # Extract the first word of "ocamldep", so it can be a program name with args. set dummy ocamldep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OCAMLDEP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLDEP"; then ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OCAMLDEP="ocamldep" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLDEP" && ac_cv_prog_OCAMLDEP="no" fi fi OCAMLDEP=$ac_cv_prog_OCAMLDEP if test -n "$OCAMLDEP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5 $as_echo "$OCAMLDEP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLC" = no ; then as_fn_error $? "Cannot find ocamldep." "$LINENO" 5 fi # where is perl # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PERL+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="/usr/bin/perl" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # platform { $as_echo "$as_me:${as_lineno-$LINENO}: checking platform" >&5 $as_echo_n "checking platform... " >&6; } if echo "Sys.os_type;;" | ocaml | grep -q Win32; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: win32" >&5 $as_echo "win32" >&6; } OCAMLWIN32=yes EXE=.exe else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not win32" >&5 $as_echo "not win32" >&6; } OCAMLWIN32=no EXE= fi if test "$enable_doc" = yes ; then # Extract the first word of "pdflatex", so it can be a program name with args. set dummy pdflatex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_PDFLATEX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$PDFLATEX"; then ac_cv_prog_PDFLATEX="$PDFLATEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PDFLATEX="pdflatex" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_PDFLATEX" && ac_cv_prog_PDFLATEX="no" fi fi PDFLATEX=$ac_cv_prog_PDFLATEX if test -n "$PDFLATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PDFLATEX" >&5 $as_echo "$PDFLATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$PDFLATEX" = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find pdflatex; documentation disabled." >&5 $as_echo "$as_me: WARNING: Cannot find pdflatex; documentation disabled." >&2;} enable_doc=no fi fi # substitutions to perform # Finally create all the generated files ac_config_files="$ac_config_files Makefile aux2bib" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "aux2bib") CONFIG_FILES="$CONFIG_FILES aux2bib" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi chmod a+x aux2bib chmod a-w Makefile bibtex2html-1.97/README 0000644 0002463 0000264 00000005124 11713717752 014451 0 ustar filliatr demons ************************************************************************** * bibtex2html - A BibTeX to HTML translator * * Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché * * * * This software is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public * * License version 2, as published by the Free Software Foundation. * * * * This software is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * * * See the GNU General Public License version 2 for more details * * (enclosed in the file GPL). * ************************************************************************** BibTeX2HTML is a collection of tools for producing automatically HTML documents from bibliographies written in the BibTeX format. It consists in three command line tools: - bib2bib is a filter tool that reads one or several bibliography files, filters the entries with respect to a given criterion, and outputs the list of selected keys together with a new bibliography file containing only the selected entries; - bibtex2html is a translator that reads a bibliography file and outputs two HTML documents that respectively the cited bibliography in a nice presentation, and the original BibTeX file augmented with several transparent HTML links to allow easy navigation. - aux2bib reads a .aux file as produced by LaTeX and writes to standard output a BibTeX file containing exactly the BibTeX entries refereed in the .aux file. COPYRIGHT ========= This program is distributed under the GNU GPL. See the enclosed file COPYING. INSTALLATION ============ You need Objective Caml >= 3.07 to compile the sources. 1. Configure with "./configure" 2. Compile with "make". It creates two binary files, "bibtex2html" and "bib2bib" . If you want to build the documentation, do "make doc" (You need both LaTeX and Hevea). 2. Install with "make install". You may need superuser permissions. (Note: you can also just copy the two executables in any directory of your choice) To install the doc, do "make install-doc". bibtex2html-1.97/condition.mli 0000644 0002463 0000264 00000003321 11713717752 016257 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) type constante = | Key | Entrytype | Field of string | Cte of string type condition = | True | False | And of condition * condition | Or of condition * condition | Not of condition | Comp of constante * string * constante | Match of constante * Str.regexp | Exists of string (* [(evaluate_cond e k fields cond)] returns the boolean value of [cond] with respect to the entry of type [e], of key [k], and fields [fields]. *) val evaluate_cond : string -> string -> (string * Bibtex.atom list) list -> condition -> bool val print : condition -> unit bibtex2html-1.97/COPYING 0000644 0002463 0000264 00000001045 11713717752 014622 0 ustar filliatr demons bibtex2html - BibTeX bibliography to HTML converter Copyright (C) 1997 Jean-Christophe FILLIATRE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (enclosed in the file GPL). bibtex2html-1.97/latexmacros.mli 0000644 0002463 0000264 00000004523 11713717752 016620 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s This module provides a table to store the translations of LaTeX macros. A translation is a list of actions of the following type [action]. *) (* This code is an adaptation of a code written by Xavier Leroy in 1995-1997, in its own home-made latex2html translator. See @inproceedings{Leroy-latex2html, author = "Xavier Leroy", title = "Lessons learned from the translation of documentation from \LaTeX\ to {HTML}", booktitle = "ERCIM/W4G Int. Workshop on WWW Authoring and Integration Tools", year = 1995, month = feb} *) type action = | Print of string | Print_arg | Skip_arg | Raw_arg of (string -> unit) | Parameterized of (string -> action list) | Recursive of string val def : string -> action list -> unit val find_macro: string -> action list val init_style_macros : string -> unit (*s HTML entities *) val html_entities : unit -> unit val unicode_entities : unit -> unit (*s Utility functions used in the definition of translations. *) val out_channel : out_channel ref val print_s : string -> unit val print_c : char -> unit bibtex2html-1.97/readbib.ml 0000644 0002463 0000264 00000003751 11713717752 015517 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s [(read_entries_from_file f)] returns the BibTeX entries of the BibTeX file [f]. *) open Printf let read_entries_from_file f = if not !Options.quiet then begin if f = "" then eprintf "Reading from standard input...\n" else eprintf "Reading %s..." f; flush stderr end; let chan = if f = "" then stdin else open_in f in let lb = Lexing.from_channel chan in try let el = Bibtex_parser.command_list Bibtex_lexer.token lb in if f <> "" then close_in chan; if not !Options.quiet then begin eprintf "ok (%d entries).\n" (Bibtex.size el); flush stderr end; el with Parsing.Parse_error | Failure "unterminated string" -> if f <> "" then close_in chan; eprintf "Parse error character %d, in or after entry '%s'.\n" (Lexing.lexeme_start lb) !Bibtex.current_key; flush stderr; exit 1 bibtex2html-1.97/configure.in 0000644 0002463 0000264 00000011114 11713717752 016076 0 ustar filliatr demons ########################################################################## # bibtex2html - A BibTeX to HTML translator # # Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché # # # # This software is free software; you can redistribute it and/or # # modify it under the terms of the GNU General Public # # License version 2, as published by the Free Software Foundation. # # # # This software is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # # # See the GNU General Public License version 2 for more details # # (enclosed in the file GPL). # ########################################################################## # bibtex2html autoconf input # check for one particular file of the sources AC_INIT(bibtex.mli) # options AC_ARG_ENABLE(doc, [ --enable-doc build the PDF documentation],, enable_doc=yes) # Check for Ocaml compilers # we first look for ocamlc in the path; if not present, we abort AC_CHECK_PROG(OCAMLC,ocamlc,ocamlc,no) if test "$OCAMLC" = no ; then AC_MSG_ERROR(Cannot find ocamlc.) fi # we extract Ocaml version number and library path OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` echo "ocaml version is $OCAMLVERSION" # IMPORTANT! do not use OCAMLLIB, because it is already set under Windows CAMLLIB=`ocamlc -where` echo "ocaml library path is $CAMLLIB" case $OCAMLVERSION in 0.*|1.*|2.00|3.00*|3.01*|3.02*|3.03*|3.04*|3.05*|3.06*) AC_MSG_ERROR(You need Objective 3.07 or later);; esac # then we look for ocamlopt; if not present, we issue a warning # if the version is not the same, we also discard it # we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not AC_CHECK_PROG(OCAMLOPT,ocamlopt,ocamlopt,no) OCAMLBEST=byte if test "$OCAMLOPT" = no ; then AC_MSG_WARN(Cannot find ocamlopt; bytecode compilation only.) else AC_MSG_CHECKING(ocamlopt version) TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then AC_MSG_RESULT(differs from ocamlc; ocamlopt discarded.) OCAMLOPT=no else AC_MSG_RESULT(ok) OCAMLBEST=opt fi fi # checking for ocamlc.opt AC_CHECK_PROG(OCAMLCDOTOPT,ocamlc.opt,ocamlc.opt,no) if test "$OCAMLCDOTOPT" != no ; then AC_MSG_CHECKING(ocamlc.opt version) TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then AC_MSG_RESULT(differs from ocamlc; ocamlc.opt discarded.) else AC_MSG_RESULT(ok) OCAMLC=$OCAMLCDOTOPT fi fi # checking for ocamlopt.opt if test "$OCAMLOPT" != no ; then AC_CHECK_PROG(OCAMLOPTDOTOPT,ocamlopt.opt,ocamlopt.opt,no) if test "$OCAMLOPTDOTOPT" != no ; then AC_MSG_CHECKING(ocamlc.opt version) TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVER" != "$OCAMLVERSION" ; then AC_MSG_RESULT(differs from ocamlc; ocamlopt.opt discarded.) else AC_MSG_RESULT(ok) OCAMLOPT=$OCAMLOPTDOTOPT fi fi fi AC_CHECK_PROG(OCAMLLEX,ocamllex,ocamllex,no) if test "$OCAMLLEX" = no ; then AC_MSG_ERROR(Cannot find ocamllex.) else AC_CHECK_PROG(OCAMLLEXDOTOPT,ocamllex.opt,ocamllex.opt,no) if test "$OCAMLLEXDOTOPT" != no ; then OCAMLLEX=$OCAMLLEXDOTOPT fi fi # ocamldep should also be present in the path AC_CHECK_PROG(OCAMLDEP,ocamldep,ocamldep,no) if test "$OCAMLC" = no ; then AC_MSG_ERROR(Cannot find ocamldep.) fi # where is perl AC_PATH_PROG(PERL,perl,/usr/bin/perl) # platform AC_MSG_CHECKING(platform) if echo "Sys.os_type;;" | ocaml | grep -q Win32; then AC_MSG_RESULT(win32) OCAMLWIN32=yes EXE=.exe else AC_MSG_RESULT(not win32) OCAMLWIN32=no EXE= fi if test "$enable_doc" = yes ; then AC_CHECK_PROG(PDFLATEX,pdflatex,pdflatex,no) if test "$PDFLATEX" = no ; then AC_MSG_WARN(Cannot find pdflatex; documentation disabled.) enable_doc=no fi fi # substitutions to perform AC_SUBST(OCAMLC) AC_SUBST(OCAMLOPT) AC_SUBST(OCAMLDEP) AC_SUBST(OCAMLLEX) AC_SUBST(OCAMLBEST) AC_SUBST(OCAMLVERSION) AC_SUBST(CAMLLIB) AC_SUBST(PERL) AC_SUBST(EXE) AC_SUBST(enable_doc) # Finally create all the generated files AC_OUTPUT(Makefile aux2bib) chmod a+x aux2bib chmod a-w Makefile bibtex2html-1.97/bib2bib.ml 0000644 0002463 0000264 00000021520 11713717752 015414 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) open Printf open Bibtex (* command-line arguments *) let input_file_names = ref ([] : string list) let bib_output_file_name = ref "" let php_output_file_name = ref "" let cite_output_file_name = ref "" let get_input_file_name f = input_file_names := f :: !input_file_names let condition = ref Condition.True let add_condition c = try let c = Parse_condition.condition c in condition := if !condition = Condition.True then c else Condition.And(!condition,c) with Condition_lexer.Lex_error msg -> prerr_endline ("Lexical error in condition: "^msg); exit 1 | Parsing.Parse_error -> prerr_endline "Syntax error in condition"; exit 1 let expand_abbrevs = ref false let expand_xrefs = ref false let no_comment = ref false let sort_criteria = ref [] let reverse_sort = ref false let remove_fields = ref [] let rename_field = ref "" let rename_fields = ref [] let args_spec = [ ("-ob", Arg.String (fun f -> bib_output_file_name := f), " uses as name for output bibliography file"); ("-oc", Arg.String (fun f -> cite_output_file_name := f), " uses as name for output citations file"); ("--php-output", Arg.String (fun f -> php_output_file_name := f), " outputs resulting bibliography in PHP syntax in file "); ("-c", Arg.String (add_condition)," adds as a filter condition"); ("-w", Arg.Set Options.warn_error, "stop on warning"); ("--warn-error", Arg.Set Options.warn_error, "stop on warning"); ("-d", Arg.Set Options.debug, "debug flag"); ("-q", Arg.Set Options.quiet, "quiet flag"); ("--quiet", Arg.Set Options.quiet, "quiet flag"); ("-s", Arg.String (fun s -> sort_criteria := (String.lowercase s):: !sort_criteria), " sort with respect to keys (if c=$keys) or a given field "); ("-r", Arg.Set reverse_sort, "reverse the sort order"); ("--no-comment", Arg.Unit (fun () -> no_comment := true), "do not add extra comments at beginning"); ("--remove", Arg.String (fun s -> remove_fields := (String.lowercase s):: !remove_fields), " removes the field "); ("--rename", Arg.Tuple [ Arg.Set_string rename_field ; Arg.String (fun s -> rename_fields := (String.lowercase !rename_field, String.lowercase s):: !rename_fields)], " rename field into "); ("--expand", Arg.Unit (fun () -> expand_abbrevs := true), "expand the abbreviations"); ("--expand-xrefs", Arg.Unit (fun () -> expand_xrefs := true), "expand the cross-references"); ("--version", Arg.Unit (fun () -> Copying.banner "bib2bib"; exit 0), "print version and exit"); ("--warranty", Arg.Unit (fun () -> Copying.banner "bib2bib"; Copying.copying(); exit 0), "display software warranty") ] let output_cite_file keys = if !cite_output_file_name = "" then prerr_endline "No citation file output (no file name specified)" else try let ch = open_out !cite_output_file_name in KeySet.iter (fun k -> output_string ch (k ^ "\n")) keys; close_out ch with Sys_error msg -> prerr_endline ("Cannot write output citations file (" ^ msg ^ ")"); exit 1 let output_bib_file remove rename biblio keys = try let ch = if !bib_output_file_name = "" then stdout else open_out !bib_output_file_name in let cmd = List.fold_right (fun s t -> if String.contains s ' ' then if String.contains s '\'' then " \"" ^ s ^ "\"" ^ t else " '" ^ s ^ "'" ^ t else " " ^ s ^ t) (Array.to_list Sys.argv) "" in let comments = if !no_comment then empty_biblio else add_new_entry (Comment ("Command line:" ^ cmd)) (add_new_entry (Comment ("This file has been generated by bib2bib " ^ Version.version)) empty_biblio) in let biblio = merge_biblios comments biblio in Biboutput.output_bib ~remove ~rename ~html:false ch biblio keys; if !bib_output_file_name <> "" then close_out ch with Sys_error msg -> prerr_endline ("Cannot write output bib file (" ^ msg ^ ")"); exit 1 let output_php_file remove rename biblio keys = if !php_output_file_name <> "" then try let ch = open_out !php_output_file_name in output_string ch " "; close_out ch with Biboutput.Bad_input_for_php msg -> eprintf "error while producing PHP output: %s\n" msg; exit 2 let rec make_compare_fun db criteria c1 c2 = match criteria with | [] -> 0 | field :: rem -> let comp = match field with | "$key" -> begin match (c1,c2) with | (Abbrev(s1,_),Abbrev(s2,_)) | (Entry(_,s1,_),Entry(_,s2,_)) -> compare s1 s2 | _ -> 0 end | "$type" -> begin match (c1,c2) with | (Entry(s1,_,_),Entry(s2,_,_)) -> compare s1 s2 | _ -> 0 end | "$date" -> begin match (c1,c2) with | (Entry(s1,t1,l1),Entry(s2,t2,l2)) -> Expand.date_compare db (s1,t1,Expand.expand_fields l1) (s2,t2,Expand.expand_fields l2) | _ -> 0 end | f -> begin match (c1,c2) with | (Entry(_,_,l1),Entry(_,_,l2)) -> let s1 = try match List.assoc field l1 with | [Bibtex.String(s)] -> s | [Bibtex.Id(s)] -> s | _ -> "" with Not_found -> "" and s2 = try match List.assoc field l2 with | [Bibtex.String(s)] -> s | [Bibtex.Id(s)] -> s | _ -> "" with Not_found -> "" in compare s1 s2 | _ -> 0 end in if comp = 0 then make_compare_fun db rem c1 c2 else if !reverse_sort then -comp else comp ;; let usage = "Usage: bib2bib [options] \nOptions are:" let main () = Arg.parse args_spec get_input_file_name usage; Copying.banner "bib2bib"; if !Options.debug then begin eprintf "command line:\n"; for i = 0 to pred (Array.length Sys.argv) do eprintf "%s\n" Sys.argv.(i) done; end; if !input_file_names = [] then input_file_names := [""]; if !Options.debug then begin Condition.print !condition; printf "\n" end; let all_entries = List.fold_right (fun file accu -> merge_biblios accu (Readbib.read_entries_from_file file)) !input_file_names empty_biblio in let abbrv_expanded = Bibtex.expand_abbrevs all_entries in let xref_expanded = Bibtex.expand_crossrefs abbrv_expanded in let matching_keys = Bibfilter.filter xref_expanded (fun e k f -> Condition.evaluate_cond e k f !condition) in if KeySet.cardinal matching_keys = 0 then begin eprintf "Warning: no matching reference found.\n"; if !Options.warn_error then exit 2; end; let user_expanded = if !expand_abbrevs then if !expand_xrefs then xref_expanded else abbrv_expanded else if !expand_xrefs then Bibtex.expand_crossrefs all_entries else all_entries in let needed_keys = Bibfilter.saturate user_expanded matching_keys in (* this should be to right place to sort the output bibliography *) let final_bib = if !sort_criteria = [] then user_expanded else let comp = make_compare_fun (Expand.expand user_expanded) (List.rev !sort_criteria) in eprintf "Sorting..."; let b = Bibtex.sort comp user_expanded in eprintf "done.\n"; b in output_cite_file matching_keys; output_bib_file !remove_fields !rename_fields final_bib (Some needed_keys); output_php_file !remove_fields !rename_fields final_bib (Some needed_keys) let _ = Printexc.catch main () bibtex2html-1.97/bibtex.mli 0000644 0002463 0000264 00000007725 11713717752 015562 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s A datatype for BibTeX bibliographies. *) type entry_type = string type key = string module KeySet : Set.S with type elt = key type atom = | Id of string | String of string type command = | Comment of string | Preamble of atom list | Abbrev of string * atom list | Entry of entry_type * key * (string * atom list) list type biblio (*s [empty_biblio] is an empty bibliography *) val empty_biblio : biblio (*s [add_new_entry k c b] adds an entry of key [k] and command [c] in biblio [b] and returns the new biblio. The entry [k] is supposed not to exists yet in [b]. *) val add_new_entry : command -> biblio -> biblio (*s [merge_biblios b1 b2] merges biblios [b1] and [b2]. Commands in the resulting biblio are the commands of b1, then the commands of b2, except for duplicates: any abbrev in [b2] that already exists in [b1] is ignored, and conversely every regular entries of [b1] which key exists also in [b2] is ignored. This behaviour is because abbrevs are supposed to be used by entries AFTER the definition of abbrevs, whereas regular entries are supposed to be used as crossrefs by entries BEFORE the definition of this entry. *) val merge_biblios : biblio -> biblio -> biblio (*s [find_entry k b] returns the first entry of key [k] in biblio [b]. Raises [Not_found] if no entry of this key exist. *) val find_entry : key -> biblio -> command (*s [size b] is the number of commands in [b] *) val size : biblio -> int (*s [fold f b accu] iterates [f] on the commands of [b], starting from [a]. If the commands of [b] are $c_1,\ldots,c_n$ in this order, then it computes $f ~ c_n ~ (f ~ c_{n-1} ~ \cdots ~ (f ~ c_1 ~ a)\cdots)$. *) val fold : (command -> 'a -> 'a) -> biblio -> 'a -> 'a (*s [abbrev_is_implicit k] is true when [k] is an integer or a month name. [abbrev_search k b] returns the first abbrev of key [k] in biblio [b], Raises [Not_found] if no abbrev of this key exist. *) val abbrev_is_implicit : key -> bool val find_abbrev : key -> biblio -> command (*s expansion of abbreviations. [expand_abbrevs bib] returns a new bibliography where all strings have been expanded *) val expand_abbrevs : biblio -> biblio val expand_crossrefs : biblio -> biblio (*s sorting bibliography As with the \texttt{bibsort} command of Nelson H. F. Beebe, comments are placed first, then preamble, then abbrevs, then regular entries. Within the last two categories, entries are sorted with respect to the comparison function given in argument. This function may be assumed called only on pairs of the form (Abbrev _,Abbrev _) or (Entry _, Entry _) Warning! it is up to you to provide a comparison function that will not place crossrefs before regular entries! *) val sort : (command -> command -> int) -> biblio -> biblio (* for parsing *) val current_key : string ref bibtex2html-1.97/translate.mli 0000644 0002463 0000264 00000004646 11713717752 016301 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Production of the HTML documents from the BibTeX bibliographies. *) open Bibtex (*s Translation options. *) val nodoc : bool ref val nokeys : bool ref val use_keys : bool ref val file_suffix : string ref val link_suffix : string ref val raw_url : bool ref val title : string ref val title_spec : bool ref val print_abstract : bool ref val print_keywords : bool ref val print_links : bool ref val print_header : bool ref val print_footer : bool ref val multiple : bool ref val single : bool ref val both : bool ref val user_header : string ref val user_footer : string ref val bib_entries : bool ref val input_file : string ref val output_file : string ref val use_label_name : bool ref val linebreak : bool ref val doi : bool ref val doi_prefix : string ref val eprint : bool ref val eprint_prefix : string ref val links_in_bib_file : bool ref val revkeys : bool ref type table_kind = Table | DL | NoTable val table : table_kind ref (*s Inserting links for some BibTeX fields. *) val add_field : string -> unit val add_named_field : string -> string -> unit val add_note_field : string -> unit val add_note_html_field : string -> unit (*s Production of the HTML output. *) val format_list : biblio -> (string option * (string option * string * Expand.entry) list) list -> KeySet.t option -> unit bibtex2html-1.97/bibtex2html.1 0000644 0002463 0000264 00000002300 11713717752 016070 0 ustar filliatr demons .TH BIBTEX2HTML BIB2BIB 1 .SH NAME BibTeX2HTML \- A translator of bibliography databases into HTML .SH SYNOPSIS .B bibtex2html [filename] .B bib2bib [options] .SH DESCRIPTION BibTeX2HTML is a collection of tools for automatically producing HTML documents from bibliography databases written in the BibTeX format. It consists in two command line tools: .B bib2bib is a filter tool that reads one or several bibliography files, filters the entries with respect to a given criterion, and outputs the list of selected keys together with a new bibliography file containing only the selected entries; .B bibtex2html is a translator that reads a bibliography file and outputs two HTML documents that contains respectively the cited bibliography in a nice presentation, and the original BibTeX file augmented with several transparent HTML links to allow easy navigation. .SH OPTIONS A short description of available options is displayed when programs are run with option -help. For detailed explanations, please look at the HTML documentation at the URL .I http://www.lri.fr/~filliatr/bibtex2html/doc/ .SH SEE ALSO .BR bibtex (1), .br .I http://www.lri.fr/~filliatr/bibtex2html/ bibtex2html-1.97/html.ml 0000644 0002463 0000264 00000005637 11713717752 015100 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Production of HTML syntax. *) open Printf let bgcolor = ref None let css = ref None let open_document ch ftitle = output_string ch "\n\n"; output_string ch "\n\n\n"; output_string ch " "; ftitle(); output_string ch " \n"; begin match !css with | None -> () | Some f -> fprintf ch "\n" f end; output_string ch "\n\n"; begin match !bgcolor with | None -> output_string ch "\n" | Some color -> fprintf ch "\n" color end; flush ch let close_document ch = output_string ch "\n\n"; flush ch let open_balise ch s = output_string ch ("<" ^ s ^ ">"); flush ch let close_balise ch s = output_string ch ("" ^ s ^ ">"); flush ch let open_anchor ch s = open_balise ch ("a name=\"" ^ s ^ "\"") let close_anchor ch = close_balise ch "a" let absolute_url_regexp = Str.regexp "\\(.+://\\)\\|#\\|mailto:" let is_absolute_url u = try Str.search_forward absolute_url_regexp u 0 = 0 with Not_found -> false let is_relative_url u = not (is_absolute_url u) let open_href ch s = open_balise ch ("a href=\"" ^ s ^ "\"") let close_href ch = close_balise ch "a" let open_h ch i = open_balise ch (sprintf "h%d" i) let close_h ch i = close_balise ch (sprintf "h%d" i) let open_em ch = open_balise ch "em" let close_em ch = close_balise ch "em" let open_b ch = open_balise ch "b" let close_b ch = close_balise ch "b" let paragraph ch = open_balise ch "p" let h_title ch n title = let s = sprintf "h%d" n in open_balise ch s; output_string ch title; close_balise ch s let h1_title ch s = h_title ch 1 s let h2_title ch s = h_title ch 2 s bibtex2html-1.97/bbl_lexer.mll 0000644 0002463 0000264 00000006071 11713717752 016237 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*i $Id: bbl_lexer.mll,v 1.9 2010-02-22 07:38:19 filliatr Exp $ i*) (*s Lexer to analyze \verb!.bbl! files. *) { open Lexing exception End_of_biblio let opt_ref = ref None let key = ref "" let brace_depth = ref 0 let buf = Buffer.create 1024 } rule biblio_header = parse | "\\begin{thebibliography}" '{' [^ '}']* '}' { biblio_name lexbuf } | eof { raise End_of_file } | _ { biblio_header lexbuf } and biblio_name = parse | '[' [^ ']']* ']' { let l = lexeme lexbuf in let s = String.sub l 1 (String.length l - 2) in Some s } | _ { None } and bibitem = parse | "\\end{thebibliography}" { raise End_of_biblio } | '\\' ['a'-'z']* "bibitem" { brace_depth := 0; begin try bibitem1 lexbuf with Failure "lexing: empty token" -> opt_ref := None end; bibitem2 lexbuf } | _ { bibitem lexbuf } and bibitem1 = parse | '[' { Buffer.reset buf; opt_ref := Some (bibitem1_body lexbuf) } and bibitem1_body = parse | ']' { Buffer.contents buf } | "%\n" { bibitem1_body lexbuf } | _ { Buffer.add_char buf (lexeme_char lexbuf 0); bibitem1_body lexbuf } | eof { raise End_of_file } and bibitem2 = parse | '{' { Buffer.reset buf; key := bibitem2_body lexbuf; skip_end_of_line lexbuf; Buffer.reset buf; bibitem_body lexbuf } and bibitem2_body = parse | '}' { Buffer.contents buf } | "%\n" { bibitem2_body lexbuf } | _ { Buffer.add_char buf (lexeme_char lexbuf 0); bibitem2_body lexbuf } | eof { raise End_of_file } and bibitem_body = parse | "\n\n" { let s = Buffer.contents buf in (!opt_ref, !key, s) } | eof { raise End_of_file } | "\\%" { Buffer.add_string buf "\\%"; bibitem_body lexbuf } | "%\n" { bibitem_body lexbuf } | _ { Buffer.add_char buf (lexeme_char lexbuf 0); bibitem_body lexbuf } and skip_end_of_line = parse | [' ' '\n' '\010' '\013' '\009' '\012'] + { () } | _ { skip_end_of_line lexbuf } bibtex2html-1.97/main.ml 0000644 0002463 0000264 00000046315 11713717752 015056 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Main module of bibtex2html. *) open Printf open Translate (* Options. *) let excluded = ref ([] : string list) let add_exclude k = excluded := k :: !excluded let style = ref "plain" let command = ref "bibtex -min-crossrefs=1000" type sort = Unsorted | By_date | By_author let sort = ref Unsorted let reverse_sort = ref false let ignore_bibtex_errors = ref false let expand_abbrev_in_bib_output = ref true (* Optional citation file. *) let use_cite_file = ref false let citations = ref ([] : string list) let add_citations file = try let chan = open_in file and buf = Buffer.create 1024 in try while true do Buffer.add_char buf (input_char chan) done with End_of_file -> close_in chan; citations := (Str.split (Str.regexp "[ \t\n]+") (Buffer.contents buf)) @ !citations with Sys_error msg -> prerr_endline ("Cannot open citation file (" ^ msg ^ ")"); exit 1 (*s Sorting the entries. *) module KeyMap = Map.Make(struct type t = string let compare = compare end) let keep_combine combine l1 l2 = let map = List.fold_left (fun m ((_,k,_) as e) -> KeyMap.add k e m) KeyMap.empty l2 in let rec keep_rec = function | [] -> [] | ((_,k,_) as x)::rem -> if not (List.mem k !excluded) then try let y = KeyMap.find k map in (combine x y) :: (keep_rec rem) with Not_found -> keep_rec rem else keep_rec rem in keep_rec l1 let combine_f (c,_,b) e = c,b,e let rev_combine_f x y = combine_f y x let sort_entries entries bibitems = if not !Options.quiet then begin eprintf "Sorting..."; flush stderr end; let el = if !sort = By_author then keep_combine combine_f bibitems entries else keep_combine rev_combine_f entries bibitems in let sl = if !sort = By_date then Sort.list (fun (_,_,e1) (_,_,e2) -> Expand.date_order entries e1 e2) el else el in if not !Options.quiet then begin eprintf "ok.\n"; flush stderr end; if !reverse_sort then List.rev sl else sl (* We use BibTeX itself to format the entries. Operations: \begin{enumerate} \item create an auxiliary file tmp.aux \item call bibtex on it \item read the resulting tmp.bbl file to get the formatted entries \end{enumerate} *) let create_aux_file fbib tmp = let ch = open_out (tmp ^ ".aux") in output_string ch "\\relax\n\\bibstyle{"; output_string ch !style; output_string ch "}\n"; if !use_cite_file then List.iter (fun k -> output_string ch ("\\citation{" ^ k ^ "}\n")) !citations else output_string ch "\\citation{*}\n"; output_string ch "\\bibdata{"; output_string ch (Filename.chop_suffix fbib ".bib"); output_string ch "}\n"; close_out ch let rm f = try Sys.remove f with _ -> () let clean tmp = if not !Options.debug then begin rm (tmp ^ ".aux"); rm (tmp ^ ".blg"); rm (tmp ^ ".bbl"); rm tmp end let call_bibtex tmp = if not !Options.quiet then begin eprintf "calling BibTeX..."; flush stderr end; match let redir = if !output_file = "" || !Options.quiet then match Sys.os_type with | "Win32" -> "> nul 2>&1" | _ -> "> /dev/null 2>&1" else "" in let cmd = sprintf "%s %s %s" !command tmp redir in if !Options.debug then begin eprintf "\nbibtex command: %s\n" cmd; flush stderr end; Sys.command cmd with | 0 -> if not !Options.quiet then begin eprintf "\n"; flush stderr end | n -> if !ignore_bibtex_errors then begin if not !Options.quiet then begin eprintf "error %d (ignored)\n" n; flush stderr end end else begin eprintf "error %d while running bibtex\n" n; exit n end let read_one_biblio lb = let rec read_items acc lb = try let (_,k,_) as item = Bbl_lexer.bibitem lb in if !Options.debug then begin eprintf "[%s]" k; flush stderr end; read_items (item::acc) lb with Bbl_lexer.End_of_biblio -> List.rev acc in let name = Bbl_lexer.biblio_header lb in let items = read_items [] lb in (name,items) let read_biblios lb = let rec read acc lb = try let b = read_one_biblio lb in read (b::acc) lb with End_of_file -> List.rev acc in read [] lb let read_bbl tmp = let fbbl = tmp ^ ".bbl" in if not !Options.quiet then begin eprintf "Reading %s..." fbbl; flush stderr end; let ch = open_in fbbl in let lexbuf = Lexing.from_channel ch in let biblios = read_biblios lexbuf in close_in ch; clean tmp; if not !Options.quiet then begin eprintf "ok "; List.iter (fun (_,items) -> eprintf "(%d entries)" (List.length items)) biblios; eprintf "\n"; flush stderr end; biblios let get_biblios fbib = let tmp = Filename.temp_file "bib2html" "" in try create_aux_file fbib tmp; call_bibtex tmp; read_bbl tmp with e -> clean tmp; raise e (*i let insert_title_url bib = let rec remove_assoc x = function | [] -> raise Not_found | ((y,v) as p) :: l -> if x = y then (v,l) else let (v',l') = remove_assoc x l in (v', p :: l') in let url_value = function | [Bibtex.Id u] -> u | [Bibtex.String u] -> u | _ -> raise Not_found in let modify_entry f = try let t,f' = remove_assoc "title" f in let u,f'' = remove_assoc "url" f' in let u' = Html.normalize_url (url_value u) in let nt = (Bibtex.String (sprintf "\\begin{rawhtml}\\end{rawhtml}" u')) :: t @ [Bibtex.String "\\begin{rawhtml}\\end{rawhtml}"] in ("TITLE",nt) :: f'' with Not_found -> f in Bibtex.fold (fun com bib' -> match com with | Bibtex.Entry (ty,k,f) -> Bibtex.add_new_entry (Bibtex.Entry (ty,k,modify_entry f)) bib' | _ -> Bibtex.add_new_entry com bib') bib Bibtex.empty_biblio i*) let parse_only = ref false let print_keys = ref false let translate fullname = let input_bib = Readbib.read_entries_from_file fullname in if !parse_only then exit 0; let entries = List.rev (Expand.expand input_bib) in let biblios = if fullname = "" then begin let tmp = Filename.temp_file "bibtex2htmlinput" ".bib" in let ch = open_out tmp in Biboutput.output_bib ~html:false ch input_bib None; close_out ch; let bbl = get_biblios tmp in Sys.remove tmp; bbl end else get_biblios fullname in let sb = List.map (fun (name,bibitems) -> (name,sort_entries entries bibitems)) biblios in if !print_keys then begin List.iter (fun (_,bibitems) -> List.iter (fun (_,_,(_,k,_)) -> printf "%s\n" k) bibitems) sb; flush stdout; exit 0 end; format_list (if !expand_abbrev_in_bib_output then Bibtex.expand_abbrevs input_bib else input_bib) sb (if !use_cite_file then let keys = List.fold_right (fun s e -> Bibtex.KeySet.add s e) !citations Bibtex.KeySet.empty in let keys = List.fold_right (fun s e -> Bibtex.KeySet.remove s e) !excluded keys in Some (Bibfilter.saturate input_bib keys) else None) (*s Reading macros in a file. *) let read_macros f = let chan = open_in f in let lb = Lexing.from_channel chan in Latexscan.read_macros lb; close_in chan (*s Command line parsing. *) let usage ?(error=true) () = if error then prerr_endline "bibtex2html: bad command line syntax"; (if error then prerr_endline else print_endline) " Usage: bibtex2html[filename] -s style BibTeX style (plain, alpha, ...) -c command BibTeX command (otherwise bibtex is searched in your path) -d sort by date -a sort as BibTeX (usually by author) -u unsorted i.e. same order as in .bib file (default) -r reverse the sort -revkeys entries numbered in reverse order -t title title of the HTML file (default is the filename) -bg color background color of the HTML file (default is none) -css file specify a style sheet file -o file redirect the output -header additional header in the HTML file -footer additional footer in the HTML file -i ignore BibTeX errors -both produce versions with and without abstracts -multiple produce one file per entry -single produce a single page (with BibTeX input and output) -nodoc only produces the body of the HTML documents -nokeys do not print the BibTeX keys -nolinks do not print any web link -nobiblinks do not add web links in the BibTeX output -rawurl print URL instead of file type -heveaurl use HeVeA's \\url macro -noabstract do not print the abstracts (if any) -nokeywords do not print the keywords (if any) -nodoi do not insert the DOI links -doi-prefix url set the DOI links prefix (default is http://dx.doi.org/) -noeprint do not insert the eprint links -eprint-prefix url set the eprint links prefix (default is http://arxiv.org/abs/) -linebreak add a linebreak between an entry and its links -use-table enforce the use of HTML tables (to be used after -nokeys) -noheader do not print the header (bibtex2html command) -nofooter do not print the footer (bibtex2html web link) -noexpand do not expand abbreviations in the BibTeX output -nobibsource do not produce the BibTeX entries file -fsuffix give an alternate suffix for HTML files -lsuffix give an alternate suffix for HTML links -suffix s give an alternate suffix for HTML files and links -citefile f read keys to include from file f -e key exclude an entry -m file read (La)TeX macros in file -f field add a web link for that BibTeX field -nf field name add a web link for that BibTeX field, with the supplied name -note field declare a note field -dl use DL lists instead of TABLEs -unicode use Unicode characters for some LaTeX macros (as HTML entities) -html-entities use HTML entities for some LaTeX macros -labelname use the label name when inserting a link --print-keys print the sorted bibtex keys and exit -debug verbose mode (to find incorrect BibTeX entries) -q quiet mode -w stop on warning -v print version and exit On-line documentation at http://www.lri.fr/~filliatr/bibtex2html/ "; exit (if error then 1 else 0) let parse () = let rec parse_rec = function (* General aspect of the web page *) | ("-t" | "-title" | "--title") :: s :: rem -> title := s; title_spec := true; parse_rec rem | ("-t" | "-title" | "--title") :: [] -> usage() | ("-bg" | "-background" | "--background") :: s :: rem -> Html.bgcolor := Some s; parse_rec rem | ("-bg" | "-background" | "--background") :: [] -> usage() | ("-css" | "-style-sheet" | "--style-sheet") :: f :: rem -> Html.css := Some f; parse_rec rem | ("-css" | "-style-sheet" | "--style-sheet") :: [] -> usage() | ("-header" | "--header") :: s :: rem -> user_header := s; parse_rec rem | ("-header" | "--header") :: [] -> usage() | ("-footer" | "--footer") :: s :: rem -> user_footer := s; parse_rec rem | ("-footer" | "--footer") :: [] -> usage() | ("-s" | "-style" | "--style") :: s :: rem -> style := s; parse_rec rem | ("-s" | "-style" | "--style") :: [] -> usage() | ("-noabstract" | "-no-abstract" | "--no-abstract") :: rem -> print_abstract := false; parse_rec rem | ("-nodoi" | "-no-doi" | "--no-doi") :: rem -> doi := false; parse_rec rem | ("-doi-prefix" | "--doi-prefix") :: s :: rem -> doi_prefix := s; parse_rec rem | ("-doi-prefix" | "--doi-prefix") :: [] -> usage () | ("-noeprint" | "-no-eprint" | "--no-eprint") :: rem -> eprint := false; parse_rec rem | ("-eprint-prefix" | "--eprint-prefix") :: s :: rem -> eprint_prefix := s; parse_rec rem | ("-eprint-prefix" | "--eprint-prefix") :: [] -> usage () | ("-nokeywords" | "-no-keywords" | "--no-keywords") :: rem -> print_keywords := false; parse_rec rem | ("-nolinks" | "-no-links" | "--no-links") :: rem -> print_links := false; parse_rec rem | ("-nobiblinks" | "-no-bib-links" | "--no-bib-links") :: rem -> links_in_bib_file := false; parse_rec rem | ("-nokeys" | "-no-keys" | "--no-keys") :: rem -> nokeys := true; table := NoTable; parse_rec rem | ("-use-table" | "--use-table") :: rem -> table := Table; parse_rec rem | ("-usekeys" | "-use-keys" | "--use-keys") :: rem -> use_keys := true; parse_rec rem | ("-rawurl" | "-raw-url" | "--raw-url") :: rem -> raw_url := true; parse_rec rem (*i | ("-tu" | "-titleurl" | "--title-url") :: rem -> title_url := true; parse_rec rem i*) | ("-heveaurl" | "-hevea-url" | "--hevea-url") :: rem -> Latexscan.hevea_url := true; parse_rec rem | ("-linebreak" | "--linebreak") :: rem -> linebreak := true; parse_rec rem | ("-noheader" | "-no-header" | "--no-header") :: rem -> print_header := false; parse_rec rem | ("-nofooter" | "-no-footer" | "--no-footer") :: rem -> print_footer := false; parse_rec rem | ("-f" | "-field" | "--field") :: s :: rem -> add_field s; parse_rec rem | ("-f" | "-field" | "--field") :: [] -> usage() | ("-nf" | "-named-field" | "--named-field") :: s :: name :: rem -> add_named_field s name; parse_rec rem | ("-nf" | "-named-field" | "--named-field") :: ([_] | []) -> usage() | ("-note" | "--note") :: s :: rem -> add_note_field s; parse_rec rem | ("-note" | "--note") :: [] -> usage() | ("-note-html" | "--note-html") :: s :: rem -> add_note_html_field s; parse_rec rem | ("-note-html" | "--note-html") :: [] -> usage() | ("-ln" | "-labelname" | "--labelname" | "--label-name") :: rem -> use_label_name := true; parse_rec rem | ("-multiple" | "--multiple") :: rem -> multiple := true; parse_rec rem | ("-single" | "--single") :: rem -> multiple := false; both := false; print_keywords := false; bib_entries := false; single := true; parse_rec rem | ("-both" | "--both") :: rem -> both := true; parse_rec rem | ("-dl" | "--dl") :: rem -> table := DL; parse_rec rem | ("-unicode" | "--unicode") :: rem -> Latexmacros.unicode_entities (); parse_rec rem | ("-html-entities" | "--html-entities") :: rem -> Latexscan.html_entities := true; Latexmacros.html_entities (); parse_rec rem (* Controlling the translation *) | ("-m" | "-macros-from" | "--macros-from") :: f :: rem -> read_macros f; parse_rec rem | ("-m" | "-macros-from" | "--macros-from") :: [] -> usage() (* Sorting the entries *) | ("-d" | "-sort-by-date" | "--sort-by-date") :: rem -> sort := By_date; parse_rec rem | ("-a" | "-sort-as-bibtex" | "--sort-as-bibtex") :: rem -> sort := By_author; parse_rec rem | ("-u" | "-unsorted" | "--unsorted") :: rem -> sort := Unsorted; parse_rec rem | ("-r" | "-reverse-sort" | "--reverse-sort") :: rem -> reverse_sort := not !reverse_sort; parse_rec rem | ("-revkeys" | "--revkeys") :: rem -> reverse_sort := not !reverse_sort; revkeys := true; parse_rec rem (* Options for selecting keys *) | ("-citefile" | "--citefile") :: f :: rem -> use_cite_file := true; add_citations f; parse_rec rem | ("-citefile" | "--citefile") :: [] -> usage() | ("-e" | "-exclude" | "--exclude") :: k :: rem -> add_exclude k; parse_rec rem | ("-e" | "-exclude" | "--exclude") :: [] -> usage() (* Miscellaneous options *) | ("-o" | "-output" | "--output") :: f :: rem -> output_file := f; parse_rec rem | ("-o" | "-output" | "--output") :: [] -> usage() | ("-nobibsource" | "--nobibsource") :: rem -> bib_entries := false; parse_rec rem | ("-nodoc" | "--nodoc" | "-no-doc" | "--no-doc") :: rem -> nodoc := true; parse_rec rem | ("-noexpand" | "-no-expand" | "--no-expand") :: rem -> expand_abbrev_in_bib_output := false; parse_rec rem | ("-i" | "-ignore-errors" | "--ignore-errors") :: rem -> ignore_bibtex_errors := true; parse_rec rem | ("-suffix" | "--suffix") :: s :: rem -> file_suffix := s; link_suffix := s; parse_rec rem | ("-fsuffix" | "-file-suffix" | "--file-suffix") :: s :: rem -> file_suffix := s; parse_rec rem | ("-lsuffix" | "-link-suffix" | "--link-suffix") :: s :: rem -> link_suffix := s; parse_rec rem | ("-suffix" | "--suffix" | "-fsuffix" | "--file-suffix" | "-file-suffix" | "-lsuffix" | "-link-suffix" | "--link-suffix") :: [] -> usage() | ("-c" | "-command" | "--command") :: s :: rem -> command := s; parse_rec rem | ("-c" | "-command" | "--command") :: [] -> usage() | ("-h" | "-help" | "-?" | "--help") :: rem -> usage ~error:false () | ("-v" | "-version" | "--version") :: _ -> Copying.banner "bibtex2html"; exit 0 | ("-warranty" | "--warranty") :: _ -> Copying.banner "bibtex2html"; Copying.copying(); exit 0 | ("-w" | "-warn-error" | "--warn-error") :: rem -> Options.warn_error := true; parse_rec rem | ("-q" | "-quiet" | "--quiet") :: rem -> Options.quiet := true; parse_rec rem | ("-debug" | "--debug") :: rem -> Options.debug := true; parse_rec rem | "-parse-only" :: rem -> parse_only := true; parse_rec rem | ("-print-keys" | "--print-keys") :: rem -> print_keys := true; parse_rec rem | [fbib] -> if not (Sys.file_exists fbib) then begin eprintf "%s: no such file\n" fbib; exit 1 end; let basename = Filename.basename fbib in if Filename.check_suffix basename ".bib" then (fbib, Filename.chop_suffix basename ".bib") else begin prerr_endline "bibtex2html: BibTeX file must have suffix .bib"; exit 1 end | [] -> ("","") | _ -> usage () in parse_rec (List.tl (Array.to_list Sys.argv)) (*s Main function. *) let main () = let (fbib,f) = parse () in Copying.banner "bibtex2html"; if fbib = "" then begin if not !title_spec then title := "bibtex2html output"; begin match !output_file with | "" -> bib_entries := false | "-" -> output_file := ""; bib_entries := false | _ -> () end end else begin input_file := f ^ ".bib"; begin match !output_file with | "" -> output_file := f; | "-" -> output_file := ""; bib_entries := false | _ -> () end; if not !title_spec then title := f end; Latexmacros.init_style_macros !style; (* producing the documents *) translate fbib let _ = Printexc.catch main () bibtex2html-1.97/copying.mli 0000644 0002463 0000264 00000002346 11713717752 015747 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Copyright and licence information. *) val copying : unit -> unit val banner : string -> unit bibtex2html-1.97/aux2bib.in 0000644 0002463 0000264 00000003773 11713717752 015465 0 ustar filliatr demons #!@PERL@ # auxtobib takes the name of a main .aux file (as generated by LaTeX) # as argument. It extracts all the citations contained in the aux # file, recursively descending into included aux files (as generated # by the LaTeX \include directive), and uses this list to extract a # BibTeX file containing only the cited references, including the # needed string abbreviations and crossreferences. The names of the # BibTeX files are taken from the main aux file, and are searched in # exactly the same way as done by bibtex. # # Needs bib2bib (see http://www.lri.fr/~filliatr/bibtex2html) # and kpsewhich (comes with the kpathsea library). # # Ralf Treinen . # Published under the Gnu General Public Licence, version 2. # process arguments if ( $#ARGV != 0 ) {&errorexit("Usage: aux2bib ");} $mainauxfile = $ARGV[0]; sub errorexit { print STDERR "aux2bib: @_[0]\n"; exit; } # process the aux files sub dofile { local($filename, $handle) = @_; $handle++; open($handle,$filename) || &errorexit("Cannot open file $filename"); while (<$handle>){ if (/\\\@input\{(.*)\}/) { &dofile($1,$handle); next; } if (/\\citation\{(.*)\}/) { foreach $subkey (split(/,/,$1)) { $keys{$subkey} = 0; } next; } if (/\\bibdata\{(.*)\}/) { @bibfiles = split(/,/,$1); } } close $handle; } &dofile($mainauxfile,'handle00'); # build the expression for the search condition $condfile="/tmp/aux2bib$$"; open(COND,"> $condfile") || &errorexit("Cannot open temp file $condfile"); foreach $key (keys %keys){ print COND "\$key=\"$key\" or "; } print COND "1=2\n"; close COND; # get the string of path names of the bib files $bibfilesbib = ""; foreach $bibfile (@bibfiles) { $bibfilesbib .= "$bibfile.bib " } $bibfilestring = ""; open(CMD,"kpsewhich $bibfilesbib|"); while ( ){ chop; $bibfilestring .= "$_ "; } close(CMD); # call bib2bib open(CMD,"bib2bib -c \"`cat $condfile`\" $bibfilestring|"); while ( ){print;} close(CMD); # cleanup unlink($condfile); bibtex2html-1.97/options.ml 0000644 0002463 0000264 00000002377 11713717752 015625 0 ustar filliatr demons (**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2010 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Default is no debugging and verbose mode. *) let debug = ref false let quiet = ref false let warn_error = ref false