On 9 April 2015 at 00:40, David Macek <[email protected]> wrote:
> Since the way to make static builds differs between build systems, maybe it'd 
> be good to work with an example.

Do you mean an example of how I build things at the moment, or what
I'm looking for? I suppose it's probably easiest if I give both :-)

At the moment, in order to build (say) libarchive (bsdtar), what I
need to do is:

Create a new /win64 directory (so I don't accidentally pick up
existing dynamic builds)
Download and unpack libiconv
Run
    export CFLAGS="-I/win64/include"
    export CPPFLAGS="-I/win64/include"
    export LDFLAGS="-L/win64/lib"
    ./configure --prefix=/win64 --build=x86_64-w64-mingw32 --disable-shared
    make install

Repeat for zlib, bzip2, gzip, xz, lzo, libxml2, libarchive

My build process also includes gmp, mpfr, libidn, openssl, and pcre,
but these may be for other builds - wget for example uses a lot of
dependencies. I haven't sorted out precisely what depends on what, or
an exact build order to create minimal dependencies, as frankly it's
too much work :-(

What I'd like to do is to grab
https://github.com/Alexpux/MINGW-packages, go into the
mingw-w64-libarchive subdirectory, and run makepkg-mingw, possibly
with some command line options or environment variables set to say
"use static versions of any dependencies".

Having to build (and potentially port) huge numbers of support
libraries, when msys2 already provides static builds of them, seems
like a huge waste of time to me :-(

I hope that clarifies what I'm asking.

> In the meantime you can check out the man pages of gcc and ld for -static and 
> -Bstatic and docs for libtool for --enable-static. Maybe they'll help.

That's more or less where I got the above process from. The variations
on -static, -Bstatic and --enable-static that I tried never seemed to
work - no matter what I tried, the build always seemed to prefer a
dynamic link if it was available. Some articles I found on
stackoverflow essentially said that the only way to avoid dynamic
linking is never to build the dynamic versions of the libraries. Which
seems to me to defeat the object of building both, and having libtool
to manage them, but I don't have enough experience with the Unix
toolset to contradict what I was told.

Thanks,
Paul

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to