Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
[MagTek.iDynamo] Fix up native library slices
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Hogan committed Dec 4, 2014
1 parent 415753d commit d70c12c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
23 changes: 5 additions & 18 deletions MagTek.iDynamo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,23 @@ MagTek.iDynamo
These are bindings to MagTek's native iDynamo SDK for iOS from
http://www.magtek.com/support/software/programming_tools/

Building
========

Run `make' in the binding directory to build MagTek.iDynamo.dll.

Using
=====

Copy the MagTek.iDynamo.dll project in the binding directory to your
project, and add it as a reference in your project.

Building
========

Run `make' in the binding directory to build MagTek.iDynamo.dll.

Sample
======

The sample program in sample/ is a partial port of MagTek's sample iDynamo
program, it covers about half of the features in it.

ARMv7 support
=============

The downloaded static library contains duplicate symbols for ARMv7 that
results in an error when linking ARMv7 projects (e.g. for an iPad app).
The fix requires some minor surgery on the static library:
* split the .a into both an armv6 and armv7 .a (lipo -thin)
* decompress the armv7.a (ar -x)
* the duplicate will overwrite themselves, no work required
* recompress the armv7.a library (libtool -static)
* merge the (old) armv6 and the new armv7 libraries (lip -create)
* rebuild the bindings

License
=======

Expand Down
2 changes: 1 addition & 1 deletion MagTek.iDynamo/binding/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using MonoTouch.ObjCRuntime;

[assembly: LinkWith ("libMTSCRA.a", LinkTarget.ArmV6 | LinkTarget.ArmV7 | LinkTarget.Thumb, "-lc++", Frameworks = "AudioToolbox CoreGraphics ExternalAccessory", ForceLoad = true, IsCxx = true)]
[assembly: LinkWith ("libMTSCRA.a", LinkTarget.Simulator | LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Thumb, "-lc++", Frameworks = "AudioToolbox CoreGraphics ExternalAccessory", ForceLoad = true, IsCxx = true)]
8 changes: 7 additions & 1 deletion MagTek.iDynamo/binding/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ all: MagTek.iDynamo.dll
$(ZIP_VERSION).zip:
curl http://www.magtek.com/support/software/downloads/sw/$@ > $@

libMTSCRA.a: $(ZIP_VERSION).zip
libMTSCRA_ios.a: $(ZIP_VERSION).zip
unzip -p $< '$(ZIP_VERSION)/Lib/Release-iphoneos/libMTSCRA.a' > $@ || rm -f $@

libMTSCRA_sim.a: $(ZIP_VERSION).zip
unzip -p $< '$(ZIP_VERSION)/Lib/Release-iphonesimulator/libMTSCRA.a' > $@ || rm -f $@

libMTSCRA.a: libMTSCRA_ios.a libMTSCRA_sim.a
lipo -create -output $@ $^

MagTek.iDynamo.dll: Makefile MagTek.iDynamo.cs enums.cs AssemblyInfo.cs libMTSCRA.a
$(BTOUCH) -out:$@ MagTek.iDynamo.cs -s:enums.cs -x:AssemblyInfo.cs --link-with=libMTSCRA.a,libMTSCRA.a

Expand Down

0 comments on commit d70c12c

Please sign in to comment.