This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] to solve problems with MinGW (gcc\makefile.in, gcc\configure)


Hello list,

I try to compile the GCC 4.1.0 under a MinGW environment, and this failed.

The problem was the gcc\makefile.in

Here you will find some lines:

# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that *config.h will be found in the compilation
# subdirectory rather than in the source directory.
# -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
# currently being compiled, in both source trees, to be examined as well.
# libintl.h will be found in ../intl if we are using the included libintl.
INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
	   -I$(srcdir)/../include @INCINTL@ \
	   $(CPPINC) $(GMPINC) $(DECNUMINC)

I have removed the -I$(@D) and -I$(srcdir)/$(@D), now it could be compiled
on MinGW too.

INCLUDES = -I. -I$(srcdir) \
	   -I$(srcdir)/../include @INCINTL@ \
	   $(CPPINC) $(GMPINC) $(DECNUMINC)

Sorry, I do not know if this part was important.

============================================================================
========

If you like to use the --enable-win32-registry options, this is not working
under MinGW. The problem is the RegOpenKeyExA test from the gcc\configure.
It looks like:

/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char RegOpenKeyExA ();
int
main ()
{
RegOpenKeyExA ();
  ;
  return 0;
}

This must be changed to:

/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
#include <windows.h>
static HKEY reg_key = (HKEY) INVALID_HANDLE_VALUE;
int
main ()
 {
  LONG res;
  res = RegOpenKeyExA (HKEY_LOCAL_MACHINE, "SOFTWARE", 0,
			   KEY_READ, &reg_key);
   ;
   return 0;
 }

Now the configure will find the RegOpenKeyExA  too.

Best regards,

Michael




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]