guile: Include <config.h>, not "config.h".
[gnutls.git] / guile / src / make-enum-header.scm
blob041527dd6e04aa45c993420f6221f581bcc19bea
1 ;;; Help produce Guile wrappers for GnuTLS types.
2 ;;;
3 ;;; GNUTLS --- Guile bindings for GnuTLS.
4 ;;; Copyright (C) 2007, 2008  Free Software Foundation
5 ;;;
6 ;;; GNUTLS is free software; you can redistribute it and/or
7 ;;; modify it under the terms of the GNU Lesser General Public
8 ;;; License as published by the Free Software Foundation; either
9 ;;; version 2.1 of the License, or (at your option) any later version.
10 ;;;
11 ;;; GNUTLS is distributed in the hope that it will be useful,
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 ;;; Lesser General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU Lesser General Public
17 ;;; License along with GNUTLS; if not, write to the Free Software
18 ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20 ;;; Written by Ludovic Courtès <ludo@gnu.org>.
23 (use-modules (gnutls build enums))
26 ;;;
27 ;;; The program.
28 ;;;
30 (define (main . args)
31   (define extra? (not (null? args)))
33   (let ((port (current-output-port))
34         (enums (if (not extra?)
35                    %gnutls-enums
36                    %gnutls-extra-enums)))
37     (format port "/* Automatically generated, do not edit.  */~%~%")
38     (format port "#ifndef GUILE_GNUTLS_~aENUMS_H~%"
39             (if extra? "EXTRA_" ""))
40     (format port "#define GUILE_GNUTLS_~aENUMS_H~%"
41             (if extra? "EXTRA_" ""))
43     (format port "#ifdef HAVE_CONFIG_H~%")
44     (format port "# include <config.h>~%")
45     (format port "#endif~%~%")
46     (format port "#include <gnutls/gnutls.h>~%")
47     (format port "#include <gnutls/x509.h>~%")
49     (if extra?
50         (begin
51           (format port "#include <gnutls/extra.h>~%")
52           (format port "#include <gnutls/openpgp.h>~%")))
54     (for-each (lambda (enum)
55                 (output-enum-declarations enum port)
56                 (output-enum->c-converter enum port)
57                 (output-c->enum-converter enum port))
58               enums)
59     (format port "#endif~%")))
61 (apply main (cdr (command-line)))
63 ;;; Local Variables:
64 ;;; mode: scheme
65 ;;; coding: latin-1
66 ;;; End:
68 ;;; arch-tag: 07d834ca-e823-4663-9143-6d22704fbb5b