[Mono-dev] dllmap os/cpu selection

Paolo Molaro lupus at ximian.com
Mon Sep 18 11:28:10 EDT 2006

I just committed an update to the dllmap/dllentry parsing code to
be able to select which entry is enabled on a particular operating
system/CPU combination. Currently an application or assembly is required
to ship a different config file that provides dll name remapping for each
needed architecture and the installer needs to install the correct one
or the build process needs to be changed to generate a config file with
the correct mapping.
With the committed change most cases can be handled with a single
config file: mono will discard at runtime the mapping entries that are
designed for a different operating system and/or cpu.

As an example, the Gtk# config file could be changed to have something
like this:

  <!-- the default entry for all the sane operating systems, will be
  overriden by later more specific entries if any apply -->
  <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0"/>

  <!-- OSX wants the dylib extension -->
  <dllmap os="osx" dll="libglib-2.0-0.dll" target="libglib-2.0.0.dylib"/>

  <!-- this would not be needed if we didn't install a config file, but it
  is added here because most OSes use the first entry and it is more
  convenient to add a single entry for windows here than add an entry
  for each of the sane operating systems -->
  <dllmap os="windows" dll="libglib-2.0-0.dll" target="libglib-2.0-0.dll"/>

Similarly to the os attribute, you could use the cpu attribute (with
values like x86, ppc, sparc etc), to enable one mapping only on that
specific cpu architecture. the os and cpu attributes can be combined in
the same entry, of course.

Note that I didn't change any of the config files we use in mono
or other mono packages in svn yet: feel free to make the appropriate
changes as needed, but note that the new mono will be needed for the
feature to work (old versions of mono will just ignore the os and cpu


lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better

More information about the Mono-devel-list mailing list