Description: change variable order to fix configuration step
 The GNAT, TARGET and PRJ_TARGET were used before their definition,
 causing wrong configuration values.
 .
 This patch is crucial whenever the top makefile is called, unless you
 override all variables on the command line so that autodetection
 never happens.
Author: Nicolas Boulenguez <nicolas@debian.org>
Forwarded: by private mail

--- a/makefile.conf
+++ b/makefile.conf
@@ -7,6 +7,19 @@
 #            $ make setup
 
 ##############################################################################
+# Tools used by AWS
+#
+CP	 	  = cp -p
+GNAT		  = gnat
+GPRBUILD	  = gprbuild
+GPRCLEAN	  = gprclean
+GPRINSTALL	  = gprinstall
+MKDIR	 	  = mkdir -p
+PYTHON            = python
+RM	 	  = rm
+SED	 	  = sed
+
+##############################################################################
 # AWS will be installed under $(prefix). Update this variable to point to
 # the install directory. By default, it is set to the current GNAT root
 # directory to have AWS project files automatically available.
@@ -20,6 +33,27 @@
 #
 TARGET = $(shell gcc -dumpmachine)
 
+# Compute PRJ_TARGET which is a simplified set for the TARGET value.
+# It can be UNIX, Darwin, Windows_NT and vxworks.
+#
+ifeq ($(strip $(findstring vxworks, $(TARGET))),vxworks)
+   PRJ_TARGET=vxworks
+else
+ifeq ($(strip $(findstring mingw32, $(TARGET))),mingw32)
+   PRJ_TARGET=Windows_NT
+else
+ifeq ($(strip $(findstring darwin, $(TARGET))),darwin)
+   PRJ_TARGET=Darwin
+else
+ifeq ($(strip $(findstring freebsd, $(TARGET))),freebsd)
+   PRJ_TARGET=freebsd
+else
+   PRJ_TARGET=UNIX
+endif
+endif
+endif
+endif
+
 ##############################################################################
 # Set to true if the AWS shared runtime must be built. If ENABLE_SHARED is
 # set to false only the static version is built. The default value is true if
@@ -124,45 +158,12 @@
 PROCESSORS	= 0
 
 ##############################################################################
-# Tools used by AWS
-#
-CP	 	  = cp -p
-GNAT		  = gnat
-GPRBUILD	  = gprbuild
-GPRCLEAN	  = gprclean
-GPRINSTALL	  = gprinstall
-MKDIR	 	  = mkdir -p
-PYTHON            = python
-RM	 	  = rm
-SED	 	  = sed
-
-##############################################################################
 # Load current setup if any
 #
 -include makefile.setup
 #  user setup
 
 ##############################################################################
-# Compute PRJ_TARGET which is a simplified set for the TARGET value.
-# It can be UNIX, Darwin, Windows_NT and vxworks.
-#
-ifeq ($(strip $(findstring vxworks, $(TARGET))),vxworks)
-   PRJ_TARGET=vxworks
-else
-ifeq ($(strip $(findstring mingw32, $(TARGET))),mingw32)
-   PRJ_TARGET=Windows_NT
-else
-ifeq ($(strip $(findstring darwin, $(TARGET))),darwin)
-   PRJ_TARGET=Darwin
-else
-ifeq ($(strip $(findstring freebsd, $(TARGET))),freebsd)
-   PRJ_TARGET=freebsd
-else
-   PRJ_TARGET=UNIX
-endif
-endif
-endif
-endif
 
 OTHER_LIBRARY_TYPE	= \
 	$(if $(filter-out static,$(DEFAULT_LIBRARY_TYPE)),static,relocatable)
