From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,10baa30e2bfad6c5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-15 14:35:58 PST Path: archiver1.sj.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!proxad.net!isdnet!psinet-france!psiuk-f4!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Using Windows GNAT with Cygwin Date: Tue, 15 May 2001 17:24:17 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9ds6q3$po9$1@nh.pace.co.uk> References: <2m53gtkmvaou7ktac1jfmfmb32iuiernkm@4ax.com> NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 989961859 26377 136.170.200.133 (15 May 2001 21:24:19 GMT) X-Complaints-To: newsmaster@pace.co.uk NNTP-Posting-Date: 15 May 2001 21:24:19 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.sj.google.com comp.lang.ada:7544 Date: 2001-05-15T21:24:19+00:00 List-Id: Having just gone through this, here's another little bit of help: The following C program was written by Sune Falck to change the registry entries & can readily be run in an initialization .BAT file. I tweaked the program ever so slightly from its original design so it may not bit-for-bit match with the original if you got it from another source. MDC /* * File: select_gcc.c * * Author: Sune Falck * * Purpose: To allow egcs and gnat to coexist by changing the value * GCC under the key LOCAL_MACHINE\Software\Free Software Foundation * to the installation directory for gnat or egcs. * The installation directories must be manually set up with * REGEDIT in the values GCC_GNAT and GCC_EGCS under the same key. * * Syntax: select_gcc gnat|egcs * * Date: 1999-01-26 * * Changes: 1999-01-27 Sune Falck * Changed protection in RegOpenKeyEx because of ACCESS DENIED * error when running under Windows NT * */ #include #include #include #define WIN32_LEAN_AND_MEAN #include void Test_For_Error (int Error, char *Error_Text); int main (int argc, char **argv) { LONG rc; /* Return code */ HKEY Key; /* Key handle */ char *Prefix = "GCC_"; char Name [256]; /* Constructed key name */ char Value [256]; DWORD Value_Type; DWORD Value_Length; fprintf (stderr, "\n\n argv[0] %s argv[1] %s\n\n", argv[0], argv[1]); Test_For_Error (argc != 2, "-I-No parameter given."); /* Create a value name from GCC_ and the command parameter */ strcpy (Name, Prefix); strcat (Name, argv [1]); Value_Length = sizeof (Value); rc = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "Software\\Free Software Foundation", 0, KEY_READ|KEY_SET_VALUE, &Key); Test_For_Error (rc != ERROR_SUCCESS, "-E-Can't open registry key " "\"HKLM\\Software\\Free Software Foundation\"."); rc = RegQueryValueEx (Key, Name, 0, &Value_Type, Value, &Value_Length); Test_For_Error (rc != ERROR_SUCCESS, "-E-No saved value GCC_XXXX for given configuration."); rc = RegSetValueEx (Key, "GCC", 0, Value_Type, Value, Value_Length); Test_For_Error (rc != ERROR_SUCCESS, "-E-New value for GCC could not be stored."); RegCloseKey (Key); return EXIT_SUCCESS; } void Test_For_Error (int Error, char *Error_Text) { if (Error) { fprintf (stderr, "select_gcc%s\n\n", Error_Text); fprintf (stderr, "Switch between gnat and egcs by modifying registry\n\n" "Manually set up the values GCC_GNAT and GCC_EGCS to the\n" "installation directories for gnat and egcs with REGEDIT\n" "for the key LOCAL_MACHINE\\Software\\Free Software Foundation.\n" "Use select_gcc with gnat or egcs as parameter to switch\n" "between the compilers - the path must also be adjusted.\n"); exit (EXIT_FAILURE); } } -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Stephen Leake" wrote in message news:u3da6nx40.fsf@gsfc.nasa.gov... > Set PATH appropriately. There is also one registry setting that Cygwin > and GNAT fight over; > > HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation > > The simplest way to manage this is to use the Registry Editor to > export this key (to a .reg file) after installing Cygwin, and again > after installing GNAT. Then run the appropriate .reg file when you > need to run the compiler. > > This use of the registry is totally inappropriate, as far as I can > tell. It just gets in the way. > > You can set PATH and run the .reg file from a batch script; that > simplifies things a bit. > > -- > -- Stephe