Mumit Khan <khan@xraylith.wisc.edu>
* configure.in: Handle --disable/enable-win32-registry. * install.texi: Document --disable/enable-win32-registry. * acconfig.h (ENABLE_WIN32_REGISTRY): New macro. (WIN32_REGISTRY_KEY): New macro. * prefix.c: Use to enable/disable win32-specific code. (lookup_key): Use versioned key. * configure: Regenerate. * config.in: Likewise. From-SVN: r28712
This commit is contained in:
parent
efc3b511cb
commit
f4ab28e3c6
7 changed files with 353 additions and 221 deletions
|
@ -1,3 +1,14 @@
|
|||
Sat Aug 14 15:04:06 1999 Mumit Khan <khan@xraylith.wisc.edu>
|
||||
|
||||
* configure.in: Handle --disable/enable-win32-registry.
|
||||
* install.texi: Document --disable/enable-win32-registry.
|
||||
* acconfig.h (ENABLE_WIN32_REGISTRY): New macro.
|
||||
(WIN32_REGISTRY_KEY): New macro.
|
||||
* prefix.c: Use to enable/disable win32-specific code.
|
||||
(lookup_key): Use versioned key.
|
||||
* configure: Regenerate.
|
||||
* config.in: Likewise.
|
||||
|
||||
Fri Aug 13 17:41:55 1999 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* cpplib.c (read_line_number): New fn, split out of...
|
||||
|
|
|
@ -10,6 +10,13 @@
|
|||
/* Define to 1 if NLS is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define to 1 if installation paths should be looked up in Windows32
|
||||
Registry. Ignored on non windows32 hosts. */
|
||||
#undef ENABLE_WIN32_REGISTRY
|
||||
|
||||
/* Define to be the last portion of registry key on windows hosts. */
|
||||
#undef WIN32_REGISTRY_KEY
|
||||
|
||||
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
|
||||
#undef HAVE_CATGETS
|
||||
|
||||
|
|
|
@ -11,6 +11,13 @@
|
|||
/* Define to 1 if NLS is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define to 1 if installation paths should be looked up in Windows32
|
||||
Registry. Ignored on non windows32 hosts. */
|
||||
#undef ENABLE_WIN32_REGISTRY
|
||||
|
||||
/* Define to be the last portion of registry key on windows hosts. */
|
||||
#undef WIN32_REGISTRY_KEY
|
||||
|
||||
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
|
||||
#undef HAVE_CATGETS
|
||||
|
||||
|
|
473
gcc/configure
vendored
473
gcc/configure
vendored
File diff suppressed because it is too large
Load diff
|
@ -3871,6 +3871,46 @@ AC_ARG_ENABLE(nls,
|
|||
AM_GNU_GETTEXT
|
||||
XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
|
||||
|
||||
# Windows32 Registry support for specifying GCC installation paths.
|
||||
AC_ARG_ENABLE(win32-registry,
|
||||
[ --disable-win32-registry
|
||||
Disable lookup of installation paths in the
|
||||
Registry on Windows hosts.
|
||||
--enable-win32-registry Enable registry lookup (default).
|
||||
--enable-win32-registry=KEY
|
||||
Use KEY instead of GCC version as the last portion
|
||||
of the registry key.],,)
|
||||
|
||||
AC_MSG_CHECKING(whether windows registry support is requested)
|
||||
if test x$enable_win32_registry != xno; then
|
||||
AC_DEFINE(ENABLE_WIN32_REGISTRY)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
# Check if user specified a different registry key.
|
||||
case x${enable_win32_registry} in
|
||||
x | xyes)
|
||||
# default.
|
||||
gcc_cv_win32_registry_key="$VERSION"
|
||||
;;
|
||||
xno)
|
||||
# no registry lookup.
|
||||
gcc_cv_win32_registry_key=''
|
||||
;;
|
||||
*)
|
||||
# user-specified key.
|
||||
gcc_cv_win32_registry_key="$enable_win32_registry"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x$enable_win32_registry != xno; then
|
||||
AC_MSG_CHECKING(registry key on windows hosts)
|
||||
AC_DEFINE_UNQUOTED(WIN32_REGISTRY_KEY, "$gcc_cv_win32_registry_key")
|
||||
AC_MSG_RESULT($gcc_cv_win32_registry_key)
|
||||
fi
|
||||
|
||||
# Get an absolute path to the GCC top-level source directory
|
||||
holddir=`pwd`
|
||||
cd $srcdir
|
||||
|
|
|
@ -305,6 +305,25 @@ inferior @code{catgets} interface, the GCC build procedure normally
|
|||
ignores @code{catgets} and instead uses GCC's copy of the GNU
|
||||
@code{gettext} library. The @samp{--with-catgets} option causes the
|
||||
build procedure to use the host's @code{catgets} in this situation.
|
||||
|
||||
@cindex Windows32 Registry support
|
||||
@item --enable-win32-registry
|
||||
@itemx --enable-win32-registry=@var{KEY}
|
||||
@itemx --disable-win32-registry
|
||||
The @samp{--enable-win32-registry} option enables Windows-hosted GCC
|
||||
to look up installations paths in the registry using the following key:
|
||||
|
||||
@smallexample
|
||||
@code{HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\<KEY>}
|
||||
@end smallexample
|
||||
|
||||
<KEY> defaults to GCC version number, and can be overridden by the
|
||||
@code{--enable-win32-registry=KEY} option. Vendors and distributors
|
||||
who use custom installers are encouraged to provide a different key,
|
||||
perhaps one comprised of vendor name and GCC version number, to
|
||||
avoid conflict with existing installations. This feature is enabled
|
||||
by default, and can be disabled by @code{--disable-win32-registry}
|
||||
option. This option has no effect on the other hosts.
|
||||
@end table
|
||||
|
||||
@item
|
||||
|
|
17
gcc/prefix.c
17
gcc/prefix.c
|
@ -44,9 +44,10 @@ Boston, MA 02111-1307, USA. */
|
|||
-- If this is a Win32 OS, then the Registry will be examined for
|
||||
an entry of "key" in
|
||||
|
||||
HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\
|
||||
HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\<KEY>
|
||||
|
||||
if found, that value will be used.
|
||||
if found, that value will be used. <KEY> defaults to GCC version
|
||||
string, but can be overridden at configuration time.
|
||||
|
||||
-- If not found (or not a Win32 OS), the environment variable
|
||||
key_ROOT (the value of "key" concatenated with the constant "_ROOT")
|
||||
|
@ -65,7 +66,7 @@ Boston, MA 02111-1307, USA. */
|
|||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include "prefix.h"
|
||||
|
@ -76,7 +77,7 @@ static const char *get_key_value PROTO((char *));
|
|||
static const char *translate_name PROTO((const char *));
|
||||
static char *save_string PROTO((const char *, int));
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY)
|
||||
static char *lookup_key PROTO((char *));
|
||||
static HKEY reg_key = (HKEY) INVALID_HANDLE_VALUE;
|
||||
#endif
|
||||
|
@ -101,7 +102,7 @@ get_key_value (key)
|
|||
const char *prefix = 0;
|
||||
char *temp = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY)
|
||||
prefix = lookup_key (key);
|
||||
#endif
|
||||
|
||||
|
@ -187,7 +188,7 @@ save_string (s, len)
|
|||
return result;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY)
|
||||
|
||||
/* Look up "key" in the registry, as above. */
|
||||
|
||||
|
@ -209,6 +210,10 @@ lookup_key (key)
|
|||
res = RegOpenKeyExA (reg_key, "Free Software Foundation", 0,
|
||||
KEY_READ, ®_key);
|
||||
|
||||
if (res == ERROR_SUCCESS)
|
||||
res = RegOpenKeyExA (reg_key, WIN32_REGISTRY_KEY, 0,
|
||||
KEY_READ, ®_key);
|
||||
|
||||
if (res != ERROR_SUCCESS)
|
||||
{
|
||||
reg_key = (HKEY) INVALID_HANDLE_VALUE;
|
||||
|
|
Loading…
Add table
Reference in a new issue