| 1 | /* Copyright (C) 1996,1997,2000,2001, 2006, 2008 Free Software Foundation, Inc. |
| 2 | * |
| 3 | * This library is free software; you can redistribute it and/or |
| 4 | * modify it under the terms of the GNU Lesser General Public License |
| 5 | * as published by the Free Software Foundation; either version 3 of |
| 6 | * the License, or (at your option) any later version. |
| 7 | * |
| 8 | * This library is distributed in the hope that it will be useful, but |
| 9 | * 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. |
| 12 | * |
| 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., 51 Franklin Street, Fifth Floor, Boston, MA |
| 16 | * 02110-1301 USA |
| 17 | */ |
| 18 | |
| 19 | /* This is the 'main' function for the `guile' executable. It is not |
| 20 | included in libguile.a. |
| 21 | |
| 22 | Eventually, we hope this file will be automatically generated, |
| 23 | based on the list of installed, statically linked libraries on the |
| 24 | system. For now, please don't put interesting code in here. */ |
| 25 | |
| 26 | #ifdef HAVE_CONFIG_H |
| 27 | # include <config.h> |
| 28 | #endif |
| 29 | |
| 30 | #ifdef __MINGW32__ |
| 31 | # define SCM_IMPORT 1 |
| 32 | #endif |
| 33 | #include <libguile.h> |
| 34 | |
| 35 | #ifdef HAVE_CONFIG_H |
| 36 | #include <libguile/scmconfig.h> |
| 37 | #endif |
| 38 | #include <ltdl.h> |
| 39 | |
| 40 | #ifdef HAVE_WINSOCK2_H |
| 41 | #include <winsock2.h> |
| 42 | #endif |
| 43 | |
| 44 | /* Debugger interface (don't change the order of the following lines) */ |
| 45 | #define GDB_TYPE SCM |
| 46 | #include <libguile/gdb_interface.h> |
| 47 | GDB_INTERFACE; |
| 48 | |
| 49 | static void |
| 50 | inner_main (void *closure SCM_UNUSED, int argc, char **argv) |
| 51 | { |
| 52 | #ifdef __MINGW32__ |
| 53 | /* This is necessary to startup the Winsock API under Win32. */ |
| 54 | WSADATA WSAData; |
| 55 | WSAStartup (0x0202, &WSAData); |
| 56 | GDB_INTERFACE_INIT; |
| 57 | #endif /* __MINGW32__ */ |
| 58 | |
| 59 | /* module initializations would go here */ |
| 60 | scm_shell (argc, argv); |
| 61 | |
| 62 | #ifdef __MINGW32__ |
| 63 | WSACleanup (); |
| 64 | #endif /* __MINGW32__ */ |
| 65 | } |
| 66 | |
| 67 | int |
| 68 | main (int argc, char **argv) |
| 69 | { |
| 70 | scm_boot_guile (argc, argv, inner_main, 0); |
| 71 | return 0; /* never reached */ |
| 72 | } |
| 73 | |
| 74 | /* |
| 75 | Local Variables: |
| 76 | c-file-style: "gnu" |
| 77 | End: |
| 78 | */ |