Changeset 1115


Ignore:
Timestamp:
Jan 30, 2004, 3:53:10 AM (22 years ago)
Author:
bird
Message:

Added option -Zdll-search to enable .dll as possible shared libs.

Location:
trunk/src/emx/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/emxomf/emxomfld.c

    • Property cvs2svn:cvs-rev changed from 1.35 to 1.36
    r1114 r1115  
    5454/* Whether or not linker tracing is enabled. */
    5555static int opt_t;
     56
     57/* Whether or not to include .dll in the shared library searching. */
     58static int opt_dll_search;
    5659
    5760/* The output file name, specified by the -o option.  */
     
    844847 *      1. _dll.lib
    845848 *      2. .lib
    846  *      3. .dll
     849 *      3. .dll (optional)
    847850 *      4. _s.lib
    848851 *
     
    868871{
    869872    /* Suffix list for shared linking. */
    870     static const char *apszSharedSuff[]     = { "_dll.lib", "_dll.a", ".lib",  ".a", ".dll", "_s.lib", "_s.a", NULL };
     873    static const char *apszSharedSuff[]     = { "_dll.lib", "_dll.a", ".lib",  ".a", "_s.lib", "_s.a", NULL };
     874    /* Suffix list for shared linking with .dll. */
     875    static const char *apszSharedDllSuff[]  = { "_dll.lib", "_dll.a", ".lib",  ".a", ".dll", "_s.lib", "_s.a", NULL };
    871876    /* Suffix list for static linking. */
    872877    static const char *apszStaticSuff[]     = { "_s.lib", "_s.a", ".lib",  ".a", NULL };
     
    905910
    906911    if (!fExt)
    907         papszSuffs = fShared ? &apszSharedSuff[0] : &apszStaticSuff[0];
     912    {
     913        if (fShared)
     914            papszSuffs = opt_dll_search ? &apszSharedDllSuff[0] : &apszSharedSuff[0];
     915        else
     916            papszSuffs = &apszStaticSuff[0];
     917    }
    908918    else
    909919        papszSuffs = apszExtensionSuff;
     
    12741284  fputs ("Usage: emxomfld -o <file> [-l <lib>] [-L <libdir>] [-T <base>] [-igtsS]\n"
    12751285         "                [-Zexe] [-Zdll] [-Zstack <size>] [-Zmap[=<map_file>]]\n"
    1276          "                [-Z[no-]autoconv] [-O <option>] [-static] [-non_shared]\n"
    1277          "                [-Bstatic] [-dn] [call_shared] [-Bshared] [-dy] <file>...\n"
     1286         "                [-Z[no-]autoconv] [-Zdll-search] [-O <option>] [-static]\n"
     1287         "                [-non_shared] [-Bstatic] [-dn] [call_shared] [-Bshared]\n"
     1288         "                [-dy] <file>...\n"
    12781289         "\n", stderr);
    12791290  fputs ("Options:\n"
     
    12891300         "    The search order is then changed to: lib<name>_dll.lib, <name>_dll.lib,\n"
    12901301         "    lib<name>.lib, <name>.lib, <name>.dll, lib<name>_s.lib, <name>_s.lib.\n"
     1302         " -ZDll-search:\n"
     1303         "    Enables dlls as valid libraries from shared linking. (default disabled)\n"
    12911304         "\n", stderr);
    12921305  fputs ("Environment variables:\n"
     
    13291342#define OPT_ZNO_AUTOCONV    0x1007
    13301343  {"Zno-autoconv",0, 0, OPT_ZNO_AUTOCONV},
     1344#define OPT_ZDLL_SEARCH     0x1008
     1345  {"Zdll-search",0, 0, OPT_ZDLL_SEARCH},
    13311346/*  {"e", 1, 0, 'e'}, entry point */
    13321347  {"i", 0, 0, 'i'},
     
    15181533          break;
    15191534
     1535        case OPT_ZDLL_SEARCH:
     1536          opt_dll_search = 1;
     1537          break;
     1538
    15201539        case OPT_LIBS_STATIC:
    15211540          opt_libs_static = 1;
  • trunk/src/emx/src/ld/ld.c

    • Property cvs2svn:cvs-rev changed from 1.13 to 1.14
    r1114 r1115  
    861861int force_executable;
    862862
     863/* Whether or not to include .dll in the shared library searching. */
     864int opt_dll_search;
     865
    863866/* Keep a list of any symbols referenced from the command line (so
    864867   that error messages for these guys can be generated). This list is
     
    10951098  {"call_shared", 0, 0, OPT_LIBS_SHARED},
    10961099  {"dy", 0, 0, OPT_LIBS_SHARED},
     1100#define OPT_ZDLL_SEARCH     0x1008
     1101  {"Zdll-search",0, 0, OPT_ZDLL_SEARCH},
    10971102  {0, 0, 0, 0}
    10981103};
     
    13111316          discard_locals = DISCARD_L;
    13121317          break;
     1318
     1319        case OPT_ZDLL_SEARCH:
     1320          opt_dll_search = 1;
     1321          break;
    13131322
    13141323        case OPT_LIBS_STATIC:
     
    15901599    {
    15911600      /* !we're searching for libraries here! */
    1592       static const char *dynamic_suffs[] = { "_dll.a", ".a", ".dll", "_s.a", NULL };
    1593       static const char *static_suffs[]  = { "_s.a", ".a", NULL };
    1594       const char **suffs = entry->dynamic ? dynamic_suffs : static_suffs;
     1601      static const char *dynamic_dll_suffs[] = { "_dll.a", ".a", ".dll", "_s.a", NULL };
     1602      static const char *dynamic_suffs[]     = { "_dll.a", ".a", "_s.a", NULL };
     1603      static const char *static_suffs[]      = { "_s.a", ".a", NULL };
     1604      const char **suffs = entry->dynamic ? opt_dll_search ? dynamic_dll_suffs : dynamic_suffs  : static_suffs;
    15951605      int lenname = strlen (entry->filename);
    15961606      int i;
     
    52285238       [-nostdlib] [-o file] [-r] [-s] [-t] [-u symbol] [-x] [-y symbol]\n\
    52295239       [-z] [-A file] [-Bstatic] [-D size] [-L libdir] [-M] [-N]\n\
    5230        [-S] [-T[{text,data}] addr] [-V prefix] [-X] [file...]\n",
    5231           progname);
     5240       [-S] [-T[{text,data}] addr] [-V prefix] [-X] [-Zdll-search]\n\
     5241       [file...]\n", progname);
    52325242  exit (1);
    52335243}
Note: See TracChangeset for help on using the changeset viewer.