Find more libraries via dllmap (#4451)
authorNikolay Amiantov <ab@fmap.me>
Thu, 2 Mar 2017 19:28:07 +0000 (22:28 +0300)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 2 Mar 2017 19:28:07 +0000 (20:28 +0100)
This allows centralized configuration of library paths. For instance,
previously setting path to libgtk-x11-2.0 won't make all parts of Mono use
provided library.

data/config.in
mcs/class/System.Windows.Forms/System.Windows.Forms/MimeIcon.cs
mcs/class/System.Windows.Forms/System.Windows.Forms/X11DesktopColors.cs
mcs/class/System/System.Media/AudioDevice.cs

index be83151429311d44e1c6d5aaa5c82df050a1aa74..282bc114950a16107bf961907b3270a3ccc90cdb 100644 (file)
        <dllmap dll="sqlite3" target="@SQLITE3@" os="!windows"/>
        <dllmap dll="libX11" target="@X11@" os="!windows" />
        <dllmap dll="libgdk-x11-2.0" target="@GDKX11@" os="!windows"/>
+       <dllmap dll="libgdk_pixbuf-2.0" target="libgdk_pixbuf-2.0.so.0" os="!windows"/>
        <dllmap dll="libgtk-x11-2.0" target="@GTKX11@" os="!windows"/>
+       <dllmap dll="libglib-2.0" target="libglib-2.0.so.0" os="!windows"/>
+       <dllmap dll="libgobject-2.0" target="libgobject-2.0.so.0" os="!windows"/>
+       <dllmap dll="libgnomeui-2" target="libgnomeui-2.so.0" os="!windows"/>
+       <dllmap dll="librsvg-2" target="librsvg-2.so.2" os="!windows"/>
        <dllmap dll="libXinerama" target="@XINERAMA@" os="!windows" />
+       <dllmap dll="libasound" target="libasound.so.2" os="!windows" />
        <dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
        <dllmap dll="libcairo-2.dll" target="libcairo.2.dylib" os="osx"/>
        <dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
index ae3622b9b6e31f7d48cbd359b3e9812e67747590..d56abff246526a806e0d990d0658dab3338ac3fb 100644 (file)
@@ -397,13 +397,13 @@ namespace System.Windows.Forms
        
        internal class GnomeUtil
        {
-               const string libgdk = "libgdk-x11-2.0.so.0";
-               const string libgdk_pixbuf = "libgdk_pixbuf-2.0.so.0";
-               const string libgtk = "libgtk-x11-2.0.so.0";
-               const string libglib = "libglib-2.0.so.0";
-               const string libgobject = "libgobject-2.0.so.0";
-               const string libgnomeui = "libgnomeui-2.so.0";
-               const string librsvg = "librsvg-2.so.2";
+               const string libgdk = "libgdk-x11-2.0";
+               const string libgdk_pixbuf = "libgdk_pixbuf-2.0";
+               const string libgtk = "libgtk-x11-2.0";
+               const string libglib = "libglib-2.0";
+               const string libgobject = "libgobject-2.0";
+               const string libgnomeui = "libgnomeui-2";
+               const string librsvg = "librsvg-2";
                
                [DllImport(librsvg)]
                static extern IntPtr rsvg_pixbuf_from_file_at_size (string file_name, int  width, int  height, out IntPtr error);
index a1389ca77c36ad96c25bf345afa686fdcd7cc3f8..a004e0cce8460e96a5bcd8bc691879e37c4e04bb 100644 (file)
@@ -267,8 +267,8 @@ namespace System.Windows.Forms {
                #endregion      // Methods
 
                #region DllImports
-               const string libgdk = "libgdk-x11-2.0.so.0";
-               const string libgtk = "libgtk-x11-2.0.so.0";
+               const string libgdk = "libgdk-x11-2.0";
+               const string libgtk = "libgtk-x11-2.0";
                
                [DllImport(libgtk)]
                static extern bool gtk_init_check (IntPtr argc, IntPtr argv);
index a1d0896dba63d84bb0927be9b160ec03b54c5996..5053aadace9566d6f38a4d7299f20b0e12e4feec 100644 (file)
@@ -92,85 +92,85 @@ namespace Mono.Audio {
                IntPtr hw_param;
                IntPtr sw_param;
                
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_open (ref IntPtr handle, string pcm_name, int stream, int mode);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_close (IntPtr handle);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_drain (IntPtr handle);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_writei (IntPtr handle, byte[] buf, int size);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_set_params (IntPtr handle, int format, int access, int channels, int rate, int soft_resample, int latency);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_state (IntPtr handle);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_prepare (IntPtr handle);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params (IntPtr handle, IntPtr param);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_malloc (ref IntPtr param);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern void snd_pcm_hw_params_free (IntPtr param);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_any (IntPtr handle, IntPtr param);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_set_access (IntPtr handle, IntPtr param, int access);
                
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_set_format (IntPtr handle, IntPtr param, int format);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_set_channels (IntPtr handle, IntPtr param, uint channel);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_set_rate_near (IntPtr handle, IntPtr param, ref uint rate, ref int dir);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_set_period_time_near (IntPtr handle, IntPtr param, ref uint period, ref int dir);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_get_period_size (IntPtr param, ref uint period, ref int dir);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_set_buffer_size_near (IntPtr handle, IntPtr param, ref uint buff_size);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_get_buffer_time_max(IntPtr param, ref uint buffer_time, ref int dir);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_set_buffer_time_near(IntPtr handle, IntPtr param, ref uint BufferTime, ref int dir);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_hw_params_get_buffer_size(IntPtr param, ref uint BufferSize);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_sw_params (IntPtr handle, IntPtr param);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_sw_params_malloc (ref IntPtr param);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern void snd_pcm_sw_params_free (IntPtr param);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_sw_params_current(IntPtr handle, IntPtr param);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_sw_params_set_avail_min(IntPtr handle, IntPtr param, uint frames);
 
-               [DllImport ("libasound.so.2")]
+               [DllImport ("libasound")]
                static extern int snd_pcm_sw_params_set_start_threshold(IntPtr handle, IntPtr param, uint StartThreshold);
 
                public AlsaDevice (string name) {