* configure.in: Call AC_LIBLTDL_INSTALLABLE instead of
[bpt/guile.git] / libguile / guile.c
CommitLineData
e81d98ec 1/* Copyright (C) 1996,1997,2000,2001 Free Software Foundation, Inc.
0487b82f 2 *
73be1d9e
MV
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
0487b82f 7 *
73be1d9e
MV
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
0487b82f 12 *
73be1d9e
MV
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
0487b82f
JB
17
18/* This is the 'main' function for the `guile' executable. It is not
19 included in libguile.a.
20
21 Eventually, we hope this file will be automatically generated,
22 based on the list of installed, statically linked libraries on the
23 system. For now, please don't put interesting code in here. */
24
e938aff1
RB
25#if HAVE_CONFIG_H
26# include <config.h>
27#endif
28
d7db9f60 29#ifdef __MINGW32__
8f99e3f3 30# define SCM_IMPORT 1
d7db9f60 31#endif
0487b82f
JB
32#include <libguile.h>
33
4ed6bae2 34#ifdef HAVE_CONFIG_H
a0599745 35#include <libguile/scmconfig.h>
4ed6bae2 36#endif
823b4951 37#include <guile-ltdl.h>
4ed6bae2 38
f87c105a 39#ifdef HAVE_WINSOCK2_H
82893676
MG
40#include <winsock2.h>
41#endif
42
0487b82f
JB
43/* Debugger interface (don't change the order of the following lines) */
44#define GDB_TYPE SCM
45#include <libguile/gdb_interface.h>
46GDB_INTERFACE;
47
48static void
e81d98ec 49inner_main (void *closure SCM_UNUSED, int argc, char **argv)
0487b82f 50{
82893676
MG
51#ifdef __MINGW32__
52 /* This is necessary to startup the Winsock API under Win32. */
53 WSADATA WSAData;
54 WSAStartup (0x0202, &WSAData);
55 GDB_INTERFACE_INIT;
56#endif /* __MINGW32__ */
57
0487b82f
JB
58 /* module initializations would go here */
59 scm_shell (argc, argv);
82893676
MG
60
61#ifdef __MINGW32__
62 WSACleanup ();
63#endif /* __MINGW32__ */
0487b82f
JB
64}
65
66int
67main (int argc, char **argv)
68{
d0f6ceb8 69#if !defined (__MINGW32__)
c9cfbf5b
RB
70 /* libtool automagically inserts this variable into your executable... */
71 extern const scm_lt_dlsymlist lt_preloaded_symbols[];
72 scm_lt_dlpreload_default (lt_preloaded_symbols);
4ed6bae2 73#endif
0487b82f
JB
74 scm_boot_guile (argc, argv, inner_main, 0);
75 return 0; /* never reached */
76}
89e00824
ML
77
78/*
79 Local Variables:
80 c-file-style: "gnu"
81 End:
82*/