Roger Dannenberg | 21 Sep 2009 13:56
Picon
Favicon

Re: portmidi on Mac

Hi Nico,
    I'm also posting this to media_api to solicit other ideas. Here's 
the problem...

I've been working on portmidi and discovered (yet another) configuration 
issue. It's not particular to portmidi, but I'm not sure how people 
normally deal with this...

If I build both  dynamic (libportmidi.dylib) and static (libportmidi.a) 
libraries, they go into some directory, e.g. 
portmidi/Release/libportmidi.dylib and portmidi/Release/libportmidi.a.

Now, suppose I want a project to link with the static version. To get 
the library, the linker command is: ld .... -LRelease .... -lportmidi
where -L gives the search path and -l gives the library name. If there 
is only a static library, -lportmidi will find libportmidi.a and it is 
linked as desired. However, if there are both static and dynamic 
versions, -lportmidi will find libportmidi.dylib (a preference built 
into ld) instead of libportmidi.a. There are some indirect ways to get 
the right library, e.g. access through uniquely named symbolic links and 
use -Bstatic directives in the linker line (seems tricky to manage when 
using Xcode, CMake, or automake).

My proposal is make library flavors explicit, e.g. libportmidi_s.a and 
libportmidi_d.dylib, but I would like to hear any other suggestions.

-Roger
Atsushi Eno | 23 Sep 2009 14:50

some win32 build fixes

Hello,

I was trying to build porttime and portmidi on win32 + mingw (with the 
attached
scripts, attached) from trunk, but noticed that some recent changes 
broke them.
I created a patch to fix them (attached). Can anyone please review and 
check it in?

Atsushi Eno

gcc -mno-cygwin -mwindows -c -o pmwin.o -I ../pm_common -I ../porttime pmwin.c
gcc -mno-cygwin -mwindows -c -o pmwinmm.o -I ../pm_common -I ../porttime pmwinmm.c
gcc -mno-cygwin -mwindows -c -o portmidi.o -I ../pm_common -I ../porttime ../pm_common/portmidi.c
gcc -mno-cygwin -mwindows -c -o pmutil.o -I ../pm_common -I ../porttime ../pm_common/pmutil.c
dllwrap --target i386-mingw32 --export-all --output-def portmidi.def --implib libportmidi.a
--driver-name gcc -mno-cygwin -mwindows -I ../pm_common -I ../porttime pmwin.o pmwinmm.o portmidi.o
pmutil.o -lwinmm -L../porttime -lporttime -o portmidi.dll
# gcc -mno-cygwin -shared -o porttime.dll -no-undefined -Wl,--kill-at porttime. h porttime.c
ptwinmm.c -lwinmm
# gcc -shared -mno-cygwin -mwindows -Wl,-soname -Wl,libporttime.so.0 porttime.o ptwinmm.o -o
libportmidi.so.0.0.0 -lwinmm

gcc -mno-cygwin -mwindows -c porttime.c -o porttime.o
gcc -mno-cygwin -mwindows -c ptwinmm.c -o ptwinmm.o
dllwrap --target i386-mingw32 --export-all  --output-def porttime.def --implib libporttime.a
(Continue reading)

Roger Dannenberg | 23 Sep 2009 16:55
Picon
Favicon

Re: some win32 build fixes

Hi Atsushi,
    Thanks for your post. The recent check-ins are work-in-progress, so 
it's not unexpected that some things will be broken. I'll review the 
patch, but more changes are on the way. The API is not changing, but 
hopefully the build system and options will become more consistent and 
robust.
    -Roger

Atsushi Eno wrote:
> Hello,
>
> I was trying to build porttime and portmidi on win32 + mingw (with the 
> attached
> scripts, attached) from trunk, but noticed that some recent changes 
> broke them.
> I created a patch to fix them (attached). Can anyone please review and 
> check it in?
>
> Atsushi Eno
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> media_api mailing list
> media_api@...
> http://lists.create.ucsb.edu/mailman/listinfo/media_api

Gmane