Minimal custom build for win64 Server app

Nikolay Sivov nsivov at codeweavers.com
Mon Feb 21 03:15:47 CST 2022



On 2/21/22 12:03, dravion at mail.de wrote:
>
> Am 21/02/2022 um 09:48 schrieb Eric Pouech:
>> Le 21/02/2022 à 09:17, dravion at mail.de a écrit :
>>> Hello everyone,
>>>
>>> I tried to read the docs and researched the Forum and Stackoverflow 
>>> for some pointers but right know i think only  a Developer can 
>>> answer this build specific Question.
>>>
>>> My Project:
>>> Right know, iam trying to package a Server App (hMailServer) for 
>>> Debian but also for MacOS which can run headless on WINE right now.
>>> It only needs the Console Subsystem or can run as Windows Service, 
>>> so there is really no X11 or GUI stuff going on. The server simply 
>>> starts with wine c:\hMailServer\Bin\hMailServer.exe or it can be 
>>> register itself as Windows Service by running 
>>> c:\hMailServer\Bin\hMailServer.exe /Register
>>>
>>> Right now, it runs on Debian11 Bullseye AMD64 and MacOS 12 Monterey 
>>> this way in 64-Bit mode (AMD64/x86_64) just fine.
>>>
>>> Now i want to package it as Debian *.deb package and MacOS *.pkg 
>>> Installer package but i dont want to interfere with a existing WINE 
>>> Installation on the
>>> target System nor i want the User for example to Setup WINE on MacOS 
>>> with brew or on Linux with apt-get ect. hMailServer is a very 
>>> popular and easy to use
>>> Windows 32 and 64-Bit Software and i want it to stay it that way, 
>>> even on Linux and MacOS.
>>>
>>> Long story short:
>>> I want to package hMailServer for Linux and MacOS and have all 
>>> dependencies for WINE aboard. I want the User to install the package 
>>> so it just runs, like it does for Windows.
>>>
>>>
>>>
>>> So i tried to built my custom WINE Version to make it as small as 
>>> possible
>>> ./configure CFLAGS="-Os" --verbose --without-x 
>>> --prefix=/opt/build/wine --disable-win16 --disable-tests 
>>> --without-freetype --without-gstreamer --without-openal 
>>> --without-gettext --without-ldap --without-vkd3d --without-netapi 
>>> --without-oss --without-opencl --without-pulse --without-usb 
>>> --without-pcap --without-vulkan --without-sane --without-sdl 
>>> --without-cups --without-krb5 --without-gphoto --without-capi 
>>> --without-fontconfig --without-udev --without-dbus --without-mingw 
>>> --without-gnutls --without-opengl -disable-win64 --without-x 
>>> --disable-winemenubuilder
>>> make & make install
>>>
>>> But even then, the resulted WINE binaries in "/opt/build/wine" are 
>>> hugh (over 700 MBytes whyle hMailServer is only 20 MBytes in total!)
>>> I think thats way to big and i want to cut it down even more.
>>>
>>> My question:
>>> Is there a clean way or undocumented build switches so i can only 
>>> bring the console Subsystem up and running without the whole other 
>>> stuff like DirectX ect?
>>>
>>> Just console subsystem running "bare streams" without X11, DirectX, 
>>> Vulkan3D ect, ect.
>>>
>>> Ok, i hope some experienced WINE Developer can give me some hints 
>>> how to cut down this 700 MByte Monster even a bit more down.
>>>
>>> Please; Dont give me tips like, let the user install WINE 
>>> completely, thats not what i want. I just want the required 
>>> dependencies for running a
>>> Windows Console (CUI) into my installer package, thats all.
>>>
>>> Thanks in advance,
>>> Dravion
>>>
>>>
>> you can use --disable-MODNAME option to configure to disable 
>> compilation of a given module
>>
>> you have then to determine which modules you don't need
>>
>> and btw :
>>
>> - you'd better don't use --without-mingw
>>
>> - the name of the prefix is kinda too generic if you want to bundle 
>> wine within your app
>>
>> - why are you targetting a 32bit build ?
>>
>> A+
>>
> Hi Eric and thanks for your fast reply!
>
> I have a 64-Built but i copied the wrong trial and error ./configure 
> snippet (i have the messy habbit documenting all my trials ;d
>
> ./configure CFLAGS="-Os" --prefix=/opt/wine --disable-win16 
> --without-x --disable-tests --without-freetype --without-gstreamer 
> --without-openal --without-gettext --without-ldap --without-vkd3d 
> --without-netapi --without-oss --without-opencl --without-pulse 
> --without-usb --without-pcap --without-vulkan --without-sane 
> --without-sdl --without-cups --without-krb5 --without-gphoto 
> --without-capi --without-fontconfig --without-udev --without-dbus 
> --without-mingw --without-gnutls --without-opengl --enable-win64
> make -j 4 && make install
>
> This is the correct one, so this works for me
>
> As you can see, i allready used the the --disable-mode switch for 
> example: --disable-tests OR --disable_win16
>
> But still, it results in this 700 MByte Monster in /opt/wine
>
> By the way, i had a hard time finding all the configure switches and i 
> wasn't abel to find more.
> Is there a Document or Wiki which documents all possible make 
> swithces? Are there anymore then
>
> --disable-win16
> --disable-tests
>
> ?
>
> If i cannot find any more ways to shrink this beast down to a resonble 
> size, i will check dependencies and delete unused DLL's but this is 
> something i dont want to do, bc i fear stuff will
> break in unpredicable ways.

Like Eric said, you can use same --disable-... options to exclude dlls 
you don't need. For example if you wanted to exclude d2d1 and dwrite, 
you'd use:

--without-d2d1 --without-dwrite

Note that dlls almost always depend on other dlls, and I believe 
--disable-... won't protect or warn you about that, you'll have to 
figure out that on your own. Such dependencies also change over time.

>
> Again, thanks for your help!
>
> Kind regards from Germany,
> Dravion
>




More information about the wine-devel mailing list