1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
guile/libguile/guile.c
Neil Jerram 8510e39278 Remove GDB_INTERFACE stuff from guile's main program
The main motivation for this is wanting a successful MinGW build,
which is currently failing with:

guile-guile.o: In function `inner_main':
/home/neil/SW/Guile/ovnight/libguile/guile.c:55: undefined reference to `__imp__gdb_result'
/home/neil/SW/Guile/ovnight/libguile/guile.c:55: undefined reference to `__imp__gdb_output'
/home/neil/SW/Guile/ovnight/libguile/guile.c:55: undefined reference to `__imp__gdb_output_length'

The detailed problem here is to do with how those variables are
declared as exported from the libguile DLL and imported by the guile.c
main program.  But in fact we don't need to solve that problem because
the GDB interface is an idea that never actually happened.  So here we
just remove the offending variable references from guile.c.

For the record, Guile contains two kinds of GDB support, one of which
is real (and works, last time I tried it), and the other mythical.

The first kind is that libguile includes the utility functions
gdb_print, gdb_eval, etc., and the variable gdb_output.  These have no
purpose except for developers to use from GDB when debugging
something.  For example, if you have a SCM x and want to know what it
is, you can do:

(gdb) call gdb_print(x)
(gdb) p gdb_output

The second kind is that those utility functions are somehow declared
to GDB, and then GDB itself uses/calls them in some useful way.  This
was an interesting idea, but (AFAICT) never actually happened.

I think it's worth leaving gdb_interface.h in the repository and the
distribution, in case this idea is properly resurrected in the future.

* libguile/guile.c (top level): Remove GDB_INTERFACE declaration.
  (inner_main): Remove GDB_INTERFACE_INIT call.
2009-06-25 21:40:32 +01:00

71 lines
1.9 KiB
C

/* Copyright (C) 1996,1997,2000,2001, 2006, 2008 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* This is the 'main' function for the `guile' executable. It is not
included in libguile.a.
Eventually, we hope this file will be automatically generated,
based on the list of installed, statically linked libraries on the
system. For now, please don't put interesting code in here. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef __MINGW32__
# define SCM_IMPORT 1
#endif
#include <libguile.h>
#ifdef HAVE_CONFIG_H
#include <libguile/scmconfig.h>
#endif
#include <ltdl.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
static void
inner_main (void *closure SCM_UNUSED, int argc, char **argv)
{
#ifdef __MINGW32__
/* This is necessary to startup the Winsock API under Win32. */
WSADATA WSAData;
WSAStartup (0x0202, &WSAData);
#endif /* __MINGW32__ */
/* module initializations would go here */
scm_shell (argc, argv);
#ifdef __MINGW32__
WSACleanup ();
#endif /* __MINGW32__ */
}
int
main (int argc, char **argv)
{
scm_boot_guile (argc, argv, inner_main, 0);
return 0; /* never reached */
}
/*
Local Variables:
c-file-style: "gnu"
End:
*/