Ticket #57669: dylib.patch

File dylib.patch, 5.0 KB (added by ryandesign (Ryan Carsten Schmidt), 5 years ago)
  • config/darwin.mk

    Teach the configurator how to build a macOS dynamic library and link
    everything with it instead of the static library.
    old new  
    11#########################################################
    2 # Linux                                                 #
     2# macOS                                                 #
    33#########################################################
    44OBJEXT=.o
     5SHAREDLIBEXT=.dylib
     6SHAREDLIBFLAGS=-dynamiclib -install_name $(PREFIX)/lib/$(notdir $@)
    57LIBEXT=.a
    68EXEEXT=
    79F2CEXT=.c
  • configurator/taucs_config.c

    old new  
    132132  if (flags & hsource   ) return ".h";
    133133  if (flags & csource   ) return ".c";
    134134  if (flags & cilksource) return ".c";
     135  if (flags & sharedlib ) return "$(SHAREDLIBEXT)";
    135136  if (flags & lib       ) return "$(LIBEXT)";
    136137  if (flags & executable) return "$(EXEEXT)";
    137138
     
    558559
    559560      fprintf(f, "%s: $(%s_content) $(STDDEPS)\n",get_full_name(i,0),base);
    560561      fprintf(f,"\t- $(RM) %s\n",get_full_name(i,0));
     562      if ( (files[i].flags & sharedlib) ) {
     563      fprintf(f,"\t$(FC) $(FCFLAGS) $(COUTFLG)%s $(%s_content) $(SHAREDLIBFLAGS) $(LDFLAGS) $(LIBS)\n",get_full_name(i,0),base);
     564      } else {
    561565      fprintf(f,"\t$(AR) $(AOUTFLG)%s $(%s_content)\n",get_full_name(i,0),base);
    562566      fprintf(f,"\t$(RANLIB) %s\n",get_full_name(i,0));
     567      }
    563568    }
    564569
    565570    if ( (files[i].flags & executable) ) {
  • configurator/taucs_structure.h

    old new  
    6767  dcomplex = 2048,
    6868  scomplex = 4096,
    6969  dreal    = 8192,
    70   sreal    = 16384
     70  sreal    = 16384,
     71
     72  sharedlib    = 32768
    7173};
    7274
    7375int source_types = csource | fcsource   | cilksource;
     
    151158      "taucs_ccs_ops",
    152159      0
    153160    },
    154     "libtaucs",
     161    "libtaucs.1",
    155162    { "LIBLAPACK", "LIBBLAS", 0 }
    156163  },
    157164
     
    161168      "readhb",
    162169      0
    163170    },
    164     "libtaucs",
     171    "libtaucs.1",
    165172    { 0 }
    166173  },
    167174
     
    172179
    173180  { "AMD" , include, 0, { "ORDERING", 0 },
    174181    { "amdatr","amdbar","amdexa","amdhaf","amdhat","amdpre","amdtru", 0 },
    175     "libtaucs", { 0 }
     182    "libtaucs.1", { 0 }
    176183  },
    177184
    178185  { "COLAMD" , include, 0,  { "ORDERING", 0 },
    179186    { "colamd", 0 },
    180     "libtaucs", { 0 }
     187    "libtaucs.1", { 0 }
    181188  },
    182189
    183190  { "GENMMD" , include, 0, { "ORDERING", 0 },
    184191    { "genmmd", 0 },
    185     "libtaucs", { 0 }
     192    "libtaucs.1", { 0 }
    186193  },
    187194
    188195  { "ORDERING", include, 0 , { "BASE", 0 },
     
    190197      "taucs_ccs_order",
    191198      0
    192199    },
    193     "libtaucs",
     200    "libtaucs.1",
    194201    { 0 }
    195202  },
    196203
     
    199206      "taucs_linsolve",
    200207      0
    201208    },
    202     "libtaucs",
     209    "libtaucs.1",
    203210    { 0 }
    204211  },
    205212
     
    208215      "taucs_sn_llt",
    209216      0
    210217    },
    211     "libtaucs",
     218    "libtaucs.1",
    212219    { 0 }
    213220  },
    214221
    215222  { "OOC_LLT" , include, 0, { "BASE", "ADVANCED_MEMORY_OPS", 0 },
    216223    { "taucs_ccs_ooc_llt", "taucs_ooc_io", 0 },
    217     "libtaucs", { 0 }
     224    "libtaucs.1", { 0 }
    218225  },
    219226
    220227  { "OOC_LU" , include, 0, { "BASE", "ADVANCED_MEMORY_OPS", 0 },
    221228    { "taucs_ccs_ooc_lu", "taucs_ooc_io", 0 },
    222     "libtaucs", { 0 }
     229    "libtaucs.1", { 0 }
    223230  },
    224231
    225232  { "ADVANCED_MEMORY_OPS", include, 0 , { "BASE", 0 },
     
    227234      "taucs_memory",
    228235      0
    229236    },
    230     "libtaucs",
     237    "libtaucs.1",
    231238    { 0 }
    232239  },
    233240
    234241  { "VAIDYA", include, 0, { "BASE", 0 },
    235242    { "taucs_vaidya", "taucs_iter", 0 },
    236     "libtaucs", { 0 }
     243    "libtaucs.1", { 0 }
    237244  },
    238245
    239246  { "REC_VAIDYA", include, 0, { "BASE", 0 },
    240247    { "taucs_recvaidya", "taucs_iter" ,0 },
    241     "libtaucs", { 0 }
     248    "libtaucs.1", { 0 }
    242249  },
    243250
    244251  { "GREMBAN" , include, 0, { "BASE", 0 },
    245252    { "taucs_gremban", "taucs_iter" ,0 },
    246     "libtaucs", { 0 }
     253    "libtaucs.1", { 0 }
    247254  },
    248255
    249256  { "INCOMPLETE_CHOL", include, 0 , { "BASE", 0 },
     
    252259      "taucs_ccs_solve_llt",
    253260      0
    254261    },
    255     "libtaucs",
     262    "libtaucs.1",
    256263    { 0 }
    257264  },
    258265
    259266  { "ITER" , include, 0, { "BASE", 0 },
    260267    { "taucs_iter", 0 },
    261     "libtaucs", { 0 }
     268    "libtaucs.1", { 0 }
    262269  },
    263270
    264271  { "INVERSE_FACTOR" , include, 0, { "BASE", 0 },
    265272    { "taucs_ccs_xxt", 0 },
    266     "libtaucs", { 0 }
     273    "libtaucs.1", { 0 }
    267274  },
    268275
    269276  { "TESTING_PROGRAMS" , include, 0, { "TEST_DIRECT", "TEST_ITER", "TEST_MEMORY", 0 },
     
    290297      "taucs_ccs_generators",
    291298      0
    292299    },
    293     "libtaucs", { 0 }
     300    "libtaucs.1", { 0 }
    294301  },
    295302
    296303  { "MALLOC_STUBS" , include, 0, { "BASE", 0 },
     
    298305      "taucs_malloc",
    299306      0
    300307    },
    301     "libtaucs", { 0 }
     308    "libtaucs.1", { 0 }
    302309  },
    303310
    304311  { "AD_HOC_TEST" , exclude, 0, { "BASE", 0 }, /* this is for ad-hoc testing */
     
    366373  { "memory_test" , "DIRPROGS", csource },
    367374
    368375  { "libtaucs"    , "DIRLIB", lib },
     376  { "libtaucs.1"  , "DIRLIB", sharedlib | lib },
    369377
    370378  { "direct"      , "DIREXE", executable },
    371379  { "taucs_run"   , "DIREXE", executable },