Changeset 3288 for branches


Ignore:
Timestamp:
May 2, 2007, 10:31:33 PM (18 years ago)
Author:
bird
Message:

Applied wrc.exe patch from Yuri. Fixes #159.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/src/emxomf/emxomfld.c

    r3106 r3288  
    163163   var. using any of the values WLINK, VAC365, VAC308 and LINK386. */
    164164static const char *linker_type = "VAC365";
     165
     166/* The name of the resource compiler to use.  By default, rc is used.
     167   This can be overridden with the EMXOMFLD_RC environment variable. */
     168static const char *rc_name = "rc.exe";
     169
     170/* The type of resource compiler to use. By default we assume it's
     171   IBM resource compiler. This can be overridden with the EMXOMFLD_RC_TYPE
     172   env. var. using any of the values RC, WRC. */
     173static const char *rc_type = "RC";
    165174
    166175/* Non-zero if emxomfld should automatically convert a.out objects and
     
    15261535         "    linker name or path is not supported. Quotes are not supported either.\n"
    15271536         "The default values for these two variables are VAC365 and ilink.exe.\n", stderr);
     1537  fputs ("  EMXOMFLD_RC_TYPE:\n"
     1538         "    The type of resource compiler we're using. Values: RC,WRC.\n"
     1539         "        RC       rc.exe as shipped with OS/2 or found in the Toolkit\n"
     1540         "        WRC      wrc.exe from Open Watcom v1.6 or later.\n", stderr);
     1541  fputs ("  EMXOMFLD_RC:\n"
     1542         "    Name of the resource compiler to use and optionally extra parameters.\n"
     1543         "    Spaces or quotes in the name or path are not supported.\n"
     1544         "The default values for these two variables are RC and rc.exe.\n", stderr);
    15281545  exit (1);
    15291546}
     
    18321849  t = getenv ("EMXOMFLD_TYPE");
    18331850  if (    t
    1834       &&  stricmp(t, "WLINK")
    1835       &&  stricmp(t, "VAC365")
    1836       &&  stricmp(t, "VAC308")
    1837       &&  stricmp(t, "LINK386")
     1851      &&  stricmp (t, "WLINK")
     1852      &&  stricmp (t, "VAC365")
     1853      &&  stricmp (t, "VAC308")
     1854      &&  stricmp (t, "LINK386")
    18381855      )
    18391856    fprintf (stderr, "emxomfld: warning: '%s' is an invalid value for EMXOMFLD_TYPE.\n", t);
     
    18451862    linker_name = t;
    18461863  if (opt_t)
    1847     fprintf(stderr, "*** Linker     : %s\n"
    1848                     "*** Linker type: %s\n", linker_name, linker_type);
     1864    fprintf (stderr, "*** Linker     : %s\n"
     1865                     "*** Linker type: %s\n", linker_name, linker_type);
    18491866
    18501867  /* apply object & library hacks */
     
    18571874      free (pcur->name);
    18581875      pcur->name = xstrdup(szname);
    1859       fclose(phfile);
     1876      fclose (phfile);
    18601877    }
    18611878
     
    18681885      free (pcur->name);
    18691886      pcur->name = xstrdup(szname);
    1870       fclose(phfile);
     1887      fclose (phfile);
    18711888    }
    18721889
     
    18741891
    18751892  if (!def_fname && dll_flag)
    1876     gen_deffile();
     1893    gen_deffile ();
    18771894
    18781895  /* Do the weak prelinking. Important that this is done after make_env(). */
     
    23062323  if (rc == 0 && res_fname != NULL)
    23072324    {
    2308       arg_init (TRUE);
    2309       put_arg ("rc.exe", TRUE, FALSE);
    2310       put_arg ("-n", FALSE, FALSE);
    2311       put_arg (res_fname, TRUE, FALSE);
    2312       put_arg (output_fname, TRUE, FALSE);
    2313       arg_end ();
    2314       rc = emxomfld_spawn (command_line, "Resource Linker");
    2315       if (rc < 0)
    2316         {
    2317           perror ("emxomfld: rc");
    2318           exit (2);
     2325      /* EMXOMFLD_RC_TYPE contains RC or WRC if set. If non of these
     2326         we assume RC.
     2327         EMXOMFLD_RC contains the compiler name and perhaps extra
     2328         arguments. If not set we'll use the default compiler, rc.exe. */
     2329
     2330      t = getenv ("EMXOMFLD_RC_TYPE");
     2331      if (   t
     2332          && stricmp (t, "RC")
     2333          && stricmp (t, "WRC"))
     2334        fprintf (stderr, "emxomfld: warning: '%s' is an invalid value for EMXOMFLD_RC_TYPE.\n", t);
     2335      else if (t)
     2336        rc_type = t;
     2337
     2338      t = getenv ("EMXOMFLD_RC");
     2339      if (t)
     2340        rc_name = t;
     2341      if (opt_t)
     2342        fprintf (stderr, "*** Resource compiler     : %s\n"
     2343                         "*** Resource compiler type: %s\n", rc_name, rc_type);
     2344
     2345      if (!stricmp (linker_type, "RC"))
     2346        {
     2347          arg_init (TRUE);
     2348          put_arg (rc_name, TRUE, FALSE);
     2349          put_arg ("-n", FALSE, FALSE);
     2350          put_arg (res_fname, TRUE, FALSE);
     2351          put_arg (output_fname, TRUE, FALSE);
     2352          arg_end ();
     2353          rc = emxomfld_spawn (command_line, "Resource Linker");
     2354          if (rc < 0)
     2355            {
     2356              perror ("emxomfld: rc");
     2357              exit (2);
     2358            }
     2359        }
     2360      else
     2361        {
     2362          arg_init (FALSE);
     2363          put_arg (rc_name, TRUE, FALSE);
     2364          put_arg ("-q", FALSE, FALSE);
     2365          put_arg (res_fname, TRUE, FALSE);
     2366          put_arg (output_fname, TRUE, FALSE);
     2367          arg_end ();
     2368          rc = emxomfld_spawn (command_line, "Resource Linker");
     2369          if (rc < 0)
     2370            {
     2371              perror ("emxomfld: wrc");
     2372              exit (2);
     2373            }
    23192374        }
    23202375    }
Note: See TracChangeset for help on using the changeset viewer.