Bug 23454

Summary: Compile 0.0.9 with MinGW
Product: nice Reporter: David Hoyt <dhoyt>
Component: GeneralAssignee: Olivier CrĂȘte <olivier.crete>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch 1
Patch 2
Patch 3
Patch 4

Description David Hoyt 2009-08-21 21:50:06 UTC
Created attachment 28844 [details] [review]
Patch 1

I've been able to get libnice to compile using mingw and gcc 4.4.0 on windows xp. It involved a few patches and then a script to do the rest. This was very quick and dirty - if you wanted to incorporate it, you would probably want to clean it up a bit. I didn't want to get into modifying the makefile, so this is just an example bash script (mine's a bit diff. due to how I have things configured):

CFLAGS="-D_SSIZE_T_ -D_WIN32_WINNT=0x0501 -I<SourceDir>/stun/"
LDFLAGS="-lwsock32 -lws2_32"
./configure --disable-static --enable-shared
make
	
#Create a shared library from the archive
cd "nice/.libs"
dlltool --export-all-symbols -D libnice-0.dll -l libnice.dll.a -z in.def libnice.a
ranlib libnice.dll.a
gcc -shared -s -mwindows -def in.def $LibFlags -o libnice-0.dll libnice.a -liphlpapi -lwsock32 -lws2_32 -lglib-2.0 -lgobject-2.0
	
cd "../../"
make install

cd "nice/.libs/"
cp -f libnice.dll.a ../../
cp -f libnice-0.dll ../../

lib.exe /name:libnice-0.dll /out:nice.lib /machine:$MSLibMachine /def:in.def
cp -f nice.lib ../../
	
#Update .la to reflect shared lib we created
cd "<InstallDir>"
sed -e "s/library_names=''/library_names='libnice.dll.a'/g" -e "s/old_library='libnice.a'/old_library=''/g" -e "s/dlname=''/dlname='..\/bin\/libnice-0.dll'/g" libnice.la > libnice.mod.la
mv -f "libnice.mod.la" "libnice.la"
Comment 1 David Hoyt 2009-08-21 21:50:33 UTC
Created attachment 28845 [details] [review]
Patch 2
Comment 2 David Hoyt 2009-08-21 21:50:46 UTC
Created attachment 28846 [details] [review]
Patch 3
Comment 3 David Hoyt 2009-08-21 21:51:03 UTC
Created attachment 28847 [details] [review]
Patch 4
Comment 4 Youness Alaoui 2010-03-18 13:02:47 UTC
Hi,
Could you please provide a proper patch. Cleaned up version of these patches, and hopefully one that doesn't require an additional script somewhere (if it's not doable, then provide the script so it can be added as a Makefile.mingw file for example).
I will merge and release a new version of libnice once I have your fixes.
Thank you.
Comment 5 Philip Withnall 2015-06-26 14:17:41 UTC
Migrated to Phabricator: http://phabricator.freedesktop.org/T118

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.