+static char *
+choose_target (argc, argv)
+ int argc;
+ char **argv;
+{
+ int i, j, jmax;
+ static char *from_outside;
+ static char *from_inside;
+ static char *argv_to_target[][2] =
+ {
+ NULL, "aixcoff-rs6000",
+ "-b32", "aixcoff-rs6000",
+ "-b64", "aixcoff64-rs6000",
+ };
+
+ jmax = 3;
+
+ from_outside = getenv (TARGET_ENVIRON);
+ if (from_outside != (char *)NULL)
+ return from_outside;
+
+ /* Set to default. */
+ from_inside = argv_to_target[0][1];
+ for (i = 1; i < argc; i++)
+ {
+ for (j = 1; j < jmax; j++)
+ {
+ if (0 == strcmp (argv[i], argv_to_target[j][0]))
+ from_inside = argv_to_target[j][1];
+ }
+ }
+
+ return from_inside;
+}
+
+