--- Makefile.orig	2005-04-28 20:10:20.000000000 +0000
+++ Makefile
@@ -71,7 +71,7 @@
 # it has to work with the ancient GNU make 3.77 (distributed with GNAT 3.15p).
 
 GCC_OPTIONS = -O2
-LD_OPTIONS  = -lasis
+LD_OPTIONS  = -L$(PREFIX)/lib/asis -lasis -L$(PREFIX)/lib/gnat_util -lgnat_util
 
 host := $(shell gcc -dumpmachine)
 
@@ -79,23 +79,10 @@ RM        := rm -f
 CP        := cp
 ADABROWSE := adabrowse
 NASTY     := nasty
-GET_GCC   := get_gcc
 EXE       :=
 CONFIGURE := adconf
 PATH_SEP  := :
 
-ifeq "$(findstring mingw32, $(host))" "mingw32"
-   # Assume we're on Windows
-   RM        := cmd.exe /c del
-   CP        := cmd.exe /c copy
-   ADABROWSE := adabrowse.exe
-   NASTY     := nasty.exe
-   GET_GCC   := get_gcc.exe
-   CONFIGURE := adconf.exe
-   EXE       := .exe
-   PATH_SEP  := ;
-endif
-
 # GNAT-specific gcc options: enable all warnings, and style checking.
 # The style checking flags are nearly as plain "-gnaty", but do not
 # check comment format, and do not require explicit specs for all
@@ -104,9 +91,6 @@ endif
 
 GNAT_OPTIONS := -gnatwa -gnaty3abefhiklmprt
 
-GET_GCC_GEN  = get_gcc.o get_gcc.ali
-GET_GCC_FULL = $(GET_GCC_GEN) get_gcc.txt get_gcc.use
-
 ifdef GNATSRC
 
 INTERNAL_GNAT_SRC  := $(subst \,/,$(subst \\,/,$(GNATSRC)))
@@ -201,14 +185,14 @@ endif
 
 all: ./config/$(CONFIGURE) run-conf
 	$(MAKE) $(ADABROWSE) \
-	ADABROWSE_GCC_LIB=$(dir $(subst \,/,$(shell $(shell ./get_gcc -gcc get_gcc.use) -print-libgcc-file-name)))adainclude \
+	ADABROWSE_GCC_LIB=$(dir $(subst \,/,$(shell ada -print-libgcc-file-name)))adainclude \
 	ADABROWSE_GNATSRC=$(INTERNAL_GNAT_SRC)
 
 # Configuration stuff. We build an executable adconf, which then figures out
 # from its parameters and by trying to compile a certain file whether or not
 # we do have project manager support.
 
-./config/$(CONFIGURE): get_gcc.use ./config/adconf.adb
+./config/$(CONFIGURE): ./config/adconf.adb
 	cd ./config; gnatmake -q -I.. adconf
 
 # If adconf is called with two argument only (i.e., GNATSRC is not set), it
@@ -223,39 +207,13 @@ all: ./config/$(CONFIGURE) run-conf
 
 run-conf:
 	cd ./config; \
-	./$(CONFIGURE) $(shell ./get_gcc -gcc get_gcc.use) \
+	./$(CONFIGURE) ada \
 	               $(ASIS_DIR) \
 	               $(INTERNAL_GNAT_SRC) \
-	               $(dir $(subst \,/,$(shell $(shell ./get_gcc -gcc get_gcc.use) -print-libgcc-file-name)))adainclude
+	               $(dir $(subst \,/,$(shell ada -print-libgcc-file-name)))adainclude
 	-cd ./config; $(CP) ad-projects-impl.ads ..
 	-cd ./config; $(CP) ad-projects-impl_yes-get_parent.adb ..
 
-# All this 'get_gcc' stuff here is GNAT specific: we try to dynamically
-# figure out the name of the gcc used by GNAT. On some systems, it
-# appears that this name is "gnatgcc", not "gcc"!
-
-get_gcc.o :
-	gnatmake -q -c -f get_gcc.adb
-
-get_gcc.ali:
-	gnatmake -q -c -f get_gcc.adb
-
-$(GET_GCC): get_gcc.o get_gcc.ali get_gcc.adb
-	gnatmake -q get_gcc
-
-# Note: the dependency below first ensures that all the files we're
-# going to delete in the rm command actually exist. This is a work-
-# around for Win 2k, where make stops because cmd.exe /c del returns
-# a failure exit code because some files may not exist. However, they
-# must not exist when we run gnatmake, or we won't have the desired
-# output in get_gcc.err. (The trick is that the first line in that
-# file will be the compile command gnatmake uses for get_gcc.adb,
-# which will start with the compiler name.)
-
-get_gcc.use: $(GET_GCC)
-	$(RM) $(GET_GCC) $(GET_GCC_GEN)
-	gnatmake get_gcc 2>get_gcc.use
-
 # Ok, finally we can build adabrowse! The first dependency handles the
 # C file in the distribution. All the others may be regenerated.
 
@@ -271,18 +229,17 @@ endif
 $(ADABROWSE): util-nl.o \
               ad-setup.ads \
               ad-projects-impl.ads ad-projects-impl_yes-get_parent.adb
-	gnatmake $(GCC_OPTIONS) adabrowse -cargs $(GNAT_OPTIONS) \
-	                                  -largs $(LD_OPTIONS)
+	gnatmake $(GCC_OPTIONS) \
+		-aI$(PREFIX)/include/asis -aO${PREFIX}/lib/asis \
+		-aI$(PREFIX)/include/gnat_util -aO/${PREFIX}/lib/gnat_util \
+		adabrowse -cargs $(GNAT_OPTIONS) -largs $(LD_OPTIONS)
 	strip $(ADABROWSE)
 
 $(NASTY): nasty.adb
 	gnatmake nasty -cargs $(GCC_OPTIONS)
 
-ad-setup.ads: get_gcc.use
-	$(shell ./get_gcc -setup get_gcc.use)
-
-util-nl.o: get_gcc.use util-nl.c
-	$(shell ./get_gcc -gcc get_gcc.use) -c $(GCC_OPTIONS) util-nl.c
+util-nl.o: util-nl.c
+	ada -c $(GCC_OPTIONS) util-nl.c
 
 clean:
 	$(RM) $(ADABROWSE) $(NASTY) $(GET_GCC) *.o *.ali
